Skip to content

docs(approvals): approvals on an object that declares closedStates - #38563

Merged
os-project-manager merged 2 commits into
claude/o5-data-approvals-trunkfrom
claude/issue-37766-approvals-guide
Nov 29, 2026
Merged

os-project-manager merged 2 commits into
claude/o5-data-approvals-trunkfrom
claude/issue-37766-approvals-guide

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #37766 (slice D, the approvals guide, and carried note N43; the card stays open for N45)

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:写应用的人在「审批」指南里多了一节,讲在声明了关闭状态的对象上配置审批要满足什么、发起被拒时提交人看到什么、撤回后单据停在哪个值;平台行为不变。
  • 为什么做:这是「对象声明关闭状态」那条能力的审批收尾卡的指南部分,让作者在能力发布前就能照着配对。
  • 出错会怎样:只改文档,写错只会误导读者,不影响任何运行中的应用,可以直接撤回。
  • 要你做什么:无。

What changes

One new section in content/docs/automation/approvals.mdx, "Approvals on an object that declares closedStates" (anchor closed-states), placed before "Why", plus ADR-0044 and ADR-0162 in "See also". Docs only; no code, no changeset (no published package ships content/docs/**), label skip-changeset.

Every sentence was read against the code on the trunk claude/o5-data-approvals-trunk, not the card text: packages/plugins/plugin-approvals/src/approval-opening-check.ts, approval-opening-refusal.ts, approval-service.ts (judgeOpening, mirrorStatusField, abandonedValueOnClosingField, approvalWroteHeldValue, voidRefusedOpening, reportRefusedMirror, recall, abandonForDeadRun, notifyDecisionOutcome), translations/messages.ts, packages/objectql/src/closed-state-lock.ts and closed-state-values.ts, packages/services/service-automation/src/root-run.ts, and ADR-0162 D5 as revised.

The opening refusal's lead was read on PR #38546's head (claude/issue-37766-opening-lead, 2668361) and then on the trunk, which merged it at d313098 before this branch was pushed: where the only gaps are the host's or an unreadable flow, the lead is the closedStates lead, not the "closes on its approval field" lead. The guide describes that behaviour and quotes no message text.

Not described: any author-time (validate, build or publish) refusal. That is N45, ruled separately (ruling record 7253749311), and lands in its own PR; the guide describes the refusal at an approval's first request only.

Card bullet to guide sentence

Card (slice D, N43) Guide sentence that answers it
What an abandoned approval leaves "What an abandoned approval leaves": "Three writers abandon a request: its submitter's recall ...; an administrator's override of a pending request ...; and the sweep that releases a record held by a dead run." followed by the three-step order (a closed value the approval did not write is left alone; otherwise recalled; otherwise the value at submit, the default, empty, a closed value passed over at each step).
What a field owes an approval on an object that closes on its outcome "What the mirror field owes": declares pending and the object closes on neither pending nor returned; pending among the moves out of a closed approved or rejected; no readonlyWhen and no visibleWhen on a request status option. Plus the paragraph on rules and hooks that cannot be read ahead and how a refused mirror write is handled.
What a flow owes "What the flow owes": one mirror field for every step; no pause between two steps; a node type without a descriptor; no map of approvals on the parent's record; readable whole; and the host's ground (a job service).
What a refused opening is for the person who submitted "What a refused opening is for the person who submitted": "The approval node fails the run with a VALIDATION_FAILED error, and that failed run is what the person who submitted sees. Its message names the record ..., and then, for each gap, the flow, the step, the object, the field and what is missing."
The one mirror field for every step "One mirror field for every step. Every approval step that can act on a record of the object names the same mirror field as the concerned step."
The pause that may not stand between two steps "No pause between two steps. Between two steps means after a step is decided, either way, and before the next step opens. ..."
An approval of each item under a map runs as an approval of its own "Each item under a map is an approval of its own record": "each item's request is filed on that item ... and what follows is judged for that record alone" (see the acceptance notes for how far that holds on the trunk).
An approval that does not mirror onto the closing field does not open a closed document "An approval that does not mirror onto the closing field": "It moves nothing on the closing field, so it does not open a closed document: a record that is closed stays closed through it ..."
Keep "round" for the resubmissions of ADR-0044 "ADR-0044 numbers those resubmissions as the rounds of a request, and the word means nothing else on this page." The new section uses the word nowhere else.
N43: a node type without a descriptor between two approval steps is refused, start/end are not "A node whose type publishes no descriptor counts as one that can pause, and so does a node whose type the platform cannot read: such a node between two approval steps refuses the approval. The structural types start and end have no executor and never pause, so the end of a map body or of a subflow body refuses nothing." (canPause and STRUCTURAL_TYPES in approval-opening-check.ts.)

Tests

Docs only: no test pins prose, and none was added. The local evidence is the derived docs gate list, run at head dc3081f (all 45 derived commands, each exit 0; detail below).

Acceptance notes

Verification

Read first, by risk:

  1. content/docs/automation/approvals.mdx, "What the flow owes": the condition list against approval-opening-check.ts.
  2. The same file, "What an abandoned approval leaves": against abandonedValueOnClosingField.
  3. The same file, "What a refused opening is for the person who submitted": against judgeOpening and openingRefusalText.

Two-minute check: pnpm check:doc-anchors && pnpm check:doc-authoring from the repository root. Expected: both exit 0.

Local docs gates at dc3081f (derived by dispatch-gates --commands for content/docs/automation/approvals.mdx)

Every derived command exited 0:

  • node scripts/check-adr-links.mjs and --self-test, check-closing-keyword-parity.mjs and --self-test, check-comment-mask-corpus.mjs, check-doc-route-spelling.mjs --advisory and --self-test, check-docs-section-name.mjs and --self-test, check-section-landing-index.mjs and --self-test, scripts/ci/plan-test-core-shards.mjs --self-test
  • pnpm check: adr-anchors, ci-filter-parity, closed-ceremony-text, corpus-claim-drift, cross-package-test-inputs, doc-anchors, doc-authoring, doc-frontmatter, docs-audit-scope, docs-redirects, docs-single-h1, docs-spec-enumerations, docs-transcript-drift, driver-memory-census, gitlink-declared, nul-bytes, pm-expected-skips, published-readme-links, react-page-adapter-contract, refd-timer-probe, role-word, skill-identifier-liveness, vendor-version-stamps, watch-hint-literal
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions, check:doc-security-posture
  • pnpm --filter @objectstack/spec run check:docs, check:empty-state, check:liveness, check:skill-examples, check:strictness-ledger, check:variant-docs, check:yaml-examples

check:docs-transcript-drift and check:skill-examples first answered PREREQUISITE NOT MET (exit 3, unbuilt lint and client packages). They were rerun after pnpm --filter '@objectstack/lint...' build and pnpm --filter '@objectstack/client-react...' --filter '@objectstack/client...' build under the verify lock (VERDICT command-exit 0 both) and exited 0. Reconciliation: dispatch-gates --ran: 45 derived, 45 run, 0 NOT-MEASURED (a derived zero: every row records an exit code). overlap-check --base=origin/claude/o5-data-approvals-trunk: VERDICT clean.


Generated by Claude Code

What the check at an approval's first request asks of the mirror field and
the flow, what a refused opening is for the submitter, what an abandoned
approval leaves, and how an approval that does not mirror onto the closing
field and an approval per map item behave. Read against the trunk's
approvals plugin and ADR-0162 as revised.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5phEgfPTCgvPqh4ER2
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 29, 2026
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation labels Nov 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5phEgfPTCgvPqh4ER2

Final green head · 2026-11-29T10:17Z — dc3081f6090eb8e07e4c4872b0fc0312344fa4f6

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB

席位核对 — REWORK · L1-b · area o5-data · Head-sha dc3081f6090eb8e07e4c4872b0fc0312344fa4f6 · 2026-11-29T10:20Z

L1 of PR #38563 (#37766 slice D, claim 7253782583). Net diff from the trunk at merge-base d31309867d: one file, content/docs/automation/approvals.mdx, +189/−1. It is docs only with no contract face, so no L2 is owed. One body item, no head move. The guide reads true against the code at its base. The trunk has since moved under it.

Checklist (l1-face --pr 38563 at dc3081f: 1 flag, read below)

  • Shape flag (base is the trunk): expected for a trunk slice. Part of #37766, no closing keyword. No published package is touched, so skip-changeset holds. Clause-②: no · Metadata-protocol: none.
  • Gates: 29 success, 18 expected skip, 0 failed, 0 pending, mergeable_state clean.

Sentence by sentence, against the code at this head

  • Intro. closed-state-lock.ts answers 409 RECORD_LOCKED to callers outside the system context, on the record and its master_detail lines. The check reads nothing where no registered object declares the key (appDeclares).
  • Which approvals are judged. The check runs before the insert, keyed by the root run. A later request carries the first request's stamp and is not judged. A request on the record since the root run started that records no root run makes the request open unjudged.
  • Concerned. IN_APPROVAL_STATUSES is pending, returned, approved, rejected. The visibleWhen list is REQUEST_STATUSES, which adds recalled.
  • The field owes. judgeField 1–3 matches the text: it declares pending, the object does not close on pending or returned, state_machine moves out of approved/rejected include pending, and there is no readonlyWhen or option visibleWhen.
  • Refused mirror writes. The text matches closesOnApprovalOutcome, isFirstRequestOfApproval, voidRefusedOpening (cancelled, approver index emptied, timeline note, run fails with the refusal) and reportRefusedMirror (an error line, a timeline line with no actor, the admins' notice).
  • The flow owes.
    • other_field / no_field both ways.
    • The map body counts unless every item is a record (anyOther).
    • canPause: no type or no descriptor counts as a pause. start, end, approval_revise and the call types do not.
    • map_with_approval unless itemsShowNoRecord, only over concerned parent objects.
    • unreadable_flow.
    • no_job_service for any step object that declares the key.
  • Refused opening. VALIDATION_FAILED, with the lead chosen by gapsAreAboutTheField (fix(approvals): the opening refusal says the object closes on its approval field only where a gap is about that field #38546) and the warning that names the gap kinds.
  • The put-back order. abandonedValueOnClosingField 1–3, with approvalWroteHeldValue keyed per record. The required-and-empty sentence holds because the record validator judges a readonly field for shape only.

REWORK (body only)

  1. The body's "Not on the trunk, so not written" bullet is now false. The trunk moved to 978bb2b1 (feat(approvals): on a closing field, an approval's decision is written when the approval is over (ADR-0162 item 8, slice 3) #38540, Approval status mirror: a write that does not land, a run that ends between two steps, and a decision whose run cannot resume must not leave a document closed on an unfinished approval (ADR-0162 item 8) #37767 slice 3, merged after this head was cut). It now carries all three things that bullet lists: the held-back decision, an approval whose run ends between two steps being abandoned, and nothing written while another approval's request mirrors onto the same field. The guide's text stays literally true. Item 8's door marks the approval __abandoned on its latest request and does not record recalled, so "Three writers abandon a request … Each records recalled" still describes item 7's request-level abandonment. But once this merges, the section headed "What an abandoned approval leaves" sits beside a second, unmentioned way an approval is abandoned. Rewrite the bullet: these are on the trunk since 978bb2b1 and not written here. Name the carrier as Approval status mirror: a write that does not land, a run that ends between two steps, and a decision whose run cannot resume must not leave a document closed on an unfinished approval (ADR-0162 item 8) #37767's item 8 guide text, after slice 5. Say that the carrier also revisits this section's heading and its "Three writers" enumeration. No prose change is asked here, and the head need not move: the file does not overlap slice 3, so no trunk merge is needed for this file.

Send me the body edit and I will read the delta only. After ACCEPT the area merges into the trunk with --no-ff.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5kjJ6Qm1z2mRox4ZbB

席位核对 — ACCEPT · L1-b · area o5-data · Head-sha dc3081f6090eb8e07e4c4872b0fc0312344fa4f6 · 2026-11-29T10:22Z

Delta of REWORK 7254375377. Only the body changed this round; the head is the same commit.

R1 is closed.

The prose readings of 7254375377 stand unchanged on this head. The body edit re-triggered event checks: 1 is pending at this read, and the other 29 are success. The area merges into the trunk with --no-ff once that check concludes green.

@os-project-manager
os-project-manager merged commit 97f9f1f into claude/o5-data-approvals-trunk Nov 29, 2026
51 checks passed
@os-project-manager
os-project-manager deleted the claude/issue-37766-approvals-guide branch November 29, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants