@sema-agent/sdk 40.0.0 → 41.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +71 -4
  2. package/dist/client.d.ts +15 -7
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +14 -6
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +27 -16
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +21 -12
  9. package/dist/errors.js.map +1 -1
  10. package/dist/events.d.ts +12 -27
  11. package/dist/events.d.ts.map +1 -1
  12. package/dist/events.js +2 -4
  13. package/dist/events.js.map +1 -1
  14. package/dist/health.d.ts +5 -11
  15. package/dist/health.d.ts.map +1 -1
  16. package/dist/health.js.map +1 -1
  17. package/dist/index.d.ts +12 -11
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +8 -7
  20. package/dist/index.js.map +1 -1
  21. package/dist/resources/approvals.d.ts +12 -8
  22. package/dist/resources/approvals.d.ts.map +1 -1
  23. package/dist/resources/approvals.js +4 -5
  24. package/dist/resources/approvals.js.map +1 -1
  25. package/dist/resources/rules.d.ts +1 -1
  26. package/dist/resources/rules.js +1 -1
  27. package/dist/resources/sessions.d.ts +19 -5
  28. package/dist/resources/sessions.d.ts.map +1 -1
  29. package/dist/resources/sessions.js +19 -5
  30. package/dist/resources/sessions.js.map +1 -1
  31. package/dist/resources/tool-approvals.d.ts +393 -789
  32. package/dist/resources/tool-approvals.d.ts.map +1 -1
  33. package/dist/resources/tool-approvals.js +67 -195
  34. package/dist/resources/tool-approvals.js.map +1 -1
  35. package/dist/settings.d.ts +2 -2
  36. package/dist/types.d.ts +138 -88
  37. package/dist/types.d.ts.map +1 -1
  38. package/dist/types.js +24 -0
  39. package/dist/types.js.map +1 -1
  40. package/openapi.yaml +591 -921
  41. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -173,7 +173,7 @@ tags:
173
173
  PERMISSION_RULES_ENABLED (default false) plus a wired rule store — so on a stock deployment BOTH doors
174
174
  answer 501 `capability.rule_store_required`, and so does the single-card half (the ask frame simply
175
175
  carries no `ruleOffers`). Read the observed frame / an actual response, never a version number.
176
- The SINGLE-CARD half of the same lane is `persistRule` on POST /v1/tool-approvals/{id}/respond.
176
+ The SINGLE-CARD half of the same lane is `persistRule` on POST /v1/tasks/{taskId}/asks/{askId}/decision.
177
177
  - name: adoption
178
178
  description: >
179
179
  design/183 — identity ADOPTION (form b: pure identity rebind). A one-shot, operator-only DEPLOYMENT
@@ -244,6 +244,41 @@ paths:
244
244
  application/json:
245
245
  schema: { $ref: '#/components/schemas/ErrorResponse' }
246
246
 
247
+ # ── server >= 7.152.0 —— 生效场景读面(单数 `scenario`:这次请求会生效哪只场景;与上面的复数 `scenarios/{name}` 是两条路)──
248
+ /v1/capabilities/scenario:
249
+ parameters:
250
+ - $ref: '#/components/parameters/PrincipalHeader'
251
+ get:
252
+ tags: [metrics]
253
+ operationId: effectiveScenario
254
+ x-status: live # server >= 7.152.0 `capability-scenario-effective`; capability bit `effectiveScenario`; SDK client.effectiveScenario() consumes it.
255
+ summary: Which scenario takes effect for THIS request, and from which layer?
256
+ description: >
257
+ Answers `{ scenario, source }` — the scenario the gate chooses for this caller and request, and which layer it came from (`request` = the caller named it, `ruling` = the registry's assignment chain answered,
258
+ `deployment` = this deployment's default). Naming is read the same way the submit leg reads it: the optional `?scenario=<name>` query and the `x-agent-scenario` header are both namings (a repeated `?scenario=`
259
+ => 400 `request.field_invalid`; the two naming DIFFERENT scenarios => 400 `scenario_conflict`). The refusals are byte-for-byte those of the same request shape on submit: 400 `scenario_unknown` /
260
+ `scenario_not_allowed` / `scenario_conflict`, 503 `state.scenario_assignment_unknown` / `state.scenario_assignment_unavailable` (a dangling assignment / a registry that cannot answer — never silently
261
+ falls back to a default). A client that does not name a scenario reads this first to learn the name, then expands it with `GET /v1/capabilities/scenarios/{name}`.
262
+ parameters:
263
+ - { name: scenario, in: query, required: false, schema: { type: string }, description: 'Name the scenario explicitly (same reading as the submit leg).' }
264
+ responses:
265
+ '200':
266
+ description: The scenario that takes effect, and its source layer.
267
+ content:
268
+ application/json:
269
+ schema: { $ref: '#/components/schemas/EffectiveScenario' }
270
+ '400':
271
+ description: '`scenario_unknown` / `scenario_not_allowed` / `scenario_conflict` / `request.field_invalid` (repeated `?scenario=`).'
272
+ content:
273
+ application/json:
274
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
275
+ '401': { $ref: '#/components/responses/Unauthorized' }
276
+ '503':
277
+ description: '`state.scenario_assignment_unknown` / `state.scenario_assignment_unavailable`.'
278
+ content:
279
+ application/json:
280
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
281
+
247
282
  # ── S-481(server >= 7.93.0;core 7.26.0 `probeMcpServers`)—— 无 run 可读的逐台 MCP 状态面,两条口一套词表 ──
248
283
  /v1/capabilities/mcp:
249
284
  parameters:
@@ -2213,9 +2248,12 @@ paths:
2213
2248
  summary: Light session-follow probe — the leaf pointer as a natural version number.
2214
2249
  description: >
2215
2250
  [1075]② — `leafId` is the session tree's leaf pointer; ANY append changes it, so it doubles as a
2216
- version number. Serves an ETag (`"<leafId>"`, `"empty"` when the session has no entries); poll with
2217
- `If-None-Match` and a hit is a zero-body 304 (idle-poll cost ≈ 0 — the deliberate alternative to a
2251
+ version number. Serves an ETag; poll with `If-None-Match` and a hit is a zero-body 304 (idle-poll cost ≈ 0 — the deliberate alternative to a
2218
2252
  cross-replica session SSE fan-out; the SSE face `/events` exists separately, connection-capped).
2253
+ 🔴 server >= 7.152.0: the 200 body also carries the occupancy keys `activeTaskId` (the holder of this session's single active claim right now; `null` once the claim is released; absent where the
2254
+ deployment records no claims, e.g. `DB_BACKEND=memory`) and `activeTaskStatus` (`running` | `suspended` | `needs_review`; the same projection as the 409 `conflict.session_active_run` body), and the ETag is
2255
+ the sha256 base64url of the 200 BODY BYTES — OPAQUE, no longer `"<leafId>"`: send back the ETag you received (a probe built from `leafId` never hits 304). The probe reads the run store on every call and does
2256
+ not swallow store errors: a durable run store that cannot be read => 500 `internal.error`. <= 7.151.x: body = `{ sessionId, leafId }`, ETag = `"<leafId>"` (`"empty"` when there are no entries).
2219
2257
  Owner-scoped (non-owner → 404, no existence oracle). 501 without a durable session store
2220
2258
  (SESSION_BACKEND=tidb|pg|local).
2221
2259
  parameters:
@@ -2226,17 +2264,23 @@ paths:
2226
2264
  description: Previous ETag; on match the response is 304 with no body.
2227
2265
  responses:
2228
2266
  '200':
2229
- description: The current leaf pointer (ETag header carries the same value).
2267
+ description: 'The current leaf pointer and the session''s occupancy (the ETag header is an opaque digest of this body).'
2268
+ headers:
2269
+ ETag:
2270
+ schema: { type: string }
2271
+ description: 'server >= 7.152.0: sha256 base64url of the 200 body bytes (opaque — echo it, never derive it from `leafId`). <= 7.151.x: `"<leafId>"`.'
2230
2272
  content:
2231
2273
  application/json:
2232
2274
  schema:
2233
2275
  type: object
2234
- # 封闭:铸造点 `routes/sessions.ts` 是两键字面量;版本号本身走 ETag 响应头,不进体。
2276
+ # 封闭:铸造点 `routes/sessions.ts`;server >= 7.152.0 多占用两键(`DB_BACKEND=memory` 上两键都不在)。
2235
2277
  additionalProperties: false
2236
2278
  required: [sessionId, leafId]
2237
2279
  properties:
2238
2280
  sessionId: { type: string }
2239
2281
  leafId: { type: ["string", "null"], description: "null = session exists but has no entries yet." }
2282
+ activeTaskId: { type: ["string", "null"], description: "server >= 7.152.0: the holder of the session's single active claim; null = the claim is released. Absent where claims are not recorded." }
2283
+ activeTaskStatus: { allOf: [{ $ref: '#/components/schemas/SessionActiveTaskStatus' }], description: "server >= 7.152.0: the holder run's status; present only with a holder." }
2240
2284
  '304': { description: 'Leaf unchanged since the presented ETag (no body).' }
2241
2285
  '401': { $ref: '#/components/responses/Unauthorized' }
2242
2286
  '404':
@@ -2446,8 +2490,9 @@ paths:
2446
2490
  description: >-
2447
2491
  Woken — the resumed leg ran to its next settle (terminal, re-suspended, or needs_review). 🔴 A message-carrying wake that is CANCELLED
2448
2492
  (`POST /v1/runs/{taskId}/cancel`) while the deployment's `userPromptSubmit` gate is still answering lands HERE, not as a 409 (server
2449
- >= 7.115.0 / core 7.40.1): `{ status: "failed", errorCode: "cancelled", bindingEnforced: true }` — RETURNED, branch on `errorCode`; the
2450
- park is closed with the cancel, so a second wake is 404 `not_found.parked_checkpoint` (continue the session with a new submit).
2493
+ >= 7.115.0 / core 7.40.1): `{ status: "failed", errorCode: "cancelled", bindingEnforced: true, errorMessage }` — RETURNED, branch on `errorCode` (server >= 7.152.0 also carries `bindingEnforced` and the cancel's
2494
+ terminal sentence `errorMessage` on this body; <= 7.151.x had neither). What the park does afterwards depends on the version: server >= 7.148.0 it STAYS and a second wake answers 200; 7.141.0 – 7.147.0 a wake
2495
+ cancelled at the entry screen / precheck (leg thrown as `checkpoint.resume_aborted`) closed the park and a second wake is 404 `not_found.parked_checkpoint` (continue the session with a new submit).
2451
2496
  content:
2452
2497
  application/json:
2453
2498
  schema:
@@ -2469,7 +2514,7 @@ paths:
2469
2514
  retriable: { type: boolean, description: 'true = the park is STILL pending (re-parked); refetch and retry. Synchronous form only.' }
2470
2515
  '400': { $ref: '#/components/responses/BadRequest' }
2471
2516
  '401': { $ref: '#/components/responses/Unauthorized' }
2472
- '404': { description: 'No parked checkpoint for this session (nothing to wake; `not_found.parked_checkpoint`), or session not visible to the caller. Also what a SECOND wake gets after a message-carrying wake was cancelled (server >= 7.115.0: that park was closed with the cancel — continue the session with a new submit).' }
2517
+ '404': { description: 'No parked checkpoint for this session (nothing to wake; `not_found.parked_checkpoint`), or session not visible to the caller. Also what a SECOND wake gets on server 7.141.0 – 7.147.0 after a wake cancelled at the entry screen / precheck closed the park (server >= 7.148.0 keeps the park; a second wake answers 200) — continue the session with a new submit.' }
2473
2518
  '409':
2474
2519
  description: >
2475
2520
  Pending gate (`wake.gate_pending` — decide it through its own entry) or resume context missing; also the resume-leg refusals core
@@ -3667,7 +3712,7 @@ paths:
3667
3712
  `synced` (and `synced.count` still counts ONLY the durable queue).
3668
3713
  🔴 THE TWO WORDS DELIBERATELY DO NOT REUSE `pending`/`resolved`: those are keyed by
3669
3714
  `(sessionId, toolCallId)` and decided at `POST /v1/approvals/{sessionId}/decide`, while a live row is
3670
- keyed by `approvalId` and decided at `POST /v1/tool-approvals/{id}/respond`. Sharing one word
3715
+ keyed by `approvalId` and decided at `POST /v1/tasks/{taskId}/asks/{askId}/decision`. Sharing one word
3671
3716
  would eventually send a live card to the decide door — a 404 with no wire evidence of the mistake.
3672
3717
  ⚠️ Both live words come from an IN-PROCESS window projection, so their cross-replica reach is exactly
3673
3718
  that of `GET /v1/approvals`'s `livePending` — narrower than the durable pair above. The deployment
@@ -4842,22 +4887,24 @@ paths:
4842
4887
  '404': { description: no pending question for this id (non-owner, answered, expired, or wrong replica) — no existence oracle. }
4843
4888
  '501': { description: AskUserQuestion is not enabled on this worker (ASK_QUESTION_ENABLED). }
4844
4889
 
4845
- /v1/tool-approvals/{id}:
4890
+ /v1/tasks/{taskId}/asks/{askId}:
4846
4891
  parameters:
4847
4892
  - $ref: '#/components/parameters/PrincipalHeader'
4848
- - { name: id, in: path, required: true, schema: { type: string }, description: 'The ask''s `approvalId` (server >= 7.133.0 always equal to its `askId`; an opaque string).' }
4893
+ - $ref: '#/components/parameters/TaskIdPath'
4894
+ - { name: askId, in: path, required: true, schema: { type: string }, description: 'From ApprovalRequestFrame.askId (the durable identity; always equal to the frame''s `approvalId`; an opaque string).' }
4849
4895
  get:
4850
4896
  tags: [questions]
4851
- operationId: toolApprovalRead
4852
- x-status: live # server >= 7.133.0; SDK toolApprovals.get consumes it
4853
- summary: Read ONE live-card ask — where is it now (pending, decided, parked or void)? Pure read.
4854
- description: >
4855
- server >= 7.133.0 — the by-ask read door. Same root and same gate as POST /v1/tool-approvals/{id}/respond (one `gatedPrincipal`; an owner-gate miss answers the SAME 404 as an unknown
4856
- id — no existence oracle), and the state is read the way the answer door reads it: a live registration on THIS replica waiting for the ask => `pending` (the body is the `livePending[]` row projection +
4857
- `state`); otherwise the row is read by id: `DECIDED` => `decided`, `PARKING` / `PARKED` => `parked`, `DENIED` / `VOID` => `void`. A row still `STREAM_PENDING` with no local registration lives on
4858
- another replica => 404 `tool_approval.not_pending` + `cause: "unknown_or_other_replica"` (the same answer as a late respond); a deployment with no ask ledger answers the same 404 WITHOUT `cause`.
4859
- Pure read: zero writes, no settlement, the local registration is untouched. Use it to ask "is this card still alive / was it decided by anyone" instead of inferring it from a respond 404.
4860
- An older server (<= 7.132.x) has no such door: routing-level 404 `not_found.route` — tell it apart from this door's 404 by `errorCode`, never by status.
4897
+ operationId: askRead
4898
+ x-status: gated # server >= 7.152.0; SDK toolApprovals.readAsk consumes it; no ask ledger on the worker => 501 feature.approval_ask_disabled
4899
+ summary: Read ONE approval ask — where is it now (pending, decided, parked or void)? Pure read.
4900
+ description: >
4901
+ server >= 7.152.0 — the by-ask READ half of the one pair of doors on an approval card (the DECIDE half is POST /v1/tasks/{taskId}/asks/{askId}/decision; one id, one gate,
4902
+ one `gatedPrincipal`; an ask the caller cannot see answers the SAME 404 `not_found.ask` on both doors — no existence oracle). It replaces the by-id read door that sat
4903
+ under a different root before 7.152.0 (deleted; the old path now answers the generic routing 404 `not_found.route`).
4904
+ The state is read the way the decision door reads it: a live registration on THIS replica waiting for the ask => `pending` (the body is the `livePending[]` row projection plus `state`);
4905
+ otherwise the row is read by id: `DECIDED` => `decided` (`decision` is `approve` | `deny`), `PARKING` / `PARKED` => `parked`, `DENIED` / `VOID` => `void`. A row still `STREAM_PENDING` with no
4906
+ local registration lives on another replica => 404 `tool_approval.not_pending` + `cause: "unknown_or_other_replica"`. Pure read: zero writes, no settlement, the local registration is untouched.
4907
+ When the store cannot read the row the READ door answers 404 `not_found.ask` (it cannot see it) where the decision door answers 500 `internal.error`.
4861
4908
  responses:
4862
4909
  '200':
4863
4910
  description: The ask's current state.
@@ -4867,129 +4914,17 @@ paths:
4867
4914
  '401': { $ref: '#/components/responses/Unauthorized' }
4868
4915
  '404':
4869
4916
  description: >
4870
- Server >= 7.148.0: an ask the caller cannot see (never existed / not yours / unreadable row / no ask ledger on this worker)
4871
- answers `not_found.ask` (no status keys; close the card), and `tool_approval.not_pending` reaches the OWNER only. ≤ 7.147.x reading:
4872
- `tool_approval.not_pending` — unknown / not yours (byte-identical) / still pending on another replica (`cause: unknown_or_other_replica`). Past the owner gate the body may carry the additive `cause`
4873
- (see ToolApprovalNotPendingCause); no ask ledger => no `cause`.
4917
+ An ask the caller cannot see (never existed / belongs to another task / not yours / unreadable row / no ledger row) answers `not_found.ask` (no status keys; close the card).
4918
+ `tool_approval.not_pending` reaches an owner whose ask is visible but has no readable state now (still pending on another replica with `cause: unknown_or_other_replica`; a
4919
+ decided row that holds no usable direction / instant — no `cause`). Both codes read as "close the card".
4874
4920
  content:
4875
4921
  application/json:
4876
4922
  schema: { $ref: '#/components/schemas/ToolApprovalNotPendingBody' }
4877
- '501': { description: 'Live tool-approval HITL not enabled (TOOL_APPROVAL_ENABLED) — `feature.tool_approval_disabled`.' }
4878
-
4879
- /v1/tool-approvals/{id}/respond:
4880
- parameters:
4881
- - $ref: '#/components/parameters/PrincipalHeader'
4882
- - { name: id, in: path, required: true, schema: { type: string } }
4883
- post:
4884
- tags: [questions]
4885
- operationId: toolApprovalRespond
4886
- x-status: live # spec-path-gate 首批回填 2026-07-27([816]/[820]② CC 三选卡;SDK toolApprovals.respond 消费)
4887
- summary: Answer a live policy `ask` (the CC three-choice card). LIVE-ONLY + same-replica.
4888
- description: >
4889
- Body `{decision: "allow"|"allow_session"|"deny", updatedInput?}` (`allow_session` additionally arms the
4890
- per-session allow-all for the fs-write family; `updatedInput` = ctrl+g edited args, server ≥1.28x G7).
4891
- Owner-gated with NO existence oracle (wrong owner / wrong replica / after settle or TTL → 404); body is
4892
- validated FIRST (400 is existence-independent). 501 when TOOL_APPROVAL_ENABLED is off.
4893
- requestBody:
4894
- required: true
4895
- content:
4896
- application/json:
4897
- schema:
4898
- type: object
4899
- required: [decision]
4900
- additionalProperties: true
4901
- properties:
4902
- decision: { type: string, enum: [allow, allow_session, deny] }
4903
- updatedInput: { description: 'ctrl+g edited tool args (replaces the asked args on allow).' }
4904
- persistRule:
4905
- allOf: [{ $ref: '#/components/schemas/PersistRuleSelection' }]
4906
- description: >
4907
- The person ticked "don't ask again". TWO MUTUALLY EXCLUSIVE ARMS — the candidate/edited arm
4908
- `{ rule, edited? }` and the batch arm `{ batchOfferIndex }`; the shapes, the server's four
4909
- verbatim 400 texts, the two capability bits to probe first and the `deny` posture are on
4910
- the PersistRuleSelection schema. Allow-family only (on `deny` the whole field is ignored).
4911
-
4912
- ⚠️ If the frame carried no `ruleOffers`, do not send this key —
4913
- there is nothing redeemable for THIS card and the answer is necessarily
4914
- `rulePersisted:false` + `rule_lane_unavailable` (the missing material short-circuits BEFORE
4915
- any candidate comparison, so it is never `rule_not_offered`). Absence has several causes —
4916
- no rule store wired, the engine minted no offer for this command (compound / redirect /
4917
- substitution), the command bytes were unreadable, or this ask belongs to one of the seven
4918
- families that never get offers — so do NOT diagnose the deployment's rule lane from one
4919
- frame or from that one refusal.
4920
- decidedBy:
4921
- allOf: [{ $ref: '#/components/schemas/ApprovalDecidedBy' }]
4922
- description: >-
4923
- server >= 7.118.0 — WHO made this decision (one key read the same way by all three decision doors; see
4924
- ApprovalDecidedBy). ABSENT = `person`. This door's own answers: a `policy` allow on a person-required card
4925
- and a word outside the closed set are both 400 `request.body_shape`, refused BEFORE the decision (the card is
4926
- still open; answer it again with the same `approvalId`). 🔴 An older server (no `approvalDecidedBy`
4927
- capability bit) DROPS this key silently and answers 200 — probe the bit first.
4928
- decidedVia:
4929
- allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
4930
- description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
4931
- note:
4932
- type: string
4933
- maxLength: 2048
4934
- description: >
4935
- server #229 (>=7.15.0), ADDITIVE — the human's REASON for this decision. Lands in the durable
4936
- ask row's `decision_note` column (the audit face); same word, same 2048 cap and the SAME COLUMN
4937
- as the durable decide leg's `note` (POST /v1/tasks/{taskId}/asks/{askId}/decision) — there is no
4938
- third dialect.
4939
-
4940
- ANY decision may carry it, `deny` included — "why it was refused" is the most valuable line on
4941
- the audit face. `allow_session` persists as `approve` (three wire values map to two row values)
4942
- and its note rides that approve row; nothing is lost and no second row is written.
4943
-
4944
- A malformed value (non-string / over the cap) is a loud 400 `request.body_shape`, never a silent
4945
- truncation — a quietly halved audit reason is worse than none.
4946
-
4947
- 🔴 PROBE `capabilities.approvalDecisionNote` BEFORE SENDING: this endpoint's body validation is
4948
- NOT strict (hand-written parser, unknown keys are ignored), so an older server answers 200 and
4949
- records nothing. Bit absent = old server, do not offer the field. Bit present ⇒ read the
4950
- per-call truth from the ack's `noteRecorded`.
4951
- readRootGrant:
4952
- type: string
4953
- minLength: 1
4954
- description: >-
4955
- S-720 (server >= 7.102.0 / core 7.32.0 #1093), ADDITIVE — "Yes, and add directory": the frame's
4956
- `readRootCandidate.dir` sent back BYTE FOR BYTE (a STRING — never normalised, cut or composed; not an
4957
- object). Beside `allow` it also adds that directory to THIS RUN's read directories (read faces only).
4958
- 🔴 `decision:"allow"` ONLY — on `allow_session` / `deny` the server refuses BEFORE the decision with 400
4959
- `request.body_shape` (the card stays open; answer the same `approvalId` again). SHAPE gate: a non-empty
4960
- string of at most core's `READ_ROOT_CANDIDATE_DIR_MAX`, else the same 400 (an over-long value is refused
4961
- whole, never cut — a cut directory is another directory). The server judges SHAPE, never VALUE: whether
4962
- it equals the card's string is the ENGINE's call, and the verdict arrives only as an `engine_notice` —
4963
- `approval.read_root_granted` (the run's read roots really widened) or `approval.read_root_grant_rejected`
4964
- (nothing changed; the decision stands). The 200 never says which. Reach: THIS RUN only (the ask row has no
4965
- such column, so replay / failover / durable resume do not carry it) and THIS DOOR only (the durable
4966
- `/decide` and the in-stream `…/asks/{askId}/decision` doors do not read it). An older server ignores the
4967
- unknown key and answers 200 with a plain allow (no capability bit yet) — trust the notice.
4968
- responses:
4969
- '200':
4970
- description: Ack (`decision` echoed).
4971
- content:
4972
- application/json:
4973
- # census 批2 第三段(2026-07-30):这条 200 原本是裸 `{type: object, additionalProperties: true}`,
4974
- # 而 `ToolApprovalRespondAck` 本文件里早就有、path 从来没引用(usage 三兄弟同款脱钩)。接上。
4975
- schema: { $ref: '#/components/schemas/ToolApprovalRespondAck' }
4976
- '400': { description: Malformed body (existence-independent). }
4977
- '401': { $ref: '#/components/responses/Unauthorized' }
4978
- '404':
4979
- description: >
4980
- Server >= 7.148.0: an ask the caller cannot see (never existed / not yours / unreadable row / no ask ledger on this worker)
4981
- answers `not_found.ask` (the durable decide door's code, no status keys — close the card on it as on `tool_approval.not_pending`);
4982
- `tool_approval.not_pending` then reaches the OWNER only (row `VOID` / `DENIED` with its cause word, `unknown_or_other_replica`,
4983
- a bad row with no cause). ≤ 7.147.x reading:
4984
- Unknown/settled/expired/foreign approval (no existence oracle) — `tool_approval.not_pending`. Past the owner gate the body may carry
4985
- an additive `cause` (`ToolApprovalNotPendingCause`): a row-ending cause word (the card ended without a human decision — dismiss it)
4986
- or `unknown_or_other_replica` (this replica does not know the id — retry on another endpoint / replica). 🔴 server >= 7.124.0 retired
4987
- the old words `voided` / `denied` (replaced by the concrete cause word, no alias); a row with no recorded cause carries no key, and a
4988
- deployment without a durable ask ledger never sends it. Not-yours is byte-identical to unknown.
4923
+ '501':
4924
+ description: 'The approval ask ledger is not on this worker (`feature.approval_ask_disabled`; needs the approval seat, a store backend and a park facility). Probe `capabilities.streamApproval`.'
4989
4925
  content:
4990
4926
  application/json:
4991
- schema: { $ref: '#/components/schemas/ToolApprovalNotPendingBody' }
4992
- '501': { description: Live tool-approval HITL not enabled (TOOL_APPROVAL_ENABLED). }
4927
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4993
4928
 
4994
4929
  /v1/tasks/{taskId}/asks/{askId}/decision:
4995
4930
  parameters:
@@ -5002,21 +4937,22 @@ paths:
5002
4937
  x-status: gated # design/172 §3.2 (#151 车4) — SHIPPED in server 7.3.0 (7.3.0/7.4.0 both on npm); off-by-flag (STREAM_APPROVAL_ENABLED, default OFF ≤7.4.0 / ON ≥7.5.0) ⇒ 501 feature.approval_ask_disabled when the five-way gate is unmet. SDK toolApprovals.decideAsk() 消费。
5003
4938
  summary: Settle an IN-STREAM approval card (design/172 streaming approval protocol).
5004
4939
  description: >
5005
- The in-stream sibling of POST /v1/tool-approvals/{id}/respond: the approver is live on the SSE stream, so
4940
+ The DECIDE half of the one pair of doors on an approval card (server >= 7.152.0; the READ half is GET /v1/tasks/{taskId}/asks/{askId}): the approver is live on the SSE stream, so
5006
4941
  the ask does a stream round-trip and the run never parks. Keyed on `askId` (the DURABLE identity derived
5007
- from a five-tuple), so the decision is accepted by ANY replica (the CAS lands in the persistent store).
4942
+ from a five-tuple), so the decision is accepted by ANY replica (the CAS lands in the persistent store). From server 7.152.0 this is the ONLY human decision door of a live card:
4943
+ the old live answer door (`POST /v1/tool-approvals/{id}/respond`) is deleted (it now answers the generic routing 404 `not_found.route`).
5008
4944
 
5009
- Decision is a TWO-word set (`approve`/`deny`) — `allow_session` is a live-bridge-only semantic and is NOT
5010
- on this endpoint. `actor` accepts ONLY `label`: `id`/`verified` are always server-minted and an actor
4945
+ Decision is a TWO-word set (`approve`/`deny`); the old three-word live set's third word is the independent key `remember: "session"` on an `approve`. The live-card words
4946
+ `remember` / `persistRule` / `readRootGrant` are said only through this door. The door is open to the operator seat: an operator may carry `remember: "session"` / `persistRule`
4947
+ on SOMEONE ELSE's live card. `actor` accepts ONLY `label`: `id`/`verified` are always server-minted and an actor
5011
4948
  NEVER participates in the permission decision (design/171 §5.1).
5012
4949
 
5013
4950
  Response doctrine (design/172 §3.2, four rules): ① same `idempotencyKey` retried → the ORIGINAL 200
5014
4951
  replayed (no second CAS); ② already DECIDED with a DIFFERENT decision → 409 `conflict.ask_decided`
5015
4952
  carrying the first decision echo (`decision`/`decidedAtMs`/`actor`; `note` is NEVER echoed across
5016
- permission boundaries); ③ PARKED/DENIED/VOID → 410 `gone.ask_parked` (with the gate reconciliation
5017
- coordinates `{sessionId, gateBoundCallId, gateBoundInputHash}` — NEVER the checkpoint token) or
5018
- `gone.ask`; ④ PARKING → 425 `parking.ask_retry` — retrying fetches the FINAL ROUTING INFO, it does NOT
5019
- retry acceptance of the decision (the window is already closed).
4953
+ permission boundaries); ③ DENIED/VOID → 410 `gone.ask` (`{state, cause?}`); a PARKED row is REDEEMED through the durable redemption leg (200 + `accepted: "parked_redeemed"`) — the
4954
+ 410 `gone.ask_parked` (gate reconciliation coordinates `{sessionId, gateBoundCallId, gateBoundInputHash}`, NEVER the checkpoint token) is only the arm where the gate no longer sits where the row says;
4955
+ ④ PARKING → 425 `parking.ask_retry` + `Retry-After` — the decision was NOT accepted this time: wait the header's seconds and RESEND (the resend reads where the ask finally landed).
5020
4956
 
