feat: action effects — handler bodies → navigate/fetch/dispatch/setState (B3)#19
Merged
officialCodeWork merged 1 commit intoJul 14, 2026
Conversation
…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>
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.
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
navigates-toa RouteNode. Target folded to:paramform (reusing endpoint resolution) and joined to a route by exact path, then param-agnostic shape — sonavigate(`/users/${id}`)reaches/users/:userId. A target resolving to a shape with no declared route flagsunresolved-nav(visible, never silent).triggersa data source.writes-stateon the slice, via new action/thunk→slice maps in the store registry.setOpen(…)) →writes-stateon the localuseStateslot.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;
detectRoutesruns before the effect pass so navigate targets can join to routes.Schema
navigates-toedge kind (event → route); JSON schema regenerated (drift gate green).Eval
effectsgolden check: event → effect edge → target (route path / endpoint / state name).b3-programmatic-navcovering all four effect kinds + shape-matched navigation + theunresolved-navflag.Verification
pnpm -r build / typecheck / test: 84 parser-react tests pass (8 new ineffects.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