Repository navigation
Commit b85dff0
docs(approvals): descriptions name the four-leaf viewer block; the automation skill says who admin_rescue opens on (#35066)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_
Fixes #34839
Clause-②: no
Metadata-protocol: none
Served-tier: CONTRACT_REVIEW_TIER
## 维护者速读
- 改了什么:只改文字和一处测试整理,不改运行时行为。① 三处代码注释、三条 QA 清单条目改成和服务端一致:审批请求的 `viewer`
块有四个字段(`can_act`、`is_submitter`、`can_override`、`can_override_approve`),「批准」读
`can_override_approve`,「驳回 / 改派 / 撤回」仍读 `can_override`。② 对外发布的自动化技能里
`onEmptyApprovers` 一行,原来说 `admin_rescue`
下「只有特权管理员能通过改派处理」,现在改成运行时的真实行为:请求直接落到本组织管理员的待办里。③ 一条测试用例把替换掉的 `find` 在
finally 里放回去。
- 为什么改:#34755 合并后服务端多了
`can_override_approve`,这些描述还停在三个字段;技能那一句会让照着技能搭审批的 AI 向用户讲错
`admin_rescue` 的行为。
- 风险与回滚:没有行为变化;技能文件比原来短 9 字节,token 棘轮上限没动。回滚就是还原这一个 PR。
-
先看:`skills/objectstack-automation/references/state-machines-and-approvals.md`
的 `onEmptyApprovers`
行(对外发布,唯一受治理的文件);`docs/qa/platform-checklist/areas/approvals.json` 里
`approvals.record-page-decisions` 的 steps[9] 和 acceptance[4](期望从「菜单里有
Override Approve」改成「没有
Approve」,依据是源码,没有在浏览器里重跑);`ui/packages/app-shell/src/utils/approvalOverride.ts`
的文件头注释。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期看到
`state-machines-and-approvals.md is 5913 tokens (ceiling 5916; headroom
3)` 且整体通过。
- 需要你做的:审阅后合并本 PR,或给出批准评审后由席位落地。落地档位是 Tier H(人合):`check-governed-merges
--branch` 的实测输出是 `landing tier: H(人合) — the maintainer's hand, or an
authorized APPROVED review (GOVERNED_APPROVERS) and then the owning seat
lands it`。低风险技能通道用不上,原因见 Acceptance notes 第 1 条。
## What changes
No behaviour change. Seven files.
**The served block, as read from the runtime.**
`ApprovalService.attachViewers`
(`packages/plugins/plugin-approvals/src/approval-service.ts`) sets four
leaves on every request it serves: `can_act`, `is_submitter`,
`can_override` and `can_override_approve`. The object declares the same
four under `attachedOnRead` (`sys-approval-request.object.ts`).
`can_override_approve` is `can_override` minus an approval of the
viewer's own request. Of the nine declared actions, `approval_approve`
reads `can_override_approve` in its override arm; `approval_reject`,
`approval_reassign` and `approval_recall` read `can_override`.
**Descriptions brought to that reading (items 1 to 4):**
- `packages/spec/src/data/object.zod.ts`: the docblock over the
`attachedOnRead` schema names the four leaves and which action reads
which override leaf. Comment only; the docblock sits on a non-exported
const.
- `packages/platform-objects/src/apps/account.app.ts`: the comment over
the Approvals nav entry said all eight actions gate on `can_act ||
can_override`. It now says every action gates on a leaf of the served
block, and names the four.
- `ui/packages/app-shell/src/utils/approvalOverride.ts`: the module
docblock, the `ViewerBlockLike` docblock and the
`actionAdmittedByOverride` docblock say that the override test is a
substring match on `can_override`, which both leaf names carry. No code
line changes.
- `docs/qa/platform-checklist/areas/approvals.json`: three items, each
with its revision bumped and a history entry dated 2026-11-18, ref
#34839.
- `approvals.inbox-metadata-actions` (9 to 10): steps[3], steps[4] and
acceptance[2].verify name the four leaves.
- `approvals.viewer-gating-submitter-side` (7 to 8):
acceptance[0].verify no longer says Approve is visible on
`can_override`.
- `approvals.record-page-decisions` (8 to 9): steps[9],
acceptance[4].verify and source[4]. The admin of this item submitted the
request, so off the slate the row reads `can_override` true and
`can_override_approve` false, and the folded override menu lists
Override Reject, Override Reassign and the plain Recall, and no Approve.
The text listed Override Approve.
**The skill row (item 5).**
`skills/objectstack-automation/references/state-machines-and-approvals.md`,
the `onEmptyApprovers` row: "request opens, only a privileged admin can
act via Reassign" becomes "request opens on the organization's
administrators". The rest of the row is unchanged. This matches
`content/docs/automation/approvals.mdx` (the manager callout, the
`onEmptyApprovers` paragraph and the section "When a slate names no
one") and the runtime: the `admin_rescue` branch of `openNodeRequest`
resolves `organizationAdministrators` and opens the request on them as
ordinary approvers.
**Test hygiene (item 6).** `approval-override-audit.test.ts`: the
letter-case case keeps the double's original `find` and puts it back in
a `finally` block.
**Changeset.**
`.changeset/34839-approvals-viewer-block-descriptions.md`, patch for
`@objectstack/skills` and `@objectstack/platform-objects`.
## Tests
Head `77dbe40f6e`.
- `pnpm --filter @objectstack/plugin-approvals exec vitest run
--maxWorkers=2 src/approval-override-audit.test.ts`: 20 of 20 passed on
the base copy of the file (`367e324eeb`), and 20 of 20 on the edited
copy.
- `pnpm --filter @objectstack/plugin-approvals exec vitest run
--maxWorkers=2`: Test Files 122 passed (122), Tests 1741 passed (1741).
- `pnpm --filter @objectstack/plugin-approvals typecheck`: exit 0.
- `pnpm --filter @objectstack/spec check:generated`: all 14 generated
artifacts up to date, against a `dist` built from this branch.
- No ablation: no tested behaviour changed.
## Acceptance notes
1. **Low-risk skills arm.** `check-governed-merges --branch` prints
`low-risk skills arm: NOT MEASURED — no reading of the pull request was
handed in` and answers Tier H, fail closed. Read against the arm's own
allowlist in the same script (`LOW_RISK_RIDER_PATTERNS`,
`LOW_RISK_ARM_FILE_PATTERNS`), the arm cannot apply to this PR: every
changed path has to lie under a hit catalog row or be a changeset or
docs Markdown, and five of the seven paths are neither (`packages/spec`,
`packages/platform-objects`, `packages/plugins/plugin-approvals`,
`ui/packages/app-shell`, and the checklist JSON under `docs/`). The
changeset also releases `@objectstack/platform-objects`, and the arm
admits nothing but a skills patch.
2. **Item 6, premise.** The double in that describe block is already
rebuilt before every case (`beforeEach` calls `makeFakeEngine()`), so
the replaced `find` could not reach another case. The `finally` makes
the case self-contained; it fixes no observed leak.
3. **Item 7, no pin added.** A live MySQL lane exists, `Temporal
Conformance (live PG + MySQL)` in `ci.yml`, and it runs the `driver-sql`
suite only. No lane runs `ApprovalService` on a store whose collation
folds letter case: plugin-approvals' integration tests use `driver-sql`
on SQLite, which compares text case-exactly. A pin for the email-target
rule would need a new lane, so none was added.
4. **Checklist item `approvals.record-page-decisions`.** The new
expectation (no Approve in the override menu for the admin who submitted
the request) is read from source: `attachViewers`, the
`approval_approve` predicate, and `DeclaredActionsBar` drawing each
action by its own declared `visible`. It was not re-run in a browser.
5. **What ships.** Built and searched: the `packages/spec` docblock does
not reach `packages/spec/dist` (0 files carry the new sentence; control
`attachedOnRead`, 12 files). The `platform-objects` comment does reach
`packages/platform-objects/dist` (4 files), so the changeset names that
package. `@object-ui/app-shell` is private.
6. **Token ratchet.** The reference file is priced:
`scripts/check-skills-token-ratchet.mjs` holds a row for it at 5916, and
it sat at 5916 with headroom 0. The edit shortens the file from 23661 to
23652 bytes (5913 tokens), so the row is not touched. The whole
published bundle moves by the same 9 bytes; no `SKILL.md` changes.
7. **Open PR #35002** edits another section of the same skill file.
`overlap-check` merges it cleanly with this branch.
8. **Body shape.** This body opens with the attribution comment and ends
with the signed trailer, as the dispatch order and the relay's PR-body
rule ask. The developer agent file says a body carries no HTML comment
of the agent's own writing; the two rules disagree and this PR follows
the dispatch order.
## Verification
<details><summary>Derived gates (dispatch-gates --commands, then
--ran)</summary>
`dispatch-gates --commands` derived 113 families from the tree at
`77dbe40f6e`. Each was run with its exit code captured before any pipe.
- 110 exited 0.
- `pnpm check:dual-build-cjs-loads`: exit 3, PREREQUISITE NOT MET (needs
a full workspace build). NOT MEASURED locally.
- `pnpm check:i18n`: exit 3, PREREQUISITE NOT MET (the workspace CLI is
not built). NOT MEASURED locally.
- `pnpm --dir ui exec vitest run scripts/`: exit 1. Test Files 1 failed,
170 passed, 2 skipped. The one failure,
`unit-registry-absence-collision.test.ts`, could not resolve
`@objectstack/client`, which was not built in this worktree. After
building that package's closure the file was re-run alone: 15 of 15
passed, exit 0. The full family was not re-run.
- `dispatch-gates --ran`: `113 derived famil(ies) accounted for — 111
run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)`, exit 0.
Outside the derived list:
- `node scripts/check-platform-checklist.mjs --changed-from
origin/main`: `OK — 2 anchored file(s) in the change set, 20 anchor(s)
judged, 0 lost`, exit 0.
- `pnpm gen:checklist-status`: exit 0, working tree clean after it.
- `node scripts/check-skills-token-ratchet.mjs`:
`state-machines-and-approvals.md is 5913 tokens (ceiling 5916; headroom
3)`, 58 authored bundle files within their ceilings.
- `node scripts/pm/overlap-check.mjs`: clean against `origin/main` and
#35002.
</details>
<details><summary>Not run locally, left to CI</summary>
- The full test suites of `@objectstack/spec`,
`@objectstack/platform-objects` and `@object-ui/app-shell`: their diffs
are comments only.
- `test:repo`, the repo-wide lint run and the full dogfood battery (the
title carries no `!` and the declaration carries no narrowing arm).
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(a comment changed, no schema)
- [x] 2. Every name I added uses the casing for its kind. (no name
added)
- [x] 3. No formatter ran; `pnpm lint` passes. (the repo-wide lint run
is CI's)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (`check:generated` reports all 14 up to date)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziunkXbDT7wUWqfmWz -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3b4ffb2 commit b85dff0
7 files changed
Lines changed: 84 additions & 40 deletions
File tree
- .changeset
- docs/qa/platform-checklist/areas
- packages
- platform-objects/src/apps
- plugins/plugin-approvals/src
- spec/src/data
- skills/objectstack-automation/references
- ui/packages/app-shell/src/utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
326 | 329 | | |
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
341 | 348 | | |
342 | 349 | | |
343 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | | - | |
2884 | | - | |
2885 | | - | |
2886 | | - | |
2887 | | - | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
2888 | 2891 | | |
2889 | 2892 | | |
2890 | 2893 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
59 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
105 | | - | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | | - | |
| 117 | + | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
| |||
0 commit comments