@sema-agent/sdk 37.0.0 → 38.1.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 (61) hide show
  1. package/README.md +133 -3
  2. package/dist/client.d.ts +12 -1
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +16 -1
  5. package/dist/client.js.map +1 -1
  6. package/dist/errors.d.ts +78 -86
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +43 -19
  9. package/dist/errors.js.map +1 -1
  10. package/dist/events.d.ts +46 -6
  11. package/dist/events.d.ts.map +1 -1
  12. package/dist/events.js +5 -0
  13. package/dist/events.js.map +1 -1
  14. package/dist/health.d.ts +51 -9
  15. package/dist/health.d.ts.map +1 -1
  16. package/dist/health.js +2 -26
  17. package/dist/health.js.map +1 -1
  18. package/dist/index.d.ts +13 -9
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +7 -4
  21. package/dist/index.js.map +1 -1
  22. package/dist/resources/approvals.d.ts +2 -2
  23. package/dist/resources/leader.d.ts +11 -1
  24. package/dist/resources/leader.d.ts.map +1 -1
  25. package/dist/resources/leader.js +10 -0
  26. package/dist/resources/leader.js.map +1 -1
  27. package/dist/resources/principal-inbox.d.ts +4 -0
  28. package/dist/resources/principal-inbox.d.ts.map +1 -1
  29. package/dist/resources/principal-inbox.js +4 -0
  30. package/dist/resources/principal-inbox.js.map +1 -1
  31. package/dist/resources/rules.d.ts +2 -2
  32. package/dist/resources/rules.js +1 -1
  33. package/dist/resources/runs.d.ts +25 -46
  34. package/dist/resources/runs.d.ts.map +1 -1
  35. package/dist/resources/runs.js +38 -53
  36. package/dist/resources/runs.js.map +1 -1
  37. package/dist/resources/session-sync.d.ts +5 -0
  38. package/dist/resources/session-sync.d.ts.map +1 -1
  39. package/dist/resources/session-sync.js +5 -0
  40. package/dist/resources/session-sync.js.map +1 -1
  41. package/dist/resources/sessions.d.ts +9 -3
  42. package/dist/resources/sessions.d.ts.map +1 -1
  43. package/dist/resources/sessions.js +8 -2
  44. package/dist/resources/sessions.js.map +1 -1
  45. package/dist/resources/tool-approvals.d.ts +12 -2
  46. package/dist/resources/tool-approvals.d.ts.map +1 -1
  47. package/dist/resources/tool-approvals.js +9 -1
  48. package/dist/resources/tool-approvals.js.map +1 -1
  49. package/dist/settings.d.ts +4 -8
  50. package/dist/settings.d.ts.map +1 -1
  51. package/dist/settings.js.map +1 -1
  52. package/dist/transport.d.ts +4 -1
  53. package/dist/transport.d.ts.map +1 -1
  54. package/dist/transport.js +6 -2
  55. package/dist/transport.js.map +1 -1
  56. package/dist/types.d.ts +145 -48
  57. package/dist/types.d.ts.map +1 -1
  58. package/dist/types.js +35 -7
  59. package/dist/types.js.map +1 -1
  60. package/openapi.yaml +392 -317
  61. package/package.json +2 -2
package/openapi.yaml CHANGED
@@ -479,7 +479,11 @@ paths:
479
479
  '409':
480
480
  description: >-
481
481
  Conflict (ConflictError). 409 — session already has an active run (`conflict.session_active_run`, `activeTaskId`,
482
- `pendingGate`), OR an idempotency/session-CAS conflict. Server >= 7.140.0, zero-work submissions only: `config.read_deny_floor_unkept` — the
482
+ `pendingGate`), OR an idempotency/session-CAS conflict. Server >= 7.148.0 adds two: `conflict.claim_lost` — the claim
483
+ re-check just before start found this run already settled by a death verdict (reaper, an observation, or a claim conflict),
484
+ nothing ran; and, zero-work only on this synchronous leg, `config.skill_deny_unreadable` — a named operator skill's deny-side
485
+ entry read as empty to the engine (the operator fixes that skill; resend unchanged; before 7.148.0 this was a 200 + failed body;
486
+ `POST /v1/runs` and the stream keep 2xx and land the code on the run row). Server >= 7.140.0, zero-work submissions only: `config.read_deny_floor_unkept` — the
483
487
  deployment sets `READ_DENY_FLOOR_REQUIRED=true` and this run's read-deny table has rows while its execution environment does not keep the byte floor (all
