boundver Spec Overview (v4)¶
Lockfile schema¶
- Lockfile schema identifier:
boundary-lock/v4. - Canonical schema file:
spec/boundary.lock.schema.json. - v1, v2, and v3 hash-bearing locks require regeneration; migration cannot infer the complete v4 semantic configuration from an old lockfile.
- Every lock records
boundver-semantic-config/v3and a digest covering all contract-relevant config, including boundary paths/globs/options, behavior paths, version sources, vendored copies, compatibility mode, internal and external consumers, provider declarations, slice declarations, and default/component verification policy, plus generated-artifact derivation declarations. Presentation-only componentecosystemandnoteannotations, plus boundarynoteannotations, are excluded from v3 alongside$schema.
Component facets¶
Each component includes four fingerprints:
exact: every selected tracked file in the component path, binding path, Git mode/type, and content.behavior: a cryptographic envelope over declared behavioral entries and the component boundary digest. It isnullwhen behavior is not configured.boundary: the configured provider's public contract selection. Raw path providers bind path, Git mode/type, and content; canonical providers bind their deterministic semantic representation.compat: digest derived from compatibility identity (SemVer family mode), ornullwhen no version source supplies an identity.
The intended containment hierarchy is exact ⊇ behavior ⊇ boundary. The behavior envelope enforces its boundary dependency cryptographically: any boundary digest change changes a configured behavior digest even when the declared behavior paths are disjoint.
Contract version axes¶
boundary-lock/v4identifies the persisted lock shape. It retains the v3 component entry/framing domains for exact, behavior, and compatibility fingerprints, while slice fingerprints bind both the selected mode and the member-digest map.boundver-semantic-config/v3independently identifies the normalized configuration field set and canonical digest domain.- Each built-in provider independently versions its selection, validation,
normalization, and output identity in
boundary_provider_version.
A release may advance one axis without changing the others. An identifier is never reused after its meaning changes; verification requires every recorded axis to match, and non-equivalent digests must be regenerated from source.
Version sources¶
version_source.fileis component-relative. The explicitversion_source.repo_filevariant is relative to the repository root, not the config directory. Each requires afield, uses the same captured source, and rejects globs, absolute paths, traversal, backslashes and ADS colons. They are mutually exclusive with each other and with other version source variants. Established Git repositories require tracked, regular source files; existing first-run fallback rules are unchanged.- A component may inherit the resolved version of another configured component.
Resolution uses the same captured source, is transitive, and rejects unknown
targets, self-references, and cycles. The identity relation does not create a
consumer edge; impact routing remains governed by
consumers. - A component may declare a bounded explicit SemVer constant. The declaration participates in the semantic config digest and is intended for identities with no repository-owned manifest or tag.
- Compat slices consume the resolved compatibility fingerprint without
distinguishing which version-source form supplied it. The source declaration
participates in the semantic-config identity; opting into
repo_filechanges that declaration but does not redefine existing digests or lock structure. - File-backed version fields are textual identifiers in JSON, TOML and YAML. Numeric values, booleans, nulls, mappings and sequences are rejected: parser conversion must not change a version's source spelling. Numeric data elsewhere in a JSON/YAML document still uses the bounded JSON decimal grammar (no plus sign, leading zeroes, separators, alternate bases, or sexagesimal notation), with integers limited to 4,300 decimal digits.
- TOML parsing is provided by the standard library
or the required
tomlicompatibility dependency. YAML version sources require theyamlextra. If an authoritative parser is unavailable, extraction fails closed rather than applying a partial regex grammar. - External version bytes do not implicitly become component exact, behavior or boundary inputs. They affect the resolved version and compatibility identity. Changed-path reporting includes file readers and transitive version inheritors (and any owning component); unknown paths retain conservative full selection. Full lock integrity is still verified. Component diagnostics can name the currently declared external version file without classifying it as boundary content or claiming deployment/compatibility proof.
- A numeric run longer than 640 significant digits anywhere in a TOML config or version-source document is rejected before parsing, including when the selected version field is a valid string. Digits inside strings and comments are not numeric tokens.
Slice model¶
- A slice has a mode (
exact,behavior,boundary, orcompat) and exactly one membership declaration: an explicitcomponentsset, orclosure_ofa configured component. closure_ofresolves to the seed plus every configured component reachable by following downstreamconsumersedges. Resolution is sorted and cycle-safe, and the resolved membership is persisted in the lock entry.- Its fingerprint is the digest of its mode and selected component-digest map; it is stable only while both remain unchanged.
- Adding unrelated components does not change a slice unless its declaration or membership changes; those declaration changes are still visible through the lock's semantic config digest.
Strict configuration validation and generation reject a slice whose selected
member facet is null. Validation resolves closure_of before checking every
member, so a downstream component cannot introduce a late generation failure.
generate --allow-partial relaxes only that intentional null slice input; it
does not suppress missing declarations, provider/version errors, or vendored
copy failures. validate-config --allow-partial applies the same static slice
availability relaxation without generating a lock.
Consumer graph¶
components.<name>.consumersis a unique list of configured component names directly downstream of<name>. Unknown names and self-edges are invalid.external_consumersis a unique list of opaque non-component terminal labels. A terminal cannot alias a configured component.- Direct consumer reporting is the default.
verify --transitiveandwhy --transitivefollow internal edges, include external terminals declared by the source and every reached component, deduplicate results, and terminate safely on cycles.
Verification policy¶
- An explicit CLI
--facetslist applies to every component. - Otherwise
components.<name>.verify_facetsoverridesdefaults.verify_facetsfor that component. - With no explicit/configured policy, the implicit fallback is every facet available for the component; intentional null facets do not make that fallback fail.
- If CLI, component, or default policy selects an unavailable locked/current
facet, verification is a usage error (exit
2). - A slice is gated when its mode is selected by the CLI policy, or, without a CLI policy, by at least one resolved member's effective component policy.
Verification baseline ratchet¶
verify --write-baseline PATHis an explicit create-only operation.--update-baseline PATHis shrink-only and refuses any newly observed violation identity. Neither operation silently updates the lock.- Only component-facet mismatches, slice-facet mismatches, and their affected-
consumer annotations are baselinable. Metadata, configuration, structure,
provider/digest, vendored-copy, unavailable-facet, and unclassified failures
are never independently acknowledged. When a current component
compatmismatch is known, its same-componentversionandsemvermetadata lines are ancillary observations of that mismatch and are covered only while the compat mismatch is present; no metadata identity is stored. - Identities exclude changing digest values but the baseline binds the complete canonical lock digest, project, lock/config contract identifiers, source, verification scope, consumer traversal, and effective facet policy.
- Applying a baseline removes known identities from the gated failure set. Newly observed identities retain their ordinary exit severity; stale stored identities are reported for explicit shrink-only cleanup.
- The stored format is
boundver-verify-baseline/v1, described byspec/verify-baseline.schema.json, and is bounded to 10,000 identities.
Determinism¶
- Hash framing, Git modes/types, source snapshots, path/glob selection,
ordering, canonicalization, failure behavior, and semantic config hashing are
defined in
spec/HASHING.md. - Any implementation following that contract produces matching digests for an equivalent config and repository/source state.
Source modes¶
head: one captured committed tree resolved from HEAD at operation start.index: one captured index tree written at operation start.working-tree: one captured tracked path set with current disk content and mode/type observations.
For head and index, config and the verification lock are read from that
same captured source, not from a different working-tree view. Generation writes
the new lock to the working tree. An index workflow therefore stages source,
derived output, and config before generation, then stages the lock before
verification.
Machine-readable CLI output¶
Canonical schemas live in spec/cli-output.*.schema.json. verify, status,
coverage, diff, discover, why, slice, and historical review support
--format json;
migrate-lock --explain also supports a bounded JSON selector audit.
discover --diff-config adds a deterministic registered/unregistered path
comparison to the discovery payload. Baseline-aware verification adds its
action, acknowledged issues, stale identities, and shrink delta under the
optional baseline member.
Declaration coverage uses boundver-declaration-coverage/v2. It reports
unselected component paths and unowned source-indicator paths, binds them to
the selected config source and responsible JSON Pointer, and separates
reasoned exclusions from uncovered paths. Coverage policy is intentionally
absent from the semantic-config projection: this read-only advisory cannot
change a component, slice, or lock identity.
The v2 scope records selected components, literal path prefixes, and whether
ownership was analyzed. Component filtering disables repository-wide ownership
analysis; path-prefix filtering narrows both applicable analyses. Config
validation is not narrowed. complete means completed analysis in that scope,
not exhaustive path presentation or whole-repository coverage. Presentation
records total/shown/omitted entries, truncation, summary mode and path/byte
limits. Counts include every in-scope finding, while path arrays may be shorter.
Strict exit 1 and ok: false depend on all uncovered findings, including omitted
ones. Exceeding a genuine work/result budget exits 2 without partial success.
An unchanged file omitted in two facets contributes two path entries. The v1
and v2 array-completeness contracts are not interchangeable.
diff is a non-mutating review surface. It accepts canonical
boundary-lock/v4 inputs using boundver-semantic-config/v3, reports metadata
transitions under changed_metadata, and does not relabel or trust a historical
digest as current. Different lock schemas,
unknown semantic contracts, and structures whose changes cannot be represented
by the diff output contract are rejected before comparison. Generation and
verification outputs use semantic-config/v3: full generation recomputes it from
repository content, while verification and generation paths that reuse an
existing lock reject every older contract.
Historical range output uses the versioned boundver-review/v1 contract. It
binds two reconciled v4/v3 config-lock pairs to explicit immutable commit/tree
identities, compares every facet, and records conservative base/target consumer
edge provenance plus slice impact. Boundary transitions also carry a typed,
provider/version/digest-bound structural report. The first supported report is
canonical OpenAPI JSON-tree drift: value-free RFC 6901 paths classified as
added, removed, or changed. Unsupported and over-budget explanations contain no
partial rows and have their own completeness state; they do not weaken the
complete facet/impact result. Structural evidence is not a compatibility
verdict. The command is read-only and returns success for any complete range
analysis; ordinary verification remains the integrity gate.
review --format plan projects that same captured result into the versioned
boundver-plan/v1 CI contract. It preserves endpoint provenance, policy,
changed facets, conservative consumer/slice impact, structural completeness,
and deterministic changed/impacted/test selections while omitting historical
fingerprint pairs that a scheduler does not need. Its claim is routing evidence
only. Bounded human summaries and Action outputs may truncate explicitly; the
complete plan file never contains a partial closure.
Derived artifacts¶
The config may declare data-only relations between tracked generator inputs,
generated boundary outputs, a unique evidence path, and a logical generator
identity. record-derivation writes a bounded receipt for one explicit source
view. Validation, generation, and verification fail closed unless the receipt
matches both selected file sets and the declaration. Every output must belong
to a component boundary and to at most one derivation.
No repository-configured generator is executed. A receipt detects stale or post-recording files; it is not an execution authorization, provenance signature, or correctness proof.
Forward approach¶
boundaryterminology is canonical; there is no legacy alias expansion in spec language.- A semantic change advances the narrowest recorded contract axis described above; no lock, semantic-config, or provider identifier is silently overloaded.