Skip to content

Commit d576d5b

Browse files
committed
docs(spec): spell the acted_as slot forms as the approvals changesets do, and say what absent cannot prove
Claude-Session: https://claude.ai/code/session_01YDt3PzwfrkuFzUBF89WPmM Co-authored-by: Claude <noreply@anthropic.com>
1 parent 828d3f2 commit d576d5b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎.changeset/21458-spec-approval-action-acted-as.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Clause-②: yes
88

99
**What it declares.** One optional string member on `ApprovalActionRow` in `@objectstack/spec/contracts`, the row type of an approval request's action log (`IApprovalService.listActions`, served at `GET /api/v1/approvals/requests/:id/actions` and typed by the client SDK):
1010

11-
- `acted_as?: string` is the slot the action was admitted under, in the slot's stored spelling as it stood in the request's `pending_approvers`: a `position:<p>` address (or its older `role:<p>` spelling), an email, or a user id.
11+
- `acted_as?: string` is the slot the action was admitted under, in the slot's stored spelling as it stood in the request's `pending_approvers`: a `position:<name>` address (or `role:<name>`, the deprecated pre-rename spelling), an email, or a user id.
1212
- It is never a person. The person who acted is `actor_id`, which under ADR-0118 D1 holds a `sys_user` id or nothing. A slot addressed by a user id carries that id in `acted_as` as the slot's address, which makes no claim about who acted.
13-
- Absent means the action was not admitted through a slot (a submitter's own action, a system action, or an admin override, which `via_override` marks), or the row was written before the slot was recorded. Absent reads as "not recorded", not as "no slot".
13+
- Absent means the action was not admitted through a slot (a submitter's own action, a system action, or an admin override, which `via_override` marks), or the row was written before the slot was recorded. So absent alone never proves that no slot was involved.
1414

1515
**What moves for consumers.** Nothing in this package writes the member, and every existing export and member is unchanged: a row without `acted_as` conforms exactly as before. The approvals service is its producer, and that package's own changeset states when `listActions` starts returning it. Until then every row omits it, which is the member's declared absent case. A client that renders the action log can show `acted_as` beside the actor's name as the capacity the actor acted in.

‎packages/spec/src/contracts/approval-service.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,9 @@ export interface ApprovalActionRow {
516516
/**
517517
* The pending-approver slot this action was taken as: the slot's address in
518518
* its stored spelling, exactly as it stood in the request's
519-
* `pending_approvers` when the action was admitted — a `position:<p>`
520-
* address (or its older `role:<p>` spelling), an email, or a user id.
519+
* `pending_approvers` when the action was admitted — a `position:<name>`
520+
* address (or `role:<name>`, the deprecated pre-rename spelling), an email,
521+
* or a user id.
521522
*
522523
* "Who acted" and "as which slot" are two facts. One holder of a position
523524
* can act for it, and one person can hold several slots, so the slot is
@@ -531,8 +532,8 @@ export interface ApprovalActionRow {
531532
* Absent means one of two things, and this member alone does not tell them
532533
* apart: the action was not admitted through a slot (a submitter's own
533534
* action, a system action, or an admin override — see `via_override`), or
534-
* the row was written before the slot was recorded — "not recorded", which
535-
* is not the same claim as "no slot".
535+
* the row was written before the slot was recorded. So absent alone never
536+
* proves that no slot was involved: "not recorded" is not the same claim.
536537
*/
537538
acted_as?: string;
538539
}

0 commit comments

Comments
 (0)