Uh oh!
There was an error while loading. Please reload this page.
feat(studio): author the approval revise loop in the flow designer (ADR-0044) - #1954
Merged
Merged
Conversation
…DR-0044) The ADR-0044 send-back-for-revision loop — an approval node's `revise` out-edge to a wait point, closed by a declared `type: 'back'` edge that re-enters the approval (round N+1) — was previously reachable only by hand-editing flow JSON. The flow designer now authors all four pieces: - Revise branch: an approval out-edge offers approve / reject / revise via a new Approval-branch picker in the edge inspector; `maxRevisions` surfaces on the approval node's form (engine configSchema online, hardcoded fallback off). - Back-edge authoring: a new Connection-type select marks an edge `back` (also fault / conditional). A back-edge renders as a dashed amber return arc and is excluded from the layered auto-layout — exactly as the engine excludes it from DAG validation — so the loop reads top-to-bottom. - Client-side DAG validation: the simulator preflight flags an UNmarked cycle (graph minus declared back-edges must be a DAG, mirroring registerFlow); a declared revise loop passes; a self-loop is caught. - One-click "add revision loop": an affordance on an approval node drops the signal wait node + the revise edge + the declared back edge in one gesture, reproducing the canonical showcase_budget_approval shape. Refs framework#1770. Follows the flow-builder work in #1927 and #1930. 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 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>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
os-zhuang added a commit
to objectstack-ai/objectstack
that referenced
this pull request
Jun 24, 2026
…ocol (#2291) `FlowCanvasEdgeStyleSchema` gains a `back` value alongside solid/dashed/dotted/bold, marking an ADR-0044 declared back-edge (a `revise` loop's resubmit edge). Flow-builder-protocol consumers can render it as a distinct curved/dashed return arc, set apart from forward flow — matching the objectui designer's canvas (objectstack-ai/objectui#1954). Additive enum value: public API surface + factory signatures unchanged. Part of #2274 (ADR-0044 AI/designer parity). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
os-zhuang added a commit
that referenced
this pull request
Jun 24, 2026
…ape (#1974) The wait inspector read only `waitEventConfig.{eventType,signalName,…}`, but the engine also accepts the looser `config.{eventType,…}` shape that the canonical showcase_budget_approval (and AI-authored flows) use — so a showcase-shaped wait node showed blank fields in the designer. Flow config fields gain `fallbackPath`: tolerant read (loose shape displays + dependent fields reveal), canonical write that prunes the fallback (migrate-on-edit), and the fallback config key suppressed from Advanced. The `wait` fields fall back to `config.*`. Designer now matches engine tolerance. Refs #1954 (ADR-0044). 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
Implements the Studio flow-designer authoring for the ADR-0044 approval send-back-for-revision loop — closing the 4 authoring gaps from framework#1770. The engine / service / REST / inbox side is already merged in framework; only the visual authoring was missing, so the loop was reachable only by hand-editing flow JSON.
The loop shape (canonical
showcase_budget_approval): an approval node'sreviseout-edge walks to a signalwaitpoint where the submitter reworks the record; a declaredtype: 'back'edge re-enters the approval node (round N+1). DAG cycle validation runs on the graph minus declared back-edges;maxRevisionsguards runaway loops.The four gaps
approve/reject/revisevia a new Approval-branch picker in the edge inspector (mirrorsAPPROVAL_BRANCH_LABELS).maxRevisionssurfaces on the approval form — from the engine's publishedconfigSchemaonline, with a hardcoded fallback inflow-node-config.tsfor offline / older backends.back(alsofault/conditional). A back-edge renders distinctly as a dashed amber return arc (own#flow-arrow-backmarker) and is excluded from the layered auto-layout — exactly as the engine excludes it from DAG validation — so the loop reads top-to-bottom instead of dragging its target below the wait point.validateFlowDraft) flags an UNmarked cycle as an error (graph minus declared back-edges must be a DAG, mirroringregisterFlow); a declared revise loop passes; a self-loop is caught. Surfaces in the Debug panel and blocks Run.waitnode + thereviseedge + the declaredbackedge in one gesture, reproducing the canonical showcase shape.Files
previews/flow-canvas-layout.ts— excludetype:'back'from layering;backEdgePath/rightAnchor/backEdgeLabelAnchor/isBackEdge.previews/FlowCanvas.tsx— dashed amber back-edge rendering + marker;addReviseLoop()one-click mutation.previews/flow-canvas-parts.tsx— the approval-node revise-loop affordance onNodeCard.inspectors/FlowEdgeInspector.tsx— approval-branch picker + connection-type select (writesedge.type).inspectors/flow-node-config.ts—maxRevisionson the approval group (fallback).previews/simulator/flow-sim-validate.ts—findCycle()+ DAG-modulo-back-edges rule;flow-sim-types.tsgainsSimEdge.type.i18n.ts— en + zh strings.Verification
showcase_budget_approvalflow (Studio flow designer):reviseedge shows the Approval-branch picker = 退回修改 (Revise); the approval node showsmaxRevisions = 2(from the engine configSchema).wait_revision -> manager_reviewedge renders as a dashed amber return arc; inspector Type = 回边(退回修改环) (back-edge), labelresubmit.waitnode (Signal /revision) +revise+backedges.findCycle); back-edge geometry + layout exclusion;maxRevisionsfield presence.type-checkclean;eslintclean (0 errors).Refs framework#1770. Follows the flow-builder work in #1927 and #1930.
🤖 Generated with Claude Code