feat(parser-react): class components, HOC unwrapping, graceful degradation — Gate 1 complete#12
Merged
officialCodeWork merged 1 commit intoJul 13, 2026
Conversation
…ation — Gate 1 complete
Step 1.6 (TRACKER). Failure mode D4; closes Phase 1:
- Class components: React.Component/PureComponent/bare Component subclasses
scanned — render() is the text/instance/event body, the whole class body
yields lifecycle fetches (componentDidMount), this.state keys become
class-state nodes, this.props.X accesses become props, and method-
reference handlers (onClick={this.refresh}) resolve.
- HOC unwrapping: const Panel = connect(map)(PanelInner) records an alias;
<Panel/> call sites materialize as instances OF PanelInner (alias chain
bounded at 3). Eval components check now counts instances by definitionId,
not tag name — the semantically correct reading the HOC case exposed.
- Graceful degradation: a class with no render() emits an incomplete-flagged
node instead of vanishing; coderadar scan prints the incomplete count.
- Body-walking helpers genericized from FunctionLike to Node so classes and
functions share extraction (extractRenderedText/BodyFacts/InstanceSites).
- Scorecard: 91 pass / 0 fail / 2 xfail; precision 1.000, recall 0.895.
67 unit tests. GATE 1 PASSES.
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 1.6 — failure mode D4, and the close of Phase 1 (Gate 1).
What's in it
React.Component/PureComponent/ bareComponentsubclasses:render()supplies text/instances/events, the whole class body supplies lifecycle fetches (componentDidMount),this.statekeys becomeclass-statenodes,this.props.Xaccesses become props, andonClick={this.refresh}method references resolve as handlers.const Panel = connect(mapState)(PanelInner)records an alias;<Panel/>materializes as an instance ofPanelInner. Covers connect/withRouter/memo/forwardRef/observer/inject/withTranslation/styled, curried or not, alias chains bounded at 3.render()yields anincomplete-flagged node instead of silence;coderadar scanprintsincomplete: N node(s) could not be fully parsed.definitionId, not tag name —<Panel/>is an instance ofPanelInnereven though the JSX never says so.Gate 1 (from docs/testing-strategy.md)
Passed: precision 1.000, recall 0.895, all seven failure-mode fixtures green, zero poison. Scorecard: 91 pass / 0 fail / 2 xfail (the C1 instance attributions — Phase 2's headline target).
Test plan
pnpm evalgate OK; schema regenerated (class-state kind), drift gate greenDocumentation
TRACKER.md— 1.6 done, Gate 1 recorded, Status → Phase 2 step 2.1🤖 Generated with Claude Code