5021
4957
  Attribution split: DENIED is produced ONLY by routing failure (`routing_failure_fail_closed`); an
5022
4958
  operator refusal is DECIDED(decision=deny). A timeout NEVER produces a deny.
@@ -5027,10 +4963,13 @@ paths:
5027
4963
  schema: { $ref: '#/components/schemas/AskDecisionBody' }
5028
4964
  responses:
5029
4965
  '200':
5030
- description: The decision was accepted (or replayed for the same idempotencyKey).
4966
+ description: 'The decision was accepted (or replayed for the same idempotencyKey), or — on a PARKED row — the parked card was redeemed (`accepted: "parked_redeemed"`).'
5031
4967
  content:
5032
4968
  application/json:
5033
- schema: { $ref: '#/components/schemas/AskDecisionAck' }
4969
+ schema:
4970
+ oneOf:
4971
+ - $ref: '#/components/schemas/AskDecisionAck'
4972
+ - $ref: '#/components/schemas/AskDecisionParkedRedeemed'
5034
4973
  '400':
5035
4974
  description: 'Malformed body — `request.invalid_json` (unparseable) or `request.body_shape` (schema reject, e.g. an `actor` carrying anything but `label`, or — on a server < 7.104.0 — a `settledBy` key). Server >= 7.118.0 reads `decidedBy` (see AskDecisionBody.decidedBy): `request.field_conflict` (a `policy` allow on a person-required card), `decided_by_not_in_proof` (direct-door worker), `request.field_invalid` (outside the closed set); the retired `settledBy` key is a `request.body_shape`.'
5036
4975
  content:
@@ -5064,9 +5003,9 @@ paths:
5064
5003
  schema: { $ref: '#/components/schemas/AskGoneBody' }
5065
5004
  '425':
5066
5005
  description: >
5067
- PARKING — transferring to the delivery plane. `parking.ask_retry`; the retry fetches FINAL ROUTING
5068
- INFO, never acceptance. The body carries `retryAfterSec` and NO gate coordinates (they are not
5069
- written until bind).
5006
+ PARKING — transferring to the delivery plane. `parking.ask_retry`; this decision was NOT accepted and is not
5007
+ queued — wait `Retry-After` and send it again (a row that has landed as PARKED redeems it: 200 `parked_redeemed`;
5008
+ an ask that ended without a human answer answers 410 `gone.ask`). The body carries `retryAfterSec` and NO gate coordinates.
5070
5009
  headers:
5071
5010
  Retry-After:
5072
5011
  schema: { type: integer }
@@ -5076,8 +5015,8 @@ paths:
5076
5015
  schema: { $ref: '#/components/schemas/AskParkingBody' }
5077
5016
  '501':
5078
5017
  description: >
5079
- In-stream approval protocol not on this worker (`feature.approval_ask_disabled`) — no ask store, or
5080
- STREAM_APPROVAL_ENABLED is off. Probe `capabilities.streamApproval` (same predicate as this gate),
5018
+ The approval ask ledger is not on this worker (`feature.approval_ask_disabled`) — the approval seat, a store backend and a park facility must all be present
5019
+ (the old `STREAM_APPROVAL_ENABLED` switch is retired; setting it refuses to start). Probe `capabilities.streamApproval` (same predicate as this gate),
5081
5020
  do not trial-by-501.
5082
5021
  content:
5083
5022
  application/json:
@@ -7731,6 +7670,18 @@ components:
7731
7670
  alias withdrawn at #342).
7732
7671
  examples: ['code', 'default', 'code-review', 'scan']
7733
7672
 
7673
+ ScenarioSource:
7674
+ type: string
7675
+ enum: [request, ruling, deployment]
7676
+ description: 'server >= 7.152.0 (closed, read it exhaustively; sdk `SCENARIO_SOURCES`): which layer chose the scenario — `request` (the caller named it), `ruling` (the registry assignment chain), `deployment` (this deployment''s default).'
7677
+ EffectiveScenario:
7678
+ type: object
7679
+ description: 'The 200 body of GET /v1/capabilities/scenario (server >= 7.152.0).'
7680
+ required: [scenario, source]
7681
+ additionalProperties: false
7682
+ properties:
7683
+ scenario: { type: string }
7684
+ source: { $ref: '#/components/schemas/ScenarioSource' }
7734
7685
  ScenarioDetail:
7735
7686
  # 新增(2026-07-25 回填批):`GET /v1/capabilities/scenarios/{name}` 此前**整条路径**都不在本文件里
7736
7687
  # (只有 `Capabilities.scenarios` 那个名字数组)。形按 server 亲读取证(`src/http/routes/capabilities.ts`)。
@@ -8461,9 +8412,9 @@ components:
8461
8412
  A resume replay of a stored body whose seat went bad => 409 `resume_blocked_by_policy`. A compliance deny is a REFUSAL, not a narrowing: a request denying `web_fetch` is refused whole where the default tool surface still mounts `WebFetch` (the single-user default does).
8462
8413
  🔴 `settings.approvalFrameFamilies` (server >= 7.134.0; send it on sight of `capabilities.taskSettings.approvalFrameFamilies === true` — NOT of the top-level
8463
8414
  `capabilities.approvalFrameFamilies`, which <= 7.133.x already has while answering 400 `request.body_shape` for this key): the approval opening-frame FAMILIES this
8464
- run's client RENDERS — an array of `tool_approval` / `approval_request`, each once (`[]` reads as absent). Bad value (not an array / a word outside the set / a
8415
+ run's client RENDERS — an array of `approval_request` (the only family since server >= 7.152.0; server 7.134.0-7.151.x also accepted `tool_approval`), each once (`[]` reads as absent). Bad value (not an array / a word outside the set / a
8465
8416
  repeat) => 400 `request.field_invalid` with `field: "settings.approvalFrameFamilies"`, `reason: "bad_entry"` and `index` (absent for a non-array). BEHAVIOR (BREAKING, wire):
8466
- a run whose declaration does not contain the family this worker presents (`capabilities.approvalFrameFamilies`) has NO live approval channel — no card of either
8417
+ a run whose declaration does not contain the family this worker presents (`capabilities.approvalFrameFamilies`) has NO live approval channel — no card of any
8467
8418
  family (no fallback, no double send), no replay in the stream preamble of the sync stream or of `GET /v1/runs/{taskId}/events`; every ask goes to the unattended
8468
8419
  policy at once: with a durable store (`capabilities.approvals`) it parks per the operator policy (default; answer through `POST /v1/approvals/{sessionId}/decide`)
8469
8420
  or is refused naming the missing family; with NO durable store the gated tool is refused on the spot and the run finishes (no card, no decide). The declaration
@@ -10495,12 +10446,11 @@ components:
10495
10446
 
10496
10447
  ApprovalFrameFamily:
10497
10448
  type: string
10498
- enum: [tool_approval, approval_request]
10449
+ enum: [approval_request]
10499
10450
  description: >-
10500
- The approval opening-frame FAMILY words (closed; the server's `APPROVAL_FRAME_FAMILIES` verbatim and in order): `tool_approval` = the legacy family
10501
- (live card `tool_approval` / close `tool_approval_complete`); `approval_request` = the card family (`approval_request` / `approval_complete` /
10502
- batch revoke `approval_revoke`). ONE vocabulary for two faces: the capability `approvalFrameFamilies` (which family this worker presents) and, server >= 7.134.0,
10503
- the request key `settings.approvalFrameFamilies` (which families this run's client renders).
10451
+ The approval opening-frame FAMILY words (closed; the server's `APPROVAL_FRAME_FAMILIES` verbatim) — ONE word since server 7.152.0: `approval_request` = the card family (`approval_request` / `approval_complete` /
10452
+ batch revoke `approval_revoke`); the legacy `tool_approval` family is retired. ONE vocabulary for two faces: the capability `approvalFrameFamilies` (`["approval_request"]` = this worker presents cards, `[]` = none) and,
10453
+ server >= 7.134.0, the request key `settings.approvalFrameFamilies` (which families this run's client renders; a word outside the set => 400 `request.field_invalid`, `bad_entry`).
10504
10454
  ApprovalDecision:
10505
10455
  type: object
10506
10456
  description: >
@@ -10564,6 +10514,13 @@ components:
10564
10514
  not inside the HMAC payload, so accepting it unsigned would be tamperable); 501 without an exemption
10565
10515
  store. On the parked-background-agent leg the grant lands on the child's ROOT/HOST session (the whole
10566
10516
  session tree shares it). The 200 body echoes `rememberApplied` when a store is wired.
10517
+ persistRule:
10518
+ allOf: [{ $ref: '#/components/schemas/PersistRuleSelection' }]
10519
+ description: >-
10520
+ server >= 7.152.0 (capability `approvalDecideRuleSlot`; send on sight of the bit — an older server answers 400 `request.body_shape`) — "do not ask again": the rule this FIRST decision of a parked
10521
+ tool-approval card should persist, redeemed at the resume leg's settle point against the record minted with the card (not the current list). Same shape, arms and refusals as the decision door's `persistRule`
10522
+ (PersistRuleSelection; `scope` is always refused). The 200 carries the rule-position keys (`rulePersisted` / `ruleRefusal` / `persistedRule` / `persistedRules` / `persistedRuleAnchors`); a rule that did not persist never flips the
10523
+ verdict. A direct-door deployment carries the key in the proof envelope's sixth-position extension object (key `persistRule`).
10567
10524
  decidedBy:
10568
10525
  allOf: [{ $ref: '#/components/schemas/ApprovalDecidedBy' }]
10569
10526
  description: >-
@@ -10582,7 +10539,7 @@ components:
10582
10539
  a non-string ⇒ 400 `request.field_invalid`; any value on a direct-door worker ⇒ 400 `feedback_not_in_proof` (not inside the signed proof); words
10583
10540
  carrying `<system-reminder>` ⇒ server >= 7.135.0 (engine 7.55.0): 409 `resume_outcome_invalid` + `field: "feedback"` + `retriable: true` (the engine's sentence naming `feedback`; refused before the CAS, the card stays pending — ask the person to change
10584
10541
  or drop the words, do not auto-refetch and re-decide on the code); server 7.134.x: 409 `approval_binding_mismatch` (no `field`). The same door serves parked background-agent cards and workflow child cards; the live
10585
- `POST /v1/tool-approvals/{id}/respond` does NOT take it. Servers <= 7.133.x refuse the key (400 `request.body_shape`, `unknownKeys: ["feedback"]`).
10542
+ `POST /v1/tasks/{taskId}/asks/{askId}/decision` does NOT take it. Servers <= 7.133.x refuse the key (400 `request.body_shape`, `unknownKeys: ["feedback"]`).
10586
10543
  decidedVia:
10587
10544
  allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
10588
10545
  description: 'server >= 7.143.0 (capability `approvalDecidedVia`): which seat answered a `decidedBy: "policy"` decision. Only beside `decidedBy: "policy"`; `null` is not absence (400); any value on a direct-door worker ⇒ 400.'
@@ -11036,7 +10993,7 @@ components:
11036
10993
  NORMAL multi-tenant reading, not a contradiction.
11037
10994
  mcpElicitation: { type: boolean, description: "MCP elicitation round-trips are supported." }
11038
10995
  askUserQuestion: { type: boolean, description: "AskUserQuestion gate is available (durable when approvals are)." }
11039
- toolApproval: { type: boolean, description: "Tool-approval gating is active." }
10996
+ toolApproval: { type: boolean, description: "This worker presents approval cards (server >= 7.152.0: approval seat AND store backend AND park facility must all hold, otherwise no seat is installed and no card exists; <= 7.151.x it only said the approval code is installed). Read `approvalFrameFamilies` for the presented family." }
11040
10997
  approvalsStreamLive:
11041
10998
  type: boolean
11042
10999
  description: >
@@ -11064,12 +11021,10 @@ components:
11064
11021
  maxItems: 1
11065
11022
  items: { $ref: '#/components/schemas/ApprovalFrameFamily' }
11066
11023
  description: >-
11067
- server >= 7.133.0, ALWAYS present (the projection of the same judgement as `streamApproval`) — which FRAME FAMILY this worker's approval opening frames belong to:
11068
- a closed-word array with AT MOST ONE member. `["approval_request"]` = the card protocol is on: one ask travels only `approval_request` -> `approval_complete` / `approval_revoke`
11069
- (the legacy `tool_approval` / `tool_approval_complete` pair is NOT sent — BREAKING vs <= 7.132.x, which sent both families for one ask and relied on `approvalId` de-duplication;
11070
- remedy on the worker: `STREAM_APPROVAL_ENABLED=false`). `["tool_approval"]` = the card protocol is not on (`STREAM_APPROVAL_ENABLED=false`, no store backend, or no checkpoint store) but the live card leg is.
11071
- `[]` = per-call approvals are off altogether (`TOOL_APPROVAL_ENABLED=false`): no card is presented. Dispatch frame families off THIS array, never off `streamApproval`.
11072
- KEY ABSENT (not `[]`) = server <= 7.132.x — there a `streamApproval: true` leg sends BOTH families for one ask.
11024
+ ALWAYS present (the projection of the same judgement as `streamApproval`) — which FRAME FAMILY this worker's approval opening frames belong to: a closed-word array with AT MOST ONE member
11025
+ (server >= 7.152.0: the only word is `approval_request`). `["approval_request"]` = the card protocol is on: one ask travels only `approval_request` -> `approval_complete` / `approval_revoke`.
11026
+ `[]` = this worker presents no approval card (the approval seat needs TOOL_APPROVAL_ENABLED, a store backend and a park facility; any one missing => no seat, no card).
11027
+ Dispatch frame families off THIS array. KEY ABSENT (not `[]`) = server <= 7.132.x — there a `streamApproval: true` leg sent BOTH families for one ask; <= 7.151.x may also answer `["tool_approval"]` (the retired legacy family).
11073
11028
  🔴 server >= 7.134.0: this bit says which family THIS WORKER presents, no longer that you will receive cards — a run has a live approval channel only when
11074
11029
  its submit body declared that family in `settings.approvalFrameFamilies` (send it on sight of `taskSettings.approvalFrameFamilies`, not of this bit — <= 7.133.x
11075
11030
  already had this bit yet answers 400 `request.body_shape` for the key). The value does not change with a declaration. The words are the request key's words.
@@ -11077,7 +11032,7 @@ components:
11077
11032
  type: boolean
11078
11033
  description: >
11079
11034
  design/172 IN-STREAM approval protocol is on this worker (server >=7.3.0, the `streamApproval` bit in
11080
- `src/http/routes/capabilities.ts` — `resolveStreamApprovalGate(...).active`). TRUE ⇒ the live
11035
+ `src/http/routes/capabilities.ts` — `resolveStreamApprovalGate(...).active`; server >= 7.152.0: a THREE-way conjunction — approval seat ∧ store backend ∧ park facility). TRUE ⇒ the live
11081
11036
  stream may carry `approval_request` / `approval_revoke` frames and `POST
11082
11037
  /v1/tasks/{taskId}/asks/{askId}/decision` settles them. FALSE/absent ⇒ that endpoint answers **501
11083
11038
  `feature.approval_ask_disabled`** on every call and the two frames never appear — the SAME predicate
@@ -11103,7 +11058,7 @@ components:
11103
11058
  description: >
11104
11059
  server #229 (>=7.15.0, hard-coded `true` in `src/http/routes/capabilities.ts`) — the VERSION PROBE
11105
11060
  for the decision-REASON field: the live respond leg accepts `note` and its ack carries `noteRecorded`
11106
- (see ToolApprovalRespondAck), and the durable decide leg's three response bodies echo `decisionNote`.
11061
+ (see AskDecisionAck), and the durable decide leg's three response bodies echo `decisionNote`.
11107
11062
 
11108
11063
  🔴 PROBE BEFORE SENDING: the live respond body validation is NOT strict (hand-written parser, unknown
11109
11064
  keys ignored), so an older server answers 200 to a `note` and records nothing. Bit absent = old
@@ -11118,6 +11073,12 @@ components:
11118
11073
  server >= 7.118.0, hardcoded true (a version bit): the three approval decision doors read `decidedBy` (ApprovalDecidedBy).
11119
11074
  Send it only when this is present; absent = an older server (the durable doors and `plan_review` 400 it, the live
11120
11075
  `respond` drops it silently and answers 200).
11076
+ approvalDecideRuleSlot:
11077
+ type: boolean
11078
+ description: 'server >= 7.152.0, constant true — the durable decision door `POST /v1/approvals/{sessionId}/decide` accepts `persistRule` ("do not ask again"; first decision of a parked tool-approval card). Key ABSENT = an older server (it answers 400 `request.body_shape` for the key).'
11079
+ effectiveScenario:
11080
+ type: boolean
11081
+ description: 'server >= 7.152.0, constant true — `GET /v1/capabilities/scenario` exists (which scenario takes effect for this request, and from which layer). Key ABSENT = an older server (routing 404).'
11121
11082
  approvalDecidedVia:
11122
11083
  type: boolean
11123
11084
  description: >-
@@ -11171,7 +11132,7 @@ components:
11171
11132
  type: boolean
11172
11133
  description: >
