@sema-agent/sdk 41.1.0 → 42.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +115 -1
  2. package/dist/bitless-surfaces.d.ts +12 -1
  3. package/dist/bitless-surfaces.d.ts.map +1 -1
  4. package/dist/bitless-surfaces.js +14 -1
  5. package/dist/bitless-surfaces.js.map +1 -1
  6. package/dist/client.d.ts +14 -11
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +5 -5
  9. package/dist/client.js.map +1 -1
  10. package/dist/errors.d.ts +50 -8
  11. package/dist/errors.d.ts.map +1 -1
  12. package/dist/errors.js +56 -17
  13. package/dist/errors.js.map +1 -1
  14. package/dist/events.d.ts +185 -6
  15. package/dist/events.d.ts.map +1 -1
  16. package/dist/events.js +6 -0
  17. package/dist/events.js.map +1 -1
  18. package/dist/health.d.ts +9 -2
  19. package/dist/health.d.ts.map +1 -1
  20. package/dist/health.js +15 -3
  21. package/dist/health.js.map +1 -1
  22. package/dist/index.d.ts +11 -5
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +4 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/registry-conflict.d.ts +23 -2
  27. package/dist/registry-conflict.d.ts.map +1 -1
  28. package/dist/registry-conflict.js +37 -6
  29. package/dist/registry-conflict.js.map +1 -1
  30. package/dist/resources/adoption.d.ts +2 -4
  31. package/dist/resources/adoption.d.ts.map +1 -1
  32. package/dist/resources/adoption.js +30 -1
  33. package/dist/resources/adoption.js.map +1 -1
  34. package/dist/resources/approvals.d.ts +16 -11
  35. package/dist/resources/approvals.d.ts.map +1 -1
  36. package/dist/resources/approvals.js +19 -4
  37. package/dist/resources/approvals.js.map +1 -1
  38. package/dist/resources/assistant.d.ts +3 -5
  39. package/dist/resources/assistant.d.ts.map +1 -1
  40. package/dist/resources/assistant.js +23 -2
  41. package/dist/resources/assistant.js.map +1 -1
  42. package/dist/resources/attachments.d.ts +2 -4
  43. package/dist/resources/attachments.d.ts.map +1 -1
  44. package/dist/resources/attachments.js +27 -1
  45. package/dist/resources/attachments.js.map +1 -1
  46. package/dist/resources/control/auth-providers.d.ts +2 -4
  47. package/dist/resources/control/auth-providers.d.ts.map +1 -1
  48. package/dist/resources/control/auth-providers.js +13 -1
  49. package/dist/resources/control/auth-providers.js.map +1 -1
  50. package/dist/resources/control/config.d.ts +5 -12
  51. package/dist/resources/control/config.d.ts.map +1 -1
  52. package/dist/resources/control/config.js +13 -4
  53. package/dist/resources/control/config.js.map +1 -1
  54. package/dist/resources/control/fleet.d.ts +6 -16
  55. package/dist/resources/control/fleet.d.ts.map +1 -1
  56. package/dist/resources/control/fleet.js +13 -5
  57. package/dist/resources/control/fleet.js.map +1 -1
  58. package/dist/resources/control/images.d.ts +4 -10
  59. package/dist/resources/control/images.d.ts.map +1 -1
  60. package/dist/resources/control/images.js +14 -3
  61. package/dist/resources/control/images.js.map +1 -1
  62. package/dist/resources/control/publish.d.ts +2 -4
  63. package/dist/resources/control/publish.d.ts.map +1 -1
  64. package/dist/resources/control/publish.js +8 -1
  65. package/dist/resources/control/publish.js.map +1 -1
  66. package/dist/resources/control/secrets.d.ts +3 -6
  67. package/dist/resources/control/secrets.d.ts.map +1 -1
  68. package/dist/resources/control/secrets.js +16 -2
  69. package/dist/resources/control/secrets.js.map +1 -1
  70. package/dist/resources/control/users.d.ts +2 -4
  71. package/dist/resources/control/users.d.ts.map +1 -1
  72. package/dist/resources/control/users.js +12 -1
  73. package/dist/resources/control/users.js.map +1 -1
  74. package/dist/resources/control/versioning.d.ts +3 -6
  75. package/dist/resources/control/versioning.d.ts.map +1 -1
  76. package/dist/resources/control/versioning.js +10 -2
  77. package/dist/resources/control/versioning.js.map +1 -1
  78. package/dist/resources/control/workers.d.ts +2 -4
  79. package/dist/resources/control/workers.d.ts.map +1 -1
  80. package/dist/resources/control/workers.js +9 -1
  81. package/dist/resources/control/workers.js.map +1 -1
  82. package/dist/resources/devices.d.ts +2 -4
  83. package/dist/resources/devices.d.ts.map +1 -1
  84. package/dist/resources/devices.js +59 -1
  85. package/dist/resources/devices.js.map +1 -1
  86. package/dist/resources/fleet.d.ts +5 -4
  87. package/dist/resources/fleet.d.ts.map +1 -1
  88. package/dist/resources/fleet.js +2 -1
  89. package/dist/resources/fleet.js.map +1 -1
  90. package/dist/resources/images.d.ts +5 -12
  91. package/dist/resources/images.d.ts.map +1 -1
  92. package/dist/resources/images.js +16 -6
  93. package/dist/resources/images.js.map +1 -1
  94. package/dist/resources/leader.d.ts +3 -7
  95. package/dist/resources/leader.d.ts.map +1 -1
  96. package/dist/resources/leader.js +9 -2
  97. package/dist/resources/leader.js.map +1 -1
  98. package/dist/resources/memory.d.ts +3 -7
  99. package/dist/resources/memory.d.ts.map +1 -1
  100. package/dist/resources/memory.js +32 -4
  101. package/dist/resources/memory.js.map +1 -1
  102. package/dist/resources/models.d.ts +4 -5
  103. package/dist/resources/models.d.ts.map +1 -1
  104. package/dist/resources/models.js +13 -2
  105. package/dist/resources/models.js.map +1 -1
  106. package/dist/resources/ops.d.ts +8 -20
  107. package/dist/resources/ops.d.ts.map +1 -1
  108. package/dist/resources/ops.js +16 -7
  109. package/dist/resources/ops.js.map +1 -1
  110. package/dist/resources/policy.d.ts +2 -4
  111. package/dist/resources/policy.d.ts.map +1 -1
  112. package/dist/resources/policy.js +9 -1
  113. package/dist/resources/policy.js.map +1 -1
  114. package/dist/resources/projects.d.ts +3 -6
  115. package/dist/resources/projects.d.ts.map +1 -1
  116. package/dist/resources/projects.js +8 -2
  117. package/dist/resources/projects.js.map +1 -1
  118. package/dist/resources/rules.d.ts +2 -4
  119. package/dist/resources/rules.d.ts.map +1 -1
  120. package/dist/resources/rules.js +67 -1
  121. package/dist/resources/rules.js.map +1 -1
  122. package/dist/resources/runs.d.ts +5 -9
  123. package/dist/resources/runs.d.ts.map +1 -1
  124. package/dist/resources/runs.js +11 -6
  125. package/dist/resources/runs.js.map +1 -1
  126. package/dist/resources/session-sync.d.ts +6 -11
  127. package/dist/resources/session-sync.d.ts.map +1 -1
  128. package/dist/resources/session-sync.js +45 -4
  129. package/dist/resources/session-sync.js.map +1 -1
  130. package/dist/resources/sessions.d.ts +44 -38
  131. package/dist/resources/sessions.d.ts.map +1 -1
  132. package/dist/resources/sessions.js +64 -22
  133. package/dist/resources/sessions.js.map +1 -1
  134. package/dist/resources/tool-approvals.d.ts +25 -17
  135. package/dist/resources/tool-approvals.d.ts.map +1 -1
  136. package/dist/resources/tool-approvals.js +22 -1
  137. package/dist/resources/tool-approvals.js.map +1 -1
  138. package/dist/resources/trace.d.ts +6 -12
  139. package/dist/resources/trace.d.ts.map +1 -1
  140. package/dist/resources/trace.js +12 -7
  141. package/dist/resources/trace.js.map +1 -1
  142. package/dist/resources/usage.d.ts +9 -12
  143. package/dist/resources/usage.d.ts.map +1 -1
  144. package/dist/resources/usage.js +13 -4
  145. package/dist/resources/usage.js.map +1 -1
  146. package/dist/resources/workflows.d.ts +7 -10
  147. package/dist/resources/workflows.d.ts.map +1 -1
  148. package/dist/resources/workflows.js +13 -3
  149. package/dist/resources/workflows.js.map +1 -1
  150. package/dist/sse.d.ts +79 -29
  151. package/dist/sse.d.ts.map +1 -1
  152. package/dist/sse.js +174 -152
  153. package/dist/sse.js.map +1 -1
  154. package/dist/sync.d.ts +16 -27
  155. package/dist/sync.d.ts.map +1 -1
  156. package/dist/sync.js +40 -44
  157. package/dist/sync.js.map +1 -1
  158. package/dist/transport.d.ts +31 -2
  159. package/dist/transport.d.ts.map +1 -1
  160. package/dist/transport.js +22 -9
  161. package/dist/transport.js.map +1 -1
  162. package/dist/types.d.ts +245 -28
  163. package/dist/types.d.ts.map +1 -1
  164. package/dist/types.js +14 -1
  165. package/dist/types.js.map +1 -1
  166. package/openapi.yaml +558 -55
  167. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -1362,6 +1362,9 @@ paths:
1362
1362
  application/json:
1363
1363
  schema:
1364
1364
  type: object
1365
+ # server >= 7.153.0 (BREAKING): the body is CLOSED `{ instructions? }` — a non-object body (array / scalar) => 400 `request.invalid_json` + `reason: "not_object"`;
1366
+ # a key outside the set => 400 `request.body_shape` + `unknownKeys` (<= 7.152.x: an array body was taken as empty and unknown keys were silently ignored).
1367
+ additionalProperties: false
1365
1368
  properties:
1366
1369
  instructions: { type: string, minLength: 1, description: 'Targeted compaction directive; ≤2048 code points (engine cap, enforced fail-loud).' }
1367
1370
  responses:
@@ -1376,10 +1379,20 @@ paths:
1376
1379
  '401': { $ref: '#/components/responses/Unauthorized' }
1377
1380
  '404': { $ref: '#/components/responses/NotFound' }
1378
1381
  '409':
1379
- description: 'errorCode "compact.not_running" — run is terminal, or active on another replica (manual compact is replica-local).'
1382
+ description: >-
1383
+ errorCode `compact.not_running` — this replica has no live manual-compact face for the run (manual compact is replica-local). server >= 7.153.0 the body root carries a machine key `cause`, a CLOSED four-word set,
1384
+ always present: `run_terminal` (the run has ended, or the engine said so on its first beat) · `run_parked` (the run waits on an approval / review / resource gate) · `run_on_other_replica` (the row PROVES it lives on another
1385
+ replica) · `run_not_steerable` (read as running, no steerable face on this replica, and it cannot be proven elsewhere — e.g. this replica's own verify / cascade leg). The two first-beat shapes (the engine's
1386
+ synchronous `steering.not_running`, or a `mooted` settling in the same beat) used to answer `202`; they now answer this 409. `run_terminal` sentences end with a pointer to `POST /v1/sessions/{id}/compact`.
1387
+ <= 7.152.x: no `cause`; every `running` row not on this replica read as "active on another replica".
1380
1388
  content:
