Skip to main content

spec_spine_types/
lib.rs

1//! # spec-spine-types
2//!
3//! The typed data substrate for spec-spine: configuration, the spec frontmatter
4//! grammar, the authority-unit and typed-edge vocabulary, the registry DTOs,
5//! schema-version constants, and the stable [`Error`] enum.
6//!
7//! Everything here is plain, owned, `serde`-serializable data (no lifetimes,
8//! generics, or trait objects at the public boundary) so the same types back
9//! both the `spec-spine-core` engine and future FFI bindings.
10//!
11//! See `docs/design/00-architecture.md` for the design and the provenance of
12//! the ported semantics.
13//!
14//! ## Layout
15//! - [`config`]: the `spec-spine.toml` model ([`Config`]).
16//! - [`frontmatter`]: the authored grammar ([`Frontmatter`], [`parse_frontmatter`]).
17//! - [`unit`] / [`edges`]: the authority-unit and relationship vocabulary.
18//! - [`registry`]: the compiled spec-as-source DTOs ([`Registry`]).
19//! - [`version`]: schema-version constants.
20//! - [`error`]: the [`Error`] enum and its exit-code contract.
21
22pub mod attest;
23pub mod codebase;
24pub mod config;
25pub mod edges;
26pub mod error;
27pub mod frontmatter;
28pub mod registry;
29pub mod schema;
30pub mod unit;
31pub mod version;
32
33// --- curated public prelude (the names callers reach for most) ---
34
35pub use attest::{
36    ATTESTATION_SCHEMA_VERSION, CompileVerdict, CorpusAttestation, CoupleVerdict, LedgerSeal,
37    LintVerdict, ToolStamp, Verdicts,
38};
39pub use codebase::{
40    CodebaseIndex, Diagnostic, Diagnostics, ImplementingPath, IndexBuild, IndexPackageShard,
41    IndexSpecShard, LineSpan, PackageKind, PackageRecord, ResolvedLocation, ResolvedUnit,
42    SourceField, TraceMapping, TraceSource, Traceability,
43};
44pub use config::{
45    AllowlistConfig, BrandingConfig, Config, CouplingConfig, FrontmatterConfig, IndexConfig,
46    LayoutConfig, ManifestConfig, ProvenanceConfig, load_config,
47};
48pub use edges::{
49    CoAuthorityItem, ConstrainItem, ExtendItem, Origin, Provenance, ReferenceItem, RefineItem,
50    SupersedeItem, SupersedeScope, SupersedeScoped,
51};
52pub use error::{Error, Result};
53pub use frontmatter::{
54    Frontmatter, FrontmatterIssue, Implementation, KNOWN_KEYS, Risk, Status, parse_frontmatter,
55    parse_frontmatter_with, split_frontmatter,
56};
57pub use registry::{
58    Build, BuildMeta, Registry, RegistrySpecShard, Severity, SpecRecord, ValidationReport,
59    Violation,
60};
61pub use schema::{
62    BUILD_META_SCHEMA, INDEX_PACKAGE_SHARD_SCHEMA, INDEX_SCHEMA, INDEX_SPEC_SHARD_SCHEMA,
63    REGISTRY_SCHEMA, REGISTRY_SPEC_SHARD_SCHEMA,
64};
65pub use unit::Unit;
66pub use version::{
67    BUILD_META_SCHEMA_VERSION, CONFIG_VERSION, INDEX_SCHEMA_VERSION, REGISTRY_SCHEMA_VERSION,
68    parse_semver,
69};