Repository navigation
fix(watch): refresh JS/TS imports after resolver input changes - #5022
azizur100389 wants to merge 1 commit into
Conversation
Refs Graphify-Labs#5017. 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 incremental _rebuild_code so a change to a JS/TS resolution input (tsconfig, workspace layout, lockfile) re-resolves unchanged importers instead of leaving their imports_from edges stale. It feeds resolution_inputs through manifest classification, and when any is modified, deleted or excluded it skips the incremental change set and falls back to a full code-graph rebuild, which means the deleted-row set is no longer handed to the rebuild on that path. Adds tests covering edit, remove and add of a tsconfig path alias, plus a lockfile-only change that re-extracts the importer once and then settles.
Worth a look
- Resolution-input full rebuild drops explicit deleted rows (shrink guard / stale nodes) —
graphify/watch.py:2445· Escalate · medium- NOT verified (no proof, no reproducing execution) — needs human review
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 717 functions depend on the 127 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
_rebuild_code()— 255 callers, 74 callees
Verification — 717 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: 449 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_js_resolution_inputs.py— impact, changed-testtests/test_update_lock_contention.py— impacttests/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 #5017.
What does this PR do?
The
imports_fromedge still points toold/target.ts. Adding or deleting the config also leaves the unchanged importer unresolved or attached to the old file.The manifest-derived update checks ordinary config files and separately detected resolver inputs such as
pnpm-lock.yaml. Added, modified, deleted, or excluded resolver inputs select the full rebuild so untouched importers can resolve again. Ordinary source changes still take the incremental path.Reproduction
export function target() {}in bothold/target.tsandnew/target.ts.main.ts, importtargetfrom@app/targetand call it from an exported function.compilerOptions.baseUrlto.andcompilerOptions.pathsto{"@app/*":["./old/*"]}intsconfig.json.graphify update . --no-cluster. Change only the alias to./new/*and run the same command.Verification
uv sync --all-extras --frozenon Python 3.12.python -m pytest -q --tb=short tests/test_update_js_resolution_inputs.py— 4 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.