Skip to content

Migrate SymbolResolver class lookups onto the SymbolSource seam - #377

Merged
Firehed merged 3 commits into
mainfrom
slice/S2.4
Jul 28, 2026
Merged

Migrate SymbolResolver class lookups onto the SymbolSource seam#377
Firehed merged 3 commits into
mainfrom
slice/S2.4

Conversation

@Firehed

@Firehed Firehed commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Slice S2.4 — Migrate SymbolResolver class lookups to lookupClassLike

Slice: S2.4 (docs/architecture/build-manifest.md, Wave 1)
Plan step: docs/architecture/0002-execution-plan.md Step 2 (§5.5 consumer-migration
table, SymbolResolver row; §5.2 interface JIT) — a consumer migration onto the S2.1
seam, no behavior change.
Depends on: S2.1 (SymbolSource / SymbolSink + delegating facade, #374) — merged.
RFC sections: 0001 §4.2 (Symbol Discovery Authority), §4.4 (FQN-based knowledge
queries), §4.5 (type-graph traversal), §5.1 (typed identifiers).

Routes SymbolResolver's class knowledge through the SymbolSource seam instead of
naming ClassRepository directly. The nine ClassRepository::get() sites (the position
predicates isInstantiable / isInterface / isThrowable / … and the self/named
class resolution) now call SymbolSource::lookupClassLike; SymbolResolver is
constructed with the one shared DelegatingSymbolSource facade (wired in Server.php
since S2.2). The facade construction moves above the resolver in Server.php, which is
safe — the facade depends only on the repositories/index, never on the resolver.

The isSubclassOf decision

SymbolResolver also called ClassRepository::isSubclassOf at two sites (isThrowable
and protected-visibility resolution) — a transitive subtype query that a single
lookupClassLike cannot answer. The Step-2 illustrative interface (§5.2) lists only
three methods, but §5.2 scopes the seam to "the surface today's migrated features
actually need," and this migrated feature needs the subtype query. Leaving it on
ClassRepository would keep SymbolResolver naming the repository directly, defeating
the migration and forcing an extra exemption in S2.6's §4.2 rule (which is scoped to
FunctionRepository only).

So the seam gains isSubclassOf, implemented in DelegatingSymbolSource by pure
delegation to ClassRepository::isSubclassOf — the same strangler pattern as
lookupClassLike, no behavior change. SymbolResolver now names ClassRepository
nowhere.

Behavior preservation

Both new seam calls delegate to the exact same backing methods, so no result changes.
The frozen ClassLikeLookupParityTest golden — which covers both get() and
isSubclassOf (testIsSubclassOfTraversesTheGraph) — is unchanged, and the full
SymbolResolver, Hover, Definition, SignatureHelp, and Completion suites stay green.
A new DelegatingSymbolSourceTest case pins the facade's isSubclassOf forwarding
(both truth branches, and argument order).

Test wiring for the five suites that construct SymbolResolver is de-duplicated behind
a shared BuildsSymbolSourceTrait rather than re-assembling the facade by hand in each.

Acceptance criteria

  • SymbolResolver reads class-like lookup through SymbolSource::lookupClassLike,
    no longer naming ClassRepository directly.
  • The transitive subtype check reads through the seam (SymbolSource::isSubclassOf,
    delegating to today's ClassRepository::isSubclassOf); SymbolResolver's direct
    ClassRepository dependency is removed entirely.
  • Behavior identical — the ClassLikeLookupParityTest golden (lookup + subtype) is
    unchanged and green.
  • Full composer test green.

Candidate closes (pending review verification): none (manifest Closes is ).

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.14%. Comparing base (b205420) to head (fe442ec).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #377   +/-   ##
=========================================
  Coverage     98.14%   98.14%           
- Complexity     1711     1712    +1     
=========================================
  Files           107      107           
  Lines          4308     4310    +2     
=========================================
+ Hits           4228     4230    +2     
  Misses           80       80           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Firehed
Firehed enabled auto-merge (squash) July 28, 2026 21:27
@Firehed
Firehed merged commit f73e582 into main Jul 28, 2026
7 checks passed
@Firehed
Firehed deleted the slice/S2.4 branch July 28, 2026 21:28
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.

1 participant