feat(parser-react): handler resolution through props — 4-level chains (B1)#15
Merged
officialCodeWork merged 1 commit intoJul 13, 2026
Conversation
… (B1)
Step 2.3 (TRACKER). Failure mode B1, the core static-analysis investment:
- resolveHandlerChains: events whose handler is a prop of their own
component follow the prop through instance call sites up to 4 levels —
renamed hops (onSave={onSaveDraft}), inline-arrow wraps
(onSaveDraft={() => onPersist()}), props.X access, destructure defaults —
until a real function body grounds the chain; bodies are mined for data
sources and wired event --triggers--> data-source.
- Chains that never ground flag the event unresolved-prop-handler and emit
NOTHING (the orphan fixture forbids cross-chain endpoint bleed).
- Bug found by the fixture: expression-bodied arrows ARE the call node —
getDescendantsOfKind excludes self; both body scans now include it.
- Fixture b1-prop-drilled-handler: SaveButton.onClick grounds in
POST /api/drafts through Toolbar → EditorPanel → DraftEditor.
- Scorecard: 119 pass / 0 fail; precision/recall 1.000. 80 unit tests.
Co-Authored-By: Claude Fable 5 <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.
Summary
TRACKER Step 2.3 — failure mode B1, the second pillar of Phase 2.
<button onClick={onSave}>whereonSaveis a prop means the real handler lives at a call site — possibly four components up. Per-file analysis stops dead at the prop boundary; the chain resolver doesn't.The fixture chain, resolved
traceLineage(SaveButton)now reports/api/drafts— through three files it never touches directly.Honesty guarantees
unresolved-prop-handlerand emit nothing — theOrphanButtonfixture (handler never passed) has aforbiddenassertion against cross-chain endpoint bleed.props.Xaccess, inline arrows wrapping prop calls, destructure defaults, function-declaration and arrow-const handlers.Found by the fixture
Expression-bodied arrows (
() => onPersist()) — the body is the CallExpression, andgetDescendantsOfKindexcludes the node itself, so the whole chain silently died at the wrap hop. Both body scans now include the body node.Eval
Documentation
TRACKER.md— 2.3 done, Status → 2.4🤖 Generated with Claude Code