Skip to content

feat(moves): rivet variant integration in verify/enumerate (Track E commit 6/8)#173

Open
avrabe wants to merge 2 commits intomainfrom
feat/v0.8.0-track-e-commit6-variants
Open

feat(moves): rivet variant integration in verify/enumerate (Track E commit 6/8)#173
avrabe wants to merge 2 commits intomainfrom
feat/v0.8.0-track-e-commit6-variants

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 27, 2026

Summary

  • Adds --variant NAME and --variant-context PATH flags to both spar moves verify and spar moves enumerate, per the v1 contract in docs/contracts/rivet-spar-variant-v1.md. The flags are mutually exclusive; explicit form accepts a filesystem path or - for stdin; implicit form shells out to rivet resolve --variant NAME --format spar-context-json (located via $RIVET_BIN then $PATH).
  • Wires spar-variants (Track B v0.7.x consumer crate, PR feat(variants): spar-variants consumer crate for rivet variant context v1 (Track B commit 1) #162) into the move-oracle pipeline. New variants_bridge module provides HasBindingIdentity adapters for ComponentInstance and a non-mutating VariantScope wrapper that exposes lookup-time accessors over the (SystemInstance, VariantContext) pair so dropped components are excluded from --component/--to resolution and from the candidate-target set in enumerate — without rebuilding the instance.
  • JSON output gains top-level variant + feature_model_hash fields for the audit trail; text output prefixes the summary line with (variant=<name>).
  • New REQ-MIGRATION-008 and TEST-MOVES-VARIANT rivet artifacts; clear errors for the rivet-not-found, unknown-version, mutually-exclusive-flags, and dropped-by-variant cases.

Test plan

  • cargo build --workspace clean
  • cargo test --workspace green (all crates passing, including 8 new tests in crates/spar-cli/tests/moves_variant.rs and 4 new unit tests in variants_bridge::tests)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • rivet validate PASS (91 pre-existing INFO-level schema warnings unrelated to this commit)
  • Existing 10 moves_verify and 10 moves_enumerate integration tests still pass — variant flags are additive
  • Implicit-form rivet shell-out verified via SPAR_VARIANT_TEST_RIVET_OUTPUT test seam (env var that bypasses the actual rivet binary; production builds never set it)

🤖 Generated with Claude Code

avrabe and others added 2 commits April 27, 2026 06:11
Promotes the v0.7.x line to a tagged release. Headlines:

- Track A v0.7.0 (IRQ-aware hierarchical RTA + Lean theorems)
- Track A v0.7.1 (PIP/PCP blocking)
- Track B v0.7.x foundation (variant contract spec + spar-variants
  consumer crate)
- v0.7.x verification infrastructure: Lean + Bazel + proptest CI
  gates (#135), Kani harnesses (#136), cargo-fuzz (#138), criterion
  benchmarks (#137)

Track D Phase 1 (TSN/WCTT) and Track E commits 1-4 are also on main
at the time of this tag and ship in the resulting binaries; they
will be advertised as v0.8.0 features when Track E is fully closed.

Cargo.toml workspace version + vscode-spar/package.json bumped to
0.7.1. CHANGELOG.md created (Keep a Changelog format).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ommit 6/8)

Wires spar-variants (Track B v0.7.x consumer crate, #162) into
spar moves verify and spar moves enumerate. Both commands now accept
--variant NAME (implicit; shells out to rivet) and --variant-context
PATH (explicit; reads the JSON blob directly per the v1 contract).

Variant filter is applied before overlay validation: items not in the
selected variant are dropped from the analysis surface, matching the
contract's intersection semantics. Output includes variant + feature
model hash for audit trail.

New requirement: REQ-MIGRATION-008.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 79.60089% with 92 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-cli/src/moves.rs 65.06% 87 Missing ⚠️
crates/spar-cli/src/variants_bridge.rs 97.52% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant