Migrate SymbolResolver class lookups onto the SymbolSource seam - #377
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Firehed
enabled auto-merge (squash)
July 28, 2026 21:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice S2.4 — Migrate
SymbolResolverclass lookups tolookupClassLikeSlice: S2.4 (
docs/architecture/build-manifest.md, Wave 1)Plan step:
docs/architecture/0002-execution-plan.mdStep 2 (§5.5 consumer-migrationtable,
SymbolResolverrow; §5.2 interface JIT) — a consumer migration onto the S2.1seam, 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 theSymbolSourceseam instead ofnaming
ClassRepositorydirectly. The nineClassRepository::get()sites (the positionpredicates
isInstantiable/isInterface/isThrowable/ … and theself/namedclass resolution) now call
SymbolSource::lookupClassLike;SymbolResolverisconstructed with the one shared
DelegatingSymbolSourcefacade (wired inServer.phpsince S2.2). The facade construction moves above the resolver in
Server.php, which issafe — the facade depends only on the repositories/index, never on the resolver.
The
isSubclassOfdecisionSymbolResolveralso calledClassRepository::isSubclassOfat two sites (isThrowableand protected-visibility resolution) — a transitive subtype query that a single
lookupClassLikecannot answer. The Step-2 illustrative interface (§5.2) lists onlythree 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
ClassRepositorywould keepSymbolResolvernaming the repository directly, defeatingthe migration and forcing an extra exemption in S2.6's §4.2 rule (which is scoped to
FunctionRepositoryonly).So the seam gains
isSubclassOf, implemented inDelegatingSymbolSourceby puredelegation to
ClassRepository::isSubclassOf— the same strangler pattern aslookupClassLike, no behavior change.SymbolResolvernow namesClassRepositorynowhere.
Behavior preservation
Both new seam calls delegate to the exact same backing methods, so no result changes.
The frozen
ClassLikeLookupParityTestgolden — which covers bothget()andisSubclassOf(testIsSubclassOfTraversesTheGraph) — is unchanged, and the fullSymbolResolver, Hover, Definition, SignatureHelp, and Completion suites stay green.A new
DelegatingSymbolSourceTestcase pins the facade'sisSubclassOfforwarding(both truth branches, and argument order).
Test wiring for the five suites that construct
SymbolResolveris de-duplicated behinda shared
BuildsSymbolSourceTraitrather than re-assembling the facade by hand in each.Acceptance criteria
SymbolResolverreads class-like lookup throughSymbolSource::lookupClassLike,no longer naming
ClassRepositorydirectly.SymbolSource::isSubclassOf,delegating to today's
ClassRepository::isSubclassOf);SymbolResolver's directClassRepositorydependency is removed entirely.ClassLikeLookupParityTestgolden (lookup + subtype) isunchanged and green.
composer testgreen.Candidate closes (pending review verification): none (manifest
Closesis—).