Skip to content

Commit b503291

Browse files
feat(spec)!: one pending-confirmation service for every AI door, the in-app pending-action queue leaves IAIService (#38273)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu6r4hvzNtEmw2nzZexBmkpy)_ 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) ## 维护者速读 - 用户能看到什么变化:用户无感。这是四步里的第一步,只改平台的规范契约:应用内助手和外部 AI 两条「待本人确认」的登记通道合成一个服务,界面、客户端、云端和文档在后面三步跟着改。 - 为什么做:你在决策卡上选了「现在合并成一套」,赶在 v19 正式版之前把这次不兼容改动做掉,以后改确认规则只写一处。 - 出错会怎样:只有自己实现过平台确认服务、或直接读旧答案字面量的宿主代码会编译不过,升级说明和迁移条目写了逐项改法;写应用元数据的人不受影响;本 PR 可整体撤回。 - 要你做什么:契约审核档评审通过后,由你批准合并(这次是收窄性改动,按 Tier H 走)。 ## 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.ts` - `IActionConfirmationService` (still registered under `ACTION_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 the `held` outcome are stated on the service's members. The decider is the `context: ExecutionContext` passed in (it was an `actorId` string on the queue). - `ActionConfirmationHandOff` gains optional `toolName`, `conversationId`, `messageId` for an in-app item; `door` is `mcp` or `assistant`. - The service docblock says how a hand-off from every door becomes a `PendingActionRow` (row shape unchanged): `tool_name` is the tool the call was made through (the model's tool on an in-app item; `run_action`, or `resume_run` when the hand-off carries a run, on an MCP item); `tool_input` is that call's input as JSON, so the record, the namespace and the run ride there and get no column; `object_name` is 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). - Rule 1 of the confirmation contract now says every door hands off to the same service, the in-app door never eliciting. - New types `ActionConfirmationListFilter`, `ActionConfirmationApproveOutcome`. - `IAIService` loses `proposePendingAction`, `approvePendingAction`, `rejectPendingAction`, `listPendingActions`; `ProposePendingActionInput` is removed. - `PendingActionStatus` (six states, `held` included, no `expired`: a lapse stays the host's to define) and `PendingActionRow` keep their shape and now describe the service's items. - The confirmation contract's in-app section now reads "the same rule, the same channel": the in-app door hands off through `submit` with `door: 'assistant'` and answers `ActionConfirmationPending` (`pending_confirmation` + `pendingId`). A new paragraph retires the `pending_approval` + `pendingActionId` answer and states that a reader of stored conversations reads it through the SAME recogniser that reads `pending_confirmation` (`pendingActionId` taken as `pendingId`), 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-actions` route schemas are unchanged; they now front the pending-confirmation service. - `packages/spec/src/kernel/execution-context.zod.ts`: `performedBy.confirmationId` describes one store (TSDoc + `.describe`), regenerated into `content/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. - Generated: `api-surface/contracts.json`, `export-origins/contracts.json` (+2 `ActionConfirmation*` interfaces, −`ProposePendingActionInput`). - Tests: `ai-service.test.ts` re-points the held-outcome and deciding-point pins to the service members and adds type pins (`IAIService` declares none of the four members; the service's keys are exactly the five; a submit-only service is refused); `action-confirmation-contract.pin.test.ts` follows the prose; `ai-store-caller-context.pin.test.ts` re-points the inbox read to `list`/`get` (context required). - `ui/packages/plugin-chatbot/src/usePendingActions.ts`: one comment re-pointed from the retired `IAIService.proposePendingAction` / `.listPendingActions` to `IActionConfirmationService.list` / `.get` (`ui`'s `check:spec-symbols` reads spec members cited in comments and went red on bf6f12e; AGENTS.md: a removal that breaks `ui/` ships with the `ui/` fix). Comment only; not a file open PR #38246 edits. - Changeset `.changeset/33806-pending-confirmation-service-one-seam.md`: `@objectstack/spec` patch, 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 making `object_name` / `tool_name` optional (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/spec` 19.0.0-next.2), so the breaking change lands before 19.0.0 and a confirmation rule lives in one place. ## Acceptance notes - Premise check (ruling's step-1 condition): open PR #38246 (#34255, head e3c122b) touches only `ui/**` and its own changeset; this PR touches `packages/spec/**`, its generated docs page, one `ui/` comment (`usePendingActions.ts`) and a changeset. Zero overlap. - `ui/` imports `PendingActionRow`, `PendingActionStatus` and the `AiPendingAction*` response types from spec and none of the four retired members (`git grep` over `ui/`, `packages/client`), so the removal does not red `Type Check UI`; `packages/runtime` uses `IActionConfirmationService` only to cast and call `submit`. - The 18 D3 entry `in-app-pending-action-decided-by-person` still names the old members: it is 18's record and is left as written. - ADR-0011's revision note ("Merging the two seams was not ruled") is now stale; it is `docs/adr/**` and belongs to step 4. The docs-drift comment's list (`content/docs/ai/actions-as-tools.mdx` and the pages that merely share a field name such as `messageId`) is the docs step's too. - Contract review round 1 (7238295862, FAIL) answered at 5d82277: M1 row mapping (above), S1 rule 1, S2 the `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.mjs` exit 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-typecheck` and `vitest run src/contracts src/migrations` — Test Files 62 passed, Tests 719 passed (VERDICT command-exit 0). - Derived gate list (`dispatch-gates.mjs --commands`, 117 commands), full run 11:11–11:53Z (ff98353, a `ui/` comment only, was committed during it): 109 exit 0, 1 exit 1, 7 exit 3. All eight non-zero were PREREQUISITE, not findings: the CLI `migrate-meta-engine-guidance` test (exit 1) could not load the unbuilt `@objectstack/lint` dist, and seven gates refused on missing built output. After `pnpm 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-test` needs an unshallow clone; read from this PR's check-runs. - Dogfood, at ff98353 (final head): the CI `Dogfood Regression Gate` is green there, but its shards were skipped by the PR filter, so it was run locally: `pnpm turbo run build --filter=@objectstack/dogfood` exit 0, then `pnpm turbo run test --filter=@objectstack/dogfood` exit 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](https://claude.ai/code/session_01L6bhgTrYJvLJfdjfWhNMMV)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgTrYJvLJfdjfWhNMMV --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2568c7c commit b503291

12 files changed

Lines changed: 545 additions & 272 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec)!: one pending-confirmation service for every AI door — the in-app assistant's pending-action queue leaves `IAIService`
6+
7+
Clause-②: yes (narrowing)
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: registered ai-pending-action-queue-merged-into-confirmation-service -->
11+
12+
**BREAKING** contract change in `@objectstack/spec/contracts`, inside the 19 prerelease window and before 19.0.0. A confirmation rule had two seams: the in-app assistant's pending-action queue on `IAIService` (answering the model `pending_approval`) and the AI-door hand-off `IActionConfirmationService` (answering `pending_confirmation`, with only a `submit` member). They are now one: `IActionConfirmationService`, still registered under `ACTION_CONFIRMATION_SERVICE` (`'ai.actionConfirmation'`), carries the whole lifecycle, and every AI door hands its gated calls to it and answers `pending_confirmation`. No metadata changes: `ai.requiresConfirmation` and every other key an author writes mean what they meant.
13+
14+
| FROM | TO |
15+
|:--|:--|
16+
| `aiService.proposePendingAction({ objectName, actionName, toolName, toolInput, conversationId, messageId, proposedBy })`, answering `{ id }` | `confirmations.submit({ actionName, objectName, recordId, params: toolInput, door: 'assistant', toolName, conversationId, messageId }, context)`, answering `{ pendingId }` (`context` = the person the call runs as) |
17+
| `aiService.listPendingActions(filter, context?)` | `confirmations.list(filter, context)` (context required) |
18+
| (none) | `confirmations.get(pendingId, context)`, one item's row or `null` |
19+
| `aiService.approvePendingAction(id, actorId)` | `confirmations.approve(id, context)` (`context` = the deciding person; still answers `executed`, `held` or `failed`) |
20+
| `aiService.rejectPendingAction(id, actorId, reason?)` | `confirmations.reject(id, context, reason?)` |
21+
| `ProposePendingActionInput` | `ActionConfirmationHandOff`, which gains optional `toolName`, `conversationId` and `messageId` for an in-app item |
22+
| in-app tool answer `{ status: 'pending_approval', pendingActionId }` | `{ status: 'pending_confirmation', pendingId, message, actionName, objectName }` (`ActionConfirmationPending`) |
23+
24+
The one-line fix: register one `IActionConfirmationService` implementing `submit`, `list`, `get`, `approve` and `reject`, route the in-app assistant's gated tool calls through `submit` instead of `proposePendingAction`, and delete the four `IAIService` members from your implementation. A reader of stored conversations reads an old `pending_approval` answer with the same recogniser that reads `pending_confirmation`, taking `pendingActionId` as the `pendingId`; it never gets a second reader. Keep the ids of items you move from the old queue so those answers still name their item.
25+
26+
- **`@objectstack/spec`**: `IActionConfirmationService` gains `list`, `get`, `approve` and `reject` (all required) and states 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) for every item, whichever door handed it off. New types `ActionConfirmationListFilter` and `ActionConfirmationApproveOutcome`. `IAIService` loses `proposePendingAction`, `approvePendingAction`, `rejectPendingAction` and `listPendingActions`; `ProposePendingActionInput` is removed. `PendingActionStatus` (six states, `held` included) and `PendingActionRow` keep their shape and now describe the service's items; the service's docblock says how a hand-off from every door becomes a row (`tool_name` is the tool the call was made through, `run_action` or `resume_run` on an MCP item; `tool_input` is that call's input as JSON, record, namespace and run included; `object_name` is the empty string for an action on no object). The `/api/v1/ai/pending-actions` route schemas (`AiPendingAction*`) are unchanged. The D3 entry `ai-pending-action-queue-merged-into-confirmation-service` lists the hand work for `os migrate meta --from 18`.

‎content/docs/references/kernel/execution-context.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const result = AuthGateCodeSchema.parse(data);
9494
| **clientId** | `string` | optional | The OAuth client (`azp`, the client_id of a registered sys_oauth_application) that performed the operation. Set by the /mcp OAuth door only; absent when the in-product AI performed it. |
9595
| **agentId** | `string` | optional | The in-product AI agent that performed the operation for the signed-in person in userId: the agent the chat runs as (the same value as ToolExecutionContext.agentId). Set by the server-constructed in-product AI path only, and only after the server resolved it as the agent it actually ran; never a sys_user id or an OAuth client id. |
9696
| **conversationId** | `string` | optional | The AI conversation the operation was performed in (the same id as ToolExecutionContext.conversationId). Set beside agentId by the in-product AI path, and only after the server resolved it as a conversation the person in userId owns. |
97-
| **confirmationId** | `string` | optional | The confirmation the person gave before the operation ran: the id of the pending item their approval decided (the in-app pending action id, or the pending-confirmation service item id). Stamped only after the server resolved it as a pending item the person in userId decided for this operation; absent when the operation needed no confirmation. |
97+
| **confirmationId** | `string` | optional | The confirmation the person gave before the operation ran: the id of the pending-confirmation service item their approval decided, whichever AI door handed it off. Stamped only after the server resolved it as a pending item the person in userId decided for this operation; absent when the operation needed no confirmation. |
9898

9999
### Nested Shape: `ExecutionContext.permissionSetAddresses[number]`
100100

‎packages/spec/api-surface/contracts.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"APPROVAL_STATUS_LABELS (const)",
3131
"AUDIT_CHECKPOINT_SIGNER_SERVICE (const)",
3232
"AUDIT_CHECKPOINT_SINK_SERVICE (const)",
33+
"ActionConfirmationApproveOutcome (interface)",
3334
"ActionConfirmationHandOff (interface)",
35+
"ActionConfirmationListFilter (interface)",
3436
"ActionConfirmationPending (interface)",
3537
"ActionConfirmationRefusalReason (type)",
3638
"ActionConfirmationRequiredDetails (interface)",
@@ -315,7 +317,6 @@
315317
"PrincipalSession (interface)",
316318
"PrincipalSessionCookie (interface)",
317319
"PrincipalSessionMintOptions (interface)",
318-
"ProposePendingActionInput (interface)",
319320
"PubSubHandler (type)",
320321
"PubSubMessage (interface)",
321322
"PublishOptions (interface)",

‎packages/spec/export-origins/contracts.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"APPROVAL_STATUS_LABELS": "src/contracts/approval-service.ts#APPROVAL_STATUS_LABELS (const)",
3131
"AUDIT_CHECKPOINT_SIGNER_SERVICE": "src/contracts/audit-checkpoint.ts#AUDIT_CHECKPOINT_SIGNER_SERVICE (const)",
3232
"AUDIT_CHECKPOINT_SINK_SERVICE": "src/contracts/audit-checkpoint.ts#AUDIT_CHECKPOINT_SINK_SERVICE (const)",
33+
"ActionConfirmationApproveOutcome": "src/contracts/ai-service.ts#ActionConfirmationApproveOutcome (interface)",
3334
"ActionConfirmationHandOff": "src/contracts/ai-service.ts#ActionConfirmationHandOff (interface)",
35+
"ActionConfirmationListFilter": "src/contracts/ai-service.ts#ActionConfirmationListFilter (interface)",
3436
"ActionConfirmationPending": "src/contracts/ai-service.ts#ActionConfirmationPending (interface)",
3537
"ActionConfirmationRefusalReason": "src/contracts/ai-service.ts#ActionConfirmationRefusalReason (type)",
3638
"ActionConfirmationRequiredDetails": "src/contracts/ai-service.ts#ActionConfirmationRequiredDetails (interface)",
@@ -315,7 +317,6 @@
315317
"PrincipalSession": "src/contracts/auth-service.ts#PrincipalSession (interface)",
316318
"PrincipalSessionCookie": "src/contracts/auth-service.ts#PrincipalSessionCookie (interface)",
317319
"PrincipalSessionMintOptions": "src/contracts/auth-service.ts#PrincipalSessionMintOptions (interface)",
318-
"ProposePendingActionInput": "src/contracts/ai-service.ts#ProposePendingActionInput (interface)",
319320
"PubSubHandler": "src/contracts/cluster-service.ts#PubSubHandler (type)",
320321
"PubSubMessage": "src/contracts/cluster-service.ts#PubSubMessage (interface)",
321322
"PublishOptions": "src/contracts/cluster-service.ts#PublishOptions (interface)",

‎packages/spec/src/api/protocol.zod.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4787,7 +4787,9 @@ export const AiAgentChatRequestSchema = lazySchema(() => z.object({
47874787
// ── HITL pending actions ──────────────────────────────────────────────────
47884788
//
47894789
// The approval queue an embedding app has to render. `objectui` ships a whole
4790-
// approval UI on these four routes over hand-built URLs.
4790+
// approval UI on these four routes over hand-built URLs. They front the
4791+
// pending-confirmation service (`IActionConfirmationService`, contracts), the
4792+
// one store every AI door hands a gated call to.
47914793

47924794
/**
47934795
* Lifecycle of a proposed action. Mirrors `PendingActionStatus` in contracts.
@@ -4824,9 +4826,9 @@ export const AiPendingActionSchema = lazySchema(() => z.object({
48244826
/**
48254827
* `GET /api/v1/ai/pending-actions` query.
48264828
*
4827-
* Only the three the ROUTE reads. `AIService.listPendingActions` also accepts
4828-
* `objectName`, but the route never forwards it, so declaring it here would
4829-
* type a filter that silently does nothing.
4829+
* Only the three the ROUTE reads. `IActionConfirmationService.list` also
4830+
* accepts `objectName`, but the route never forwards it, so declaring it here
4831+
* would type a filter that silently does nothing.
48304832
*/
48314833
export const ListAiPendingActionsRequestSchema = lazySchema(() => z.object({
48324834
status: AiPendingActionStatusSchema.optional().describe('Filter by status'),

‎packages/spec/src/contracts/action-confirmation-contract.pin.test.ts‎

Lines changed: 69 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import {
6161
type ActionConfirmationRefusalReason,
6262
type ActionConfirmationRequiredDetails,
6363
type IActionConfirmationService,
64+
type PendingActionRow,
6465
} from './ai-service';
6566

6667
/** The refusal code the contract names. */
@@ -175,6 +176,15 @@ describe('action-confirmation contract, as amended: a person confirms, elicited
175176
const CONTRACT_SOURCE = join(HERE, 'ai-service.ts');
176177

177178
/** The capability constant's docblock, comment gutters folded into spaces. */
179+
/** The pending-confirmation service's docblock, comment gutters folded into spaces. */
180+
function serviceProse(): string {
181+
const source = readFileSync(CONTRACT_SOURCE, 'utf8');
182+
const at = source.indexOf('export interface IActionConfirmationService {');
183+
expect(at, '`IActionConfirmationService` moved — re-anchor this pin').toBeGreaterThan(-1);
184+
const open = source.lastIndexOf('/**', at);
185+
return source.slice(open, at).replace(/\n\s*\*\s?/g, ' ').replace(/\s+/g, ' ');
186+
}
187+
178188
function capabilityProse(): string {
179189
const source = readFileSync(CONTRACT_SOURCE, 'utf8');
180190
const at = source.indexOf('export const AI_ACTION_CONFIRMATION_CAPABILITY');
@@ -247,8 +257,8 @@ describe('action-confirmation contract, as amended: a person confirms, elicited
247257
};
248258
expect(pending.status).toBe('pending_confirmation');
249259
const wrongStatus: ActionConfirmationPending = {
250-
// @ts-expect-error — the discriminant is one literal; the in-app chat's
251-
// older `pending_approval` envelope is not this answer.
260+
// @ts-expect-error — the discriminant is one literal; the in-app door's
261+
// retired `pending_approval` answer is not this answer.
252262
status: 'pending_approval',
253263
pendingId: 'pc_1',
254264
message: 'm',
@@ -273,8 +283,36 @@ describe('action-confirmation contract, as amended: a person confirms, elicited
273283
expect(runWithoutValues.run?.runId).toBe('run_7');
274284
const service: IActionConfirmationService = {
275285
submit: async (h) => ({ pendingId: h.run ? `pc_resume_${h.run.runId}` : `pc_${h.actionName}` }),
286+
list: async () => [],
287+
get: async () => null,
288+
approve: async () => ({ status: 'executed' }),
289+
reject: async () => undefined,
276290
};
277291
await expect(service.submit(handOff, {} as never)).resolves.toEqual({ pendingId: 'pc_archive_account' });
292+
// How an MCP hand-off becomes the row `list` and `get` answer: the door's
293+
// own tool, its input as JSON, and the empty string for an object-less
294+
// action. The row's required members always have a value.
295+
const objectLess: ActionConfirmationHandOff = { actionName: 'rebuild_index', params: {}, door: 'mcp' };
296+
const row: PendingActionRow = {
297+
id: 'pc_rebuild_index',
298+
object_name: objectLess.objectName ?? '',
299+
action_name: objectLess.actionName,
300+
tool_name: objectLess.run ? 'resume_run' : 'run_action',
301+
tool_input: JSON.stringify({ actionName: objectLess.actionName, params: objectLess.params }),
302+
status: 'pending',
303+
proposed_at: '2026-11-28T00:00:00Z',
304+
};
305+
expect([row.tool_name, row.object_name]).toEqual(['run_action', '']);
306+
const mapping = serviceProse();
307+
expect(mapping, 'the contract no longer says what an MCP item names as its tool').toMatch(
308+
/on an MCP item the door's own tool, `run_action`, or `resume_run` when the hand-off carries a run/,
309+
);
310+
expect(mapping, 'the contract no longer says where the record and the run go').toMatch(
311+
/So the record, the namespace and the run ride in `tool_input`, and the row has no column of its own for them/,
312+
);
313+
expect(mapping, 'the contract no longer says what an object-less action stores as its object').toMatch(
314+
/and the empty string for an action that runs on no object/,
315+
);
278316
await expect(service.submit(resumeHandOff, {} as never)).resolves.toEqual({ pendingId: 'pc_resume_run_7' });
279317
});
280318

@@ -329,9 +367,10 @@ describe('action-confirmation contract, as amended: a person confirms, elicited
329367
);
330368
});
331369

332-
it('the rule binds EVERY AI door, the in-app assistant included, through its own channel', () => {
370+
it('the rule binds EVERY AI door, the in-app assistant included, through the one channel', () => {
333371
// #33689 Q1, ruled B (record 6893484458, 「B 同一规则,两套流程暂留」): one
334-
// rule for every AI door; the in-app queue stays its own channel.
372+
// rule for every AI door. #33806, ruled A (record 7237978621): the in-app
373+
// queue is merged into the pending-confirmation service.
335374
const prose = capabilityProse();
336375
expect(prose, 'rule 1 no longer covers every AI door').toMatch(
337376
/through EVERY AI door that starts one: the MCP `run_action` tool, the MCP `resume_run` tool for the candidate action it would run, and the in-app assistant's action tools/,
@@ -340,7 +379,13 @@ describe('action-confirmation contract, as amended: a person confirms, elicited
340379
expect(prose, 'rule 1 reads as MCP-only again').not.toMatch(
341380
/through an AI door: the MCP `run_action` tool, and the MCP `resume_run` tool for the candidate action it would run\. Every caller/,
342381
);
343-
expect(prose, 'the in-app door lost its section').toContain('## The in-app assistant door: the same rule, its own channel');
382+
expect(prose, 'the in-app door lost its section').toContain('## The in-app assistant door: the same rule, the same channel');
383+
expect(prose, 'the in-app door no longer hands off to the one service').toMatch(
384+
/The in-app assistant asks through that service: the call is handed off \(\{@link IActionConfirmationService\.submit\}, with `door: 'assistant'`/,
385+
);
386+
expect(prose, 'the in-app door no longer answers the one pending literal').toMatch(
387+
/the tool answers the model \{@link ActionConfirmationPending\} \(`pending_confirmation` and the item's `pendingId`\)/,
388+
);
344389
expect(prose, 'the in-app door no longer withholds a declared-gated action when its channel is not wired').toMatch(
345390
/When that channel is not wired .* the door does not offer a declared-gated action as a tool at all/,
346391
);
@@ -363,17 +408,32 @@ describe('action-confirmation contract, as amended: a person confirms, elicited
363408
/Neither the model's own confirmation nor the caller's `confirm` counts/,
364409
);
365410
expect(prose, 'the three points no longer bind every in-app queued item, whichever trigger queued it').toMatch(
366-
/The three points bind EVERY item in the in-app queue, whichever trigger queued it: an action declaring `ai\.requiresConfirmation: true`, or one the destructive heuristic gates/,
411+
/The three points bind EVERY item the in-app door hands off, whichever trigger gated it: an action declaring `ai\.requiresConfirmation: true`, or one the destructive heuristic gates/,
367412
);
368-
expect(prose, 'the contract no longer says why the in-app queue has one decider rule').toMatch(
369-
/A pending row does not record why it was queued, and the queue has one decider rule/,
413+
expect(prose, 'the contract no longer says why the service has one decider rule').toMatch(
414+
/A pending item does not record why it was gated, and the service has one decider rule/,
370415
);
371416
// Control: the MCP doors' reach is still the DECLARED flag alone; the
372417
// in-app queue's wider reach must not leak into rule 1.
373418
expect(prose, 'rule 1 lost its DECLARED-flag predicate').toMatch(
374419
/`ai\.requiresConfirmation: true` \(the DECLARED flag, never the listing heuristic;/,
375420
);
376-
expect(prose, 'the contract claims the two seams were merged').toMatch(/stay two seams; the rule that binds them is one/);
421+
expect(prose, 'rule 1 sends the in-app door down its own channel again').toMatch(
422+
/Every door hands off to the same pending-confirmation service: rules 2 to 4 below are how the MCP doors ask, and the in-app door never elicits/,
423+
);
424+
// Control: the two-channel sentence of rule 1 is gone, not merely joined.
425+
expect(prose, 'rule 1 still says the in-app door asks through its own channel').not.toMatch(/asks through its own channel/);
426+
expect(prose, 'the bounds no longer name one service for every AI door').toMatch(
427+
/Every AI door hands off to one pending-confirmation service/,
428+
);
429+
// Control: the two-seam reading is gone, not merely joined.
430+
expect(prose, 'the contract claims two seams again').not.toMatch(/stay two seams/);
431+
expect(prose, 'a stored pending_approval answer is no longer read by the one recogniser').toMatch(
432+
/reads it through the SAME recogniser that reads \{@link ActionConfirmationPending\}, taking `pendingActionId` as the `pendingId`; ⛔ there is no second reader of the retired literal/,
433+
);
434+
expect(prose, 'the merge no longer states its FROM half').toMatch(
435+
/A host whose in-app door still records on its own queue and answers `pending_approval` runs the FROM half of that breaking note/,
436+
);
377437
expect(prose, 'the FROM half of the in-app door is no longer stated').toMatch(
378438
/The in-app door likewise runs ADR-0011's queue as documented until its implementing change ships: any holder of `ai:approve` may decide an item/,
379439
);

0 commit comments

Comments
 (0)