Repository navigation
fix(watch): refuse shrink after extractor failure (#2660) - #2663
ousamabenyounes wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
This PR adds a failed_sources parameter to the shrink-guard logic in graphify/watch.py. During a full rebuild, sources whose AST extraction failed are now tracked and passed to _check_shrink, where their nodes are excluded from being "accounted for" as expected deletions — so a failed extractor no longer counts its dropped nodes as legitimate symbol removals and can no longer overwrite the previous graph. The change also wires failed_sources through both write paths in _rebuild_code (clustered and non-clustered), adds a CHANGELOG entry (#2660), and adds tests covering the new _check_shrink behavior and an end-to-end _rebuild_code scenario where a SQL extractor is made to fail. The surface area is limited to the watch/rebuild shrink-protection path and its tests.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 662 functions depend on the 512 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
_rebuild_code()— 95 callers, 51 callees
Verification — 662 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 523 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify \_check\_shrink.
The verifier did not have enough to check \_check\_shrink, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: parameter `tmp` is annotated `'Path | None'` — outside the synthesizable primitive/collection set
Could not verify: Could not verify \_rebuild\_code.
The verifier did not have enough to check \_rebuild\_code, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: parameter `watch_path` is annotated `Path` — outside the synthesizable primitive/collection set
· 1 more finding(s) on lines outside this diff (see the check run).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Shipped in v0.9.41 ( |
Why
A full rebuild treated every node lost from a rebuilt source as an expected symbol deletion. When an extractor failed, that accounting allowed a smaller graph to overwrite the last good graph while reporting success.
Fixes #2660.
What changed
--no-clusterrebuild paths, including preservation of the existing graph.Why it is safe
Successful rebuilds and explicit deletions keep their existing accounting. The new refusal applies only when extraction already reported that the affected source failed.
Test verification (RED → GREEN)
Upstream
v8with only the new integration regression:Patched branch:
Full local CI replay on Python 3.12 and 3.10 remained iso-better than upstream:
The two unchanged failures are existing
v8failures in hidden-directory collection and the Unicode normalization property test. Skill generation checks, install smoke, and Ruff also passed.