Uh oh!
There was an error while loading. Please reload this page.
feat(studio): simulate approval decisions in the flow debugger - #1955
Merged
Conversation
The designer-time flow simulator treated an `approval` node as a pass-through
that fanned out to every out-edge at once, so an ADR-0044 revise loop could not
be debugged — it walked approve/reject/revise simultaneously and tripped the
step ceiling on the back-edge.
Model an approval as a durable pause (like wait/screen): the run suspends at the
node, and the Debug panel offers its out-edge labels (approve/reject/revise) as
decision buttons. Resuming routes down ONLY the chosen branch, mirroring how the
engine resumes a suspended approval by branch label — so a full revise loop is
now walkable: revise -> wait -> resubmit (back-edge) -> round 2 -> approve. An
unmatched decision falls back to fanning out (engine label-fallback), logged.
- flow-simulator.ts: approval pause case; resume({screenOutputs?, decision?}) +
resumeApproval() routing by edge label.
- FlowSimulatorPanel.tsx: per-decision Continue buttons; Run no longer
blind-resumes an approval pause.
- Tests: simulator approval routing + full revise-loop walk; panel UI walk.
Follows #1954 (ADR-0044 revise-loop authoring).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang added a commit
that referenced
this pull request
Jun 24, 2026
) The flow designer's structural validation (un-declared cycle, missing entry, duplicate ids, dangling edges, …) was only visible in the Debug panel. Surface it INLINE on the canvas so a broken graph is obvious without opening Debug: - An un-declared cycle paints its offending edges + nodes red (the same `validateFlowDraft` the simulator preflight uses); the closing edge's tooltip points at the fix (mark it as a back-edge). A declared revise loop (ADR-0044 back-edge) is excluded from cycle detection and stays un-flagged. - An error banner on the canvas lists the structural-error messages. The cycle Diagnostic now carries the closing node path so the canvas can derive the exact edges/nodes to highlight. FlowPreview runs validation continuously and passes `invalidNodeIds` / `invalidEdges` / `validationErrors` to FlowCanvas; invalid edges/nodes also expose `data-invalid` for styling + tests. Follows #1954, #1955. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 24, 2026
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 freeto 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.
What & why
Follow-up to #1954 (ADR-0044 revise-loop authoring). That PR let authors draw a revise loop, but the designer-time Debug simulator still couldn't walk one: it treated an
approvalnode as a pass-through that fanned out to every out-edge at once (approve + reject + revise simultaneously), so a revise loop just bounced around the back-edge until it tripped the step ceiling. You could draw the loop but not simulate it.Change
Model an
approvalas a durable pause (likewait/screen) — which is what it is in the engine (ADR-0019):pausedReason: 'approval').approve/reject/revise).branchLabel— instead of fanning out.Files
previews/simulator/flow-simulator.ts—approvalpause case;resume({ screenOutputs?, decision? })+resumeApproval()(route by out-edge label).previews/FlowSimulatorPanel.tsx— per-decision Continue buttons when paused at an approval;Runno longer blind-resumes an approval pause (would fan out).Verification
done— the same path a browser check would exercise.type-check0 errors;eslintclean.Follows #1954.
🤖 Generated with Claude Code