Skip to content

Commit c242d97

Browse files
committed
docs(skills): the approval fault-edge eval asks for a TypeScript defineFlow; the refusal members read as optional
The eval prompt now says the project's files are absent and asks for the flow as a TypeScript defineFlow, so its single-quoted tokens match the form the answer is asked for. The reference and the changeset say the body may carry innerRefusal and userMessage, and the changeset names the list item that now holds the entry-criteria note. Claude-Session: https://claude.ai/code/session_012MmDsS4GoHCgYwA2uv3n3C Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1af6115 commit c242d97

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎.changeset/34637-approval-fault-edge-skill.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ docs(skills): `objectstack-automation` teaches the `fault` edge on a write after
77
Clause-②: no
88
Metadata-protocol: none
99

10-
`references/state-machines-and-approvals.md` § Branching, side-effects & rejection gains one bullet. When a step on the `approve` / `reject` branch writes a record that a record hook, a validation rule or a permission may refuse, the flow draws a `fault` edge from that step to a handler: the refusal takes that edge and the decision answers normally. Without the edge `POST …/approve` (or `/reject`) answers `500 RESUME_FAILED`: the decision stands (`finalized: true`), the run is stranded, and the body carries `innerRefusal` (`{ code, message }`) and `userMessage`, the hook's declared sentence for the approver. One eval case covers it.
10+
`references/state-machines-and-approvals.md` § Branching, side-effects & rejection gains one bullet. When a step on the `approve` / `reject` branch writes a record that a record hook, a validation rule or a permission may refuse, the flow draws a `fault` edge from that step to a handler: the refusal takes that edge and the decision answers normally. Without the edge `POST …/approve` (or `/reject`) answers `500 RESUME_FAILED`: the decision stands (`finalized: true`), the run is stranded, and the body may carry `innerRefusal` (`{ code, message }`) and `userMessage`, the hook's declared sentence for the approver. One eval case covers it; its prompt asks for the flow as a TypeScript `defineFlow`.
1111

12-
Paid in place, the token ceiling does not move. Four restatements were cut, each keeping another home: the send-back section's text diagram (the paragraph above it and the snippet below it trace the same path), and three bullets of § Branching: "Conditional step" (the discount-approval example's `needs_director` node and the comment on its `e1` edge), the send-back pointer (the section it pointed to), and "Hard reject" (the examples' `reject` edges into an `end` node).
12+
Paid in place, the token ceiling does not move. Four restatements were cut, each keeping another home: the send-back section's text diagram (the paragraph above it and the snippet below it trace the same path), and three bullets of § Branching: "Conditional step" (the discount-approval example's `needs_director` node and the list item above it that names the `e1` edge), the send-back pointer (the section it pointed to), and "Hard reject" (the examples' `reject` edges into an `end` node).

‎skills/objectstack-automation/evals/approval-fault-edge.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"evals": [
44
{
55
"id": 1,
6-
"prompt": "Build a flow `mrp_plan_approval` on `purchase_plan`: when `status` becomes `submitted`, the planning manager approves or rejects, and on approve a step sets `status` to `adopted`. That object's `beforeUpdate` hook refuses the write when capacity is already taken. A refusal must send the plan back to its owner; the approver's click must not fail or leave the run stuck.",
7-
"expected_output": "An `approval` node (`type: 'approval'`, the planning manager as a `position` approver, not the deprecated `role` spelling) whose `label: 'approve'` edge enters an `update_record` step, and a `fault` edge from THAT step to a handler: `{ source: 'adopt_plan', target: 'bounce_back', type: 'fault' }`, the handler returning the plan to its owner (an `update_record` or a `notify`). The hook's refusal takes that edge, the decision answers normally and the run finishes. Without the edge `POST …/approve` answers `500 RESUME_FAILED`: the decision stands, the run is stranded, and the body carries `innerRefusal` and `userMessage`, the hook's declared sentence. Not an ordinary edge labelled as an error (it traverses on success), and not the reject branch: the approver approved.",
6+
"prompt": "Build a flow `mrp_plan_approval` on `purchase_plan`: when `status` becomes `submitted`, the planning manager approves or rejects, and on approve a step sets `status` to `adopted`. That object's `beforeUpdate` hook refuses the write when capacity is already taken. A refusal must send the plan back to its owner; the approver's click must not fail or leave the run stuck. None of the project's files are in this directory: write the flow as a TypeScript `defineFlow` in your answer.",
7+
"expected_output": "A TypeScript `defineFlow`. An `approval` node (`type: 'approval'`, the planning manager as a `position` approver, not the deprecated `role` spelling) whose `label: 'approve'` edge enters an `update_record` step, and a `fault` edge from THAT step to a handler: `{ source: 'adopt_plan', target: 'bounce_back', type: 'fault' }`, the handler returning the plan to its owner (an `update_record` or a `notify`). The hook's refusal takes that edge, the decision answers normally and the run finishes. Without the edge `POST …/approve` answers `500 RESUME_FAILED`: the decision stands, the run is stranded, and the body may carry `innerRefusal` and `userMessage`, the hook's declared sentence. Not an ordinary edge labelled as an error (it traverses on success), and not the reject branch: the approver approved.",
88
"files": [],
99
"assertions": {
1010
"must_contain": [

‎skills/objectstack-automation/references/state-machines-and-approvals.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ These are wired on the **graph**, not in node config:
362362
(SKILL.md § Failure routing): the refusal takes it and the decision answers
363363
normally. Without one, `POST …/approve` (or `/reject`) answers
364364
`500 RESUME_FAILED`: the decision stands (`finalized: true`), the run is
365-
stranded, and the body carries `innerRefusal` (`{ code, message }`) and
366-
`userMessage`, the hook's declared sentence to show the approver.
365+
stranded, and the body may carry `innerRefusal` (`{ code, message }`) and
366+
`userMessage`, the hook's declared sentence for the approver.
367367
- **Roll back on reject** — route the `reject` edge as a **back-edge** to an
368368
earlier node so the submitter can revise.
369369

0 commit comments

Comments
 (0)