Repository navigation
Conversation
Go package-level var/const were skipped by extract_go, so domain constants and policy data never entered the graph. Emit nodes and contains edges for those declarations, plus references edges for in-file and cross-file uses.
There was a problem hiding this comment.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR adds Go package-level var/const declarations as graph nodes in the Go extractor, emitting them as identifiers contained by the file (including parenthesized blocks and multi-name specs, while skipping blank identifiers). It also introduces references edges from callers to these package-level symbols, both for in-file uses (resolved directly) and cross-file uses (deferred via the raw_calls resolution path). To support non-call relation types, the generic edge-emitting logic in extract.py was generalized to read relation/context from the raw call dict, defaulting to the previous calls/call behavior. A new test file covers node emission and reference edges across these scenarios.
Worth a look
- Field/selector identifiers on RHS of selector_expression counted as package-level references —
graphify/extractors/go.py:456· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- Package-level identifier reference may collide with local variable of same name —
graphify/extractors/go.py:458· Escalate · medium- 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 — 1229 functions depend on the 206 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
extract()— 353 callers, 28 callees - worse:
extract_go()— 20 callers, 3 callees
Verification — 1229 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: 1102 function(s) in the blast radius were not formally verified this run
· 1 grounded finding(s) anchored inline below; 1 more finding(s) on lines outside this diff (see the check run).
| @@ -80,7 +80,7 @@ def _go_collect_type_refs(node, source: bytes, generic: bool, out: list[tuple[st | |||
| _go_collect_type_refs(c, source, generic, out) | |||
|
|
|||
| def extract_go(path: Path) -> dict: | |||
There was a problem hiding this comment.
extract_go()
20 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
Reviewer notesHappy to adjust anything — writing this up so the change is easy to evaluate. Why this exists
Same bug class as the accepted Kotlin/Java enum-constant fix (#1700), applied to Go. Issue has a minimal 2-file repro. What changed (3 files)1.
2.
3.
Blast radius
Residual tradeoff (same class as existing cross-file call resolution): a local identifier that uniquely matches a package-level symbol name elsewhere can get an Suggested review path
pytest tests/test_go_package_level_vars.py tests/test_go_builtin_call_targets.py -qThanks for taking a look. |
Keep package-level var/const extraction and main's Go import-path map plus 0.85 inferred scores.
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 2 advisory finding(s) below merit a look before merge.
Formal verification. No changes could be formally verified in this run.
Graphify review — findings
Emits Go package-level var/const declarations as nodes contained by their file, handling parenthesized blocks and multi-name specs while skipping blank identifiers. Adds references/identifier edges for in-file uses of those symbols and queues unknown identifiers as cross-file raw_calls, deduped per caller so hot locals like err don't flood. Threads a per-call relation/context through extract's edge builder, defaulting to calls/call so existing emitters are unchanged.
Worth a look
- Go package-level reference extraction ignores local shadowing —
graphify/extractors/go.py:545· Escalate · medium- agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
- Go local variables are exported as unresolved package references —
graphify/extractors/go.py:555· Escalate · medium- 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 — 1788 functions depend on the 248 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract()— 522 callers, 43 callees - new:
_rebuild_code()— 113 callers, 50 callees - new:
extract_js()— 85 callers, 4 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
dispatch_command()— 2 callers, 123 callees - new:
extract_go()— 23 callers, 7 callees - new:
_get_extractor()— 26 callers, 6 callees - new:
run_pipeline()— 8 callers, 13 callees - …and 26 more — each is listed as a finding
Verification — 1788 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: 1623 function(s) in the blast radius were not formally verified this run
Formal verification
Could not verify: Could not verify extract.
The verifier did not have enough to check extract, 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 `cache_root` is annotated `Path | None` — outside the synthesizable primitive/collection set
Could not verify: Could not verify extract\_go.
The verifier did not have enough to check extract\_go, 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 `path` is annotated `Path` — outside the synthesizable primitive/collection set
· 1 grounded finding(s) anchored inline below; 33 more finding(s) on lines outside this diff (see the check run).
| @@ -83,7 +83,7 @@ def _go_collect_type_refs(node, source: bytes, generic: bool, out: list[tuple[st | |||
| _go_collect_type_refs(c, source, generic, out) | |||
|
|
|||
| def extract_go(path: Path) -> dict: | |||
There was a problem hiding this comment.
extract_go()
fans out to 7 callees (efferent coupling); 23 callers depend on it (afferent coupling).
Grounded coupling-delta finding (deterministic), not an LLM guess.
Summary
containsedges for Go package-levelvar/constdeclarations (including parenthesized blocks and multi-name specs), matching howtype_declarationis handled.referencesedges when functions use those symbols, and resolve unique-label cross-file uses asreferences(notcalls) via an opt-inrelation/contextonraw_calls.Test plan
pytest tests/test_go_package_level_vars.py(issue repro: nodes, blank_, in-file + cross-file refs)pytest tests/test_go_builtin_call_targets.py tests/test_multilang.py -k goaffected/querycan see package-level consts