Repository navigation
Conversation
…te's constructor type (Graphify-Labs#2860) 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.
Formal verification. PR-changed functions: 0/2 verified (0 proven, 0 may-equivalent, 0 distinguished) · 2 not verified (1 vacuous, 1 unsupported).
Not verified on this run: \_resolve\_python\_member\_calls (vacuous: never exercised), \_extract\_generic (unsupported).
Graphify review — findings
Resolves Python self.X.m() calls by typing self.X per class from its assignments across that class's methods, using either an annotation (self.x: T = ...) or a bare constructor (self.x = Ctor()). Conflicting or untypable bindings leave the field untyped, and self.x = None is ignored. A call emits an INFERRED calls edge (score 0.85) only when the type names a single class that the caller's file defines or imports and that class owns m; otherwise no edge is added, so a same-named method on another class is never targeted.
Worth a look
- Typed
self.X.m()calls skip the existing receiver-resolution fallback —graphify/extract.py:4247· 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 — 3083 functions depend on the 1051 functions this change touches.
Health — this change adds coupling hotspots:
- new:
extract()— 789 callers, 50 callees - new:
_rebuild_code()— 151 callers, 56 callees - new:
_extract_generic()— 18 callers, 33 callees - new:
extract_js()— 87 callers, 5 callees - new:
extract_xaml()— 19 callers, 17 callees - new:
main()— 102 callers, 3 callees - new:
extract_objc()— 27 callers, 10 callees - new:
dispatch_command()— 2 callers, 128 callees - …and 49 more — each is listed as a finding
Verification — 3083 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: 2888 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
148 of 337 test file(s) selected (44%) via static blast radius.
tests/test_astro_extraction.py— impacttests/test_astro_import_ids.py— impacttests/test_blade_extractor.py— impacttests/test_build.py— impacttests/test_builtin_global_type_refs.py— impacttests/test_cache.py— impacttests/test_case_sensitive_resolution.py— impacttests/test_cjs_module_extension.py— impacttests/test_cobol_extractor.py— impacttests/test_cpp_method_declarations.py— impacttests/test_cpp_nested_and_cli.py— impacttests/test_cpp_objc_cross_file_calls.py— impacttests/test_cross_extension_reexport_self_cycle.py— impacttests/test_cross_language_call_resolution.py— impacttests/test_cross_repo_external_call_guards.py— impacttests/test_cross_repo_member_calls.py— impacttests/test_csharp_call_site_generic_args.py— impacttests/test_csharp_enum_members.py— impacttests/test_csharp_field_generic_args.py— impacttests/test_csharp_generic_callsites.py— impacttests/test_csharp_interface_dispatch.py— impacttests/test_csharp_member_calls.py— impacttests/test_csharp_member_nodes.py— impacttests/test_csharp_object_creation.py— impacttests/test_csharp_partial_classes.py— impacttests/test_csharp_tuple_type_refs.py— impacttests/test_csharp_type_resolution.py— impacttests/test_definition_file_portability.py— impacttests/test_detect.py— impacttests/test_dotnet.py— impacttests/test_duplicate_annotation_edges.py— impacttests/test_elixir_import_resolution.py— impacttests/test_elixir_unqualified_call_scope.py— impacttests/test_erlang_extractor.py— impacttests/test_extract.py— impact, changed-testtests/test_extract_cache_location.py— impacttests/test_extract_php_closures.py— impacttests/test_file_label_disambiguation.py— impacttests/test_file_node_id_spec.py— impacttests/test_forwarding_review_findings.py— impacttests/test_go_builtin_call_targets.py— impacttests/test_go_import_repoint.py— impacttests/test_go_interface_methods.py— impacttests/test_go_qualified_resolution.py— impacttests/test_import_extension_resolution.py— impacttests/test_import_self_loops.py— impacttests/test_imported_export_forwarding.py— impacttests/test_incremental.py— impacttests/test_indirect_call_arrow_single_param_shadow.py— impacttests/test_indirect_call_block_scoped_shadow.py— impact- … and 98 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.
Formal verification
Could not verify: Could not verify \_resolve\_python\_member\_calls.
The verifier did not have enough to check \_resolve\_python\_member\_calls, 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: non-vacuity: domain too small (only 1 distinct inputs exercised, need 3) — 'no divergence' would be near-vacuous
Could not verify: Could not verify \_extract\_generic.
The verifier did not have enough to check \_extract\_generic, 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: parameter `config` is annotated `LanguageConfig` — outside the synthesizable primitive/collection set
· 57 more finding(s) on lines outside this diff (see the check run).
|
Checked this one and it doesn't skip anything v8 did. A |
…ound local (#4198) Resolves a call on a local or parameter whose class is known from an annotation (c: Client), an Optional/union/string annotation, or a constructor/with binding, to the owning class's method - fail-closed to a single in-file-or-imported class that owns the method. Complements the self.<attr> arm from #4176. Rebased onto the landed #4176: reuses its _emit_call(inferred=True) INFERRED/0.85 path instead of the PR's own confidence= parameter. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Closes #2860
Calls like
self.agents.bull_researcher(idea)got nocallsedge, since nothing tracked whatself.agentswas. Now each class gets a small field -> class table from its methods:self.X = Ctor(...)(bare capitalized name),self.X: Tannotations, withself.X = Noneignored. A field that gets two different classes or some other value (factory(), tuple unpack) stays untyped._resolve_python_member_callsthen adds an INFERRED edge only when the class name matches exactly one class, that class is defined in or imported by the caller's file, and it defines the method itself. Otherwise no edge, sofrom requests import Sessionwon't bind to an unrelated localSession.Not covered: inherited methods, fields set in a parent class,
self.x = mod.Ctor(), the outer name inself.a = self.b = Ctor(), and calls inside a nesteddef.@sai2142 I saw you'd prototyped a fix. If you already have one going, I'm happy to close this.
Testing: 4 new tests in
tests/test_extract.py(same file, across an import, annotation, and a negative case); the 3 positive ones fail on v8. Full suite on 3.10/3.12/3.13/3.14 shows the same failures as v8, ruff clean, no new pyright findings. Livegraphify update --no-clusteron the issue repro addsdeep_portfolio_review -> AgentRunner.bull_researcher. On httpx, urllib3, requests and click it added 12 edges, all checked by hand and correct, and removed none.AI-assisted (Grok Bot); each commit carries a Co-Authored-By line.