Skip to content

Commit f1ddc98

Browse files
os-zhuangclaude
andauthored
docs(skill): teach the automation skill the ADR-0044 send-back-for-revision shape (#2294)
The objectstack-automation skill documented approve/reject approvals (ADR-0019) but not the ADR-0044 revise loop, so AI-authored approval flows omit it (and a revise loop hand-built without the back-edge gets rejected by registerFlow). Add a "Send-back for revision" section to the Approvals area: the `revise` out-edge → a signal `wait` node, the resubmit edge typed `type: 'back'` (the only thing that legalizes the cycle — graph-minus-back-edges must be a DAG, authors opt in edge by edge), and the `maxRevisions` budget. Calls out the two shapes the compile-time flow lint flags (dead-end revise; unmarked back-edge) and points at the canonical showcase_budget_approval. Completes the agent-teaching slice of #2274 (ADR-0044), alongside the compile-time lint (#2279), the flow-builder `back` edge style (#2291), and the engine's already-specific cycle-rejection hint. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e8246e3 commit f1ddc98

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

skills/objectstack-automation/SKILL.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,56 @@ is one diagram a reviewer (or AI) can read end-to-end.
297297
}
298298
```
299299

300+
### Send-back for revision (ADR-0044)
301+
302+
Approval centers also model **send back for revision** (退回修改) — distinct from
303+
`reject` (terminate) and from a comment thread (which keeps the request pending).
304+
Send-back is a **flow movement**: the request finalizes as `returned`, the run
305+
walks a **`revise`** out-edge to a `wait` node where the record unlocks and the
306+
submitter reworks it, and an explicit *resubmit* re-enters the approval node over
307+
a **declared back-edge**, opening round N+1 with a fresh approver slate.
308+
309+
```
310+
approval ──approve──▶ …
311+
──reject───▶ …
312+
──revise───▶ wait (signal; record unlocked, submitter edits)
313+
└──resubmit──[type:'back']──▶ approval (round N+1)
314+
```
315+
316+
Three pieces author it:
317+
318+
1. **`revise` out-edge** — a third branch label alongside `approve` / `reject`,
319+
targeting an ordinary `wait` node (signal flavour).
320+
2. **`type: 'back'` resubmit edge** — the edge from the wait node back into the
321+
approval node MUST be typed `'back'`. This is the *only* thing that legalizes
322+
the cycle: `registerFlow` validates the graph **minus `back` edges** as a DAG,
323+
so an **unmarked** cycle is rejected — you opt in, edge by edge. At run time a
324+
back-edge traverses normally (it just re-enters the node).
325+
3. **`maxRevisions`** on the approval `config` (default `3`) — the budget of
326+
send-backs per run; exceeding it **auto-rejects** (resumes down the `reject`
327+
edge). `maxRevisions: 0` disables send-back, so never pair `0` with a `revise`
328+
edge.
329+
330+
```typescript
331+
{
332+
id: 'manager_review', type: 'approval',
333+
config: { approvers: [{ type: 'role', value: 'manager' }], lockRecord: true, maxRevisions: 2 },
334+
},
335+
{ id: 'wait_revision', type: 'wait', label: 'Awaiting Revision',
336+
config: { eventType: 'signal', signalName: 'budget_revision' } },
337+
// …among the approval's edges…
338+
{ id: 'rev', source: 'manager_review', target: 'wait_revision', label: 'revise' },
339+
{ id: 'back', source: 'wait_revision', target: 'manager_review', label: 'resubmit', type: 'back' },
340+
```
341+
342+
> Two mistakes the compile-time flow lint flags: a `revise` edge whose wait node
343+
> never loops back (a dead end `registerFlow` accepts but that leaves the
344+
> submitter nowhere to resubmit), and a resubmit edge left **without**
345+
> `type: 'back'` (an unmarked cycle `registerFlow` rejects). Resubmit is an
346+
> explicit verb (`POST /api/v1/approvals/requests/:id/resubmit`), never a
347+
> record-save. See `examples/app-showcase``showcase_budget_approval` for the
348+
> canonical shape.
349+
300350
### Re-homing the old process model
301351

302352
If you've seen the pre-ADR-0019 `ApprovalProcess.create({...})` shape, every

0 commit comments

Comments
 (0)