Skip to content

feat(studio): flow designer authoring for the approval revise loop (ADR-0044) #1770

Description

@os-zhuang

Follow-up to #1744 / PR #1769 (ADR-0044), split out on purpose.

The engine, service, REST and Console inbox for send-back-for-revision are merged: an approval node may declare a revise out-edge to a wait node, with a type: 'back' edge closing the loop back into the approval node (cycle validation now runs on the graph minus declared back-edges), guarded by maxRevisions on the node config.

What's missing is authoring: today the revise loop is reachable only by hand-editing flow JSON (see showcase_budget_approval in examples/app-showcase/src/flows/index.ts for the canonical shape). The Studio flow designer should:

  1. offer the revise branch on the approval node's out-edge labels (alongside approve/reject), with maxRevisions already surfaced via the node's published configSchema;
  2. let the author draw/mark a back-edge (type: 'back') and render it distinctly (dashed/curved return arrow);
  3. validate the reduced-graph DAG rule client-side so an unmarked cycle is flagged while a declared revise loop passes;
  4. ideally a one-click "add revision loop" affordance that drops the wait node + both edges in one gesture.

References: docs/adr/0044-approval-send-back-for-revision.md, APPROVAL_BRANCH_LABELS (packages/spec/src/automation/approval.zod.ts), FlowEdgeSchema.type (packages/spec/src/automation/flow.zod.ts).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions