Repository navigation
Conversation
On a full rebuild `rebuilt_sources` is every file in the corpus, so `_accounted` returned True for every lost node and `_check_shrink` could never refuse. The protection was structurally absent on exactly the path its own refusal message recommends as the remedy. Membership in `rebuilt_sources` says a file was scanned, not that losing its nodes was intended. A re-extracted source now accounts for its own losses only while it still contributes something to the new graph: a source that goes from N nodes to none while still on disk is the silent shrink this guard exists for. Files the caller declared deleted stay exempt, since contributing nothing is the correct outcome for them. An emptied-but-present file keeps its file node, so a legitimate "removed every symbol" edit still passes without --force.
…ull-rebuild # Conflicts: # tests/test_watch.py
There was a problem hiding this comment.
Graphify reviewed this change.
Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
Tightens _check_shrink so a re-extracted source only accounts for its own lost nodes while it still contributes at least one node to the new graph, closing the hole where a full rebuild (with the whole corpus in rebuilt_sources) degenerated to "always allow" on exactly the --force path the refusal message recommends (#3579). Sources named in the new deleted_sources argument stay exempt, so a file gone from disk contributing nothing is still accepted, while an emptied-but-present file keeps its file node and passes; failed_sources keeps precedence and the #1116 symbol-removal case still succeeds. Both _rebuild_code call sites now pass deleted_paths through as deleted_sources.
Worth a look
- rebuilt_sources None dereference in _accounted membership check —
graphify/watch.py:1263· Escalate · high- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 652 functions depend on the 458 functions this change touches.
Health — this change adds coupling hotspots:
- new:
_rebuild_code()— 144 callers, 55 callees - new:
main()— 98 callers, 3 callees - new:
dispatch_command()— 2 callers, 125 callees - new:
watch()— 5 callers, 7 callees - new:
_reconcile_graph_html()— 6 callers, 5 callees - new:
_reconcile_existing_graph()— 1 callers, 8 callees - new:
_reconcile_markdown_links()— 1 callers, 7 callees - new:
test_poisoned_manifest_is_healed()— 0 callers, 6 callees
Verification — 652 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: 480 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
8 of 298 test file(s) selected (3%) via static blast radius.
tests/test_elixir_import_resolution.py— impacttests/test_external_stub_endpoints.py— impacttests/test_kotlin_grammar.py— impacttests/test_labeling.py— impacttests/test_markdown_code_spans.py— impacttests/test_terraform_modules.py— impacttests/test_watch.py— impact, changed-testtests/test_watch_manifest_location.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
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: no capturable inputs from the test suite; property tier: 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: no capturable inputs from the test suite; property tier: parameter `watch_path` is annotated `Path` — outside the synthesizable primitive/collection set
· 8 more finding(s) on lines outside this diff (see the check run).
|
On the advisory finding, a |
…ull-rebuild # Conflicts: # graphify/watch.py
Since Graphify-Labs#2229 an unstamped node reads as semantic, and the saved-semantic-id check refuses its loss before the per-source accounting runs. With the old fixtures the full-rebuild test passed through that check instead of this fix, and the two allow cases were refused by it. Stamped _origin: ast, the tests reach the accounting again: reverting the surviving-source rule fails the full-rebuild test.
|
Merged One follow-up in 9232d49: since #2229, an unstamped node reads as semantic, and The full suite passes: 8396 passed, 15 skipped. I deselected one test, |
Closes #3579.
_check_shrinkcannot refuse a write on a full rebuild.rebuilt_sourcesis the whole corpus there:and
_accountedtreats membership as evidence that a loss was intended, soall(_accounted(n) for n in lost)is true for every node that has asource_fileand for every node that has none. The guard is structurally absent on exactly the path its own refusal message recommends: "Run a full rebuild to be safe."Observable on
v8with two files and no fixtures — a full rebuild that emptiesa.pygoes 5 nodes to 3 and writes without a word:The change
Membership says a file was scanned. It does not say that losing its nodes was intended. A re-extracted source now accounts for its own lost nodes only while it still contributes something to the new graph, with two exemptions kept intact:
deleted_sources(the set the call sites already fold intorebuilt_sources) is passed separately and exempted.failed_sources. Unchanged, and still takes precedence: extraction did not complete, so the disappearance is the silent shrink.The "removed every symbol" case does not regress, and that is measured rather than assumed: graphify keeps a file node for an emptied-but-present file (
a.py: 1above), so such a source stays in the surviving set and the write is still allowed without--force.Test
Six cells in
tests/test_watch.py, beside the existing guard cells. The one that names the defect fails onv8:The other five pin the boundaries: a symbol removed from a rebuilt source still passes (#1116), a deleted source still passes, a failed source still refuses, a node with no
source_fileis still accounted, and a loss from a source that was not rebuilt still refuses (the incremental case this guard was written for, which had no cell of its own — a mutation that dropped the membership check survived until it was added).tests/test_watch.pyandtests/test_build_merge_shrink_guard.pyare green at 166 passed, 3 skipped. The fulltests/run has 26 failures, and the identical 26 fail on an unmodifiedv8atfe66389here — the two sets compare equal, so none of them are this change.Mutation-checked: five seeded defects, including restoring the original
_accounted, dropping the deleted-file exemption, and dropping thefailed_sourcesprecedence. Each is caught by a named cell; none survive.On the sibling report: this is the guard half of what #3580 describes, so a rebuild that zeroes files would now refuse rather than write silently. It does not address why those files were zeroed — I could not reproduce that part on
v8and have posted the harness and the negative result there.