docs: rivet <-> spar variant binding contract v1 (proposed)#144
Merged
Conversation
Defines the interchange format and CLI contract between rivet (feature-model + variant truth) and spar (HIR consumer + analyses). Key decisions captured: - rivet owns the entire PLE model; spar does not parse feature/variant files - AADL/SysML2 source files remain variant-agnostic; binding is external - Intersection semantics when multiple bindings match one item - Symbol bindings include textually-nested contents; not inherited via extends - Explicit form (rivet emits JSON, spar reads via --variant-context) and implicit form (spar --variant <name> shells out to rivet) both supported - v1 schema is stable; v2+ adds fields only; readers must ignore unknowns Coordinates with ongoing rivet rework so the binding layer has a concrete contract to implement against. No spar code changes yet; consumer crate lands alongside Track B implementation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Apr 25, 2026
avrabe
added a commit
that referenced
this pull request
Apr 25, 2026
…I integration (#154) Closes the v0.7.0 Track A milestone: - COMPLIANCE.md "In progress / v0.7.0" expanded into a full narrative covering all four Track A commits (foundation #145, hierarchical RTA #147, Lean convergence #148, this close-out), the Track B variant- contract foundation (#144), v0.7.x infrastructure landings (#141-143, #151), and v0.8.0 planning anchors (Track D #149/#152, Track E #150/#153). - Updated header date to 2026-04-25 and crate count from "16 crates, 1200+ tests" to "17 crates, 1900+ tests" reflecting the test growth through Track A and the v0.7.x infrastructure additions. - New CLI integration test crates/spar-cli/tests/track_a_close_out.rs exercises the full parse → instance → analyze pipeline on a model using the Spar_Timing::ISR_* property surface plus a sporadic handler thread. The unit + fixture tests in spar-analysis cover the algorithm at the analysis-crate level; this test guards the property surface flowing through the CLI binary end-to-end. Out-of-scope items explicitly recorded: PIP/PCP blocking deferred to v0.7.1, multi-processor ISR migration deferred, cache-aware interference inflation deferred to v1.0+. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 25, 2026
Merged
avrabe
added a commit
that referenced
this pull request
Apr 26, 2026
…t v1 (Track B commit 1)
New crate spar-variants implements the consumer side of the v1 contract
(docs/contracts/rivet-spar-variant-v1.md). Reads rivet's resolved-variant
JSON blob, exposes a `keep_in_variant` predicate that applies intersection-
semantics binding rules to HIR items, and validates strict version
matching ("1" only — v2 readers refused per contract).
No CLI integration in this commit (--variant flag wiring lands when
rivet's emitter side ships and we have an end-to-end test loop). No
HasBindingIdentity impls for spar-hir-def types yet — adapter ships
with the CLI commit. Stub types are used in unit tests.
Per Track B contract v1 (#144).
New requirement: REQ-VARIANT-001.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
avrabe
added a commit
that referenced
this pull request
Apr 26, 2026
…t v1 (Track B commit 1) (#162) New crate spar-variants implements the consumer side of the v1 contract (docs/contracts/rivet-spar-variant-v1.md). Reads rivet's resolved-variant JSON blob, exposes a `keep_in_variant` predicate that applies intersection- semantics binding rules to HIR items, and validates strict version matching ("1" only — v2 readers refused per contract). No CLI integration in this commit (--variant flag wiring lands when rivet's emitter side ships and we have an end-to-end test loop). No HasBindingIdentity impls for spar-hir-def types yet — adapter ships with the CLI commit. Stub types are used in unit tests. Per Track B contract v1 (#144). New requirement: REQ-VARIANT-001. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proposed interchange contract between rivet (feature-model + variant-config truth) and spar (HIR consumer).
Background
Decided in design discussion (2026-04-23) that spar should not duplicate rivet's PLE machinery. Instead:
This avoids parallel feature-parsing code in two tools and matches the Bazel
select()pattern (binding lives outside the source).What the contract defines
rivet_spar_context_version: "1",features,bindings, etc.)rivet resolve | spar check --variant-context -) and implicit (spar check --variant X) formsrivet resolve,rivet variants list)Why now
You're reworking rivet to be the generic artifact-to-feature binding layer (Rust/Cargo/AADL/…). Locking a concrete contract now lets both tools implement against it instead of shipping in parallel and meeting in the middle.
Scope
Documentation only. No code changes. The consumer crate
spar-variantslands as part of Track B of the v0.7.0 plan once this contract is confirmed.Open items (non-blocking for v1)
Test plan
🤖 Generated with Claude Code