feat: journey query — lazy page→event→effect expansion, cyclic-safe (B5/B6)#20
Merged
officialCodeWork merged 1 commit intoJul 14, 2026
Merged
Conversation
…B5/B6)
Add journeys(graph, start, { depth }) in core (TRACKER step 3.3). Given a route
path, component name, or instance id, it enumerates user-journey paths at query
time: on each screen the user fires an event whose action effect (step 3.2)
either navigates to another route — continuing on the next page — or terminates
the path at a fetch or state write.
- Per-path visited-set of pages: a node may recur across sibling paths but never
loops within one, so a list ↔ detail cycle yields a finite path that ends
"cycle" (B6) instead of hanging. depth=50 on a cyclic graph still returns in <1ms.
- depth caps navigation levels; the boundary path ends "depth-limit" and the
result is flagged truncated. maxPaths caps total fan-out.
- Steps carry the EdgeCondition that gated them (populated by step 3.5).
- Screen events include those handled by the page component and any component in
its render subtree, so a button living in a child component is on the page.
Also expose it end-to-end: new `coderadar journeys <start>` CLI command renders
each path (▸ page • event → navigate ⇢ fetch ✎ state-write, with ↩ cycle).
Eval: new `journeys` golden check (page-sequence + end) and fixture
b6-cyclic-journeys (list ↔ detail loop). Core journeys.test.ts covers navigate/
fetch expansion, cycle termination, large-depth safety, depth cap, start
resolution, and condition threading. 29 core + 84 parser tests pass; eval green
(185 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.3 — Journey query (lazy expansion)
Failure modes B5/B6. Adds
journeys(graph, start, { depth })in core — the third of CodeRadar's three core requirements (match · attribution · journeys).Given a route path (
/users/:id), component name, or instance id, it enumerates user-journey paths at query time: on each screen the user fires an event whose action effect (step 3.2) either navigates to another route — continuing on the next page — or terminates the path at a fetch or state write.Cyclic-safe by construction (B6)
Per-path visited-set of pages: a node may recur across sibling paths but never loops within one. A list ↔ detail cycle yields a finite path that ends
cycleinstead of hanging —depth=50on a cyclic graph still returns in <1 ms.depthcaps navigation levels; the boundary path endsdepth-limitand the result is flagged truncated.maxPathscaps total fan-out.EdgeConditionthat gated them (populated by step 3.5).Now testable end-to-end 🎉
New
coderadar journeys <start>CLI command. Full pipeline on the b6 fixture:Plus the existing
find(screenshot text → component) andtrace(component → data/state/events) commands.Eval
journeysgolden check (asserts a path visiting an ordered page sequence with a givenend).b6-cyclic-journeys(list ↔ detail loop).journeys.test.ts: navigate/fetch expansion, cycle termination, large-depth safety, depth cap, start resolution (route/component/instance), condition threading.Verification
pnpm -r build / typecheck / test: 29 core + 84 parser tests pass.pnpm eval: 185 pass · 0 fail, precision/recall 1.000, match accuracy 1.000.🤖 Generated with Claude Code