Repository navigation
Commit 24b6ae5
docs(skills, client): deciding an in-app AI pending action is the person's own act, on their signed-in session (#34230)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9MdVWiH4D1vGNt7peGkinYV)_
Fixes #34189
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:技能 `objectstack-ai`、`client-sdk.mdx`、`actions-as-tools.mdx` 的
ObjectOS 提示框和 `client.ai.pendingActions` 的注释改成:批准或拒绝应用内 AI
待批动作,只能由发起那次调用的本人,在应用里用自己的登录会话来做;令牌(哪怕是本人的)和 AI
身份都会被拒,只能列出,不能决定;模型自己的确认不算数。加了一个 eval 用例。
- 为什么改:ADR-0087 `in-app-pending-action-decided-by-person` 的规则由
cloud#4607 在应用内的门落地后,这四处还在教「用令牌或 SDK 调 POST 去决定」,照做会被拒。
- 风险与回滚:只改文档和注释文本,无代码行为、导出或类型变化;回滚就是 revert 本 PR。⚠ 落地时机:必须与带 cloud#4607
的 cloud 版本钉位升级同一发布窗口或之后合并,不能更早,否则文档会先于门的行为。
- 先看:`skills/objectstack-ai/SKILL.md` 的 Human-in-the-loop
段;`content/docs/api/client-sdk.mdx` 的 Pending actions
注释;`packages/client/src/index.ts` 的 `pendingActions` 注释。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs | grep
objectstack-ai/SKILL` 预期 6068 / 6801,全绿。
- 需要你做的:批准本 PR(在 cloud#4607 的钉位升级同窗或之后合并)。
## What changes
Four teaching sites now say what the in-app door's confirmation rule
says: deciding (approve or reject) an in-app AI pending action is the
person's own act, on their signed-in session to the app. Listing stays
as written.
1. `skills/objectstack-ai/SKILL.md`, **Human-in-the-loop** paragraph:
drops "an operator approves or rejects … (or via `GET/POST
/api/v1/ai/pending-actions/...`)". The queue is listed in the inbox or
via `GET /api/v1/ai/pending-actions`. Only the person the call ran as
decides, in the app on their signed-in session. Another user's
`ai:approve` does not decide it. An API key or token (even the person's
own) is refused, and so is an AI identity and any call that arrives
through an AI door. "The model's own confirmation does not decide the
item, and neither does a `confirm` on the call: the item waits for the
person." A second approver goes through the approvals engine (`held`).
The next sentence now reads "Whether *your* action is queued".
Frontmatter untouched.
2. `content/docs/api/client-sdk.mdx`: the "Listing takes `ai:read`,
deciding takes `ai:approve`" comment moves above `approve`. It keeps the
`ai:read` listing sentence and now says, as the skill does, that only
the person the call ran as decides, on their signed-in session. Another
user's `ai:approve` does not decide it. A client on an API key or token
(even the person's own) lists and does not decide, and an AI identity is
refused too. The block's closing "These methods are for … server code,
jobs, CLIs, tests" now excepts approve and reject.
3. `packages/client/src/index.ts`: the `pendingActions` namespace
docblock and the `approve` / `reject` docblocks say the same, AI
identity included. The existing "`ai:read` vs `ai:approve`, handle the
403" paragraph is unchanged. Docblock text only, no code change.
4. `content/docs/ai/actions-as-tools.mdx`, ObjectOS callout (about line
236): one sentence. "an operator resolves it from the **AI Pending
Actions** Studio inbox (approve re-runs the same dispatcher; reject
records a reason)" now says only the person the call ran as decides it
in the inbox, on their own signed-in session. Another user's
`ai:approve` does not decide it, and an API key, a token or an AI
identity is refused. Approve runs the action as that person with every
gate re-checked; reject records a reason. Sources: the spec contract's
in-app door section, points 1-3 (**Who decides**, **Which credential**,
**As whom it runs**: "never as a synthetic AI principal, through the
same admitted sequence as any action call, every gate and permission
re-checked"). The seat widened the claimed surface to this sentence
(card comment 6905036822). Review N1 also changed "operators expect
single-click yes/no" to "people expect". Nothing else in the callout
changes.
5. `skills/objectstack-ai/evals/skills-tools-knowledge.json`: case 6. An
operator script on an API token is asked to approve the queue. Expected:
list via the token, decide in the app on the person's session. An AI
identity is refused too, and the model's own confirmation does not
count. `must_contain` is `pendingActions.list`, `signed-in session` and
`refused`. `must_not_contain` is `pendingActions.approve(`.
Self-consistent: no `must_contain` string is in `must_not_contain`, and
`expected_output` contains every `must_contain` string and neither
`must_not_contain` string.
6. `.changeset/34189-pending-action-decide-session.md`:
`@objectstack/skills` patch, `@objectstack/client` patch (the docblock
ships in its `.d.ts`). It says the door enforces this from the runtime
release that carries the in-app door, not from this package release.
## Premise check (on `origin/main` dfb8ed3)
- **The door.** No package in this repository serves
`/api/v1/ai/pending-actions/:id/approve|reject`. `git grep
pending-actions` over `packages/services/**` and `packages/plugins/**`
has no hits. The only hits are the client
(`packages/client/src/index.ts`) and the protocol schemas
(`packages/spec/src/api/protocol.zod.ts` 4386 and 4403). The door is
served by the AI service in cloud, and its refusal is cloud#4607, which
this container cannot read. So no refusal code is quoted here. The text
says "refused" and names no code. The client's existing `ai:approve` 403
note is kept as written.
- **What main states**, and the source of each sentence in this PR:
- "only the person the call ran as decides; another user's `ai:approve`
does not" comes from `packages/spec/src/contracts/ai-service.ts`, "The
in-app assistant door: the same rule, its own channel", point 1 (**Who
decides**).
- "a signed-in session to the app; an API key or token is refused, even
the person's own" comes from the same section, point 2 (**Which
credential**): "an API key, a delegated or OAuth token and any other
service credential are refused, whoever it resolves to". Rule 4 adds "a
person's own API key resolves as that person, and is refused there all
the same".
- "a second approver goes through `held`" comes from point 1: "A host
that wants a second person to approve the write uses the existing `held`
outcome".
- The ADR-0087 entry
`packages/spec/src/migrations/entries/semantic/18.in-app-pending-action-decided-by-person.ts`
(`replacement`) says the same, from the release whose in-app door
enforces it.
- "Listing takes `ai:read`" is the client's existing text. The spec pin
`ai-service.test.ts` holds that `listPendingActions` carries none of the
deciding points.
- **What each place taught before:** SKILL.md:164-166 "an operator
approves or rejects in Studio's **AI Pending Actions** inbox (or via
`GET/POST /api/v1/ai/pending-actions/...`)". client-sdk.mdx:426-427
"Listing takes `ai:read`, deciding takes `ai:approve` — a caller that
can see the queue may still be refused on approve. Handle the 403." The
client docblock taught only the `ai:read` vs `ai:approve` split.
- Because the rule binds only once the cloud door ships, this PR waits
for that release (card item 4).
## Tests
- No behaviour change. `pnpm --filter @objectstack/client test`: Test
Files 58 passed (58), Tests 812 passed (812). `pnpm --filter
@objectstack/client typecheck`: exit 0, under `os-verify-lock`.
- No forced test edits.
## Acceptance notes
- **Tier.** `skills/**` mandates CONTRACT_REVIEW_TIER (`dispatch-gates
--tier`: MANDATORY, no one-line exit). Measured quota exemption, on the
maintainer's 2026-11-15 21:53Z 「fable 不多了,后续契约复审找review 席位」: this PR was
authored at the thread's default tier, never lower. The at-tier L2
review is review#2's. Tier H: stays draft.
- **Skill size** (after review round 1).
`skills/objectstack-ai/SKILL.md` went from 23736 to 24291 bytes, 427 to
434 lines and 5929 to 6068 tokens (+139; review round 2 added 14). The
ceiling is 6801, so the ratchet row does not move. Whole package (sum of
every `skills/*/SKILL.md`): 4593 to 4600 lines, 59219 to 59358 tokens.
Bundle total: 248073 at the round-2 head. The eval file went from 1081
to 1343 tokens; eval fixtures are measured, not ratcheted.
- **Same family:** `content/docs/ai/actions-as-tools.mdx` taught the
same superseded route. Round 1 reported it to the seat. The seat widened
the surface (6905036822), and round 2 fixes that one sentence.
## Review round 1 (review#2 record 6905434558, PASS on 3690b8e; seat
fix order r1)
- **S1** chose the cheaper fix: "Whether *your* action is held" now
reads "is queued" (+2 bytes). The second-approver clause stays where it
was.
- **S2:** the skill now names the other refused class, an AI identity
and any call that arrives through an AI door (contract point 2), and
rule 5: neither the model's own confirmation nor the caller's `confirm`
counts. Eval 6's expected output names both. The client docblocks,
`client-sdk.mdx` and `actions-as-tools.mdx` add "an AI identity" in
their existing clause.
- **S3:** the `ai:approve` precondition is dropped from
`client-sdk.mdx`, which now uses the skill's wording. The class-level
client docblock had no precondition. Its new paragraph now says "another
user's `ai:approve` does not decide it", and its old `ai:read` vs
`ai:approve` 403 paragraph stays.
- **N1:** `actions-as-tools.mdx` "operators expect" now reads "people
expect". Only that word changed.
- **N2:** `client-sdk.mdx`'s closing comment adds "(approve and reject
excepted: those are the person's own act in the app)".
- **N3:** eval 6 `must_contain` "list" is now "pendingActions.list", and
"/approve" is dropped from `must_not_contain`. The expected output
contains every `must_contain` string and no `must_not_contain` string. A
script asserted this.
- **N4:** the changeset adds "The door enforces this from the runtime
release that carries the in-app door, not from this package release."
## Review round 2 (review#2 record 6905889120, PASS on f407440; seat
fix order r2)
- **S1:** the skill's rule-5 sentence is now scoped to the queue item,
in the reviewer's wording: "The model's own confirmation does not decide
the item, and neither does a `confirm` on the call: the item waits for
the person." The MCP table rows (`delete_record`, `delete_records`,
`run_action`) are untouched. Eval 6 is unchanged.
- **N1:** the client class docblock and `client-sdk.mdx` were reordered
so that the list/get clause speaks only of the API-key/token client: "a
client on an API key or token (even the person's own) can list and get,
never decide; an AI identity is refused too". The two places are kept
consistent.
- **Body:** the 两分钟验证 line now expects the measured 6068 / 6801.
- **N2:** no change; the reviewer noted it only.
## Verification
Round 4 head 769aad7. `dispatch-gates` reported no STALE TREE, so
there was no merge this round; the round 3 merge of `origin/main`
7be32d3 stands. `@objectstack/client` was rebuilt first, and its
`typecheck` and `test` ran in the same lock (`os-verify-lock` VERDICT
command-exit 0; Test Files 58 passed (58), Tests 812 passed (812)).
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` gave 102 commands, and all of them plus
`check:skill-refs` were run on 769aad7. The earlier rounds ran the
same set at cf09e9f (after a full `pnpm build`), at 3690b8e and at
f407440. All of them were green.
`node scripts/pm/dispatch-gates.mjs --ran` at 769aad7 reported: "102
derived famil(ies) accounted for — 102 run, 0 NOT-MEASURED (a DERIVED
zero)". All 103 recorded commands exited 0, including
`check:skill-docs`, `check:skill-refs` and `check:skill-examples`.
<details><summary>Notes on the run</summary>
- `node scripts/check-plugin-teardown-shape.mjs --self-test` needs its
pinned fixture commit 621a487 in a shallow clone (`git fetch --no-tags
origin 621a487`). With it, the
self-test exits 0 with 48 cases.
- `node scripts/check-skills-token-ratchet.mjs` reads
`skills/objectstack-ai/SKILL.md is 6068 tokens (ceiling 6801; headroom
733)`.
- Every check-run of the PR is CI's to report.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind. (no names
added)
- [x] 3. No formatter ran; `pnpm lint` is a CI-owned repo scan, not run
locally (the diff is prose and docblock text).
- [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: n/a.
- [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 with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmSoMtbbwL3w3kwCmky
<!-- signed: domain:skills#2 · os-steve ·
session_01ADHkmSoMtbbwL3w3kwCmky -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent f806608 commit 24b6ae5
6 files changed
Lines changed: 58 additions & 11 deletions
File tree
- .changeset
- content/docs
- ai
- api
- packages/client/src
- skills/objectstack-ai
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | | - | |
254 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | | - | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
420 | 425 | | |
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
424 | 429 | | |
425 | 430 | | |
426 | | - | |
427 | | - | |
428 | 431 | | |
429 | 432 | | |
430 | 433 | | |
431 | | - | |
| 434 | + | |
| 435 | + | |
432 | 436 | | |
433 | 437 | | |
434 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7714 | 7714 | | |
7715 | 7715 | | |
7716 | 7716 | | |
| 7717 | + | |
| 7718 | + | |
| 7719 | + | |
| 7720 | + | |
| 7721 | + | |
| 7722 | + | |
7717 | 7723 | | |
7718 | 7724 | | |
7719 | 7725 | | |
| |||
7743 | 7749 | | |
7744 | 7750 | | |
7745 | 7751 | | |
| 7752 | + | |
| 7753 | + | |
| 7754 | + | |
7746 | 7755 | | |
7747 | 7756 | | |
7748 | 7757 | | |
| |||
7753 | 7762 | | |
7754 | 7763 | | |
7755 | 7764 | | |
7756 | | - | |
| 7765 | + | |
| 7766 | + | |
| 7767 | + | |
| 7768 | + | |
| 7769 | + | |
7757 | 7770 | | |
7758 | 7771 | | |
7759 | 7772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
55 | 65 | | |
0 commit comments