484
488
  seven lanes today): refused at prepare, no command started, zero tokens. NOT a request error — the deployment state conflicts with it (use an execution
485
489
  environment that keeps the floor, or the operator drops the knob; then the run proceeds and each run raises one operator notice with the same code, off the
@@ -982,7 +986,7 @@ paths:
982
986
  evicts an already-accepted instruction to make room. Opposite handling from not_running: the
983
987
  text is still valid — let the run resume (which drains the queue) or reduce concurrent steers,
984
988
  then resend.
985
- errorCode "steering.duplicate_input_id" (server >=7.3.0 / core 5.14.0; server >= 7.118.0 adds `detail.differs`, a
989
+ errorCode "steering.duplicate_input_id" (server >=7.3.0 / core 5.14.0; server >= 7.118.0 adds `differs` — nested `detail.differs` on 7.118.0–7.147.x, a ROOT key since 7.148.0 —, a
986
990
  non-empty subset of SteerReplayFacet — contains `text` ⇒ fresh key; otherwise the same instruction, replay with the
987
991
  original values and do NOT change the key) — the Idempotency-Key you
988
992
  sent is already parked with DIFFERENT steering content (same key + same content is an idempotent
@@ -1058,6 +1062,8 @@ paths:
1058
1062
  data root not writable / SQL unreachable). NOTHING reached the engine. Client action: retry the SAME
1059
1063
  text later (same Idempotency-Key is fine — nothing was accepted); unlike every other `steering.*`
1060
1064
  code this is not a content / key / resume problem. SDK: `SteeringLedgerUnavailableError`.
1065
+ Also server >= 7.148.0: `state.resume_context_unreadable` — a steer on a TERMINAL run could not read the run's stored resume
1066
+ context (store fault): nothing was queued (a card minted before the re-check is withdrawn); resend the same request later.
1061
1067
  content:
1062
1068
  application/json:
1063
1069
  schema: { $ref: '#/components/schemas/ErrorResponse' }
@@ -1136,71 +1142,65 @@ paths:
1136
1142
  content:
1137
1143
  application/json:
1138
1144
  schema: { $ref: '#/components/schemas/ErrorResponse' }
1145
+ '503':
1146
+ description: >
1147
+ server >= 7.148.0: `state.resume_context_unreadable` — reading this run's stored resume context FAILED (store connection
1148
+ fault / missing table / denied grant / unrecognised store error). Transient and nothing ran: the card stays pending and the row
1149
+ is untouched — resend the same request later (if it keeps failing, the deployment's store needs an operator).
1150
+ `409 conflict.resume_context_unavailable` keeps meaning "the context is really gone"; a fault of the server's own is `500 internal.error`.
1151
+ content:
1152
+ application/json:
1153
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
1139
1154
  /v1/runs/{taskId}/interrupt:
1140
1155
  parameters:
1141
1156
  - $ref: '#/components/parameters/PrincipalHeader'
1142
1157
  - $ref: '#/components/parameters/TaskIdPath'
1143
- # server 收法与 steer 逐字同配方(scoped 口径 + sha256 定长 + `idem-` 前缀)收成 core `inputId`,
1144
- # 🔴 且 text 形 **202 回执的 `messageId` ≡ 这个 inputId** —— `task.turn_interrupted` 帧的
1145
- # `detail.inputId` 用同一个值,回执与帧对得上(并发两刀分得清哪刀是谁的)。与 steer 的缺席臂刻意
1146
- # 不同:本 op **无 key 也现铸 uuidv7 并下传**(每请求各是各的指令,零去重域,重试语义与旧形一致)。
1147
- # bare 形上本头是 no-op(没有输入帧可去重;halt 天然幂等,重复调用引擎自答 turnCut:false)。
1148
- # ⚠️ 键不是重试许可证(steer 同纪律):AT-MOST-ONCE,SDK 不自动铸也不因有键而重试。
1149
- - $ref: '#/components/parameters/IdempotencyKey'
1150
1158
  post:
1151
1159
  tags: [runs]
1152
1160
  operationId: runsInterrupt
1153
- x-status: live # core #504 / server 7.52.0 F1 全弧(A-075.78 SDK 半场,2026-08-30)。
1154
- summary: Interrupt the in-flight TURN of a durable run — cut (+ optionally steer); bare form = halt.
1155
- description: >
1156
- core #504 — the TURN-level verb that run-level cancel is not: finished tools keep their REAL results,
1157
- un-started ones settle as interrupted pairs, in-flight tools are NOT collateral. TWO shapes,
1158
- discriminated by `text` presence.
1159
- WITH text = cut + steer: the in-flight turn is cut and the text goes to the FRONT of the queue — the
1160
- `"now"` tier is the VERB's semantics, not a body field (the steer op's own `priority` is a separate
1161
- input: it takes effect only on a server whose `Capabilities.fleet.steerPriority` reads `"engine"`) —
1162
- and the run CONTINUES. 202 `{taskId, status, delivery:"queued-immediate", messageId, note}`;
1163
- `messageId` ≡ the engine inputId, and a real cut is proven ONLY by a `task.turn_interrupted` event on
1164
- the run stream whose `detail.inputId` matches it (core: no false interrupt claims — every real cut
1165
- emits one, an idle cut emits none and the text lands at the next turn boundary).
1166
- BARE form (body `{}` / empty / literal null) = halt (the CC Esc semantic, cut + STOP): the same cut,
1167
- but the run CLOSES at this human-made boundary as `status:"completed"` with
1168
- `TaskResult.haltedByUser:true`; the session continues normally (submit the next objective on the same
1169
- session). 202 `{taskId, status, turnCut, note}` — deliberately NO `delivery`/`messageId` (no input
1170
- frame exists to correlate; the frame's `detail.cause:"user_halt"` arm carries no inputId). A bare body
1171
- with EXTRA keys is a 400 — a typo'd `{txt:…}` must not silently become a verb that stops the run.
1172
- LIVE-ONLY, no park fallback (the root difference from steer — a turn is an in-process concept, a
1173
- parked run has no in-flight turn to cut). Authorization = the cancel door (owner-or-explicit-operator:
1174
- whoever may collaterally cancel the whole run holds the strictly smaller power to cut one turn).
1161
+ x-status: live
1162
+ summary: Halt the in-flight TURN of a durable run — cut it and stop the run at that boundary.
1163
+ description: >
1164
+ The TURN-level halt (the CC Esc semantic: cut + STOP) — the verb that run-level cancel is not: finished tools keep their REAL results,
1165
+ un-started ones settle as interrupted pairs, in-flight tools are NOT collateral. The in-flight turn is cut and the run CLOSES at this
1166
+ human-made boundary as `status:"completed"` with `TaskResult.haltedByUser:true`; the session continues normally (submit the next
1167
+ objective on the same session). A `task.turn_interrupted` event with `detail.cause:"user_halt"` marks each real cut (it carries no `inputId`).
1168
+ 🔴 THIS DOOR TAKES NO FIELDS (server >= 7.148.0). The body must be empty — no body, `{}` or literal `null`; any top-level key (`text`
1169
+ included) or a non-object body is 400 `request.body_shape`, judged BEFORE the run lookup, so every run state / owner / existence answers
1170
+ the same 400. To send the run a message, use `POST /v1/runs/{taskId}/steer` with `priority:"now"` — the one door for "cut the in-flight turn
1171
+ and say something": it cuts the in-flight turn first, then the run continues with that message, and on a parked or ended run it parks the message
1172
+ instead of refusing. server <= 7.147.x also accepted `{ text }` on this door (a second verb with its own 202 receipt); that form is retired.
1173
+ 202 `{taskId, status, turnCut, note}` — deliberately NO `delivery`/`messageId` (no input frame exists to correlate and no input id to deduplicate;
1174
+ the `Idempotency-Key` header is not read by this door — a repeat halt is naturally idempotent and answers `turnCut:false` once the stop is latched).
1175
+ A halt that cuts nothing and stops nothing consumes nothing (server >= 7.74.0): it can race the run's natural last moments, and then the run's own
1176
+ ending stands — the result does NOT carry `haltedByUser`, and the only trace of that halt is a `task.halt_unconsumed` engine notice.
1177
+ LIVE-ONLY, no park fallback (a turn is an in-process concept — a parked run has no in-flight turn to cut). Authorization = the cancel door
1178
+ (owner-or-explicit-operator: whoever may collaterally cancel the whole run holds the strictly smaller power to cut one turn).
1175
1179
  requestBody:
1176
1180
  required: false
1177
1181
  content:
1178
1182
  application/json:
1179
1183
  schema:
1180
- type: object
1181
- # text 形对多余键宽容(冻结契约,steer 同族);bare 形零键纪律由 400 执法(见下)。
1184
+ type: [object, 'null']
1185
+ # 这扇门不收字段:体必须为空(不发体 / `{}` / `null`);带任何键由 400 `request.body_shape` 执法(见下)。
1182
1186
  additionalProperties: false
1183
- properties:
1184
- text:
1185
- type: string
1186
- description: >-
1187
- Optional. Present ⇒ cut + steer (non-empty required; present-but-empty/non-string = 400).
1188
- Absent ⇒ bare halt — the body must then be EXACTLY `{}` (zero keys), empty, or null.
1187
+ description: >-
1188
+ Empty. The halt takes no fields — no body, `{}` or literal `null`; a key (`text` included) is 400. To send the run a message, POST /v1/runs/{taskId}/steer
1189
+ with `priority:"now"`.
1189
1190
  responses:
1190
1191
  '202':
1191
1192
  description: >-
1192
- Accepted — two shapes share this code; branch on which arm's keys are present (`delivery` vs
1193
- `turnCut`), NOT on the status code. See InterruptReceipt.
1193
+ Accepted — the halt receipt `{taskId, status, turnCut, note}`; `turnCut` says whether THIS call cut a live turn. See InterruptReceipt.
1194
1194
  content:
1195
1195
  application/json:
1196
1196
  schema: { $ref: '#/components/schemas/InterruptReceipt' }
1197
1197
  '400':
1198
1198
  description: >-
1199
1199
  errorCode "request.invalid_json" — the body did not parse as JSON;
1200
- errorCode "request.body_shape" — a scalar/array body, a bare body with EXTRA keys, or `text`
1201
- present but empty/non-string (the message is the literal accepted shape: `{}` for bare halt, or
1202
- `{ text: string (non-empty) }` for cut + steer). Malformed is NEVER silently folded into halt —
1203
- that would swap the caller's verb for one that stops the run.
1200
+ errorCode "request.body_shape" (server >= 7.148.0) — the body carried any top-level key (every key, `text` included, is named in `unknownKeys`; `unsupportedKeys` is always `[]`) or was not an object.
1201
+ The message is the fixed sentence: body must be empty (no body, {} or null): this door is halt — it cuts the in-flight turn and stops the run at that boundary — and takes no fields; to send the run a message,
1202
+ POST /v1/runs/:id/steer with priority:"now" (it cuts the in-flight turn first, then the run continues with that message).
1203
+ Judged BEFORE the run lookup: the engine is never called and any run state / owner / existence answers the same 400.
1204
1204
  content:
1205
1205
  application/json:
1206
1206
  schema: { $ref: '#/components/schemas/ErrorResponse' }
@@ -1208,9 +1208,8 @@ paths:
1208
1208
  '404': { $ref: '#/components/responses/NotFound' }
1209
1209
  '409':
1210
1210
  description: >-
1211
- errorCode "interrupt.nothing_in_flight" — the run is PARKED on a pending decision: no in-flight
1212
- turn to cut, and deliberately NO park fallback — to deliver input to a parked run use
1213
- POST /v1/runs/{taskId}/steer (it parks onto the checkpoint and injects on resume).
1211
+ errorCode "interrupt.nothing_in_flight" — the run is PARKED on a pending decision: there is no in-flight turn to interrupt; answer that decision to let the run resume,
1212
+ or POST /v1/runs/{taskId}/cancel to stop the run. (server <= 7.147.x pointed this sentence at the steer door.)
1214
1213
  errorCode "interrupt.not_held" — the run is running but THIS replica holds no live interruptible
1215
1214
  turn face: live on ANOTHER replica (stated only when the row's instanceId PROVES it — the message
1216
1215
  then says to resend there), or a verify/cascade execution lane which exposes no stream (those legs
@@ -1218,37 +1217,17 @@ paths:
1218
1217
  Use POST /v1/runs/{taskId}/cancel for a run-level stop.
1219
1218
  errorCode "steering.not_running" (reused verbatim) — terminal / not accepting, or the stream
1220
1219
  settled in the race window ("run just finished on this replica — no in-flight turn to interrupt").
1221
- errorCode "steering.duplicate_input_id" (server >= 7.118.0: read `detail.differs` first, see SteerReplayFacet) — this Idempotency-Key was already accepted with DIFFERENT
1222
- content or at a DIFFERENT tier (core's replay identity includes the normalized tier: the same key
1223
- that once went through the steer door (default tier) then hits this door (now) is refused —
1224
- "idempotent success without the cut" would be a dispositive lie). Reissue with a fresh key.
1225
1220
  content:
1226
1221
  application/json:
1227
1222
  schema: { $ref: '#/components/schemas/ErrorResponse' }
1228
1223
  '413':
1229
1224
  description: >-
1230
1225
  errorCode "request.payload_too_large" — the worker's global body cap (`MAX_BODY`, 8 MiB), raised
1231
- by the shared JSON reader (the steer op's 413 note applies verbatim; no separate text cap here).
1226
+ by the shared JSON reader (the steer op's 413 note applies verbatim).
1232
1227
  content:
1233
1228
  application/json:
1234
1229
  schema: { $ref: '#/components/schemas/ErrorResponse' }
1235
- '422':
1236
- description: >-
1237
- TWO codes, text form only (the bare form skips content validation — no text reaches the model,
1238
- and core's userPromptSubmit gate has no jurisdiction over a halt):
1239
- errorCode "steering.invalid_content" — the text carried a control-plane escape (e.g.
1240
- </system-reminder>); validated BEFORE the row lookup, and core re-rejects on the live leg.
1241
- errorCode "steering.blocked_by_hook" (S-51 / core 5.62 design/373 §4.3) — the deployment's
1242
- userPromptSubmit hook refused this input; block / hook timeout / hook crash are ONE code,
1243
- FAIL-CLOSED. The input was NOT accepted (no human_input frame, the inputId is not spent) — a
1244
- retry with different content is legitimate. The hook's own bounded reason is passed through
1245
- verbatim (first-hand triage material). SDK: falls on the SteeringError base via the `steering.`
1246
- prefix family (`.errorCode` carries the discriminator; same registration as
1247
- steering.parked_input_blocked).
1248
- content:
1249
- application/json:
1250
- schema: { $ref: '#/components/schemas/ErrorResponse' }
1251
- '429': { $ref: '#/components/responses/RateLimited' } # rateLimited||quotaExceeded||leaseDenied — steer 同门(mutating + injects into a model run)
1230
+ '429': { $ref: '#/components/responses/RateLimited' } # rateLimited||quotaExceeded||leaseDenied — steer 同门(mutating + stops a model run)
1252
1231
  '501':
1253
1232
  description: >-
1254
1233
  errorCode "capability.run_store_required" — no durable run store wired
@@ -1257,16 +1236,6 @@ paths:
1257
1236
  content:
1258
1237
  application/json:
1259
1238
  schema: { $ref: '#/components/schemas/ErrorResponse' }
1260
- '503':
1261
- description: >-
1262
- errorCode "steering.ledger_unavailable" (server >=7.110.0, S-928) — the text form rides the same
1263
- engine verb as a live steer, so the same ledger write happens BEFORE the 202 `queued-immediate`; when
1264
- the ledger cannot be written the interrupt is refused and NOTHING reached the engine (the bare halt
1265
- carries no input and never takes this arm). Client action: retry the same text later. SDK:
1266
- `SteeringLedgerUnavailableError`.
1267
- content:
1268
- application/json:
1269
- schema: { $ref: '#/components/schemas/ErrorResponse' }
1270
1239
 
1271
1240
  /v1/runs/{taskId}/subagents/{target}/steer:
1272
1241
  parameters:
@@ -2075,6 +2044,10 @@ paths:
2075
2044
  background children rooted at this session could not be stopped from here, NOTHING was deleted, and `remaining`
2076
2045
  lists their ids (the same strings as `GET /v1/agents/roster`'s `handle`): wait for them to finish or stop them
2077
2046
  where they run, then retry the delete verbatim (idempotent). Not a server fault — do not back off as for a 5xx.
2047
+ Server >= 7.148.0 (deletion is one tri-state: live → deleting → gone): `conflict.session_deleting` — another delete of the
2048
+ same session is in progress; this request deletes nothing, resend a little later. While a delete is in progress the session
2049
+ reads as absent to everyone but the delete door (`404 resume.session_not_found` on head reads, listing, export and new run
2050
+ claims); a delete that failed midway (500) has already made the session read as absent — resend the `DELETE` to finish it.
2078
2051
  content:
2079
2052
  application/json:
2080
2053
  schema: { $ref: '#/components/schemas/ErrorResponse' }
@@ -2516,6 +2489,15 @@ paths:
2516
2489
  '422': { description: '`steering.invalid_content` — the message failed the steering content gate.' }
2517
2490
  '429': { $ref: '#/components/responses/RateLimited' }
2518
2491
  '501': { $ref: '#/components/responses/NotImplemented' }
2492
+ '503':
2493
+ description: >
2494
+ server >= 7.148.0: `state.resume_context_unreadable` — reading this run's stored resume context FAILED (store connection
2495
+ fault / missing table / denied grant / unrecognised store error). Transient and nothing ran: the card stays pending and the row
2496
+ is untouched — resend the same request later (if it keeps failing, the deployment's store needs an operator).
2497
+ `409 conflict.resume_context_unavailable` keeps meaning "the context is really gone"; a fault of the server's own is `500 internal.error`.
2498
+ content:
2499
+ application/json:
2500
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
2519
2501
 
2520
2502
  /v1/sessions/{sessionId}/workspace:
2521
2503
  parameters:
@@ -3790,6 +3772,15 @@ paths:
3790
3772
  schema: { $ref: '#/components/schemas/ErrorResponse' }
3791
3773
  '409':
3792
3774
  description: >
3775
+ Server >= 7.148.0: `decide.agent_definition_unavailable` — a parked background agent whose agent definition the revive path
3776
+ cannot supply again (a per-request `agents` definition, a deployment definition withdrawn since it stopped, a definition named
3777
+ `fork`): approve and deny are BOTH refused, nothing is revived, the claim is rolled back and the card stays pending (body
3778
+ `taskId` + `rollback`; it ends by expiry or `POST /v1/sessions/{sessionId}/children/retire`). Also server >= 7.148.0: reading the
3779
+ run's resume context FAILED (connection fault / missing table / denied grant / unrecognised store error) now answers
3780
+ `503 state.resume_context_unreadable` (transient — resend later, the card stays pending) instead of this 409's
3781
+ `conflict.resume_context_unavailable`, which keeps "the context is really gone". A workflow-child card whose run is live in
3782
+ THIS process is applied to that run at once: 200 `{ taskId: <workflow run id>, status: "resuming", decision }` (poll
3783
+ `GET /v1/workflows/{runId}`, not `GET /v1/runs`).
3793
3784
  Either a session-CAS conflict (`ErrorResponse.activeTaskId`), OR a design/80 D-1
3794
3785
  `approval_binding_mismatch` (`errorCode`, `field`: boundCallId|boundInputHash, or absent — e.g. core's row-integrity
3795
3786
  refusal, whatever engine wrote the parked row) — your binding does NOT match the current pending action (TOCTOU/swap).
@@ -3970,6 +3961,15 @@ paths:
3970
3961
  content:
3971
3962
  application/json:
3972
3963
  schema: { $ref: '#/components/schemas/ErrorResponse' }
3964
+ '503':
3965
+ description: >
3966
+ server >= 7.148.0: `state.resume_context_unreadable` — reading this run's stored resume context FAILED (store connection
3967
+ fault / missing table / denied grant / unrecognised store error). Transient and nothing ran: the card stays pending and the row
3968
+ is untouched — resend the same request later (if it keeps failing, the deployment's store needs an operator).
3969
+ `409 conflict.resume_context_unavailable` keeps meaning "the context is really gone"; a fault of the server's own is `500 internal.error`.
3970
+ content:
3971
+ application/json:
3972
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
3973
3973
 
3974
3974
  /v1/approvals/{sessionId}/exemptions:
3975
3975
  parameters:
@@ -4207,6 +4207,15 @@ paths:
4207
4207
  application/json:
4208
4208
  schema: { $ref: '#/components/schemas/ErrorResponse' }
4209
4209
  '501': { $ref: '#/components/responses/NotImplemented' }
4210
+ '503':
4211
+ description: >
4212
+ server >= 7.148.0: `state.resume_context_unreadable` — reading this run's stored resume context FAILED (store connection
4213
+ fault / missing table / denied grant / unrecognised store error). Transient and nothing ran: the card stays pending and the row
4214
+ is untouched — resend the same request later (if it keeps failing, the deployment's store needs an operator).
4215
+ `409 conflict.resume_context_unavailable` keeps meaning "the context is really gone"; a fault of the server's own is `500 internal.error`.
4216
+ content:
4217
+ application/json:
4218
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4210
4219
 
4211
4220
  /v1/assistant/tasks/{taskId}/plan_review:
4212
4221
  parameters:
@@ -4268,6 +4277,15 @@ paths:
4268
4277
  application/json:
4269
4278
  schema: { $ref: '#/components/schemas/ErrorResponse' }
4270
4279
  '501': { $ref: '#/components/responses/NotImplemented' }
4280
+ '503':
4281
+ description: >
4282
+ server >= 7.148.0: `state.resume_context_unreadable` — reading this run's stored resume context FAILED (store connection
4283
+ fault / missing table / denied grant / unrecognised store error). Transient and nothing ran: the card stays pending and the row
4284
+ is untouched — resend the same request later (if it keeps failing, the deployment's store needs an operator).
4285
+ `409 conflict.resume_context_unavailable` keeps meaning "the context is really gone"; a fault of the server's own is `500 internal.error`.
4286
+ content:
4287
+ application/json:
4288
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4271
4289
 
4272
4290
  /v1/assistant/tasks/{taskId}/preempt:
4273
4291
  parameters:
@@ -4849,6 +4867,8 @@ paths:
4849
4867
  '401': { $ref: '#/components/responses/Unauthorized' }
4850
4868
  '404':
4851
4869
  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:
4852
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`
4853
4873
  (see ToolApprovalNotPendingCause); no ask ledger => no `cause`.
4854
4874
  content:
@@ -4957,6 +4977,10 @@ paths:
4957
4977
  '401': { $ref: '#/components/responses/Unauthorized' }
4958
4978
  '404':
4959
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:
4960
4984
  Unknown/settled/expired/foreign approval (no existence oracle) — `tool_approval.not_pending`. Past the owner gate the body may carry
4961
4985
  an additive `cause` (`ToolApprovalNotPendingCause`): a row-ending cause word (the card ended without a human decision — dismiss it)
4962
4986
  or `unknown_or_other_replica` (this replica does not know the id — retry on another endpoint / replica). 🔴 server >= 7.124.0 retired
@@ -5504,6 +5528,48 @@ paths:
5504
5528
  '401': { $ref: '#/components/responses/Unauthorized' }
5505
5529
  '404': { $ref: '#/components/responses/NotFound' }
5506
5530
 
5531
+ /v1/leader/{leaderRunId}/cancel:
5532
+ parameters:
5533
+ - $ref: '#/components/parameters/PrincipalHeader'
5534
+ - in: path
5535
+ name: leaderRunId
5536
+ required: true
5537
+ schema: { type: string }
5538
+ post:
5539
+ tags: [leader]
5540
+ operationId: leaderCancel
5541
+ x-status: gated
5542
+ summary: Stop a leader run (server >= 7.148.0; idempotent).
5543
+ description: >
5544
+ A running row ⇒ the durable cancel flag is set and the driving replica aborts at once (same replica) or on its next
5545
+ liveness tick (another replica): `202 { leaderRunId, status: "cancelling", cancelRequested: true }`. A run that stops at an
5546
+ abort checkpoint ends `failed` with `errorCode: "cancelled"` and pushes nothing (`result.stopped: true`); a cancel that
5547
+ lands after the push ends as it really ended — read `errorCode`, not `cancelRequested`, to tell "stopped, nothing pushed".
5548
+ A row already terminal ⇒ idempotent `202` with that terminal word and a `note`, and the pending worker parks the run left
5549
+ behind are expired. Older servers have no such route (404 `not_found.route`).
5550
+ responses:
5551
+ '202':
5552
+ description: Cancel receipt (two arms by `status`).
5553
+ content:
5554
+ application/json:
5555
+ schema: { $ref: '#/components/schemas/LeaderCancelReceipt' }
5556
+ '401': { $ref: '#/components/responses/Unauthorized' }
5557
+ '404':
5558
+ description: 'errorCode `not_found.leader_run` — no such leader run, or not yours (the same answer as `GET`).'
5559
+ content:
5560
+ application/json:
5561
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
5562
+ '409':
5563
+ description: 'errorCode `conflict.approval_settled` — the run is already terminal and some of its pending worker approvals were settled concurrently (decided or expired) while this cancel tried to expire them; read the pending list for their fate.'
5564
+ content:
5565
+ application/json:
5566
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
5567
+ '501':
5568
+ description: 'errorCode `capability.leader_endpoint_required` — this deployment has no leader face.'
5569
+ content:
5570
+ application/json:
5571
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
5572
+
5507
5573
  # ── sandbox 镜像目录(补漏 2026-07-25)──────────────────────────────────────────────────────────────
5508
5574
  # ⚠️ 诚实记下本次的**范围**:只补了带 SDK 具名类型的这两条读面(`ImageIndexEntry`/`ImageSelectResult`)。
5509
5575
  # server 的 `/v1/images` 前缀下还有 register / :profile / digests/:digest 以及整个 bake 控制面
@@ -6383,7 +6449,14 @@ paths:
6383
6449
  '404': { description: '`org_delivery.not_member` — one byte-identical body for six causes (see the description); the gate is not an existence probe.' }
6384
6450
  '409': { description: '`org_delivery.inbox_full` — the recipient''s box holds 50 unconfirmed envelopes.' }
6385
6451
  '410': { description: '`org_delivery.recipient_tombstoned` — the recipient''s mailbox is in its pre-delete state.' }
6386
- '429': { description: '`org_delivery.rate_limited` — one sentence for the sender-attempt bound, the pair bound and the recipient aggregate bound.' }
6452
+ '429':
6453
+ description: >-
6454
+ `org_delivery.rate_limited` — one sentence for the sender-attempt bound, the pair bound and the recipient aggregate bound. server >= 7.149.0: the body adds `retryAfterSec`
6455
+ (integer seconds to the end of the current clock-hour bucket, rounded up, >= 1) and the response carries the same value as `Retry-After`, one number for all three bounds;
6456
+ server <= 7.148.x: neither (no window given — not "retry at once").
6457
+ headers:
6458
+ Retry-After: { schema: { type: integer }, description: 'server >= 7.149.0: seconds to the end of the current clock-hour bucket (same value as the body `retryAfterSec`).' }
6459
+ '500': { description: '`internal.org_delivery_quota_unreadable` (server >= 7.149.0; code family deterministic) — `DB_BACKEND=local` only: the delivery-quota state file cannot be read, so EVERY delivery is refused until an operator repairs or moves the file and restarts the service (the store reads it only at boot). No `Retry-After`; retrying will not change the answer (the SDK''s `NON_RETRYABLE_CODES` carries it). Before 7.149.0 this state answered `500 internal.error`.' }
6387
6460
  '501': { description: 'No delivery gate mounted (`PRINCIPAL_INBOX_ASSISTANT` off) — `capability.unavailable`.' }
6388
6461
 
6389
6462
  /v1/diagnostics/wiring:
@@ -7073,7 +7146,10 @@ paths:
7073
7146
  the source; body lists the conflicting tables in `conflicts` — go clean those up);
7074
7147
  `adoption.destination_unrepresentable` (the destination identity does not fit some key this
7075
7148
  adoption would DERIVE from it, e.g. a memory `proj:` key overrunning a column width — pick a
7076
- SHORTER destination principal).
7149
+ SHORTER destination principal);
7150
+ `adoption.table_missing` (server >= 7.148.0: a wired optional face — memory-engine DB backend / attachment store —
7151
+ whose table is missing on the database; body `{ adoptionId, tables[] }`; the arc is not settled — create the missing
7152
+ tables (restart a replica) and resend the same request). Since 7.148.0 the receipt's `legs[]` lists only the legs that ran.
7077
7153
  Either way both sides are byte-unchanged.
7078
7154
  content:
7079
7155
  application/json:
@@ -7586,7 +7662,10 @@ components:
7586
7662
  schema: { $ref: '#/components/schemas/ErrorResponse' }
7587
7663
  RateLimited:
7588
7664
  description: >
7589
- 429 — a limit was hit. Four real `errorCode`s ride this status: `limit.cost_quota_exceeded`
7665
+ 429 — a limit was hit. `limit.rate_exceeded` may carry a machine `reason`: `run_concurrency_cap` (server >= 7.146.0,
7666
+ `RUN_MAX_CONCURRENT*`) or `sandbox_capacity` (server >= 7.148.0, local-docker lane `DOCKER_MAX_CONTAINERS`: a new submission is refused
7667
+ while executions are waiting for a container slot; a tool call that waits past its budget gets the same code and reason in its
7668
+ tool result, the run is not ended); other producers carry no `reason`. Four real `errorCode`s ride this status: `limit.cost_quota_exceeded`
7590
7669
  (per-principal CUMULATIVE cost quota — the QuotaError body below), `limit.rate_exceeded`
7591
7670
  (request-rate limit; also the status-derived fallback code), `quota_exhausted` (the E4 fleet
7592
7671
  quota-LEASE budget), and `usage.window_exhausted` (server 6.1.0 — the deployment-wide token
@@ -7984,7 +8063,7 @@ components:
7984
8063
  entry would turn a narrowing intent into a widening.
7985
8064
  🔴 server >= 7.136.0 — on a FRESH submit (the three submit doors) a badly written declaration is REFUSED, not dropped, and no longer answers a 200
7986
8065
  that reads as "in effect": a list that is not an array / an entry that is not an object / a key value the judge cannot read as usable
7987
- (`url` not an http(s) string, `headers` values that are not strings, `allowSkills` not a string array …) ⇒ `400 request.field_invalid` with the sentence only
8066
+ (`url` not an http(s) string, `headers` values that are not strings, `allowSkills` not a string array …) ⇒ `400 request.field_invalid` with the sentence only on 7.136.0–7.147.x (server >= 7.148.0 adds `field` — `a2aPeers` for the list, the in-body coordinate for an entry / key value — and `index` on an entry-level refusal; still no `reason`)
7988
8067
  (no `field` / `reason`); a key outside the peer vocabulary (a mis-spelled `allowSkill` …) ⇒ `400 request.body_shape` + `unknownKeys` (full coordinates, e.g.
7989
8068
  `a2aPeers[0].allowSkill`); a `url` / `cardUrl` that carries a credential ⇒ `400 request.field_invalid` WITH `field` / `reason` (`url_userinfo` / `url_credential_param`);
7990
8069
  more than 32 entries ⇒ `400 request.field_invalid` WITH `field: "a2aPeers"` / `reason: "over_cap"` / `count` / `cap`. Branch on `errorCode` / `unknownKeys` / `field`, never on the sentence.
@@ -8227,7 +8306,11 @@ components:
8227
8306
  verifyRounds: { type: integer }
8228
8307
  cascade:
8229
8308
  type: boolean
8230
- description: Quality-gate cascade (cheap→strong). Mutually exclusive with `verify`. Not on the stream.
8309
+ description: >
8310
+ Quality-gate cascade (cheap→strong). Mutually exclusive with `verify`. Not on the stream.
8311
+ server >= 7.148.0: a rung that stops on a durable gate parks the RUN (`suspended`, session held, the card
8312
+ listed with the rung's own `sessionId` and this run's `taskId`); deciding it resumes the same run up the ladder,
8313
+ and `RESOURCE_SUSPEND` covers cascade too.
8231
8314
  suggestNextPrompts:
8232
8315
  description: >
8233
8316
  E12 (shell-host; service spec-fields.ts / runs.ts, SHIPPED) — opt-in post-completion "what to ask
@@ -8914,6 +8997,9 @@ components:
8914
8997
  🔴 On the wire it carries NO `token` — the same withholding rule as the top-level `paused` arm
8915
8998
  (see `PausedCause`); `gate` / `checkpointId` are present as usual.
8916
8999
  Absent on every failure the engine itself assembles.
9000
+ server >= 7.140.0 promotes the pause of a leg that ran on the run's own session (verify) to the run's own `paused`;
9001
+ server >= 7.148.0 promotes EVERY nested pause the composition entry hands back (a cascade rung's card records the
9002
+ submitting session as its home), so a server-driven run no longer carries this key — older servers still do.
8917
9003
  detail:
8918
9004
  allOf: [{ $ref: '#/components/schemas/TerminalFailureDetail' }]
8919
9005
  description: >
@@ -9212,6 +9298,15 @@ components:
9212
9298
  cancel scene to look at", NOT "nothing was wrong at cancel time"). Landings: `GET /v1/runs/{taskId}` -> `result.cancelContext`
9213
9299
  (and the same object rides the other cancelled-terminal landings listed on `abortCause`). Shape and per-key reading
9214
9300
  rules: `CancelContext`.
9301
+ readDenyFloor:
9302
+ allOf: [{ $ref: '#/components/schemas/ReadDenyFloorSummary' }]
9303
+ description: >
9304
+ server >= 7.149.0, PRESENT-IFF the run WENT AHEAD while its read-deny rules are not byte-enforced: the read-deny table has rows, the execution
9305
+ environment (lane) does not keep the byte floor, and the deployment did not set `READ_DENY_FLOOR_REQUIRED=true` (when it did, the synchronous
9306
+ `POST /v1/tasks` answers 409 `config.read_deny_floor_unkept` and the asynchronous legs land the same code on the terminal row - the run does not go).
9307
+ ABSENT = no such disclosure: the run did not start (entry budget gate / refused submit), the table is empty, the lane keeps the byte floor, or an older
9308
+ server - absence does NOT prove the read-deny rules were kept. Landings, one value: `GET /v1/runs/{taskId}` -> `result.readDenyFloor` ·
9309
+ `POST /v1/tasks/stream` -> `done.result.readDenyFloor` · the `POST /v1/tasks` 200 body at its top level · the ledger `done` row's `result`. Shape: `ReadDenyFloorSummary`.
9215
9310
 
9216
9311
  abortCause:
9217
9312
  allOf: [{ $ref: '#/components/schemas/AbortCause' }]
@@ -9245,9 +9340,12 @@ components:
9245
9340
 
9246
9341
  AbortCause:
9247
9342
  type: string
9248
- enum: [client_disconnected, ask_park_grace_exhausted, cancel_verb]
9343
+ enum: [client_disconnected, ask_park_grace_exhausted, cancel_verb, stall_verdict]
9249
9344
  description: >
9250
- The closed three-word vocabulary of `abortCause` (server >= 7.112.0 / S-947; contract §5.0d) — who initiated a
9345
+ server >= 7.148.0 adds the fourth word `stall_verdict`: the run's executor was judged dead (heartbeat stale past the reap window, observed
9346
+ by an owner-gated read or a colliding submit — the row is `failed` + `errorCode: run.stalled`) and stopped itself at its next heartbeat;
9347
+ its own cancel terminal (this connection's stream / body, the ledger rows it wrote) carries this word, the run row carries the verdict.
9348
+ The closed vocabulary of `abortCause` (server >= 7.112.0 / S-947; contract §5.0d) — who initiated a
9251
9349
  server-side abort. Each word has one real site: `client_disconnected` — a non-detach `POST /v1/tasks/stream` client
9252
9350
  disconnect while no in-stream ask was pending, aborted at once ("the connection dropped, the run was aborted" — not an
9253
9351
  engine error); `ask_park_grace_exhausted` — the same disconnect arm but an in-stream ask WAS pending: the server first
@@ -9260,6 +9358,18 @@ components:
9260
9358
  CLOSED set, additive-only by the server's rule (a new word is a new server version in `wire-changes` AND a new SDK
9261
9359
  minor, in this enum in the same batch): read an unknown word as "the server aborted this run, cause not recognised".
9262
9360
 
9361
+ ReadDenyFloorSummary:
9362
+ type: object
9363
+ additionalProperties: false
9364
+ required: [code, message]
9365
+ description: >
9366
+ `TaskResult.readDenyFloor` (server >= 7.149.0): the run-level disclosure that a run WENT AHEAD while its read-deny rules are not byte-enforced.
9367
+ `{ code, message }` is the same pair as that run's `engine_notice` frame `config.read_deny_floor_unkept`; `message` is the server's lane-specific
9368
+ sentence (display text, never a match key). Two keys, no others.
9369
+ properties:
9370
+ code: { type: string, enum: [config.read_deny_floor_unkept] }
9371
+ message: { type: string }
9372
+
9263
9373
  CancelContext:
9264
9374
  type: object
9265
9375
  # 封闭(K-43,sdk 16.0.0):铸点 `run-cancel-context.js` `buildCancelContext` 是逐键条件 spread 的字面量(lastEventKind / lastEventAgeMs / lastBrainStatus / elapsedMs),
@@ -9457,10 +9567,10 @@ components:
9457
9567
  description: >
9458
9568
  K-32 (server >= 7.106.0 / S-866 ①) — the `GET /v1/capabilities` `store` segment, key-for-key the server's
9459
9569
  `dist/store-posture.d.ts` `StoreCapability`. Three faces, one assembled value: `degradedReason` present ⇔
9460
- `/health.storeDegraded:true` + `durable:false` ⇔ gauge `store_backend_degraded` = 1. A deployment self-report; changes no
9461
- endpoint's behaviour.
9570
+ `/health.storeDegraded:true` ⇔ gauge `store_backend_degraded` = 1. A deployment self-report; changes no
9571
+ endpoint's behaviour. Durability has ONE reading (server >= 7.148.0): `durability` here = `/health.store.durability`.
9462
9572
  additionalProperties: false
9463
- required: [declared, backend, durable]
9573
+ required: [declared, backend, durability]
9464
9574
  properties:
9465
9575
  declared:
9466
9576
  type: string
@@ -9475,7 +9585,15 @@ components:
9475
9585
  store that could not be built (`declared: local`, `backend: memory`, `local_unwritable`). Server >= 7.119.0: a configured
9476
9586
  SQL store that cannot open is retried inside the wait window and then the boot is REFUSED — it never degrades to memory
9477
9587
  (server <= 7.118.x degraded it silently under `SESSION_BACKEND=auto`, with the RETIRED word `degradedReason: db_unreachable`).
9478
- durable: { type: boolean, description: '`backend !== "memory"`.' }
9588
+ durability:
9589
+ type: string
9590
+ enum: [durable, ephemeral, unknown]
9591
+ description: >
9592
+ server >= 7.148.0 (BREAKING: replaces the boolean `durable`, deleted with zero alias — `if (store.durable)` was true for every
9593
+ non-memory backend whatever filesystem the local store sat on). Whether the data survives a container / Pod replacement: the
9594
+ weakest of three roots (data root · sealed-key directory · the wired file-memory root); a SQL backend delegates the data root to
9595
+ the database (always `durable`); a local store reads the mount its data root sits on, undecidable ⇒ `unknown` (never folded to
9596
+ `durable`). A server <= 7.147.x does not send it (it sent the boolean).
9479
9597
  degradedReason:
9480
9598
  type: string
9481
9599
  enum: [db_unreachable, local_unwritable]
@@ -10232,7 +10350,8 @@ components:
10232
10350
  type: object
10233
10351
  description: >
10234
10352
  200 body of GET /v1/leader/{leaderRunId} (server leader/endpoint.ts — exact literal
10235
- `{ id, status, ...(result?{result}:{}), ...(error?{error}:{}) }`).
10353
+ `{ id, status, ...(result?{result}:{}), ...(error?{error}:{}) }`; server >= 7.148.0 adds `cancelRequested` (always) and
10354
+ `errorCode` (cancel terminal only) — `{ id, status, cancelRequested, ...(errorCode?{errorCode}:{}), ...redactedView }`).
10236
10355
  # 🔴 census 批2 五段:两处修——① CLOSED(result/error 是 OMIT-when-absent 的可选键,不是额外键);
10237
10356
  # ② `status` 的第四值 `needs_human`(LEADER-REPAIRLOOP-INTEGRATION §5/§10.6 的第三终态,
10238
10357
  # `statusForLeaderResult` 在 candidate_only/needs_human_oracle/conflict 三个 repairTerminal 上产出)
@@ -10251,6 +10370,33 @@ components:
10251
10370
  `LeaderRecord.result: unknown` for one more version: pointing it at the named type is a NARROWING,
10252
10371
  which RELEASE.md reserves for a major. Cast it: `record.result as LeaderRunResult`.)
10253
10372
  error: { type: string }
10373
+ cancelRequested:
10374
+ type: boolean
10375
+ description: 'server >= 7.148.0 (always present there; absent on older servers): the durable cancel flag `POST /v1/leader/{leaderRunId}/cancel` sets. It says someone asked to stop — NOT that the run stopped (read `errorCode`).'
10376
+ errorCode:
10377
+ type: string
10378
+ description: 'server >= 7.148.0: present only on the cancel terminal — `cancelled` (stopped at an abort checkpoint, nothing pushed; `status: failed`, `result.stopped: true`).'
10379
+
10380
+ LeaderCancelReceipt:
10381
+ description: >
10382
+ 202 body of `POST /v1/leader/{leaderRunId}/cancel` (server >= 7.148.0). `cancelling` = the run was still running and the
10383
+ cancel flag is now set; a terminal word = the row was already terminal (idempotent), with a human `note` on what was left to stop.
10384
+ oneOf:
10385
+ - type: object
10386
+ additionalProperties: false
10387
+ required: [leaderRunId, status, cancelRequested]
10388
+ properties:
10389
+ leaderRunId: { type: string }
10390
+ status: { type: string, enum: [cancelling] }
10391
+ cancelRequested: { type: boolean, enum: [true] }
10392
+ - type: object
10393
+ additionalProperties: false
10394
+ required: [leaderRunId, status, cancelRequested, note]
10395
+ properties:
10396
+ leaderRunId: { type: string }
10397
+ status: { type: string, enum: [completed, failed, needs_human] }
10398
+ cancelRequested: { type: boolean }
10399
+ note: { type: string }
10254
10400
 
10255
10401
  LeaderRunResult:
10256
10402
  type: object
@@ -10334,6 +10480,10 @@ components:
10334
10480
  sessionId: { type: string }
10335
10481
  route: { type: string, description: 'single = a one-subtask plan; fanout = N.' }
10336
10482
  error: { type: string, description: 'Planning/provisioning failed before fan-out.' }
10483
+ stopped:
10484
+ type: boolean
10485
+ enum: [true]
10486
+ description: 'server >= 7.148.0: the wave stopped at an abort checkpoint (a cancel, or the row was settled elsewhere) — no new work started and nothing was pushed after the stop. Present only on that form, always true; the cancel terminal is read off `LeaderRecord.errorCode` (`cancelled`).'
10337
10487
  replan:
10338
10488
  type: object
10339
10489
  additionalProperties: true
@@ -10428,7 +10578,7 @@ components:
10428
10578
  server >= 7.134.0 (core 7.54.0) — what the approving PERSON writes in the card's "and tell the agent what to do next" input: on the resumed
10429
10579
  leg it reaches the model as the user's own words (unfenced, unbounded — like the reference's accepted-prompt feedback). ONLY on a person's approve
10430
10580
  (`decision: "approve"`, `decidedBy` absent or `person`): on a deny or a `decidedBy: "policy"` decision ⇒ 400 `request.field_conflict` with
10431
- `detail.kind: "approval_feedback"` and `detail.fields` `["feedback", "decision"]` / `["feedback", "decidedBy"]` (a denial's words go in `reason`);
10581
+ `reason: "approval_feedback"` and `fields` `["feedback", "decision"]` (root keys since server 7.148.0; `detail.kind` / `detail.fields` before) / `["feedback", "decidedBy"]` (a denial's words go in `reason`);
10432
10582
  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
10433
10583
  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
10434
10584
  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
@@ -10718,7 +10868,6 @@ components:
10718
10868
  diagnostics, never as vocabulary). Empty array = honest "nothing usable here" (e.g. multi-tenant
10719
10869
  with no explicit allowlist); ABSENT = an older server (degrade to not teaching, not validating).
10720
10870
  resumeAt: { type: boolean, description: "E18 resume-at-message anchors are resolvable." }
10721
- rewindFiles: { type: boolean, description: "E19 file-history store present (the file-restore legs `restoreFiles` / `rewindFilesTo` can take effect). The bit's NAME is a historical spelling: the same-named REQUEST key `rewindFiles` is retired (server 7.139.0 ⇒ 400 `request.body_shape`), the bit itself is still minted." }
10722
10871
  rewindFilesTo:
10723
10872
  type: boolean
10724
10873
  description: >-
@@ -10734,6 +10883,8 @@ components:
10734
10883
  restoreFiles:
10735
10884
  type: boolean
10736
10885
  description: >-
10886
+ THE one file-restore bit (server >= 7.148.0 deleted its same-predicate twin `rewindFiles`, zero alias — the two were
10887
+ always equal since 7.52.0, so reading this bit gives the same answer on every supported server; `rewindFilesTo` = this ∧ `resumeAt`).
10737
10888
  S-15 epoch discriminator (server ≥7.52, `Boolean(fileHistoryStore)`): this server understands the
10738
10889
  `restoreFiles` REQUEST KEY / tracked-set restore semantics (design/381 — restore narrowed
10739
10890
  whole-tree ⇒ tracked set). New clients negotiate on THIS bit and send `restoreFiles` (+
@@ -10964,14 +11115,25 @@ components:
10964
11115
  server >= 7.143.0, hardcoded true (a version bit): the four decision doors (live `respond`, durable ask `decision`, `/decide`,
10965
11116
  `plan_review`) read `decidedVia` (ApprovalDecidedVia) beside `decidedBy: "policy"`. Send it only when this is present.
10966
11117
  sessionReadRedaction:
11118
+ oneOf:
11119
+ - type: array
11120
+ items: { type: string }
11121
+ - { const: true }
11122
+ description: >-
11123
+ server >= 7.148.0 (BREAKING: the boolean form is gone): the list of session-HISTORY leaves (`<shape>.<key>`, eleven today —
11124
+ assistant.content / assistant.errorMessage / assistant.diagnostics / assistant.repetition / toolResult.content /
11125
+ toolResult.details / bashExecution.command / bashExecution.output / compactionSummary.summary / compactionSummary.details /
11126
+ attachmentFrame.content) that `GET /v1/sessions/:id` `messages[]` passes through the same redaction as the live frames; known
11127
+ leaves NOT in the list are verbatim. Read it per leaf after `Array.isArray`: a server 7.120.0–7.147.x inside the support floor
11128
+ sends the boolean `true` (whole-history redaction; the three `assistant` leaves since 7.123.0); absent = <= 7.119.x. The bit
11129
+ does not mean the read face exists (that is `sessions`), nor that the archive holds no credential (read-side only).
11130
+ scenarioSubject:
10967
11131
  type: boolean
10968
11132
  description: >-
10969
- server >= 7.120.0, hardcoded true (a predicate-class bit, same family as `approvalDecidedBy`): the session HISTORY read
10970
- (`GET /v1/sessions/:id`, the `messages` string leaves, every fetch form) passes the same redaction as the live and ledger
10971
- frames (see SessionRecord). Branch on the bit, not on the server version. Bit absent is NOT `false` and NOT "unredacted":
10972
- a server <= 7.118.x returns the archive as written; a 7.119.x server already redacts but does not report the bit. A true
10973
- bit does not mean the read face exists (that is `sessions`; without a session audit face that door answers 501 and this
10974
- bit is still true), nor that the archive holds no credential (the redaction is read-side only).
11133
+ server >= 7.148.0, hardcoded true: this server reads the request header `x-agent-scenario` (a scenario sub-namespace inside the
11134
+ verified person: run / session / ask owners, park scope, attachments, submit idempotency identity, list visibility and session rules
11135
+ split per person + scenario). Send the header only when this bit is present — an older server ignores it (the request lands in
11136
+ the person's own partition, no refusal to probe).
10975
11137
  approvalReadRootGrant:
10976
11138
  type: boolean
10977
11139
  description: >-
@@ -11372,6 +11534,13 @@ components:
11372
11534
  `org_denied` = this principal's caps say auto is off and no local deny is set (the center's explicit deny, or its fail-closed refusal); `local_denied` = the local `PERMISSIONS_DISABLE_AUTO_MODE`;
11373
11535
  `settings_denied` = the settings layer folds auto (run-level, not produced by this read face); `resolver_fault` = the resolver threw.
11374
11536
  model: { type: string }
11537
+ refusedBy:
11538
+ type: string
11539
+ enum: [center.autoMode, center.allowAutoMode, both]
11540
+ description: >-
11541
+ server >= 7.148.0 — present ONLY with `armed: false` + `reason: org_denied` when the CENTER itself refused auto: which
11542
+ center entitlement key refused it (`both` = both keys). Absent when the center could not answer (the server's
11543
+ fail-closed refusal), when the local `PERMISSIONS_DISABLE_AUTO_MODE` wins (`local_denied`), and on servers <= 7.147.x.
11375
11544
  readFace:
11376
11545
  type: ["string", "null"]
11377
11546
  enum: [open, roots, null]
@@ -12453,6 +12622,10 @@ components:
12453
12622
  properties:
12454
12623
  removed: { type: integer, minimum: 0 }
12455
12624
  remaining: { type: integer, minimum: 0 }
12625
+ unreadable:
12626
+ type: integer
12627
+ minimum: 0
12628
+ description: how many of `remaining` are carriers the lane could not read to tell whether they hold an erased entry — counted as remaining, never as clean (the `quarantineCopy` class answers it on both lanes).
12456
12629
  - type: object
12457
12630
  required: [unverified]
12458
12631
  additionalProperties: true
@@ -12563,14 +12736,16 @@ components:
12563
12736
  engine's sweep; `quarantineCopy` — quarantine files whose frontmatter id is the erased id; `planArchive` / `planWorkbook` — the
12564
12737
  consolidation plane's mint archive and plan workbook; `evidenceBinding` — evidence-chain rows that still spell the entry's file
12565
12738
  name, which the append-only chain keeps, so they keep the request `partial` and a replay cannot clear them; `backendDerived` —
12566
- anything a backend derives privately).
12567
- required: [projection, shadow, indexLine, quarantineCopy, planArchive, planWorkbook, evidenceBinding, backendDerived]
12739
+ anything a backend derives privately; server >= 7.148.0 / engine 7.66.0 adds `clearanceCustody` — the cleared-entry text an origin
12740
+ clearance keeps in custody, erased with the entry, its clearance row then carrying `custodyErased: true`).
12741
+ required: [projection, shadow, indexLine, quarantineCopy, clearanceCustody, planArchive, planWorkbook, evidenceBinding, backendDerived]
12568
12742
  additionalProperties: true
12569
12743
  properties:
12570
12744
  projection: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12571
12745
  shadow: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12572
12746
  indexLine: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12573
12747
  quarantineCopy: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12748
+ clearanceCustody: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12574
12749
  planArchive: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12575
12750
  planWorkbook: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
12576
12751
  evidenceBinding: { $ref: '#/components/schemas/MemoryErasureCarrierAnswer' }
@@ -12693,6 +12868,9 @@ components:
12693
12868
  under-report a CJK entry by up to two thirds, and this number is the only evidence of how much the
12694
12869
  recovery seat still holds). `0` = this row carries no bytes; `> 0` on a `pending` row = the crash
12695
12870
  recovery seat still holds a memory's body AND A HUMAN MUST ACT (call the clear endpoint again).
12871
+ custodyErased:
12872
+ const: true
12873
+ description: 'server >= 7.148.0 (engine 7.66.0) — present ⇔ an erasure of the entry erased this clearance''s custody text: the row no longer resumes (`memory.origin_clear_unknown`); who / why / when / events stay. Absent = custody stands (or an older server).'
12696
12874
 
12697
12875
  MemoryOriginClearancesResult:
12698
12876
  type: object
@@ -12964,12 +13142,13 @@ components:
12964
13142
 
12965
13143
  DroppedEntryReasonCode:
12966
13144
  type: string
12967
- enum: [entry-schema-invalid, entry-key-invalid, entry-unreadable]
13145
+ enum: [entry-schema-invalid, entry-key-invalid, entry-unreadable, entry-unknown-key]
12968
13146
  description: >
12969
13147
  Why the read leg dropped a catalog entry (server >= 7.123.0). The words are settings-schema's closed `DROPPED_ENTRY_REASON_CODES`, passed through
12970
13148
  verbatim (the server neither hand-copies nor rewrites them; a new word in the package is a compile error there, forcing an explicit decision).
12971
13149
  `entry-schema-invalid` = the entry did not pass its own schema; `entry-key-invalid` = a Record-shaped collection's key did not pass the key schema
12972
- (the catalog is an array, so this word does not appear on `droppedEntries` today — keep it in the switch anyway); `entry-unreadable` = the judging
13150
+ (the catalog is an array, so this word does not appear on `droppedEntries` today — keep it in the switch anyway); server >= 7.148.0 (settings-schema 24.0.0) adds
13151
+ `entry-unknown-key` = the entry body carried a key the contract does not know (a forward key, a misspelt key) — the whole entry is dropped and named; `entry-unreadable` = the judging
12973
13152
  threw (a pathological accessor; the engine never carries what it threw). Read an unknown word as "dropped, reason unknown".
12974
13153
 
12975
13154
  DroppedEntryIdentity:
@@ -13009,7 +13188,9 @@ components:
13009
13188
  reasoning: { type: boolean, description: 'a reasoning-tier model (picker can badge it). THREE states since server 7.131.0: `true` / `false` when the row declares it, ABSENT when undeclared (env lane without MODEL_REASONING; center entry without `reasoning`) — absent is not false.' }
13010
13189
  vision: { type: boolean, description: 'Whether this catalog row accepts image input — THREE states (server >= 7.117.0; before it a row that declared no `input` reported `false`): `true` = the row declares `input` and it contains "image"; `false` = declares `input` without it; ABSENT = the row declared no `input` (a hand-written catalog entry; the env lane and the config-center lane always declare it). ABSENT means UNKNOWN, not false: treat it as "send the image anyway and tell the user", do not read it as `false` and block the image locally — the server hands the image to the model for that same row at run time. Only an explicit `false` justifies "this model does not take images".' }
13011
13190
  supportsThinkingOff: { type: boolean, description: "Whether this model's reasoning can be turned off — the engine's one reading `thinkingOffSpelled` (derived from the row's API family, `compat`, `thinkingLevelMap.off` and `reasoning` declaration; the catalog carries no key for it). ALWAYS PRESENT on a server >= 7.138.0 (a plain boolean, not three-state); ABSENT = an older server (unknown, not `false`)." }
13191
+ defaultThinking: { type: string, enum: [minimal, low, medium, high, xhigh, max, 'off'], description: 'server >= 7.148.0, present iff declared: the model''s default thinking rung (the engine''s `Model.defaultThinking`, seven rungs incl. `off` — a request that names no rung then carries an explicit off). ABSENT = no model-level default (the provider''s own default applies), or an older server. Whether thinking CAN be turned off is `supportsThinkingOff`.' }
13012
13192
  contextWindow: { type: integer, description: 'E4 (SHIPPED) — context-window token DENOMINATOR for the %-used gauge; omitted when unknown.' }
13193
+ contextWindowSource: { type: string, enum: [declared, assumed], description: 'server >= 7.149.0, PRESENT-IFF `contextWindow` is present: where the window came from. `declared` = someone along the model''s inheritance chain wrote a number (the catalog entry''s `contextWindow`, the deployment''s `MODEL_CONTEXT_WINDOW` which an entry that writes none inherits, or `MODEL_CHEAP_CONTEXT_WINDOW` for the cheap slot); `assumed` = nobody wrote one and the server filled a conservative guess (131072 since 7.149.0; 7.148.x and before assumed 262144 and did not say so) - an estimate, not a measurement: the engine sizes its compaction trigger and tool-schema deferral on it, so a model whose real window is smaller reaches its limit before compaction starts and a larger one compacts earlier than it needs to. CLOSED two words. ABSENT = a server <= 7.148.x (source unknown, NOT `declared`) or a row with no `contextWindow`.' }
13013
13194
  maxOutputTokens: { type: integer, description: 'E4 (SHIPPED) — single-call max output tokens; omitted when unknown.' }
13014
13195
  supportedEffortLevels:
13015
13196
  type: array
@@ -15316,6 +15497,12 @@ components:
15316
15497
  the vocabulary's owner is still core and it has grown before, so read it the same way as everywhere
15317
15498
  else: branch known words, keep a `default` arm, and treat an unknown one as "unknown origin", never
15318
15499
  as "no origin". A row minted before the bit existed reads absent (unreported), not "no authority".
15500
+ runOrigin:
15501
+ type: string
15502
+ description: >-
15503
+ server >= 7.148.0 — the scheduler origin of the run this ask belongs to (the engine's `RunOrigin`, carried verbatim; today one
15504
+ word, `scheduled`). Present only when the engine recorded a word (a deployment's own scheduler trigger mints it; this service
15505
+ never does). ABSENT reads "the host said nothing", never "a person sent it"; an unknown word reads as an unknown origin.
15319
15506
  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.' }
15320
15507
  boundGrants:
15321
15508
  allOf: [{ $ref: '#/components/schemas/BoundSkillGrants' }]
@@ -15658,7 +15845,7 @@ components:
15658
15845
  type: array
15659
15846
  description: >-
15660
15847
  server >=7.110.0 (S-928 user-input acceptance ledger): user inputs this session LOST to a crash —
15661
- the server had answered 200 `applied` (interrupt{text}: 202) but the process carrying that run died
15848
+ the server had answered 200 `applied` (before server 7.148.0 also the 202 of the retired text form of `/interrupt`) but the process carrying that run died
15662
15849
  before the engine confirmed consuming them (server >= 7.113.0 / core 7.39.0 #1273: an acceptance the engine confirmed
15663
15850
  consuming is settled `consumed` and is no longer listed here — the <= 7.112.x reading "whether the run consumed
15664
15851
  them is not known" narrowed to this; it still does NOT say "never consumed"; see `engine_notice`
@@ -15785,6 +15972,12 @@ components:
15785
15972
  PRESENT-IFF the row can be written conditionally (all three durable session backends); a lister face with no session metadata (the in-memory run-store aggregate) does not carry it.
15786
15973
  ABSENT = an older server (<= 7.138.x) or such a face — read as "no tag, unconditional write only". Never parse it, compare its order or use it across sessions. Not an ETag, no capability bit.
15787
15974
  unreadable: { $ref: '#/components/schemas/SessionUnreadable' }
15975
+ forkedFrom:
15976
+ type: string
15977
+ description: >-
15978
+ server >= 7.148.0 (additive): fork lineage — the id of the session this one was forked from. Present only when the row was created by
15979
+ a fork after lineage was recorded (a fork made before 7.148.0 is not backfilled: its source is unknown); OMITTED when absent, never
15980
+ `null`. The `PATCH /v1/sessions/{sessionId}` 200 row is the same projection, so it carries it too.
15788
15981
 
15789
15982
  SessionUnreadable:
15790
15983
  type: object
@@ -15832,7 +16025,7 @@ components:
15832
16025
  description: >
15833
16026
  `POST /v1/sessions/{sessionId}/fork` OPTIONAL body (server >= 7.139.0, contract section 23.4) — the keyed, retryable fork: `forkId` (the caller-minted canonical uuid that BECOMES the new session's id; not the source) and
15834
16027
  `forkNonce` (a non-empty string of at most 255 UTF-16 code units, i.e. JavaScript `String.length` — the server compares exactly that; a retry sends the SAME one). TOGETHER OR NEITHER: only one ⇒
15835
- `400 request.field_conflict` (`detail.kind: "fork_target"`, `fields: ["forkId", "forkNonce"]`); neither (an empty object, or no body at all) = the previous form (the server mints the id). The server reads only these two keys
16028
+ `400 request.field_conflict` (`reason: "fork_target"`, `fields: ["forkId", "forkNonce"]` — root keys since server 7.148.0); neither (an empty object, or no body at all) = the previous form (the server mints the id). The server reads only these two keys
15836
16029
  and IGNORES any other key (the object is not key-closed). Note the route now PARSES the body (it ignored it up to 7.138.x): malformed JSON ⇒ `400 request.invalid_json`, over the 8 MiB cap ⇒ `413`, a JSON array or scalar ⇒ `400 request.field_invalid`.
15837
16030
  additionalProperties: true
15838
16031
  oneOf:
@@ -16145,7 +16338,7 @@ components:
16145
16338
  server >= 7.131.0 — present ONLY when the scenario gate refused (and then `servers` is absent); the panel still answers 200 because the ledger half
16146
16339
  (`lastLegMcp`) does not depend on the scenario. Exactly one of `servers` / `scenarioRefusal` is present (the `oneOf` above; `degraded` only beside `servers`). Members = the body of the same refusal answered
16147
16340
  whole-face (503 on `GET /v1/capabilities/mcp` / `GET /v1/sessions/{id}/a2a`), byte-equal (one sentence builder): today `errorCode`
16148
- `state.scenario_assignment_unknown`, `error` naming the scenario and this deployment's roster, `detail: { scenario, source }` with `source` one of
16341
+ `state.scenario_assignment_unknown`, `error` naming the scenario and this deployment's roster, root keys `scenario` + `source` (server >= 7.148.0; nested `detail` on 7.131.0–7.147.x) with `source` one of
16149
16342
  `ruling` (the center assigned this principal a scenario this deployment does not have) / `deployment` (a dangling `DEFAULT_SCENARIO`; sema-server refuses
16150
16343
  to boot on it, only an embedder's own `resolveSpec` reaches it). A gate that throws something that is not a typed refusal is still a 500.
16151
16344
  required: [errorCode, error]
@@ -16153,12 +16346,8 @@ components:
16153
16346
  properties:
16154
16347
  errorCode: { type: string }
16155
16348
  error: { type: string }
16156
- detail:
16157
- type: object
16158
- required: [scenario, source]
16159
- properties:
16160
- scenario: { type: string }
16161
- source: { type: string, description: '`ruling` / `deployment` today; read open.' }
16349
+ scenario: { type: string }
16350
+ source: { type: string, description: '`ruling` / `deployment` today; read open.' }
16162
16351
  lastLegMcp:
16163
16352
  type: object
16164
16353
  description: >
@@ -16725,10 +16914,6 @@ components:
16725
16914
  row (`status` / `instanceId`) — zero extra reads — and a cross-principal caller never reaches these codes
16726
16915
  (the owner gate answers `not_found.run`, same code and text as the unknown arm). Both dispositions are the
16727
16916
  same: stop retrying the handle, read the run's own outcome via GET /v1/runs/{taskId}.
16728
- SettingsHooksConfigPath:
16729
- type: array
16730
- items: { type: [string, integer] }
16731
- description: 'the coordinate of a `settings.hooks` verdict — segments relative to the request body''s `settings` (caller-text segments echo-bounded). SDK `SettingsHooksConfigPath`.'
16732
16917
  ErrorResponse:
16733
16918
  type: object
16734
16919
  description: >
@@ -16932,7 +17117,9 @@ components:
16932
17117
  the IN-BODY COORDINATE of the capped / bad place (`skills[1].allowedTools`, `agents[0].denyTools[3]`, `agents`, `allowTools`, `additionalDirectories` …) —
16933
17118
  the same group as `reason` / `count` / `cap` / `index`. Also on 400 `request.field_invalid` for a
16934
17119
  `settings.hooks` tool-event matcher that selects an engine alias but not its canonical name (server >= 7.115.0 / S-1025):
16935
- `field` is always the literal `settings.hooks` (see `detail`). Also on 400 `request.body_shape` (server >= 7.119.0), on the THREE
17120
+ `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`,
17121
+ `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
17122
+ `settings.hooks.` / `settings.hooks[` (SDK `SettingsHooksRefusalExtra`). Also on 400 `request.body_shape` (server >= 7.119.0), on the THREE
16936
17123
  tool-approval decision doors (`POST /v1/tool-approvals/{id}/respond`, `POST /v1/tasks/{taskId}/asks/{askId}/decision`,
16937
17124
  `POST /v1/approvals/{sessionId}/decide`) and ONLY there: the body carried the retired key `settledBy` (any value but `undefined` —
16938
17125
  `null` and `""` count), the refusal landed before any decision, and `field` is the literal `settledBy`; the three doors now answer
@@ -16946,158 +17133,38 @@ components:
16946
17133
  server >= 7.136.0: the credential-slot set gains four seats (generation 3) — `mcpServers[i].transport.command` / `mcpServers[i].transport.args` (stdio transport) and `settings.hooks.<event>[g].hooks[h].command` / `.args` (command hook); `args` is sealed as ONE value (the whole array); on 409 `conflict.checkpoint_ctx_unsealable` `field` names that coordinate (which doors can answer which `reason`, and how the refusal arrives, is written once — in the SDK documentation of `CHECKPOINT_CTX_UNSEALABLE_REASONS` — not repeated here).
16947
17134
  server >= 7.136.0: on 400 `request.field_invalid` for a URL that carries a credential, `field` also names `images[i].url` (the sixth seat); on `mcpServers` over 32 entries `field` is `mcpServers` (beside `reason: "over_cap"` / `count` / `cap`); a key outside the `a2aPeers` entry vocabulary is `400 request.body_shape` whose `unknownKeys` carry the full coordinates (`a2aPeers[0].allowSkill`).
16948
17135
  server >= 7.135.0: on `a2aPeers` over 32 entries `field` is `a2aPeers` (beside `reason: "over_cap"` / `count` / `cap`).
16949
- detail:
16950
- description: >
16951
- 🔴 SHAPES differ by code — branch on `field` (or the `errorCode`), never guess from the type of `detail`. On 503
16952
- `state.scenario_assignment_unknown` (server >= 7.119.0): an OBJECT `{ scenario, source }` — `scenario` = the dangling scenario name,
16953
- `source` ∈ `ruling` (the center's assignment for this principal names a scenario this deployment does not have) / `deployment`
16954
- (the deployment default `DEFAULT_SCENARIO` is dangling — the server refuses to BOOT on that, so a request reaches it only on an
16955
- embedder that assembles `resolveSpec` itself). On 400
16956
- `request.field_invalid` for a `settings.hooks` tool-event matcher (server >= 7.115.0 / S-1025; additive, the sentence and the code
16957
- are unchanged): an OBJECT `{ event, alias, canonical }` — `event` = the tool event of the refused group (the first refused one when
16958
- several are), `alias` / `canonical` = the engine catalog's alias and canonical name (closed strings, never the caller's raw bytes),
16959
- beside `field: "settings.hooks"`; 🔴 server >= 7.126.0 adds `reason` (`dead_alias` / `over_budget` / `invalid_regex`) and server >= 7.132.0 makes EVERY
16960
- `settings.hooks` refusal carry this object with `path` ALWAYS present (the coordinate of the verdict, a segment array relative to the body's `settings`):
16961
- the matcher forms (+ `budget_exceeded` with `totalMs`), the config reader's piece codes (+ `key`), `unsupported_entry_type` (+ `type`), the service caps
16962
- `over_cap` / `too_long` (+ `count` / `cap`) and `unnamed_refusal` — see the hooks branch below and SDK `SettingsHooksRefusalDetail`. On 400
16963
- `config.user_attachment_invalid` (server >= 7.132.0 / core 7.53.0): an OBJECT `{ path, index? }` — the field the engine names at the head of the sentence,
16964
- `index` (0-based) only when the sentence names one attachment (SDK `UserAttachmentRefusalExtra`). On 400 `request.field_invalid` for the two `POST /v1/adoption` principal sentences (adoption):
16965
- a human-readable STRING. Other codes (core `checkpoint.*` mirrors; `rules.*` refusals carry no `detail` — their keys are `field` / `entry` / `reason` / `verdict` / `currentName` / `guidance` / `got` at the top level) carry their
16966
- own `detail`; read it by `errorCode`. SDK: `err.extra.detail` (verbatim, unnamed).
16967
- oneOf:
16968
- - type: object
16969
- description: 'the `settings.hooks` refusal detail (beside `field: "settings.hooks"`), one shape per `reason` — branch on `reason`, exhaustively (SDK `SettingsHooksRefusalDetail`). server >= 7.132.0: every hooks refusal carries it and `path` is always present; in-floor older servers: the three matcher shapes without `path` (7.126.0–7.131.x) and the reason-less dead-alias shape (7.115.0–7.125.x).'
16970
- oneOf:
16971
- - type: object
16972
- description: 'matcher: selects an engine alias but not its canonical name (`path` absent on server 7.126.0–7.131.x).'
16973
- required: [reason, event, alias, canonical]
16974
- additionalProperties: false
16975
- properties:
16976
- reason: { type: string, enum: [dead_alias] }
16977
- event: { type: string }
16978
- alias: { type: string }
16979
- canonical: { type: string }
16980
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
16981
- - type: object
16982
- description: 'matcher: one regex evaluation over the per-evaluation budget (`path` absent on server 7.126.0–7.131.x).'
16983
- required: [reason, event, groupIndex, budgetMs]
16984
- additionalProperties: false
16985
- properties:
16986
- reason: { type: string, enum: [over_budget] }
16987
- event: { type: string }
16988
- groupIndex: { type: integer }
16989
- budgetMs: { type: integer }
16990
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
16991
- - type: object
16992
- description: 'matcher (server >= 7.132.0): the completed regex evaluations of one admission summed over `totalMs`.'
16993
- required: [reason, event, groupIndex, totalMs, path]
16994
- additionalProperties: false
16995
- properties:
16996
- reason: { type: string, enum: [budget_exceeded] }
16997
- event: { type: string }
16998
- groupIndex: { type: integer }
16999
- totalMs: { type: integer }
17000
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17001
- - type: object
17002
- description: 'matcher: the regex does not compile (`path` absent on server 7.126.0–7.131.x).'
17003
- required: [reason, event, groupIndex]
17004
- additionalProperties: false
17005
- properties:
17006
- reason: { type: string, enum: [invalid_regex] }
17007
- event: { type: string }
17008
- groupIndex: { type: integer }
17009
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17010
- - type: object
17011
- description: 'the config reader''s classifier code verbatim (server >= 7.132.0; SDK `SETTINGS_HOOKS_PIECE_CODES`), `key` = the key that broke that piece when named.'
17012
- required: [reason, path]
17013
- additionalProperties: false
17014
- properties:
17015
- reason: { type: string, enum: [guard-outside-hooks, hooks-is-matcher, guard-under-unknown-event, guard-event-not-array, guard-matcher-invalid, guard-entry-invalid, hooks-not-object, unknown-event, event-not-array, matcher-invalid, entry-invalid] }
17016
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17017
- key: { type: string }
17018
- - type: object
17019
- description: 'an entry type this service does not execute (server >= 7.132.0).'
17020
- required: [reason, path, type]
17021
- additionalProperties: false
17022
- properties:
17023
- reason: { type: string, enum: [unsupported_entry_type] }
17024
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17025
- type: { type: string }
17026
- - type: object
17027
- description: 'a service cap (server >= 7.132.0).'
17028
- required: [reason, path, count, cap]
17029
- additionalProperties: false
17030
- properties:
17031
- reason: { type: string, enum: [over_cap, too_long] }
17032
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17033
- count: { type: integer }
17034
- cap: { type: integer }
17035
- - type: object
17036
- description: 'the classifier refused without naming a piece — contract drift, fail-closed (server >= 7.132.0).'
17037
- required: [reason, path]
17038
- additionalProperties: false
17039
- properties:
17040
- reason: { type: string, enum: [unnamed_refusal] }
17041
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17042
- - type: object
17043
- description: 'one of the three wire keys this service reads itself is malformed (server >= 7.133.0): the group `source` / a command entry''s `plugin` / `args`; `key` names it, `path` is its coordinate. The whole request is refused (they used to be stripped silently as unknown keys).'
17044
- required: [reason, key, path]
17045
- additionalProperties: false
17046
- properties:
17047
- reason: { type: string, enum: [wire_key_invalid] }
17048
- key: { type: string }
17049
- path: { $ref: '#/components/schemas/SettingsHooksConfigPath' }
17050
- - type: object
17051
- description: 'server 7.115.0–7.125.x: the dead-alias matcher refusal before `reason` existed.'
17052
- required: [event, alias, canonical]
17053
- additionalProperties: false
17054
- properties:
17055
- event: { type: string }
17056
- alias: { type: string }
17057
- canonical: { type: string }
17058
- - type: object
17059
- description: '400 `config.user_attachment_invalid` (server >= 7.132.0): the field the engine names; `index` only when one attachment is named.'
17060
- required: [path]
17061
- additionalProperties: false
17062
- properties:
17063
- path: { type: string }
17064
- index: { type: integer }
17065
- - type: object
17066
- required: [scenario, source]
17067
- additionalProperties: false
17068
- properties:
17069
- scenario: { type: string }
17070
- source: { type: string, enum: [ruling, deployment] }
17071
- - type: object
17072
- description: >-
17073
- server >= 7.133.0 — entry problems on a tool-name list / settings-rule refusal (400 `request.field_invalid`, 422): `problems` (at most 1000, each EntryProblem) + `total` (the true count; `total > problems.length` => cut).
17074
- With `callerTrust` it is the below-trust-floor refusal: the caller's admission tier (`global` | `project`, read open; the same words as `capabilities.settings.permissions.callerTrust`).
17075
- required: [problems, total]
17076
- additionalProperties: false
17077
- properties:
17078
- problems: { type: array, items: { $ref: '#/components/schemas/EntryProblem' } }
17079
- total: { type: integer }
17080
- callerTrust: { type: string }
17081
- - type: object
17082
- description: >-
17083
- server >= 7.133.0 — 400 `request.field_conflict`: the request body contradicts itself. `kind` = which constraint (a CLOSED set — fourteen words, fifteen from server >= 7.134.0 — read open: cascade_verify | image_profile | resume_anchor |
17084
- system_prompt_fold | file_history_restore | skills_disabled | existing_session | scratchpad_root | ask_answer | policy_person_ask | plan_edit | plan_mode_after | bound_call_door | remember_decision |
17085
- approval_feedback (server >= 7.134.0: `feedback` on a deny — fields `["feedback", "decision"]` — or on a policy decision — `["feedback", "decidedBy"]`));
17086
- `fields` = the named body coordinates, subject first (at least one; a dynamic index reads `agents[1].skills`); `count` / `cap` only on the fold-cap kind (the folded total and its cap).
17087
- required: [kind, fields]
17088
- additionalProperties: false
17089
- properties:
17090
- kind: { type: string }
17091
- fields: { type: array, items: { type: string } }
17092
- count: { type: integer }
17093
- cap: { type: integer }
17094
- - type: object
17095
- description: '409 `conflict.session_placed` (server >= 7.133.0): the session sync commit targeted a session that holds a delegated agent''s transcript. `placement_kind` is the stored placement kind (today only `subagent`; read open).'
17096
- required: [placement_kind]
17097
- additionalProperties: false
17098
- properties:
17099
- placement_kind: { type: string }
17100
- - type: string
17136
+ problems:
17137
+ type: array
17138
+ items: { $ref: '#/components/schemas/EntryProblem' }
17139
+ description: >-
17140
+ server >= 7.148.0, ROOT key (<= 7.147.x nested it under `detail`; the SDK reads only the root): the entry problems (SDK `EntryProblem`) on 400
17141
+ `request.field_invalid` · 400 `config.agent.unknown_tool` · 400 `config.tool_face_control` · 422 `request.unprocessable` · 409 `resume_blocked_by_policy`,
17142
+ beside `field` (the first problem's coordinate) and `total` (`total > problems.length` = truncated). SDK `EntryProblemsRefusalExtra`.
17143
+ total: { type: integer, description: 'server >= 7.148.0 root key: the true number of entry problems (see `problems`).' }
17144
+ callerTrust: { type: string, description: 'server >= 7.148.0 root key: the trust tier the request was admitted at, on the `below_trust_floor` refusal (open set: `global` / `project`). SDK `BelowTrustFloorExtra`.' }
17145
+ fields:
17146
+ type: array
17147
+ items: { type: string }
17148
+ description: >-
17149
+ server >= 7.148.0 root key on 400 / 409 / 422 `request.field_conflict` (beside `reason` = the constraint class, `count?` / `cap?` on the fold-cap class):
17150
+ the body coordinates in conflict, subject first. <= 7.147.x nested `{ kind, fields, … }` under `detail` (`kind` renamed `reason`, same words). SDK `FieldConflictRefusalExtra`.
17151
+ differs:
17152
+ type: array
17153
+ items: { type: string, enum: [text, trusted, priority, actor, runOrigin] }
17154
+ description: 'server >= 7.148.0 root key on 409 `steering.duplicate_input_id` (<= 7.147.x: `detail.differs`): the facets in which this replay differs from the accepted one. SDK `SteeringDuplicateInputIdError.differs`.'
17155
+ placement_kind: { type: string, description: 'server >= 7.148.0 root key on 409 `conflict.session_placed` (<= 7.147.x: `detail.placement_kind`): the stored placement kind of the target session.' }
17156
+ scenario: { type: string, description: 'server >= 7.148.0 root key on 503 `state.scenario_assignment_unknown` (and inside the `scenarioRefusal` of `GET /v1/sessions/{id}/mcp`): the dangling scenario name (<= 7.147.x: `detail.scenario`).' }
17157
+ source:
17158
+ type: string
17159
+ description: 'server >= 7.148.0 root key beside `scenario`: `ruling` (the center assigned a scenario this deployment lacks) / `deployment` (the deployment default is dangling); open set.'
17160
+ canonical: { type: string, description: 'On 400 `request.field_invalid` of `POST /v1/rules` (server >= 7.148.0): the canonical spelling the store would keep — resend it verbatim. On the `settings.hooks` `dead_alias` refusal: the canonical tool name.' }
17161
+ event: { type: string, description: 'server >= 7.148.0, `settings.hooks` matcher refusals (`dead_alias` / `over_budget` / `budget_exceeded` / `invalid_regex`): the hook event of the refused group (SDK `SettingsHooksRefusalExtra`).' }
17162
+ groupIndex: { type: integer, description: 'server >= 7.148.0, beside `event` on the four matcher refusals: the group position under that event (0-based).' }
17163
+ alias: { type: string, description: 'server >= 7.148.0, `settings.hooks` `dead_alias`: the engine alias the matcher selected.' }
17164
+ budgetMs: { type: integer, description: 'server >= 7.148.0, `settings.hooks` `over_budget`: the per-evaluation budget.' }
17165
+ totalMs: { type: integer, description: 'server >= 7.148.0, `settings.hooks` `budget_exceeded`: the admission-wide total budget.' }
17166
+ type: { type: string, description: 'server >= 7.148.0, `settings.hooks` `unsupported_entry_type`: the entry type this server does not run.' }
17167
+ key: { type: string, description: 'server >= 7.148.0, `settings.hooks` piece refusals (the key that broke the piece) and `wire_key_invalid` (`source` / `plugin` / `args`).' }
17101
17168
  count:
17102
17169
  type: integer
17103
17170
  description: '`reason: over_cap` / `too_long` / `too_large` — how much was sent (entries / characters / bytes; every capped face since >= 7.132.0). ABSENT on the unmeasured form (a body read that stopped at the cap). SDK: `err.extra.count`.'
@@ -17147,6 +17214,18 @@ components:
17147
17214
  - $ref: '#/components/schemas/ErrorResponse'
17148
17215
  - type: object
17149
17216
  properties:
17217
+ wayOut:
17218
+ type: string
17219
+ enum: [cancel_run, newer_worker]
17220
+ description: >-
17221
+ server >= 7.149.0, PRESENT-IFF the server can say the client's way out of a refused card (the engine judged the card not resumable on this engine;
17222
+ the three decision doors `POST /v1/approvals/{sessionId}/decide` · `.../plan_review` · `.../resume` refuse alike). CLOSED two words, decided by the verdict and the card alone
17223
+ (not by which door, not by the decision word): `cancel_run` - the card takes NO decision on this engine (approve / deny / reject / edit all refused), the way out is
17224
+ `POST /v1/runs/{taskId}/cancel`, which expires the card, drives the run to the cancelled terminal and frees the session (then start a new task) - render no approve / deny;
17225
+ `newer_worker` - a row parked by a newer engine: a worker at or above the version that parked it can resume it and the same decision lands there; the card stays pending
17226
+ (cancel is giving it up). ABSENT = the server cannot say a client way out (the card sits on a plain park of an already-terminal run, the run is running, the row's owner is
17227
+ unreadable, or no durable run store) - ask the operator; do NOT render "decide again" from `retriable`. Not carried: a refusal of the decision body's own cell (fix that
17228
+ cell and decide again), a deployment-fact refusal, `POST /v1/sessions/{sessionId}/wake`. SDK: `err.extra.wayOut` (`ResumeRefusalExtra.wayOut`).
17150
17229
  retriable:
17151
17230
  type: boolean
17152
17231
  enum: [true]
@@ -17163,8 +17242,8 @@ components:
17163
17242
  task on the same session — or finishing the run on a worker with the previous engine; before 7.113.0 this code ended the
17164
17243
  run `failed` with the session lock released and an orphaned card), to `steering.blocked_by_hook` on the `/wake` door (a
17165
17244
  wake carrying a `message` hit the deployment's `userPromptSubmit` hook crashing / timing out / refusing: the card stays
17166
- pending and the same card can be woken again once the hook recovers; the live `steer` / `interrupt` doors answer the
17167
- same code with 422 and no key), and to the new mirror code `checkpoint.config_refused` (409; the body also carries `field`:
17245
+ pending and the same card can be woken again once the hook recovers;
17246
+ the live `steer` door answers the same code with 422 and no key — `interrupt` took no content from server 7.148.0 and has no such 422), and to the new mirror code `checkpoint.config_refused` (409; the body also carries `field`:
17168
17247
  `taskConfig` | `inheritedGate`). Codes / status / `error` text are unchanged. SDK: `APIError.retriable`.
17169
17248
 
17170
17249
  # ── Streaming event taxonomy (the UX 命脉). Each SSE `data:` line is one JSON-serialized AgentEvent. ──
@@ -18511,8 +18590,9 @@ components:
18511
18590
  strings and arrive SECRET-REDACTED. REQUEST-LAYER ATTACHMENTS (server >= 7.131.0 / core 7.50.0): the frame of the objective that declared
18512
18591
  attachments (`carrier: "objective"`, `delivery: "applied"`) carries `attachments` — one item per attachment, in declared order (submit key
18513
18592
  `TaskRequest.userAttachments`; probe `Capabilities.userAttachments`). It is the ADMISSION outcome, not delivery: each attachment's message lands as its
18514
- own `message_committed{role:"user"}`. Attachments ride the objective only: a steer door (run / child / workflow child steer, child resume, interrupt
18515
- bare or with text) carrying `userAttachments` is 400 `request.body_shape` (named in `unsupportedKeys`), and resume / delivery legs do not rebuild it.
18593
+ own `message_committed{role:"user"}`. Attachments ride the objective only: a steer door (run / child / workflow child steer, child resume)
18594
+ carrying `userAttachments` is 400 `request.body_shape` (named in `unsupportedKeys`); the interrupt door takes no fields at all (server >= 7.148.0: any key, `userAttachments`
18595
+ included, is 400 with the key named in `unknownKeys`); resume / delivery legs do not rebuild it.
18516
18596
  (7.127.0 – 7.130.x did not accept `userAttachments` and never carried `attachments`; the capability bit is absent there.)
18517
18597
  allOf: [{ $ref: '#/components/schemas/EventIdentity' }]
18518
18598
  additionalProperties: false # 封闭 + identity 本地镜像:见 Event_reasoning 处的长注
@@ -18562,6 +18642,9 @@ components:
18562
18642
  kind: { type: string }
18563
18643
  outcome: { type: string }
18564
18644
  label: { type: string }
18645
+ declinedBy:
18646
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
18647
+ description: 'server >= 7.148.0 (core 7.66.0): the extension that refused this attachment at its `prompt.mention` station (registration name). Present only on a `not_attached` attachment whose refusal an extension made; a display / audit fact.'
18565
18648
  rewrittenBy:
18566
18649
  type: array
18567
18650
  items: { type: string }
@@ -18570,6 +18653,15 @@ components:
18570
18653
  changed it, in the order they did (registration names). The model saw the rewritten text (the caller's own words were not delivered). Rides the frame the screening
18571
18654
  entrance mints (an objective's `"applied"` frame, a parked steer's or a wake message's, a live steer's `"queued"` frame). ABSENT = the text went as it came (or an older
18572
18655
  server); the server projects only non-empty names and omits an empty list. Attribution only, never authority.
18656
+ author:
18657
+ type: string
18658
+ description: 'server >= 7.148.0 (core 7.66.0): who wrote this input when it was NOT the person — one of the engine''s `INPUT_AUTHORS` other than `operator` (`parent_model` / `workflow` / `peer` / `observer` / `engine` / `extension`; open on read). ABSENT = the person''s own words, or an older server.'
18659
+ extension:
18660
+ type: string
18661
+ description: 'server >= 7.148.0: with `author: extension`, the registration name of the extension that wrote this input (sanitized wire text; attribution only).'
18662
+ runOrigin:
18663
+ type: string
18664
+ description: 'server >= 7.148.0: the scheduler origin of the run (the engine''s `RunOrigin`, verbatim; today `scheduled`). ABSENT = the engine recorded none — not evidence that a person sent it.'
18573
18665
  eventId: { type: string }
18574
18666
  parentToolCallId: { type: string }
18575
18667
  sourceTaskId: { type: string }
@@ -19328,6 +19420,11 @@ components:
19328
19420
  with a finish reason the engine does not understand, so the text above may be cut short (`finishReason` = the provider's own word, an OPEN string, passed through verbatim; once per run per word); and
19329
19421
  `route.stream_end_ignored` `{statement, word, frames, sessionId, runId}` — the provider had already ended the turn and its stream sent more (`statement` in {`ending`, `error`, `content`}, `word` = the late first
19330
19422
  frame's ending reason / error word / content kind, `frames` = how many frames came after the end; the first ending counts, anything later never entered the turn; once per run per (statement, word)).
19423
+ server 7.149.0 (the user-visible whitelist grows 51 -> 52 codes; contract appendix D.3): `config.read_deny_floor_unkept` (the engine's code, passed through; the code book lists audience `operator`
19424
+ but this server puts it on the run event stream) - this run WENT AHEAD while its read-deny rules are not byte-enforced (the read-deny table has rows, the execution environment does not
19425
+ keep the byte floor, `READ_DENY_FLOOR_REQUIRED` is not set; when it is set the run does not go: the synchronous `POST /v1/tasks` answers 409 with the same code). `detail` =
19426
+ `{ rowCount, sessionId, runId }` - the table's row count and the run it speaks of (a ladder level / verifier / subagent leg is its own run id); `message` is rewritten by the server per lane.
19427
+ The same `{ code, message }` pair lands once more on the terminal result as `readDenyFloor` (`TaskResult.readDenyFloor`).
19331
19428
  A notice whose `detail.sessionId` is absent is HONESTLY NOT DELIVERED (the server never guesses a session),
19332
19429
  so the frame's absence does NOT mean "did not happen" — the operator-facing structured log always has the
19333
19430
  full family. `detail` is already redacted + size-bounded by the server; still treat it as external text.
@@ -21487,7 +21584,7 @@ components:
21487
21584
  description: >
21488
21585
  core 7.44.0 #1374 `STEER_REPLAY_FACETS` (`runOrigin` joined in core 7.58.0 — the run origin the caller declared for the input; server 7.138.0 hands the engine
21489
21586
  no run origin, so that facet does not arrive from it), verbatim and in order — the facets on which a replayed steering input id differs from the
21490
- accepted one. Carried as `detail.differs` (a non-empty subset, the engine's order) on 409 `steering.duplicate_input_id` (server >= 7.118.0):
21587
+ accepted one. Carried as the root key `differs` on server >= 7.148.0 (`detail.differs` on 7.118.0–7.147.x) (a non-empty subset, the engine's order) on 409 `steering.duplicate_input_id` (server >= 7.118.0):
21491
21588
  contains `text` ⇒ a different instruction, reissue with a fresh key; no `text` ⇒ the SAME instruction — do NOT change the key (it
21492
21589
  would queue twice), replay with the original values.
21493
21590
 
@@ -21708,15 +21805,6 @@ components:
21708
21805
  frame carrying it "violated" spec. Same key, same semantics as the 409 body.) Milliseconds since the
21709
21806
  occupying run's last recorded activity — the ONLY liveness-evidence bit on this frame (same-replica
21710
21807
  best-effort). Absent = no evidence, NOT "fresh"; never narrow absence to 0.
21711
- stale:
21712
- const: true
21713
- description: >
21714
- (#316(c), server >= 7.37; [4664]② hole (c)) The occupying run row looks DEAD by the same staleness
21715
- criterion the poll face (`GET /v1/runs/:id`) uses to fold a terminal status — heartbeat silence past
21716
- the reap window. This frame does NOT fold the status (`activeTaskStatus` stays verbatim, the reaper
21717
- owns the transition); the bit lets a shell reconcile "conflict says running / poll says failed"
21718
- inside the self-heal window. ADDITIVE, present ONLY as `true`; absent = no staleness evidence (parked
21719
- rows are out of reap scope and never carry it — absence is NOT "alive").
21720
21808
  pendingGate:
21721
21809
  allOf: [{ $ref: '#/components/schemas/PendingGateMaterial' }]
21722
21810
  description: >
@@ -22882,6 +22970,7 @@ components:
22882
22970
  description: 'Which leg emitted it (effective half only; the static half has no leg identity).'
22883
22971
  properties:
22884
22972
  kind: { type: string, enum: [root, child, resume] }
22973
+ runOrigin: { type: string, description: 'server >= 7.148.0 — the leg''s scheduler origin (the engine''s `RunOrigin`; tenant and operator frames alike). ABSENT = none recorded.' }
22885
22974
  sessionRules:
22886
22975
  type: object
22887
22976
  required: [childrenReadLive]
@@ -23485,6 +23574,9 @@ components:
23485
23574
  core's steer was a single-slot last-writer-wins with no per-message priority or addressable drop, so a
23486
23575
  faithful priority queue (and DELETE /v1/runs/{taskId}/queue/{messageId}) waited on a core seam. An absent
23487
23576
  or unknown capability value means "do not assume it is applied".
23577
+ `now` is the ONLY door for "cut the in-flight turn and say something": the engine cuts first, then the run continues with that text. A run that is parked or has ended has no turn to cut,
23578
+ so the entry parks instead of being refused (`delivery:"queued"` / `"parked_for_wake"`) — there is no live-only refusal form. `POST /v1/runs/{taskId}/interrupt` is the separate halt
23579
+ (cut + stop) and takes no text.
23488
23580
 
23489
23581
  SteerReceipt:
23490
23582
  type: object
@@ -23523,38 +23615,21 @@ components:
23523
23615
  note: { type: string, description: 'Human-readable note on the two parked legs; absent on `applied`.' }
23524
23616
 
23525
23617
  InterruptReceipt:
23618
+ type: object
23526
23619
  description: >
23527
- The POST /v1/runs/{taskId}/interrupt 202 receipt — TWO mutually exclusive shapes (oneOf, discriminated
23528
- by which arm's keys are present, NOT by status code; both are 202 — codex 复审 R1-[medium]:单对象全
23529
- 可选形会让 `{taskId,status}` 与混臂形都合法,生成式消费方靠不住判别键). TEXT form (cut + steer):
23530
- `delivery:"queued-immediate"` + `messageId` (≡ the engine inputId — correlate with the run stream's
23531
- `task.turn_interrupted` `detail.inputId`; acceptance = enqueued, the cut itself is best-effort).
23532
- BARE (halt) form: `turnCut` and deliberately NO delivery/messageId (no input frame exists to correlate
23533
- — A-075.78 成文;halt's acceptance is NOT a queue insert, so the receipt can honestly answer whether
23534
- THIS call cut a live turn). `status` = the run row's word as the server read it at acceptance. Honest
23535
- window: a halt racing the run's natural last moments reports the natural completion, still carrying
23536
- the haltedByUser seat.
23537
- # 封闭两臂:两个铸造点都是逐字面量拼出的对象(server routes/runs.ts interrupt 段),不是引擎透传形。
23538
- oneOf:
23539
- - type: object
23540
- description: TEXT form (cut + steer) — the run continues.
23541
- required: [taskId, status, delivery, messageId]
23542
- additionalProperties: false
23543
- properties:
23544
- taskId: { type: string }
23545
- status: { type: string, description: 'The run status the server saw at acceptance time.' }
23546
- delivery: { type: string, enum: [queued-immediate] }
23547
- messageId: { type: string, description: '≡ the engine inputId (with an Idempotency-Key: `idem-<sha256[:32]>`; without one: a fresh uuidv7, minted and threaded down PER REQUEST — unlike steer''s absent arm, which lets core mint).' }
23548
- note: { type: string, description: 'Contract note (逐句照 core 契约,不多许诺一个字).' }
23549
- - type: object
23550
- description: BARE (halt) form (cut + stop) — the run closes at this boundary.
23551
- required: [taskId, status, turnCut]
23552
- additionalProperties: false
23553
- properties:
23554
- taskId: { type: string }
23555
- status: { type: string, description: 'The run status the server saw at acceptance time.' }
23556
- turnCut: { type: boolean, description: 'true ⇔ THIS call cut a live turn; repeat calls answer false once the stop is latched (halt is naturally idempotent).' }
23557
- note: { type: string, description: 'Contract note (逐句照 core 契约,不多许诺一个字).' }
23620
+ The POST /v1/runs/{taskId}/interrupt 202 receipt — one shape, the halt's. `turnCut` is true iff THIS call cut a live turn; repeat calls answer false once the stop is latched
23621
+ (halt is naturally idempotent). Deliberately NO `delivery` / `messageId`: halt's acceptance is not a queue insert, so no input frame exists to correlate and no input id to deduplicate
23622
+ (server <= 7.147.x answered a second receipt shape on the retired text form of this door). `status` = the run row's word as the server read it at acceptance.
23623
+ Honest window: a halt that cuts nothing and stops nothing consumes nothing (server >= 7.74.0) — it can race the run's natural last moments, and then the run's own
23624
+ ending stands: the result does NOT carry `haltedByUser`, and the only trace of that halt is the `task.halt_unconsumed` engine notice.
23625
+ required: [taskId, status, turnCut]
23626
+ # 封闭:铸造点是逐字面量拼出的对象(server routes/runs.ts interrupt 段),不是引擎透传形。
23627
+ additionalProperties: false
23628
+ properties:
23629
+ taskId: { type: string }
23630
+ status: { type: string, description: 'The run status the server saw at acceptance time.' }
23631
+ turnCut: { type: boolean, description: 'true ⇔ THIS call cut a live turn; repeat calls answer false once the stop is latched (halt is naturally idempotent).' }
23632
+ note: { type: string, description: 'Contract note (逐句照 server 的契约,不多许诺一个字).' }
23558
23633
 
23559
23634
  SubagentSteerReceipt:
23560
23635
  type: object
@@ -23859,11 +23934,11 @@ components:
23859
23934
  EntryProblem:
23860
23935
  type: object
23861
23936
  description: >
23862
- One ENTRY PROBLEM (server >= 7.133.0): a refusal body's `detail.problems[]` element and an accept-time `warnings[]` element share this shape. `code` = the refusal code the problem belongs to (in `warnings[]`: the engine's
23937
+ One ENTRY PROBLEM (server >= 7.133.0): a refusal body's `problems[]` element (server >= 7.148.0 a ROOT key; <= 7.147.x nested under `detail`) and an accept-time `warnings[]` element share this shape. `code` = the refusal code the problem belongs to (in `warnings[]`: the engine's
23863
23938
  reading code for that entry); `field` = the coordinate of the list holding the entry in the request body (`settings.permissions.allow`, `skills[i].allowedTools` …); `entry` = the entry string (passed through the server''s
23864
23939
  redaction mouth — not a guarantee of your original bytes); `reason` = the machine reason — mostly the ENGINE''s word verbatim (why it read the entry as nothing); the server mints two of its own, `not_in_roster` (accept-time
23865
23940
  warnings only: the name in an allow-side selector list is not in the roster and is no protocol namespace name — the engine accepts it anyway) and `home_unresolvable` (settings-rule 422: a `~/` path rule on a deployment that cannot
23866
- resolve the execution environment''s home); and `below_trust_floor` (the caller''s trust tier is below the member''s admission floor — see ErrorResponse.detail.callerTrust). Read OPEN.
23941
+ resolve the execution environment''s home); and `below_trust_floor` (the caller''s trust tier is below the member''s admission floor — see ErrorResponse.callerTrust, a root key from server >= 7.148.0). Read OPEN.
23867
23942
  required: [code, field, entry, reason]
23868
23943
  additionalProperties: false
23869
23944
  properties: