Repository navigation
Conversation
…bs#4366) pkg.mod.func, pkg.mod.func() and the pkg.mod:func entry-point form now map onto the path::symbol lookup (pkg/mod.py or pkg/mod/__init__.py, suffix-matched so src/ layouts work). A function and same-named method in that module are refused as a tie instead of picking one. Co-Authored-By: Grok Bot <[email protected]>
|
Thanks for the pull request, @Mpasha17. 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 2 changed function(s) (2 sampled, not proven).
Formal verification. PR-changed functions: 2/2 verified (0 proven, 2 may-equivalent, 0 distinguished) · 0 not verified.
Graphify review — findings
Adds dotted Python symbol resolution to node lookup: pkg.mod.func, pkg.mod.func() and the pkg.mod:func entry-point form map onto the path::symbol lookup against pkg/mod.py or pkg/mod/__init__.py, suffix-matched so src/ layouts resolve. This kicks in only when no node label matches the string literally, and a miss falls through to the ordinary tiers. In _resolve_single_node, several hits from one dotted symbol (say a function and a same-named method in the same module) are refused as ambiguous instead of being treated as a file query that picks the first member.
Worth a look
- Dotted-symbol same-file tie refused only in _resolve_single_node, not in the other _tier_refusal callers —
graphify/serve.py:1704· 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 — 698 functions depend on the 377 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
_load_graph()— 23 callers, 3 callees - worse:
_query_terms()— 20 callers, 3 callees - worse:
_resolve_single_node()— 10 callers, 3 callees - worse:
_find_node_tiers()— 4 callers, 6 callees
Verification — 698 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: 498 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
13 of 376 test file(s) selected (3%) via static blast radius.
tests/test_benchmark.py— impacttests/test_benchmark_raw_graph.py— impacttests/test_explain_same_file_tie.py— impacttests/test_file_label_disambiguation.py— impacttests/test_mcp_graph_view_cache.py— impacttests/test_path_cli.py— impacttests/test_query_induced_edges.py— impacttests/test_query_mcp_direction.py— impacttests/test_query_names_its_graph.py— impacttests/test_serve.py— impact, changed-testtests/test_serve_http.py— impacttests/test_terraform.py— impacttests/test_truncation_full_answer.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
No difference found (not proven): No behavior difference found in \_find\_node\_tiers (not a proof).
The verifier ran both versions of \_find\_node\_tiers on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
No difference found (not proven): No behavior difference found in \_resolve\_single\_node (not a proof).
The verifier ran both versions of \_resolve\_single\_node on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.
Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.
Note: An input the sampler did not try could still differ.
· 1 grounded finding(s) anchored inline below; 3 more finding(s) on lines outside this diff (see the check run).
…raphify-Labs#4366) Moves the check out of _resolve_single_node so the path endpoint (CLI path / MCP shortest_path) refuses pkg.mod.run the same way get_node and explain do, instead of taking the first hit. Co-Authored-By: Grok Bot <[email protected]>
|
Good catch, checked it live: |
|
Shipped in v0.9.88, just released to PyPI as |
Asking for
miden_preflight.cli.main(ormiden_preflight.engine.scan) found nothing, even thoughmain()/scan()resolve fine. The dotted name tokenizes tomiden_preflight cli main, which matches no label. The issue'sgraphify_node/resolved: semanticoutput comes from a wrapper outside this repo. Upstreamget_node/get_neighbors/explainalready fail closed with "No node matching…", so the wrong match itself doesn't come from here. Still, the qualified name should resolve.What changed (
graphify/serve.py): in_find_node_tiers, a dotted Python symbol (pkg.mod.func,pkg.mod.func(), or thepkg.mod:funcentry-point form) is now mapped onto the existingpath::symbollookup. It checkspkg/mod.pyand thenpkg/mod/__init__.py, suffix-matched, sosrc/layouts work. It's skipped when the raw query already exactly matches a node label, and when nothing matches it falls through to the old tiers._tier_refusaltreats a dotted hit as a symbol tier and not a file query, so a function plus a same-named method in that module come back asAmbiguous(forget_node/explainandpathalike) instead of one of them being picked.Testing
graphify update .:miden_preflight.cli.mainandmiden_preflight.cli:mainnow resolve tosrc/miden_preflight/cli.pymain()L26, andmiden_preflight.engine.scanresolves toengine.pyscan()L158. Before, all three gave "No node matching".main()itself is still ambiguous becauserole_model.pyalso defines one, same as before.tests/test_serve.py. Both fail on v8 and pass here.test_dm_*, 7test_securitysafe_fetch/validate_url).Not covered:
pkg.mod.Class.method. Usepath::.method()or the node id for that.Fixes #4366
AI disclosure: written with help from Grok Bot. I reviewed the change and ran the tests myself.