Skip to content

feat(cli): spar moves verify — hypothetical rebinding oracle (Track E commit 3/8)#166

Merged
avrabe merged 1 commit intomainfrom
feat/v0.8.0-track-e-commit3-verify-cli
Apr 26, 2026
Merged

feat(cli): spar moves verify — hypothetical rebinding oracle (Track E commit 3/8)#166
avrabe merged 1 commit intomainfrom
feat/v0.8.0-track-e-commit3-verify-cli

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 26, 2026

Summary

  • Adds spar moves verify --component X --to Y --format {json,text} — the first user-facing surface of the v0.8.0 migration oracle (Track E commit 3 of 8).
  • Builds a BindingOverlay (commit 2, feat(migration): tentative-binding overlay (Track E commit 2/8) #164) over the parsed instance, runs frozen / allowed-targets validation, runs the standard analysis-pass suite, and emits a structured MoveVerifyReport in either text or JSON form.
  • Exit codes: 0 = move admissible, 1 = analysis errors, 2 = overlay (Frozen / Allowed_Targets) violations.

What's in

  • CLI: spar moves verify — hand-rolled arg parsing matching the rest of spar-cli's subcommand pattern (no clap dependency added).
  • crates/spar-cli/src/moves.rs (~735 LOC): run_verify, MoveVerifyReport, Violation (Frozen / AllowedTargets / AnalysisError variants), DiagnosticOut, FQN-suffix matcher with deepest-match-wins tie-breaking.
  • JSON shape is the canonical machine-readable contract that the v0.9.0 MCP spar.verify_move tool will consume; text shape is the developer-friendly path.
  • 10 integration tests (crates/spar-cli/tests/moves_verify.rs) covering ok, unknown target / component, frozen violation, allowed-targets violation, analysis-error pass-through, both output formats, non-mutation invariant, and trivial fixed-point.
  • Rivet artifacts: REQ-MIGRATION-005, TEST-MOVES-VERIFY (links to REQ-MIGRATION-{004,005}).

What's NOT in (deferred)

  • spar moves enumerate — Track E commit 4.
  • spar moves optimize / spar-solver hypothetical mode — commits 5–6.
  • MCP server surface (spar.verify_move, spar.enumerate_moves) — v0.9.0.
  • Widening overlay-awareness from the HIR-level helper into RTA / bandwidth / latency / EMV2 / ARINC653 — explicitly commit 4. For commit 3 the overlay validates structural constraints; the analysis suite reads the un-overlayed instance.
  • COMPLIANCE.md — close-out commit 8.
  • AADL parser/lexer; spar-solver; MCP code; Track D ζ surface — untouched per scope.

Test plan

  • cargo build --workspace clean
  • cargo test --workspace green — 55 test runs, 0 failures (existing 800+ tests still pass; 10 new CLI tests are additive)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --all -- --check clean
  • rivet validate passes (no new gaps)
  • spar moves verify --help renders informative help
  • spar top-level usage now lists moves

🤖 Generated with Claude Code

… commit 3/8)

Adds `spar moves verify --component X --to Y --format {json,text}`,
the first user-facing surface of the v0.8.0 migration oracle. Builds a
BindingOverlay (commit 2) over the parsed instance, runs frozen /
allowed-targets validation, runs the analysis-pass suite under the
overlay-aware property lookup, and emits a structured pass/fail report.

Exit codes: 0 = ok, 1 = analysis errors, 2 = binding violations.

JSON output is the canonical machine-readable shape (consumed later by
the v0.9.0 MCP tool surface). Text output is the developer-friendly
human-readable format.

For commit 3, only analyses that already consume actual_processor_binding
are overlay-aware. Widening to bandwidth, latency, EMV2 etc. is commit 4.

New requirement: REQ-MIGRATION-005.

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

codecov Bot commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 67.50700% with 116 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spar-cli/src/moves.rs 67.79% 114 Missing ⚠️
crates/spar-cli/src/main.rs 33.33% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit 5a75994 into main Apr 26, 2026
16 of 17 checks passed
@avrabe avrabe deleted the feat/v0.8.0-track-e-commit3-verify-cli branch April 26, 2026 18:27
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