Repository navigation
Conversation
…uard (Graphify-Labs#5247) build._EDGE_LANG_FAMILY is meant to mirror extract._LANG_FAMILY_BY_EXT but had drifted: 37 extensions extract knows (.dart, .vue/.svelte/.astro/.ejs, .kts/.gradle, .vb/.razor/.cshtml/.xaml, .sql, .sh, .ps1, .zig, .ex, .jl, alternate PHP extensions, ...) had no family, so the Graphify-Labs#1749 guard never dropped a cross-language imports/references/calls edge touching them. Add them, using build's own family names, and add a test that fails if extract gains a language the guard does not cover or if a build family ever spans two extract families. Written with the help of an AI coding agent.
There was a problem hiding this comment.
Graphify reviewed this change.
No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.
Not checked: tests were not run; no formal proof of the changed code.
Graphify review — findings
Extends the cross-language phantom-edge guard in build to cover every extension extract already classifies, so an import like a Python from app import db no longer binds to a Dart lib/app.dart. Previously, extensions missing from _EDGE_LANG_FAMILY (Vue/Svelte, Kotlin script, VB/Razor, COBOL, Erlang, Zig, Elixir, Dart, SQL, shell, PowerShell, and others) had no family, so the guard never fired for edges touching them and they were kept. Adds tests that fail if the two tables drift apart and that a py→dart import is dropped while dart→dart survives.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 2312 functions depend on the 316 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
build_from_json()— 320 callers, 25 callees
Verification — 2312 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: 1613 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
158 of 581 test file(s) selected (27%) via static blast radius.
tests/test_4874_jvm_resolution.py— impacttests/test_4978_reconcile_cost.py— impacttests/test_5072_splittable_under_cap_retry.py— impacttests/test_affected_cli.py— impacttests/test_affected_path_file_node.py— impacttests/test_affected_seed_reference_forms.py— impacttests/test_alias_folding.py— impacttests/test_analyze.py— impacttests/test_atomic_canvas_export.py— impacttests/test_atomic_writes.py— impacttests/test_backend_opt_in.py— impacttests/test_benchmark.py— impacttests/test_benchmark_raw_graph.py— impacttests/test_benchmark_real_query.py— impacttests/test_build.py— impact, changed-testtests/test_build_located_semantic_identity.py— impacttests/test_build_merge_dedup_scope.py— impacttests/test_build_merge_ghost_fold_4955.py— impacttests/test_build_merge_hyperedges_and_prune.py— impacttests/test_build_merge_shrink_guard.py— impacttests/test_c_include_resolution.py— impacttests/test_carried_hyperedge_remap.py— impacttests/test_charmap_encoding.py— impacttests/test_chunking.py— impacttests/test_claude_cli_backend.py— impacttests/test_cli_export.py— impacttests/test_cluster.py— impacttests/test_community_labels_skill.py— impacttests/test_compact_graph_json.py— impacttests/test_confidence.py— impacttests/test_confidence_score_output.py— impacttests/test_corrupt_graph_json.py— impacttests/test_cpp_forward_declarations.py— impacttests/test_cpp_member_declaration_identity.py— impacttests/test_cpp_objc_cross_file_calls.py— impacttests/test_cross_extension_reexport_self_cycle.py— impacttests/test_cross_repo_external_call_guards.py— impacttests/test_csharp_method_owner_labels.py— impacttests/test_csharp_object_creation.py— impacttests/test_dedup.py— impacttests/test_dedup_remaps_hyperedges.py— impacttests/test_dedup_shrink_refuses_force_write.py— impacttests/test_dedup_survivor_richness.py— impacttests/test_definition_file_portability.py— impacttests/test_duplicate_annotation_edges.py— impacttests/test_edge_also_seen.py— impacttests/test_evidence_binding.py— impacttests/test_export.py— impacttests/test_export_control_characters.py— impacttests/test_export_direction.py— impact- … and 108 more
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.
· 1 more finding(s) on lines outside this diff (see the check run).
What does this PR do?
Fixes #5247.
build._EDGE_LANG_FAMILY(the cross-language phantom-edge guard from #1749) says it mirrorsextract._LANG_FAMILY_BY_EXT, but it had drifted: 37 extensions that extract assigns a family had none in build, so the guard never fired for an edge touching them. That includes.dart,.vue/.svelte/.astro/.ejs,.kts/.gradle,.vb/.razor/.cshtml/.xaml,.sql,.sh/.bash,.ps1/.psm1/.psd1,.zig,.ex/.exs,.jl,.r,.sol, Erlang, COBOL,.luauand the alternate PHP extensions.This PR adds the missing extensions to
_EDGE_LANG_FAMILYand keeps build's own family names (js,jvm,cs,php,lua, ...), so SFCs stay with JS/TS, Kotlin scripts/Gradle with the JVM, and VB/Razor/XAML with C#. Nothing that was already in the table changes.Type of change
Verification & Invariants
Invariant: an
imports/imports_from/referencesedge between two known code languages of different interop families, or an INFERRED cross-familycallsedge, is dropped inbuild_from_json. That only holds if every language extract knows has a family in the guard table.test_edge_lang_family_covers_every_extract_languagefails if_LANG_FAMILY_BY_EXTgains an extension that_EDGE_LANG_FAMILYlacks. It also fails if a build family spans two extract families, so the guard can never drop an edge that call resolution treats as same-language. The family names differ between the two tables, so the test compares groupings, not names.test_cross_language_import_into_dart_is_dropped: a py -> dartimports_fromedge is dropped and a dart -> dart import survives.v8without the change and pass with it.Limitations, left out on purpose to keep this narrow:
build still has
.pyi,.hh,.hxx, which extract's table lacks. That is the opposite direction and does not weaken the guard.build keeps Swift separate from C/ObjC (extract groups them as
native). That is stricter than extract, and the new test allows it.On current
v8, the issue's three-file CLI repro already bindsfrom app import dbtoapp/__init__.py(I checked before and after this change), so the end-to-end symptom no longer shows there. The table gap is still real for any edge that does reachbuildpointing at one of these extensions, which is what the regression test covers.Read the CONTRIBUTING.md guide.
Reproduced the issue and identified the invariant.
Made the smallest fix necessary.
Added a regression test (if bug fix) or isolated boundary test.
Kept the PR description synchronized with the final implementation.
Documented any limitations / unsupported cases explicitly.
How was this tested?
The full run also had failures that this change does not cause:
test_sql_tsql_bracketed_procedure_is_recoveredandtest_sql_escaped_double_quote_in_routine_name_is_consumedalready fail onv8with tree-sitter-sql 0.3.13 (SQL: partially parsed procedure headers produce duplicate and malformed routine nodes with tree-sitter-sql 0.3.13 #5236).tests/test_security.pyURL/fetch tests fail because my sandbox resolves hosts to private IPs.Graphify-specific checklist
uv run python -m tools.skillgen --bless) when changing their source fragments. (n/a, no fragments touched)