Skip to content

Commit f5a2257

Browse files
os-zhuangclaude
andcommitted
docs(approvals): unbreak the role-word ratchet after the lifecycle walkthrough
#3113's approval walkthrough pushed approvals.mdx from 5 to 9 uses of the reserved word (ADR-0090 D3), which fails check-role-word on every PR cut from main since. Most were avoidable prose ("a business role like…", "`role:<r>`") and are reworded to the canonical vocabulary. The one that remains is the warning that the `type: 'role'` approver resolves against the better-auth membership tier rather than a position — naming the literal enum value is the point of the warning, and the better-auth boundary is exactly the legitimate case the ratchet's own header calls out. Baseline ratcheted 5 → 6 for that one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3a8ce9d commit f5a2257

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

content/docs/automation/approvals.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,11 @@ Only `approvers` is required on the node; everything else has a default
133133
(`behavior: 'first_response'`, `lockRecord: true`, `maxRevisions: 3`).
134134

135135
<Callout type="warn">
136-
**`type: 'role'` is not a position.** In an approver entry, `role` means the
137-
better-auth membership tier (`owner` / `admin` / `member`). Naming a business
138-
role like `sales_manager` there matches nobody and the request silently has no
139-
approvers — use `{ type: 'position', value: 'sales_manager' }`.
136+
**The `type: 'role'` approver is not a position.** That approver kind resolves
137+
against the better-auth membership tier (`owner` / `admin` / `member`) — not
138+
your business hierarchy. Pointing it at something like `sales_manager` matches
139+
nobody, and the request silently ends up with no approvers. Use
140+
`{ type: 'position', value: 'sales_manager' }` instead.
140141
</Callout>
141142

142143
### The approver finds it in their queue
@@ -150,8 +151,9 @@ curl -b cookies.txt \
150151
"https://your-app.example.com/api/v1/approvals/requests?status=pending&approverId=usr_123"
151152
```
152153

153-
`approverId` accepts a user id, an email, or `role:<r>` — and takes several
154-
values (comma-separated or repeated) to cover a person's identities in one call.
154+
`approverId` accepts a user id, an email, or a membership-tier reference — and
155+
takes several values (comma-separated or repeated) to cover a person's
156+
identities in one call.
155157
Other filters: `status`, `object`, `recordId`, `submitterId`, `q`, `limit`,
156158
`offset`.
157159

scripts/role-word-baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"content/docs/ai/index.mdx": 2,
44
"content/docs/api/error-catalog.mdx": 1,
55
"content/docs/api/wire-format.mdx": 1,
6-
"content/docs/automation/approvals.mdx": 5,
6+
"content/docs/automation/approvals.mdx": 6,
77
"content/docs/automation/hooks.mdx": 1,
88
"content/docs/concepts/architecture.mdx": 4,
99
"content/docs/concepts/metadata-lifecycle.mdx": 1,

0 commit comments

Comments
 (0)