1381
1389
  application/json:
1382
- schema: { $ref: '#/components/schemas/ErrorResponse' }
1390
+ schema:
1391
+ allOf:
1392
+ - $ref: '#/components/schemas/ErrorResponse'
1393
+ - type: object
1394
+ properties:
1395
+ cause: { type: string, enum: [run_terminal, run_parked, run_on_other_replica, run_not_steerable] }
1383
1396
  '429': { $ref: '#/components/responses/RateLimited' } # (declared 2026-07-31) rateLimited||quotaExceeded||leaseDenied all gate this verb (routes/runs.ts)
1384
1397
  '501': { $ref: '#/components/responses/NotImplemented' }
1385
1398
 
@@ -1867,6 +1880,12 @@ paths:
1867
1880
  name: owner
1868
1881
  schema: { type: string }
1869
1882
  description: Fleet-wide credential only — scope the page to a tenant. Ignored for a principal caller.
1883
+ - in: query
1884
+ name: sessionKind
1885
+ required: false
1886
+ schema: { type: string, enum: [sidechain] }
1887
+ description: >-
1888
+ Server >= 7.151.0 (read `capabilities.sessionKinds`): `sidechain` selects the VIEW of client-placed sub-conversations; absent = the default view (top-level sessions only). A word outside the set => 400 `request.query_invalid`.
1870
1889
  - in: query
1871
1890
  name: q
1872
1891
  required: false
@@ -2717,22 +2736,7 @@ paths:
2717
2736
  # 🔴 请求体里的 `rules` 收闭(server >= 7.129.0:写口的判官拒一切不是桶的键,含退役命令桶 ⇒ 400 `rules.invalid_shape`)。
2718
2737
  # `SessionPermissionRules` 本体保持开放(响应 / 同步面的 `StoredSessionRules` 经 allOf 引它并再加 `rev` / `gen`,本体收闭会把合法的 `rev` 判成违约);
2719
2738
  # 所以收闭落在**这一个引用点**:allOf + 本地镜像三桶 + `additionalProperties:false`(spec.test 的通用「封闭 allOf 必须镜像分支键」门看守镜像完整)。
2720
- rules:
2721
- allOf: [{ $ref: '#/components/schemas/SessionPermissionRules' }]
2722
- additionalProperties: false
2723
- properties:
2724
- toolAllow: { type: array, items: { type: string } }
2725
- toolDeny: { type: array, items: { type: string } }
2726
- allowDirs: { type: array, items: { type: string } }
2727
- # server >= 7.129.0 (engine 7.51.2): a stored body echoed back (GET → edit → PUT) may carry its `rev` and `grammar`;
2728
- # the engine reads the entries in THAT grammar (`rev` without `grammar` = grammar 0 ⇒ a rule-spelled allow entry
2729
- # answers `400 rules.inert_entry` reason `earlier_grammar`; the way out is to send the three buckets alone — the
2730
- # write judge stamps the current grammar). `grammar` newer than the engine's ⇒ `400 rules.invalid_shape`.
2731
- rev: { type: integer, minimum: 0 }
2732
- grammar: { type: integer, minimum: 0 }
2733
- # server >= 7.135.0 (engine 7.55.0): a stored body echoed back (GET → edit → PUT) may also carry its `operatorRules`; on THIS door the echoed part is ALWAYS ignored — the route reads the value through the write reader
2734
- # (its product carries no `rev`) and the store judges it again: over an existing row the STORED row's operator part is kept, over no row an empty stamped part is minted. Do not rely on an echo to move the operator line — send the new value without `operatorRules`.
2735
- operatorRules: { $ref: '#/components/schemas/SessionRulesOperatorPart' }
2739
+ rules: { $ref: '#/components/schemas/SessionRulesWrite' }
2736
2740
  expectedRev: { type: integer, minimum: 0, description: CAS — reject if the stored rev differs. }
2737
2741
  responses:
2738
2742
  '200':
@@ -3357,7 +3361,7 @@ paths:
3357
3361
  (`application/octet-stream`). 🔴 SCOPE BOUNDARY (the security boundary — a content-addressed blob is
3358
3362
  shared across sessions): the cloud serves a hash ONLY if THIS session's HISTORY GRAPH references it
