Repository navigation
fix(watch): rebuild the full corpus when graph.json is missing - #5021
azizur100389 wants to merge 1 commit into
Conversation
Refs Graphify-Labs#5016. Co-Authored-By: OpenAI Codex <[email protected]>
|
Thanks for the pull request, @azizur100389. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic. |
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.
Not checked: tests were not run; formal verification proved 0 of 1 changed function(s) (1 not verified).
Formal verification. PR-changed functions: 0/1 verified (0 proven, 0 may-equivalent, 0 distinguished) · 1 not verified (1 unsupported).
Not verified on this run: \_rebuild\_code (unsupported).
Graphify review — findings
Fixes _rebuild_code rebuilding only the changed files when graph.json is missing but manifest.json survives, which dropped every unchanged node from the recreated graph. The manifest-driven incremental path now runs only when graph.json exists, and otherwise falls through to the full extraction, so a deleted graph is rebuilt from all sources. The guard sits on the manifest-derived branch, so a caller that passes changed_paths directly still goes down the incremental path without the check.
Worth a look
- Missing-graph guard skipped when caller supplies changed_paths —
graphify/watch.py:2420· Escalate · medium- NOT verified (no proof, no reproducing execution) — needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 713 functions depend on the 123 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
_rebuild_code()— 254 callers, 73 callees
Verification — 713 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: 445 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
37 of 519 test file(s) selected (7%) via static blast radius.
tests/test_cache_stale_import_target.py— impacttests/test_code_only_scope_4923.py— impacttests/test_compact_graph_json.py— impacttests/test_csharp_method_owner_labels.py— impacttests/test_elixir_import_resolution.py— impacttests/test_elixir_qualified_calls.py— impacttests/test_elixir_unqualified_call_scope.py— impacttests/test_export_direction.py— impacttests/test_external_stub_endpoints.py— impacttests/test_go_receiver_member_calls.py— impacttests/test_incremental_unscanned_placeholders.py— impacttests/test_java_member_calls.py— impacttests/test_kotlin_grammar.py— impacttests/test_labeling.py— impacttests/test_language_override_lifecycle.py— impacttests/test_linked_worktree_reconcile.py— impacttests/test_lost_saved_semantic_nodes.py— impacttests/test_markdown_code_spans.py— impacttests/test_no_cluster_undeclared_endpoints.py— impacttests/test_pr10_watch_overrides.py— impacttests/test_python_inherited_method_calls.py— impacttests/test_python_injected_factory_calls.py— impacttests/test_python_property_reads.py— impacttests/test_python_pytest_fixture_receivers.py— impacttests/test_rust_use_trees.py— impacttests/test_semantic_origin_stamp.py— impacttests/test_skill_persisted_scan_options.py— impacttests/test_solidity_inherited_calls.py— impacttests/test_terraform_modules.py— impacttests/test_undirected_two_file_import_cycle.py— impacttests/test_update_incremental.py— impacttests/test_update_lock_contention.py— impacttests/test_update_missing_graph.py— impact, changed-testtests/test_update_no_change_gate.py— impacttests/test_watch.py— impacttests/test_watch_identity_cache.py— impacttests/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 \_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: nondeterministic output (both versions disagreed with themselves on the witness) — not a behaviour change; a function whose output is not a function of its inputs (random / time / uuid / os.urandom, or state carried across calls) cannot be soundly distinguished by execution, so this tier abstains for the whole function
· 1 more finding(s) on lines outside this diff (see the check run).
|
Landed on |
Fixes #5016.
What does this PR do?
With no source changes, update exits successfully without recreating the file. With one changed source, it creates a graph containing only that source. The manifest identifies changed bytes but cannot supply unchanged nodes and edges.
The manifest-derived incremental path now requires an existing
graph.json. The existing full rebuild path handles a missing graph, including the case where one source also changed. The guard applies to the manifest-derived graphify update path.Reproduction
def first(): return 1infirst.pyanddef second(): return 2insecond.pyin a clean directory.graphify update . --no-cluster.graphify-out/graph.json. Leavegraphify-out/manifest.jsonin place.first.py.Verification
uv sync --all-extras --frozenon Python 3.12.python -m pytest -q --tb=short tests/test_update_missing_graph.py— 2 passed. The new failure cases reproduce on unchangedv8at59b5ab11.python -m ruff check .,python -m pre_commit run --all-files, and all fivepython -m tools.skillgenchecks passed.