feat(migration): tentative-binding overlay (Track E commit 2/8)#164
Merged
feat(migration): tentative-binding overlay (Track E commit 2/8)#164
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
714235d to
73592b8
Compare
Adds BindingOverlay — a HIR-level immutable map from component idx to hypothetical target processor idx — that lets any analysis run "as if" the binding were rebound without mutating the SystemInstance. The overlay validates against Spar_Migration::Frozen and Allowed_Targets from commit 1, returning structured FrozenViolation / AllowedTargetsViolation diagnostics. Empty overlay is the no-op identity (non-regression). This is the technical foundation for spar moves verify (commit 3) and spar moves enumerate (commit 4-5). No CLI surface, no solver wiring, no MCP in this commit. Per Track E research §6.4 (#153, merged). New requirement: REQ-MIGRATION-004. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
73592b8 to
61c2988
Compare
7 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
BindingOverlayinspar-hir-def— an immutable per-component-instance map from a moving component to its hypothetical target processor — so any analysis can run "as if" the binding were rebound without mutating the underlyingSystemInstance.actual_processor_binding_with_overlay(instance, comp, overlay)as the load-bearing accessor: when the overlay carries a move it returns the hypothetical target; otherwise it falls through to the declaredActual_Processor_Binding.Spar_Migration::Frozen(from commit 1) andSpar_Migration::Allowed_Targets, returning structuredFrozenViolation/AllowedTargetsViolationdiagnostics (no prose-parsing required by callers).actual_processor_binding_with_overlay(.., None)andactual_processor_binding_with_overlay(.., Some(&BindingOverlay::new()))agree on every component.Scope (what this commit is)
crates/spar-hir-def/src/overlay.rs—BindingOverlay,FrozenViolation,AllowedTargetsViolation,OverlayDiagnostic,actual_processor_binding_with_overlay, plus 10 unit tests.crates/spar-hir-def/src/lib.rs.REQ-MIGRATION-004appended toartifacts/requirements.yaml.TEST-OVERLAYappended toartifacts/verification.yaml, satisfyingREQ-MIGRATION-{004,001,002}.Out of scope (explicitly NOT in this commit)
spar moves verifylands in commit 3.spar-solverhypothetical mode lands in commits 4–5.spar.verify_move,spar.enumerate_movesare deferred to v0.9.0 (commits 9–11).COMPLIANCE.md,spar-cli,spar-solver, α/β/δ surfaces, or any MCP scaffolding.Test plan
cargo build --workspace— cleancargo test -p spar-hir-def— 448 passed (438 prior + 10 new inoverlay::tests)cargo test --workspace— all greencargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleanrivet validate— PASSThe 10 new tests cover the contract: empty-overlay identity, single-move semantics, unrelated-component non-interference, frozen-component violation (with
Pinned_Reasonplumbed through), non-frozen no-op, allowed-targets satisfied, allowed-targets violated, empty-allowed-targets means no restriction (both empty list and absent property), three-move independence, and clone independence.🤖 Generated with Claude Code