Add steps 23-26 for remaining M×N problems - #473
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #473 +/- ##
=========================================
Coverage 99.46% 99.46%
Complexity 1892 1892
=========================================
Files 133 133
Lines 4897 4897
=========================================
Hits 4871 4871
Misses 26 26 ☔ View full report in Codecov by Harness. |
Firehed
added a commit
that referenced
this pull request
Sep 1, 2026
Follow-up to #473. Scope grew after a second scan surfaced five more M×N patterns not captured by the current manifest, and after the realisation that step-21's baseline hard-lock made new tighten rules impractical. ## Tightens to steps 25 and 26 - **step-25** — enumerates the nine node kinds that must gain docblock coverage; notes that if `docblockForExpression` becomes a one-liner it is deleted and inlined rather than kept as a wrapper. - **step-26** — names `Domain\LateBindingKeyword` as the sole home (drops the "or `ScopeFinder::resolveClassName`, whichever" hedge); adds a `tests/Architecture/` test that fails if the three keyword literals appear in `src/` outside the enum. ## New steps 27-31 for uncaptured M×N findings Each ships a `disallowedMethodCalls` tighten modelled on #478's pattern. - **step-27** — union/intersection receivers: every member-lookup site in `ExpressionResolver` and `MemberAccessDetector` picks `getResolvableClassNames()[0]` while `SymbolResolver::getAccessibleMembers` iterates. Failure: `function f(A|B $x) { $x->onlyB(); }` — completion offers `onlyB`, hover returns null. Tighten pins `getResolvableClassNames()` to the shared helper. - **step-28** — `resolveConstFetch` uses one lookup, `resolveFuncCall` iterates `NameContext::candidates`. Failure: `namespace App; const X = 1; echo X;` — hover on `X` returns null. Tighten pins `SymbolSource::lookupConstant` to `ExpressionResolver`. - **step-29** — `SymbolCandidates` reads `->docblock` + `DocblockParser::extractDescription` directly, bypassing `HasSymbolLocation::getDocumentation()`. Preventive today; a future tag-strip in `getDocumentation()` would silently miss completion detail. Tighten pins `DocblockParser::extractDescription` to `HasSymbolLocation`. - **step-30** — `HoverHandler`, `SignatureHelpHandler`, and `CompletionItemFactory` each compose `format()` + `getDocumentation()` themselves; a `ResolvedSymbolPresenter` consolidates the shape. Tighten pins the two methods to the presenter. - **step-31** — `$this` typing has an AST path in `ExpressionResolver` and a text-fallback side-channel in `MemberAccessDetector` (via a `resolvedType` node attribute). Deletes the attribute; routes both through one helper. Tighten pins `TextFallbackHelper::resolveEnclosingClassName` to that helper. ## Relaxes bin/check-baseline-shrink NOW Step-21's script failed if either baseline file existed. That made new tighten rules with residuals impossible to add. Restored the pre-step-21 shrink-only-when-present logic (comparing to `origin/main`). The hard "must-not-exist" lock moves to the retire step, by which point every interim tighten will have drained its residual. ## Beefed-up retire (step-32) - Restores the hard lock on `bin/check-baseline-shrink`. - Adds a `tests/Architecture/HandlerDependenciesRule.php` that fails if any handler in `src/Handler/` names `ParserService`, `SymbolIndex`, `MemberResolver`, or `SymbolSource` directly — code-enforcing the "handlers are formatters, not resolvers" invariant that CLAUDE.md documents but nothing enforces today. - Updates `CLAUDE.md` Guardrails and Architecture Invariants to reflect final state: baselines permanently gone, freeze paragraph deleted, the running list of scoped `disallowedMethodCalls` tightens named as the seams they pin. ## Considered and dropped from the scan - Two regex classifiers for call kind (`TextFallbackHelper::parseCallPattern` vs `CompletionClassifier`) — verifier confirmed they answer different questions on the same input; no feature asymmetry possible. - Two text regex walkers (`DefaultTextSymbolExtractor` vs `TextFallbackHelper::findClassLikeDeclarations`) — `DefaultTextSymbolExtractor` is a consumer of the second; already unified. _PR body written by AI, reviewed by a human._
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.
Cursory scan surfaced four M×N problems in
src/Resolution/not captured by the current manifest. Adding them as steps 23-26 ahead of the retire step (now step-27).SymbolResolver::resolveCallablenode fan-out. The method-call path skips late-bound return-type resolution that the static-call path applies, so hover on$obj->foo(): staticshowsstaticandFoo::bar(): staticshows the receiver class.ExpressionResolver. Late-binding runs for methods but not properties, so$obj->proptypedstaticin the parent returns rawstatic.docblockForExpressionre-implements resolve+docblock for three node kinds and misses four others; foreach element-type inference from a@return list<T>docblock works on$this->items()but notFoo::items().self/static/parentliterals recur acrossMemberAccessDetector's text and AST paths;ScopeFinder::resolveClassNameandLateBindingKeywordalready exist as homes.Ordering puts the callable/member dispatch cluster (23-24) first since 24 depends on 23 having
ExpressionResolveras the sole callable answerer.PR body written by AI, reviewed by a human.