Skip to content

feat: action effects — handler bodies → navigate/fetch/dispatch/setState (B3)#19

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-3/step-3.2-action-effects
Jul 14, 2026
Merged

feat: action effects — handler bodies → navigate/fetch/dispatch/setState (B3)#19
officialCodeWork merged 1 commit into
developmentfrom
build/phase-3/step-3.2-action-effects

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Step 3.2 — Action effects (TRACKER phase 3)

Failure modes B3 and B2 (dispatch half). Mines resolved handler bodies (from step 2.3) for effects, each a typed edge from the EventNode.

Effects

  • navigate()/router.push/history.push → navigates-to a RouteNode. Target folded to :param form (reusing endpoint resolution) and joined to a route by exact path, then param-agnostic shape — so navigate(`/users/${id}`) reaches /users/:userId. A target resolving to a shape with no declared route flags unresolved-nav (visible, never silent).
  • fetch/axios/wrapper call in a handler → triggers a data source.
  • dispatch(thunk()) / dispatch(action()) → writes-state on the slice, via new action/thunk→slice maps in the store registry.
  • setState setter (setOpen(…)) → writes-state on the local useState slot.

Handler resolution is unified: prop-drilled (B1), local references, and inline arrows all flow through the same machine, now emitting every effect kind. Handler expressions are captured per event during body extraction; detectRoutes runs before the effect pass so navigate targets can join to routes.

Schema

  • New navigates-to edge kind (event → route); JSON schema regenerated (drift gate green).

Eval

  • New effects golden check: event → effect edge → target (route path / endpoint / state name).
  • New fixture b3-programmatic-nav covering all four effect kinds + shape-matched navigation + the unresolved-nav flag.

Verification

  • pnpm -r build / typecheck / test: 84 parser-react tests pass (8 new in effects.test.ts), core schema-drift gate green.
  • pnpm eval: 176 pass · 0 fail, lineage precision/recall 1.000, match accuracy 1.000.

🤖 Generated with Claude Code

…ate (B3)

Mine resolved handler bodies for effects, each a typed edge from the EventNode
(TRACKER step 3.2, failure modes B3 + B2 dispatch half):

- navigate()/router.push/history.push → navigates-to a RouteNode. Target folded
  to :param form (reusing endpoint resolution) and joined to a route by exact
  path then param-agnostic shape, so navigate(`/users/${id}`) reaches /users/:userId.
  A target that resolves to a shape with no declared route flags "unresolved-nav".
- fetch/axios/wrapper call in a handler → triggers a data source.
- dispatch(thunk()) / dispatch(action()) → writes-state on the slice, via new
  action/thunk→slice maps in the store registry.
- setState setter (setOpen(…)) → writes-state on the local useState slot.

Handler resolution is unified: prop-drilled (B1), local refs, and inline arrows
all resolve through the same machine, now emitting every effect kind. Handler
expressions are captured per event during body extraction; detectRoutes runs
before the effect pass so navigate targets can join to routes.

Schema: add navigates-to edge kind (event → route); regenerate JSON schema.
Eval: add `effects` golden check (event → effect edge → target); new fixture
b3-programmatic-nav covering all four effect kinds + the unresolved-nav flag.
84 parser tests pass; eval green (176 pass, precision/recall 1.000).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit fea78dd into development Jul 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants