Skip to content

PHP: (new Service())->method() resolves as EXTRACTED with FQN corroboration #3

Closed

Description

@filipechagas

Parent

Spec: #1 (upstream: Graphify-Labs#1682)

What to build

An inline instantiation call — (new Service())->method() or (new \\App\\Services\\Service())->method() — gets a calls edge to the service's method. Because the source names the exact class, the edge is EXTRACTED — but only when the source's qualified name corroborates the resolved node; otherwise it downgrades to INFERRED. new self() / new static() receivers are refused.

Extends the tracer's receiver mapping with the (new) receiver key plus the retained class name and qualified text.

Acceptance criteria

  • (new \\NS\\Service())->method() yields an EXTRACTED calls edge when the qualified name corroborates the resolved node; decoy gets no edge
  • Bare (new Service())->method() resolves; confidence per the corroboration rule
  • Non-corroborating qualified name downgrades to INFERRED (or refuses — per spec decision)
  • (new self())->m() and (new static())->m() yield no edge
  • Anonymous-class instantiation (new class {...})->m() yields no edge
  • Bare new Service() statements without an immediate call remain out of scope (unchanged)

Blocked by

Activity

  1. added
    ready-for-agent
    on Aug 5, 2026
  2. filipechagas commented on Aug 5, 2026

    @filipechagas
    CollaboratorAuthor

    Implemented in ae95261. Orchestrator gate: full suite 3957/36 (+10 tests). EXTRACTED only under PSR-4 path corroboration of the written namespace; bare/mismatched names stay INFERRED; new self()/static() and anonymous classes refused (anonymous-class AST shape probed on tree-sitter-php 0.24.1, closing design open-risk #3). All three upstream repro scenarios now produce the expected edges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions