Skip to content

feat(php): resolve instance member calls through the receiver type and link them across repos - #3391

Closed
xiongjianxu wants to merge 2 commits into
Graphify-Labs:v8from
xiongjianxu:feat/php-cross-repo-member-calls
Closed

xiongjianxu wants to merge 2 commits into
Graphify-Labs:v8from
xiongjianxu:feat/php-cross-repo-member-calls

Conversation

@xiongjianxu

@xiongjianxu xiongjianxu commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

What

Extends the PHP member-call resolver that landed in #3872. That change made
_resolve_php_member_calls bind scoped Class::method() / self:: /
static:: / parent:: calls to the actual method (EXTRACTED). This PR adds
the instance tier beside it and wires PHP into the cross-repo merge.

Net-new over v8 (verified against current v8 tip)

v8 today:

This PR:

  1. Instance receiver typing. A per-file _php_receiver_type_table records
    name -> TypeName from typed properties (private Greeter $g;), promoted
    constructor params, typed parameters and $g = new Greeter(). The shared
    resolver looks the receiver up there, takes the single PHP declaration of
    that type, and emits the calls edge — INFERRED (0.85), since the type
    comes from the annotation, never the call site. The scoped :: path is
    untouched and stays EXTRACTED.
  2. Interop-family gate. The declaration index is corpus-wide, so a
    same-named class in another language would both answer the receiver and hide
    that no PHP file declares it. The index is gated to the PHP family.
  3. Cross-repo linking. A receiver typed to a class declared nowhere in this
    build is parked (merge-graphs / global add can never produce cross-repo member-call edges: the resolved receiver type is discarded at bail-out instead of persisted #3152); adding PHP's suffixes to _LANG_SUFFIXES lets the
    merge finish the call against the one declaration in another repo.

A receiver the table cannot type to exactly one class — untyped, union, longer
chain, two same-named classes — stays unresolved rather than guessing.

Tests

  • tests/test_php_receiver_member_calls.py — instance tier: property, promotion,
    typed param, new local, nullable; negatives for untyped / union / longer
    chain / ambiguous name; the cross-language parking case.
  • tests/test_php_static_call_resolution.py — updated the PHP Class::method() static calls without an explicit 'use' import stay INFERRED instead of EXTRACTED #3872 boundary test to
    assert the instance call now resolves INFERRED (the limitation this PR lifts).
  • tests/test_cross_repo_member_calls.py — a parked PHP call binds to the one PHP
    declaration in another repo, and not to a Java class of the same name.

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Adds cross-file PHP member-call resolution so a call like $greeter->greet() on a typed receiver whose method lives in another file now gets a calls edge. _resolve_php_member_calls types the receiver from a new per-file php_type_table (built by _php_receiver_type_table from typed properties, promoted/typed parameters, and new bindings, first binding wins), emits an INFERRED edge at 0.85 only when exactly one class declares that type, bails on ambiguity, and parks receivers whose type this build declares nowhere for a later merge. Registers php suffixes for cross-repo binding, extracts receiver names for $var->m() and $this->prop->m() chains, and keeps PHP member calls in-file rather than deferring so an unresolved bare callee routes through raw_calls.

Worth a look

  • PHP member resolver can bind calls to non-PHP declarations — graphify/extract.py:4459 · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Existing non-call edge suppresses required PHP calls edge — graphify/extract.py:4471 · 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 — 2162 functions depend on the 519 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 546 callers, 43 callees
  • new: _rebuild_code() — 115 callers, 51 callees
  • new: _extract_generic() — 18 callers, 27 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 124 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • …and 43 more — each is listed as a finding

Verification — 2162 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: 1997 function(s) in the blast radius were not formally verified this run

Formal verification

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: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 51 more finding(s) on lines outside this diff (see the check run).

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 4 advisory finding(s) below merit a look before merge.

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Adds cross-file PHP member-call resolution: _resolve_php_member_calls looks each $greeter->greet() receiver up in a per-file php_type_table, resolves the single class declaring that type, and emits an INFERRED calls edge (score 0.85) to its method, bailing when the type is ambiguous or a builtin. Builds that table via _php_receiver_type_table, which records the written-down type of typed properties, promoted/typed parameters, and new bindings (file-scoped, first binding wins), and types member-call receivers during generic extraction from $var or $this->prop. Parks receivers whose type is declared nowhere in the corpus for a later merge (#3152), and extends the PHP suffix set (including .phtml, .php3–.php7, .phps) to the cross-repo indexer and resolver activation.

Worth a look

  • PHP builtin globals are checked against the language map keys — graphify/extract.py:4484 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP member-call resolver suppresses calls edges when any other edge already connects the nodes — graphify/extract.py:4495 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP receiver type table conflates same-named parameters across methods — graphify/extractors/engine.py:693 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • member_receiver may be referenced before assignment for PHP member_access chains — graphify/extractors/engine.py:5551 · 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 — 2163 functions depend on the 520 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 546 callers, 43 callees
  • new: _rebuild_code() — 115 callers, 51 callees
  • new: _extract_generic() — 18 callers, 27 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 124 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • …and 43 more — each is listed as a finding

Verification — 2163 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: 1998 function(s) in the blast radius were not formally verified this run

Formal verification

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: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 51 more finding(s) on lines outside this diff (see the check run).

@xiongjianxu

Copy link
Copy Markdown
Contributor Author

Self-audit pass over the bot review. One fix pushed, two findings I am deliberately not acting on.

Fixed — the declaration index was corpus-wide. _is_type_like_definition is label-based and language-blind, so a Java class Greeter could answer a PHP receiver typed Greeter; and because its presence made type_defs non-empty, the parking branch never ran and the call was dropped instead of handed to the merge. The index is now gated with _lang_family(...) == "php" — the same interop-family map the shared cross-file call resolver consults — which also keeps every .phtml/.php5 declaration in. Pinned by test_a_class_from_another_language_never_answers_a_php_receiver, asserting both halves: no edge, and a parked entry.

Not acting on — existing_pairs is relation-agnostic. It is built from every edge, so a pre-existing references or uses edge between the same pair suppresses the calls edge. That is verbatim what _resolve_csharp_member_calls does, and diverging here would make the two resolvers disagree about what "already edged" means for no gain in this PR.

Not acting on — the type table is per-file and flat. Swift (#1356), TS/JS and C++ all scope theirs this way, and test_the_first_binding_of_a_name_wins pins the consequence deliberately: a parameter shadowing a property elsewhere in the file must not retype the property's own calls. C#/Java moved to per-method tables in #2299 after flat tables caused real mis-binds there; if PHP wants that later it is the same refactor, not a change of behaviour under this feature.

Verification: ruff check graphify tests clean; full suite 5322 passed / 93 skipped, with only the four pre-existing tests/test_ollama_retry_cap.py env failures that v8 also shows here.

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Adds cross-file PHP receiver-typed member-call resolution so calls like $greeter->greet() reach a method declared in another file. The engine now builds a per-file php_type_table (via _php_receiver_type_table) mapping receivers to their written-down types from typed properties, promoted constructor params, typed params, and new bindings, and captures member receivers for both $var->m() and $this->prop->m() chains; the new _resolve_php_member_calls pass looks the receiver up, and when exactly one PHP-declared class of that type exists emits an INFERRED calls edge at 0.85, bailing on ambiguity and skipping builtins. A receiver typed to a class this build contains nowhere is parked on the caller (#3152) for a later merge rather than dropped, and PHP suffixes are registered so cross-repo scanning picks up .php/.phtml/etc.

Worth a look

  • Nullable PHP builtin types are parked as unresolved — graphify/extract.py:4476 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • member_receiver may be used before assignment for PHP chained access — graphify/extractors/engine.py:5551 · 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 — 2163 functions depend on the 520 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 546 callers, 43 callees
  • new: _rebuild_code() — 115 callers, 51 callees
  • new: _extract_generic() — 18 callers, 27 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 124 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • …and 43 more — each is listed as a finding

Verification — 2163 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: 1998 function(s) in the blast radius were not formally verified this run

Formal verification

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: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 51 more finding(s) on lines outside this diff (see the check run).

@xiongjianxu

Copy link
Copy Markdown
Contributor Author

Both advisory findings were checked against the branch; neither holds.

member_receiver used before assignment (engine.py:5551) — no defect. It is initialised to
None at engine.py:5318, at the top of the call-expression block, before any language branch
runs. The PHP chained-access arm only ever assigns to it.

Nullable builtin types parked as unresolved (extract.py:4476) — the premise does not hold.
Nullability is unwrapped before the lookup: _php_declared_type_name strips optional_type, so
?DateTime and DateTime reach the resolver as the same name and behave identically. ?string
yields nothing at all, because the unwrapped node is a primitive_type and only named_type
qualifies.

What is true, and deliberate, is that a stdlib class such as DateTime gets parked: the PHP
blocklist consulted there is the exception-base-class set, so DateTime is not in it. A
single-repo build genuinely cannot distinguish a stdlib class from a class declared in a sibling
repo, and parking is the conservative side of that — the payload is names only, capped per node,
and only becomes an edge if a declaration of that name actually turns up in the merged corpus.
Adding a PHP stdlib class list would trade that for a new failure mode, since a project is free
to declare its own namespaced DateTime.

@xiongjianxu
xiongjianxu force-pushed the feat/php-cross-repo-member-calls branch from 1ab5d63 to 5388d8d Compare September 10, 2026 02:18

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 5 advisory finding(s) below merit a look before merge.

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Adds cross-file PHP member-call resolution: $greeter->greet() on a typed receiver whose method lives in another file now emits an INFERRED calls edge (score 0.85) via _resolve_php_member_calls, which looks the receiver up in a per-file php_type_table and resolves to the single PHP class declaring that type. The engine builds that table from typed properties, promoted constructor params, typed parameters, and $x = new Foo() bindings (first binding wins, file-scoped) and tags member receivers for both $greeter->greet() and $this->greeter->greet(). Receivers typed to a class this build doesn't contain are parked on the caller for a later merge (#3152); ambiguous or builtin types bail unresolved, and .php/.phtml/etc. now register as a PHP suffix set for cross-repo indexing.

Worth a look

  • PHP receiver type table ignores scope and can mis-type shadowing variables — graphify/extractors/engine.py:726 · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • local _key strips underscores, diverging from cross_repo_calls _key normalization — graphify/extract.py · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP builtin type filtering is case-sensitive — graphify/extract.py:4538 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Existing non-call edge suppresses PHP member call edge — graphify/extract.py:4550 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP new-assignment typing misses $this->property = new Type() receivers — graphify/extractors/engine.py:741 · 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 — 2199 functions depend on the 528 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 565 callers, 43 callees
  • new: _rebuild_code() — 115 callers, 51 callees
  • new: _extract_generic() — 18 callers, 27 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 124 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • …and 44 more — each is listed as a finding

Verification — 2199 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: 2034 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

106 of 263 test file(s) selected (40%) via static blast radius.

  • tests/test_astro_extraction.py — impact
  • tests/test_astro_import_ids.py — impact
  • tests/test_build.py — impact
  • tests/test_builtin_global_type_refs.py — impact
  • tests/test_case_sensitive_resolution.py — impact
  • tests/test_cjs_module_extension.py — impact
  • tests/test_cpp_nested_and_cli.py — impact
  • tests/test_cpp_objc_cross_file_calls.py — impact
  • tests/test_cross_extension_reexport_self_cycle.py — impact
  • tests/test_cross_language_call_resolution.py — impact
  • tests/test_cross_repo_member_calls.py — impact, changed-test
  • tests/test_csharp_call_site_generic_args.py — impact
  • tests/test_csharp_enum_members.py — impact
  • tests/test_csharp_field_generic_args.py — impact
  • tests/test_csharp_generic_callsites.py — impact
  • tests/test_csharp_interface_dispatch.py — impact
  • tests/test_csharp_member_calls.py — impact
  • tests/test_csharp_member_nodes.py — impact
  • tests/test_csharp_object_creation.py — impact
  • tests/test_csharp_partial_classes.py — impact
  • tests/test_csharp_type_resolution.py — impact
  • tests/test_definition_file_portability.py — impact
  • tests/test_detect.py — impact
  • tests/test_dotnet.py — impact
  • tests/test_duplicate_annotation_edges.py — impact
  • tests/test_extract.py — impact
  • tests/test_extract_cache_location.py — impact
  • tests/test_file_label_disambiguation.py — impact
  • tests/test_file_node_id_spec.py — impact
  • tests/test_forwarding_review_findings.py — impact
  • tests/test_global_graph.py — impact
  • tests/test_go_builtin_call_targets.py — impact
  • tests/test_go_qualified_resolution.py — impact
  • tests/test_import_extension_resolution.py — impact
  • tests/test_import_self_loops.py — impact
  • tests/test_imported_export_forwarding.py — impact
  • tests/test_incremental.py — impact
  • tests/test_indirect_call_arrow_single_param_shadow.py — impact
  • tests/test_indirect_call_catch_binding_shadow.py — impact
  • tests/test_indirect_call_external_import_shadow.py — impact
  • tests/test_indirect_call_for_of_binding_shadow.py — impact
  • tests/test_indirect_call_function_expression_shadow.py — impact
  • tests/test_indirect_call_nested_closure_shadow.py — impact
  • tests/test_indirect_dispatch.py — impact
  • tests/test_indirect_dispatch_assign_return.py — impact
  • tests/test_indirect_dispatch_getattr.py — impact
  • tests/test_inferred_confidence_rubric.py — impact
  • tests/test_inherited_field_receivers.py — impact
  • tests/test_java_member_calls.py — impact
  • tests/test_java_type_resolution.py — impact
  • … and 56 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 \_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: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 52 more finding(s) on lines outside this diff (see the check run).

@xiongjianxu
xiongjianxu force-pushed the feat/php-cross-repo-member-calls branch from 5388d8d to 288cb51 Compare September 11, 2026 02:36

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 4 advisory finding(s) below merit a look before merge.

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Adds cross-file PHP member-call resolution so $greeter->greet() binds to a method declared in another file. A per-file php_type_table records each receiver's declared type from typed properties, promoted/typed constructor parameters, and new bindings, and _resolve_php_member_calls looks the receiver up there, emits an INFERRED calls edge (score 0.85) only when exactly one PHP class declares that type, bails on ambiguity, and skips builtins. Receivers typed to a class this build doesn't contain are parked on the caller for a later merged graph, and .php variants are registered as a PHP language suffix and resolver.

Worth a look

  • PHP parked calls are not accepted by the cross-repo linker — graphify/cross_repo_calls.py:170 · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP member call edge suppressed by unrelated existing edge — graphify/extract.py:4676 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • Existing non-call edges suppress PHP call resolution — graphify/extract.py:4678 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • member_receiver may be unbound when object is a member_access_expression that is not $this-> — graphify/extractors/engine.py:5726 · 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 — 2230 functions depend on the 532 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 587 callers, 44 callees
  • new: _rebuild_code() — 115 callers, 51 callees
  • new: _extract_generic() — 18 callers, 27 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 124 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • …and 45 more — each is listed as a finding

Verification — 2230 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: 2060 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

109 of 269 test file(s) selected (41%) via static blast radius.

  • tests/test_astro_extraction.py — impact
  • tests/test_astro_import_ids.py — impact
  • tests/test_build.py — impact
  • tests/test_builtin_global_type_refs.py — impact
  • tests/test_case_sensitive_resolution.py — impact
  • tests/test_cjs_module_extension.py — impact
  • tests/test_cpp_nested_and_cli.py — impact
  • tests/test_cpp_objc_cross_file_calls.py — impact
  • tests/test_cross_extension_reexport_self_cycle.py — impact
  • tests/test_cross_language_call_resolution.py — impact
  • tests/test_cross_repo_member_calls.py — impact, changed-test
  • tests/test_csharp_call_site_generic_args.py — impact
  • tests/test_csharp_enum_members.py — impact
  • tests/test_csharp_field_generic_args.py — impact
  • tests/test_csharp_generic_callsites.py — impact
  • tests/test_csharp_interface_dispatch.py — impact
  • tests/test_csharp_member_calls.py — impact
  • tests/test_csharp_member_nodes.py — impact
  • tests/test_csharp_object_creation.py — impact
  • tests/test_csharp_partial_classes.py — impact
  • tests/test_csharp_type_resolution.py — impact
  • tests/test_definition_file_portability.py — impact
  • tests/test_detect.py — impact
  • tests/test_dotnet.py — impact
  • tests/test_duplicate_annotation_edges.py — impact
  • tests/test_extract.py — impact
  • tests/test_extract_cache_location.py — impact
  • tests/test_file_label_disambiguation.py — impact
  • tests/test_file_node_id_spec.py — impact
  • tests/test_forwarding_review_findings.py — impact
  • tests/test_global_add_tag_inference.py — impact
  • tests/test_global_graph.py — impact
  • tests/test_go_builtin_call_targets.py — impact
  • tests/test_go_qualified_resolution.py — impact
  • tests/test_import_extension_resolution.py — impact
  • tests/test_import_self_loops.py — impact
  • tests/test_imported_export_forwarding.py — impact
  • tests/test_incremental.py — impact
  • tests/test_indirect_call_arrow_single_param_shadow.py — impact
  • tests/test_indirect_call_catch_binding_shadow.py — impact
  • tests/test_indirect_call_external_import_shadow.py — impact
  • tests/test_indirect_call_for_of_binding_shadow.py — impact
  • tests/test_indirect_call_function_expression_shadow.py — impact
  • tests/test_indirect_call_nested_closure_shadow.py — impact
  • tests/test_indirect_dispatch.py — impact
  • tests/test_indirect_dispatch_assign_return.py — impact
  • tests/test_indirect_dispatch_getattr.py — impact
  • tests/test_inferred_confidence_rubric.py — impact
  • tests/test_inherited_field_receivers.py — impact
  • tests/test_issue_3405_python_resolution.py — impact
  • … and 59 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 \_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: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 53 more finding(s) on lines outside this diff (see the check run).

@xiongjianxu

Copy link
Copy Markdown
Contributor Author

Rebased onto v8 (0.9.58) — same conflict as the Kotlin sibling, upstream's is_py_local_data guard (#3405 Part 3/4) wrapping the rc_entry block; the PHP tag now sits inside it. MERGEABLE again, CI green.

On the high finding — PHP parked calls are not accepted by the cross-repo linker (cross_repo_calls.py:170): this is refuted by execution, not by argument. The PR's one-line change to that module registers the family the gate reads:

graphify/cross_repo_calls.py:45   "php": frozenset({".php", ".phtml", ".php3", ".php4", ".php5", ".php7", ".phps"}),

and the end-to-end case builds two repos, merges them through the CLI, and asserts the edge exists:

tests/test_cross_repo_member_calls.py::test_each_language_parks_the_call_and_the_merge_finishes_it[php-typed-property] PASSED

That parametrization asserts both halves — the parked entry (callee, receiver_type, lang == "php", call site) in the app repo's graph.json, then exactly one _cross_repo_call edge after merge-graphs, from app::…run to lib::…greet. _member_relations returning ("method",) for PHP is correct and is what the test exercises: a PHP method is a method edge, and the defines fallback exists only for C++'s in-class declarations.

The remaining three are unchanged from the previous rounds:

  • existing_pairs is relation-agnostic (extract.py:4676, 4678) — one finding reported twice. It is verbatim what _resolve_csharp_member_calls treats as "already edged"; diverging here would make the two resolvers disagree about that for no gain in this PR.
  • member_receiver may be unbound (engine.py:5726) — no defect. It is initialised to None at the top of the call-expression block, before any language branch runs; the PHP chained-access arm only ever assigns to it.

Verification: ruff check graphify tests clean; full suite 5447 passed / 95 skipped, deselecting only the pre-existing test_ts_normalizer_scales_linearly_on_large_files timing flake (it fails on unmodified v8 in a full run too) and tests/test_ollama_retry_cap.py (no openai in this env).

@xiongjianxu
xiongjianxu force-pushed the feat/php-cross-repo-member-calls branch from 288cb51 to f17f5c9 Compare September 11, 2026 05:35

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


Graphify review — findings

Adds cross-file PHP member-call resolution: _resolve_php_member_calls types receivers like $greeter->greet() through a per-file php_type_table and emits an INFERRED calls edge (score 0.85) to the sole class declaring that type, bailing when the type is ambiguous, builtin, or absent — in which case the call is parked for a merged-graph pass rather than dropped. Builds that type table in _php_receiver_type_table from typed properties, promoted constructor params, typed parameters, and new assignments (file-scoped, first binding wins), and captures member receivers for $var->m() and $this->prop->m() during generic extraction. Registers php suffixes for cross-repo call matching and adds the php_member_calls resolver.

Worth a look

  • member_receiver may be referenced before assignment in PHP branch — graphify/extractors/engine.py:5723 · Escalate · high
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP member-call resolver suppresses calls when any non-call edge already connects the same nodes — graphify/extract.py:4666 · 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 — 2230 functions depend on the 532 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 587 callers, 44 callees
  • new: _rebuild_code() — 115 callers, 51 callees
  • new: _extract_generic() — 18 callers, 27 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 124 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: _get_extractor() — 26 callers, 6 callees
  • …and 45 more — each is listed as a finding

Verification — 2230 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: 2060 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

109 of 269 test file(s) selected (41%) via static blast radius.

  • tests/test_astro_extraction.py — impact
  • tests/test_astro_import_ids.py — impact
  • tests/test_build.py — impact
  • tests/test_builtin_global_type_refs.py — impact
  • tests/test_case_sensitive_resolution.py — impact
  • tests/test_cjs_module_extension.py — impact
  • tests/test_cpp_nested_and_cli.py — impact
  • tests/test_cpp_objc_cross_file_calls.py — impact
  • tests/test_cross_extension_reexport_self_cycle.py — impact
  • tests/test_cross_language_call_resolution.py — impact
  • tests/test_cross_repo_member_calls.py — impact, changed-test
  • tests/test_csharp_call_site_generic_args.py — impact
  • tests/test_csharp_enum_members.py — impact
  • tests/test_csharp_field_generic_args.py — impact
  • tests/test_csharp_generic_callsites.py — impact
  • tests/test_csharp_interface_dispatch.py — impact
  • tests/test_csharp_member_calls.py — impact
  • tests/test_csharp_member_nodes.py — impact
  • tests/test_csharp_object_creation.py — impact
  • tests/test_csharp_partial_classes.py — impact
  • tests/test_csharp_type_resolution.py — impact
  • tests/test_definition_file_portability.py — impact
  • tests/test_detect.py — impact
  • tests/test_dotnet.py — impact
  • tests/test_duplicate_annotation_edges.py — impact
  • tests/test_extract.py — impact
  • tests/test_extract_cache_location.py — impact
  • tests/test_file_label_disambiguation.py — impact
  • tests/test_file_node_id_spec.py — impact
  • tests/test_forwarding_review_findings.py — impact
  • tests/test_global_add_tag_inference.py — impact
  • tests/test_global_graph.py — impact
  • tests/test_go_builtin_call_targets.py — impact
  • tests/test_go_qualified_resolution.py — impact
  • tests/test_import_extension_resolution.py — impact
  • tests/test_import_self_loops.py — impact
  • tests/test_imported_export_forwarding.py — impact
  • tests/test_incremental.py — impact
  • tests/test_indirect_call_arrow_single_param_shadow.py — impact
  • tests/test_indirect_call_catch_binding_shadow.py — impact
  • tests/test_indirect_call_external_import_shadow.py — impact
  • tests/test_indirect_call_for_of_binding_shadow.py — impact
  • tests/test_indirect_call_function_expression_shadow.py — impact
  • tests/test_indirect_call_nested_closure_shadow.py — impact
  • tests/test_indirect_dispatch.py — impact
  • tests/test_indirect_dispatch_assign_return.py — impact
  • tests/test_indirect_dispatch_getattr.py — impact
  • tests/test_inferred_confidence_rubric.py — impact
  • tests/test_inherited_field_receivers.py — impact
  • tests/test_issue_3405_python_resolution.py — impact
  • … and 59 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.

· 53 more finding(s) on lines outside this diff (see the check run).

@xiongjianxu

Copy link
Copy Markdown
Contributor Author

The push was an author-identity rewrite: my commits were authored under an email that is not linked to my GitHub account, so they were not being attributed to me. The tree hash is identical to the previously reviewed head (verified before pushing) and the commit messages are unchanged, so the re-review's findings are the ones already answered above.

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 4 advisory finding(s) below merit a look before merge.

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Adds cross-file PHP member-call resolution so $greeter->greet() reaches a method declared in another file. A new per-file php_type_table records the written-down type of each property, promoted/typed constructor parameter, typed parameter, and new binding (first binding wins, file-scoped), and the _resolve_php_member_calls pass looks the receiver up there, resolving to the single PHP class declaring that type and emitting an INFERRED calls edge (0.85); ambiguous types bail and receivers whose type is declared nowhere in the corpus get parked on the caller for a later merge. Registers PHP suffixes in the cross-repo caller and the resolver registry, and skips union/intersection/primitive types (which name no single class) plus builtins.

Worth a look

  • PHP type matching collapses distinct namespaced class names — graphify/extract.py:4638 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP member resolver suppresses calls when any edge already exists between caller and target — graphify/extract.py:4664 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • PHP call resolution suppresses calls when a non-call edge already exists — graphify/extract.py:4683 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • All unresolved PHP calls are tagged as parked PHP member calls — graphify/extractors/engine.py:6457 · 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 — 2340 functions depend on the 546 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 639 callers, 45 callees
  • new: _rebuild_code() — 123 callers, 53 callees
  • new: _extract_generic() — 18 callers, 30 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • new: dispatch_command() — 2 callers, 125 callees
  • new: extract_objc() — 27 callers, 9 callees
  • new: link_cross_repo_member_calls() — 21 callers, 9 callees
  • …and 47 more — each is listed as a finding

Verification — 2340 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: 2166 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

118 of 284 test file(s) selected (42%) via static blast radius.

  • tests/test_astro_extraction.py — impact
  • tests/test_astro_import_ids.py — impact
  • tests/test_build.py — impact
  • tests/test_builtin_global_type_refs.py — impact
  • tests/test_case_sensitive_resolution.py — impact
  • tests/test_cjs_module_extension.py — impact
  • tests/test_cpp_nested_and_cli.py — impact
  • tests/test_cpp_objc_cross_file_calls.py — impact
  • tests/test_cross_extension_reexport_self_cycle.py — impact
  • tests/test_cross_language_call_resolution.py — impact
  • tests/test_cross_repo_external_call_guards.py — impact
  • tests/test_cross_repo_member_calls.py — impact, changed-test
  • tests/test_csharp_call_site_generic_args.py — impact
  • tests/test_csharp_enum_members.py — impact
  • tests/test_csharp_field_generic_args.py — impact
  • tests/test_csharp_generic_callsites.py — impact
  • tests/test_csharp_interface_dispatch.py — impact
  • tests/test_csharp_member_calls.py — impact
  • tests/test_csharp_member_nodes.py — impact
  • tests/test_csharp_object_creation.py — impact
  • tests/test_csharp_partial_classes.py — impact
  • tests/test_csharp_type_resolution.py — impact
  • tests/test_definition_file_portability.py — impact
  • tests/test_detect.py — impact
  • tests/test_dotnet.py — impact
  • tests/test_duplicate_annotation_edges.py — impact
  • tests/test_extract.py — impact
  • tests/test_extract_cache_location.py — impact
  • tests/test_file_label_disambiguation.py — impact
  • tests/test_file_node_id_spec.py — impact
  • tests/test_forwarding_review_findings.py — impact
  • tests/test_global_add_tag_inference.py — impact
  • tests/test_global_graph.py — impact
  • tests/test_go_builtin_call_targets.py — impact
  • tests/test_go_qualified_resolution.py — impact
  • tests/test_import_extension_resolution.py — impact
  • tests/test_import_self_loops.py — impact
  • tests/test_imported_export_forwarding.py — impact
  • tests/test_incremental.py — impact
  • tests/test_indirect_call_arrow_single_param_shadow.py — impact
  • tests/test_indirect_call_catch_binding_shadow.py — impact
  • tests/test_indirect_call_external_import_shadow.py — impact
  • tests/test_indirect_call_for_of_binding_shadow.py — impact
  • tests/test_indirect_call_function_expression_shadow.py — impact
  • tests/test_indirect_call_nested_closure_shadow.py — impact
  • tests/test_indirect_dispatch.py — impact
  • tests/test_indirect_dispatch_assign_return.py — impact
  • tests/test_indirect_dispatch_getattr.py — impact
  • tests/test_inferred_confidence_rubric.py — impact
  • tests/test_inherited_field_receivers.py — impact
  • … and 68 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 \_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 `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 55 more finding(s) on lines outside this diff (see the check run).

xiongjianxu and others added 2 commits October 13, 2026 11:21
…red type

v8's `_resolve_php_member_calls` (Graphify-Labs#3872) binds scoped `Class::method()` calls
but leaves instance `$g->method()` calls unresolved. This adds the instance
tier beside it: a per-file receiver type table (`_php_receiver_type_table`
over typed properties, promoted constructor params, typed params and `new`
bindings) names the receiver's class, and the shared resolver takes the single
PHP declaration of that class and emits the `calls` edge, INFERRED.

The declaration index is gated to the PHP interop family: the index is
corpus-wide, so a same-named class in another language would both answer the
receiver and hide that no PHP file declares it. A receiver the table cannot
type to one class — untyped, union, longer chain — stays unresolved.

Co-Authored-By: Claude Code <[email protected]>
A receiver typed to a class this build declares nowhere is parked on the
caller (Graphify-Labs#3152); the merge then binds it to the one declaration in another
repo. PHP was absent from `_LANG_SUFFIXES`, so parked PHP entries were never
language-checked and the edge was dropped. Adding PHP's suffixes lets the
merge finish the call, gated to PHP declarations like every other tier.

Co-Authored-By: Claude Code <[email protected]>
@xiongjianxu
xiongjianxu force-pushed the feat/php-cross-repo-member-calls branch from de19f26 to e7fee26 Compare October 13, 2026 03:21
@github-actions github-actions Bot added the needs:title PR title should follow the conventional-commit format label Oct 13, 2026
@github-actions

Copy link
Copy Markdown

Thanks @xiongjianxu! One small thing: our changelog and release notes are built from PR titles, so we use the conventional-commits format, for example:

fix(python): resolve a bare stdlib import correctly

Prefixes we use: feat, fix, docs, chore, refactor, test, perf, build, ci. Editing the PR title clears this automatically. This is just a nudge and does not block review.

@xiongjianxu xiongjianxu changed the title PHP: receiver-typed member calls, and park them for cross-repo merges PHP: resolve instance ($g->m()) member calls through the receiver's type, and link them across repos Oct 13, 2026
@xiongjianxu xiongjianxu changed the title PHP: resolve instance ($g->m()) member calls through the receiver's type, and link them across repos feat(php): resolve instance member calls through the receiver type and link them across repos Oct 13, 2026
@github-actions github-actions Bot removed the needs:title PR title should follow the conventional-commit format label Oct 13, 2026
safishamsi added a commit that referenced this pull request Oct 13, 2026
Kotlin/Scala/C++/Swift generic & template type-param pruning (#4406,
#4407, #4408, #4409), Objective-C NS_ENUM/NS_OPTIONS extraction and
callable markers (#4401, #3385), and Go/PHP receiver-typed member-call
parking (#3395, #3391) all change AST extraction output, so warm caches
must re-extract.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@safishamsi

Copy link
Copy Markdown
Member

Shipped in v0.9.89, just released to PyPI as graphifyy 0.9.89. Landed via an authorship-preserving cherry-pick (your commit keeps your name and counts on your contributor graph), which is why GitHub marks this closed rather than merged. Thanks @xiongjianxu!

@safishamsi safishamsi closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants