feat(version-skew): SHA-keyed store + cross-version rename tracking (6.4, G3/A11)#57
Merged
officialCodeWork merged 1 commit intoJul 16, 2026
Conversation
…king (6.4, G3/A11)
Warn when a ticket resolved against a stored (production) graph points at a
definition that was renamed or moved in the current code.
- core diffRenames(from, to): pairs a definition gone by identity (name+file)
with a same-body-signature definition that is new in the newer graph. Signature
= structural fingerprint + normalized rendered text + props + rendered-children,
stable across a rename/move. Confident 1:1 only; generic/ambiguous bodies
skipped (no false renames).
- core SHA-keyed store: saveGraphToStore/loadGraphFromStore/graphStoreDir ->
.coderadar/graphs/<sha>.json (or "working") + a latest pointer.
- buildBundle gains a currentGraph option -> "version skew — matched `X`;
renamed `Y` (file) in the current graph".
- CLI: scan --store writes the store; bundle --against <sha|latest> loads the
current graph for the diff.
- Fixture pair g3-version-skew/{old,new} (InvoiceCard.tsx -> BillingCard.tsx,
renamed and moved). .coderadar/ gitignored.
7 core + 4 store + 2 parser-react + 3 agent-sdk tests; verified end-to-end via
the CLI. eval 317/0/0/0, determinism 1.000, all metrics 1.000; typecheck + lint
clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Phase 6.4 — Version skew & rename tracking (failure modes G3, A11)
An agent often resolves a ticket against a stored graph (the commit in production) while the code has moved on. If the matched definition was renamed or moved on main, the match points at a file that no longer exists under that identity. This step detects that and warns with the new name/path.
Changes
diffRenames(fromGraph, toGraph)(core): pairs a definition gone by identity (name+file) in the newer graph with a same-body-signature definition that is new there. Signature = structural fingerprint + normalized rendered text + props + rendered-children — all stable across a rename or file move. Confident 1:1 only: unique among both the gone and arrived sets; generic empty bodies and ambiguous many-to-many sets are skipped (no false renames).storage):saveGraphToStore/loadGraphFromStore/graphStoreDir→.coderadar/graphs/<sha>.json(orworkingoutside git) + alatestpointer.buildBundlegains acurrentGraphoption →version skew — matched \InvoiceCard` (…); renamed `BillingCard` (…) in the current graph`.scan --storewrites the store;bundle --against <sha|latest>loads the current graph from it for the diff.Fixture & tests
g3-version-skew/{old,new}:InvoiceCard.tsx→BillingCard.tsx, renamed and moved, identical body. The golden validates the post-rename graph directly; the two-graph diff is covered by unit tests.diffRenames+ 4 store round-trip + 2 parser-react (real scan) + 3 agent-sdk (buildBundlewarning) tests.--against latestemits the rename warning with the new name+file.Verification
pnpm eval→ 317 pass · determinism 1.000 · all metrics 1.000pnpm typecheck,pnpm lintgreen..coderadar/gitignored.Tracker updated. 6.1 (incremental re-scan) and 6.2 (scale) remain before Gate 6 is fully stamped.
🤖 Generated with Claude Code