11173
11134
  server >= 7.44.0 (#340), hard-coded true in the capability object — the VERSION PROBE for the
11174
- free-text arm of POST /v1/tool-approvals/{id}/respond (`persistRule.edited: true`): the rule to
11135
+ free-text arm of POST /v1/tasks/{taskId}/asks/{askId}/decision (`persistRule.edited: true`): the rule to
11175
11136
  persist is text the person HAND-EDITED on the card, not one of the engine's candidates.
11176
11137
 
11177
11138
  PROBE IT BEFORE RENDERING THE EDITABLE INPUT. The live respond body validator is a NON-STRICT
@@ -14712,7 +14673,7 @@ components:
14712
14673
  # #315(server ≥7.43):第二顶层键 `livePending` = streamApproval 窗内的流内 ask(此前对轮询消费端
14713
14674
  # 结构性不可见)。ADDITIVE / tolerate-absent:键缺席=「协调器未装配(本部署无 live 审批面)」或
14714
14675
  # 旧 server;空数组=「有面、此刻无待批」——两义可判别,消费端测 presence。**分数组不混编**:
14715
- # live 行的决议口=POST /v1/tool-approvals/{id}/respond,durable 行=decide 口;数组名即路由判据。
14676
+ # live 行的决议口=POST /v1/tasks/{taskId}/asks/{askId}/decision,durable 行=decide 口;数组名即路由判据。
14716
14677
  # 22.0.0:第三、四顶层键此前漏声明 —— 封闭 schema 上一个真键 = 合法信封被严格校验器拒收。
14717
14678
  additionalProperties: false
14718
14679
  required: [pending]
@@ -14815,7 +14776,7 @@ components:
14815
14776
  type: object
14816
14777
  description: >-
14817
14778
  A live (in-stream) pending ask inside its streamApproval window (#315, server ≥7.43). Decide it via
14818
- POST /v1/tool-approvals/{id}/respond — NOT the /decide route (that is the durable rows' door).
14779
+ POST /v1/tasks/{taskId}/asks/{askId}/decision (`askId` / `taskId` are on the embedded `frame`; the row's top level carries neither) — NOT the /decide route (that is the durable rows' door).
14819
14780
  Optional flags are only-if-true (absent is NEVER encoded as false).
14820
14781
  🔴 THE "tool input/args are NOT listed" NARROWING IS GONE (server >= 7.87.0 / S-454 P1). The old reason
14821
14782
  was "details ride the stream frame" — but a SUSPENDED ask never has a stream frame (at mint time it had
@@ -14833,14 +14794,14 @@ components:
14833
14794
  additionalProperties: true
14834
14795
  required: [approvalId, toolName, ts, expiresAtMs]
14835
14796
  properties:
14836
- approvalId: { type: string, description: 'The SAME id the respond endpoint takes. server >= 7.133.0: for an ask that has a ledger row it is ALWAYS the row''s key `askId` (a 64-character lowercase hexadecimal string — an OPAQUE string, never a uuid); on <= 7.132.x a wire uuidv7.' }
14797
+ approvalId: { type: string, description: 'This ask''s id (equal to `frame.askId` / `frame.approvalId`; decide by `askId`). server >= 7.133.0: for an ask that has a ledger row it is ALWAYS the row''s key `askId` (a 64-character lowercase hexadecimal string — an OPAQUE string, never a uuid); on <= 7.132.x a wire uuidv7.' }
14837
14798
  consumerState:
14838
14799
  type: string
14839
14800
  enum: [absent]
14840
14801
  description: >-
14841
14802
  server >= 7.133.0, TRUE-ONLY (present as `absent`): no engine leg on THIS replica is waiting for this ask. Present <=> the row was ADOPTED from the ask ledger at start-up (minted by a previous
14842
14803
  process / another replica, the row still undecided — a "zombie card"): it lists and can be answered (the row becomes decided; the answer ack carries the same bit), but that decision resumes
14843
- nothing running on this replica — read the run surface to learn whether anything continued. The `live_pending` stream frame and the `pending` arm of GET /v1/tool-approvals/{id} carry it too. After a restart an
14804
+ nothing running on this replica — read the run surface to learn whether anything continued. The `live_pending` stream frame and the `pending` arm of GET /v1/tasks/{taskId}/asks/{askId} carry it too. After a restart an
14844
14805
  ask still undecided on the ledger RETURNS to `livePending[]` (it used to vanish and answer 404). Absent = this replica has an engine leg waiting, or an older server.
14845
14806
  toolName: { type: string }
14846
14807
  ts: { type: number, description: 'Registration time (ms epoch).' }
@@ -14851,7 +14812,7 @@ components:
14851
14812
  type: boolean
14852
14813
  enum: [true]
14853
14814
  description: >-
14854
- server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (live `allow_session` / durable `/decide` `remember:"session"`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `allow_session` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a click on `allow_session` receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while `allow_session` still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
14815
+ server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (`decideAsk` / durable `/decide` `remember:"session"`; on server <= 7.151.x the removed respond door's third word `allow_session`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `remember: "session"` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a `remember: "session"` decision receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while the "allow for the session" click still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
14855
14816
  governanceForced: { type: boolean, enum: [true] }
14856
14817
  mandated: { type: boolean, enum: [true], description: 'server >= 7.101.0 (T4①): the mandated bit, same layer and shape as the two flags above (present only when true); the SAME value as `frame.mandated` (read once when the entry is minted).' }
14857
14818
  mandate:
@@ -14861,7 +14822,7 @@ components:
14861
14822
  allOf: [{ $ref: '#/components/schemas/AskOrigin' }]
14862
14823
  description: 'server >= 7.102.0 (S-755 / cli L-695): WHO raised this ask, read once together with `frame.origin` when the entry is minted. The durable `pending[]` rows of the same response carry it top-level too — one reading for both row families. OPEN set (see AskOrigin).'
14863
14824
  fromSubagent: { type: boolean, enum: [true], description: 'The ask originates from a delegated subagent.' }
14864
- originTaskId: { type: string, description: 'S-52 C2 (server ≥7.52, A-075.87): the delegated child taskId (= the child''s core runSourceTaskId, uuid) — correlates this live ask to the child run row. Minted by the SAME conditional spread as `fromSubagent`: the two keys are always both present or both absent (三键恒等亲证在案).' }
14825
+ sourceSessionId: { type: string, description: 'server >= 7.152.0 (BREAKING RENAME of the top-level key `originTaskId`; same value, no alias): the delegated child''s core SESSION id (the key used to say task; the value was always a session id) — correlates this live ask to the child row; the SAME name and value as `frame.card.sourceSessionId`. Present iff `fromSubagent` is present (host-originated cards carry neither). The `live_pending` stream frame and the `pending` arm of `GET /v1/tasks/{taskId}/asks/{askId}` rename with it. The revoke frame''s `taskId` is the origin RUN id — a different thing, unchanged.' }
14865
14826
  approvalCard:
14866
14827
  allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
14867
14828
  description: 'server >= 7.126.0 (core 7.49.0 #1414): which card this ask renders on — the engine-minted card word, the SAME value as `frame.approvalCard` (the row reads the frame''s own seat, no second read), same layer and shape as the operator queue row''s `approvalCard`. It REPLACES `contentKind` (server <= 7.125.x derived it from the tool name; deleted at 7.126.0, no alias). ABSENT = the engine minted none. Display / triage only; it NEVER takes part in decision routing.'
@@ -14869,13 +14830,10 @@ components:
14869
14830
  const: true
14870
14831
  description: 'server >= 7.143.0 — a row ADOPTED at boot from the ask ledger (see `consumerState`) whose ask was minted before this version: top-level `mandated` / `mandate` / `origin` are absent and this key says "unknown". The same fact as `frame.liveFactsUnknown`.'
14871
14832
  frame:
14872
- oneOf:
14873
- - $ref: '#/components/schemas/ToolApprovalFrame'
14874
- - $ref: '#/components/schemas/ApprovalRequestFrame'
14833
+ $ref: '#/components/schemas/ApprovalRequestFrame'
14875
14834
  description: >-
14876
- server >= 7.87.0 (S-454 P1; cli L-397) — THE CARD FRAME THIS ASK WOULD HAVE EMITTED. TWO SHAPES, by leg (sdk 25.0.0 declares the union; discriminant
14877
- `frame.type`): on a leg that speaks the card protocol (`capabilities.approvalFrameFamilies` contains `approval_request`, server >= 7.133.0) it is the
14878
- `approval_request` frame (card facts under `frame.card`, the ten off-card live facts flat at the top); on a legacy-family leg it is the `tool_approval` frame. It is the SAME
14835
+ server >= 7.87.0 — THE CARD FRAME THIS ASK WOULD HAVE EMITTED. ONE SHAPE since server 7.152.0 (the legacy `tool_approval` family is retired): the
14836
+ `approval_request` frame (card facts under `frame.card`, the off-card live facts flat at the top; `frame.askId` / `frame.taskId` are the two path cells of the decision door). It is the SAME
14879
14837
  OBJECT as the server's `PendingApproval.frame` (the one construction site in `askBroadcast`, already
14880
14838
  redacted / byte-capped / window-keys filled), shared by the suspended and the reachable path — so
14881
14839
  this is NOT a second card projection computed for the list, and there is no second redaction surface.
@@ -15115,6 +15073,11 @@ components:
15115
15073
  🔴 server >= 7.116.0: ALWAYS `false` on a card that carries `rememberRefused: true` (an engine `Skill` card etc. — the
15116
15074
  answer would also grant more than this one call): the decision is accepted and applies once, the exemption store gets
15117
15075
  zero writes (existing key, not a new one). Ordinary cards keep `true` = landed.
15076
+ rulePersisted: { type: boolean, description: 'server >= 7.152.0: only on a FIRST decision whose request carried `persistRule` — whether the rule landed in the rule store. A rule that did not persist NEVER flips the verdict: 200 + `false` + `ruleRefusal`.' }
15077
+ ruleRefusal: { $ref: '#/components/schemas/RuleRefusalReason' }
15078
+ persistedRule: { type: string, description: 'server >= 7.152.0: free-text arm only — the canonical spelling written.' }
15079
+ persistedRules: { type: array, items: { type: string }, description: 'server >= 7.152.0: batch arm only — the canonical texts of every member written.' }
15080
+ persistedRuleAnchors: { type: array, items: { $ref: '#/components/schemas/PersistedRuleAnchor' }, description: 'server >= 7.152.0: index-aligned with `persistedRules`.' }
15118
15081
 
15119
15082
  ApprovalExemption:
15120
15083
  type: object
@@ -15132,6 +15095,14 @@ components:
15132
15095
  description: Principal that granted it; null = ownerless/anonymous grant.
15133
15096
  createdAt: { type: number, description: Epoch MS of the FIRST grant (re-grant refreshes grantedBy only). }
15134
15097
 
15098
+ SessionActiveTaskStatus:
15099
+ type: string
15100
+ enum: [running, suspended, needs_review]
15101
+ description: >-
15102
+ server >= 7.152.0 — the status of the run holding a session (closed three-word set; the same projection as the `activeTaskStatus` key on the 409
15103
+ `conflict.session_active_run` body and on the session head probe): `running` | `suspended` | `needs_review`. Present only when there is a holder.
15104
+ Splits the exit families: `running` => steer / cancel; `suspended` / `needs_review` => decide at the pending gate / cancel.
15105
+
15135
15106
  PendingGateMaterial:
15136
15107
  type: object
15137
15108
  required: [kind, decidePath]
@@ -15217,6 +15188,7 @@ components:
15217
15188
  additionalProperties: true
15218
15189
  properties:
15219
15190
  kind: { const: checkpoint, description: 'server >= 7.143.0: the row family (always `checkpoint` on this schema); absent on servers <= 7.142.x, which list this family only.' }
15191
+ askId: { type: string, description: 'server >= 7.152.0: the ASK identity of this row when it is a parked card with an ask-ledger row — decide it via `POST /v1/tasks/{taskId}/asks/{askId}/decision`, read it via `GET /v1/tasks/{taskId}/asks/{askId}`. ABSENT = the row has no ask-ledger row (a durable `/decide`-only card / an older server): decide it via `POST /v1/approvals/{sessionId}/decide`.' }
15220
15192
  checkpointId: { type: string, minLength: 1, maxLength: 128, description: 'server >= 7.133.0: the NON-SECRET stable identity of the pause this row parks on — the join key where the token cannot go; the SAME value as `PausedCause.checkpointId`. Carried on three durable read surfaces (GET /v1/approvals `pending[]` rows, the /v1/approvals/stream `pending` frame, GET /v1/assistant/inbox rows). A row whose value is unreadable or untrusted (non-string / empty / over 128 / contains the token / an old row / an older server) is STILL LISTED with the key ABSENT — read absence as "this row has no joinable identity", never as a required key.' }
15221
15193
  rowVerdict:
15222
15194
  allOf: [{ $ref: '#/components/schemas/CheckpointRowVerdict' }]
@@ -15278,7 +15250,7 @@ components:
15278
15250
  type: array
15279
15251
  items: { $ref: '#/components/schemas/AllowRuleShadow' }
15280
15252
  description: >
15281
- server >= 7.117.0 (core 7.42.0): the DURABLE dual of `ToolApprovalFrame.allowRuleShadowed` — the allow-layer members that matched this call
15253
+ server >= 7.117.0 (core 7.42.0): the DURABLE dual of `ApprovalCard.allowRuleShadowed` — the allow-layer members that matched this call
15282
15254
  and could not clear its ask (same shape and semantics; entries are secret-redacted again at the server's read boundary). Passed through whole
15283
15255
  on `GET /v1/approvals` and `/v1/approvals/stream`. Absent != "you have no rule". 🔴 The old key `shadowedRule` (a string, server <= 7.116.x)
15284
15256
  is RETIRED: the SQL backend rewrote its parked rows once at the 7.117.0 boot to `[{ member: "persisted", entries: [<old value>] }]`, but the
@@ -15295,12 +15267,12 @@ components:
15295
15267
  pre-5.58 rows fail the new narrow read entry by entry and land as "no supply" (no compatibility
15296
15268
  read — a stale schema means re-ask).
15297
15269
 
15298
- 🔴 THE INDEX ON THIS LEG IS NOT A SELECTION KEY. This projection drops malformed offers one by one
15299
- and COMPACTS, so an excision shifts every later index forward. That is only sound because this leg
15300
- has NO redemption mouth (POST /v1/approvals/{sessionId}/decide takes no rule field). Using it as
15301
- `persistRule.batchOfferIndex` would redeem a different rule than the one the person clicked. The
15302
- live card leg is the opposite (pure prefix truncation, no per-entry drops) and is where redemption
15303
- actually happens.
15270
+ 🔴 THE REDEMPTION MOUTH DEPENDS ON THE SERVER VERSION. From server >= 7.152.0 `POST /v1/approvals/{sessionId}/decide` takes `persistRule`
15271
+ (capability `approvalDecideRuleSlot`; same body shape, refusal sentences and five receipt keys as the card door): redeem from this row by copying a
15272
+ single offer's text verbatim into `persistRule.rule` (exactly one offer must match), or, for the conjunctive batch, putting its index in THIS row's array into
15273
+ `persistRule.batchOfferIndex`; the rule is redeemed once at the resumed leg's settle point and an idempotent replay redeems nothing. On servers
15274
+ <= 7.151.x the index on this leg is NOT a selection key: the projection drops malformed offers one by one and COMPACTS, which was only sound because this leg
15275
+ had no redemption mouth (`/decide` took no rule field), and redemption happened only on the since-deleted live respond door.
15304
15276
 
15305
15277
  🔴 DISPLAY / TRIAGE ONLY, and ABSENT MEANS THERE REALLY IS NO SUPPLY (rule lane unarmed, the
15306
15278
  command yields no rule, no rule could silence this ask, or an old row) — never "the projection
@@ -15309,7 +15281,7 @@ components:
15309
15281
  type: boolean
15310
15282
  enum: [true]
15311
15283
  description: >-
15312
- server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (live `allow_session` / durable `/decide` `remember:"session"`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `allow_session` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a click on `allow_session` receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while `allow_session` still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
15284
+ server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (`decideAsk` / durable `/decide` `remember:"session"`; on server <= 7.151.x the removed respond door's third word `allow_session`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `remember: "session"` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a `remember: "session"` decision receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while the "allow for the session" click still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
15313
15285
  governanceForced:
15314
15286
  type: boolean
15315
15287
  enum: [true]
@@ -15513,7 +15485,7 @@ components:
15513
15485
  server >= 7.148.0 — the scheduler origin of the run this ask belongs to (the engine's `RunOrigin`, carried verbatim; today one
15514
15486
  word, `scheduled`). Present only when the engine recorded a word (a deployment's own scheduler trigger mints it; this service
15515
15487
  never does). ABSENT reads "the host said nothing", never "a person sent it"; an unknown word reads as an unknown origin.
15516
- boundGrantDigest: { type: string, description: 'server >= 7.118.0 — a parked `Skill` card''s grant-binding digest; same value as the live frame''s ToolApprovalFrame.boundGrantDigest.' }
15488
+ boundGrantDigest: { type: string, description: 'server >= 7.118.0 — a parked `Skill` card''s grant-binding digest; same value as the live frame''s ApprovalRequestLiveFacts.boundGrantDigest.' }
15517
15489
  boundGrants:
15518
15490
  allOf: [{ $ref: '#/components/schemas/BoundSkillGrants' }]
15519
15491
  description: 'server >= 7.118.0 — the value `boundGrantDigest` hashes, published ONLY when it hashes to it (the engine judges; a pair that disagrees reads as absent). DEPLOYMENT TEXT: render with contextual escaping.'
@@ -15539,17 +15511,22 @@ components:
15539
15511
  RETIRED: server >= 7.72.0 (core 7.14.0) never mints this key on any of the three faces; its
15540
15512
  successor is `disposition.cause` on the gate record (`unavailable` / `parse_error` — a different
15541
15513
  question, so an old switch does not port). Kept for servers in [7.69.0, 7.72.0) only (sdk 9.2.0); the row key retires
15542
- together with the frame key (floor ≥ 7.106.0, next major); why the frame still declares it: `ToolApprovalFrame.classifierUnavailable`.
15514
+ together with the card key (floor ≥ 7.106.0, next major); the card still declares it too (see `ApprovalCard.classifierUnavailable`).
15543
15515
  ruleStoreUnreadable:
15544
15516
  type: string
15545
15517
  enum: [store, call]
15546
15518
  description: >-
15547
15519
  server >= 7.72.0 (core 7.14.0 #688 C3), ADDITIVE — WHICH HALF of the rule lane could not be read (`store` / `call`).
15548
- The same key, with the same two words and the same reading, as on the live frame; the authoritative statement of the shape, the presence
15549
- rule, what the two words mean and the retirement wording is on `ToolApprovalFrame.ruleStoreUnreadable`, and this description points to it.
15550
- RETIRED: server >= 7.106.0 never mints this key on either face (the frame's description names the successor). Kept for
15551
- servers in [7.72.0, 7.106.0) only (sdk K-32); the row key retires together with the frame key (floor ≥ 7.106.0, next major);
15552
- `origin: rule_store_unavailable` itself stays.
15520
+ Present iff `origin === "rule_store_unavailable"`: `store` = the wired rule store could not be read
15521
+ (look at the store / network); `call` = the store was read but THIS command could not be read against
15522
+ the person's deny/ask rows (look at the command spelling). One `origin` word covers both facts, and
15523
+ their recovery verbs live in different places (ops vs prompt). Absence = `origin` is not that word — NOT an assertion that the rule store
15524
+ is healthy. (The `card_json` card deliberately does NOT carry it: it travels with `origin`, which is not on the card.)
15525
+ RETIRED: server >= 7.106.0 (core 7.34.0, BREAKING — wire) never mints this key on either face; the
15526
+ signal moved to the session stream's user-facing
15527
+ `engine_notice` `permission.rule_store_unavailable` (`detail.at` = `prepare` / `call`; what the run does while the rules cannot be read is
15528
+ that notice's own text). Kept for servers [7.72.0, 7.106.0), which are inside the supported range and still send it (the closed row declares the key);
15529
+ it goes with the next major once the support floor is >= 7.106.0 (`origin: rule_store_unavailable` itself stays).
15553
15530
 
15554
15531
  InboxList:
15555
15532
  type: object
@@ -16519,6 +16496,20 @@ components:
16519
16496
  are reported as conflicts) — a CONSERVATIVE merge: an entry deleted on one side since the last round comes back from the other.
16520
16497
  The service never writes, edits or deletes a cursor itself. Read OPEN: no enum — an unknown word means "way out unknown, do not
16521
16498
  act for the user".
16499
+ cause:
16500
+ type: string
16501
+ description: >-
16502
+ server >= 7.151.0 — WHY this layer is parked (not the trigger of the round that hit it): `cursor_refused` (the sync engine refused this layer's cursor — then `axis` / `found` say on which axis and how) or
16503
+ `cursor_unusable` (the cursor could not be read). Read OPEN (known words: `cursor_refused`, `cursor_unusable`); ABSENT = an older server (<= 7.150.x).
16504
+ axis:
16505
+ type: string
16506
+ description: >-
16507
+ server >= 7.151.0 — the axis the engine refused the cursor on: `scope` / `peer` / `store` / `incarnation` (the center-layer partition's incarnation). Present iff `cause` is `cursor_refused` AND the engine's reading is inside both closed
16508
+ sets; comes as a pair with `found` (an unknown word in either => both keys absent). Read OPEN.
16509
+ found:
16510
+ type: string
16511
+ description: >-
16512
+ server >= 7.151.0 — whether the cursor has no binding on that axis (`absent`) or is bound to another value (`other`); present iff `axis` is present. Read OPEN.
16522
16513
 
16523
16514
  McpReconnectServerStatus:
16524
16515
  type: object
@@ -16955,7 +16946,7 @@ components:
16955
16946
  notify-wake / leader). The SDK lands the family on ServiceStateError (same class and window reading as `state.`);
16956
16947
  the retry arm retries it by status (GET and auto-keyed submits). Not `quota_exhausted` (429, the caller is over
16957
16948
  budget): this code says nothing about the caller's quota. (`gone.` = 410, "the channel closed, switch
16958
- channels"; `parking.` = 425, "intermediate state — you retry to learn the landing, not to re-submit".
16949
+ channels"; `parking.` = 425, "intermediate state — this decision was not accepted; wait and send it again".
16959
16950
  Both families, and both status codes, first reached the wire with server 7.3.0's in-stream approval
16960
16951
  decision endpoint.) 🔴 server >= 7.139.0 also mints two 409 codes under a prefix that is NOT one of the fourteen:
16961
16952
  `execution_lane.not_served` / `execution_lane.tree_bound` (the session is placed on an execution lane this deployment no
@@ -17130,7 +17121,7 @@ components:
17130
17121
  `field` is the literal `settings.hooks` on servers <= 7.147.x; server >= 7.148.0 makes it the EXACT bracket coordinate of the verdict (`settings.hooks.PreToolUse[0].matcher`,
17131
17122
  `settings.hooks.Stop[0].hooks[1].type` …) beside `reason` and the verdict's keys at the root — recognise the family by `reason`, or by `field` being `settings.hooks` / starting with
17132
17123
  `settings.hooks.` / `settings.hooks[` (SDK `SettingsHooksRefusalExtra`). Also on 400 `request.body_shape` (server >= 7.119.0), on the THREE
17133
- tool-approval decision doors (`POST /v1/tool-approvals/{id}/respond`, `POST /v1/tasks/{taskId}/asks/{askId}/decision`,
17124
+ tool-approval decision doors (`POST /v1/tasks/{taskId}/asks/{askId}/decision`, `POST /v1/tasks/{taskId}/asks/{askId}/decision`,
17134
17125
  `POST /v1/approvals/{sessionId}/decide`) and ONLY there: the body carried the retired key `settledBy` (any value but `undefined` —
17135
17126
  `null` and `""` count), the refusal landed before any decision, and `field` is the literal `settledBy`; the three doors now answer
17136
17127
  the SAME sentence. Every such 400 carries it, even when another defect in the same body was hit first (the sentence then names that
@@ -17325,12 +17316,10 @@ components:
17325
17316
  # GET /v1/runs/:id/events all along (the server appends them and the read boundary re-emits
17326
17317
  # `{type, ...data}`) but neither this union nor the SDK's declared them, so a generated client
17327
17318
  # had no arm to switch on and dropped approval cards. Each arm is `allOf: [<the frame schema>, the
17328
- # narrowed discriminant]` — the key set stays owned by ToolApprovalFrame / ApprovalRequestFrame,
17319
+ # narrowed discriminant]` — the key set stays owned by ApprovalRequestLiveFacts / ApprovalRequestFrame,
17329
17320
  # so a frame gaining a key (7.5.0's governanceForced) needs no edit here.
17330
17321
  # `approval_revoke` joined as the FOURTH arm ([5924]/S-58, server >= 7.55.0): the bg/resume durable
17331
17322
  # legs append it to the run's ledger now (the sync leg stays live-SSE-only), so it replays here too.
17332
- - $ref: '#/components/schemas/Event_tool_approval'
17333
- - $ref: '#/components/schemas/Event_tool_approval_complete'
17334
17323
  - $ref: '#/components/schemas/Event_approval_request'
17335
17324
  - $ref: '#/components/schemas/Event_approval_revoke'
17336
17325
  # server >= 7.133.0 (sdk 25.0.0): the card family's single-card CLOSE frame (`approval_complete`; one frame family per leg — it replaces the legacy
@@ -17396,8 +17385,6 @@ components:
17396
17385
  workflow_complete: '#/components/schemas/Event_workflow_complete'
17397
17386
  human_input: '#/components/schemas/Event_human_input'
17398
17387
  wiring_manifest: '#/components/schemas/Event_wiring_manifest'
17399
- tool_approval: '#/components/schemas/Event_tool_approval'
17400
- tool_approval_complete: '#/components/schemas/Event_tool_approval_complete'
17401
17388
  approval_request: '#/components/schemas/Event_approval_request'
17402
17389
  approval_revoke: '#/components/schemas/Event_approval_revoke'
17403
17390
  approval_complete: '#/components/schemas/Event_approval_complete'
@@ -19279,8 +19266,7 @@ components:
19279
19266
  spec-resolver, which now passes the notice seat). Consequence for consumers that assert on ledger
19280
19267
  CONTENTS: a resume leg's ledger MAY now carry one extra `engine_notice` row it did not before — assert
19281
19268
  "may appear", never an exact row count or order (and consume idempotently: reconnect replay shows it again).
19282
- `approval.read_root_granted` / `approval.read_root_grant_rejected` (server >= 7.102.0 / S-720 / core 7.32.0
19283
- #1093) — the ENGINE's verdict on a `readRootGrant` answer (POST /v1/tool-approvals/{id}/respond), at most one
19269
+ `approval.read_root_granted` / `approval.read_root_grant_rejected` (server >= 7.102.0 / core 7.32.0) — the ENGINE's verdict on a `readRootGrant` answer (POST /v1/tasks/{taskId}/asks/{askId}/decision), at most one
19284
19270
  frame per answered ask. GRANTED = this run's read directories really include it now (core: the ONLY evidence the
19285
19271
  run widened; read faces only, this run only) — `{dir, covers?, root, toolName, toolCallId, sessionId, runId,
19286
19272
  taskId?}`, `root` = the canonical spelling the engine holds. REJECTED = nothing changed and the decision stands
@@ -19956,146 +19942,110 @@ components:
19956
19942
  by: { type: array, minItems: 1, items: { $ref: '#/components/schemas/RewriteAuthor' } }
19957
19943
  input: {}
19958
19944
 
19959
- ToolApprovalFrame:
19945
+ ApprovalRequestLiveFacts:
19960
19946
  type: object
19961
19947
  description: >
19962
- Tool-approval frame (SSE, `type` IS the event name). On the LIVE stream it interleaves out-of-band when
19963
- TOOL_APPROVAL_ENABLED and is NOT an AgentEvent arm there (the live leg dispatches by SSE `event:` name).
19964
- On the BACKGROUND/durable leg the server appends it to the events tail so it also replays through
19965
- GET /v1/runs/:id/events — and there it IS a declared arm as of #185a, via `Event_tool_approval` /
19966
- `Event_tool_approval_complete` (each = THIS schema plus the narrowed discriminant, so the keys live
19967
- here only). Before #185a the durable response was typed solely as `AgentEvent` with no such arm: the
19968
- payload carried `type` (the read boundary emits `{type, ...data}`) so runtime discrimination worked,
19969
- but a generated client had nothing to switch on and dropped approval cards. That gap is closed.
19970
- The shell renders `tool_approval` as the three-choice card and dismisses it on `tool_approval_complete`.
19971
- Respond via POST /v1/tool-approvals/{id}/respond.
19972
- required: [type, approvalId]
19948
+ The OFF-CARD live facts of an `approval_request` frame — the eleven keys that ride flat at the frame's top level next to `card` (server >= 7.133.0; the eleventh,
19949
+ `requestedBy`, since server >= 7.138.0). THIS schema is their single declaration: `ApprovalRequestFrame` `$ref`s each property below, so a reading rule is stated once.
19950
+ Every key is OPTIONAL and presence-conditional (absent is not evidence; a replay frame that cannot read them carries `liveFactsUnknown: true` instead).
19973
19951
  additionalProperties: true
19974
19952
  properties:
19975
- type: { type: string, enum: [tool_approval, tool_approval_complete] }
19976
- approvalId:
19977
- type: string
19978
- description: 'The approval''s OWN key (uuidv7) — echo it to respond; the complete frame settles by it.'
19979
- toolCallId:
19980
- type: string
19981
- description: >
19982
- server >= 1.307 (ADDITIVE), "tool_approval" only: the ENGINE's tool-call id — the same `call_…` that
19983
- rides the assistant message's tool_use block. ANCHOR THE CARD ON THIS. `approvalId` is unrelated to
19984
- that block and nothing else on the stream ever mentions it again, so a card keyed by it is never
19985
- reclaimed. Anchoring on "the most recent tool_start" does not work either: the approval frame arrives
19986
- BEFORE tool_start (measured 4020ms vs 4142ms in one turn). Absent on the complete frame (a second
19987
- anchor would only add ambiguity) and on servers < 1.307.
19988
- toolName: { type: string, description: '"tool_approval" only: canonical core tool name.' }
19989
- message: { type: string, description: '"tool_approval" only: the policy''s ask message, secret-redacted. UNTRUSTED for display.' }
19990
- args:
19991
- description: '"tool_approval" only: the call''s args, secret-redacted. UNTRUSTED for display. Absent (with argsOmitted) when over the byte cap or unserializable.'
19992
- argsOmitted: { type: boolean, enum: [true] }
19993
- rememberRefused:
19994
- type: boolean
19995
- enum: [true]
19996
- description: >-
19997
- server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (live `allow_session` / durable `/decide` `remember:"session"`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `allow_session` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a click on `allow_session` receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while `allow_session` still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
19998
- governanceForced:
19953
+ mandated:
19999
19954
  type: boolean
20000
19955
  enum: [true]
20001
19956
  description: >
20002
- "tool_approval" only, ADDITIVE, two-stage presence: ABSENT on server <= 7.4.0; from server >= 7.5.0
20003
- ([2942]/[2943]) present with value `true` when this ask's gate comes from the OPERATOR GOVERNANCE
20004
- layer (the deployment-side AUTONOMY / commandPolicy / MANUAL_MODE_SHELL_GATE / SENSITIVE_WRITE_PATTERNS
20005
- knobs) rather than from a model default gate or the request's own client permission posture.
20006
- The only authority on presence is an observed frame, never a version string.
20007
-
20008
- Use it to render a "forced by governance" badge: such a gate CANNOT be removed by a client posture,
20009
- so the shell must present it as non-bypassable instead of pointing the user at `permissionMode`.
20010
-
20011
- 🔴 ABSENT != false (same discipline as the risk axes): the key is present ONLY when true. Absence
20012
- means "no evidence of a governance origin" — it covers both genuinely non-governance asks (e.g. a tool
20013
- listed in the deployment's APPROVAL_REQUIRE) AND shapes the server cannot discriminate (e.g. when the
20014
- governance shell gate sits at the "classify" tier, a shell ask may come from the classifier or from
20015
- another gate; the server leaves the key absent rather than guessing). Never render absence as
20016
- "this gate can be bypassed by a posture".
20017
- ruleOffers:
20018
- type: array
20019
- minItems: 1
20020
- items: { $ref: '#/components/schemas/RuleOffer' }
20021
- description: >
20022
- server >= 7.46.0 (core 5.58.0, design/375), "tool_approval" only — the ENGINE-minted "don't ask
20023
- again" OPTIONS for this ask, as a DISCRIMINATED UNION (`single` | `batch`). It is the BREAKING
20024
- REPLACEMENT of the triple-shaped `ruleSuggestions` of servers <= 7.45: a >= 7.46.0 engine mints the old key nowhere and there is no
20025
- alias (sdk 26.0.0 deleted the old key with the support floor 7.52.0).
20026
-
20027
- 🔴 READ `kind` TO TELL THE ARMS APART, never a positional assumption. ORDER IS CONTRACT: a
20028
- whole-string exact `single` is index 0 when present and a `batch` is always last; core's own
20029
- cardinality is <= 2 while the server enforces a tolerance cap of 4.
20030
-
20031
- 🔴 INDEX SEMANTICS DIFFER PER LEG, and only one leg can redeem. On THIS leg (and on the
20032
- `approval_request` card and the durable replay of both) the server prefix-truncates and never drops
20033
- an entry, so the index equals core's offer index and IS a legal selection key for
20034
- `persistRule.batchOfferIndex`. On the durable queue row (PendingCheckpoint.ruleOffers) the server
20035
- drops malformed entries and COMPACTS, so indexes shift there and that leg has no redemption mouth
20036
- at all. A consumer that drops entries itself must keep every survivor's ORIGINAL wire index, or
20037
- suppress its persistence actions entirely (core's normative clause) — a compacted index means the
20038
- k-th option the person clicked is not the k-th rule the server redeems.
20039
-
20040
- 🔴 PRESENCE IS THE PROMISE: present only where a permission-rule store
20041
- is really wired. The converse does not hold — a wired deployment still omits it for mandated /
20042
- requiresRealApproval / allow_outranked / ask_rule_matched / hook-produced / inherited-unresolved / ancestor-resolved /
20043
- anonymous asks. Absence reads as "THIS CARD has no such option", never as "this deployment has no
20044
- rule lane" (that is `capabilities.permissionRules`) and never as "your rule broke" (that is
20045
- `allowRuleShadowed`).
20046
-
20047
- ⚠️ REDEMPTION SCOPE is the live respond leg keyed by this frame's `approvalId` only; a replayed
20048
- offer on another replica is not a promise that it is still redeemable.
20049
- allowRuleShadowed:
20050
- type: array
20051
- items: { $ref: '#/components/schemas/AllowRuleShadow' }
19957
+ (server >= 7.93.0, core 7.26.0) This card was MANDATED — a read-station / rule-lane forced ask (a rule can
19958
+ never clear it; an approver's yes cannot release a deny-listed read). Present only when true, literal `true`;
19959
+ absent = an ordinary ask. ⚠️ CORRECTED (sdk 11.4.0): the durable parked row DOES carry a twin bit since core
19960
+ 7.31.0 (`PendingAction.tool_approval.mandated`), projected since server 7.101.0 onto the operator queue
19961
+ row / the `/stream` `pending` frame / the inbox row and the `livePending` row top level
19962
+ — four faces, one bit. `card_json` does not carry it (`ApprovalCardSchema` is `.strict()`).
19963
+ mandate:
19964
+ allOf: [{ $ref: '#/components/schemas/PersistedRuleMandate' }]
19965
+ description: >-
19966
+ server >= 7.102.0 (core 7.32.0), ADDITIVE — which word the `mandated`
19967
+ bit stands on (server `src/tool-approval.ts:841`, read through `readClosedWordSeat(req, "mandate")` =
19968
+ core's `isPersistedRuleMandate` screen). Present only when the WHOLE cause of `mandated:true` is that one
19969
+ word; absence never names a word and is not "not mandated". Same value on the `livePending` row, the
19970
+ operator queue row and the inbox row; NOT on `card_json` / `approval_request`.
19971
+ origin: { $ref: '#/components/schemas/AskOrigin' }
19972
+ boundGrantDigest:
19973
+ type: string
19974
+ description: >-
19975
+ server >= 7.118.0 (core 7.43.0), — on a call of the engine's `Skill` tool: the hash of what
19976
+ approving it ALSO grants (the skill name + its two lists, canonical spelling); absent on every other card. Same value as the
19977
+ parked row's / the inbox row's twin (the live card and its parked twin reconcile by `(toolCallId, boundGrantDigest)`); passed
19978
+ through verbatim. A live "allow for this session" is remembered under "this tool + this digest" and answers only an ask with the
19979
+ same digest (same skill, same lists); a different skill or a changed list asks again. The durable `remember: "session"` never
19980
+ remembers a skill card.
19981
+ boundGrants:
19982
+ allOf: [{ $ref: '#/components/schemas/BoundSkillGrants' }]
19983
+ description: 'server >= 7.118.0, — the value `boundGrantDigest` hashes; present iff it is. DEPLOYMENT TEXT: render with contextual escaping.'
19984
+ classifierNoRuling:
19985
+ allOf: [{ $ref: '#/components/schemas/AutoModeFallbackCause' }]
19986
+ description: >-
19987
+ server >= 7.118.0 (core 7.43.0), only on a `classifier_no_ruling` card — WHY the auto-mode classifier
19988
+ did not rule (`error` / `timeout` = it could not run; `parse_error` = it replied with no verdict), so a person decides. The server
19989
+ screens it with the engine's closed set (an out-of-set word is withheld). Display only.
19990
+ boundGrantAbsence:
19991
+ allOf: [{ $ref: '#/components/schemas/BoundGrantAbsence' }]
19992
+ description: 'server >= 7.129.0 (core 7.51.0), — why this card has no `boundGrantDigest` (exactly one of the two). Same name and value on the inbox row, the operator queue row and the `pending` stream frame; passed through verbatim.'
19993
+ approvalCard:
19994
+ allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
20052
19995
  description: >
20053
- server >= 7.117.0 (core 7.42.0), ADDITIVE, "tool_approval" only — BREAKING RENAME, replacing the retired string `persistedRuleShadowed`
20054
- (no alias): the allow-layer members that MATCHED this call and could NOT clear this ask, one `{ member, entries, omitted? }` record per
20055
- matching member (see AllowRuleShadow). `member` is one of `hook` / `deployment` / `persisted` / `skill` / `request`; `entries` are the
20056
- entries that member matched, as their source spells them (UNTRUSTED for display like `message`, secret-redacted, <= 512 chars each,
20057
- <= 32 listed; a `hook` record's `entries` names the answering registration — server >= 7.132.0 / engine 7.52.0 mods: on this server only the
20058
- request's own `settings.hooks` answers, so `["settings.hooks"]`; it was always the empty list on <= 7.131.x); `omitted` counts the entries not listed.
20059
-
20060
- The explaining sentence ("... matches this call but does not clear the ask — <reason>") is IN `message` (the engine writes it where it builds
20061
- the card); this key is the structured twin of the same fact. Render a line from it ("your rule matched, but this call must be confirmed each
20062
- time"): without it the only conclusion a user can draw is "my rule broke".
20063
-
20064
- 🔴 ABSENT != "you have no rule": present only when a member matched AND could not clear the ask; a match that cleared never becomes an ask.
20065
- 🔴 `member: "hook"` names the answering registration in `entries` (server >= 7.132.0; the deployment seat's registrations are observers and never
20066
- answer — on <= 7.131.x the record could not say whose hook). 🔴 Deliberately SEPARATE from `governanceForced` (that one: "who imposed the gate"; this one: "what happened to YOUR
20067
- rule"). What the allow layer can NOT clear: any layer's deny / ask rule, operator `APPROVAL_REQUIRE` / `APPROVAL_NEVER_AUTO` /
20068
- `MANUAL_MODE_SHELL_GATE=always`, write protection, sensitive-path writes, governance, a hook's ask, plan-mode asks. The durable dual is
20069
- `gate.riskDescriptor.allowRuleShadowed` on the parked row (PendingCheckpoint.riskDescriptor). Rolling-upgrade caveat: a card stored by a
20070
- <= 7.116.x replica (`card_json` carrying `persistedRuleShadowed`) cannot be read by a >= 7.117.0 replica — the replay skips it.
20071
- probeCause:
19996
+ ADDITIVE (server >= 7.126.0 / core 7.49.0, contract table B `approvalCard` row) — WHICH CARD THIS ASK RENDERS ON: the one word the engine minted at the gate
19997
+ (closed set `ToolApprovalCardWord`, eight words), passed through verbatim after a closed-set narrow read (an out-of-set word reads as absent). The ONLY card-word source — it REPLACES the
19998
+ second card word `contentKind` that server <= 7.125.x derived from the tool name (deleted at 7.126.0, no alias: a consumer reading `contentKind === "content_ask"` reads
19999
+ `approvalCard === "question"`). ABSENT = the engine minted none (a host-built ask / an older engine / a non-approval gate) — never `generic` by default. Display / triage only; it NEVER
20000
+ takes part in resume / gate / CAS. The same word rides the `livePending` row top level (= this frame's own value), the operator queue row and the `/v1/approvals/stream` `pending` /
20001
+ `live_pending` frames; from server >= 7.136.0 the `card_json` card face and the `approval_request` frame's `card` (live mint and reconnect replay alike) carry the same word too (`ApprovalCard.approvalCard`: one read, three faces — before 7.136.0 the card did not carry it, so a replayed frame had none and a reconnecting shell fell back to the generic card).
20002
+ readRootCandidate:
20072
20003
  type: object
20073
- description: >
20074
- server >= 7.17.0 (core 5.33.0 #239), ADDITIVE, "tool_approval" only: the STRUCTURED cause of a
20075
- reversibility-probe tightening. `code` is machine-readable (open set — branch with a default arm);
20076
- `shown` may be truncated by the server (<= 8 entries) while `total` stays verbatim, so "N more
20077
- unnamed" is always computable. Absent != "no reason" (only maybe-tier tightenings whose probe
20078
- supplied a cause carry it). Render as data; the server never flattens it into a sentence.
20004
+ required: [dir, clearsThisAsk]
20079
20005
  additionalProperties: false
20080
- required: [code, roots]
20081
20006
  properties:
20082
- code: { type: string }
20083
- roots:
20084
- type: object
20085
- required: [shown, total]
20086
- properties:
20087
- shown: { type: array, items: { type: string } }
20088
- total: { type: integer }
20089
- further:
20090
- type: object
20091
- required: [shown, total]
20092
- properties:
20093
- shown: { type: array, items: { type: string } }
20094
- total: { type: integer }
20007
+ dir:
20008
+ type: string
20009
+ minLength: 1
20010
+ maxLength: 1024
20011
+ description: >-
20012
+ The ABSOLUTE, lexically-folded directory to add to this session's read roots, spelled by the read
20013
+ boundary itself — THE STRING SHOWN IS THE STRING TO ADD. A shell may render a shortened / `~` form,
20014
+ but must echo THIS string back verbatim. The server carries it whole or drops the whole key
20015
+ (a malformed shape, or a `dir` over 1024 UTF-16 code units ⇒ the key is ABSENT — never truncated,
20016
+ because a truncated directory is a DIFFERENT directory and adding it would not clear this ask;
20017
+ see the STRING-LENGTH UNIT convention in `info.description` for this `maxLength`'s counting unit).
20018
+ covers:
20019
+ allOf: [{ $ref: '#/components/schemas/ReadRootCover' }]
20020
+ description: >-
20021
+ Optional (engine core 7.22.0 `ReadRootGrantCandidate.covers`; the server carries it through key by key). ABSENT ⇒ `dir` is a DIRECTORY
20022
+ (adding it to the read roots releases what lies under it). `exact` ⇒ `dir` is the path the command NAMED, offered verbatim
20023
+ (a file or one concrete path, not a directory containing it): the consumer ADDS the string itself — expanding it into a
20024
+ pattern grants nothing — and must not render the offer as "add directory". The domain is the single word `exact`
20025
+ (a word outside it makes the server drop the whole candidate). The `approval_request` frame reads this very definition.
20026
+ clearsThisAsk:
20027
+ type: boolean
20028
+ enum: [true]
20029
+ description: >-
20030
+ Shape, not value — the domain is the literal `true` only, so this seat cannot be quietly widened
20031
+ into a "might help" hint.
20032
+ description: >-
20033
+ server >= 7.78.1 (core 7.19.0), ADDITIVE, LIVE `tool_approval` FRAME ONLY — the clearing directory for
20034
+ an OUT-OF-ROOT READ ask: add `dir` to this session's read roots (the shell's existing `/add-dir`) and
20035
+ the same call stops asking.
20036
+ 🔴 READ PRESENCE ONLY, NEVER ABSENCE. Absence is NOT "nothing can be done": it also covers sensitive-path
20037
+ deny rows (pattern-judged — no root changes them), commands the read boundary cannot parse (heredoc /
20038
+ newline / command substitution / an argument used as the program), unexpanded globs, recursive walks,
20039
+ and every ask NOT raised by the read boundary — every ask on server <= 7.78.0 has this shape too.
20040
+ ⚠️ THIS FACE ONLY: `card_json`, the §2 inbox row, the `/v1/approvals` rich row and the park face carry
20041
+ NO twin of this seat in this version — a PARKED out-of-root read ask still renders that single card.
20042
+ ⚠️ Known shapes (upstream-registered, so a shell must NOT render this option as a guarantee):
20043
+ `cd X && cat Y` yields X's PARENT directory; and on a deployment that normalizes declared read roots
20044
+ (e.g. `/tmp/x` stored as `/private/tmp/x`) the same call may ask once more after the root is added.
20095
20045
  probeReason:
20096
20046
  type: string
20097
20047
  description: >
20098
- server >= 7.115.0 (S-733), ADDITIVE, "tool_approval" only: the PROSE reason a reversibility probe gave for tightening this ask
20048
+ server >= 7.115.0, ADDITIVE, : the PROSE reason a reversibility probe gave for tightening this ask
20099
20049
  (core `AskRequest.probeReason`; the server's narrow read: a non-string / blank value ⇒ absent, more than 201 code points ⇒
20100
20050
  dropped WHOLE rather than truncated, content-family redaction — the same rule as the durable face's
20101
20051
  `gate.riskDescriptor.probeReason`, so the two faces carry the same bytes for the same sentence). It runs ALONGSIDE
@@ -20107,304 +20057,12 @@ components:
20107
20057
  requestedBy:
20108
20058
  allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
20109
20059
  description: >
20110
- server >= 7.138.0, ADDITIVE, "tool_approval" only: the call this ask is about was initiated by an extension registration itself
20060
+ server >= 7.138.0, ADDITIVE, : the call this ask is about was initiated by an extension registration itself
20111
20061
  (`$.tool.call`; core `AskRequest.requestedBy`) — the provenance of the card's "extension X wants to run …" line. Same reading as the
20112
20062
  key of the same name on `tool_start` / `tool_end`. Absent on calls a model message carried; reachable once the deployment seat mounts
20113
20063
  operator-declared packages. Display fact, never an adjudication input. The presented frame (`approval_request`) carries it on its top
20114
20064
  level with the same value (one of its off-card live facts); the durable card (`card_json`) does not, and a disconnect-replay frame never does.
20115
- ruleEvidence:
20116
- type: object
20117
- description: >
20118
- server >= 7.23.0 (core 5.35.0 design/252 G-2), ADDITIVE, "tool_approval" only: the RULE-PROVENANCE
20119
- evidence behind this ask — the org policy snapshot revision, the matched org rule's verbatim text
20120
- (secret-redacted + length-bounded), and the shadowed personal rule's add dots (the rule's durable
20121
- identity: an ARRAY by construction — render/reconcile as data, never join into one scalar id).
20122
-
20123
- EACH member is a value OR a NAMED absence (`...Absent`, five-word set — read as open set, the engine
20124
- owns the vocabulary): `not_wired` (no such lane) / `not_adjudicated` (lane exists, call skipped) /
20125
- `unavailable` (lane consulted, its SOURCE unreadable — the one word meaning the audit chain is
20126
- BROKEN, not empty; the ask in hand is the fail-closed tighten that followed) / `no_match`
20127
- (consulted, nothing spoke) / `not_reported` (the seam answered without the identity).
20128
-
20129
- Display/reconciliation metadata, NEVER adjudication input. The server transcribes the ENGINE-stamped
20130
- record and never mints an absence word itself; a malformed record is dropped whole (absent frame key
20131
- = older server or a dropped record — never "ungoverned").
20132
-
20133
- CONSUMPTION (1) — THE DISPLAY PREDICATE IS THE WORD, NOT THE PRESENCE. A member earns display space
20134
- when it HAS A VALUE, or when its absence word is NOT on the benign list (`not_wired` /
20135
- `not_adjudicated` — "this governance lane isn't wired / wasn't its turn to speak"). `unavailable` is
20136
- ALWAYS visible (it means the audit chain is BROKEN — the lane was consulted, its source could not be
20137
- read, and the ask in hand is the fail-closed tighten that followed: it is the user's only view of "why
20138
- am I suddenly being asked"), and an UNKNOWN word is visible too (open-set read: a word you don't know
20139
- must never be treated as benign silence). Why this must be spelled out: on a deployment with NO
20140
- governance wired, EVERY ask carries all three named absences — that is CONTRACT BEHAVIOUR, not a
20141
- defect — so the naive "render a line per present member" smears three "not wired" lines onto every
20142
- approval card and buries the one line that matters.
20143
-
20144
- CONSUMPTION (2) — NARROW-READ DISCIPLINE: the server's own read is ALL-OR-NOTHING (a malformed record
20145
- is dropped WHOLE, not salvaged member-by-member). A consumer that also narrow-reads must keep its read
20146
- domain >= the minting domain: a NARROWER domain means one unrecognised member sends the WHOLE record
20147
- into the reject arm and takes its siblings' legitimate evidence down with it (the `orgRule` that was
20148
- readable on that same card disappears along with the stranger). Treat MEMBERS as an open set — keep
20149
- what you don't recognise and simply don't render it; never validate the object against a closed
20150
- whitelist. THIS SCHEMA IS OPEN BY CONSTRUCTION for exactly that reason: unknown members are allowed and
20151
- the `...Absent` words are plain strings (known words listed per property), so neither a new member nor a
20152
- new absence word can make a strict validator throw the record away.
20153
- # 🔴 OPEN BY CONSTRUCTION (codex R1-F2, verified): `additionalProperties: false` + closed absence
20154
- # enums CONTRADICTED the two consumption clauses right above — a strict generated client would
20155
- # reject the whole record over one unknown member or one future absence word, which IS the
20156
- # "all-or-nothing reject takes the siblings' evidence with it" failure those clauses warn about
20157
- # (the readable `orgRule`, and worse the `unavailable` broken-audit-chain signal, vanish together).
20158
- # The engine OWNS this vocabulary and mints new words; the SDK types are open on read
20159
- # (`"not_wired" | ... | (string & {})`), so the schema must be too. Known words stay named in the
20160
- # descriptions — documentation, not a validator gate.
20161
- additionalProperties: true
20162
- properties:
20163
- orgRevision: { type: number }
20164
- orgRevisionAbsent: { type: string, description: 'Named absence. Known words (open on read — the engine owns the vocabulary, a future one is a NEW word, never a redefinition): not_wired | not_adjudicated | unavailable | no_match | not_reported.' }
20165
- orgRule: { type: string }
20166
- orgRuleAbsent: { type: string, description: 'Named absence. Known words (open on read): not_wired | not_adjudicated | unavailable | no_match | not_reported.' }
20167
- personalRuleDots:
20168
- type: array
20169
- items:
20170
- type: object
20171
- required: [actor, counter]
20172
- properties:
20173
- actor: { type: string }
20174
- counter: { type: integer }
20175
- personalRuleDotsAbsent: { type: string, description: 'Named absence. Known words (open on read): not_wired | not_adjudicated | unavailable | no_match | not_reported.' }
20176
- fromSubagent:
20177
- type: boolean
20178
- enum: [true]
20179
- description: 'Present ⇔ the ask comes from a DELEGATED background/nested child — the EXPLICIT discriminator (trusted engine fact).'
20180
- sourceSessionId:
20181
- type: string
20182
- description: 'server >= 7.143.0 (core 7.61.0 BREAKING rename of `sourceTaskId`, same value, no alias): the delegated child''s core SESSION id — row-join value. Read attribution off `fromSubagent`, not off this key''s presence.'
20183
- agentId:
20184
- type: string
20185
- description: 'server >= 7.143.0: the agent id of the leg that raised the ask (a background child''s registry row id `a…`, a foreground child''s session id); a directly started workflow''s agent carries it WITHOUT `fromSubagent`; absent on the host''s own ask.'
20186
- askReasons:
20187
- type: array
20188
- items: { $ref: '#/components/schemas/AskReason' }
20189
- description: 'server >= 7.143.0 (core 7.61.0): WHO asked and WHY — one entry per asker with its own words. Structured approval UIs render reason lines from this, not from `message`. Words are credential-redacted and length-capped; any malformed entry ⇒ the whole seat is withheld. Absent = an older engine / the engine''s generic question.'
20190
- sourceAgentName: { type: string, description: 'Display name of the child agent, redacted. UNTRUSTED.' }
20191
- delegation:
20192
- type: object
20193
- description: >
20194
- core >= 5.9.0 W1 ([2535]), "tool_approval" only, ADDITIVE: the ask's DELEGATION provenance chain
20195
- (the innermost grandchild frame wins). Present on the same door as `fromSubagent`. Read-only display
20196
- enrichment; `agentName` is UNTRUSTED for display like `sourceAgentName`.
20197
- additionalProperties: true
20198
- required: [parentToolCallId, depth]
20199
- properties:
20200
- parentToolCallId: { type: string }
20201
- depth: { type: integer }
20202
- agentName: { type: string }
20203
- # ─── S-139(sdk 8.3.0):对 server 7.60.0 的整体重对账补齐的 9 位 ────────────────────────
20204
- # 长 description 的单一真源在 `packages/sdk/src/resources/tool-approvals.ts` 的同名成员上;
20205
- # 这里只留 codegen 需要的形与硬条款一句。机械对账门 = `test/server-keyset-parity.test.ts`。
20206
- requiresRealApproval:
20207
- type: boolean
20208
- enum: [true]
20209
- description: >
20210
- server >= 7.30.0 (core 5.37, #283), "tool_approval" only, ADDITIVE: the SAFETY-class provenance
20211
- bit core stamps at the gate. Present (true) or ABSENT — never encoded as false. Deliberately a
20212
- DIFFERENT contract from the card's `risk.requiresRealApproval` (which is an always-present
20213
- boolean): the card form needs the durable ask store, and this key is what lets a LIVE-ONLY
20214
- deployment read the bit at all. Present ⇒ every automatic allowance (remembered rules,
20215
- bypassPermissions posture) stands down.
20216
- origin: { $ref: '#/components/schemas/AskOrigin' }
20217
- approvalCard:
20218
- allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
20219
- description: >
20220
- "tool_approval" only, ADDITIVE (server >= 7.126.0 / core 7.49.0 #1414, contract table B `approvalCard` row) — WHICH CARD THIS ASK RENDERS ON: the one word the engine minted at the gate
20221
- (closed set `ToolApprovalCardWord`, eight words), passed through verbatim after a closed-set narrow read (an out-of-set word reads as absent). The ONLY card-word source — it REPLACES the
20222
- second card word `contentKind` that server <= 7.125.x derived from the tool name (deleted at 7.126.0, no alias: a consumer reading `contentKind === "content_ask"` reads
20223
- `approvalCard === "question"`). ABSENT = the engine minted none (a host-built ask / an older engine / a non-approval gate) — never `generic` by default. Display / triage only; it NEVER
20224
- takes part in resume / gate / CAS. The same word rides the `livePending` row top level (= this frame's own value), the operator queue row and the `/v1/approvals/stream` `pending` /
20225
- `live_pending` frames; from server >= 7.136.0 the `card_json` card face and the `approval_request` frame's `card` (live mint and reconnect replay alike) carry the same word too (`ApprovalCard.approvalCard`: one read, three faces — before 7.136.0 the card did not carry it, so a replayed frame had none and a reconnecting shell fell back to the generic card).
20226
- inputHasBidi:
20227
- type: boolean
20228
- enum: [true]
20229
- description: >
20230
- server >= 7.45.0 (E-14), "tool_approval" only, ADDITIVE: the TO-BE-EXECUTED input (`args`)
20231
- contains Unicode bidi control characters — what the eye reads may not be the byte order that
20232
- runs. DISCLOSURE bit, bytes unchanged (sanitising would change the bytes about to execute, which
20233
- is WORSE than not disclosing); rendering is the shell's. Present (true) or ABSENT; absence !=
20234
- "verified clean". Computed BEFORE the byte cap, so it can ride a frame whose `args` were omitted.
20235
- expiresAtMs:
20236
- type: integer
20237
- description: >
20238
- server >= 7.34.0 (#288), "tool_approval" only, ADDITIVE: window triple (with `expiresInMs` and
20239
- `serverNowMs`, same names/semantics as on ApprovalRequestFrame) so the LEGACY frame family can
20240
- render a countdown too. `expiresAtMs` = this ask's absolute deadline on the server clock. The
20241
- three keys are BORN AND ABSENT TOGETHER — any frame that gets emitted carries all three.
20242
- expiresInMs:
20243
- type: integer
20244
- description: 'Window triple (see expiresAtMs): max(0, expiresAtMs - serverNowMs), computed at mint time.'
20245
- serverNowMs:
20246
- type: integer
20247
- description: 'Window triple (see expiresAtMs): the server clock at FRAME MINT time — the countdown anchor; use it to correct local clock skew.'
20248
- ruleOffersAbsence: { $ref: '#/components/schemas/RuleOffersAbsence' }
20249
- mandated:
20250
- type: boolean
20251
- enum: [true]
20252
- description: >
20253
- (server >= 7.93.0, core 7.26.0 #997) This card was MANDATED — a read-station / rule-lane forced ask (a rule can
20254
- never clear it; an approver's yes cannot release a deny-listed read). Present only when true, literal `true`;
20255
- absent = an ordinary ask. ⚠️ CORRECTED (sdk 11.4.0): the durable parked row DOES carry a twin bit since core
20256
- 7.31.0 #1079 (`PendingAction.tool_approval.mandated`), projected since server 7.101.0 onto the operator queue
20257
- row / the `/stream` `pending` frame / the inbox row (S-663 part 2) and the `livePending` row top level (T4①)
20258
- — four faces, one bit. `card_json` does not carry it (`ApprovalCardSchema` is `.strict()`).
20259
- mandate:
20260
- allOf: [{ $ref: '#/components/schemas/PersistedRuleMandate' }]
20261
- description: >-
20262
- server >= 7.102.0 (S-721 / core 7.32.0 #1092), "tool_approval" only, ADDITIVE — which word the `mandated`
20263
- bit stands on (server `src/tool-approval.ts:841`, read through `readClosedWordSeat(req, "mandate")` =
20264
- core's `isPersistedRuleMandate` screen). Present only when the WHOLE cause of `mandated:true` is that one
20265
- word; absence never names a word and is not "not mandated". Same value on the `livePending` row, the
20266
- operator queue row and the inbox row; NOT on `card_json` / `approval_request`.
20267
- askClass:
20268
- allOf: [{ $ref: '#/components/schemas/AskClass' }]
20269
- description: >-
20270
- server >= 7.109.0 (S-934 ② / core 7.37.0 #1214), "tool_approval" only, ADDITIVE — WHICH CLASS this ask belongs
20271
- to: the first member of `classes` (core `ASK_CLASSES` order; the same closed set as the gate record's
20272
- `AskClass`). Stamped by the engine at every station that stamps `origin`; the server reads it through ONE
20273
- narrow read (`readAskClassPair`, members screened by core `isAskClass`). PRESENT TOGETHER WITH `classes` or
20274
- not at all, and `classes[0]` equals `askClass` — a half pair / an out-of-set word / a mismatched first member
20275
- is withheld WHOLE (both keys absent). ABSENT = an older engine (core < 7.37.0), an old parked row (resume
20276
- does not backfill) or a station that stamps no class — NOT "no class", and not `ordinary`. Display / triage
20277
- metadata (the shell renders by class; a durable approver answers by class), never an adjudication input.
20278
- The same pair, same order, rides this frame, `livePending[].frame`, the `approval_request` card (=
20279
- `card_json` = the disconnect-replay frame) and the operator queue row (`GET /v1/approvals` `pending[]` and
20280
- the `/stream` `pending` frame). The inbox row does NOT carry it (core `CheckpointSummary` does not echo it),
20281
- nor does the `livePending` row top level (only its `frame`).
20282
- classes:
20283
- type: array
20284
- minItems: 1
20285
- items: { $ref: '#/components/schemas/AskClass' }
20286
- description: >-
20287
- server >= 7.109.0 (S-934 ②), "tool_approval" only, ADDITIVE — EVERY class this ask belongs to (core
20288
- `ASK_CLASSES` order, non-empty, `classes[0] === askClass`); one ask can belong to several, so read the whole
20289
- set, not just `askClass`. Present together with `askClass`; passed through verbatim in order (the server
20290
- neither sorts nor dedupes).
20291
- boundGrantDigest:
20292
- type: string
20293
- description: >-
20294
- server >= 7.118.0 (core 7.43.0 #1348 / #1357), "tool_approval" only — on a call of the engine's `Skill` tool: the hash of what
20295
- approving it ALSO grants (the skill name + its two lists, canonical spelling); absent on every other card. Same value as the
20296
- parked row's / the inbox row's twin (the live card and its parked twin reconcile by `(toolCallId, boundGrantDigest)`); passed
20297
- through verbatim. A live "allow for this session" is remembered under "this tool + this digest" and answers only an ask with the
20298
- same digest (same skill, same lists); a different skill or a changed list asks again. The durable `remember: "session"` never
20299
- remembers a skill card.
20300
- boundGrants:
20301
- allOf: [{ $ref: '#/components/schemas/BoundSkillGrants' }]
20302
- description: 'server >= 7.118.0, "tool_approval" only — the value `boundGrantDigest` hashes; present iff it is. DEPLOYMENT TEXT: render with contextual escaping.'
20303
- boundGrantAbsence:
20304
- allOf: [{ $ref: '#/components/schemas/BoundGrantAbsence' }]
20305
- description: 'server >= 7.129.0 (core 7.51.0 #1688), "tool_approval" only — why this card has no `boundGrantDigest` (exactly one of the two). Same name and value on the inbox row, the operator queue row and the `pending` stream frame; passed through verbatim.'
20306
- classifierNoRuling:
20307
- allOf: [{ $ref: '#/components/schemas/AutoModeFallbackCause' }]
20308
- description: >-
20309
- server >= 7.118.0 (core 7.43.0 #1353), "tool_approval" only, only on a `classifier_no_ruling` card — WHY the auto-mode classifier
20310
- did not rule (`error` / `timeout` = it could not run; `parse_error` = it replied with no verdict), so a person decides. The server
20311
- screens it with the engine's closed set (an out-of-set word is withheld). Display only.
20312
- denialLimitFallback: { $ref: '#/components/schemas/DenialLimitFallback' }
20313
- parked:
20314
- type: boolean
20315
- enum: [true]
20316
- description: >
20317
- server >= 7.42.0 (#329), "tool_approval_complete" ONLY, ADDITIVE: the explicit discriminator for
20318
- the PARK sense of `outcome: "expired"` (which is one word with three landings). Present ⇔ THIS ask
20319
- settled through the park route ⇒ render "moved to the background queue", not "the card died".
20320
- 🔴 ABSENCE MUST NOT BE READ AS "really denied": a store-less deployment, a deny policy, and a
20321
- sibling VOIDed in a batch all emit no such key — absence only means "no park evidence".
20322
- outcome:
20323
- type: string
20324
- enum: [allowed, denied, expired]
20325
- description: '"tool_approval_complete" only. Cosmetic dismiss reason. `expired` = TTL/abort/disconnect; what the ENGINE received for it DEPENDS on the deployment: where the design/172 ask ledger is on (server >= 7.3.0 under STREAM_APPROVAL_ENABLED) the server''s expireAsk CAS re-adjudicates the outcome to "unavailable" and the run PARKS; without that ledger the historical fail-closed DENY stands. Never derive the run''s fate from this frame.'
20326
- cause:
20327
- allOf: [{ $ref: '#/components/schemas/ApprovalSettleCause' }]
20328
- description: >
20329
- server >= 7.124.0, "tool_approval_complete" ONLY, ADDITIVE: the CAUSE of `outcome: "expired"` — one of the fourteen non-human ending
20330
- words (`ApprovalSettleCause`), the same word the audit settle row carries. Present ⇔ a non-human ending; a human answer
20331
- (`allowed` / `denied`) has none. The only HTTP face that shows the four waiting words. ABSENT is not evidence (older servers never send it);
20332
- the run's fate is still read from the run row / checkpoint face.
20333
20065
 
20334
- # ── design/172 流内审批协议(#151)—— 已随 server 7.3.0 上线;开关 STREAM_APPROVAL_ENABLED 的默认值
20335
- # 分两段:server ≤7.4.0 默认 OFF,≥7.5.0 默认 ON(BREAKING,见 server CHANGELOG)。──
20336
- # 与上面的 ToolApprovalFrame 是两个帧族,**一条腿只走一个**(server >= 7.133.0,capabilities.approvalFrameFamilies):呈卡协议上场的腿上一只 ask 只出本族的帧、
20337
- # 旧族一帧都不发,消费端不再按 `approvalId` 去重;≤7.132.x 的呈卡腿两族并发(先 tool_approval、后 approval_request,同带 `approvalId`)⇒ 按它去重、优先渲染新帧。
20338
- classifierUnavailable:
20339
- $ref: '#/components/schemas/ClassifierUnavailable'
20340
- description: >-
20341
- server >= 7.69.0 (core 7.10.0), ADDITIVE, present only when the classifier was consulted and
20342
- could not run — WHY this ask reached a human. See ClassifierUnavailable for the open-`cause` rule and
20343
- the three shapes absence covers.
20344
- RETIRED: server >= 7.72.0 (core 7.14.0) never mints this key on any of the three faces; its
20345
- successor is `disposition.cause` on the gate record (`unavailable` / `parse_error` — a different
20346
- question, so an old switch does not port). Kept on the frame because servers 7.69–7.71 are inside the supported range and still
20347
- send it, and the closed inbox row declares the same key (frame and row read the same); it goes with the next major once the support floor is >= 7.106.0.
20348
- ruleStoreUnreadable:
20349
- type: string
20350
- enum: [store, call]
20351
- description: >-
20352
- server >= 7.72.0 (core 7.14.0), ADDITIVE — WHICH HALF of the rule lane could not be read.
20353
- Present iff `origin === "rule_store_unavailable"`: `store` = the wired rule store could not be read
20354
- (look at the store / network); `call` = the store was read but THIS command could not be read against
20355
- the person's deny/ask rows (look at the command spelling). One `origin` word covers both facts, and
20356
- their recovery verbs live in different places (ops vs prompt). Carried on the live `tool_approval`
20357
- frame and the inbox row; the `card_json` card deliberately does NOT carry it (it travels with `origin`,
20358
- which is not on the card). Absence = `origin` is not that word — NOT an assertion that the rule store
20359
- is healthy.
20360
- RETIRED: server >= 7.106.0 (core 7.34.0, BREAKING — wire) never mints this key on either face; the
20361
- signal moved to the session stream's user-facing
20362
- `engine_notice` `permission.rule_store_unavailable` (`detail.at` = `prepare` / `call`; what the run does while the rules cannot be read is
20363
- that notice's own text). Kept on the frame because servers 7.72–7.105 are inside the supported range and still send it, and the closed inbox row
20364
- declares the same key; it goes with the next major once the support floor is >= 7.106.0 (`origin: rule_store_unavailable` itself stays).
20365
- readRootCandidate:
20366
- type: object
20367
- required: [dir, clearsThisAsk]
20368
- additionalProperties: false
20369
- properties:
20370
- dir:
20371
- type: string
20372
- minLength: 1
20373
- maxLength: 1024
20374
- description: >-
20375
- The ABSOLUTE, lexically-folded directory to add to this session's read roots, spelled by the read
20376
- boundary itself — THE STRING SHOWN IS THE STRING TO ADD. A shell may render a shortened / `~` form,
20377
- but must echo THIS string back verbatim. The server carries it whole or drops the whole key
20378
- (a malformed shape, or a `dir` over 1024 UTF-16 code units ⇒ the key is ABSENT — never truncated,
20379
- because a truncated directory is a DIFFERENT directory and adding it would not clear this ask;
20380
- see the STRING-LENGTH UNIT convention in `info.description` for this `maxLength`'s counting unit).
20381
- covers:
20382
- allOf: [{ $ref: '#/components/schemas/ReadRootCover' }]
20383
- description: >-
20384
- Optional (engine core 7.22.0 `ReadRootGrantCandidate.covers`; the server carries it through key by key). ABSENT ⇒ `dir` is a DIRECTORY
20385
- (adding it to the read roots releases what lies under it). `exact` ⇒ `dir` is the path the command NAMED, offered verbatim
20386
- (a file or one concrete path, not a directory containing it): the consumer ADDS the string itself — expanding it into a
20387
- pattern grants nothing — and must not render the offer as "add directory". The domain is the single word `exact`
20388
- (a word outside it makes the server drop the whole candidate). The `approval_request` frame reads this very definition.
20389
- clearsThisAsk:
20390
- type: boolean
20391
- enum: [true]
20392
- description: >-
20393
- Shape, not value — the domain is the literal `true` only, so this seat cannot be quietly widened
20394
- into a "might help" hint.
20395
- description: >-
20396
- server >= 7.78.1 (core 7.19.0), ADDITIVE, LIVE `tool_approval` FRAME ONLY — the clearing directory for
20397
- an OUT-OF-ROOT READ ask: add `dir` to this session's read roots (the shell's existing `/add-dir`) and
20398
- the same call stops asking.
20399
- 🔴 READ PRESENCE ONLY, NEVER ABSENCE. Absence is NOT "nothing can be done": it also covers sensitive-path
20400
- deny rows (pattern-judged — no root changes them), commands the read boundary cannot parse (heredoc /
20401
- newline / command substitution / an argument used as the program), unexpanded globs, recursive walks,
20402
- and every ask NOT raised by the read boundary — every ask on server <= 7.78.0 has this shape too.
20403
- ⚠️ THIS FACE ONLY: `card_json`, the §2 inbox row, the `/v1/approvals` rich row and the park face carry
20404
- NO twin of this seat in this version — a PARKED out-of-root read ask still renders that single card.
20405
- ⚠️ Known shapes (upstream-registered, so a shell must NOT render this option as a guarantee):
20406
- `cd X && cat Y` yields X's PARENT directory; and on a deployment that normalizes declared read roots
20407
- (e.g. `/tmp/x` stored as `/private/tmp/x`) the same call may ask once more after the root is added.
20408
20066
  ApprovalRequestFrame:
20409
20067
  type: object
20410
20068
  description: >
@@ -20466,28 +20124,90 @@ components:
20466
20124
  approvalId:
20467
20125
  type: string
20468
20126
  description: >
20469
- The id of POST /v1/tool-approvals/{id}/respond and GET /v1/tool-approvals/{id}. server >= 7.133.0: ALWAYS EQUAL TO `askId` (the row's key is the ask's one wire
20127
+ The id of POST /v1/tasks/{taskId}/asks/{askId}/decision and GET /v1/tasks/{taskId}/asks/{askId}. server >= 7.133.0: ALWAYS EQUAL TO `askId` (the row's key is the ask's one wire
20470
20128
  identity; a 64-character lowercase hexadecimal string — treat it as an OPAQUE string, never parse it as a uuid); the matching close frame `approval_complete` carries it too.
20471
20129
  On server <= 7.132.x it is the legacy bridge / dedupe key (a uuid, the same value as the parallel tool_approval frame).
20472
20130
  # ── server >= 7.133.0: the off-card LIVE facts on the opening frame's top level (ELEVEN from server >= 7.138.0 — `requestedBy` joined; ten on 7.133.0–7.137.x) (one frame family per leg) ──────────────────────────
20473
- # Same keys, same shapes, same values as on the legacy `tool_approval` frame (each is a `$ref` into ToolApprovalFrame's own property — one
20131
+ # Same keys, same shapes, same values everywhere they are declared (each is a `$ref` into ApprovalRequestLiveFacts' own property — one
20474
20132
  # source per shape). Only the frame minted LIVE carries them (and what the durable ledger recorded of that frame): a disconnect-replay frame
20475
20133
  # (rebuilt from `card_json`) never does. Absence means "this frame does not carry it", not "there is none". See APPROVAL_REQUEST_LIVE_FACT_KEYS (sdk) / the server's twin.
20476
- mandated: { $ref: '#/components/schemas/ToolApprovalFrame/properties/mandated' }
20477
- mandate: { $ref: '#/components/schemas/ToolApprovalFrame/properties/mandate' }
20478
- origin: { $ref: '#/components/schemas/ToolApprovalFrame/properties/origin' }
20479
- boundGrantDigest: { $ref: '#/components/schemas/ToolApprovalFrame/properties/boundGrantDigest' }
20480
- boundGrants: { $ref: '#/components/schemas/ToolApprovalFrame/properties/boundGrants' }
20481
- classifierNoRuling: { $ref: '#/components/schemas/ToolApprovalFrame/properties/classifierNoRuling' }
20482
- boundGrantAbsence: { $ref: '#/components/schemas/ToolApprovalFrame/properties/boundGrantAbsence' }
20483
- approvalCard: { $ref: '#/components/schemas/ToolApprovalFrame/properties/approvalCard' }
20484
- readRootCandidate: { $ref: '#/components/schemas/ToolApprovalFrame/properties/readRootCandidate' }
20485
- probeReason: { $ref: '#/components/schemas/ToolApprovalFrame/properties/probeReason' }
20486
- requestedBy: { $ref: '#/components/schemas/ToolApprovalFrame/properties/requestedBy' }
20134
+ mandated: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/mandated' }
20135
+ mandate: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/mandate' }
20136
+ origin: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/origin' }
20137
+ boundGrantDigest: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/boundGrantDigest' }
20138
+ boundGrants: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/boundGrants' }
20139
+ classifierNoRuling: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/classifierNoRuling' }
20140
+ boundGrantAbsence: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/boundGrantAbsence' }
20141
+ approvalCard: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/approvalCard' }
20142
+ readRootCandidate: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/readRootCandidate' }
20143
+ probeReason: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/probeReason' }
20144
+ requestedBy: { $ref: '#/components/schemas/ApprovalRequestLiveFacts/properties/requestedBy' }
20487
20145
  liveFactsUnknown:
20488
20146
  const: true
20489
20147
  description: 'server >= 7.143.0 — ONLY on a disconnect-replay frame: the row was minted before this version (its card envelope has no live-facts seat) or that seat cannot be read, so the top-level live facts are all absent and this key says "unknown" (not "none"). Absent = the live facts on this frame are verbatim (a live frame, or a replay frame whose envelope carries the seat).'
20490
20148
 
20149
+ ApprovalRuleEvidence:
20150
+ type: object
20151
+ description: >
20152
+ server >= 7.23.0 (core 5.35.0), ADDITIVE, : the RULE-PROVENANCE
20153
+ evidence behind this ask — the org policy snapshot revision, the matched org rule's verbatim text
20154
+ (secret-redacted + length-bounded), and the shadowed personal rule's add dots (the rule's durable
20155
+ identity: an ARRAY by construction — render/reconcile as data, never join into one scalar id).
20156
+
20157
+ EACH member is a value OR a NAMED absence (`...Absent`, five-word set — read as open set, the engine
20158
+ owns the vocabulary): `not_wired` (no such lane) / `not_adjudicated` (lane exists, call skipped) /
20159
+ `unavailable` (lane consulted, its SOURCE unreadable — the one word meaning the audit chain is
20160
+ BROKEN, not empty; the ask in hand is the fail-closed tighten that followed) / `no_match`
20161
+ (consulted, nothing spoke) / `not_reported` (the seam answered without the identity).
20162
+
20163
+ Display/reconciliation metadata, NEVER adjudication input. The server transcribes the ENGINE-stamped
20164
+ record and never mints an absence word itself; a malformed record is dropped whole (absent frame key
20165
+ = older server or a dropped record — never "ungoverned").
20166
+
20167
+ CONSUMPTION (1) — THE DISPLAY PREDICATE IS THE WORD, NOT THE PRESENCE. A member earns display space
20168
+ when it HAS A VALUE, or when its absence word is NOT on the benign list (`not_wired` /
20169
+ `not_adjudicated` — "this governance lane isn't wired / wasn't its turn to speak"). `unavailable` is
20170
+ ALWAYS visible (it means the audit chain is BROKEN — the lane was consulted, its source could not be
20171
+ read, and the ask in hand is the fail-closed tighten that followed: it is the user's only view of "why
20172
+ am I suddenly being asked"), and an UNKNOWN word is visible too (open-set read: a word you don't know
20173
+ must never be treated as benign silence). Why this must be spelled out: on a deployment with NO
20174
+ governance wired, EVERY ask carries all three named absences — that is CONTRACT BEHAVIOUR, not a
20175
+ defect — so the naive "render a line per present member" smears three "not wired" lines onto every
20176
+ approval card and buries the one line that matters.
20177
+
20178
+ CONSUMPTION (2) — NARROW-READ DISCIPLINE: the server's own read is ALL-OR-NOTHING (a malformed record
20179
+ is dropped WHOLE, not salvaged member-by-member). A consumer that also narrow-reads must keep its read
20180
+ domain >= the minting domain: a NARROWER domain means one unrecognised member sends the WHOLE record
20181
+ into the reject arm and takes its siblings' legitimate evidence down with it (the `orgRule` that was
20182
+ readable on that same card disappears along with the stranger). Treat MEMBERS as an open set — keep
20183
+ what you don't recognise and simply don't render it; never validate the object against a closed
20184
+ whitelist. THIS SCHEMA IS OPEN BY CONSTRUCTION for exactly that reason: unknown members are allowed and
20185
+ the `...Absent` words are plain strings (known words listed per property), so neither a new member nor a
20186
+ new absence word can make a strict validator throw the record away.
20187
+ # 🔴 OPEN BY CONSTRUCTION (codex R1-F2, verified): `additionalProperties: false` + closed absence
20188
+ # enums CONTRADICTED the two consumption clauses right above — a strict generated client would
20189
+ # reject the whole record over one unknown member or one future absence word, which IS the
20190
+ # "all-or-nothing reject takes the siblings' evidence with it" failure those clauses warn about
20191
+ # (the readable `orgRule`, and worse the `unavailable` broken-audit-chain signal, vanish together).
20192
+ # The engine OWNS this vocabulary and mints new words; the SDK types are open on read
20193
+ # (`"not_wired" | ... | (string & {})`), so the schema must be too. Known words stay named in the
20194
+ # descriptions — documentation, not a validator gate.
20195
+ additionalProperties: true
20196
+ properties:
20197
+ orgRevision: { type: number }
20198
+ orgRevisionAbsent: { type: string, description: 'Named absence. Known words (open on read — the engine owns the vocabulary, a future one is a NEW word, never a redefinition): not_wired | not_adjudicated | unavailable | no_match | not_reported.' }
20199
+ orgRule: { type: string }
20200
+ orgRuleAbsent: { type: string, description: 'Named absence. Known words (open on read): not_wired | not_adjudicated | unavailable | no_match | not_reported.' }
20201
+ personalRuleDots:
20202
+ type: array
20203
+ items:
20204
+ type: object
20205
+ required: [actor, counter]
20206
+ properties:
20207
+ actor: { type: string }
20208
+ counter: { type: integer }
20209
+ personalRuleDotsAbsent: { type: string, description: 'Named absence. Known words (open on read): not_wired | not_adjudicated | unavailable | no_match | not_reported.' }
20210
+
20491
20211
  ApprovalCard:
20492
20212
  type: object
20493
20213
  description: >
@@ -20503,79 +20223,178 @@ components:
20503
20223
  message: { type: string, description: 'The engine ask text, secret-redacted. UNTRUSTED for display.' }
20504
20224
  args: { description: 'The pending call''s args, redacted + byte-bounded. Absent (with argsOmitted) when over the cap or unserializable. UNTRUSTED for display.' }
20505
20225
  argsOmitted: { type: boolean, enum: [true], description: 'Present (true) only when args exceeded the byte cap. Never false.' }
20506
- toolCallId: { type: string, description: 'The engine''s tool-call id (the `call_…` on the assistant message''s tool_use block) — same domain as ToolApprovalFrame.toolCallId.' }
20226
+ toolCallId:
20227
+ type: string
20228
+ description: >
20229
+ server >= 1.307 (ADDITIVE), : the ENGINE's tool-call id — the same `call_…` that
20230
+ rides the assistant message's tool_use block. ANCHOR THE CARD ON THIS. `approvalId` is unrelated to
20231
+ that block and nothing else on the stream ever mentions it again, so a card keyed by it is never
20232
+ reclaimed. Anchoring on "the most recent tool_start" does not work either: the approval frame arrives
20233
+ BEFORE tool_start (measured 4020ms vs 4142ms in one turn). Absent on the complete frame (a second
20234
+ anchor would only add ambiguity) and on servers < 1.307.
20507
20235
  risk: { $ref: '#/components/schemas/ApprovalRiskAxes' }
20508
20236
  approvalCard:
20509
20237
  allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
20510
- description: 'server >= 7.136.0, ADDITIVE: the engine-minted card word — the SAME word, read once, as the live frame''s top-level `ToolApprovalFrame.approvalCard`; it now rides the live-minted `approval_request` frame''s `card`, the stored `card_json` envelope and the reconnect-replay frame''s `card` (before 7.136.0 the card did not carry it, so a replayed frame had none). ABSENT = the engine minted none / an out-of-set word (the server narrows it again when it mints the card) / a card stored before 7.136.0 — never `generic` by default. Display / triage only; it NEVER takes part in resume / gate / CAS. The stored envelope is strict: a 7.135.x replica cannot read a row carrying this key (replay skips it, the idempotent re-entry goes to the durable park) — roll the fleet in one pass.'
20238
+ description: 'server >= 7.136.0, ADDITIVE: the engine-minted card word — the SAME word, read once, as the live frame''s top-level `ApprovalRequestLiveFacts.approvalCard`; it now rides the live-minted `approval_request` frame''s `card`, the stored `card_json` envelope and the reconnect-replay frame''s `card` (before 7.136.0 the card did not carry it, so a replayed frame had none). ABSENT = the engine minted none / an out-of-set word (the server narrows it again when it mints the card) / a card stored before 7.136.0 — never `generic` by default. Display / triage only; it NEVER takes part in resume / gate / CAS. The stored envelope is strict: a 7.135.x replica cannot read a row carrying this key (replay skips it, the idempotent re-entry goes to the durable park) — roll the fleet in one pass.'
20511
20239
  rememberRefused:
20512
20240
  type: boolean
20513
20241
  enum: [true]
20514
20242
  description: >-
20515
- server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (live `allow_session` / durable `/decide` `remember:"session"`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `allow_session` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a click on `allow_session` receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while `allow_session` still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
20243
+ server >= 7.116.0, ADDITIVE, present ONLY when true (never `false`): the "remember for this session" answer (`decideAsk` / durable `/decide` `remember:"session"`; on server <= 7.151.x the removed respond door's third word `allow_session`) will NOT be remembered on this card — the decision is accepted and applies once, the receipt's `rememberApplied` is `false` (existing key, not a new one), later cards of the same kind still ask. A shell reads this to decide whether to render the "allow for the session" choice instead of inferring it from `requiresRealApproval` / `mandated` / `governanceForced`. One bit for four reasons: the operator-governance gate / a human must approve each time / a mandated card / the answer would also grant more than this one call (new in 7.116.0: approving an engine `Skill` card activates the skill and frees its listed tools for the run, which the card cannot show, so it is not remembered). server >= 7.150.0 reads this bit as "this question + this leg" (the card and the `remember: "session"` receipt read one judge): a leg with no session, or one whose session-occupant token cannot be read (the session store carries no execution seat — the engine's default in-memory store), carries it too; the card carries it IFF a `remember: "session"` decision receipts `rememberApplied: false` (a write failure or an ambiguous commit is known only after the decision settles and is still reported on the receipt alone). ABSENT = remember works on this card, OR an older server (<= 7.115.x never carries the key) — and on <= 7.149.x ABSENT is also what those two leg shapes showed while the "allow for the session" click still receipted `false`, so "absent = remembered" does not hold there for them. Same bit on the live frame, the `approval_request` card (= `card_json`, incl. the reconnect replay), the `livePending` row, and the `/v1/approvals` `pending[]` row (+ their `/stream` frames); NOT on inbox rows.
20516
20244
  governanceForced:
20517
20245
  type: boolean
20518
20246
  enum: [true]
20519
20247
  description: >
20520
- ADDITIVE, two-stage presence (ABSENT on server <= 7.4.0; present with `true` from server >= 7.5.0):
20521
- this ask's gate comes from the OPERATOR GOVERNANCE layer and cannot be removed by a client permission
20522
- posture. Semantics, the ABSENT != false clause and the discrimination boundary are stated verbatim on
20523
- ToolApprovalFrame.governanceForced. It sits at the card's top level rather than inside `risk` because
20524
- `risk` describes the ENGINE's judgement of the call, while this key says WHO imposed the gate.
20248
+ ADDITIVE, two-stage presence: ABSENT on server <= 7.4.0; from server >= 7.5.0
20249
+ present with value `true` when this ask's gate comes from the OPERATOR GOVERNANCE
20250
+ layer (the deployment-side AUTONOMY / commandPolicy / MANUAL_MODE_SHELL_GATE / SENSITIVE_WRITE_PATTERNS
20251
+ knobs) rather than from a model default gate or the request's own client permission posture.
20252
+ The only authority on presence is an observed frame, never a version string.
20253
+
20254
+ Use it to render a "forced by governance" badge: such a gate CANNOT be removed by a client posture,
20255
+ so the shell must present it as non-bypassable instead of pointing the user at `permissionMode`.
20256
+
20257
+ 🔴 ABSENT != false (same discipline as the risk axes): the key is present ONLY when true. Absence
20258
+ means "no evidence of a governance origin" — it covers both genuinely non-governance asks (e.g. a tool
20259
+ listed in the deployment's APPROVAL_REQUIRE) AND shapes the server cannot discriminate (e.g. when the
20260
+ governance shell gate sits at the "classify" tier, a shell ask may come from the classifier or from
20261
+ another gate; the server leaves the key absent rather than guessing). Never render absence as
20262
+ "this gate can be bypassed by a posture".
20525
20263
  ruleOffers:
20526
20264
  type: array
20527
20265
  minItems: 1
20528
20266
  items: { $ref: '#/components/schemas/RuleOffer' }
20529
20267
  description: >
20530
- server >= 7.46.0 (core 5.58.0, design/375) — the discriminated-union replacement of the retired
20531
- `ruleSuggestions` (servers <= 7.45; sdk 26.0.0 deleted it). Same material as the live frame and the stored `card_json` (the server
20532
- projects all three through one `copyRuleOffer`), so semantics, order-is-contract, presence-is-the-
20533
- promise and the per-leg index rules are stated verbatim on ToolApprovalFrame.ruleOffers.
20268
+ server >= 7.46.0 (core 5.58.0), — the ENGINE-minted "don't ask
20269
+ again" OPTIONS for this ask, as a DISCRIMINATED UNION (`single` | `batch`). It is the BREAKING
20270
+ REPLACEMENT of the triple-shaped `ruleSuggestions` of servers <= 7.45: a >= 7.46.0 engine mints the old key nowhere and there is no
20271
+ alias (sdk 26.0.0 deleted the old key with the support floor 7.52.0).
20272
+
20273
+ 🔴 READ `kind` TO TELL THE ARMS APART, never a positional assumption. ORDER IS CONTRACT: a
20274
+ whole-string exact `single` is index 0 when present and a `batch` is always last; core's own
20275
+ cardinality is <= 2 while the server enforces a tolerance cap of 4.
20276
+
20277
+ 🔴 INDEX SEMANTICS DIFFER PER LEG. On THIS leg (and on the
20278
+ `approval_request` card and the durable replay of both) the server prefix-truncates and never drops
20279
+ an entry, so the index equals core's offer index and IS a legal selection key for
20280
+ `persistRule.batchOfferIndex`. On the durable queue row (PendingCheckpoint.ruleOffers) the server
20281
+ drops malformed entries and COMPACTS, so indexes shift there; on servers <= 7.151.x that leg had no redemption mouth at all, and from server >= 7.152.0
20282
+ `POST /v1/approvals/{sessionId}/decide` redeems the row's own index through `persistRule.batchOfferIndex`. A consumer that drops entries itself must keep every survivor's ORIGINAL wire index, or
20283
+ suppress its persistence actions entirely (core's normative clause) — a compacted index means the
20284
+ k-th option the person clicked is not the k-th rule the server redeems.
20285
+
20286
+ 🔴 PRESENCE IS THE PROMISE: present only where a permission-rule store
20287
+ is really wired. The converse does not hold — a wired deployment still omits it for mandated /
20288
+ requiresRealApproval / allow_outranked / ask_rule_matched / hook-produced / inherited-unresolved / ancestor-resolved /
20289
+ anonymous asks. Absence reads as "THIS CARD has no such option", never as "this deployment has no
20290
+ rule lane" (that is `capabilities.permissionRules`) and never as "your rule broke" (that is
20291
+ `allowRuleShadowed`).
20292
+
20293
+ ⚠️ REDEMPTION SCOPE is the live respond leg keyed by this frame's `approvalId` only; a replayed
20294
+ offer on another replica is not a promise that it is still redeemable.
20534
20295
  allowRuleShadowed:
20535
20296
  type: array
20536
20297
  items: { $ref: '#/components/schemas/AllowRuleShadow' }
20537
20298
  description: >
20538
- ADDITIVE (server >= 7.117.0 / core 7.42.0, BREAKING RENAME of the retired `persistedRuleShadowed`): the allow-layer members that matched this
20539
- call and could not clear this ask. Semantics, the five members, the `hook` record naming its registration (server >= 7.132.0; always empty before), the explaining sentence living in `message`,
20540
- the ABSENT != "you have no rule" clause and the separation from `governanceForced` are stated verbatim on ToolApprovalFrame.allowRuleShadowed
20541
- — the live frame, the stored `card_json`, the replayed frame and the `approval_request` card carry the SAME material.
20299
+ server >= 7.117.0 (core 7.42.0), ADDITIVE, — BREAKING RENAME, replacing the retired string `persistedRuleShadowed`
20300
+ (no alias): the allow-layer members that MATCHED this call and could NOT clear this ask, one `{ member, entries, omitted? }` record per
20301
+ matching member (see AllowRuleShadow). `member` is one of `hook` / `deployment` / `persisted` / `skill` / `request`; `entries` are the
20302
+ entries that member matched, as their source spells them (UNTRUSTED for display like `message`, secret-redacted, <= 512 chars each,
20303
+ <= 32 listed; a `hook` record's `entries` names the answering registration — server >= 7.132.0 / engine 7.52.0 mods: on this server only the
20304
+ request's own `settings.hooks` answers, so `["settings.hooks"]`; it was always the empty list on <= 7.131.x); `omitted` counts the entries not listed.
20305
+
20306
+ The explaining sentence ("... matches this call but does not clear the ask — <reason>") is IN `message` (the engine writes it where it builds
20307
+ the card); this key is the structured twin of the same fact. Render a line from it ("your rule matched, but this call must be confirmed each
20308
+ time"): without it the only conclusion a user can draw is "my rule broke".
20309
+
20310
+ 🔴 ABSENT != "you have no rule": present only when a member matched AND could not clear the ask; a match that cleared never becomes an ask.
20311
+ 🔴 `member: "hook"` names the answering registration in `entries` (server >= 7.132.0; the deployment seat's registrations are observers and never
20312
+ answer — on <= 7.131.x the record could not say whose hook). 🔴 Deliberately SEPARATE from `governanceForced` (that one: "who imposed the gate"; this one: "what happened to YOUR
20313
+ rule"). What the allow layer can NOT clear: any layer's deny / ask rule, operator `APPROVAL_REQUIRE` / `APPROVAL_NEVER_AUTO` /
20314
+ `MANUAL_MODE_SHELL_GATE=always`, write protection, sensitive-path writes, governance, a hook's ask, plan-mode asks. The durable dual is
20315
+ `gate.riskDescriptor.allowRuleShadowed` on the parked row (PendingCheckpoint.riskDescriptor). Rolling-upgrade caveat: a card stored by a
20316
+ <= 7.116.x replica (`card_json` carrying `persistedRuleShadowed`) cannot be read by a >= 7.117.0 replica — the replay skips it.
20542
20317
  fromSubagent: { type: boolean, enum: [true], description: 'Present ⇔ the ask comes from a DELEGATED child — the explicit discriminator (a worker cannot forge it).' }
20543
- sourceSessionId: { type: string, description: 'server >= 7.143.0 (rename of `sourceTaskId`, same value, no alias): the child''s core session id — same as ToolApprovalFrame.sourceSessionId.' }
20544
- agentId: { type: string, description: 'server >= 7.143.0: same as ToolApprovalFrame.agentId.' }
20318
+ sourceSessionId:
20319
+ type: string
20320
+ description: 'server >= 7.143.0 (core 7.61.0 BREAKING rename of `sourceTaskId`, same value, no alias): the delegated child''s core SESSION id — row-join value. Read attribution off `fromSubagent`, not off this key''s presence.'
20321
+ agentId:
20322
+ type: string
20323
+ description: 'server >= 7.143.0: the agent id of the leg that raised the ask (a background child''s registry row id `a…`, a foreground child''s session id); a directly started workflow''s agent carries it WITHOUT `fromSubagent`; absent on the host''s own ask.'
20545
20324
  askReasons:
20546
20325
  type: array
20547
20326
  items: { $ref: '#/components/schemas/AskReason' }
20548
- description: 'server >= 7.143.0: same value as ToolApprovalFrame.askReasons (one narrow read for frame, card and queue row).'
20327
+ description: 'server >= 7.143.0 (core 7.61.0): WHO asked and WHY — one entry per asker with its own words. Structured approval UIs render reason lines from this, not from `message`. Words are credential-redacted and length-capped; any malformed entry ⇒ the whole seat is withheld. Absent = an older engine / the engine''s generic question.'
20549
20328
  sourceAgentName: { type: string, description: 'The child agent''s display name, redacted. UNTRUSTED.' }
20550
20329
  # A-057.④(#314):三键 server 早已随卡投出(与 tool_approval 帧同一窄读函数 ⇒ 帧与 card 同值),
20551
20330
  # 但本 schema 只在帧上公示过 —— 按 spec 生成的卡消费方拿不到。定义与帧上同构段逐字同源,
20552
- # 长 description 不复制(单一真源在 ToolApprovalFrame 的同名键)。
20331
+ # 长 description 不复制(单一真源在 ApprovalRequestLiveFacts / ApprovalCard 的同名键)。
20553
20332
  inputHasBidi: { type: boolean, enum: [true], description: 'server >= 7.45.0 (E-14): the TO-BE-EXECUTED input (redacted args, computed BEFORE the byte cap) contains Unicode bidi override characters — what the eye reads may not be the byte order that runs. DISCLOSURE bit, bytes unchanged; rendering (escape/highlight) is the shell''s. Present (true) or ABSENT; absence != "verified clean" (not detected / serialization failed / older server).' }
20554
- probeCause: { type: object, additionalProperties: true, description: 'server >= 7.17.0: structured reversibility-probe tightening cause — same shape and semantics as ToolApprovalFrame.probeCause ({code, roots:{shown,total}, further?:{shown,total}}); frame and card carry the SAME value (one narrow-read function server-side). See that key for the full contract.' }
20555
- ruleEvidence: { type: object, additionalProperties: true, description: 'server >= 7.23.0: rule-provenance evidence — same shape and semantics as ToolApprovalFrame.ruleEvidence (each member a value or a NAMED absence word; display/reconciliation metadata, never adjudication input). Frame and card carry the SAME value. See that key for the full contract.' }
20333
+ probeCause:
20334
+ type: object
20335
+ description: >
20336
+ server >= 7.17.0 (core 5.33.0), ADDITIVE, : the STRUCTURED cause of a
20337
+ reversibility-probe tightening. `code` is machine-readable (open set — branch with a default arm);
20338
+ `shown` may be truncated by the server (<= 8 entries) while `total` stays verbatim, so "N more
20339
+ unnamed" is always computable. Absent != "no reason" (only maybe-tier tightenings whose probe
20340
+ supplied a cause carry it). Render as data; the server never flattens it into a sentence.
20341
+ additionalProperties: false
20342
+ required: [code, roots]
20343
+ properties:
20344
+ code: { type: string }
20345
+ roots:
20346
+ type: object
20347
+ required: [shown, total]
20348
+ properties:
20349
+ shown: { type: array, items: { type: string } }
20350
+ total: { type: integer }
20351
+ further:
20352
+ type: object
20353
+ required: [shown, total]
20354
+ properties:
20355
+ shown: { type: array, items: { type: string } }
20356
+ total: { type: integer }
20357
+ ruleEvidence: { $ref: '#/components/schemas/ApprovalRuleEvidence' }
20556
20358
  delegation: { $ref: '#/components/schemas/ApprovalCardDelegation' }
20557
20359
  # S-139(sdk 8.3.0):同 A-057.④ 的理由 —— server 早随卡投出(帧与卡同一只窄读函数 ⇒ 同值),
20558
- # 但本 schema 此前只在帧上公示过。长 description 的单一真源在 ToolApprovalFrame 的同名键。
20360
+ # 但本 schema 此前只在帧上公示过。长 description 的单一真源在 ApprovalRequestLiveFacts 的同名键。
20559
20361
  ruleOffersAbsence: { $ref: '#/components/schemas/RuleOffersAbsence' }
20560
20362
  denialLimitFallback: { $ref: '#/components/schemas/DenialLimitFallback' }
20561
20363
  # K-37 (sdk 15.1.0): server >= 7.109.0 (S-934 ②) — `ApprovalCardSchema` gains the ask-class pair + a pairing rule.
20562
20364
  askClass:
20563
20365
  allOf: [{ $ref: '#/components/schemas/AskClass' }]
20564
- description: 'server >= 7.109.0 (S-934 ②): the SAME pair as the live frame (one narrow read at the frame mint point), so the live frame / `approval_request` / `card_json` / the replay frame carry one value. Present together with `classes`, `classes[0] === askClass`; absent = an older engine / a station that stamps no class, not "no class". Full contract on ToolApprovalFrame.askClass.'
20366
+ description: >-
20367
+ server >= 7.109.0 (core 7.37.0), ADDITIVE — WHICH CLASS this ask belongs
20368
+ to: the first member of `classes` (core `ASK_CLASSES` order; the same closed set as the gate record's
20369
+ `AskClass`). Stamped by the engine at every station that stamps `origin`; the server reads it through ONE
20370
+ narrow read (`readAskClassPair`, members screened by core `isAskClass`). PRESENT TOGETHER WITH `classes` or
20371
+ not at all, and `classes[0]` equals `askClass` — a half pair / an out-of-set word / a mismatched first member
20372
+ is withheld WHOLE (both keys absent). ABSENT = an older engine (core < 7.37.0), an old parked row (resume
20373
+ does not backfill) or a station that stamps no class — NOT "no class", and not `ordinary`. Display / triage
20374
+ metadata (the shell renders by class; a durable approver answers by class), never an adjudication input.
20375
+ The same pair, same order, rides this frame, `livePending[].frame`, the `approval_request` card (=
20376
+ `card_json` = the disconnect-replay frame) and the operator queue row (`GET /v1/approvals` `pending[]` and
20377
+ the `/stream` `pending` frame). The inbox row does NOT carry it (core `CheckpointSummary` does not echo it),
20378
+ nor does the `livePending` row top level (only its `frame`).
20565
20379
  classes:
20566
20380
  type: array
20567
20381
  minItems: 1
20568
20382
  items: { $ref: '#/components/schemas/AskClass' }
20569
- description: 'server >= 7.109.0 (S-934 ②): every class this ask belongs to (non-empty, first member = `askClass`). See ToolApprovalFrame.classes.'
20383
+ description: >-
20384
+ server >= 7.109.0, ADDITIVE — EVERY class this ask belongs to (core
20385
+ `ASK_CLASSES` order, non-empty, `classes[0] === askClass`); one ask can belong to several, so read the whole
20386
+ set, not just `askClass`. Present together with `askClass`; passed through verbatim in order (the server
20387
+ neither sorts nor dedupes).
20570
20388
  classifierUnavailable:
20571
20389
  $ref: '#/components/schemas/ClassifierUnavailable'
20572
20390
  description: >-
20573
- (minted by servers [7.69.0, 7.72.0), core 7.10.0 #616) WHY this ask reached a human. See ClassifierUnavailable for the open-`cause` rule and the three
20574
- shapes absence covers.
20391
+ server >= 7.69.0 (core 7.10.0), ADDITIVE, present only when the classifier was consulted and
20392
+ could not run — WHY this ask reached a human. See ClassifierUnavailable for the open-`cause` rule and
20393
+ the three shapes absence covers.
20575
20394
  RETIRED: server >= 7.72.0 (core 7.14.0) never mints this key on any of the three faces; its
20576
20395
  successor is `disposition.cause` on the gate record (`unavailable` / `parse_error` — a different
20577
- question, so an old switch does not port). It stays declared on the CARD because the pinned server's card schema (`ApprovalCardSchema`, server 7.134.0) still accepts it: a still-pending `card_json` row a
20578
- 7.69–7.71 server wrote replays verbatim onto `approval_request.card` / the replay frame. (The FRAME's same-named key stays declared too; why, and until when: `ToolApprovalFrame.classifierUnavailable`.)
20396
+ question, so an old switch does not port). Kept on the frame because servers 7.69–7.71 are inside the supported range and still
20397
+ send it, and the closed inbox row declares the same key (frame and row read the same); it goes with the next major once the support floor is >= 7.106.0.
20579
20398
 
20580
20399
  ClassifierUnavailable:
20581
20400
  # 8.9.0:三面(tool_approval 帧 / ApprovalCard / InboxRow)同形同值 ⇒ 具名单源,内联三份会各自漂。
@@ -20612,7 +20431,7 @@ components:
20612
20431
  # 闭集**执法**只属于**筛过的**那一面(`GateOutcome.origin`:引擎的 `screenGateOutcome` 判成员,
20613
20432
  # 出集即整条不上帧),所以那张 enum 落在**那个引用点**,恰一处。已知十二词(core 7.49.0 +plan_review)见下面的描述。
20614
20433
  description: >
20615
- WHO raised an ask (`ToolApprovalFrame.origin`; server >= 7.57.0 / core 7.5.0, S-125③/#564) — core's
20434
+ WHO raised an ask (`ApprovalRequestLiveFacts.origin`; server >= 7.57.0 / core 7.5.0) — core's
20616
20435
  `ASK_ORIGINS`, ENGINE-STAMPED at the gate (core's words: "engine-stamped at the gate, never a policy's
20617
20436
  claim"), transcribed verbatim by the server, which deliberately mints no second eligibility table of
20618
20437
  its own.
@@ -20685,7 +20504,7 @@ components:
20685
20504
  additionalProperties: false
20686
20505
  required: [member, entries]
20687
20506
  description: >
20688
- One allow-layer DISCLOSURE record (`ToolApprovalFrame.allowRuleShadowed` / `ApprovalCard.allowRuleShadowed` / the durable
20507
+ One allow-layer DISCLOSURE record (`ApprovalCard.allowRuleShadowed` / `ApprovalCard.allowRuleShadowed` / the durable
20689
20508
  `PendingCheckpoint.riskDescriptor.allowRuleShadowed`; server >= 7.117.0 / core 7.42.0 `AllowRuleShadow`): one member of the allow layer that
20690
20509
  MATCHED the call and could NOT clear its ask. At most one record per member, at most five per ask. The vocabulary owner is core; the server
20691
20510
  drops the whole key on a member outside the five words, so a >= 7.117.0 server only ever sends these five — still read `member` as an open
@@ -20708,7 +20527,7 @@ components:
20708
20527
  type: string
20709
20528
  enum: [mandated, allow_outranked, ask_rule_matched, lane_cannot_speak]
20710
20529
  description: >
20711
- WHY `ruleOffers` is absent while the rule lane IS present (`ToolApprovalFrame.ruleOffersAbsence` and
20530
+ WHY `ruleOffers` is absent while the rule lane IS present (`ApprovalCard.ruleOffersAbsence` and
20712
20531
  `ApprovalCard.ruleOffersAbsence`; server >= 7.55.0 / core #490 fix ②, S-15). The engine names which
20713
20532
  door is shut: `mandated` = this ask must be confirmed every time (🔴 this arm must NOT point the user
20714
20533
  at writing a rule — a rule would not silence it, and saying so sends them into a loop); `allow_outranked` = an
@@ -20728,7 +20547,7 @@ components:
20728
20547
  type: string
20729
20548
  enum: [not_bindable, unreadable]
20730
20549
  description: >
20731
- WHY a tool-approval card has NO grant-binding digest (`ToolApprovalFrame.boundGrantDigest`) — the engine's closed `BOUND_GRANT_ABSENCES` (core 7.51.0 #1688; server >= 7.129.0). The engine mints
20550
+ WHY a tool-approval card has NO grant-binding digest (`ApprovalRequestLiveFacts.boundGrantDigest`) — the engine's closed `BOUND_GRANT_ABSENCES` (core 7.51.0; server >= 7.129.0). The engine mints
20732
20551
  EXACTLY ONE of the digest and this word on every card. `not_bindable` = this ask is not an activation of the engine's `Skill` tool, so it binds no grant: approving it grants nothing else, and "allow for this
20733
20552
  session" can be remembered per tool. `unreadable` = the card binds a grant but what it binds could not be read (a stored row whose digest is not a string, or says neither — a row parked before engine 7.51.0
20734
20553
  reads as this on the inbox face); on a live card the engine always supplies the digest, so this word shows up only where STORED rows are read.
@@ -20778,7 +20597,7 @@ components:
20778
20597
  additionalProperties: false
20779
20598
  required: [consecutive, total, limit, autoDenyAfterMs]
20780
20599
  description: >
20781
- The auto-mode classifier's DENIAL-LIMIT FALLBACK card (`ToolApprovalFrame.denialLimitFallback` and
20600
+ The auto-mode classifier's DENIAL-LIMIT FALLBACK card (`ApprovalCard.denialLimitFallback` and
20782
20601
  `ApprovalCard.denialLimitFallback`; server >= 7.57.0 / core 7.4.0 #548, S-114): the call that hit the
20783
20602
  consecutive (default 3) or cumulative (default 20) refusal limit is no longer silently denied — it
20784
20603
  becomes a card a HUMAN must decide. The same mint also stamps `requiresRealApproval`; the two are twins.
@@ -20790,7 +20609,7 @@ components:
20790
20609
  waits for a person) is for RENDERING THE COUNTDOWN ONLY. Never start a second timer from it: the window
20791
20610
  is executed by the ENGINE, and two overlapping windows are worse than the original defect and silent.
20792
20611
  🔴 ABSENCE IS NOT AN ASSERTION — the vast majority of asks are not fallback cards.
20793
- ⚠️ TWO LEGS CARRY IT, and they differ in ONE member. The live/card leg (`ToolApprovalFrame` /
20612
+ ⚠️ TWO LEGS CARRY IT, and they differ in ONE member. The live/card leg (`ApprovalRequestFrame` /
20794
20613
  `ApprovalCard` / `card_json`) can carry a NON-ZERO `autoDenyAfterMs`; the DURABLE leg — the parked row,
20795
20614
  projected onto `InboxRow` since server >= 7.57.0 (core's park twin of the same member) — always carries
20796
20615
  `0` there, because nothing counts down on a parked lane (see InboxRow.denialLimitFallback).
@@ -20951,7 +20770,7 @@ components:
20951
20770
  type: object
20952
20771
  description: >
20953
20772
  server >= 7.48.0 (P-39), ADDITIVE — one self-describing attribution anchor for
20954
- `ToolApprovalRespondAck.persistedRules`, index-aligned with it.
20773
+ `AskDecisionAck.persistedRules`, index-aligned with it.
20955
20774
 
20956
20775
  The disease it closes: per-entry attribution of `persistedRules` used to be inferable only from
20957
20776
  POSITION, and position was not provable on the wire (the ack order came from the server's RE-MINTED
@@ -20971,7 +20790,7 @@ components:
20971
20790
 
20972
20791
  PersistRuleSelection:
20973
20792
  description: >
20974
- The body field `persistRule` of POST /v1/tool-approvals/{id}/respond — TWO MUTUALLY EXCLUSIVE ARMS,
20793
+ The body field `persistRule` of POST /v1/tasks/{taskId}/asks/{askId}/decision — TWO MUTUALLY EXCLUSIVE ARMS,
20975
20794
  matching the server's `ParsedPersistRule` one for one.
20976
20795
 
20977
20796
  🔴 THERE IS NO `kind` ON THE WIRE: that is the server's own post-parse discriminator. The arms are told
@@ -21283,18 +21102,17 @@ components:
21283
21102
  type: string
21284
21103
  enum: [ttl_expired, broadcast_lost, stream_disconnected, undeliverable, run_cancelled, run_exited, batch_aborted, batch_sibling_withdrawn, batch_bound_elsewhere, routing_failure_fail_closed, crashed_before_park, shutdown_before_park, orphan_ttl_exceeded, adhoc_leg_no_durable_domain]
21285
21104
  description: >
21286
- server >= 7.124.0 — the NON-HUMAN ending causes (fourteen words) carried by the live close frame `tool_approval_complete` `cause` (and the
21105
+ server >= 7.124.0 — the NON-HUMAN ending causes (fourteen words) carried by the close frame `approval_complete` `cause` (server <= 7.151.x: the legacy `tool_approval_complete`, same words) (and the
21287
21106
  audit ledger's settle rows): the ten ask-row words (`AskRowEndingCause`) plus four waiting words that never land on the ask row —
21288
- `ttl_expired` (the wait window ran out), `broadcast_lost` (neither frame family reached any connection), `stream_disconnected` (the
21107
+ `ttl_expired` (the wait window ran out), `broadcast_lost` (the frame reached no connection), `stream_disconnected` (the
21289
21108
  carrying stream dropped; forced park), `undeliverable` (persisted row unusable / identity indeterminate / hanging without a row). The three
21290
21109
  decision words (`binding_changed` / `answer_invalid` / `outcome_cell_invalid`) refuse one decision, never end a card, and are not here.
21291
21110
  ToolApprovalNotPendingCause:
21292
21111
  type: string
21293
- enum: [routing_failure_fail_closed, run_cancelled, run_exited, batch_aborted, batch_sibling_withdrawn, batch_bound_elsewhere, adhoc_leg_no_durable_domain, orphan_ttl_exceeded, crashed_before_park, shutdown_before_park, unknown_or_other_replica]
21112
+ enum: [unknown_or_other_replica]
21294
21113
  description: >
21295
- The late-answer `404 tool_approval.not_pending` `cause`: the ask-row ending-cause words (the card ended without a human decision — dismiss
21296
- it) plus the 404-only `unknown_or_other_replica` (this replica does not know the id — retry on another endpoint / replica). server >= 7.124.0
21297
- retired the old words `voided` / `denied` (no alias).
21114
+ The `cause` of the read door's `404 tool_approval.not_pending`: ONE word since server 7.152.0 — `unknown_or_other_replica` (the ask is still pending but lives on another replica / this replica
21115
+ does not know it). The ask-row ending-cause words travel only on the `void` body's `cause` and on `410 gone.ask`.
21298
21116
  ToolApprovalNotPendingBody:
21299
21117
  allOf:
21300
21118
  - $ref: '#/components/schemas/ErrorResponse'
@@ -21303,7 +21121,7 @@ components:
21303
21121
  cause:
21304
21122
  allOf: [{ $ref: '#/components/schemas/ToolApprovalNotPendingCause' }]
21305
21123
  description: 'Optional, past the owner gate only. See `ToolApprovalNotPendingCause`.'
21306
- description: '404 body of `POST /v1/tool-approvals/{id}/respond` (`tool_approval.not_pending`).'
21124
+ description: '404 body of `GET /v1/tasks/{taskId}/asks/{askId}` (`tool_approval.not_pending`).'
21307
21125
  AskGoneBody:
21308
21126
  allOf:
21309
21127
  - $ref: '#/components/schemas/ErrorResponse'
@@ -21343,9 +21161,10 @@ components:
21343
21161
  properties:
21344
21162
  retryAfterSec: { type: integer, description: 'Suggested lower bound before polling again; paired with the Retry-After header.' }
21345
21163
  description: >
21346
- 425 body (`parking.ask_retry`). 🔴 NOT "retry may succeed": the window is already closed and the decision
21347
- can never be accepted. The retry fetches the FINAL ROUTING INFO (poll until the 410 hands over the gate
21348
- coordinates). Carries NO gate coordinates — they are not written until the batch binds.
21164
+ 425 body (`parking.ask_retry`). 🔴 This decision was NOT accepted this time and is not queued (the server's sentence: a retry tells you where the ask finally
21165
+ landed): the card window is closed and the row is mid-park. Wait the `Retry-After` seconds, then send the decision again — once the row has landed as PARKED the
21166
+ decision door redeems it (200 `accepted: "parked_redeemed"`, schema AskDecisionParkedRedeemed); if the ask ended without a human answer it answers 410 `gone.ask`
21167
+ (`state` / `cause`). The body carries NO gate coordinates (only `retryAfterSec`, the same value as the `Retry-After` header).
21349
21168
 
21350
21169
  RuleWriteFailedBody:
21351
21170
  allOf:
@@ -21410,9 +21229,8 @@ components:
21410
21229
  type: string
21411
21230
  enum: [approve, deny]
21412
21231
  description: >
21413
- The decision on an IN-STREAM approval card (design/172 §3.2). A TWO-word set — deliberately NOT the
21414
- three-word ToolApprovalDecision: `allow_session` ("remember for this session") is a live-bridge-only
21415
- semantic and does not exist on POST /v1/tasks/{taskId}/asks/{askId}/decision.
21232
+ The decision on an approval card. A TWO-word set; the old live card's third word ("remember for this session") is the independent key
21233
+ `remember: "session"` on an `approve` of POST /v1/tasks/{taskId}/asks/{askId}/decision.
21416
21234
 
21417
21235
  ActorAssertion:
21418
21236
  type: object
@@ -21456,9 +21274,7 @@ components:
21456
21274
  type: string
21457
21275
  maxLength: 2048
21458
21276
  description: >
21459
- Audit note (a malformed value is a loud 400, never a silent truncation). Same word, same cap and the
21460
- SAME COLUMN (`decision_note`) as the live respond leg's `note` on POST
21461
- /v1/tool-approvals/{id}/respond — one dialect, two legs.
21277
+ Audit note (a malformed value is a loud 400, never a silent truncation); the SAME COLUMN (`decision_note`) on the row.
21462
21278
  🔴 THE ECHO RULING WAS FLIPPED (server #229, >= 7.15.0): this used to be "NEVER echoed back on the 409
21463
21279
  first-decision echo", and the cost of that narrowest-disclosure shape was a write-only audit column.
21464
21280
  Today all three response bodies (first-decision 200 / idempotent replay 200 / 409
@@ -21491,6 +21307,27 @@ components:
21491
21307
  decidedVia:
21492
21308
  allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
21493
21309
  description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
21310
+ remember:
21311
+ type: string
21312
+ enum: [session]
21313
+ description: >
21314
+ server >= 7.152.0 — "remember for this session" (the live card's old third word `allow_session`, now an independent key): ONLY the literal `session`, ONLY with `decision: "approve"`.
21315
+ Another word => 400 `request.field_invalid`; with `deny` => 400 `request.field_conflict` (`reason: "remember_decision"`, `fields: ["remember", "decision"]`) — both refused before the decision.
21316
+ The 200 carries `rememberApplied` (did it land). On a card that carries grants (the engine's `Skill` card, card key `rememberRefused`) the decision is accepted, lets THIS call through and remembers
21317
+ nothing; when the decision lands on a replica that does not hold the engine leg it answers `rememberApplied: false` (the in-process allow is remembered only where it is held).
21318
+ persistRule:
21319
+ allOf: [{ $ref: '#/components/schemas/PersistRuleSelection' }]
21320
+ description: >
21321
+ server >= 7.152.0 — "do not ask again": the rule this decision should persist (candidate arm `{ rule }` / free-text arm `{ rule, edited: true }` / batch arm `{ batchOfferIndex }`;
21322
+ see PersistRuleSelection). The FIRST decision's 200 carries the rule-position keys (`rulePersisted` / `ruleRefusal` / `persistedRule` / `persistedRules` / `persistedRuleAnchors`);
21323
+ a rule that did not persist never flips the verdict. A late answer / replay does not persist a rule.
21324
+ readRootGrant:
21325
+ type: string
21326
+ minLength: 1
21327
+ description: >
21328
+ server >= 7.152.0 — "Yes, and add directory": the card's `readRootCandidate.dir` echoed back verbatim. ONLY with `decision: "approve"` and no `remember`; accepted only where capability
21329
+ `approvalReadRootGrant` is true (a single-user host-lane deployment); a PARKED card does not take it. Violations => 400 `request.body_shape` (before the decision). The server judges the SHAPE only —
21330
+ the ENGINE judges the value; the outcome is announced (`approval.read_root_granted` / `approval.read_root_grant_rejected`), never in the 200.
21494
21331
 
21495
21332
  ApprovalDecideGateKind:
21496
21333
  type: string
@@ -21498,7 +21335,7 @@ components:
21498
21335
  description: >
21499
21336
  server >= 7.126.0 (sdk 21.1.0 `APPROVAL_DECIDE_GATE_KINDS`, verbatim and in order; single owner = server
21500
21337
  `APPROVAL_GATE_KINDS`) — the parked gate kinds the DURABLE decision door `POST /v1/approvals/{sessionId}/decide`
21501
- accepts (the live `POST /v1/tool-approvals/{id}/respond` answers the same card family). A parked row of
21338
+ accepts (the live `POST /v1/tasks/{taskId}/asks/{askId}/decision` answers the same card family). A parked row of
21502
21339
  kind `plan_review` goes to the plan-review door instead (`PlanReviewGateKind`); `resource_limit` / `needs_review` /
21503
21340
  `task_done` have no human decision door (resume / terminal). Clients route a pending row by reading this set,
21504
21341
  never by a hand-written copy of it.
@@ -21538,7 +21375,7 @@ components:
21538
21375
  enum: [person, policy]
21539
21376
  description: >
21540
21377
  server >= 7.118.0 (`APPROVAL_DECIDED_BY`, verbatim and in order) — WHO made an approval decision, one key on all three decision
21541
- doors (live `POST /v1/tool-approvals/{id}/respond`, durable `POST /v1/tasks/{taskId}/asks/{askId}/decision`, durable
21378
+ doors (live `POST /v1/tasks/{taskId}/asks/{askId}/decision`, durable `POST /v1/tasks/{taskId}/asks/{askId}/decision`, durable
21542
21379
  `POST /v1/approvals/{sessionId}/decide`). `person` = a person decided through the approval channel (ABSENT means this);
21543
21380
  `policy` = this deployment's own policy decided (a rule / posture answering on someone's behalf, a headless lane) — BOTH
21544
21381
  directions: the engine records `tool_end.gate.settlement.kind` = `policy_allowed` / `policy_refused` (`who.party: "policy"`).
@@ -21601,7 +21438,7 @@ components:
21601
21438
 
21602
21439
  AskDecisionAck:
21603
21440
  type: object
21604
- description: 'The 200 ack of POST /v1/tasks/{taskId}/asks/{askId}/decision (design/172 §3.2 rule ①; also the replay body for an idempotent retry).'
21441
+ description: 'The 200 ack of POST /v1/tasks/{taskId}/asks/{askId}/decision on a FIRST decision or an idempotent replay. A PARKED ask answers the other arm, AskDecisionParkedRedeemed.'
21605
21442
  required: [askId, taskId, decision, decidedAtMs]
21606
21443
  additionalProperties: false # server-composed envelope (car4 §6), not an engine passthrough — closed on purpose
21607
21444
  properties:
@@ -21648,6 +21485,58 @@ components:
21648
21485
  TRUE-ONLY disclosure (present as `absent`): no engine leg on THIS replica is waiting for this ask — the decision is on the row (an idempotent replay will read it, the audit surface keeps it)
21649
21486
  but nothing running here resumes because of it (the holder of the suspended promise may be another replica, or this replica restarted and its local window is empty). Read the RUN surface to
21650
21487
  learn whether anything continued; NEVER take a 200 without this key as proof the run continued (older servers never send it). Not a 409 / 410: the decision DID take effect.
21488
+ rememberApplied:
21489
+ type: boolean
21490
+ description: 'server >= 7.152.0: only on a FIRST decision whose request carried `remember`: did it land. `false` on a card that carries grants and when the decision landed on a replica that does not hold the engine leg. Absent on a replay.'
21491
+ rulePersisted:
21492
+ type: boolean
21493
+ description: 'server >= 7.152.0: only on a FIRST decision whose request carried `persistRule` — whether the rule landed in the rule store. A rule that did not persist NEVER flips the verdict: 200 + `false` + `ruleRefusal`. Absent is not `false`.'
21494
+ ruleRefusal:
21495
+ $ref: '#/components/schemas/RuleRefusalReason'
21496
+ persistedRule:
21497
+ type: string
21498
+ description: 'server >= 7.152.0: free-text arm only — the canonical spelling of the rule that was written.'
21499
+ persistedRules:
21500
+ type: array
21501
+ items: { type: string }
21502
+ description: 'server >= 7.152.0: batch arm only — the canonical texts of every member written, in the requested offer''s member order.'
21503
+ persistedRuleAnchors:
21504
+ type: array
21505
+ items: { $ref: '#/components/schemas/PersistedRuleAnchor' }
21506
+ description: 'server >= 7.152.0: index-aligned with `persistedRules`; present only when the server can prove the attribution.'
21507
+ AskDecisionParkedRedeemed:
21508
+ type: object
21509
+ description: >
21510
+ server >= 7.152.0 — the 200 of the decision door on a PARKED ask (the card's window ended and it moved to background standby): the answer goes through the durable redemption leg (the same CAS as
21511
+ POST /v1/approvals/{sessionId}/decide) and the body is that leg's receipt (ApprovalDecisionResult keys, e.g. `status` / `taskId` / `sessionId`) plus this door's keys. Discriminant: `accepted: "parked_redeemed"`.
21512
+ `idempotent: true` only on a replay (the same redeemed card answered again).
21513
+ required: [askId, taskId, decision, decidedAtMs, actor, accepted]
21514
+ additionalProperties: false # closed like its sibling arm: the key set is ApprovalDecisionResult's own keys (by $ref) plus this door's keys
21515
+ properties:
21516
+ askId: { type: string }
21517
+ taskId: { type: string }
21518
+ decision: { $ref: '#/components/schemas/ApprovalAskDecision' }
21519
+ decidedAtMs: { type: integer }
21520
+ actor: { $ref: '#/components/schemas/ActorAssertion' }
21521
+ accepted: { type: string, enum: [parked_redeemed] }
21522
+ decisionNote: { type: string }
21523
+ noteRecorded: { type: boolean }
21524
+ rememberApplied: { type: boolean, description: 'server >= 7.152.0: only when the request carried `remember` and this was the FIRST redemption.' }
21525
+ rulePersisted: { type: boolean }
21526
+ ruleRefusal: { $ref: '#/components/schemas/RuleRefusalReason' }
21527
+ persistedRule: { type: string }
21528
+ persistedRules: { type: array, items: { type: string } }
21529
+ persistedRuleAnchors: { type: array, items: { $ref: '#/components/schemas/PersistedRuleAnchor' } }
21530
+ status: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/status' }
21531
+ sessionId: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/sessionId' }
21532
+ bindingEnforced: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/bindingEnforced' }
21533
+ decisionCommitted: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/decisionCommitted' }
21534
+ checkpointId: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/checkpointId' }
21535
+ errorCode: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/errorCode' }
21536
+ errorMessage: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/errorMessage' }
21537
+ retriable: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/retriable' }
21538
+ idempotent: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/idempotent' }
21539
+ executionOutcome: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/executionOutcome' }
21651
21540
 
21652
21541
  QuestionFrame:
21653
21542
  type: object
@@ -22218,7 +22107,7 @@ components:
22218
22107
 
22219
22108
  # ── 🔴 #185a (2026-08-08): the DURABLE leg's three APPROVAL arms ────────────────────────────────
22220
22109
  # Shape rule for all three: `allOf: [<frame schema>, {the narrowed discriminant}]`. The keys are NOT
22221
- # restated here — ToolApprovalFrame / ApprovalRequestFrame stay their single owner, so an additive
22110
+ # restated here — ApprovalRequestLiveFacts / ApprovalRequestFrame stay their single owner, so an additive
22222
22111
  # frame key (7.5.0's `governanceForced`) lands on the arm for free. The arms stay OPEN
22223
22112
  # (the frame schemas are `additionalProperties: true`), which is also why they need no local mirror
22224
22113
  # of the allOf branch keys (that duty only binds closed schemas).
@@ -22226,30 +22115,6 @@ components:
22226
22115
  # never that the frame will arrive: `tool_approval*` needs TOOL_APPROVAL_ENABLED, `approval_request`
22227
22116
  # needs the design/172 protocol (server >= 7.3.0; default OFF <= 7.4.0 / ON >= 7.5.0, and the only
22228
22117
  # authority is the measured `capabilities.streamApproval` bit, never a version string).
22229
- Event_tool_approval:
22230
- description: >
22231
- DURABLE-leg replay of the legacy tool-approval OPEN frame. Same payload as ToolApprovalFrame with the
22232
- discriminant narrowed to `tool_approval`. Settle it via POST /v1/tool-approvals/{id}/respond.
22233
- Anchor the card on `toolCallId` (NOT `approvalId`); render `governanceForced` as a non-bypassable
22234
- "forced by governance" badge. UNTRUSTED for display: `message`/`args` are redacted but model-authored.
22235
- allOf:
22236
- - $ref: '#/components/schemas/ToolApprovalFrame'
22237
- - type: object
22238
- required: [type]
22239
- properties:
22240
- type: { type: string, enum: [tool_approval] }
22241
- Event_tool_approval_complete:
22242
- description: >
22243
- DURABLE-leg replay of the legacy tool-approval CLOSE frame (ToolApprovalFrame with the discriminant
22244
- narrowed to `tool_approval_complete`). `outcome` is a COSMETIC dismiss reason: for `expired`, a
22245
- deployment carrying the design/172 ask ledger re-adjudicates to "unavailable" and the run PARKS, while
22246
- one without it keeps the historical fail-closed DENY. NEVER derive the run's fate from this frame.
22247
- allOf:
22248
- - $ref: '#/components/schemas/ToolApprovalFrame'
22249
- - type: object
22250
- required: [type]
22251
- properties:
22252
- type: { type: string, enum: [tool_approval_complete] }
22253
22118
  Event_approval_request:
22254
22119
  description: >
22255
22120
  The design/172 in-stream approval card as an AgentEvent arm. ONE FRAME FAMILY PER LEG (server >= 7.133.0,
@@ -23853,15 +23718,6 @@ components:
23853
23718
  enum: [true]
23854
23719
  description: 'server >= 7.135.0 (failure only): present (always `true`) when the failure was a provider refusal whose minter RULED OUT input-too-long as the explanation (core `AssistantMessage.inputTooLongRuledOut`, passed through). It speaks ONLY to that negative: it does not say the status is 400 / 422 and does not say a verbatim resend repeats the failure (the engine also rules input length out for statuses such as 401 / 429 / 500) — triage on `errorCode`. Absent = no such judgment.'
23855
23720
 
23856
- ToolApprovalDecision:
23857
- type: string
23858
- enum: [allow, allow_session, deny]
23859
- description: >
23860
- The human's decision on a live tool-approval gate (server parseToolApprovalDecision,
23861
- tool-approval.ts — CLOSED 3-word set; anything else is a 400). `allow_session` = allow AND
23862
- remember for this session's category (fs-write tools share ONE category: approving Write covers
23863
- Edit/NotebookEdit; other tools are per-tool) — the CC "don't ask again this session" semantic.
23864
-
23865
23721
  ConfigCatalog:
23866
23722
  type: object
23867
23723
  description: >
@@ -23993,7 +23849,7 @@ components:
23993
23849
  type: string
23994
23850
  enum: [pending, decided, parked, void]
23995
23851
  description: >
23996
- `state` of GET /v1/tool-approvals/{id} (server >= 7.133.0), a CLOSED four-word set — read it exhaustively: `pending` = a live registration on this replica is waiting (answer door open);
23852
+ `state` of GET /v1/tasks/{taskId}/asks/{askId} (server >= 7.133.0), a CLOSED four-word set — read it exhaustively: `pending` = a live registration on this replica is waiting (answer door open);
23997
23853
  `decided` = the row is DECIDED; `parked` = PARKING / PARKED (a late answer redeems the parked card); `void` = DENIED / VOID (nobody decided it, the answer has nowhere to land).
23998
23854
  ApprovalsStreamReadErrorCode:
23999
23855
  type: string
@@ -24006,7 +23862,7 @@ components:
24006
23862
  ToolApprovalReadProjection:
24007
23863
  type: object
24008
23864
  description: >
24009
- The row projection shared by the three non-`pending` arms of GET /v1/tool-approvals/{id} (server >= 7.133.0): a SUBSET of the `livePending[]` row keys — one reader, one key set. `frame` = the disconnect-replay
23865
+ The row projection shared by the three non-`pending` arms of GET /v1/tasks/{taskId}/asks/{askId} (server >= 7.133.0): a SUBSET of the `livePending[]` row keys — one reader, one key set. `frame` = the disconnect-replay
24010
23866
  opening frame (an `approval_request` frame; ABSENT when the card cannot be read back — never invented).
24011
23867
  required: [approvalId, ts, expiresAtMs]
24012
23868
  additionalProperties: true
@@ -24019,7 +23875,7 @@ components:
24019
23875
  frame: { $ref: '#/components/schemas/ApprovalRequestFrame' }
24020
23876
  ToolApprovalReadBody:
24021
23877
  description: >
24022
- The 200 body of GET /v1/tool-approvals/{id} (server >= 7.133.0) — a four-arm union discriminated by `state` (closed, read it exhaustively): `pending` = a live registration on this replica is waiting
23878
+ The 200 body of GET /v1/tasks/{taskId}/asks/{askId} (server >= 7.133.0) — a four-arm union discriminated by `state` (closed, read it exhaustively): `pending` = a live registration on this replica is waiting
24023
23879
  (the `livePending[]` row + `state`; answer door open); `decided` = the row is DECIDED (`decision` / `decidedAtMs` / `decisionNote?`, the same three keys as the late-replay body); `parked` = PARKING / PARKED
24024
23880
  (a late answer redeems the parked card; `decidePath?` points at the durable decision path); `void` = DENIED / VOID (nobody decided it, the answer has nowhere to land; `cause?` is the same cause word as the
24025
23881
  late-answer 404's, see ToolApprovalNotPendingCause).
@@ -24058,7 +23914,7 @@ components:
24058
23914
  required: [state, decision, decidedAtMs]
24059
23915
  properties:
24060
23916
  state: { type: string, enum: [decided] }
24061
- decision: { type: string, enum: [allow, deny] }
23917
+ decision: { $ref: '#/components/schemas/ApprovalAskDecision' }
24062
23918
  decidedAtMs: { type: integer }
24063
23919
  decisionNote: { type: string }
24064
23920
  ToolApprovalReadParked:
@@ -24089,7 +23945,7 @@ components:
24089
23945
  required: [reason]
24090
23946
  properties:
24091
23947
  reason: { $ref: '#/components/schemas/ToolApprovalReopenReason' }
24092
- decision: { type: string, enum: [allow, deny] }
23948
+ decision: { $ref: '#/components/schemas/ApprovalAskDecision' }
24093
23949
  decidedAtMs: { type: integer }
24094
23950
  decisionNote: { type: string }
24095
23951
  ToolApprovalReadVoid:
@@ -24102,192 +23958,6 @@ components:
24102
23958
  cause:
24103
23959
  allOf: [{ $ref: '#/components/schemas/AskRowEndingCause' }]
24104
23960
  description: 'The row''s recorded ending cause (absent for a legacy row with no cause written — never invented).'
24105
- ToolApprovalRespondApplied:
24106
- type: object
24107
- description: >
24108
- The APPLIED arm of the 200 ack of POST /v1/tool-approvals/{id}/respond (server tool-approval.ts — exact
24109
- shape, `decision` echoed): the decision settled a live gate. Owner-gated with a 404 and NO existence oracle: non-owner and
24110
- unknown/settled/expired/wrong-replica ids are indistinguishable. See ToolApprovalRespondAck for the replayed arm.
24111
- # 封闭(census 批2 第三段,2026-07-30):铸造点 `tool-approval.ts` 三恒在键 + 两条件键
24112
- # (rememberApplied/updatedInputForwarded 的条件展开就在同一行字面量里)。
24113
- # #154 车二(2026-08-10):`persistRuleAfterDecision` 的 `withFlag()` 在同一个体上再盖两个条件键
24114
- # (rulePersisted 恒在、ruleRefusal 仅失败时)—— 键集从 5 升 7,**封闭性不动**(additive 不许把
24115
- # census 闭合的口悄悄捅开)。
24116
- # #229(2026-08-12):`finishRespond` 的同一行字面量再加一个条件键 `noteRecorded`(仅请求带 `note`
24117
- # 时在场)—— 键集 7 升 8,封闭性同样不动。
24118
- required: [approvalId, delivery, decision]
24119
- additionalProperties: false
24120
- properties:
24121
- approvalId: { type: string }
24122
- delivery: { type: string, enum: [applied] }
24123
- decision: { $ref: '#/components/schemas/ToolApprovalDecision' }
24124
- consumerState:
24125
- type: string
24126
- enum: [absent]
24127
- description: >-
24128
- server >= 7.133.0, TRUE-ONLY: no engine leg on THIS replica was waiting for the ask this answer settled — the same bit, with the same meaning, as `LivePendingRow.consumerState` and the
24129
- durable decision ack's. Present <=> the answered entry was ADOPTED from the ask ledger at start-up. The decision lands on the row as usual, but nothing running here resumes because of it — read the run
24130
- surface; do not read the 200 as "the run continued". Absent = a local engine leg was waiting, or an older server.
24131
- rememberApplied:
24132
- type: boolean
24133
- description: >
24134
- server 1.239 ([1392]②): on allow_session, an honest echo of whether the grant was REALLY
24135
- recorded (true = landed in the bridge store; false = no sessionId, could not record — do not
24136
- render "session-wide allowed"). Omitted on non-allow_session decisions and on older servers.
24137
- 🔴 server >= 7.116.0: ALWAYS `false` on a card that carries `rememberRefused: true` (an engine `Skill` card etc.) — the decision
24138
- applies once and nothing is remembered (existing key, not a new one).
24139
- updatedInputForwarded:
24140
- type: boolean
24141
- description: >
24142
- server 1.241 ([1458]): present (true) when an allow-family decision carried `updatedInput` and
24143
- the server forwarded the edited args to the engine — forwarded, not necessarily applied
24144
- (consumption depends on the core OnAsk object arm). Omitted on deny / no edit / older servers.
24145
- rulePersisted:
24146
- type: boolean
24147
- description: >
24148
- server #154 车二, ADDITIVE: whether the `persistRule` this respond carried actually landed in the
24149
- rule store.
24150
-
24151
- 🔴 A FAILED PERSISTENCE NEVER FLIPS THE DECISION — the person's "allow this once" already took
24152
- effect and reached the engine, so the honest shape is 200 + `rulePersisted: false` + `ruleRefusal`,
24153
- NOT a 4xx. Render it as "allowed, but 'don't ask again' was not saved" — never as a failed approval.
24154
- Omitted when the respond carried no `persistRule`, and on older servers; ABSENT is not `false`.
24155
- ruleRefusal:
24156
- allOf: [{ $ref: '#/components/schemas/RuleRefusalReason' }]
24157
- description: >
24158
- server #154 车二, ADDITIVE: the MACHINE-READABLE reason when `rulePersisted` is false (closed
24159
- vocabulary). Always absent when `rulePersisted` is true. Branch on it to separate "try again on the
24160
- next ask" (`rule_input_edited`) from "there was nothing redeemable on this card"
24161
- (`rule_lane_unavailable`). 🔴 `rule_lane_unavailable` covers four causes, two of them per-card — do
24162
- NOT read it as "this deployment has no rule lane" (see the RuleRefusalReason schema).
24163
- persistedRule:
24164
- type: string
24165
- maxLength: 512
24166
- description: >
24167
- server >= 7.44.0 (#340), ADDITIVE — FREE-TEXT ARM ONLY: the CANONICAL SPELLING of the rule that
24168
- actually landed (core may normalise `Bash(adb *)` into `Bash(adb:*)`). Echo THIS back to the
24169
- person, not the bytes they typed into the box.
24170
-
24171
- 🔴 ABSENCE HAS THREE MEANINGS, none of them "the rule is gone": (1) this respond used the
24172
- CANDIDATE arm — the server's `editedArmEcho` is the single mint point for this key, so a candidate
24173
- respond's ack is byte-for-byte unchanged; (2) nothing landed (read `rulePersisted` / `ruleRefusal`);
24174
- (3) the respond carried no `persistRule` at all.
24175
- persistedRules:
24176
- type: array
24177
- items: { type: string, maxLength: 512 }
24178
- description: >
24179
- server >= 7.46.0 (design/377), ADDITIVE — BATCH ARM ONLY: the canonical text of EVERY member that
24180
- landed in this one redemption. A conjunctive batch is one yes for the whole set; if any member is
24181
- refused the ack is `rulePersisted:false` + `ruleRefusal:"redeem-refused"` and the members that DID
24182
- land are not rolled back (their dots are on record and a re-triggered card dedupes idempotently).
24183
-
24184
- 🔴 ORDER: from server 7.48.0 on, the DISPLAY order of the requested offer
24185
- (`ruleOffers[batchOfferIndex].rules`) is a PROMISE, not a coincidence; on 7.46-7.47 it inherited the
24186
- server's re-minted walk order instead. For per-entry attribution read `persistedRuleAnchors`
24187
- rather than inferring it from position.
24188
- 🔴 Not the same thing as `persistedRule`: the singular key belongs to the single/edited arm, the
24189
- plural one to the batch arm, and the two never appear together.
24190
- persistedRuleAnchors:
24191
- type: array
24192
- items: { $ref: '#/components/schemas/PersistedRuleAnchor' }
24193
- description: >
24194
- server >= 7.48.0 (P-39), ADDITIVE and with NO capability bit — the per-entry, self-describing
24195
- attribution anchors for `persistedRules`, INDEX-ALIGNED with it.
24196
-
24197
- Minted ONLY on the batch arm (the single/edited arm has no member coordinates to speak of), and
24198
- omitted WHOLESALE whenever the server cannot prove attribution — an honest absence, never a
24199
- fabricated index. A consumer that sees it absent knows this ack can only be read positionally, and
24200
- `persistedRules` itself is unchanged to the byte (older consumers ignore the unknown key).
24201
- noteRecorded:
24202
- type: boolean
24203
- description: >
24204
- server #229 (>=7.15.0), ADDITIVE: whether the `note` this respond carried actually landed in the
24205
- durable ask row.
24206
-
24207
- 🔴 IT REPORTS THE STORE'S REAL RESULT, not "does this deployment have a store". `false` has three real
24208
- causes: (1) this deployment keeps no durable ask ledger (live-card-only shape — there is nowhere to
24209
- write it), (2) the store was flapping at the moment the decision settled (the server's D5
24210
- fail-open — THE DECISION STILL STANDS, only the reason was not recorded), or (3) a concurrent respond
24211
- carrying the SAME decision but a DIFFERENT note reached the row first — the decision is final (so the
24212
- answer is still 200), but the text on the row is somebody else's. So `true` is the only value
24213
- that lets you tell a person "the reason is in the audit log", and `false` must NOT be rendered as a
24214
- failed approval (same discipline as `rulePersisted`).
24215
- Omitted when the respond carried no `note`, and on older servers. 🔴 ABSENT is not `false`: an older
24216
- server ignores the unknown key and still answers 200, so "this build does not know `note`" is only
24217
- distinguishable via `capabilities.approvalDecisionNote` — probe that bit before sending `note`.
24218
-
24219
- ToolApprovalRespondReplayed:
24220
- type: object
24221
- description: >
24222
- The REPLAYED arm of the 200 ack of POST /v1/tool-approvals/{id}/respond: the ask was already DECIDED
24223
- (by anyone) when this answer arrived, so the server replays the FIRST decision — `decision` is the row's two-word
24224
- value (`allow_session` was folded to `allow` when it landed), `decidedAtMs` the first decision's clock,
24225
- `decisionNote` only when the row has one, `rememberApplied: false` only when THIS request asked `allow_session`.
24226
- No `delivery` key: nothing was delivered. A reversed late answer is the same replay — not a 409, nothing re-judged.
24227
- (server src/tool-approval.ts `replayDecidedAsk`; sdk 23.0.0 declares it, the shape predates it.)
24228
- required: [approvalId, askId, idempotent, decision, decidedAtMs]
24229
- additionalProperties: false
24230
- properties:
24231
- approvalId: { type: string }
24232
- askId: { type: string }
24233
- idempotent: { type: boolean, enum: [true] }
24234
- decision: { type: string, enum: [allow, deny] }
24235
- decidedAtMs: { type: integer }
24236
- decisionNote: { type: string }
24237
- rememberApplied: { type: boolean, enum: [false] }
24238
- noteRecorded: { type: boolean, description: 'server >= 7.133.0 (two doors, one shape): present ONLY when THIS request carried a `note`; `true` <=> the row''s text is verbatim what this request submitted, `false` = not confirmed (another reason is on the row / no store / read-back failed). A late answer''s note never overwrites the first decision''s reason — that is `decisionNote`.' }
24239
- rulePersisted: { type: boolean, enum: [false], description: 'server >= 7.133.0: present (as `false`) only when this late answer carried `persistRule`: the rule is redeemed on the FIRST decision only, a late answer never saves one.' }
24240
- ruleRefusal:
24241
- type: string
24242
- enum: [rule_lane_unavailable]
24243
- description: 'with `rulePersisted: false`; on this arm always `rule_lane_unavailable` (the only word the published late-answer path mints).'
24244
- ToolApprovalRespondParkedRedeemed:
24245
- type: object
24246
- description: >
24247
- The PARKED-REDEEMED arm of the 200 ack of POST /v1/tool-approvals/{id}/respond (server >= 7.133.0; server tool-approval.ts `redeemParkedAsk` /
24248
- `replayRedeemReceipt`): the card's window had run out and the ask moved to background waiting (PARKED); this late answer — on another replica or after a restart —
24249
- goes through the EXISTING durable redemption leg (the same CAS as POST /v1/approvals/{sessionId}/decide) instead of the old 404 `tool_approval.not_pending`
24250
- (`cause: unknown_or_other_replica`). Body = the redemption leg's receipt (ApprovalDecisionResult's keys — `status` / `taskId` / `sessionId` / ... as they come) plus the three keys
24251
- this door adds: `approvalId` / `askId` (the same 64-hex value) and the discriminant `accepted`. `decision` is the two-word direction on the REPLAY form only (`allow` / `deny`,
24252
- `allow_session` folded to `allow`); `rememberApplied` appears only when this request asked `allow_session` and this is the FIRST redemption (server >= 7.147.0: the leg's own boolean answer; <= 7.146.x always `false`; the replay form carries none);
24253
- `rulePersisted` / `ruleRefusal` / `persistedRule*` are the `persistRule` outcome on the redemption leg (a rule that fails to store NEVER flips the verdict).
24254
- `idempotent: true` appears only on the REPLAY (the same already-redeemed card answered again returns the first redemption's receipt).
24255
- CLOSED like its two sibling arms (the census keeps this op's 200 body closed): the key set is ApprovalDecisionResult's own keys (one source per shape, by `$ref`) plus the added ones.
24256
- required: [approvalId, askId, accepted]
24257
- additionalProperties: false
24258
- properties:
24259
- decisionCommitted: { type: boolean, enum: [true], description: 'server >= 7.138.0 - settlement evidence carried over from the redeemed decide receipt (present on the late-redeemed card and on a same-direction retry; a reverse-direction retry replay omits it). Absent = read as "not committed".' }
24260
- checkpointId: { type: string, description: 'server >= 7.138.0 - only alongside `decisionCommitted`: the gate identity of the redeemed row; absent when unreadable.' }
24261
- approvalId: { type: string }
24262
- askId: { type: string }
24263
- accepted: { type: string, enum: [parked_redeemed] }
24264
- status: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/status' }
24265
- taskId: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/taskId' }
24266
- sessionId: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/sessionId' }
24267
- bindingEnforced: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/bindingEnforced' }
24268
- decision: { type: string, description: 'REPLAY form: `allow` / `deny` (`allow_session` folded to `allow`). FIRST redemption: whatever the redemption leg''s own receipt says (`approve` / `deny` today) — read it open.' }
24269
- errorCode: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/errorCode' }
24270
- errorMessage: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/errorMessage' }
24271
- retriable: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/retriable' }
24272
- idempotent: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/idempotent' }
24273
- executionOutcome: { $ref: '#/components/schemas/ApprovalDecisionResult/properties/executionOutcome' }
24274
- rememberApplied: { type: boolean, description: 'Present only when this request asked `allow_session` AND this is the FIRST redemption (not the replay form). server >= 7.147.0: the redemption leg''s own answer (true = it remembered the session grant, false = this once only); a server <= 7.146.x always answered false here ("a parked redemption cannot remember a session grant").' }
24275
- rulePersisted: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/rulePersisted' }
24276
- ruleRefusal: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/ruleRefusal' }
24277
- persistedRule: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/persistedRule' }
24278
- persistedRules: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/persistedRules' }
24279
- persistedRuleAnchors: { $ref: '#/components/schemas/ToolApprovalRespondApplied/properties/persistedRuleAnchors' }
24280
- ToolApprovalRespondAck:
24281
- description: >
24282
- The 200 ack of POST /v1/tool-approvals/{id}/respond — a discriminated union: the decision was APPLIED to a live
24283
- gate (ToolApprovalRespondApplied, `delivery: "applied"`) or the ask was already decided and the first decision is
24284
- REPLAYED (ToolApprovalRespondReplayed, `idempotent: true`), or (server >= 7.133.0, sdk 25.0.0) the answer REDEEMED a PARKED card through the durable redemption
24285
- leg (ToolApprovalRespondParkedRedeemed, `accepted: "parked_redeemed"`). The discriminants are `delivery` / `idempotent` / `accepted` (a replayed redemption carries
24286
- BOTH `accepted: "parked_redeemed"` and `idempotent: true` — read `accepted` first).
24287
- oneOf:
24288
- - $ref: '#/components/schemas/ToolApprovalRespondApplied'
24289
- - $ref: '#/components/schemas/ToolApprovalRespondReplayed'
24290
- - $ref: '#/components/schemas/ToolApprovalRespondParkedRedeemed'
24291
23961
  UsageMetric:
24292
23962
  type: string
24293
23963
  enum: [tasks, tokensIn, tokensOut, costUsd]