3359
3363
  (some tracked file version's `blobHash` in its exportHistory envelope). A foreign / unreferenced hash
3360
- → 404 `not_found.blob`, never a blind read; a server whose file-history store has no blob faces
3364
+ → 404 `not_found.blob` (the sentence is the frozen text `blob not found`), never a blind read; a server whose file-history store has no blob faces
3361
3365
  (e.g. the local file backend) answers the SAME 404 shape (no oracle — "nothing servable" and "not
3362
3366
  referenced" are deliberately indistinguishable). 400 `request.id_invalid` on a non-64-hex hash.
3363
3367
  Owner-scoped (404). Replaces the retired snapshot-scoped PULL arm of servers <= 7.51 (below the support floor; sdk 26.0.0 deleted `getBlob` and its path).
@@ -4758,7 +4762,7 @@ paths:
4758
4762
  Gate order: 429 `limit.rate_exceeded` -> capability facts (501) -> id shape (400) -> session head (404) -> owner or explicit operator (a stranger and "no such session" answer byte-identical 404) -> corrupt archive (500) -> body (400)
4759
4763
  -> the one execution-start resolver (read-only mirror 409 `conflict.session_mirror` + `forkPath`; `conflict.fork_in_progress`; `conflict.session_id_retired`; `execution_lane.not_served` + `boundLane`) -> workspace root (host lane: 409
4760
4764
  `conflict.session_workspace_unknown`) -> `to` resolution (404 `rewind_files_to.unknown_event`) -> the durable claim (409 `conflict.session_active_run` with `activeTaskId`) -> the engine. Not billed.
4761
- Probe with the capability bits `sessionRewindFiles` / `sessionRewindFilesPreview`; an ABSENT bit = an older server (404 `not_found.route`). The SDK does not auto-retry (a POST with no idempotency key).
4765
+ Probe with the capability bits `sessionRewindFiles` / `sessionRewindFilesPreview` (and, for the body key `cwd`, `sessionRewindFilesCwd`); an ABSENT bit = an older server (404 `not_found.route`). The SDK does not auto-retry (a POST with no idempotency key).
4762
4766
  requestBody:
4763
4767
  required: true
4764
4768
  content:
@@ -4790,6 +4794,64 @@ paths:
4790
4794
  application/json:
4791
4795
  schema: { $ref: '#/components/schemas/ErrorResponse' }
4792
4796
  '501': { $ref: '#/components/responses/NotImplemented' }
4797
+ '503':
4798
+ description: >-
4799
+ server >= 7.153.0 — `rewind.restore_failed` (BREAKING; <= 7.152.x: a generic 500 `internal.error`): the file-history store answered `failed` during the restore, or the restore went half-way and this door has no
4800
+ partial-restore policy. The body root is `{ error, errorCode, permanence? }` (`permanence` = the store's retry judgement, `transient` / `terminal`, present only when the store judged; the body has no `detail`; the store's own
4801
+ code is in the engine's sentence). Files may already be partly rewritten (the ledger summary is in the sentence); re-sending the same request keeps converging (per-file idempotent). `terminal` => repair the store first.
4802
+ content:
4803
+ application/json:
4804
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4805
+ /v1/sessions/{sessionId}/compact:
4806
+ parameters:
4807
+ - $ref: '#/components/parameters/PrincipalHeader'
4808
+ - in: path
4809
+ name: sessionId
4810
+ required: true
4811
+ schema: { type: string }
4812
+ post:
4813
+ tags: [sessions]
4814
+ operationId: sessionsCompact
4815
+ x-status: live # server >= 7.153.0 (contract section 30). SDK sessions.compact().
4816
+ summary: Compact an IDLE session synchronously (no run holds it) — the `/compact` of a session that is not running.
4817
+ description: >
4818
+ server >= 7.153.0 (contract section 30; read `capabilities.sessionCompact` first — an ABSENT bit = an older server, 404 `not_found.route`) — synchronously summarises a session that NO run holds (the run-level door
4819
+ `POST /v1/runs/{taskId}/compact` stays the door for a run that is running: it compacts at the next turn boundary). The body is CLOSED (every key optional, `{}` is valid): `instructions` (non-empty, at most 2048 code
4820
+ points — the same judge as the run-level door), `model` / `compactionModel` (the submit body's fresh model judge: 400 `request.unknown_reference` + `available` / `request.model_unavailable` / `request.model_not_allowed`),
4821
+ `compaction: { clampTolerance? }` (a finite number in [0,1] else 400 `request.field_invalid`); any other key => 400 `request.body_shape` + `unknownKeys`. Gate order: billing gates (503) -> rate / quota / lease (429) ->
4822
+ capability fact (501) -> id shape (400) -> owner gate (surface `session.supervise`; an operator may override; a stranger and "no such session" answer byte-identical 404) -> store unreadable (500) -> body -> model ->
4823
+ the one execution-start resolver -> the durable claim (a run running or parked on a decision on ANY replica => 409 `conflict.session_active_run` with `activeTaskId` / `activeTaskStatus?`; the sentence points at
4824
+ `POST /v1/runs/<id>/compact` when running, or says answer the card first when parked) -> the engine's out-of-run compaction. 200 `{ outcome, events, usage? }`: the engine's `CompactOutcome` verbatim
4825
+ (`compacted` / `failed` / `mooted` / `noop` / `blocked` / `disabled`), the pass's frames in order (`compaction_started` then `compacted` or `compaction_outcome`, `trigger: "manual"`, the same `pass`), and the summary call's
4826
+ usage (present only when the pass made a model call). The summary commits ONLY onto the leaf it summarised: another writer moving the leaf during the summary call => `200 outcome: "failed"`, zero writes, the
4827
+ `compaction_outcome` frame carries `cause: "leaf_moved"` (the spend already happened). This door neither holds the claim nor creates a run row. The engine's refusals pass through the synchronous submit leg's code table:
4828
+ 409 `compact.session_busy` (transient: another leg of this replica's engine process holds the session lock) / 409 `compact.session_parked` (the session has a pending card; the sentence names its `checkpointId`) /
4829
+ 400 `compact.invalid_request` / 409 `config.unknown_role` / 404 `resume.session_not_found` (the occupant changed while the engine fetched the session); codes outside the table => 500. A connection closed before the
4830
+ response is written WITHDRAWS the call (`mooted`, zero writes; the summary spend may have happened): a front proxy's idle timeout for this door must not be shorter than one summary call. Not a submit; it reads no
4831
+ `Idempotency-Key`; the SDK does not auto-retry (resending is safe: just compacted with no new turn => `noop`).
4832
+ requestBody:
4833
+ required: false
4834
+ content:
4835
+ application/json:
4836
+ schema: { $ref: '#/components/schemas/SessionCompactRequest' }
4837
+ responses:
4838
+ '200':
4839
+ description: The pass settled (synchronous). `outcome` is the engine's verbatim word.
4840
+ content:
4841
+ application/json:
4842
+ schema: { $ref: '#/components/schemas/SessionCompactResult' }
4843
+ '400': { $ref: '#/components/responses/BadRequest' }
4844
+ '401': { $ref: '#/components/responses/Unauthorized' }
4845
+ '404': { $ref: '#/components/responses/NotFound' }
4846
+ '409':
4847
+ description: >-
4848
+ Told apart by `errorCode`: `conflict.session_active_run` (body `activeTaskId` + `activeTaskStatus?` — a run holds the session or is parked on a decision), `compact.session_busy` (transient), `compact.session_parked`,
4849
+ `config.unknown_role`, plus the shared execution-start refusals (`conflict.session_mirror` + `forkPath`, `conflict.fork_in_progress`, `conflict.session_id_retired`, `execution_lane.not_served` + `boundLane`).
4850
+ content:
4851
+ application/json:
4852
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
4853
+ '429': { $ref: '#/components/responses/RateLimited' }
4854
+ '501': { $ref: '#/components/responses/NotImplemented' }
4793
4855
  /v1/models:
4794
4856
  parameters:
4795
4857
  - $ref: '#/components/parameters/PrincipalHeader'
@@ -5092,7 +5154,14 @@ paths:
5092
5154
  properties:
5093
5155
  workflows:
5094
5156
  type: array
5095
- items: { $ref: '#/components/schemas/WorkflowRunSummary' }
5157
+ # 🔴 server >= 7.153.0 (BREAKING): each element is a UNION of two arms — the engine's readable summary, OR a row the engine could not read as stored (written by an older engine, or altered in storage):
5158
+ # exactly `{ id, unreadable: { errorCode } }` (`errorCode` = the engine's row-verdict code, today `workflow_run.row_malformed`; scope / member names / sentences never go on the wire).
5159
+ # The `?status=` filter reads the row's stored `status` as written (same => listed; different or unreadable => not listed). `GET /v1/workflows/{id}` on the same id answers the byte-identical 404
5160
+ # `not_found.workflow` as for a missing run. <= 7.152.x dropped such rows from the list (only an operator counter was kept).
5161
+ items:
5162
+ oneOf:
5163
+ - { $ref: '#/components/schemas/WorkflowRunSummary' }
5164
+ - { $ref: '#/components/schemas/WorkflowListUnreadableRow' }
5096
5165
  '401': { $ref: '#/components/responses/Unauthorized' }
5097
5166
  '501': { $ref: '#/components/responses/NotImplemented' }
5098
5167
 
@@ -7661,14 +7730,14 @@ components:
7661
7730
  type: string
7662
7731
  description: >
7663
7732
  Primary routing axis (one image serves many). Selects model/tools/skills/prompt. OPEN: a stock server's builtin
7664
- table is `code` (factory default) / `default` / `code-review` / `scan` (SDK `KNOWN_SCENARIOS`, checked against the
7733
+ table is `code` (factory default) / `default` / `code-review` / `scan` / `cowork` (SDK `KNOWN_SCENARIOS`, checked against the
7665
7734
  published server's `buildScenarios()` table; servers <= 7.125.x also listed `discuss`, retired with the whole team-orchestration surface at
7666
7735
  7.126.0, no alias) — and a deployment may register more through the registry. A name
7667
7736
  the caller SENDS that the deployment does not serve is a loud 400 `scenario_unknown` (server >= 5.1.0, the body
7668
7737
  carries the live vocabulary) — the silent fold to `default` exists only on the server-side ASSIGNMENT chain.
7669
7738
  Retired, no alias: `oa` (5.0.0), `autonomous` ([2400] CAPS-OPS-11), `team` (renamed `discuss`, server #273 / C-R14;
7670
7739
  alias withdrawn at #342).
7671
- examples: ['code', 'default', 'code-review', 'scan']
7740
+ examples: ['code', 'default', 'code-review', 'scan', 'cowork']
7672
7741
 
7673
7742
  ScenarioSource:
7674
7743
  type: string
@@ -8293,11 +8362,30 @@ components:
8293
8362
  `turnReminder` is absent), echoed on the stream as `steering_injected` with `source: "output_style"`. One fact, one seat: the
8294
8363
  style's BODY (the guide text) still goes in `settings.outputStyle`; this key carries only the name and the per-turn line.
8295
8364
  The value's owner is the engine (exactly these two keys, `name` non-empty and at most 256 characters, `turnReminder` a non-empty
8296
- string when present); the server does not judge it — a bad value is accepted and refused at prepare, the run ends `failed` with
8297
- code `config.output_style_invalid` (never silently ignored).
8365
+ string when present); the server does not judge it — a bad value is refused at prepare (never silently ignored). Server >= 7.153.0
8366
+ (BREAKING): the synchronous `POST /v1/tasks` leg refuses BEFORE the run starts — `400` + `{ error, errorCode: "config.output_style_invalid" }`
8367
+ (no run envelope, the submit idempotency key is not spent, zero model calls); <= 7.152.x it was `200` + a `failed` terminal with the same code.
8368
+ The streaming leg (`200` stream, terminal `done` frame) and the async leg (`202` + a terminal run row) keep their status and code.
8298
8369
  properties:
8299
8370
  name: { type: string, minLength: 1, maxLength: 256 }
8300
8371
  turnReminder: { type: string, minLength: 1 }
8372
+ wake:
8373
+ type: string
8374
+ description: >-
8375
+ Server >= 7.153.0 (send only when `capabilities.wake` is true; an older server answers 400 `request.body_shape`): the WAKE leg — a leg that carries no input of its own and
8376
+ opens on the task notifications parked for this session's occupant while it was idle (a background sub-agent / command / workflow finished). Handed verbatim to the engine
8377
+ (`TaskSpec.wake`); the closed word set is owned by the engine and not judged here — today the only word is `parked_notifications`. `objective` must be empty alongside it
8378
+ (the empty-objective gate only applies to bodies without `wake`); a word outside the engine's set, or `wake` with a non-empty `objective` / `images` / `userAttachments`, is refused
8379
+ before the run as `config.invalid_argument` (synchronous leg 400, the sentence names `TaskSpec.wake`); nothing parked when the leg opens ⇒ `config.nothing_to_wake` (synchronous leg 409,
8380
+ the idempotency key is not spent).
8381
+ language:
8382
+ type: string
8383
+ description: >-
8384
+ Server >= 7.153.0 (send only when `capabilities.language` is true; an older server answers 400 `request.body_shape`): the reply language the user set in the shell (free name or
8385
+ code, e.g. `Japanese` / `ja`), handed verbatim to the engine (`TaskSpec.language`), which states it to the model in its own `# Language` reminder (never in the system prompt). The ENGINE is
8386
+ the only judge of the value shape: not a string / blank / more than 256 characters (a JSON `null` is a non-string) ⇒ refused before the run as `config.language_invalid` (synchronous leg 400,
8387
+ streaming leg 200 + terminal `done`, async leg 202 + terminal run row, same code). Send it on EVERY submit: absent after having been stated makes the engine tell the model the
8388
+ preference was cleared.
8301
8389
  promptLean:
8302
8390
  type: boolean
8303
8391
  description: >
@@ -8474,7 +8562,16 @@ components:
8474
8562
  EXPLICIT `permissionDecision: "allow"` states it (and binds only the arguments the hook saw); a hook that only adds
8475
8563
  `additionalContext` / only rewrites `updatedInput` states nothing.
8476
8564
  additionalProperties: true
8477
- cwd: { type: string, description: Working directory for the execution env. }
8565
+ sessionKind:
8566
+ type: string
8567
+ enum: [sidechain]
8568
+ description: >-
8569
+ Server >= 7.151.0 (read `capabilities.sessionKinds` first): the KIND of the session this submission CREATES — `sidechain` = a client-placed sub-conversation: it is not listed by `GET /v1/sessions` unless asked for with `?sessionKind=sidechain`, and is deleted after the deployment's background-agent retention window of inactivity. Absent = a top-level conversation. Written ONCE when the session is created and never changes (a different kind on an existing session => 409 `conflict.session_kind_mismatch`, body `sessionKind` = the row's kind); a deployment whose session store cannot record the kind answers 501.
8570
+ cwd:
8571
+ type: string
8572
+ description: >-
8573
+ Working directory for the execution env. ABSENT IS LEGAL — never an error: the run still has a working directory (a run with zero tools is not a run without one). Where an absent `cwd` lands depends on
8574
+ the lane; on the local host lane it is a PER-TASK temporary directory. A present `cwd` is honoured only on the single-owner host and device lanes (a host path; cloud / multi-tenant lanes ignore it).
8478
8575
  deviceId:
8479
8576
  type: string
8480
8577
  description: >
@@ -8605,7 +8702,10 @@ components:
8605
8702
  hands, the engine's own tools, MCP / A2A, scenario and leg tools) ∩ `allowTools` − `excludeTools` (deny wins), computed by the engine once before the run starts.
8606
8703
  `["*"]` = no list at this layer (same as absent); `[]` = give nothing; an entry is a wire name or alias, `Tool(content)` (the whole tool), `mcp__srv` / `mcp__srv__*` /
8607
8704
  a tool-segment wildcard (`mcp__*` is rejected on this list). A leg's protocol tools (a delegated child's `ReportBlocked`, …) need no mention. A name that NO tool answers to
8608
- => `config.tool_face_control` (sync leg 400, no token burned; streamed / background legs: a `failed` terminal with the same code). Wrong shape (not a string array) =>
8705
+ => on server 7.126.0–7.128.x `config.tool_face_control` (sync leg 400, no token burned; streamed / background legs: a `failed` terminal with the same code); on server >= 7.129.0 the run goes as
8706
+ written (the entry is kept; an operator row `runner_config_advisory` announces it once); on server >= 7.132.0 a near-miss / retired-with-successor name is refused before the run (`config.tool_face_control`,
8707
+ sync leg 400). NOT body keys: `allowedTools` / `disallowedTools` are SKILL members (`skills[]`), never top-level submit keys — sending them top-level is `400 request.body_shape`; the three top-level keys that
8708
+ decide tool availability are `excludeTools`, `allowTools` and `excludeAllTools`. Wrong shape (not a string array) =>
8609
8709
  400 `request.field_invalid`, the same gate as `excludeTools` / `deferTools`. An engine older than 7.49.0 rejects loudly (400 `request.field_invalid` naming `allowTools`) —
8610
8710
  never silently dropped (dropping a narrowing key widens). No capability bit: probe by key closure (<= 7.125.x answers `400 request.body_shape` with the name in
8611
8711
  `unknownKeys`). The A2A inbound face (`message/send`) does not carry this key.
@@ -8783,7 +8883,9 @@ components:
8783
8883
  bypassBreaker: { type: boolean, description: 'Operator-only; silently dropped for non-operator callers.' }
8784
8884
  compaction:
8785
8885
  type: object
8786
- description: Compaction tuning for this task.
8886
+ description: >-
8887
+ Compaction tuning for this task. Server >= 7.153.0: `clampTolerance` outside the finite range [0, 1] is `400 request.field_invalid` on all three submit doors
8888
+ (the same judge as `POST /v1/sessions/{id}/compact`); before it was accepted and the key silently dropped at assembly.
8787
8889
  properties:
8788
8890
  clampTolerance: { type: number }
8789
8891
 
@@ -10611,6 +10713,59 @@ components:
10611
10713
  server >= 7.137.0 (always true — a version fact, hangs on no facility): `POST /v1/assistant/tasks/{taskId}/plan_review` accepts the gate-identity key `checkpointId` (the gate you decided on
10612
10714
  changed => 409 `approval_stale`, nothing recorded). It answers "does this binary's gate accept the key", not "is plan_review usable on this deployment". Read the bit BEFORE sending the
10613
10715
  key: ABSENT = an older server (7.86.0-7.136.x answer the key with 400 `request.body_shape`; older ones drop it silently).
10716
+ wake:
10717
+ type: boolean
10718
+ description: >-
10719
+ server >= 7.153.0 (always true — a version fact): this build accepts the top-level submit key `wake` (the WAKE leg: opens on the task notifications parked for the session's idle occupant,
10720
+ carries no input of its own). Read it BEFORE sending the key: ABSENT = an older server (answers `400 request.body_shape`).
10721
+ language:
10722
+ type: boolean
10723
+ description: >-
10724
+ server >= 7.153.0 (always true — a version fact; single-user and multi-tenant answer alike, it is the requester's own preference and widens no gate): this build accepts the top-level
10725
+ submit key `language` (the reply language, handed verbatim to the engine). Read it BEFORE sending the key: ABSENT = an older server.
10726
+ resumeCursorNotice:
10727
+ type: boolean
10728
+ description: >-
10729
+ server >= 7.153.0 (always true — a version fact): the ledger read doors (`GET /v1/runs/{id}/events`, `GET /v1/tasks/{id}/stream`, `GET /v1/images/bakes/{id}/events`) tell the caller when a
10730
+ present `Last-Event-ID` / `?from=` cursor is not a finite number: the replay still starts at the ledger head, and the response carries the header `x-resume-cursor: unrecognized` plus one
10731
+ leading SSE comment line. ABSENT = an older server (silent replay from the head).
10732
+ lastWireBreakingVersion:
10733
+ type: string
10734
+ pattern: '^\d+\.\d+\.\d+$'
10735
+ description: >-
10736
+ server >= 7.153.0 (always present, no deployment or caller dependence): the MOST RECENT server version whose wire change list carried a hard-breaking row (full `x.y.z`). Compare by semver
10737
+ numeric order, never by string order: a value newer than the contract the client was checked against means this server has had an incompatible wire change since — tell the user, do not
10738
+ block. Wire face only (deployment-face breaks — stop-migrate-start, refuse-to-boot knobs — are not in it). ABSENT = a server <= 7.152.x: unknown.
10739
+ sessionRulesGrammar:
10740
+ type: integer
10741
+ minimum: 0
10742
+ description: >-
10743
+ server >= 7.153.0 (always present; a build fact — does not vary by session or caller): the session-rules grammar number of the engine this server links (7 on the 7.153.0 bytes).
10744
+ `PUT /v1/sessions/{id}/policy` must carry `rules.grammar` (absent => 400 `rules.grammar_required`): for the FIRST write (the session has no rules row yet) stamp this value; with a row,
10745
+ send the row's own `grammar` back. ABSENT = an older server: use the grammar number the caller itself chose (7.152.x and older accept a stamped body and read by the stamp).
10746
+ sessionCompact:
10747
+ type: boolean
10748
+ description: >-
10749
+ server >= 7.153.0: `POST /v1/sessions/{id}/compact` (the idle-session manual compaction door) is open = a session store with head reads AND a durable run store AND the engine's compaction
10750
+ commit compares-and-swaps on the summarised leaf (`DB_BACKEND=mysql|pg|local` always true, `memory` false). Reads the same fact as the door's 501 (`capability.session_store_required` /
10751
+ `capability.run_store_required` / `capability.unavailable`). ABSENT = an older server (the door is 404 `not_found.route`).
10752
+ sessionKinds:
10753
+ type: array
10754
+ items: { type: string, enum: [sidechain] }
10755
+ description: >-
10756
+ Server >= 7.151.0: the session kinds this deployment can RECORD (`["sidechain"]` where the session store records a session's kind and ages such sessions out — `DB_BACKEND=mysql|pg|local`; `[]` elsewhere,
10757
+ where `sessionKind` on a submit answers 501). ABSENT = an older server.
10758
+ sessionRewindFilesCwd:
10759
+ type: boolean
10760
+ description: >-
10761
+ server >= 7.153.0: the immediate rewind door `POST /v1/sessions/{id}/rewind-files` accepts the optional body key `cwd`. Reads the same fact as `sessionRewindFiles` (bit true => `sessionRewindFiles` true;
10762
+ false <=> the door is 501). It says "this server knows the key", not "this session's lane will use it" (single-owner host / device lanes honour it; ssh / adb take it and ignore it with one warn line).
10763
+ ABSENT (incl. <= 7.152.x) => do not send `cwd` (an older server answers 400 `request.body_shape`).
10764
+ user_attachments.read_state:
10765
+ type: boolean
10766
+ description: >-
10767
+ ENGINE CAPABILITY WORD (core `ENGINE_CAPABILITIES`' fourth word, core 7.67.0; server >= 7.153.0 projects it, always `true`; the key IS the word, dotted): this engine reads the read-state of request-layer
10768
+ attachments (`TaskRequest.userAttachments`). ABSENT = an older server / engine: read it as "not promised", not as "absent capability".
10614
10769
  credentialPlane:
10615
10770
  allOf: [{ $ref: '#/components/schemas/CredentialPlaneCapability' }]
10616
10771
  description: >-
@@ -13261,6 +13416,67 @@ components:
13261
13416
  properties:
13262
13417
  to: { type: string, minLength: 1, maxLength: 255, description: 'A rewind handle this server minted (a prompt''s taskId, or a message''s eventId) — the same handle space and the same reader as the submit body''s `rewindFilesTo`. Unknown => 404 `rewind_files_to.unknown_event`.' }
13263
13418
  dryRun: { type: boolean, description: 'true => preview only; no file is written. Absent = false.' }
13419
+ cwd:
13420
+ type: string
13421
+ minLength: 1
13422
+ description: >-
13423
+ server >= 7.153.0 (send only when `capabilities.sessionRewindFilesCwd` is true; an older server answers 400 `request.body_shape`): the caller's statement of the working directory THIS rewind lands in —
13424
+ the same judge as the submit body's `cwd` (bad shape => 400 `request.field_invalid`, sentence `cwd must be a non-empty absolute host path`); honoured on the single-owner host and device lanes, ignored
13425
+ (with one server warn line) elsewhere; it wins over the process-local registered cwd for this call and NEVER writes that registry; on the host lane the directory must exist (else 409
13426
+ `conflict.session_workspace_unknown`, no mkdir, `dryRun` judges the same). Absent => the registered cwd, as before.
13427
+
13428
+ SessionCompactRequest:
13429
+ type: object
13430
+ description: >-
13431
+ `POST /v1/sessions/{sessionId}/compact` body (server >= 7.153.0), CLOSED — every key optional, `{}` is valid. Any other key => 400 `request.body_shape` + `unknownKeys`.
13432
+ additionalProperties: false
13433
+ properties:
13434
+ instructions: { type: string, minLength: 1, description: 'Replaces the deployment''s compaction instructions for this pass; at most 2048 code points (the same judge as `POST /v1/runs/{taskId}/compact`).' }
13435
+ model: { type: string, description: 'A catalog name, tier word or id the caller may pick (the submit body''s model judge); absent => the deployment default.' }
13436
+ compactionModel: { type: string, description: 'The summary model (same judge and codes as `model`); absent => the deployment''s summarize role.' }
13437
+ compaction:
13438
+ type: object
13439
+ additionalProperties: false
13440
+ description: 'The submit body''s `compaction` object: only `clampTolerance` (a finite number in [0,1], else 400 `request.field_invalid`).'
13441
+ properties:
13442
+ clampTolerance: { type: number, minimum: 0, maximum: 1 }
13443
+
13444
+ SessionCompactUsage:
13445
+ type: object
13446
+ description: >-
13447
+ The summary call's usage, the engine's keys verbatim, EACH PRESENT ONLY WHEN SET. `unpriced` present => `costMicroUsd` is not an amount.
13448
+ additionalProperties: false
13449
+ properties:
13450
+ tokens: { type: integer, minimum: 0 }
13451
+ totalInputTokens: { type: integer, minimum: 0 }
13452
+ promptTokens: { type: integer, minimum: 0 }
13453
+ cachedTokens: { type: integer, minimum: 0 }
13454
+ cacheWriteTokens: { type: integer, minimum: 0 }
13455
+ outputTokens: { type: integer, minimum: 0 }
13456
+ costMicroUsd: { type: number }
13457
+ usageMissing: { type: boolean, enum: [true], description: 'A reply reported no usage (a lower bound); always the literal `true`, never `false`.' }
13458
+ unpriced: { type: boolean, enum: [true], description: 'A call ran on a model with no price entry, so `costMicroUsd` is not an amount; always the literal `true`, never `false`.' }
13459
+
13460
+ SessionCompactResult:
13461
+ type: object
13462
+ description: >-
13463
+ `POST /v1/sessions/{sessionId}/compact` 200 body (server >= 7.153.0). Synchronous: the engine's out-of-run compaction has fully settled. A pass whose commit loses the compare-and-swap on the summarised leaf is
13464
+ `outcome: "failed"` with zero writes (the `compaction_outcome` frame carries `cause: "leaf_moved"`).
13465
+ additionalProperties: false
13466
+ required: [outcome, events]
13467
+ properties:
13468
+ outcome: { type: string, enum: [compacted, failed, mooted, noop, blocked, disabled], description: 'The engine''s `CompactOutcome`, verbatim.' }
13469
+ events:
13470
+ type: array
13471
+ description: >-
13472
+ The pass's frames in order, each the run stream's projection of the same frame (`compaction_started` then `compacted` or `compaction_outcome`, `trigger: "manual"`, the same `pass`); `[]` when the call was withdrawn
13473
+ before the pass ran.
13474
+ items:
13475
+ oneOf:
13476
+ - $ref: '#/components/schemas/Event_compaction_started'
13477
+ - $ref: '#/components/schemas/Event_compacted'
13478
+ - $ref: '#/components/schemas/Event_compaction_outcome'
13479
+ usage: { $ref: '#/components/schemas/SessionCompactUsage' }
13264
13480
 
13265
13481
  SessionRewindFilesDiffStats:
13266
13482
  type: object
@@ -13711,6 +13927,22 @@ components:
13711
13927
  exhaustive — render an unknown future state generically).
13712
13928
  examples: [running, completed, failed]
13713
13929
 
13930
+ WorkflowListUnreadableRow:
13931
+ type: object
13932
+ description: >-
13933
+ server >= 7.153.0 — a row of `GET /v1/workflows` that the engine could not read as stored, listed instead of silently dropped. EXACTLY two keys. The marker is the same one a session-list row carries.
13934
+ Test `unreadable` BEFORE reading any summary key (`status` / `phaseCount` / `scope` ... are absent on this arm).
13935
+ additionalProperties: false
13936
+ required: [id, unreadable]
13937
+ properties:
13938
+ id: { type: string, description: 'The run id the row is filed under (the id `GET /v1/workflows/{id}` answers 404 `not_found.workflow` for).' }
13939
+ unreadable:
13940
+ type: object
13941
+ additionalProperties: false
13942
+ required: [errorCode]
13943
+ properties:
13944
+ errorCode: { type: string, description: 'The engine''s row-verdict code; `workflow_run.row_malformed` today (open set).' }
13945
+
13714
13946
  WorkflowRunSummary:
13715
13947
  type: object
13716
13948
  description: >
@@ -14286,6 +14518,7 @@ components:
14286
14518
  additionalProperties: true
14287
14519
  properties:
14288
14520
  id: { type: string, description: 'Stable identity (durable runId/taskId; subagent child = "<runId> <taskId>"). Update/remove by this.' }
14521
+ model: { type: string, description: 'server >= 7.148.0 (contract appendix H.3c): the model this row runs on (display-scrubbed free text; ABSENT = unknown, not "the default model"). The wire carried it before the SDK declared it.' }
14289
14522
  name: { type: string }
14290
14523
  description: { type: string }
14291
14524
  agentType: { type: string }
@@ -14808,6 +15041,14 @@ components:
14808
15041
  expiresAtMs: { type: number, description: 'Absolute window deadline — the SAME number minted once for the tool_approval frame (never recomputed).' }
14809
15042
  sessionId: { type: string }
14810
15043
  requiresRealApproval: { type: boolean, enum: [true] }
15044
+ deploymentListQuestion:
15045
+ type: boolean
15046
+ enum: [true]
15047
+ description: >-
15048
+ server >= 7.153.0: this card carries the DEPLOYMENT LIST's question (`APPROVAL_REQUIRE` / the centre-issued list) — told apart from a card the user's own ask rule asked (the two were same-shaped: source `ask_rule`, class `ask_rule`,
15049
+ `ruleOffersAbsence: "ask_rule_matched"`). True-only, never `false`. A list question => this bit `true` and `rememberRefused` absent ("this session" is remembered in the server's session exemption store); the user's own ask rule =>
15050
+ this bit absent and `rememberRefused: true`; both naming the same tool => one forced card with this bit `true`, `rememberRefused: true` and frame-level `mandated: true`. Live faces judge it when the question was ASKED (a later
15051
+ hot swap of the list changes nothing on a live card); parked faces judge it when READ (the list is read now). ABSENT = not a list question / a card minted before 7.153.0 / an older server. The inbox row does not carry it.
14811
15052
  rememberRefused:
14812
15053
  type: boolean
14813
15054
  enum: [true]
@@ -15277,6 +15518,22 @@ components:
15277
15518
  🔴 DISPLAY / TRIAGE ONLY, and ABSENT MEANS THERE REALLY IS NO SUPPLY (rule lane unarmed, the
15278
15519
  command yields no rule, no rule could silence this ask, or an old row) — never "the projection
15279
15520
  dropped it", which is precisely the bug this key exists to close. Never `null`, never `[]`.
15521
+ deploymentListQuestion:
15522
+ type: boolean
15523
+ enum: [true]
15524
+ description: >-
15525
+ server >= 7.153.0: this card carries the DEPLOYMENT LIST's question (`APPROVAL_REQUIRE` / the centre-issued list) — told apart from a card the user's own ask rule asked (the two were same-shaped: source `ask_rule`, class `ask_rule`,
15526
+ `ruleOffersAbsence: "ask_rule_matched"`). True-only, never `false`. A list question => this bit `true` and `rememberRefused` absent ("this session" is remembered in the server's session exemption store); the user's own ask rule =>
15527
+ this bit absent and `rememberRefused: true`; both naming the same tool => one forced card with this bit `true`, `rememberRefused: true` and frame-level `mandated: true`. Live faces judge it when the question was ASKED (a later
15528
+ hot swap of the list changes nothing on a live card); parked faces judge it when READ (the list is read now). ABSENT = not a list question / a card minted before 7.153.0 / an older server. The inbox row does not carry it.
15529
+ cardMessage:
15530
+ type: string
15531
+ minLength: 1
15532
+ description: >-
15533
+ server >= 7.153.0 (engine 7.67.0 records the card's question on the parked row): the question of this parked tool-approval card — byte-equal to the live card's `card.message` for the same question; every door out of
15534
+ this server runs the same treatment (credential shapes masked through the output seat, then cut to 8192 characters). Present only when readable: a row parked before 7.153.0's engine, an empty / non-string cell, or a
15535
+ question the engine rewrote control characters in (U+2400) => ABSENT (never `""` / `null`; fall back to the generic gate reason). A question over 16384 UTF-16 units reads as the engine's own account sentence
15536
+ `approval message exceeded 16KiB (<N> chars serialized)`.
15280
15537
  rememberRefused:
15281
15538
  type: boolean
15282
15539
  enum: [true]
@@ -15413,6 +15670,20 @@ components:
15413
15670
  properties:
15414
15671
  sessionId: { type: string, description: 'The suspended task/session id.' }
15415
15672
  checkpointId: { type: string, minLength: 1, maxLength: 128, description: 'server >= 7.133.0: the NON-SECRET stable identity of the pause this row parks on — the join key where the token cannot go; the SAME value as `PausedCause.checkpointId`. Carried on three durable read surfaces (GET /v1/approvals `pending[]` rows, the /v1/approvals/stream `pending` frame, GET /v1/assistant/inbox rows). A row whose value is unreadable or untrusted (non-string / empty / over 128 / contains the token / an old row / an older server) is STILL LISTED with the key ABSENT — read absence as "this row has no joinable identity", never as a required key.' }
15673
+ cardMessage:
15674
+ type: string
15675
+ minLength: 1
15676
+ description: >-
15677
+ server >= 7.153.0 (engine 7.67.0 records the card's question on the parked row): the question of this parked tool-approval card — byte-equal to the live card's `card.message` for the same question; every door out of
15678
+ this server runs the same treatment (credential shapes masked through the output seat, then cut to 8192 characters). Present only when readable: a row parked before 7.153.0's engine, an empty / non-string cell, or a
15679
+ question the engine rewrote control characters in (U+2400) => ABSENT (never `""` / `null`; fall back to the generic gate reason). A question over 16384 UTF-16 units reads as the engine's own account sentence
15680
+ `approval message exceeded 16KiB (<N> chars serialized)`.
15681
+ askReasons:
15682
+ type: array
15683
+ description: >-
15684
+ server >= 7.153.0: WHO asked and WHY (the engine's summary echo) — the same projection on four faces (the live card, the operator queue row, the subscription frame and this inbox row; before, the inbox row did not carry it).
15685
+ ABSENT = a row parked before the engine's ask-reason record / no reasons.
15686
+ items: { $ref: '#/components/schemas/AskReason' }
15416
15687
  rowVerdict:
15417
15688
  allOf: [{ $ref: '#/components/schemas/CheckpointRowVerdict' }]
15418
15689
  description: 'server >= 7.144.0: the same verdict as `PendingCheckpoint.rowVerdict` (ABSENT IS NOT `ok`; both backends). server >= 7.145.0 on SQL backends: a row whose stored body cannot be read for its summary is LISTED (previously the whole inbox answered 500 / 503) with its column facts (`sessionId` / `scope` / `createdAt` / `gateKind` / `deadline` / `checkpointId`) plus this key; summary-derived keys are absent and `input` is `null`, while `objective` is still filled from the run row preview independently of the summary. A row whose gate kind column cannot be read is not listed. The verdict is usually non-`ok` (`damaged` …); exception: a row missing only `pendingAction` is judged `ok` and its decide still fails (a known engine gap). On `DB_BACKEND=local` that shape still answers the whole listing with 503 `approvals.read_unavailable`.'
@@ -15701,8 +15972,20 @@ components:
15701
15972
  than dropped, because a misspelled `permissionModeAfter` would otherwise silently fold to `default`
15702
15973
  (the task keeps asking before each write after its plan was approved) while the caller believes the
15703
15974
  mode was settled.
15975
+ NOTE for spec-driven generators: `approve` / `edit` REQUIRE `checkpointId` (server >= 7.153.0), which this schema states as a
15976
+ conditional `if` / `then`. A tool that does not support conditional required drops it and generates `checkpointId` as optional -
15977
+ rely on the TypeScript types of @sema-agent/sdk instead (a two-arm union); the server still refuses the call.
15704
15978
  required: [decision]
15705
15979
  additionalProperties: false
15980
+ # 🔴 server >= 7.153.0 (BREAKING): `approve` / `edit` are RELEASE words and must carry `checkpointId` (the identity of the plan gate the caller saw); `reject` is a RECALL word and need not.
15981
+ # Missing => 400 `decide_requires_binding` + `bindingEnforced: true` + `missingKeys: ["checkpointId"]`, judged before the claim (the plan stays unapproved, the card pending, nothing written).
15982
+ # A server 7.137.0 - 7.152.x accepted the body without it (no stale protection).
15983
+ if:
15984
+ properties:
15985
+ decision: { enum: [approve, edit] }
15986
+ required: [decision]
15987
+ then:
15988
+ required: [checkpointId]
15706
15989
  properties:
15707
15990
  decision: { type: string, enum: [approve, edit, reject] }
15708
15991
  editedPlan: { type: string, description: 'the operator''s revised plan — required iff decision==="edit".' }
@@ -15714,8 +15997,8 @@ components:
15714
15997
  description: >-
15715
15998
  server >= 7.137.0 (read `capabilities.planReviewCheckpointId` first) — the identity of the plan gate you decided on. If it is not the plan gate this session has pending NOW (another end answered, the run
15716
15999
  re-planned and parked on a NEW plan gate) => 409 `approval_stale` (the same code and sentence as `/decide`), nothing recorded (plan not approved, card still pending), body `currentPending: { checkpointId }`
15717
- (the current gate; absent when it has no trustworthy identity or was consumed concurrently). Absent key => accepted as before (no stale protection). Value: non-empty string, at most 128 chars, else 400
15718
- `request.field_invalid` (existence-independent). Sources: the park result's `terminal.checkpointId`, the queue / inbox row `checkpointId`, the `needs_review` ledger row `data.checkpointId` (same value).
16000
+ (the current gate; absent when it has no trustworthy identity or was consumed concurrently). Absent key => accepted (no stale protection) on server 7.137.0 - 7.152.x ONLY; server >= 7.153.0 refuses it with `approve` / `edit` (see the `if` / `then` above). Value: non-empty string, at most 128 chars, else 400
16001
+ `request.field_invalid` (existence-independent). REQUIRED with `approve` / `edit` since server >= 7.153.0 (BREAKING; absent => 400 `decide_requires_binding`, `missingKeys: ["checkpointId"]`); `reject` need not carry it. Sources: the park result's `terminal.checkpointId`, the queue / inbox row `checkpointId`, the `needs_review` ledger row `data.checkpointId` (same value).
15719
16002
  On a direct-door (D-G) deployment the key must be signed into the 6th (extension-object) position of the proof envelope; sent unsigned => 401 `approval_mac_invalid`.
15720
16003
  A server 7.86.0-7.136.x answers this key with 400 `request.body_shape` (`unknownKeys`). Do NOT blindly resend after a 409: re-fetch THAT gate's plan, show it to the human, then decide with the new identity.
15721
16004
  decidedBy:
@@ -15916,6 +16199,7 @@ components:
15916
16199
  runCount: { type: integer }
15917
16200
  objectivePreview: { type: ['string', 'null'] }
15918
16201
  lastStatus: { type: string }
16202
+ sessionKind: { type: string, enum: [sidechain], description: 'Server >= 7.151.0: the session''s kind (`sidechain` rows are listed only under `?sessionKind=sidechain`). ABSENT = a top-level conversation.' }
15919
16203
  lastRunId:
15920
16204
  type: ['string', 'null']
15921
16205
  description: The most recent run's id (null when the session has no run yet) — lets a picker deep-link.
@@ -16185,6 +16469,30 @@ components:
16185
16469
  items: { $ref: '#/components/schemas/SessionSummary' }
16186
16470
  nextCursor: { type: string, description: "Opaque keyset cursor (echo verbatim as ?cursor=)." }
16187
16471
 
16472
+ SessionRulesWrite:
16473
+ description: >-
16474
+ The `rules` of a `PUT /v1/sessions/{sessionId}/policy` body (server >= 7.153.0, engine 7.67.0, BREAKING: `grammar` is REQUIRED — the writer declares the grammar). See the PUT description.
16475
+ allOf: [{ $ref: '#/components/schemas/SessionPermissionRules' }]
16476
+ additionalProperties: false
16477
+ # 🔴 server >= 7.153.0 (engine 7.67.0, BREAKING): the writer DECLARES the grammar, the engine never fills it in and neither does this server.
16478
+ # `grammar` absent => 400 `rules.grammar_required` (before any entry is read; nothing written); a number newer than the engine's `SESSION_RULES_GRAMMAR` (7 on the
16479
+ # 7.153.0 bytes; read `capabilities.sessionRulesGrammar` for the FIRST write, send the stored row's own `grammar` back otherwise) => 400 `rules.invalid_shape`.
16480
+ # Servers <= 7.152.x also accept a stamped body, so a client sends it always.
16481
+ required: [grammar]
16482
+ properties:
16483
+ toolAllow: { type: array, items: { type: string } }
16484
+ toolDeny: { type: array, items: { type: string } }
16485
+ allowDirs: { type: array, items: { type: string } }
16486
+ # server >= 7.129.0 (engine 7.51.2): a stored body echoed back (GET → edit → PUT) may carry its `rev` and `grammar`;
16487
+ # the engine reads the entries in THAT grammar (`rev` without `grammar` = grammar 0 ⇒ a rule-spelled allow entry
16488
+ # answers `400 rules.inert_entry` reason `earlier_grammar`; <= 7.152.x: the way out was to send the three buckets alone — the
16489
+ # write judge stamped the current grammar; server >= 7.153.0 the writer must STATE `grammar`, nothing stamps it). `grammar` newer than the engine's ⇒ `400 rules.invalid_shape`.
16490
+ rev: { type: integer, minimum: 0 }
16491
+ grammar: { type: integer, minimum: 0 }
16492
+ # server >= 7.135.0 (engine 7.55.0): a stored body echoed back (GET → edit → PUT) may also carry its `operatorRules`; on THIS door the echoed part is ALWAYS ignored — the route reads the value through the write reader
16493
+ # (its product carries no `rev`) and the store judges it again: over an existing row the STORED row's operator part is kept, over no row an empty stamped part is minted. Do not rely on an echo to move the operator line — send the new value without `operatorRules`.
16494
+ operatorRules: { $ref: '#/components/schemas/SessionRulesOperatorPart' }
16495
+
16188
16496
  SessionPermissionRules:
16189
16497
  type: object
16190
16498
  description: >
@@ -17151,7 +17459,7 @@ components:
17151
17459
  the body coordinates in conflict, subject first. <= 7.147.x nested `{ kind, fields, … }` under `detail` (`kind` renamed `reason`, same words). SDK `FieldConflictRefusalExtra`.
17152
17460
  differs:
17153
17461
  type: array
17154
- items: { type: string, enum: [text, trusted, priority, actor, runOrigin] }
17462
+ items: { type: string, enum: [text, trusted, priority, actor, runOrigin, source] }
17155
17463
  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`.'
17156
17464
  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.' }
17157
17465
  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`).' }
@@ -17552,6 +17860,14 @@ components:
17552
17860
  required: [type, toolCallId, toolName]
17553
17861
  properties:
17554
17862
  type: { const: tool_start }
17863
+ resumesCheckpoint:
17864
+ type: string
17865
+ minLength: 1
17866
+ maxLength: 128
17867
+ description: >-
17868
+ server >= 7.153.0 (engine 7.67.0): this call is the REPLAY of a call held on a resumed leg — which parked row it picks up: the identity of that row's gate (the same value, through the same trust boundary,
17869
+ as `terminal.checkpointId` and the operator queue row's `checkpointId`; a value failing the shape check — non-empty, at most 128 characters — is dropped). ABSENT = not a resumed-leg replay. Same value as the paired
17870
+ `tool_end.resumesCheckpoint`. Shape-checked only on the frame: that the value is a row this server itself knows cannot be judged there.
17555
17871
  toolCallId: { type: string }
17556
17872
  toolName: { type: string }
17557
17873
  requestedBy:
@@ -18191,6 +18507,23 @@ components:
18191
18507
  required: [type, toolCallId, toolName, isError]
18192
18508
  properties:
18193
18509
  type: { const: tool_end }
18510
+ resumesCheckpoint:
18511
+ type: string
18512
+ minLength: 1
18513
+ maxLength: 128
18514
+ description: 'server >= 7.153.0 (engine 7.67.0): same as `Event_tool_start.resumesCheckpoint` — the gate identity of the parked row this resumed-leg replay picks up. ABSENT = not a replay.'
18515
+ refusedInput:
18516
+ description: >-
18517
+ server >= 7.153.0 (engine 7.67.0): the FINAL input of a refused call — the input the gate judged the refusal on (a rewritten input => the rewritten one; `tool_start.args` stays the model's own). Redacted with the same
18518
+ deep scan as `tool_start.args` / `rewrite.input`, at the one mint shared by the live frame and the ledger row (the ledger keeps the redacted bytes; replay passes the same idempotent scan again). This server does not
18519
+ judge "is this a refusal frame": it projects what the engine gave. ABSENT = not refused / an older server / the read or the redaction threw (the whole key is dropped).
18520
+ redactedKeys:
18521
+ type: array
18522
+ minItems: 1
18523
+ items: { type: string, enum: [output, structured, rewrite, refusedInput] }
18524
+ description: >-
18525
+ server >= 7.153.0 (MINTED BY THIS SERVER, not an engine key): the top-level members of this record whose bytes the redaction rewrote — a CLOSED four-word set in record order; zero hits => ABSENT (never `[]`).
18526
+ Replay reads the ledger's copy. Read this instead of comparing redaction marker literals.
18194
18527
  toolCallId: { type: string }
18195
18528
  toolName: { type: string }
18196
18529
  requestedBy:
@@ -18337,6 +18670,17 @@ components:
18337
18670
  required: [type]
18338
18671
  properties:
18339
18672
  type: { const: turn_end }
18673
+ answeredBy:
18674
+ type: string
18675
+ description: 'server >= 7.153.0 (engine 7.67.0): this turn was answered by an extension registration (a `turn`-site answer instead of the model) — the registration''s name (the registrant''s string, UNTRUSTED-for-display). ABSENT = the model answered.'
18676
+ cacheReadUnreported:
18677
+ type: boolean
18678
+ enum: [true]
18679
+ description: 'server >= 7.153.0 (engine 7.67.0): the provider did NOT report the cache read for this turn — always the literal `true`, never `false`; `usage.cacheReadTokens` is then "not reported", NOT 0. ABSENT = reported (including a real 0).'
18680
+ cacheWriteUnreported:
18681
+ type: boolean
18682
+ enum: [true]
18683
+ description: 'server >= 7.153.0 (engine 7.67.0): same as `cacheReadUnreported` for the cache WRITE (`usage.cacheWriteTokens` is "not reported", not 0).'
18340
18684
  usage:
18341
18685
  type: object
18342
18686
  description: >
@@ -18376,6 +18720,22 @@ components:
18376
18720
  required: [type]
18377
18721
  properties:
18378
18722
  type: { const: compacted }
18723
+ restoreOutcomes:
18724
+ type: array
18725
+ minItems: 1
18726
+ description: >-
18727
+ server >= 7.153.0 (engine 7.67.0): which files the compaction's RESTORE step did NOT send back and why — one entry per record, the SAME record and projection as `human_input.attachments[]` (including `reason`).
18728
+ Present iff at least one entry (ABSENT = none, never `[]`).
18729
+ items:
18730
+ type: object
18731
+ additionalProperties: false
18732
+ properties:
18733
+ ordinal: { type: number }
18734
+ kind: { type: string }
18735
+ outcome: { type: string }
18736
+ label: { type: string }
18737
+ reason: { type: string }
18738
+ declinedBy: { $ref: '#/components/schemas/ExtensionRequester' }
18379
18739
  tokensBefore: { type: integer }
18380
18740
  summarizedCrossSessionMessages: { type: integer, minimum: 1, description: 'server >= 7.147.0: how many already-delivered cross-session messages (session-inbox `crossSessionMessage` carriers) this summary swallowed; present iff >= 1 (absent = none swallowed or an older server, not 0).' }
18381
18741
  trigger: { type: string, description: '开集(engine-shaped,别当闭合枚举):`auto`(逼近窗口上限)/ `manual`(`POST /v1/runs/:id/compact`,发在该 run 自己的流上)/ `forced`(core ≥5.16.0 的 prompt-too-long 恢复腿)。缺席按 auto 渲染;未知值也按 auto 渲染,别崩。' }
@@ -18447,6 +18807,17 @@ components:
18447
18807
  required: [type, phase]
18448
18808
  properties:
18449
18809
  type: { const: status }
18810
+ toolCallId:
18811
+ type: string
18812
+ minLength: 1
18813
+ description: 'server >= 7.153.0 (engine 7.67.0 `BrainStatus.toolCallId`): which CALL this frame''s model-call liveness is about (the auto-mode classifier judging a held call names it). ABSENT = the turn''s own call. Pairs with `tool_progress.gate: "classifier"`.'
18814
+ providerMessage:
18815
+ type: string
18816
+ minLength: 1
18817
+ description: >-
18818
+ server >= 7.153.0 (engine 7.67.0): what the provider itself said about this failure (the engine passes remote text through its own screen: declared values and credential shapes masked, URLs withheld, one line, bounded).
18819
+ 🔴 UNTRUSTED-for-display: display only, never feed it to a model and never branch on it (branch on `errClass` / `providerCondition` / `errorStatus`). Rides the same output seat as `detail` and is never masked
18820
+ LESS than the terminal `message` on the same response; on some shapes it is masked MORE than literally (see the server release notes' disclosure). The same member rides `result.terminal.detail.providerMessage`.
18450
18821
  # 🔴 A-057.27:6 员(此前只列 4,漏 recovered/gave_up 两个**终局**值 —— 一段重试序列恒恰一终局帧,
18451
18822
  # 两者对渲染方是同一句话「把重试行撤下来」)。闭集声明、开集读。
18452
18823
  phase: { type: string, description: "rate_limited | retrying | reconnecting | circuit_open | recovered | gave_up | waiting_first_token (core's seven words since core 7.3.1 — `waiting_first_token` observes a first-token wait before any failure and carries `elapsedMs` / `timeoutMs`, never a retry countdown; closed in core, read as open set)" }
@@ -18639,6 +19010,7 @@ components:
18639
19010
  kind: { type: string }
18640
19011
  outcome: { type: string }
18641
19012
  label: { type: string }
19013
+ reason: { type: string, description: 'server >= 7.153.0 (engine 7.67.0): why the attachment has this outcome (the engine''s word, verbatim; non-empty only). The same record and projection as `compacted.restoreOutcomes[]`.' }
18642
19014
  declinedBy:
18643
19015
  allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
18644
19016
  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.'
@@ -18687,6 +19059,22 @@ components:
18687
19059
  required: [type]
18688
19060
  properties:
18689
19061
  type: { const: wiring_manifest }
19062
+ suspendLane:
19063
+ allOf: [{ $ref: '#/components/schemas/WiringManifestSuspendLane' }]
19064
+ description: >-
19065
+ server >= 7.153.0 (engine 7.67.0; OPERATOR face only, stripped on a tenant stream): can this leg suspend durably, and which pieces are missing. `ready` = a scheduler's yield parks the leg at its next clean boundary;
19066
+ `reasons` = the missing pieces (empty <=> ready; `no_checkpoint_store` / `volatile_tool_results` / `env_not_remote` / `env_suspend_undeclared` / `env_restore_incomplete`, closed words read open);
19067
+ `recoverableAcrossProcesses` = ready AND both the checkpoint store and the session store DECLARE durability (a park minted here can be continued by another process). Readiness, never one request's outcome.
19068
+ commandSandbox:
19069
+ allOf: [{ $ref: '#/components/schemas/WiringManifestCommandSandbox' }]
19070
+ description: >-
19071
+ server >= 7.153.0 (engine 7.67.0; OPERATOR face only): what the leg's command-sandbox requirement turned into — `{ state: "armed" }` or `{ state: "unavailable", reason }`. This server does not hand the engine a sandbox
19072
+ requirement today, so the section is ALWAYS ABSENT (absent = no requirement, not "sandbox off").
19073
+ toolPlan:
19074
+ allOf: [{ $ref: '#/components/schemas/WiringManifestToolPlan' }]
19075
+ description: >-
19076
+ server >= 7.153.0 (engine 7.67.0 `ToolMountPlan`; OPERATOR face only): the leg's mount table read over the leg's facts (to explain why a tool is not mounted). `members` = mounted / conditional tools (`when` names the facts
19077
+ that decide a conditional one), `families` = MCP / A2A listings known by peer only, `absent` = definitions that do not mount and the facts that keep them off (`because`). `half: "effective"` = the leg's real roster.
18690
19078
  schemaVersion: { type: integer }
18691
19079
  leg:
18692
19080
  type: object
@@ -18958,9 +19346,9 @@ components:
18958
19346
  instructions:
18959
19347
  allOf: [{ $ref: '#/components/schemas/WiringManifestInstructions' }]
18960
19348
  description: >
18961
- server >= 7.111.0 (S-961; cli L-910; contract appendix G.21b) — SELF-MINTED by the server (core's
18962
- `WiringManifest` has no such section; the server adds it beside core's own, and a core section of the
18963
- same name would be a compile error server-side). TENANT and OPERATOR faces alike; rides the live frame, the
19349
+ server >= 7.111.0 (S-961; cli L-910; contract appendix G.21b) — SELF-MINTED by the server up to 7.152.x (core's
19350
+ `WiringManifest` had no such section; the server added it beside core's own). 🔴 server >= 7.153.0 (BREAKING): minted by the ENGINE instead
19351
+ (the project instruction files are read by the engine): `selected` = every member the leg holds as it starts (open `string[]`, relative to the task root). TENANT and OPERATOR faces alike; rides the live frame, the
18964
19352
  durable ledger row and the sync receipt's `wiringManifest`. Which PROJECT-INSTRUCTION FILE the project-memory
18965
19353
  loader selected on THIS leg's own prepare: the chain `CLAUDE.md` > `.claude/CLAUDE.md` > `AGENTS.md` >
18966
19354
  `.claude/AGENTS.md` (first hit wins; a present-but-EMPTY `CLAUDE.md` is still the selected one and shadows
@@ -19080,6 +19468,12 @@ components:
19080
19468
  required: [type, toolCallId, toolName]
19081
19469
  properties:
19082
19470
  type: { const: tool_progress }
19471
+ gate:
19472
+ type: string
19473
+ description: >-
19474
+ server >= 7.153.0 (engine 7.67.0 `ToolGatePhase`): WHO holds this call at its gate when the frame is minted — `classifier` (an auto-mode classification of the call is in flight) or `approval` (a question about it is
19475
+ put to a person). ABSENT = nothing holds it at the gate (before the gate / between two gate rounds / after release to the executor). Closed words, read open. `approval` only rides a frame minted while some other
19476
+ call is working (while EVERY call waits on the person nothing is beaten).
19083
19477
  toolCallId: { type: string, description: "The still-running call's id — joins its own `tool_start`/`tool_end`. The server drops the whole frame without it." }
19084
19478
  toolName: { type: string, description: 'The running tool name (the `tool_start` value verbatim).' }
19085
19479
  elapsedTimeSeconds:
@@ -19631,6 +20025,7 @@ components:
19631
20025
  properties:
19632
20026
  binding: { type: string }
19633
20027
  traits: { type: array, items: { type: string } }
20028
+ locale: { type: string, description: 'server >= 7.153.0 (engine 7.67.0 `PROMPT_LOCALES`, today `canonical` / `zh-Hans`; an absent `TaskSpec.promptLocale` => `canonical`): the language word the catalog text of THIS run was rendered in — engine-minted, always present on a 7.153.0 row, verbatim; closed words read open. ABSENT on rows written by an older server.' }
19634
20029
  host:
19635
20030
  type: object
19636
20031
  additionalProperties: false
@@ -20236,6 +20631,14 @@ components:
20236
20631
  approvalCard:
20237
20632
  allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
20238
20633
  description: 'server >= 7.136.0, ADDITIVE: the engine-minted card word — the SAME word, read once, as the live frame''s top-level `ApprovalRequestLiveFacts.approvalCard`; it now rides the live-minted `approval_request` frame''s `card`, the stored `card_json` envelope and the reconnect-replay frame''s `card` (before 7.136.0 the card did not carry it, so a replayed frame had none). ABSENT = the engine minted none / an out-of-set word (the server narrows it again when it mints the card) / a card stored before 7.136.0 — never `generic` by default. Display / triage only; it NEVER takes part in resume / gate / CAS. The stored envelope is strict: a 7.135.x replica cannot read a row carrying this key (replay skips it, the idempotent re-entry goes to the durable park) — roll the fleet in one pass.'
20634
+ deploymentListQuestion:
20635
+ type: boolean
20636
+ enum: [true]
20637
+ description: >-
20638
+ server >= 7.153.0: this card carries the DEPLOYMENT LIST's question (`APPROVAL_REQUIRE` / the centre-issued list) — told apart from a card the user's own ask rule asked (the two were same-shaped: source `ask_rule`, class `ask_rule`,
20639
+ `ruleOffersAbsence: "ask_rule_matched"`). True-only, never `false`. A list question => this bit `true` and `rememberRefused` absent ("this session" is remembered in the server's session exemption store); the user's own ask rule =>
20640
+ this bit absent and `rememberRefused: true`; both naming the same tool => one forced card with this bit `true`, `rememberRefused: true` and frame-level `mandated: true`. Live faces judge it when the question was ASKED (a later
20641
+ hot swap of the list changes nothing on a live card); parked faces judge it when READ (the list is read now). ABSENT = not a list question / a card minted before 7.153.0 / an older server. The inbox row does not carry it.
20239
20642
  rememberRefused:
20240
20643
  type: boolean
20241
20644
  enum: [true]
@@ -20905,10 +21308,18 @@ components:
20905
21308
  `unknown-candidate` — the echoed text does not locate in the record's candidate table.
20906
21309
  `confirm-refused` / `redeem-refused` — the consent protocol's confirm/redeem step was refused
20907
21310
  (record state, a lost CAS, or the store refusing the write).
20908
- `rule_lane_unavailable` — FOUR causes share this one value (the server's three conjuncts): no rule store
20909
- wired, OR the engine minted no candidate for this command, OR the command bytes were unreadable, OR this
20910
- ask has no verified owner. 🔴 Two of those are per-CARD limits, so this reason is NOT evidence about the
20911
- deployment — never disable the rule feature globally on the strength of it.
21311
+ `rule_lane_unavailable` — THREE causes share this one value (server 7.153.0 bytes: the redeem function's lane test, the two
21312
+ record readers' owner test, the resume leg's settle test): no rule store wired, OR this ask has no verified owner (the
21313
+ decider's owner reads as empty), OR the decision was not proven committed / the resume leg returned no rule slot (the
21314
+ receipt then fills in "the request carried it, the outcome did not answer"). A card with NO CANDIDATE / unreadable command
21315
+ bytes / an unknowable authorization place is NOT one of the three: no material is stored at mint time and the decision answers
21316
+ `rule_material_absent` (below). NOTE: server 7.148.0's LIVE-card leg still folded "material absent" into this word; 7.153.0 reads
21317
+ both card kinds through one reader. The last two causes are per-ASK / per-attempt limits, so this reason is NOT evidence about
21318
+ the deployment — never disable the rule feature globally on the strength of it.
21319
+ A frame WITHOUT `ruleOffers` means nothing to redeem; sending `persistRule` anyway answers by condition: rule store wired =>
21320
+ `rule_material_absent`; no rule store wired => `rule_lane_unavailable` (the lane test runs before the record reader); decider's
21321
+ owner unreadable => `rule_lane_unavailable`; operator-governed card => `rule_governance_forced`; a hand-built `persistRule` on a
21322
+ parked card that has no ask row and an empty mint snapshot => `scope-unresolved`.
20912
21323
  `rule_input_edited` — the respond ALSO carried `updatedInput` (ctrl+g edit): the call that takes effect
20913
21324
  is the edited one while the candidates were minted from the ORIGINAL command, so persisting would arm a
20914
21325
  standing allow for the original (a real privilege widening). v1 refuses the persistence; the decision
@@ -20918,22 +21329,24 @@ components:
20918
21329
  `rule_store_error` — the rule store wobbled. The adjudication is unaffected.
20919
21330
  `rule_governance_forced` (server >=7.12.0, #204) — the gate on THIS ask came from the deployment's
20920
21331
  operator governance layer, so the ask never entered the rule lane at all.
20921
- 🔴 SPLIT FROM `rule_lane_unavailable` ON PURPOSE: that one is "one of four conjuncts failed" (no rule
20922
- store, no candidate, unreadable command bytes, no verified owner — two of which are per-CARD limits),
21332
+ 🔴 SPLIT FROM `rule_lane_unavailable` ON PURPOSE: that one is "one of three failed" (no rule
21333
+ store, no verified owner, no outcome from the resume leg),
20923
21334
  this one is "the lane is perfectly healthy, only THIS ask is operator-governed". Folding them would
20924
21335
  erase a real distinction on the card.
20925
21336
  ⚠️ NEITHER IS A DEPLOYMENT-LEVEL VERDICT. Every member of this enum describes ONE ask's outcome; the
20926
21337
  note on `rule_lane_unavailable` above already says never to disable the feature globally on it, and
20927
21338
  the same holds here. The one correct source for "does this worker serve rules at all" is
20928
21339
  `capabilities.permissionRules`. Keep offering "don't ask again" on the next ask; just not on this one.
20929
- `rule_material_absent` (server >=7.48.0, #363) — DURABLE (PARKED) LATE-DECISION LEG ONLY: THIS ROW
20930
- carries no material to mint a rule from. Three causes, one handling: the ask never entered the rule
20931
- lane (governance-forced / no owner / the engine minted no candidate / the command bytes are not
20932
- readable out of the args), the row predates those columns, or the card on the row will not parse.
20933
- 🔴 ALSO SPLIT FROM `rule_lane_unavailable` ON PURPOSE, for the same reason as the previous member:
20934
- that word says "this deployment serves no rules at all" and a shell may stop rendering the affordance
20935
- on it, whereas the truth here is "the lane is fine, only THIS ROW has no material". Folding them lets
20936
- one late park answer condemn a healthy deployment's whole lane. Silently ignoring it is worse still
21340
+ `rule_material_absent` (server >=7.48.0) — THIS ROW carries no material to mint a rule from. BOTH legs say it: the parked
21341
+ late-decision leg (since 7.48.0) and the live-card leg (7.153.0 bytes; the 7.148.0 live leg folded it into
21342
+ `rule_lane_unavailable`). Causes (the two record readers, 7.153.0): the card envelope on the row will not parse; the row's
21343
+ owner is not the decider's owner; the material column is empty — nothing to store at mint time (the engine minted no
21344
+ candidate, so the card carries NO `ruleOffers`; or the command bytes are not readable out of the args; or the authorization
21345
+ place is unknowable), or the row predates those columns; the command carries a credential shape (material withheld whole);
21346
+ a parked checkpoint is missing a gate part, or its row has no candidate / no readable command.
21347
+ 🔴 ALSO SPLIT FROM `rule_lane_unavailable` ON PURPOSE: that word's causes are "no rule store / no verified owner / no
21348
+ outcome from the resume leg", whereas the truth here is "the lane is fine, only THIS ROW has no material". Folding them lets
21349
+ one late answer condemn a healthy deployment's whole lane. Silently ignoring it is worse still
20937
21350
  (no silent fail-open on the approval axis): a person who ticked "don't ask again" and saw nothing
20938
21351
  happen will not tick it twice.
20939
21352
  enum:
@@ -21428,9 +21841,9 @@ components:
21428
21841
 
21429
21842
  SteerReplayFacet:
21430
21843
  type: string
21431
- enum: [text, trusted, priority, actor, runOrigin]
21844
+ enum: [text, trusted, priority, actor, runOrigin, source]
21432
21845
  description: >
21433
- 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
21846
+ core 7.67.0 added the sixth facet `source` (the input's declared source; server >= 7.153.0 ships it). 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
21434
21847
  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
21435
21848
  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):
21436
21849
  contains `text` ⇒ a different instruction, reissue with a fresh key; no `text` ⇒ the SAME instruction — do NOT change the key (it
@@ -21818,6 +22231,11 @@ components:
21818
22231
  required: [type, outcome, trigger]
21819
22232
  properties:
21820
22233
  type: { const: compaction_outcome }
22234
+ cause:
22235
+ type: string
22236
+ description: >-
22237
+ server >= 7.153.0 (engine 7.67.0 `COMPACTION_FAILURE_CAUSES`, today one word `leaf_moved`): the cause of a `failed` outcome — a compaction commits ONLY onto the leaf it summarised; another writer moved the leaf during
22238
+ the summary call => zero writes (the spend already happened). A word outside the engine's closed set drops only this key. Same on the run stream and on `POST /v1/sessions/{id}/compact`'s `events`. ABSENT = no cause.
21821
22239
  outcome: { type: string }
21822
22240
  trigger: { type: string, description: 'engine-shaped; current emitters send auto | manual | forced' }
21823
22241
  reason: { type: string }
@@ -23030,6 +23448,15 @@ components:
23030
23448
  description: >-
23031
23449
  core 7.53.0, server >= 7.133.0 — the leg's permission-mode receipt (section shape WiringManifestPermissionMode). EFFECTIVE HALF ONLY ⇒ this (static) face NEVER carries it, and absence here carries no
23032
23450
  information; the reading holds only on a live `wiring_manifest` frame.
23451
+ suspendLane:
23452
+ allOf: [{ $ref: '#/components/schemas/WiringManifestSuspendLane' }]
23453
+ description: 'server >= 7.153.0 (engine 7.67.0; OPERATOR face; EFFECTIVE HALF ONLY ⇒ ALWAYS ABSENT ON THIS ENDPOINT): can this leg suspend durably. Reading: Event_wiring_manifest.suspendLane.'
23454
+ commandSandbox:
23455
+ allOf: [{ $ref: '#/components/schemas/WiringManifestCommandSandbox' }]
23456
+ description: 'server >= 7.153.0 (engine 7.67.0; OPERATOR face; EFFECTIVE HALF ONLY ⇒ ALWAYS ABSENT ON THIS ENDPOINT, and absent on the live frame too today). Reading: Event_wiring_manifest.commandSandbox.'
23457
+ toolPlan:
23458
+ allOf: [{ $ref: '#/components/schemas/WiringManifestToolPlan' }]
23459
+ description: 'server >= 7.153.0 (engine 7.67.0; OPERATOR face; BOTH HALVES carry it): on THIS endpoint the deployment''s STATIC plan (`half: "static"` — the mount table read over the deployment''s facts before any task, explaining why a tool does not mount); the live frame carries the leg''s `half: "effective"` plan. Reading: Event_wiring_manifest.toolPlan.'
23033
23460
  instructions:
23034
23461
  allOf: [{ $ref: '#/components/schemas/WiringManifestInstructions' }]
23035
23462
  description: >
@@ -23084,6 +23511,82 @@ components:
23084
23511
  enum: [true]
23085
23512
  description: "core's ONLY present shape — the construct gate refuses an armed-but-unrunnable state, so this is a SHAPE, not a value."
23086
23513
 
23514
+ WiringManifestCommandSandbox:
23515
+ type: object
23516
+ required: [state]
23517
+ additionalProperties: false
23518
+ description: >-
23519
+ The `wiring_manifest.commandSandbox` section (server >= 7.153.0, engine 7.67.0; OPERATOR face only): `{ state: "armed" }` or `{ state: "unavailable", reason }` (`reason` is REQUIRED with `unavailable` and absent with `armed`).
23520
+ if:
23521
+ properties:
23522
+ state: { const: unavailable }
23523
+ required: [state]
23524
+ then:
23525
+ required: [reason]
23526
+ else:
23527
+ not: { required: [reason] }
23528
+ properties:
23529
+ state: { type: string, enum: [armed, unavailable] }
23530
+ reason: { type: string, description: 'The engine''s word for why the requirement could not be armed (only with `unavailable`).' }
23531
+
23532
+ WiringManifestSuspendLane:
23533
+ type: object
23534
+ additionalProperties: false
23535
+ required: [ready, reasons, recoverableAcrossProcesses]
23536
+ description: >-
23537
+ The `wiring_manifest.suspendLane` section (server >= 7.153.0, engine 7.67.0; OPERATOR face only): can this leg suspend durably, and which pieces are missing. Readiness, never one request's outcome.
23538
+ properties:
23539
+ ready: { type: boolean, description: 'A scheduler yield parks the leg at its next clean boundary.' }
23540
+ reasons:
23541
+ type: array
23542
+ description: 'The missing pieces (empty <=> ready): `no_checkpoint_store` / `volatile_tool_results` / `env_not_remote` / `env_suspend_undeclared` / `env_restore_incomplete` — closed words, read open.'
23543
+ items: { type: string }
23544
+ recoverableAcrossProcesses: { type: boolean, description: 'Ready AND both the checkpoint store and the session store DECLARE durability: a park minted here can be continued by another process (a drain hand-off).' }
23545
+
23546
+ WiringManifestToolPlan:
23547
+ type: object
23548
+ additionalProperties: false
23549
+ required: [half, members, families, absent]
23550
+ description: >-
23551
+ The `wiring_manifest.toolPlan` section (server >= 7.153.0, engine 7.67.0 `ToolMountPlan`; OPERATOR face only): the mount table read over the leg's facts. `members` = mounted / conditional tools (`when` names the facts that
23552
+ decide a conditional one), `families` = MCP / A2A listings known by peer only, `absent` = definitions that do not mount and the facts that keep them off (`because`). `half: "effective"` = the leg's real roster.
23553
+ properties:
23554
+ half: { type: string }
23555
+ members:
23556
+ type: array
23557
+ items:
23558
+ type: object
23559
+ additionalProperties: true
23560
+ required: [name, source, mountedBy, state]
23561
+ properties:
23562
+ name: { type: string }
23563
+ id: { type: string }
23564
+ source: { type: string }
23565
+ mountedBy: { type: string }
23566
+ state: { type: string }
23567
+ when: { type: array, items: { type: string } }
23568
+ families:
23569
+ type: array
23570
+ items:
23571
+ type: object
23572
+ additionalProperties: true
23573
+ required: [source, peer, state, when]
23574
+ properties:
23575
+ source: { type: string }
23576
+ peer: { type: string }
23577
+ state: { type: string }
23578
+ when: { type: array, items: { type: string } }
23579
+ absent:
23580
+ type: array
23581
+ items:
23582
+ type: object
23583
+ additionalProperties: true
23584
+ required: [name, because]
23585
+ properties:
23586
+ id: { type: string }
23587
+ name: { type: string }
23588
+ because: { type: array, items: { type: string } }
23589
+
23087
23590
  WiringManifestInstructions:
23088
23591
  # S-961(server 7.111.0):与 `WiringManifestReadDeny` / `WiringManifestAutoConsolidation` 同一条裁定 —— 同一段形被 live 帧与静态诊断面两处引用,
23089
23592
  # 内联就是两份会各自漂的镜像,所以具名单源(`spec-field-drift-gate` 也按「导出的 interface 必有同名 schema」逼出它)。
@@ -23092,15 +23595,15 @@ components:
23092
23595
  description: >
23093
23596
  The `wiring_manifest.instructions` section (server >= 7.111.0 / S-961) — SELF-MINTED by the server, not a core
23094
23597
  section: which project-instruction file the project-memory loader selected on this leg's own prepare.
23095
- `selected` members are a CLOSED four-word set — the server's instruction-file chain (`INSTRUCTION_FILE_CHAIN`,
23096
- registered in its self-minted wire table `wiringInstructionsSelected`); a fifth chain member would be a new SDK minor,
23097
- in this enum in the same batch. The present-iff / two-meanings reading is on `Event_wiring_manifest.instructions`.
23598
+ server >= 7.153.0 (BREAKING): the section is minted by the ENGINE (the project instruction files are read by the engine under the deployment's declared instruction family): `selected` = every member this leg
23599
+ holds as it starts — relative to the task root, `/`-separated, declared names first in declaration order then the rules by path; a member the model may not read, or that holds nothing, is not in it. The members are
23600
+ an OPEN `string[]` now (<= 7.152.x: a CLOSED four-word set — the server's instruction-file chain, first hit selected). The present-iff / two-meanings reading is on `Event_wiring_manifest.instructions`.
23098
23601
  required: [selected]
23099
23602
  properties:
23100
23603
  selected:
23101
23604
  type: array
23102
- description: 'The selected chain member(s), spelled as the chain spells them (relative to the cwd); `[]` = the chain was walked, nothing was selected.'
23103
- items: { type: string, enum: ['CLAUDE.md', '.claude/CLAUDE.md', 'AGENTS.md', '.claude/AGENTS.md'] }
23605
+ description: 'The instruction-file members the leg holds (server >= 7.153.0: all of them, engine-minted, relative to the task root); `[]` = the layer is held and has no member.'
23606
+ items: { type: string }
23104
23607
  WiringManifestPermissionMode:
23105
23608
  # server 7.133.0 / core 7.53.0:同一段形被 live 帧(两张脸)、静态诊断面、`POST /v1/tasks` 的 `wiringManifest` 回执与账本行引用 ⇒ 具名单源(`spec-field-drift-gate` 也按「导出的 interface 必有同名 schema」逼出它)。
23106
23609
  type: object