Repository navigation
docs(data-modeling): closed states, the closedStates key and every authoring note (ADR-0162) - #38993
Conversation
…uthoring note (ADR-0162) A new data-modelling page documents the key: its shape, what a field must be, the unit (the record and its direct master_detail lines), what is refused and for whom, the 409 RECORD_LOCKED refusal, and the way out. It carries every authoring note of ADR-0162, the three the ruling names under their own headings, and names the registered handler beside the script body where it says what runs elevated. The showcase's paid invoice is the worked example. The approvals guide's two "the record unlocks" passages point at closed states. Claude-Session: https://claude.ai/code/session_01WGufzhKEbEnW8pwZRgK2gJ Co-authored-by: Claude <noreply@anthropic.com>
check:docs-audit-scope refuses a hand-written page the list does not name; regenerated with check-audit-scope.mjs --write (+1, -0). Claude-Session: https://claude.ai/code/session_01WGufzhKEbEnW8pwZRgK2gJ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ Final green head · 2026-12-01T18:46Z · zone osa-data
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review · PR #38993 (#37772) · head 1db9570 · 2026-12-01T18:50ZVERDICT: ACCEPT. No must-fix and no should-fix.
Next: zone landing. |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhKEbEnW8pwZRgK2gJ 2026-12-01T18:51Z · Landing: L1 ACCEPT on head 1db9570 (7321664623; both zone questions accepted, one accepted nit). Not governed (0 of 5 paths), docs only, no L2 owed, CI 32 success / 0 failure, mergeable clean. Ready for review and auto-merge (squash). |
Fixes #37772
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
content/docs/data-modeling/closed-states.mdx, listed in the section's navigation (meta.json, after Validation Rules) and on the section landing page. It documents theclosedStateskey: its shape, what a field must be, the unit (the record and its directmaster_detaillines), what is refused and for whom, the409 RECORD_LOCKEDrefusal, and the way out. The showcase's paid invoice (examples/app-showcase/src/data/objects/invoice.object.ts,closedStates: { status: ['paid'] }) is the worked example.bodyand the handler registered withregisterActiontogether, both running through the same elevated context.content/docs/ui/actions.mdx(section "Authorization inside an action") already names both. No other closed-state passage undercontent/docs/**says that a script body runs elevated, so no other file changes for N15.content/docs/automation/approvals.mdx: both "the record unlocks" passages now point at closed states. The finalization passage says that on a declaring object the record is held until the approval is over and is closed where the outcome is a closed value. The send-back passage says that a record closed through another field stays closed in the revise window. The item-7 section (#closed-states) is linked and not restated.scripts/docs-audit/handwritten-docs.json: +1 row, regenerated withcheck-audit-scope.mjs --write, becausecheck:docs-audit-scoperefuses a hand-written page that the list does not name.Every statement is about behaviour that has shipped. Each note was checked against code or a test on
main(see Acceptance notes).Tests
Docs-only. The page's two TypeScript examples carry the
os:checkmarker, andcheck:skill-examplestype-checks them against the built spec. I also parsed them at runtime against the built@objectstack/spec:Runtime parse of the page's examples (spec dist at this head)
The invoice, its
master_detailline and the reopen action go throughdefineStack. As a reverse check, the same invoice declaring the non-option valueclosedis refused.Acceptance notes
mainat b53e70f):packages/objectql/src/closed-state-lock.ts, header D2 (closed is read off the stored row; nothing is stored);closed-state-lock.ts#boundByClosedStates, and the approvals guide's#holdand "When the outcome lands on the record" (item 7/8, already on main);closed-state-lock.test.ts, "a write with no principal (no context at all) is refused";packages/runtime/src/action-execution.ts#buildActionExecutionContext("serves every handler an action door dispatches, a host code handler included"); a declarativeoperation: 'update'writes as the caller (spec livenessaction.jsonoperation, live);closed-state-lock.test.ts"a system context writes and deletes a closed record and its lines";closed-state-lock.test.ts, the D7 Change Owner and hand-over cases;closed-state-lock.test.ts, "a write that closes an open record lands whole...; the next write is refused" and "a line create under a closed master is refused". The console's header-first save isui/packages/plugin-form/src/masterDetailTx.ts#buildMasterDetailEditBatch(the header is op 0). The console's closing-header-last ordering (ADR-0162 item 4) has not shipped, so the page describes today's header-first order;packages/objectql/src/record-lock-read.tsheader,content/docs/api/data-api.mdx#record-locks;closed-state-lock.test.ts"a delete whose cascade reaches a closed record removes no row", and therecord_closed_delete_blockedsentences inpackages/spec/src/system/operation-message.ts;lockReasonon the wire:closed-state-refusal-wire.dogfood.test.ts, "relays neither the developer sentence nor the lock's own members". The page therefore sends readers to the lock read for the reason and does not promise alockReasonon the 409.userActionspredicates).Skills-docs:line": PR feat(objectql)!: a record in a closed state, and its lines, are closed to change and held for its whole approval (closedStates, ADR-0162) #38810's body readsSkills-docs: follow-up #38425. It names the skills follow-up card, not Docs: document closedStates in the data-modelling guide with every authoring note, and point the approvals guide at it (ADR-0162 item 5) #37772. The skills follow-up (skills: the data skill teaches the closedStates key (after #37768) #38425, "skills: the data skill teaches the closedStates key") is filed separately and is open, so the box's intent holds. Its literal first half cannot be met by any PR now that feat(objectql)!: a record in a closed state, and its lines, are closed to change and held for its whole approval (closedStates, ADR-0162) #38810 has merged.content/docs/references/data/object.mdxis generated (build-docs.ts). It is linked and not edited.Verification
content/docs/data-modeling/closed-states.mdx, sections "Automation that acts as the caller" (the approval-hold paragraph is the subtlest claim) and "Line edits go before the closing write" (it states today's console order); thencontent/docs/automation/approvals.mdxaround the two "the record unlocks" passages.node scripts/check-doc-anchors.mjsreports every internal fragment link resolving, including the new ones into the approvals, actions, hooks, data API and administrator guides.Local gates at 1db9570 (dispatch-gates derivation for this diff, reconciled with --ran)
Generated by Claude Code