You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 270a105
Browse filesBrowse the repository at this point in the historyBrowse files
docs(skills): the automation skill says a record under approval can still be deleted
Best practice 2 of the approvals reference now says a delete of a pending
record lands, cancels the request and cascades its master_detail rows, and
where it is refused instead. The lockRecord config row states its edit bound
again, and the redundant field-group arm is dropped. The pending changeset
of the earlier data-model wording is reworded to match what shipped.
Every added token is paid for by deletion in the same file.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgVUz5oS8fMgmncxU96
Copy file name to clipboardExpand all lines: .changeset/37529-skills-data-model-publish-checks.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,8 @@ Metadata-protocol: none
9
9
10
10
Published prose and evals only; the checks already run.
11
11
12
-
-`objectstack-data``rules/relationships.md`: a roll-up whose childobject has no `lookup` or `master_detail` field referencing the parent, or whose `relationshipField`is no field of the child, is refused at publish (`rollup/child-without-parent-reference`).
12
+
-`objectstack-data``rules/relationships.md`: a roll-up is refused at publish (`rollup/child-without-parent-reference`) when it omits `relationshipField` and the child object has no `lookup` or `master_detail` field referencing the parent, or when its `relationshipField`names no field of the child.
13
13
-`objectstack-data``rules/field-types.md`: only `lookup`, `master_detail`, `user` and `tree` read `reference`; on any other type but `summary`, publish refuses it (`field/reference-on-non-reference-type`).
14
-
-`objectstack-automation``references/state-machines-and-approvals.md`: `lockRecord` locks the record and its `master_detail` child rows only; a `lookup` child drawn as a body table stays editable while pending, reported as the warning `approval-detail-editable-while-pending`.
14
+
-`objectstack-automation``references/state-machines-and-approvals.md`: `lockRecord` locks the record and its `master_detail` child rows only; a `lookup` child shown in the record's details (`relatedList: 'primary'`) stays editable while pending, reported as the warning `approval-detail-editable-while-pending`.
15
15
16
16
No file grew past its ceiling: each addition is paid for by shorter wording in the same file.
- Best practice 2 now says that deleting a record whose approval is pending is not refused: the delete lands, cancels the request and cascades the record's `master_detail` child rows. It is refused whole with `409 RECORD_LOCKED` only where that cascade has no single transaction to run in, or a child row has a second cascading parent.
15
+
- The `lockRecord` config row states its bound again: it locks the record from edits.
16
+
- Best practice 2 no longer names a parent field group as a way a `lookup` child is shown in the record's details: a group places a `lookup` child only when it already declares `relatedList: 'primary'`.
17
+
18
+
The file did not grow past its ceiling: each addition is paid for by deletion in the same file.
-**One rule per field.** Parallel lifecycles (`status` + `payment_status`)
38
37
are separate `state_machine` rules.
39
38
-**`initialStates`** gates INSERT: a record created in a state outside
@@ -61,7 +60,7 @@ Notes:
61
60
62
61
### Approvals (Flow Nodes)
63
62
64
-
Since **ADR-0019** there is no standalone approval-process type. An approval is
63
+
There is no standalone approval-process type (ADR-0019). An approval is
65
64
authored as an **Approval node** (`type: 'approval'`) on an ordinary flow — the
66
65
run **suspends** when it reaches the node and **resumes** down the node's
67
66
`approve` / `reject` out-edge once a decision is recorded. Multi-step review is
@@ -125,22 +124,20 @@ the same literal goes inside `defineFlow(...)`, and `` cel`…` `` builds each
125
124
126
125
**Send back for revision** is distinct from `reject` (terminate) and from a
127
126
comment thread (the request stays pending).
128
-
Send-back is a **flow movement**: the request finalizes as `returned`, the run
127
+
It is a **flow movement**: the request finalizes as `returned`, the run
129
128
walks a **`revise`** out-edge to an **`approval_revise`** node (the *revise
130
129
window*) where the record unlocks and the submitter reworks it, and an explicit
131
130
*resubmit* re-enters the approval node over a **declared back-edge**, opening
132
131
round N+1 with a fresh approver slate.
133
132
134
-
Three pieces:
135
-
136
-
1.**`revise` out-edge** — a third branch label alongside `approve` / `reject`,
137
-
targeting an **`approval_revise`** node. It must be that node type: the window
133
+
1.**`revise` out-edge** — targets an **`approval_revise`** node. It must be
134
+
that node type: the window
138
135
is a *service-owned* pause (`resumeAuthority: 'service'`), ended only by
139
136
`POST /api/v1/approvals/requests/:id/resubmit`; a `wait` is
140
137
`resumeAuthority: 'any'`, so a raw run-resume would walk the back-edge
141
-
unchecked. The node takes **no config** — there is no signal to wait on.
138
+
unchecked. The node takes **no config**.
142
139
2.**`type: 'back'` resubmit edge** — the edge from the revise window back into
143
-
the approval node MUST be typed `'back'`. Only this
140
+
the approval node MUST be typed `'back'`. This
144
141
legalizes the cycle: `registerFlow` validates the graph **minus `back` edges**
145
142
as a DAG, so an **unmarked** cycle is rejected. At
146
143
run time a back-edge traverses normally.
@@ -173,7 +170,7 @@ A decision is recorded through `ApprovalService.decide()` (or the REST routes
173
170
`POST /api/v1/approvals/requests/:id/approve` | `/reject`), a reject always
174
171
with a non-blank `comment`, its reason (else `400 VALIDATION_ERROR`). That
175
172
finalizes the `sys_approval_request` and **resumes** the suspended run down the
176
-
matching branch — you never resume the flow by hand, and you *cannot*: the
173
+
matching branch — you *cannot* resume the flow by hand: the
177
174
`approval` node declares `resumeAuthority: 'service'`, so
178
175
`POST /api/v1/automation/:name/runs/:runId/resume` answers **403** for a run
179
176
parked on one (including via a `subflow` pause) and changes nothing.
@@ -339,7 +336,7 @@ Object-hook `ctx` is a different vocabulary — see **objectstack-data**
339
336
|`approvers`| Who may act (≥ 1 — see Approver Types above). Each approver may carry an optional **`group`** label (e.g. `{ type: 'position', value: 'crm_auditor', group: 'finance' }`) — with `behavior: 'per_group'`, approvers sharing a label form one group; unlabelled approvers each form their own |
340
337
|`behavior`|`first_response` (first approver decides), `unanimous` (all must approve), `quorum` (`minApprovals` of N — M-of-N collective sign-off), or `per_group` (EACH approver `group` must reach `minApprovals` — one-from-each-group sign-off). In every mode a single rejection finalizes the node as `rejected`. Default `first_response`|
341
338
|`minApprovals`| Approvals required — total for `quorum`, per group for `per_group`. Omitted ⇒ ALL resolvable approvers under `quorum`, `1` per group; clamped at runtime so a misconfiguration can never deadlock |
342
-
|`lockRecord`| Lock the record while pending. Default `true`|
339
+
|`lockRecord`| Lock the record from edits while pending. Default `true`|
343
340
|`approvalStatusField`| Business-object field to mirror `pending`/`approved`/`rejected`/`returned`/`recalled` onto (should be readonly) |
344
341
|`onEmptyApprovers`| What an EMPTY resolved slate does: `admin_rescue` (default — request opens on the organization's administrators; never waves through, never kills the run), `fail` (node fails — treat an empty slate as a config bug), `auto_approve` (skip the request, continue down `approve` with `output.autoApproved = true` — opt-in because it silently waves the record through), `fallback` (request opens on the sibling `fallbackApprovers` instead — same shape as `approvers`, required by this policy and refused under any other; a fallback that itself resolves to nobody degrades to `admin_rescue`). Declare it explicitly on any node with an `expression` approver (linted) |
345
342
|`excludeSubmitter`|`true` drops the run's submitter (`submitter_id`) from the resolved slate, whatever approver type produced them — segregation of duties; a slate it empties takes the `onEmptyApprovers` route, never a silent pass. `onEmptyApprovers: 'auto_approve'` is **refused** beside it (it would approve exactly the request this exists to stop): use `admin_rescue`, `fail` or `fallback`. Default `false`|
@@ -371,17 +368,20 @@ These are wired on the **graph**, not in node config:
371
368
without joining `sys_approval_request`.
372
369
2.**Keep `lockRecord: true`**, or approvers chase a moving target. It locks
373
370
the record and its `master_detail` child rows only: a `lookup` child shown
374
-
in the record's details (`relatedList: 'primary'`, or a parent field group)
0 commit comments