Split S3.7 and re-scope Step 3b into reviewable slices - #390
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #390 +/- ##
=========================================
Coverage 98.55% 98.55%
Complexity 1753 1753
=========================================
Files 115 115
Lines 4434 4434
=========================================
Hits 4370 4370
Misses 64 64 ☔ View full report in Codecov by Harness. |
Firehed
added a commit
that referenced
this pull request
Aug 3, 2026
Slice **S3.7a** (#390). `ComposerAutoloadMap` gains the `autoload.files` set — the files Composer loads wholesale rather than by name, and the only place a project's functions and constants are locatable, since they have no name→file map (RFC 1 §3, Plan 0002 §3). - `autoloadFiles(): list<string>`, read from `vendor/composer/autoload_files.php`. Composer keys that file by a content hash; the paths are taken as a plain list. - Partitioned by vendor directory alongside the PSR-4/PSR-0/classmap splits, so each `FilesystemBackend` half sees its own files (RFC 1 §5.3). - Non-string entries are discarded — generated data from a project we do not control. - The fixture project declares two `files` entries, which also back S3.7b and S3.7d. The accessor's consumer is `ComposerSymbolLocator` in S3.7d; it is public because that is a different class, and caller-less until then because of the split. Note: `tests/Fixtures` gained a `files` autoload section, so `composer install` needs re-running there before the suite passes.
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.
Re-scopes the remaining Step 3b slices so each is reviewable as one unit, and records
two decisions found while sizing them.
Why
S3.7 was built as a single slice (#388: 622 src lines over 17 files, 30 commits) and is
too large to review as one unit. The seam it missed is already in the code: a class-like
lookup is arithmetic on the name (
findFile— five lines, the oldComposerClassLocatorverbatim), while a function or constant lookup has no name→file map and must derive one
by parsing the
autoload.filesset. Those are two different reviews.Sizing the rest of Step 3b against the merged slices (S3.2 +58/−40, S3.4 +171/−28,
S3.1 +305/−47) showed S3.8 and S3.9 heading the same way.
What changes
autoload.filesinto the autoload map; the per-file declarationscan; the kind-agnostic
SymbolLocatorwith its class-like branch (behavior-preserving,proven by the existing golden); the derived function/constant index (new behavior, new
fixtures). S3.7a and S3.7b are independent inputs to S3.7d.
SymbolBackendmethods no backend implements. S3.8c carries theSymbolResolveredit,so S4.2 now serializes against it rather than against S3.8 as a whole.
searchClassLikesto a kindparameter with every Step P golden frozen; S3.9b makes the backends answer function
search and rewrites only the function-surface golden.
file://conversion is hand-rolled in four live places, each differingin how it handles the scheme and percent-encoding. Pre-existing duplication owned by no
step, which is what the SC.* block is for. S3.7c is gated on it rather than adding a
fifth copy.
Decisions recorded
autoload.fileswarm-up is declined, with numbers (0002 §3). It was never acorrectness requirement — an unwarmed locator answers identically — so it only moves
which message pays a one-off cost. At §8.1's measured ~4 MB/s that cost is ~35 ms here
(~7 ms excluding PHPUnit's
Assert/Functions.php, which is 111 KB of the 139 KB).Not worth ~105 lines, a second
InitializedListener, and a non-obvious ordering rule.A reopen condition is named, and
warm()changes no interface, so re-adding it lateris free.
ConstantNameis already taken byDomain\ConstantName(class constants), whichcollides with §5.3's global-constant FQN type. Flagged to be decided before S3.8b
rather than inside it.
Also corrects the name-type JIT note:
NameKindalready exists, andQualifiedNamelands in S3.7c rather than S3.8.
Docs only — no
src/ortests/changes.