Migrate ClassCandidates onto the SymbolSource seam - #375
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #375 +/- ##
=========================================
Coverage 98.13% 98.14%
- Complexity 1710 1711 +1
=========================================
Files 107 107
Lines 4297 4308 +11
=========================================
+ Hits 4217 4228 +11
Misses 80 80 ☔ View full report in Codecov by Harness. |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.2 — Migrate
ClassCandidatestosearchSlice: S2.2 (
docs/architecture/build-manifest.md, Wave 1)Plan step:
docs/architecture/0002-execution-plan.mdStep 2 (§5.5 consumer-migration table; §5.4 lightweightSymbolDefinition) — 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).
Routes
ClassCandidates' workspace prefix search throughSymbolSource::searchClassLikesinstead of namingSymbolIndexdirectly. The oneDelegatingSymbolSourcefacade is constructed inServer.phpand shared; subsequent Step 2 slices route the remaining consumers onto the same instance (Plan §5.5).Behavior preservation
The plan requires this migration be identical (same backing).
searchClassLikessearches the whole class-like namespace and returns each match with itskind, so the per-position kind narrowing that the index query used to do stays in the consumer, applied against each result's ownkind— before theClassCandidateFilter::accepts()predicate. That ordering matters:acceptsresolves through theClassRepository, which cannot vouch for a symbol whose declaration it cannot reach (e.g. an indexed interface with no resolvable file), so the index's authoritative kind must gate first.testNewCompletionExcludesIndexedInterfacespins exactly this.Proven by the existing completion suite across every filter (Any / Instantiable / TypeHint / …) and by the frozen
PrefixSearchParityTestgolden, which stays unchanged because this slice does not touch the search surface itself.Acceptance criteria
ClassCandidatesreads class-like prefix search throughSymbolSource::searchClassLikes, no longer namingSymbolIndexdirectly.ClassCandidateFilterpositions (existingCompletionHandlerTestcoverage green, including the synthetic-interface and abstract-class exclusion cases).PrefixSearchParityTestgolden is unchanged (the search surface is untouched).Server.php;NamespaceCandidatesstill reads the raw catalog (its migration is S2.3).composer testgreen (PHPStan + tests + PHPCS).Not in this slice
SymbolIndex/ClassRepository/NamespaceCatalogoutside a backend lands in S2.6 (scoped-exempt), once the other consumers (S2.3–S2.5) have migrated.Candidate closes
None — the manifest lists no
Closesfor S2.2.🤖 Generated with Claude Code