Repository navigation
feat(spec)!: one pending-confirmation service for every AI door, the in-app pending-action queue leaves IAIService - #38273
Conversation
…firmation service Claude-Session: https://claude.ai/code/session_01L6bhgTrYJvLJfdjfWhNMMV Co-authored-by: Claude <noreply@anthropic.com>
… the changeset Claude-Session: https://claude.ai/code/session_01L6bhgTrYJvLJfdjfWhNMMV Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin e0694a083074bbd444f3abdc06adedff181d0689 && git checkout e0694a083074bbd444f3abdc06adedff181d0689
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e2a0e90025059d066dff4b067a8b70d23bca2680 ff98353378d743b36b4b3dc88998810e91833f92 && git checkout -B drift-repro e2a0e90025059d066dff4b067a8b70d23bca2680 && git merge --no-ff ff98353378d743b36b4b3dc88998810e91833f92
node scripts/docs-audit/affected-docs.mjs --json e2a0e90025059d066dff4b067a8b70d23bca2680
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: PR #38273, ① Derived judgments
② Semver levelClause-②: yes (narrowing) — on the PR body and in the changeset, as amendment 7238080787 fixes it. ③ Boundary flags
④ Design judgment
M1 (must-fix) — the row the service answers cannot carry a hand-off the same file declares legal. The service docblock now says S1 (should-fix) — rule 1 of the contract still says "Rules 2 to 4 below are the MCP doors' channel. The in-app door asks through its own channel, under "The in-app assistant door" below". The section it points to is now titled "the same rule, the same channel" and says every door hands off to one service. The contract contradicts itself in one docblock, and no pin reads rule 1's sentence. Rule 1 should say what still differs (the in-app door does not elicit; it hands off) and no more. The rest holds. The three deciding points are on N1 (nit) — the FROM → TO rows do not say that
Implementing files (the three tests) — they pin what the contract says: the four members gone from Implemented-by: VERDICT: FAIL |
…at rule 1's doors share one channel Claude-Session: https://claude.ai/code/session_01L6bhgTrYJvLJfdjfWhNMMV Co-authored-by: Claude <noreply@anthropic.com>
…ing-confirmation service, not the retired IAIService members Claude-Session: https://claude.ai/code/session_01L6bhgTrYJvLJfdjfWhNMMV Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Delta review of PR #38273 against the round-1 record (comment 7238295862, FAIL at M1: closed ① Derived judgmentsNo accept-set or public-surface change in the delta: prose in ② Semver levelClause-②: yes (narrowing) — unchanged on the PR body and in the changeset, with ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
The mapping, against the ruling, sentence by sentence:
Rule 1 now says every door hands off to the same service, rules 2 to 4 are how the MCP doors ask, and the in-app door never elicits. It no longer contradicts the section it points to. N2 (nit) — the mapping calls the
Implementing file in the delta, Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Second delta review of PR #38273, against the delta record 7238406142 (PASS at M1: closed ① Derived judgmentsThe delta is one comment in A correction to round 1: that record said nothing on ② Semver levelClause-②: yes (narrowing) — unchanged on the PR body and in the changeset, with ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
The four Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head ff98353 · card #33806 (step 1 of 3) · area s2-ai · 2026-11-28T12:48ZL1 checklist
Tier: H. Landing: hand-off to the maintainer follows this record. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Tier H hand-off · 2026-11-28T12:49Z · head ff98353 · approver 维护者速读
|
…action and shows Expired for a lapsed one (objectstack-ai#38326) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu52iwRDMp8T1eW25d28D4co)_ Fixes objectstack-ai#38250 repo:objectstack#2 · os-sales · session_01L6bhgVC7KKvrgZyWpM75L8 Clause-②: no Metadata-protocol: none ## 维护者速读 - 控制台用户重新打开一段旧对话时,聊天里的 AI 确认卡片如果对应的操作已经失效,会直接显示「已过期」,不再显示「通过 / 拒绝」按钮;以前要点一下按钮才知道已过期。本人亲手拒绝过的,打开后显示为已拒绝。 - 这是上一张「AI 待确认操作过期显示已过期」留下的后半截,解决恢复对话时按钮还在的问题。 - 只多一次读取:每张还在等确认的卡片打开时,读一次它对应条目的状态(已有的单条读取接口,客户端 SDK 的 pendingActions.get 用的就是它),不改服务端;读不到时按钮照旧,点了仍会显示「已过期」。有问题可直接撤回。 - 无 ## What changes - `ui/packages/plugin-chatbot/src/useHitlInChat.ts`: each card the messages hold in `approval-requested` with a `pendingActionId` has its row read once per mount, `GET {apiBase}/pending-actions/:id` through the same authenticated fetch the decision uses (the item read `@objectstack/client`'s `pendingActions.get` uses; the AI Approvals inbox reads the list). `settledDecisionOf(row)`: a lapsed row (`isLapsedPendingAction`, from objectstack-ai#34255) settles the card on `{ state: 'expired' }`; a row a person rejected settles it on the rejection, drawn as a rejection made in this session is (`success`, `decision: 'rejected'`, `Rejected: REASON` / `Rejected.`). Any other row, a non-2xx, or no answer leaves the card as it was. A decision made on the card before the read lands is never overwritten. The read is deduplicated by pending-action id, so a streamed message or a new `headers` object re-reads nothing. - New test `ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx` (4 cases, one of them the press-before-read race). - Four existing test files scripted `fetch` in call order (a fifth, the bearer-session pin, counted requests: see the CI notes below) for the decision POST, and the row read now comes first: `useHitlInChat.test.tsx`, `writeApprovalPending-37860.test.tsx` and `AiChatPage.approvalRehydration.test.tsx` answer the read 404 and keep their scripted POST replies in order (`decisionReply`); `useChatConversation.test.tsx`'s `pressApprove` builds a fresh `Response` per call and counts POST URLs only. Every assertion they made still holds; `AiChatPage.approvalRehydration` additionally pins that the read went to `…/pending-actions/pa_44`. - `AiChatPage.approvalRehydration.test.tsx` also gains a module-top `import '@object-ui/plugin-grid';` (`check:test-source-alias` asks it of an edited test whose source reach loads that plugin lazily). - `app-shell/src/console/rendererFetch.bearerSession-37225.test.tsx`: the in-chat approval pin now expects the row read too (CI, below). - `.changeset/38250-restored-approval-card-reads-row.md`: patch for `@object-ui/plugin-chatbot`. - CI at 82915a7 (b1f7cfc): `Test UI (5/16)` failed in `app-shell/src/sameServerFetch.bearer.ratchet.test.ts`, which counted the row read's inline `(apiFetch ?? fetch)(…)` as a bare cookie-only fetch. The read now binds `const doFetch = apiFetch ?? fetch;` first, the renderer-package channel spelling the ratchet reads as the host's `apiFetch` and the one `decide` already uses: same transport, no allow-list row. The 8 `*ratchet*` test files under `ui/packages/*/src` pass locally (89 tests). - CI at 82915a7 (f97f74c): `Test UI (10/16)` failed in `app-shell/src/console/rendererFetch.bearerSession-37225.test.tsx`, which records every request `useHitlInChat` sends and expected the approve `POST` alone. It now expects the row read first and the `POST` after, each with the stored bearer, so the pin also shows the read rides the authenticated channel. - Every test file under `ui/packages/*/src` and `ui/apps/*/src` that names `useHitlInChat`, `pending-actions`, `onToolApprove`, `toolDecisions`, `pendingActionId`, `pending_approval` or `approval-requested` re-run locally after these fixes: 32 files / 343 tests and 25 files / 257 tests, 0 failed. - Review 7240110232 (d5fc75e): the press-before-read race gets its own case (should-fix), and the changeset and hook comment name the item read rather than the inbox, which reads the list (nit). Restored rows settled approved/executed/failed/held keep their buttons, as before; the seat files that separately. ### Small calls this PR made (listed for review) 1. **The read runs for every awaiting card, not only restored ones.** The hook cannot tell a card restored from a saved conversation from one that just streamed in, and no host prop says so; a live proposal's read answers `pending` and changes nothing. Cost: one `GET` per awaiting card per mount. No new option or prop, so no public surface moves (`Clause-②: no`, as claimed). 2. **A row a person rejected reads as that rejection** (the card's second box), with the same English strip text the live reject path writes. Rows settled any other way (approved, executed, failed, held) keep their buttons: the card asks for the lapse, and a press on one still answers. 3. **The answer is read bare or in the `{ success, data }` envelope**, the two shapes `@objectstack/client`'s `pendingActions.get` reads; anything without a string `status` is ignored. 4. **A host whose own tests script `fetch` in call order** sees one extra `GET` before the decision POST; the changeset says so. Four such files in this repo were adjusted (above). 5. `usePendingActions.ts` is untouched (PR objectstack-ai#38273 edits a comment there). ## Read first 1. `ui/packages/plugin-chatbot/src/useHitlInChat.ts`: the row-read effect and `settledDecisionOf`. Risky hunk: the functional update that must not overwrite a press. 2. `ui/packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx`. 3. The four adjusted test files: each change only routes the row read away from the scripted replies. ## Tests <details><summary>New test (local, head f97f74c)</summary> `ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx` (zh, `useHitlInChat` and `ChatbotEnhanced` run together, nothing pressed): a lapsed row in the `{ success, data }` envelope draws `data-state="expired"` with 已过期, no buttons, and exactly one request, `GET /api/v1/ai/pending-actions/pa_9`; a row with `decided_by` (and `lapsed` typed as the reason) draws the rejection, never 已过期; a pending row and a 404 each leave the buttons and draw no strip; with the row read held open, Approve is pressed and answers `executed`, then the read answers a lapsed row, and the card still reads the approval, never 已过期 (review 7240110232 should-fix), with exactly `GET …/pa_9` then `POST …/pa_9/approve` sent. ``` cd ui && pnpm exec vitest run packages/plugin-chatbot/src/__tests__/ChatbotEnhanced.restoredLapsedApproval-38250.test.tsx Test Files 1 passed (1) Tests 4 passed (4) ``` </details> <details><summary>Ablation</summary> `settledDecisionOf` mutated on disk to answer `undefined` for every row (`if (row) return undefined;` first), the new file re-run at 675654b: 2 failed / 1 passed (the lapsed and person-rejected cases; the pending/404 case asserts the unchanged path), exit 1. Restored with `git checkout`. On the tree committed as d5fc75e, the press guard removed on disk (`setDecisions((prev) => ({ ...prev, [toolCallId]: settled }))`, no `toolCallId in prev` check), the new file re-run: 1 failed / 3 passed (the race case), exit 1. Restored from a copy; `git diff` clean. </details> <details><summary>Package runs, type-check, lint</summary> - `pnpm exec vitest run --maxWorkers=3 packages/plugin-chatbot/ packages/app-shell/src/console/ai/ packages/app-shell/src/assistant/ packages/app-shell/src/hooks/`: before the test adjustments 12 tests in 3 files failed (each on a scripted reply the row read consumed), and after them 1 more (`useChatConversation.test.tsx`, one `Response` body read twice). With the adjustments: 223 passed + that file re-run 58/58, so 224 files, 0 failed. - At f97f74c (since 82915a7: the new case, a hook comment, the read's channel binding, the changeset sentence, and the bearer-session pin): `pnpm exec vitest run --maxWorkers=3 packages/plugin-chatbot/` 81 files / 754 tests passed; plugin-chatbot type-check and app-shell `tsc -p tsconfig.test.json` exit 0; `eslint --no-inline-config` on the hook, the new test and the bearer-session pin exit 0. The app-shell runs below are from 82915a7; no app-shell file changed since. - `pnpm --filter @object-ui/plugin-chatbot run type-check` exit 0; `@object-ui/app-shell` `tsc --noEmit` and `tsc -p tsconfig.test.json` exit 0. - `eslint --no-inline-config` on `useHitlInChat.ts`, the new test and the four adjusted tests: exit 0, 0 problems. </details> <details><summary>Derived gate families (local)</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived the same 38 families at d5fc75e and at f97f74c (the run spans those commits: one line of `useHitlInChat.ts` and one test file moved meanwhile); each run locally, exit code captured before any pipe: ``` node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0 node scripts/check-adr-0087-registration.mjs --self-test :: exit 0 node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/check-empty-changeset.mjs --base origin/main :: exit 0 node scripts/check-empty-changeset.mjs --self-test :: exit 0 node scripts/check-sdui-manifest.mjs :: exit 0 node scripts/check-sdui-manifest.mjs --self-test :: exit 0 node scripts/ci/snapshot-next.mjs --self-test :: exit 0 node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0 node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0 node scripts/release-pending-publish.mjs --self-test :: exit 0 pnpm --dir ui exec vitest run scripts/ :: exit 0 pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0 pnpm check:adr-anchors :: exit 0 pnpm check:changeset-gate-self-tests :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:dispatcher-error-vocabulary :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:engine-double-contract :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:published-files :: exit 0 pnpm check:query-options-erasure :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:registry-log-declared :: exit 0 pnpm check:rest-log-spy-declared :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:test-source-alias :: exit 0 pnpm check:tier-file-adoption :: exit 0 pnpm check:type-check-coverage :: exit 0 pnpm check:type-check-debt :: exit 0 pnpm check:undeclared-dep-imports :: exit 0 pnpm check:watch-hint-literal :: exit 0 pnpm check:where-matcher :: exit 0 ``` `dispatch-gates --ran`: `38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero — all 38 recorded an exit code and none of them is 3)`. At 675654b `pnpm check:test-source-alias` exited 1: editing `AiChatPage.approvalRehydration.test.tsx` brought it under the gate's source-reach half (`ChatPane.tsx` imports `@object-ui/plugin-grid` lazily). 82915a7 adds the module-top `import '@object-ui/plugin-grid';` the gate names; the file passes (1/1) and the gate exits 0 above. </details> ## Acceptance notes - No server change and no new route: `GET /api/v1/ai/pending-actions/:id` is the existing read (hosted AI service; the console's API explorer and `@objectstack/client` list it). The open edition serves no AI service, so there the read answers non-2xx and the card is unchanged. - `test:repo` (vitest `repo` project) not run locally: this diff touches none of its tests; CI's `Test Core` runs it. ## Verification Two minutes: run the new test file above from `ui/`; expect 4 passing tests, the lapsed restored card reading 已过期 with nothing pressed, and a press made while the read was out standing. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgVC7KKvrgZyWpM75L8)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgVC7KKvrgZyWpM75L8 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… stored pending_approval one (objectstack-ai#38446) Fixes objectstack-ai#38322 Part of: objectstack-ai#33806 (step 2 of 4, UI and SDK; step 1 merged as PR objectstack-ai#38273) Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感。控制台聊天里待确认操作的审批卡片,今后服务端换成新的答复写法后照样出现;按旧写法保存的历史对话也照样出现,批准、拒绝都能用。 - 为什么做:这是「把应用内助手的待确认操作并入统一确认服务」四步中的第二步(界面与客户端),必须在第三步改服务端答复之前落地,否则新提案在聊天里看不到审批卡片。 - 出错会怎样:最坏情况是聊天里某条待确认操作不显示审批按钮,用户可改到 AI 审批收件箱处理;本改动只动控制台识别逻辑,可整体撤回。 - 要你做什么:无 ## What changes Step 1 (PR objectstack-ai#38273) moved the in-app pending answer from `{ status: 'pending_approval', pendingActionId }` to `{ status: 'pending_confirmation', pendingId }` (`ActionConfirmationPending`, `packages/spec/src/contracts/ai-service.ts`), and its contract text ("A stored `pending_approval` answer") says a stored old answer is read by the SAME recogniser, taking `pendingActionId` as the `pendingId`, with no second reader. Ruling A on objectstack-ai#33806 says the same. - `ui/packages/plugin-chatbot/src/toolResultParsers.ts`: `detectPendingApproval` is that one recogniser. It reads `pending_confirmation` + `pendingId` and `pending_approval` + `pendingActionId`. Each status pairs with its own id key only: a crossed pair (`pending_confirmation` + `pendingActionId`, or `pending_approval` + `pendingId`) is not read, so no lenient dialect gets in. The id still comes back as `pendingActionId`, the name `ChatToolInvocation.pendingActionId` and the approve/reject routes already use. Signature and return type are unchanged. An orphaned docblock that named only the old literal is gone. - Every reader already goes through it: `mapMessages.ts` (the live and stored-history mapper, plus the record-write, sample-data-cleanup and package-removal card detectors), app-shell `useChatConversation.ts` (`toUIMessages` approval promotion), and `aiChatHydration.ts`. `useHitlInChat.ts` and `useObjectChat.ts` read only the lifted `tool.pendingActionId`. No reader of either literal is left outside the recogniser (`git grep` over `ui/` for both literals, outside tests and CHANGELOGs, finds only the recogniser, the docblocks and the cache writer below). - Docblocks that named only the old literal now name both: `chat/types.ts`, `useHitlInChat.ts`, `useObjectChat.ts`, `mapMessages.ts`, and `useChatConversation.ts` (the cache writer). - SDK half of the card: nothing to move. `packages/client/src/index.ts` (`ai.pendingActions.*`) and `ui/packages/plugin-chatbot/src/usePendingActions.ts` call the REST routes `/ai/pending-actions/*`. They name none of the four retired `IAIService` members (`proposePendingAction`, `approvePendingAction`, `rejectPendingAction`, `listPendingActions`), so `git grep` over `packages/client`, `packages/client-react` and `ui/` (CHANGELOGs excluded) finds 0 hits. The routes belong to step 3, so both files are untouched. - No runtime, route or spec change, and no export added or removed. ## Tests - `ui/packages/plugin-chatbot/src/__tests__/mapMessages.test.ts`: a new top-level `describe`, "detectPendingApproval reads the current and the stored pending answer". It covers the new shape (bare, text-wrapped, JSON string), the old shape (bare, text-wrapped), crossed pairs and malformed ids refused, a live `pending_confirmation` result lifted to `approval-requested` + id, the record-write card drawn from a `pending_confirmation` envelope, and a conversation stored with the old answer re-drawing its approval card. A lit control checks that an ordinary result draws no card. - `ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx`: two new driven round trips that end in the REST call Approve makes. One restores a cached entry from the stored `pending_approval` envelope alone (part-key fallback removed, so the recogniser is what is proven). The other takes a live `pending_confirmation` answer through the cache to Approve. ## Acceptance notes - The chat's local cache writer (`pendingApprovalToCachedResult`) still mints `{ status: 'pending_approval', pendingActionId }`. This PR first switched it to the current answer, but `AiChatPage.runtimeMessageSeam.test.tsx` under `app-shell/src/console/ai/__tests__` pins that exact shape, and that file is outside this card's claimed file surface, so the writer change was reverted. The recogniser reads both, so a cached entry restores either way. Moving the writer to the current answer is a one-line change plus that one assertion. Carrier: objectstack-ai#38448. - `detectPendingApproval` is a public export of `@object-ui/plugin-chatbot` (and `/core`). Its signature is unchanged, and it now also recognises the `pending_confirmation` answer. It refused that input before, so this PR declares `Clause-②: yes (widening)` (seat routing on the dev's question; the claim said `no`). The bump stays `patch`: the level follows `Metadata-protocol`, which is `none`. The declaration owes a TIER_DEFAULT review of record. ## Verification Two-minute check: `pnpm --dir ui exec vitest run packages/plugin-chatbot/src/__tests__/mapMessages.test.ts`. Expect every test to pass, including the 7 under "detectPendingApproval reads the current and the stored pending answer". Read first (by risk): 1. `ui/packages/plugin-chatbot/src/toolResultParsers.ts`, the `detectPendingApproval` / `pendingAnswerIdKey` hunk: the strict literal-to-id-key pairing. 2. `ui/packages/app-shell/src/hooks/__tests__/useChatConversation.test.tsx`: the two new round trips. 3. `ui/packages/plugin-chatbot/src/__tests__/mapMessages.test.ts`: the new `describe`. All readings below are at head `e5da5265` unless a line says otherwise. <details><summary>Tests (local, under the shared verify lock)</summary> - `pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-chatbot/` + all 14 `*ratchet*` tests under `packages/app-shell/src` + `packages/app-shell/src/console/*.test.tsx` + `packages/app-shell/src/console/ai/` + `packages/app-shell/src/hooks/` + `packages/app-shell/src/assistant/`: Test Files 238 passed (238), Tests 2086 passed (2086), VERDICT command-exit 0. - `pnpm --filter @object-ui/plugin-chatbot type-check`: exit 0. `--listFiles` shows `tsconfig.test.json` compiles `src/__tests__/mapMessages.test.ts`. - `pnpm --filter @object-ui/app-shell type-check` (after building the `@object-ui/app-shell^...` closure, 72/72 tasks): VERDICT command-exit 0. - eslint over the 8 changed `ui/` files: 0 errors (13 warnings, all on lines this PR does not touch). - Narrowing, declared: the full app-shell suite (about 2,459 files) was not run locally. CI `Test UI` runs it. </details> <details><summary>Ablation (on-disk mutation via scripts/ablation-replace.mjs, restored to the HEAD blob each time)</summary> The vitest config aliases the packages under test to `src`, so no `dist` was involved. - Removed the `pending_confirmation` arm (`toolResultParsers.ts` blob 9e4f150 to 9ba227b6). 4 red: the three new-shape pins in `mapMessages.test.ts` and the new-answer cache round trip. Restored: blob equals HEAD, `git diff HEAD` empty. - Removed the `pending_approval` arm (blob 9e4f150 to 89c4cedb). 6 red: the old-shape pin, the stored-conversation re-draw, the new stored-envelope-only cache restore, and three existing cache round trips that read the stored literal. Restored: blob equals HEAD, `git diff HEAD` empty. </details> <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` derived 38 families for this diff. All 38 ran locally, each exit 0 (`pnpm --dir ui exec vitest run scripts/`: 172 files passed, 2 skipped). `--ran` reconciliation: "38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED (a DERIVED zero)". - `node scripts/pm/overlap-check.mjs`: "VERDICT clean exit 0". It merges cleanly with `origin/main` and shares a file with no open PR. - Families CI runs (repo-wide lint, the full UI test shards, typecheck lanes): read from this PR's check-runs, not re-run locally. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (`packages/spec` is not touched.) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran. eslint on the changed files shows 0 errors; repo-wide `pnpm lint` is left to CI. - [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: not applicable. - [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, apart from the maintainer quick-read section the fleet contract asks for in Chinese. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5nvFivDeQyYgTFkZhi)_ <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5nvFivDeQyYgTFkZhi --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Refs #33806
Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: changes with step 3 of #33806 — skills/objectstack-ai/SKILL.md, content/docs/ai/actions-as-tools.mdx (the runtime answer changes there; Tier H then)
维护者速读
What changes
Step 1 of 4 of #33806 (maintainer ruling 7237978621, option A): the spec contract only. UI and SDK, cloud storage and routes, and docs are steps 2–4, each its own card.
packages/spec/src/contracts/ai-service.tsIActionConfirmationService(still registered underACTION_CONFIRMATION_SERVICE,'ai.actionConfirmation') is the ONE pending-confirmation service for every AI door and carries the whole lifecycle:submit(unchanged),list,get,approve,reject, all required. The three deciding points (only the person the call ran as decides, only on a signed-in session, the call runs as that person with every gate re-checked) and theheldoutcome are stated on the service's members. The decider is thecontext: ExecutionContextpassed in (it was anactorIdstring on the queue).ActionConfirmationHandOffgains optionaltoolName,conversationId,messageIdfor an in-app item;doorismcporassistant.PendingActionRow(row shape unchanged):tool_nameis the tool the call was made through (the model's tool on an in-app item;run_action, orresume_runwhen the hand-off carries a run, on an MCP item);tool_inputis that call's input as JSON, so the record, the namespace and the run ride there and get no column;object_nameis the empty string for an action on no object; the door is not on the row (the host approves from the hand-off it kept).ActionConfirmationListFilter,ActionConfirmationApproveOutcome.IAIServicelosesproposePendingAction,approvePendingAction,rejectPendingAction,listPendingActions;ProposePendingActionInputis removed.PendingActionStatus(six states,heldincluded, noexpired: a lapse stays the host's to define) andPendingActionRowkeep their shape and now describe the service's items.submitwithdoor: 'assistant'and answersActionConfirmationPending(pending_confirmation+pendingId). A new paragraph retires thepending_approval+pendingActionIdanswer and states that a reader of stored conversations reads it through the SAME recogniser that readspending_confirmation(pendingActionIdtaken aspendingId), with no second reader. "Its bounds" and "When it binds" are updated (the FROM half of the merge is named).packages/spec/src/api/protocol.zod.ts: comments only. The/api/v1/ai/pending-actionsroute schemas are unchanged; they now front the pending-confirmation service.packages/spec/src/kernel/execution-context.zod.ts:performedBy.confirmationIddescribes one store (TSDoc +.describe), regenerated intocontent/docs/references/kernel/execution-context.mdx.packages/spec/src/migrations/entries/semantic/19.ai-pending-action-queue-merged-into-confirmation-service.ts: the D3 entry, FROM → TO per member.api-surface/contracts.json,export-origins/contracts.json(+2ActionConfirmation*interfaces, −ProposePendingActionInput).ai-service.test.tsre-points the held-outcome and deciding-point pins to the service members and adds type pins (IAIServicedeclares none of the four members; the service's keys are exactly the five; a submit-only service is refused);action-confirmation-contract.pin.test.tsfollows the prose;ai-store-caller-context.pin.test.tsre-points the inbox read tolist/get(context required).ui/packages/plugin-chatbot/src/usePendingActions.ts: one comment re-pointed from the retiredIAIService.proposePendingAction/.listPendingActionstoIActionConfirmationService.list/.get(ui'scheck:spec-symbolsreads spec members cited in comments and went red on bf6f12e; AGENTS.md: a removal that breaksui/ships with theui/fix). Comment only; not a file open PR fix(plugin-chatbot): a lapsed AI pending action reads Expired, not Rejected, in the AI Approvals inbox and the chat card #38246 edits..changeset/33806-pending-confirmation-service-one-seam.md:@objectstack/specpatch, BREAKING banner, FROM → TO table,adr-0087: registered.Shape decisions taken by this thread (no product call; the seat accepted them, the row mapping after the first contract review): extend the existing service rather than a new service name; keep the row, status and route shapes so
ui/does not move in this PR; state the hand-off → row mapping in words instead of makingobject_name/tool_nameoptional (which would move the console inbox, the file open PR #38246 edits); no new spec export for the retired literal.Why
The maintainer ruled the merge now, inside the open 19 prerelease window (
@objectstack/spec19.0.0-next.2), so the breaking change lands before 19.0.0 and a confirmation rule lives in one place.Acceptance notes
ui/**and its own changeset; this PR touchespackages/spec/**, its generated docs page, oneui/comment (usePendingActions.ts) and a changeset. Zero overlap.ui/importsPendingActionRow,PendingActionStatusand theAiPendingAction*response types from spec and none of the four retired members (git grepoverui/,packages/client), so the removal does not redType Check UI;packages/runtimeusesIActionConfirmationServiceonly to cast and callsubmit.in-app-pending-action-decided-by-personstill names the old members: it is 18's record and is left as written.docs/adr/**and belongs to step 4. The docs-drift comment's list (content/docs/ai/actions-as-tools.mdxand the pages that merely share a field name such asmessageId) is the docs step's too.Skills-docs:line, N1 the{ id }→{ pendingId }answer in the changeset's FROM → TO table.Verification
Local, at head 5d82277 unless a line says otherwise (ff98353 adds the
ui/comment only;node ui/scripts/check-spec-symbol-derivation.mjsexit 0 there):pnpm --filter @objectstack/spec build— VERDICT command-exit 0.pnpm --filter @objectstack/spec check:generated --fix— at bf6f12e 3 stale (api-surface, export-origins, docs) regenerated; at 5d82277 none stale.pnpm --filter @objectstack/spec check:test-typecheckandvitest run src/contracts src/migrations— Test Files 62 passed, Tests 719 passed (VERDICT command-exit 0).dispatch-gates.mjs --commands, 117 commands), full run 11:11–11:53Z (ff98353, aui/comment only, was committed during it): 109 exit 0, 1 exit 1, 7 exit 3. All eight non-zero were PREREQUISITE, not findings: the CLImigrate-meta-engine-guidancetest (exit 1) could not load the unbuilt@objectstack/lintdist, and seven gates refused on missing built output. Afterpnpm turbo run build(exit 0) at ff98353, seven of them were re-run there and all exit 0:migrate-meta-engine-guidance(3 tests passed),check:doc-formula-expressions,check:doc-security-posture,check:skill-examples(351 examples),check:docs-transcript-drift,check:dual-build-cjs-loads,check:lean-entry-closure. Total 116 of 117 exit 0. One NOT MEASURED locally:check-plugin-teardown-shape --self-testneeds an unshallow clone; read from this PR's check-runs.Dogfood Regression Gateis green there, but its shards were skipped by the PR filter, so it was run locally:pnpm turbo run build --filter=@objectstack/dogfoodexit 0, thenpnpm turbo run test --filter=@objectstack/dogfoodexit 0 (cache miss, executed): Test Files 491 passed, 3 skipped; Tests 4148 passed, 68 skipped.CI families: read from this PR's check-runs.
Generated by Claude Code