@sema-agent/sdk 32.0.0 → 33.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 (57) hide show
  1. package/README.md +65 -0
  2. package/dist/device/index.d.ts +2 -1
  3. package/dist/device/index.d.ts.map +1 -1
  4. package/dist/device/index.js +4 -2
  5. package/dist/device/index.js.map +1 -1
  6. package/dist/errors.d.ts +24 -10
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +17 -11
  9. package/dist/errors.js.map +1 -1
  10. package/dist/events.d.ts +62 -10
  11. package/dist/events.d.ts.map +1 -1
  12. package/dist/events.js +8 -0
  13. package/dist/events.js.map +1 -1
  14. package/dist/index.d.ts +17 -3
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +5 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/normalize.d.ts +2 -2
  19. package/dist/normalize.d.ts.map +1 -1
  20. package/dist/normalize.js +0 -1
  21. package/dist/normalize.js.map +1 -1
  22. package/dist/resources/approvals.d.ts +63 -10
  23. package/dist/resources/approvals.d.ts.map +1 -1
  24. package/dist/resources/approvals.js +56 -3
  25. package/dist/resources/approvals.js.map +1 -1
  26. package/dist/resources/assistant.d.ts +9 -5
  27. package/dist/resources/assistant.d.ts.map +1 -1
  28. package/dist/resources/assistant.js +9 -4
  29. package/dist/resources/assistant.js.map +1 -1
  30. package/dist/resources/memory.d.ts +15 -8
  31. package/dist/resources/memory.d.ts.map +1 -1
  32. package/dist/resources/memory.js +15 -8
  33. package/dist/resources/memory.js.map +1 -1
  34. package/dist/resources/rules.d.ts +18 -11
  35. package/dist/resources/rules.d.ts.map +1 -1
  36. package/dist/resources/session-sync.d.ts +2 -2
  37. package/dist/resources/session-sync.js +2 -2
  38. package/dist/resources/sessions.d.ts +22 -10
  39. package/dist/resources/sessions.d.ts.map +1 -1
  40. package/dist/resources/sessions.js +16 -6
  41. package/dist/resources/sessions.js.map +1 -1
  42. package/dist/resources/side-query.d.ts +5 -2
  43. package/dist/resources/side-query.d.ts.map +1 -1
  44. package/dist/resources/side-query.js.map +1 -1
  45. package/dist/resources/tool-approvals.d.ts +69 -21
  46. package/dist/resources/tool-approvals.d.ts.map +1 -1
  47. package/dist/resources/tool-approvals.js +43 -10
  48. package/dist/resources/tool-approvals.js.map +1 -1
  49. package/dist/settings.d.ts +13 -7
  50. package/dist/settings.d.ts.map +1 -1
  51. package/dist/settings.js +3 -3
  52. package/dist/types.d.ts +163 -32
  53. package/dist/types.d.ts.map +1 -1
  54. package/dist/types.js +32 -0
  55. package/dist/types.js.map +1 -1
  56. package/openapi.yaml +350 -93
  57. package/package.json +1 -1
package/openapi.yaml CHANGED
@@ -294,11 +294,19 @@ paths:
294
294
  application/json:
295
295
  schema: { $ref: '#/components/schemas/ErrorResponse' }
296
296
  '429': { $ref: '#/components/responses/RateLimited' } # limit.rate_exceeded — 12/60s per identity, OR the replica-wide in-flight cap (32, ACROSS identities: one caller can be refused because of another). Retry-After and the body's `retryAfterSec` are the same value; the body's absence means no header either
297
+ '409':
298
+ description: >
299
+ server >= 7.143.0: errorCode `config.mcp_server_name_collision` — two declared MCP servers would mount under the same tool-namespace
300
+ prefix; the same code, status and sentence as the synchronous submit leg (which answered 200 + a `failed` body before). Fix the
301
+ deployment's declarations; retrying does not change it. (7.142.x and earlier answered this case with the codeless 500 below.)
302
+ content:
303
+ application/json:
304
+ schema: { $ref: '#/components/schemas/ErrorResponse' }
297
305
  '500':
298
306
  description: >
299
307
  errorCode `internal.error` — the engine refused THIS DEPLOYMENT'S declaration SET as a whole (the one
300
- documented cause: two servers would mount under the same tool-namespace prefix, refused BEFORE any
301
- transport is touched). 🔴 WHOEVER WROTE THE DECLARATIONS OWNS THE ERROR: on this door they are the
308
+ documented cause on servers <= 7.142.x: two servers would mount under the same tool-namespace prefix, refused BEFORE any
309
+ transport is touched; server >= 7.143.0 answers that cause with the 409 above). 🔴 WHOEVER WROTE THE DECLARATIONS OWNS THE ERROR: on this door they are the
302
310
  deployment's, so this machine's configuration is broken and a 5xx is the honest direction — folding it
303
311
  into a 4xx would report an operator's mistake as the caller's. The cause is NOT echoed (it comes from
304
312
  the declaration set itself); it is in this worker's logs. Retrying does not change it.
@@ -2433,10 +2441,7 @@ paths:
2433
2441
  required: false
2434
2442
  content:
2435
2443
  application/json:
2436
- schema:
2437
- type: object
2438
- properties:
2439
- message: { type: string, minLength: 1 }
2444
+ schema: { $ref: '#/components/schemas/SessionWakeRequest' }
2440
2445
  responses:
2441
2446
  '200':
2442
2447
  # 🔴 census 批2 第三段(2026-07-30)spec 谎修正:此前这里写的是 **202** + required [taskId,…]。
@@ -3048,8 +3053,8 @@ paths:
3048
3053
  there is no operator override arm), and the attestation's `select` echoes exactly that. The body is
3049
3054
  `SessionMemoryEraseRequest` handed through as sent: no `select` (a body carrying one is a loud 400
3050
3055
  `request.body_shape`, never silently ignored — while any OTHER unknown key IS silently ignored and not forwarded),
3051
- `allowUnevidenced` NEVER INJECTED (the degraded lane is a human authorization statement). The one added key is the optional layer seat `scope`
3052
- (server >= 7.140.0).
3056
+ `allowUnevidenced` NEVER INJECTED (the degraded lane is a human authorization statement). Server 7.140.0–7.142.x also read an optional layer seat
3057
+ `scope`; server >= 7.143.0 refuses a body carrying `scope` (any value) with a loud 400 `request.body_shape` — the erasure spans the whole deployment.
3053
3058
 
3054
3059
  🔴 `requestId` IS THIS ERASURE'S IDEMPOTENCY IDENTITY — the same two-lane law as the operator face (read
3055
3060
  `evidenceCapability`): `"journal"` ⇒ a resend with the SAME id reads back the anchor's pinned ids and never re-resolves
@@ -3060,13 +3065,12 @@ paths:
3060
3065
  server 7.108.0 this face classifies it like the operator face does — <= 7.107.x answered 500 `internal.error`). 🔴 DO NOT put an
3061
3066
  automatic retry policy on this endpoint.
3062
3067
 
3063
- 🔴 ERASURE EXECUTES ONLY ON THE DEPLOYMENT'S STORE (server >= 7.140.0, a transitional guard — the engine has no deployment-wide erasure request identity yet).
3064
- Without `scope`: the by-session erasure runs on the deployment's store, and if this session has contributions in the OTHER store (the personal mount) or that
3065
- store's ledger cannot be read ⇒ 409 `memory.erasure_store_unjudged` — NOTHING erased (7.139.x answered 200 and erased the deployment-store half). With `scope`
3066
- naming a layer that lives in the deployment's store (e.g. `local`) ⇒ it runs there, 200, the attestation covers the deployment's store only (the layer seat does
3067
- not reach the engine or the attestation) and the other store's half is neither judged nor mentioned; `scope` naming a layer on the personal mount ⇒ 409
3068
- `memory.erasure_store_unjudged`. The audience is the session owner, so every refusal on this face is a FIXED sentence (layer keys and paths never ride the wire;
3069
- the engine's sentence goes to the operator log). 400 `request.memory_layer` here means the `scope` (or this deployment's configured layer) cannot be read.
3068
+ 🔴 ERASURE ANSWERS THE WHOLE DEPLOYMENT (server >= 7.143.0; the engine's one deployment object): this session's share in EACH store is erased by that store and
3069
+ the attestations are merged into one; a `requestId` names one request across the whole deployment (the same id first executed in another store ⇒ 409
3070
+ `memory.erasure_selector_mismatch`, nothing erased or recorded). The 7.140.0–7.142.x body layer seat `scope` is retired (there is no "which store" to name):
3071
+ a body carrying it ⇒ 400 `request.body_shape`; the 7.140.0–7.142.x 409 code (erasure store unjudged) is retired with it (those requests now execute).
3072
+ `DB_BACKEND=local`: an owner that cannot be judged (no row fact and the archive unreadable) ⇒ 404 `not_found.session`, same code and sentence as non-owner.
3073
+ The audience is the session owner, so every refusal on this face is a FIXED sentence (layer keys and paths never ride the wire; the engine's sentence goes to the operator log).
3070
3074
 
3071
3075
  GATE ORDER (release bytes): 503 destructive-session-write guard → 401 → 501 (no owner audit face — BEFORE the 404: a
3072
3076
  deployment without one must not fake a 404) → 404 (unknown AND non-owner, SAME code SAME message) → 501 (compliance face
@@ -3087,12 +3091,12 @@ paths:
3087
3091
  '400':
3088
3092
  description: >
3089
3093
  errorCode "request.body_shape" — the body is not a JSON object, or it carries `select` (the selector is fixed by the
3090
- path; the operator face takes explicit selectors). "request.request_id_required" — `requestId` missing / empty /
3094
+ path; the operator face takes explicit selectors), or (server >= 7.143.0) it carries `scope` (the retired layer seat: this face erases the
3095
+ session's contributions in every store of the deployment, so there is no layer to name). "request.request_id_required" — `requestId` missing / empty /
3091
3096
  non-string. "request.field_invalid" — `allowUnevidenced` present but not a boolean. "request.path_malformed" — the
3092
3097
  session id segment is not valid percent-encoding. "config.memory_erasure_request" — core's own selector verdict (the
3093
- route keeps the arm; today the server's own gates answer first, so it is not reached). Server >= 7.140.0: "request.memory_layer" — the
3094
- `scope` (or this deployment's configured layer) cannot be read (a FIXED sentence for the session owner); "request.field_invalid" also
3095
- covers a `scope` that is present but not a non-empty string.
3098
+ route keeps the arm; today the server's own gates answer first, so it is not reached). Server >= 7.140.0: "request.memory_layer" — a
3099
+ memory layer this deployment keeps cannot be read (a FIXED sentence for the session owner; on 7.140.0–7.142.x also the body's `scope`).
3096
3100
  content:
3097
3101
  application/json:
3098
3102
  schema: { $ref: '#/components/schemas/ErrorResponse' }
@@ -3106,9 +3110,7 @@ paths:
3106
3110
  the operator to remove the link, then resend with the SAME `requestId`. Since server 7.108.0 the other classified refusals of the
3107
3111
  operator face arrive here too, each with its own code and a FIXED sentence: "memory.erasure_selector_mismatch" /
3108
3112
  "memory.erasure_evidence_unavailable" / "memory.erasure_census_incomplete"; "memory.scope_home_not_directory" (server >= 7.118.0, same
3109
- reading as the link code). Server >= 7.140.0: "memory.erasure_store_unjudged" — the erasure lands on the memory store other than the
3110
- deployment's (a `scope` naming a personal-mount layer, or no `scope` and this session has contributions there / that store's ledger cannot be
3111
- read): NOTHING erased; a transitional guard, do NOT retry.
3113
+ reading as the link code). The 7.140.0–7.142.x store guard code is retired at server 7.143.0 (erasure answers the whole deployment).
3112
3114
  content:
3113
3115
  application/json:
3114
3116
  schema: { $ref: '#/components/schemas/ErrorResponse' }
@@ -3180,10 +3182,17 @@ paths:
3180
3182
  '401': { $ref: '#/components/responses/Unauthorized' }
3181
3183
  '404': { description: 'errorCode "not_found.session" — unknown session AND another principal''s session, byte-identical (anti-enumeration).' }
3182
3184
  '409':
3183
- description: '`conflict.session_memory_unobserved` — no read set yet (the session has no settled run with a memory observation); carries `activeTaskId` when a run is in flight.'
3185
+ description: >-
3186
+ `conflict.session_memory_unobserved` — no read set; carries `activeTaskId` when a run is in flight. server >= 7.143.0: the body ALWAYS carries
3187
+ `reason` (SessionMemoryUnobservedExtra; closed set, judged in this order) and the sentence follows it; a latest settled run whose memory was configured
3188
+ but did not mount (`memory_not_mounted`) answered 200 with an empty report on 7.142.x. Branch on `errorCode` + `reason`, never on the sentence;
3189
+ an unknown word reads as "no read set".
3184
3190
  content:
3185
3191
  application/json:
3186
- schema: { $ref: '#/components/schemas/ErrorResponse' }
3192
+ schema:
3193
+ allOf:
3194
+ - { $ref: '#/components/schemas/ErrorResponse' }
3195
+ - { $ref: '#/components/schemas/SessionMemoryUnobservedExtra' }
3187
3196
  '500': { description: 'errorCode "internal.error" — the engine refused to mint the report.' }
3188
3197
  '501': { description: '`feature.memory_sync_disabled` (no local sync leg) · `capability.run_store_required` · `capability.session_ownership_required` — capability bit `sessionMemorySync` is false.' }
3189
3198
  /v1/sessions/{sessionId}/sync/manifest:
@@ -3665,6 +3674,7 @@ paths:
3665
3674
  - in: path
3666
3675
  name: sessionId
3667
3676
  required: true
3677
+ description: 'The row''s door id: a `checkpoint` row''s `sessionId`, or a `peer_inbound` row''s `id` (server >= 7.143.0; opaque, `peer_inbound:` prefix — pass it back verbatim).'
3668
3678
  schema: { type: string }
3669
3679
  post:
3670
3680
  tags: [approvals]
@@ -3676,11 +3686,19 @@ paths:
3676
3686
  continues its durable stream (`/v1/runs/:id/events`). design/80 D-1: the decision SHOULD carry the
3677
3687
  action binding (boundCallId + boundInputHash, read off the PendingCheckpoint) — the server resolves THAT
3678
3688
  exact checkpoint, fail-closed on mismatch. (Path param stays `sessionId`; the binding travels in the body.)
3689
+ 🔴 server >= 7.143.0 ONE DOOR, TWO FAMILIES (every `pending[]` row names its family in `kind`): a `checkpoint` row is decided at
3690
+ `:sessionId` with ApprovalDecision (the binding pair REQUIRED — 400 `decide_requires_binding` + `missingKeys`); a `peer_inbound`
3691
+ row is decided at its `id` with exactly `{ decision: "approve" | "deny" }` (any other key ⇒ 400 naming it) and answers
3692
+ `200 PeerInboundDecideResult` / `404 not_found.approval` / `503 state.peer_decision_unrecorded` (retriable: the decision was not
3693
+ recorded). Branch on the row's `kind` first; skip a row whose `kind` you do not know.
3679
3694
  requestBody:
3680
3695
  required: true
3681
3696
  content:
3682
3697
  application/json:
3683
- schema: { $ref: '#/components/schemas/ApprovalDecision' }
3698
+ schema:
3699
+ oneOf:
3700
+ - { $ref: '#/components/schemas/ApprovalDecision' }
3701
+ - { $ref: '#/components/schemas/PeerInboundDecision' }
3684
3702
  responses:
3685
3703
  '200':
3686
3704
  description: >-
@@ -3689,7 +3707,10 @@ paths:
3689
3707
  (see `ParkedDecideAccepted`, `ApprovalDecisionResult`).
3690
3708
  content:
3691
3709
  application/json:
3692
- schema: { $ref: '#/components/schemas/ApprovalDecisionResult' }
3710
+ schema:
3711
+ oneOf:
3712
+ - { $ref: '#/components/schemas/ApprovalDecisionResult' }
3713
+ - { $ref: '#/components/schemas/PeerInboundDecideResult' }
3693
3714
  '400':
3694
3715
  description: >-
3695
3716
  (declared 2026-07-31) `routes/approvals-assistant.ts` has 9+ distinct 400 sites on this verb, all
@@ -3706,7 +3727,11 @@ paths:
3706
3727
  the proof's binding. A compliant client never sends it: this SDK deleted the field at 1.0.0)
3707
3728
  · "request.field_invalid" ALSO covers an unrecognised key inside `answer` (server >= 7.87.0 /
3708
3729
  S-452: the closed answer shape — the message names the key paths and the body carries `unknownKeys`)
3709
- · "remember_requires_binding" (`remember` without the D-1 binding echo). PARKED variant (server 5.12.0, core 5.7.0 RB-459):
3730
+ · "decide_requires_binding" (server >= 7.143.0: `boundCallId` or `boundInputHash` missing / empty on a checkpoint-family
3731
+ decide — judged after the gate-type guard, nothing driven, card still pending; body `missingKeys` (in the order
3732
+ boundCallId, boundInputHash) + `bindingEnforced`; it also replaces the retired remember-only binding code)
3733
+ · "decide.parked_restatement_unsupported" (server >= 7.143.0: `mcpServers` / `a2aPeers` restated on a card parked by a
3734
+ background child) · "restatement_not_in_proof" (the same two keys on a direct-door worker). PARKED variant (server 5.12.0, core 5.7.0 RB-459):
3710
3735
  `decide.parked_answer_required` — the parked child's pending action is an AskUserQuestion and the
3711
3736
  approve carried no `answer` (the ONLY pre-claim rejection left on that leg; the retired codes
3712
3737
  `decide.parked_answer_unsupported` / `decide.parked_question_unsupported` are gone — an answer HAS
@@ -4122,9 +4147,15 @@ paths:
4122
4147
  summary: Resume a resource_limit-suspended task (CONTINUE).
4123
4148
  description: >
4124
4149
  ASSISTANT-WIRE-CONTRACT §4b — resumes a task durably SUSPENDED on a `resource_limit` gate (scheduler
4125
- preempt OR a budget/turns/walltime slice). NO request body. 🔴 GATE-KIND GUARD: a `human`/`policy_ask`
4150
+ preempt OR a budget/turns/walltime slice). 🔴 GATE-KIND GUARD: a `human`/`policy_ask`
4126
4151
  gate → 409 `gate_not_resumable` (a "continue" must NEVER bypass a human approval — use `/decide`).
4127
4152
  Owner-gated (NOT D-G); non-owner → 404. SDK → GateNotResumableError on the 409.
4153
+ Body: server >= 7.143.0 takes the resume restatement `mcpServers` / `a2aPeers` (see ApprovalDecision.mcpServers); older servers ignore a body.
4154
+ requestBody:
4155
+ required: false
4156
+ content:
4157
+ application/json:
4158
+ schema: { $ref: '#/components/schemas/ResumeRestatement' }
4128
4159
  responses:
4129
4160
  '200':
4130
4161
  # 2026-07-25:此前只声明 `{status}`。真体(`src/http/routes/approvals-assistant.ts`,与 plan_review 共用
@@ -4736,6 +4767,9 @@ paths:
4736
4767
  and a word outside the closed set are both 400 `request.body_shape`, refused BEFORE the decision (the card is
4737
4768
  still open; answer it again with the same `approvalId`). 🔴 An older server (no `approvalDecidedBy`
4738
4769
  capability bit) DROPS this key silently and answers 200 — probe the bit first.
4770
+ decidedVia:
4771
+ allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
4772
+ description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
4739
4773
  note:
4740
4774
  type: string
4741
4775
  maxLength: 2048
@@ -5682,7 +5716,7 @@ paths:
5682
5716
  '404': { $ref: '#/components/responses/NotFound' }
5683
5717
  '501': { $ref: '#/components/responses/NotImplemented' }
5684
5718
 
5685
- /v1/memory/sync/{scope}:
5719
+ /v2/memory/sync/{scope}:
5686
5720
  parameters:
5687
5721
  - $ref: '#/components/parameters/PrincipalHeader'
5688
5722
  - in: path
@@ -5703,6 +5737,11 @@ paths:
5703
5737
  `memory_sync_invalid_body`). A 500 after partial application is an HONEST signal: replaying with the
5704
5738
  same baseRevs is idempotent self-healing (identical revs no-op throughout) — never silently swallowed.
5705
5739
  Server >= 7.140.0: a `:scope` the engine cannot read as a layer key ⇒ 400 `request.memory_layer` (it was a 500 before).
5740
+ 🔴 Server >= 7.143.0 (engine 7.61.0): the path is `/v2/memory/sync/{scope}`; `/v1/memory/sync/…` is unclaimed (404 `not_found.route`) — new clients
5741
+ and old centers answer each other 404 and write nothing until both ends run the same version. Each layer partition has an INCARNATION
5742
+ (born the first time the partition is synced, kept in the center database): the result always carries `cursor.incarnation`; the request's
5743
+ `peerIncarnation` is compared BEFORE any read or write — not this partition's, or a non-empty baseline without one ⇒ 200
5744
+ `{ refused: "baseline_incarnation", incarnation }` (an answer, zero reads and writes); the incarnation changed after the round's last write ⇒ 500.
5706
5745
  requestBody:
5707
5746
  required: true
5708
5747
  content:
@@ -5710,10 +5749,13 @@ paths:
5710
5749
  schema: { type: object, additionalProperties: true, description: 'The sync request (peer/baseRevs/patches — core reconcile contract).' }
5711
5750
  responses:
5712
5751
  '200':
5713
- description: 'The sync outcome (core reconcile/nextSyncBaseline projection).'
5752
+ description: 'The sync outcome (core reconcile/nextSyncBaseline projection), or (server >= 7.143.0) the incarnation refusal — told apart by `refused`.'
5714
5753
  content:
5715
5754
  application/json:
5716
- schema: { $ref: '#/components/schemas/MemorySyncResponse' }
5755
+ schema:
5756
+ oneOf:
5757
+ - { $ref: '#/components/schemas/MemorySyncResponse' }
5758
+ - { $ref: '#/components/schemas/MemorySyncIncarnationRefusal' }
5717
5759
  '400': { $ref: '#/components/responses/BadRequest' }
5718
5760
  '401': { $ref: '#/components/responses/Unauthorized' }
5719
5761
  '404': { $ref: '#/components/responses/NotFound' }
@@ -5813,13 +5855,14 @@ paths:
5813
5855
  enumerating every id in the attestation). `residuals.propagation` is core's self-declared boundary:
5814
5856
  deletion is a THIS-STORE fact, remote-peer convergence is the sync deployment's half to prove.
5815
5857
 
5816
- 🔴 LAYER SEAT (server >= 7.140.0; contract §9 head; the key is defined once, in `components.schemas.MemoryLayerSeat`): This face has NO top-level `scope` key (the body goes to the engine as sent): `select.scope` names the layer; for `select.ids` / `select.sessionId` the layer seat is `expectedScopes` (the authorization set); `select.ids` without it on a two-store deployment ⇒ 400 `request.memory_layer`.
5858
+ 🔴 LAYER SEAT (contract §9 head): This face has NO top-level `scope` key (the body goes to the engine as sent): `select.scope` names the layer.
5817
5859
 
5818
- 🔴 ERASURE EXECUTES ONLY ON THE DEPLOYMENT'S STORE (server >= 7.140.0, a transitional guard): the erasure `requestId` idempotency judgment
5819
- (replay convergence; the same id under another selector ⇒ 409 `memory.erasure_selector_mismatch`) lives on EACH store's own evidence chain, and the
5820
- engine has no deployment-wide erasure request identity yet. An erasure that lands on the OTHER store (the named layer lives on the personal mount; or,
5821
- by session, the session has contributions there or that store's ledger cannot be read) ⇒ 409 `memory.erasure_store_unjudged`: NOTHING was erased and
5822
- nothing recorded; the request is legal, the way out is the engine's deployment-wide request identity (the guard is deleted when it lands).
5860
+ 🔴 ERASURE ANSWERS THE WHOLE DEPLOYMENT (server >= 7.143.0; the engine's one deployment object): a `requestId` names one request across the whole deployment —
5861
+ every store's anchors are read before executing; the same id first used under another selector or executed in another store ⇒ 409
5862
+ `memory.erasure_selector_mismatch`, under another authorization set ⇒ 400 `config.memory_erasure_scope` (nothing erased or recorded); a personal-layer
5863
+ erasure executes normally; `select.ids` / `select.sessionId` without `expectedScopes` ⇒ each store erases its own share and the attestations are merged; an
5864
+ authorization set whose layers live in two stores ⇒ 400 `config.memory_erasure_scope`. The 7.140.0–7.142.x store guard code and the two-store
5865
+ 400 `request.memory_layer` arms are retired at 7.143.0 (`request.memory_layer` remains only for a layer key the engine cannot read).
5823
5866
  requestBody:
5824
5867
  required: true
5825
5868
  content:
@@ -5849,10 +5892,8 @@ paths:
5849
5892
  '403': { description: 'errorCode "auth.operator_only" — provenance and erasure are operator-only deployment actions. With an EMPTY `OPERATOR_PRINCIPALS` the answer is instead 501 `capability.operator_principals_required` (server >= 7.116.0; any identity, ahead of authorization — branch on `errorCode`, not the status).' }
5850
5893
  '409':
5851
5894
  description: >
5852
- Core-minted codes passed through verbatim, plus one server-minted code; branch on `errorCode` (the status cannot tell them
5853
- apart). Server >= 7.140.0: "memory.erasure_store_unjudged" (server-minted) — the erasure lands on the memory store other than the deployment's
5854
- (the named layer lives on the personal mount, or the session has contributions there / that store's ledger cannot be read): NOTHING erased, nothing
5855
- recorded; the request is legal; do NOT retry. "memory.erasure_evidence_unavailable": this backend has NO evidence face and the caller did not
5895
+ Core-minted codes passed through verbatim; branch on `errorCode` (the status cannot tell them apart). (The 7.140.0–7.142.x server-minted store
5896
+ guard code is retired at 7.143.0.) "memory.erasure_evidence_unavailable": this backend has NO evidence face and the caller did not
5856
5897
  opt into the degraded lane — deliberately NOT 501, because the caller holds a real choice
5857
5898
  (`allowUnevidenced: true`) and a 501 would send someone off to change a deployment that is fine.
5858
5899
  "memory.erasure_selector_mismatch": this `requestId` was first executed under a DIFFERENT selector —
@@ -8168,8 +8209,9 @@ components:
8168
8209
  `SEMA_CONFIG_DIR`, default `~/.sema`; sandbox lanes the forwarded `SEMA_CONFIG_DIR`, else `.sema` under the execution home;
8169
8210
  unresolvable => whole-request 422 `request.unprocessable` with entry-problem reason `home_unresolvable`), every other layer
8170
8211
  reads under the task root like a plain string; `~/`, `//` and relative forms read the same in every layer. `allow` takes
8171
- plain strings only (a layered entry there => 400 `bad_entry`). A malformed layered entry => 400 `bad_entry` + the first
8172
- bad index. Up to 1000 entries per bucket, both forms counted.
8212
+ the same layered form from server 7.143.0 (gate `capabilities.settings.permissions.layeredAllow`; a user-layer `/`-form allow reads
8213
+ at the execution environment's configuration root, `home_unresolvable` like the other buckets); 7.141.0–7.142.x refuse a layered
8214
+ allow entry (400 `bad_entry`). A malformed layered entry => 400 `bad_entry` + the first bad index. Up to 1000 entries per bucket, both forms counted.
8173
8215
  🔴 ON THIS SUBMIT FACE THE KEY SET IS CLOSED (server >= 7.57.0 for the sub-tree): accepted top-level keys
8174
8216
  are `env` / `hooks` / `model` / `outputStyle` / `permissions` / `skillListingBudgetFraction` /
8175
8217
  `skillListingMaxDescChars` / `ultracode` / `webSearch` (server >= 7.133.0 adds the three TIGHTEN-ONLY seats `complianceAdditionalDenies` / `readDenyPatterns` / `writeProtectedExtra`; server >= 7.134.0 adds `approvalFrameFamilies`;
@@ -9002,6 +9044,14 @@ components:
9002
9044
  verdict: { type: string, enum: [PASS, FAIL, PARTIAL, unverified] }
9003
9045
  rounds: { type: integer }
9004
9046
  findings: { type: array, items: { type: string } }
9047
+ allowanceExhausted:
9048
+ type: object
9049
+ additionalProperties: false
9050
+ required: [axis]
9051
+ description: 'server >= 7.143.0 (core 7.61.0 `AllowanceExhausted`): the task''s caps bound the whole implementation side; one axis ran out, so no further repair round runs and the verdict stops at that FAIL. `remaining` present = the balance (0 when spent); a priced cap with an unpriced leg reads as no balance (`axis: "cost"`, no `remaining`). Absent = no axis ran out (or an older server).'
9052
+ properties:
9053
+ axis: { type: string, enum: [cost, tokens, turns] }
9054
+ remaining: { type: number }
9005
9055
  cancelContext:
9006
9056
  allOf: [{ $ref: '#/components/schemas/CancelContext' }]
9007
9057
  description: >
@@ -10154,8 +10204,12 @@ components:
10154
10204
  the request key `settings.approvalFrameFamilies` (which families this run's client renders).
10155
10205
  ApprovalDecision:
10156
10206
  type: object
10157
- description: HITL decision (`POST /v1/approvals/:sessionId/decide`).
10158
- required: [decision]
10207
+ description: >
10208
+ HITL decision (`POST /v1/approvals/:sessionId/decide`, checkpoint family). server >= 7.143.0: `boundCallId` and `boundInputHash`
10209
+ are BOTH required (echo the pair off the `pending[]` row / `pending` frame you showed the person); a missing or empty one ⇒
10210
+ 400 `decide_requires_binding` with `missingKeys` naming the missing seats. A `peer_inbound` row is decided with
10211
+ `{ decision }` only (see the path).
10212
+ required: [decision, boundCallId, boundInputHash]
10159
10213
  properties:
10160
10214
  decision: { type: string, enum: [approve, deny] }
10161
10215
  answer:
@@ -10188,11 +10242,11 @@ components:
10188
10242
  reason: { type: string }
10189
10243
  # design/80 D-1 — action binding (TOCTOU guard). Read the TWO off the PendingCheckpoint the human saw
10190
10244
  # and echo VERBATIM; server resolves THAT exact checkpoint, fail-closed on mismatch (approval_binding_mismatch).
10191
- # Omit only against a pre-D-1 worker. boundInputHash is OPAQUE — never hashed/recomputed client-side.
10245
+ # server >= 7.143.0: both required (400 decide_requires_binding). boundInputHash is OPAQUE — never hashed/recomputed client-side.
10192
10246
  # 🔴 `checkpointToken` REMOVED (SDK 1.0.0): §4a makes it server-INTERNAL and it is NEVER surfaced on a
10193
10247
  # /v1/approvals row, so a compliant client has no way to obtain a correct value for it.
10194
- boundCallId: { type: string, description: '= PendingCheckpoint.boundCallId (the bound pendingAction.toolCallId).' }
10195
- boundInputHash: { type: string, description: 'Echo PendingCheckpoint.boundInputHash byte-for-byte; server-minted opaque, NEVER recompute.' }
10248
+ boundCallId: { type: string, minLength: 1, description: '= PendingCheckpoint.boundCallId (the bound pendingAction.toolCallId). An empty string reads as missing (400 decide_requires_binding).' }
10249
+ boundInputHash: { type: string, minLength: 1, description: 'Echo PendingCheckpoint.boundInputHash byte-for-byte; server-minted opaque, NEVER recompute. An empty string reads as missing (400 decide_requires_binding).' }
10196
10250
  updatedInput:
10197
10251
  description: >
10198
10252
  Approve-with-edit (design/37 last-wins): operator's rewritten tool args, applied AFTER the binding
@@ -10206,8 +10260,8 @@ components:
10206
10260
  `routes/approvals-assistant.ts` reads it; the SDK has typed it since the facade audit, the spec had
10207
10261
  not). It is an approval MEMORY, not a policy loosen — a deny / neverAuto always outranks it.
10208
10262
  Constraints (all server-enforced): only with `decision:"approve"` (else 400
10209
- `request.field_conflict`); requires the D-1 binding echo in the same body (else 400
10210
- `remember_requires_binding`); REFUSED on a direct-door worker (400 `remember_not_in_proof` — it is
10263
+ `request.field_conflict`); the binding pair is required on every decide (server >= 7.143.0: 400
10264
+ `decide_requires_binding`, no separate remember-only gate); REFUSED on a direct-door worker (400 `remember_not_in_proof` — it is
10211
10265
  not inside the HMAC payload, so accepting it unsigned would be tamperable); 501 without an exemption
10212
10266
  store. On the parked-background-agent leg the grant lands on the child's ROOT/HOST session (the whole
10213
10267
  session tree shares it). The 200 body echoes `rememberApplied` when a store is wired.
@@ -10230,6 +10284,42 @@ components:
10230
10284
  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
10231
10285
  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
10232
10286
  `POST /v1/tool-approvals/{id}/respond` does NOT take it. Servers <= 7.133.x refuse the key (400 `request.body_shape`, `unknownKeys: ["feedback"]`).
10287
+ decidedVia:
10288
+ allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
10289
+ description: 'server >= 7.143.0 (capability `approvalDecidedVia`): which seat answered a `decidedBy: "policy"` decision. Only beside `decidedBy: "policy"`; `null` is not absence (400); any value on a direct-door worker ⇒ 400.'
10290
+ mcpServers: { $ref: '#/components/schemas/ResumeRestatement/properties/mcpServers' }
10291
+ a2aPeers: { $ref: '#/components/schemas/ResumeRestatement/properties/a2aPeers' }
10292
+
10293
+ ResumeRestatement:
10294
+ type: object
10295
+ description: >
10296
+ server >= 7.143.0 — the resume restatement the four resume doors take (`/decide`, `plan_review`, `/resume`, `/wake`): the submit body's
10297
+ `mcpServers` / `a2aPeers`. A key present (non-null) REPLACES the parked task's stored table of that name for this resume (and is written
10298
+ back with the resume input, so a later resume that sends nothing replays it); the value shape is judged like `POST /v1/tasks` (same code
10299
+ and sentence on a bad shape). A key absent or `null` ⇒ the FROZEN reading (the table stored at submit). The two keys are independent; an
10300
+ empty array is an empty table, not absence. A task parked on an MCP call whose target is not in the sent table is judged by the engine
10301
+ (`resume.tool_unavailable` / `resume.tool_contract_mismatch` reopen the card; `resume.target_moved` consumes the approval). `/decide` on a card
10302
+ parked by a background child ⇒ 400 `decide.parked_restatement_unsupported`; the two keys on a direct-door worker's `/decide` / `plan_review`
10303
+ ⇒ 400 `restatement_not_in_proof`. Servers <= 7.142.x: `/decide` / `plan_review` refuse the keys (400), `/resume` / `/wake` ignore them.
10304
+ properties:
10305
+ mcpServers: { type: ['array', 'null'], maxItems: 32, items: { $ref: '#/components/schemas/McpServerSpec' }, description: 'Same element shape as `TaskRequest.mcpServers`.' }
10306
+ a2aPeers: { type: ['array', 'null'], maxItems: 32, items: { $ref: '#/components/schemas/A2aServerSpec' }, description: 'Same element shape as `TaskRequest.a2aPeers`.' }
10307
+
10308
+ SessionWakeRequest:
10309
+ type: object
10310
+ description: 'Body of `POST /v1/sessions/{sessionId}/wake`: an optional non-empty `message` (an empty string is 400) plus the resume restatement (server >= 7.143.0; see ResumeRestatement).'
10311
+ properties:
10312
+ message: { type: string, minLength: 1 }
10313
+ mcpServers: { $ref: '#/components/schemas/ResumeRestatement/properties/mcpServers' }
10314
+ a2aPeers: { $ref: '#/components/schemas/ResumeRestatement/properties/a2aPeers' }
10315
+
10316
+ ApprovalDecidedVia:
10317
+ type: string
10318
+ enum: [policy, permission_request_hook]
10319
+ description: >
10320
+ server >= 7.143.0 (engine `DECIDED_VIA`, verbatim and in order) — the seat a `decidedBy: "policy"` decision was answered from:
10321
+ `policy` = the deployment's own policy; `permission_request_hook` = a PermissionRequest hook answered the card (the model reads
10322
+ "a PermissionRequest hook refused this call", not the deployment-policy sentence). ABSENT = `policy`.
10233
10323
 
10234
10324
  Capabilities:
10235
10325
  type: object
@@ -10307,7 +10397,7 @@ components:
10307
10397
  itself. The memory ENGINE that replaced it is model-facing skills over an injected memory dir and
10308
10398
  has NO service HTTP verbs, so this flag is not its availability signal. The SDK removed the five
10309
10399
  legacy verbs in 1.0.0; the live face is `client.memory.exportScope` / `.sync`
10310
- (`GET /v1/memory/export`, `POST /v1/memory/sync/{scope}`), which this flag does NOT gate.
10400
+ (`GET /v1/memory/export`, `POST /v2/memory/sync/{scope}`), which this flag does NOT gate.
10311
10401
  Kept on the wire so an older shell that still reads it honestly hides the dead affordances.
10312
10402
  adoption:
10313
10403
  type: boolean
@@ -10691,6 +10781,11 @@ components:
10691
10781
  server >= 7.118.0, hardcoded true (a version bit): the three approval decision doors read `decidedBy` (ApprovalDecidedBy).
10692
10782
  Send it only when this is present; absent = an older server (the durable doors and `plan_review` 400 it, the live
10693
10783
  `respond` drops it silently and answers 200).
10784
+ approvalDecidedVia:
10785
+ type: boolean
10786
+ description: >-
10787
+ server >= 7.143.0, hardcoded true (a version bit): the four decision doors (live `respond`, durable ask `decision`, `/decide`,
10788
+ `plan_review`) read `decidedVia` (ApprovalDecidedVia) beside `decidedBy: "policy"`. Send it only when this is present.
10694
10789
  sessionReadRedaction:
10695
10790
  type: boolean
10696
10791
  description: >-
@@ -10853,6 +10948,7 @@ components:
10853
10948
  allowGrant: { type: boolean, description: 'Constant `true` on server >= 7.115.0: `settings.permissions.allow` is read as allow RULES, not as a list. The whole `settings` key being absent = an older server.' }
10854
10949
  allowLayer: { type: boolean, description: 'Constant `true` on server >= 7.117.0 (core 7.42.0): the whole `settings.permissions.allow` list goes to the engine allow layer (listed calls are not asked; content forms accepted; entries read as nothing get an `engine_notice` `permission.allowed_tool_not_granted`). Absent = a server without it (7.115.0–7.116.x: allow is a statement; older: a list).' }
10855
10950
  layers: { type: boolean, description: 'Constant `true` on server >= 7.141.0 (both deployment shapes): `settings.permissions.deny` / `ask` accept a layered entry `{ rule, layer }` beside a plain string (see `TaskRequest.settings`). Send layered entries only when this bit is `true`: an older server refuses them (a new submit 400, a resume 409) — loud, never silently dropped.' }
10951
+ layeredAllow: { type: boolean, description: 'Constant `true` on server >= 7.143.0: `settings.permissions.allow` entries accept the same layered form `{ rule, layer }` as `deny` / `ask` (a user-layer `/`-form allow reads at the execution environment''s config root). Send layered allow entries only when this bit is `true`.' }
10856
10952
  callerTrust: { type: string, description: 'server >= 7.133.0 — THIS caller''s trust tier (per caller / per credential, NOT a version bit). Request rule tables that take effect without a person answering (`settings.permissions` buckets; a named-invoked skill''s `allowedTools` / `disallowedTools`) are admitted by it: `allow` loosens the no-ask surface and needs `global`; `deny` / `ask` only tighten and are admitted at any tier. Today `global` (single-user turnkey; multi-tenant with the deployment service credential; multi-tenant sign-in token whose scope role >= the governance write role) or `project` (everything else). Read OPEN: an unknown word is treated as `project` (fail-closed). A request below the floor is refused whole with 400 `request.field_invalid` (`detail.problems[].reason: below_trust_floor`, `detail.callerTrust`). ABSENT = server <= 7.132.x: no per-tier admission.' }
10857
10953
  memoryWrite:
10858
10954
  type: boolean
@@ -11039,7 +11135,7 @@ components:
11039
11135
  memorySyncServe:
11040
11136
  description: >
11041
11137
  server >= 7.142.0 — the MEMORY-SYNC CENTER's identity bit: `{ identity }` iff this is a DB memory plane (`MEMORY_ENGINE_BACKEND=pg|mysql`) with the sync perform
11042
- seat AND the operator declared `MEMORY_SYNC_SERVE_IDENTITY`; otherwise `false` (not a center, or no identity declared — then `POST /v1/memory/sync/{scope}` answers
11138
+ seat AND the operator declared `MEMORY_SYNC_SERVE_IDENTITY`; otherwise `false` (not a center, or no identity declared — then `POST /v2/memory/sync/{scope}` (server >= 7.143.0; `/v1` before) answers
11043
11139
  501 `feature.memory_sync_serve_disabled`). A composite bit (the server's composite-member table `memorySyncServe: ["identity"]`); there is no `true`.
11044
11140
  `identity` = the canonical base address clients reach this center's sync face at (lower-case scheme and host, no default port, no trailing slash, no query /
11045
11141
  fragment / credential), verbatim: a local shell passes it as the `target` of `POST /v1/sessions/{sessionId}/memory/sync`; the center compares an inbound `peer`
@@ -11731,7 +11827,7 @@ components:
11731
11827
  type: object
11732
11828
  description: >
11733
11829
  core `MemoryEntry` (@sema-agent/core memory-engine/types.d.ts) — one memory-engine (DB twins)
11734
- note. Used verbatim by both GET /v1/memory/export's `entries` and POST /v1/memory/sync/{scope}'s
11830
+ note. Used verbatim by both GET /v1/memory/export's `entries` and POST /v2/memory/sync/{scope}'s
11735
11831
  `serverEntries` (server never re-shapes it — memory-policy.ts / memory-sync.ts pass the core
11736
11832
  array straight to `sendJson`).
11737
11833
  required: [id, slug, frontmatter, body, rev, scope]
@@ -11747,7 +11843,7 @@ components:
11747
11843
  MemorySyncResponse:
11748
11844
  type: object
11749
11845
  description: >
11750
- 200 body of POST /v1/memory/sync/{scope} — core `MemorySyncResponse` (server memory-sync.ts),
11846
+ 200 body of POST /v2/memory/sync/{scope} (server >= 7.143.0; `/v1` before) — core `MemorySyncResponse` (server memory-sync.ts),
11751
11847
  `sendJson`'d verbatim (memory-policy.ts). `pullTruncated` is OMIT-when-absent (present+`true`
11752
11848
  only when `serverEntries` was cut by `?pull.limit`).
11753
11849
  required: [applied, conflicts, serverEntries, serverDeletes, cursor]
@@ -11783,14 +11879,27 @@ components:
11783
11879
  baseRev: { type: string }
11784
11880
  cursor:
11785
11881
  type: object
11786
- required: [peer, baseRevs, updatedAtMs]
11882
+ required: [peer, incarnation, baseRevs, updatedAtMs]
11787
11883
  additionalProperties: false
11788
11884
  properties:
11789
11885
  peer: { type: string }
11886
+ incarnation: { type: string, description: 'server >= 7.143.0 (always present; only that version serves this path): the incarnation of the layer partition that answered — every write of this exchange committed under it; the next cursor carries it as its `peerIncarnation`.' }
11790
11887
  baseRevs: { type: object, additionalProperties: { type: string } }
11791
11888
  updatedAtMs: { type: integer }
11792
11889
  pullTruncated: { type: boolean, enum: [true] }
11793
11890
 
11891
+ MemorySyncIncarnationRefusal:
11892
+ type: object
11893
+ description: >
11894
+ server >= 7.143.0 — the OTHER 200 answer of POST /v2/memory/sync/{scope}: the request's `peerIncarnation` is not this partition's, or the
11895
+ request carries a non-empty baseline and no incarnation claim. Judged before any read or write — nothing was read or written. `incarnation`
11896
+ = this partition's incarnation. It is an answer, not an error: branch on `refused`.
11897
+ required: [refused, incarnation]
11898
+ additionalProperties: false
11899
+ properties:
11900
+ refused: { const: baseline_incarnation }
11901
+ incarnation: { type: string }
11902
+
11794
11903
  MemoryTransferEvidence:
11795
11904
  type: object
11796
11905
  description: >
@@ -11943,8 +12052,11 @@ components:
11943
12052
  One memory request lands on ONE store: the store the named layer lives in (file backend: the typed personal layers `user:` / `userproj:` / `org:` live in a
11944
12053
  SECOND store under the personal mount; the project layers and the un-typed layers, `local` included, live in the deployment's store). It rides the query string
11945
12054
  (`GET /v1/memory/entries/{entryId}/provenance`, `GET /v1/memory/origin/clearances`, `GET /v1/sessions/{sessionId}/memory-status`) or the body
11946
- (`MemoryOriginClearRequest`, `SessionMemoryEraseRequest`); `POST /v1/memory/erase` has no such key (the layer comes from `select.scope` / `expectedScopes`).
11947
- Needed only on a TWO-STORE deployment for verbs that name no layer; a single-store deployment answers byte-for-byte as 7.139.x. This schema is open: it only
12055
+ (`MemoryOriginClearRequest`); `POST /v1/memory/erase` has no such key (the layer comes from `select.scope` / `expectedScopes`), and the session self-service
12056
+ erase no longer has one (server >= 7.143.0: it erases across the whole deployment; 7.140.0–7.142.x read it from the body).
12057
+ Needed only on a TWO-STORE deployment for verbs that name no layer. Server >= 7.143.0 reads the deployment's store set FROM DISK: the personal mount counts
12058
+ once a store exists there (for instance after a personal-layer erasure wrote its anchor), whether or not the configuration names a personal layer;
12059
+ 7.140.0–7.142.x derived it from the configured layers. A single-store deployment answers byte-for-byte as 7.139.x. This schema is open: it only
11948
12060
  defines the key, and is embedded by property reference — it is not a request body of its own.
11949
12061
  additionalProperties: true
11950
12062
  properties:
@@ -11953,7 +12065,7 @@ components:
11953
12065
  minLength: 1
11954
12066
  description: >
11955
12067
  The memory layer key (e.g. `user:alice`, `local`) whose store answers. Absent ⇒ no layer named: on a two-store deployment the verbs that name no layer
11956
- answer 400 `request.memory_layer` (the session-id verbs fold or run on the deployment's store instead); present but not a non-empty string ⇒ 400
12068
+ answer 400 `request.memory_layer` (the session-id verbs need no seat: memory-status folds every store; the self-service erase spans the whole deployment, server >= 7.143.0); present but not a non-empty string ⇒ 400
11957
12069
  `request.field_invalid` (sentence only); a layer key the engine cannot read ⇒ 400 `request.memory_layer`. It only decides WHICH store answers — it never
11958
12070
  reaches the engine.
11959
12071
 
@@ -11987,10 +12099,8 @@ components:
11987
12099
  description: >
11988
12100
  The authorization set of this erasure (server >= 7.138.0; the judge is core): when present, the selector's own scope and the bound scope of EVERY
11989
12101
  resolved id must lie in the set, else the whole request is refused 400 `config.memory_erasure_scope` (nothing erased or recorded; an id whose scope the
11990
- store cannot attribute, or that never existed, counts as outside). The empty set authorizes no scope; absent = no narrowing. Server >= 7.140.0: it ALSO
11991
- serves as the layer seat of `select.ids` / `select.sessionId` on a two-store deployment (a non-empty set decides which store answers; spanning two stores ⇒
11992
- 400 `request.memory_layer`; a personal-mount store ⇒ 409 `memory.erasure_store_unjudged`; `select.ids` without it on a two-store deployment ⇒ 400
11993
- `request.memory_layer`).
12102
+ store cannot attribute, or that never existed, counts as outside). The empty set authorizes no scope; absent = no narrowing. Server >= 7.143.0: a set whose
12103
+ layers live in two stores ⇒ 400 `config.memory_erasure_scope`; without it, `select.ids` / `select.sessionId` erase each store's share (attestations merged).
11994
12104
 
11995
12105
  SessionMemorySyncRequest:
11996
12106
  type: object
@@ -12054,8 +12164,9 @@ components:
12054
12164
  additionalProperties: false
12055
12165
  required: [axis, found]
12056
12166
  properties:
12057
- axis: { type: string, enum: [scope, peer, store] }
12167
+ axis: { type: string, enum: [scope, peer, store, incarnation], description: 'server >= 7.143.0 adds `incarnation` (the center partition''s incarnation does not match: a center database rebuilt / restored, or a cursor written before the upgrade reads `absent`; the way out is the same — delete the cursor).' }
12058
12168
  found: { type: string, enum: [absent, other] }
12169
+ want: { type: string }
12059
12170
  outs: { type: array, minItems: 2, maxItems: 2, items: { type: string } }
12060
12171
  message: { type: string }
12061
12172
  error: { type: string }
@@ -12096,29 +12207,41 @@ components:
12096
12207
  oneOf:
12097
12208
  - required: [layers]
12098
12209
  - required: [refused]
12210
+ SessionMemoryUnobservedReason:
12211
+ type: string
12212
+ enum: [no_settled_run, run_result_missing, run_result_unobserved, memory_not_mounted, no_leaf]
12213
+ description: >
12214
+ server >= 7.143.0 — why the session memory sync has no read set, judged in this order: `no_settled_run` (no settled run); `run_result_missing` /
12215
+ `run_result_unobserved` (the latest settled run has no memory observation on record — an earlier run is never read in its place);
12216
+ `memory_not_mounted` (memory was configured for the latest settled run but did not mount, so which layers it reads is unknown); `no_leaf`
12217
+ (the session has no transcript yet, so there is no revision to sync from).
12218
+
12219
+ SessionMemoryUnobservedExtra:
12220
+ type: object
12221
+ description: 'server >= 7.143.0 — the machine-readable keys of 409 `conflict.session_memory_unobserved`.'
12222
+ required: [reason]
12223
+ properties:
12224
+ reason: { $ref: '#/components/schemas/SessionMemoryUnobservedReason' }
12225
+ activeTaskId: { type: string, description: 'Present when a run is in flight in the session.' }
12226
+
12099
12227
  SessionMemoryEraseRequest:
12100
12228
  type: object
12101
12229
  description: >
12102
12230
  Request body of POST /v1/sessions/{sessionId}/memory/erase (contract §12.5; release bytes server 7.107.0
12103
- `dist/http/routes/sessions.js:508-523`; the layer seat `scope` is server >= 7.140.0). Three NAMED keys. `select` is FORBIDDEN (the selector is minted by the path; a body
12104
- carrying it is a loud 400 `request.body_shape`). Any OTHER unknown key is NOT refused — the route silently ignores it and
12231
+ `dist/http/routes/sessions.js:508-523`). Two NAMED keys. `select` is FORBIDDEN (the selector is minted by the path; a body
12232
+ carrying it is a loud 400 `request.body_shape`); so is `scope` from server 7.143.0 (the 7.140.0–7.142.x layer seat, retired — erasure answers the whole deployment). Any OTHER unknown key is NOT refused — the route silently ignores it and
12105
12233
  forwards only `requestId` / `allowUnevidenced` (`:526`) — so this schema is open except for `select` (codex r1 F1: a closed
12106
12234
  schema would make a strict consumer reject a body the server accepts). `requestId` has the SAME meaning as
12107
12235
  `MemoryErasureRequest.requestId` (idempotency identity on the journal lane; a new request on the degraded lane) and is never
12108
12236
  minted by the server or the engine.
12109
12237
  required: [requestId]
12110
12238
  additionalProperties: true
12111
- not: { required: [select] }
12239
+ not: { anyOf: [{ required: [select] }, { required: [scope] }] }
12112
12240
  properties:
12113
12241
  requestId: { type: string, minLength: 1 }
12114
12242
  allowUnevidenced:
12115
12243
  type: boolean
12116
12244
  description: "Opt-in to the evidence-capability-ABSENT degradation lane — a human signature; never injected. Non-boolean ⇒ 400 `request.field_invalid`."
12117
- scope:
12118
- # the one definition of the layer seat key: `components.schemas.MemoryLayerSeat`. On THIS face (server >= 7.140.0): a layer living in the deployment's store
12119
- # (e.g. `local`) ⇒ the erasure runs there (200; the attestation covers that store only, the seat reaches neither the engine nor the attestation); a layer on the
12120
- # personal mount ⇒ 409 `memory.erasure_store_unjudged`; unreadable ⇒ 400 `request.memory_layer`.
12121
- $ref: '#/components/schemas/MemoryLayerSeat/properties/scope'
12122
12245
 
12123
12246
  MemoryErasedBinding:
12124
12247
  description: "core `ErasedBinding` — one erased row's coordinates: the scope it was bound in, NEVER its file name (a model-chosen name can restate the content being erased; attestation v2)."
@@ -12536,6 +12659,7 @@ components:
12536
12659
  catalog: { type: string, description: '`absent` | `adopted` | `refused` (open on read).' }
12537
12660
  refusalCode: { type: string, description: '`config.model_route_endpoint_missing` | `config.gateway_fallback_without_primary` (open on read); ABSENT = the judge passed.' }
12538
12661
  gap: { type: string, description: '`endpoint_missing` | `lane_credential_missing` (open on read); ABSENT = the judge passed.' }
12662
+ planeRefusalCode: { type: string, description: 'server >= 7.143.0: the code the model-plane group judge refused the LATEST ARRIVED catalog candidate with (present <=> that candidate was refused there; one of the settings-schema `MODEL_PLANE_REFUSAL_CODES`, open on read). `catalog: "refused"` with this key absent <=> the latest candidate was refused whole by the candidate judge (read `candidateRejected`). It names the latest candidate, `refusalCode` the table serving now.' }
12539
12663
  ModelsResponse:
12540
12664
  type: object
12541
12665
  description: >
@@ -13915,7 +14039,14 @@ components:
13915
14039
  properties:
13916
14040
  pending:
13917
14041
  type: array
13918
- items: { $ref: '#/components/schemas/PendingCheckpoint' }
14042
+ description: >
14043
+ server >= 7.143.0: TWO families, every row names its own in `kind` — `checkpoint` (PendingCheckpoint; door id = `sessionId`)
14044
+ and `peer_inbound` (PeerInboundPendingRow; door id = `id`). Branch on `kind` before reading family keys; skip an unknown `kind`.
14045
+ Servers <= 7.142.x list checkpoint rows only, without `kind`.
14046
+ items:
14047
+ oneOf:
14048
+ - { $ref: '#/components/schemas/PendingCheckpoint' }
14049
+ - { $ref: '#/components/schemas/PeerInboundPendingRow' }
13919
14050
  serverNowMs:
13920
14051
  type: integer
13921
14052
  description: >
@@ -13933,6 +14064,46 @@ components:
13933
14064
  decide route, no run revival). Present iff the local-lane ask audit store is wired; `[]` = the face exists and nothing was converged;
13934
14065
  absent = no such face on this deployment (or an older server).
13935
14066
 
14067
+ PeerInboundPendingRow:
14068
+ type: object
14069
+ description: >
14070
+ server >= 7.143.0 — a held cross-session message awaiting the RECIPIENT's review (`GET /v1/approvals` `pending[]` and the
14071
+ `/v1/approvals/stream` `pending` frame; server `PeerInboundPendingRow`, key-for-key). Held because the sender's permission mode
14072
+ does not match the recipient's. Decided at `POST /v1/approvals/{id}/decide` with `{ decision }`. A per-replica in-process
14073
+ projection (like `livePending`). Deliberately carries NO `sessionId` (in this array that name is the checkpoint door id).
14074
+ additionalProperties: false
14075
+ required: [kind, id, recipientSessionId, lane, cause, content, sentAt, heldAt]
14076
+ properties:
14077
+ kind: { const: peer_inbound }
14078
+ id: { type: string, description: 'The door id (opaque, `peer_inbound:` prefix) — pass back verbatim, never parse.' }
14079
+ recipientSessionId: { type: string }
14080
+ lane: { type: string, enum: [session, principal_inbox] }
14081
+ cause: { type: string, enum: [mode-mismatch, no-mode-asserted, invalid-mode-attestation] }
14082
+ content: { type: string }
14083
+ sentAt: { type: number, description: 'epoch ms.' }
14084
+ heldAt: { type: number, description: 'epoch ms.' }
14085
+ fromSession: { type: string }
14086
+ fromName: { type: string }
14087
+ fromScope: { type: string }
14088
+
14089
+ PeerInboundDecision:
14090
+ type: object
14091
+ description: 'server >= 7.143.0 — the `peer_inbound` family decide body: exactly `{ decision }` (any other key ⇒ 400 naming it).'
14092
+ additionalProperties: false
14093
+ required: [decision]
14094
+ properties:
14095
+ decision: { type: string, enum: [approve, deny] }
14096
+
14097
+ PeerInboundDecideResult:
14098
+ type: object
14099
+ description: 'server >= 7.143.0 — 200 body of a `peer_inbound` decide (server `PeerInboundDecideReply`): `outcome` = the engine''s settle answer (`gone` never reaches the wire, it answers 404).'
14100
+ additionalProperties: false
14101
+ required: [kind, id, outcome]
14102
+ properties:
14103
+ kind: { const: peer_inbound }
14104
+ id: { type: string }
14105
+ outcome: { type: string, enum: [delivered, released_pending, dropped, dropped_by_policy, denied, expired, decided_elsewhere] }
14106
+
13936
14107
  CrashConvergedRow:
13937
14108
  type: object
13938
14109
  description: >
@@ -14013,6 +14184,9 @@ components:
14013
14184
  approvalCard:
14014
14185
  allOf: [{ $ref: '#/components/schemas/ToolApprovalCardWord' }]
14015
14186
  description: 'server >= 7.126.0 (core 7.49.0 #1414): which card this ask renders on — the engine-minted card word, the SAME value as `frame.approvalCard` (the row reads the frame''s own seat, no second read), same layer and shape as the operator queue row''s `approvalCard`. It REPLACES `contentKind` (server <= 7.125.x derived it from the tool name; deleted at 7.126.0, no alias). ABSENT = the engine minted none. Display / triage only; it NEVER takes part in decision routing.'
14187
+ liveFactsUnknown:
14188
+ const: true
14189
+ description: 'server >= 7.143.0 — a row ADOPTED at boot from the ask ledger (see `consumerState`) whose ask was minted before this version: top-level `mandated` / `mandate` / `origin` are absent and this key says "unknown". The same fact as `frame.liveFactsUnknown`.'
14016
14190
  frame:
14017
14191
  oneOf:
14018
14192
  - $ref: '#/components/schemas/ToolApprovalFrame'
@@ -14302,6 +14476,7 @@ components:
14302
14476
  required: [sessionId, scope, createdAt]
14303
14477
  additionalProperties: true
14304
14478
  properties:
14479
+ kind: { const: checkpoint, description: 'server >= 7.143.0: the row family (always `checkpoint` on this schema); absent on servers <= 7.142.x, which list this family only.' }
14305
14480
  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.' }
14306
14481
  sessionId: { type: string, description: 'The decide handle: POST /v1/approvals/:sessionId/decide.' }
14307
14482
  scope: { type: string, description: 'Principal; "_" = submitted without one.' }
@@ -14437,6 +14612,10 @@ components:
14437
14612
  minItems: 1
14438
14613
  items: { $ref: '#/components/schemas/AskClass' }
14439
14614
  description: 'server >= 7.109.0 (S-934 ②): every class this parked ask belongs to (non-empty, first member = `askClass`); read the whole set.'
14615
+ askReasons:
14616
+ type: array
14617
+ items: { $ref: '#/components/schemas/AskReason' }
14618
+ description: 'server >= 7.143.0 (core 7.61.0): WHO asked and WHY — the park-row twin seat, read through the same narrow read as the live frame and the card (same value). Absent = an older engine / row.'
14440
14619
  hasBidiControls:
14441
14620
  type: boolean
14442
14621
  enum: [true]
@@ -14480,7 +14659,8 @@ components:
14480
14659
  (they carry a RiskDescriptor); ABSENT for resource_limit/needs_review/plan_review — UI tolerates undefined.
14481
14660
  spentMicroUsd: { type: number, description: 'cumulative spend on the suspend chain (when a resource ledger is attached).' }
14482
14661
  deadline: { type: integer, description: 'awaiting-human SLA deadline (epoch ms).' }
14483
- sourceTaskId: { type: string, description: 'The task that produced this checkpoint (when distinct from sessionId).' }
14662
+ sourceSessionId: { type: string, description: 'server >= 7.143.0 (core 7.61.0 rename of `sourceTaskId`, same value, no alias): the SESSION id of the leg that raised this ask — it names a session, not a task.' }
14663
+ agentId: { type: string, description: 'server >= 7.143.0: the agent id of the parked leg when it is a delegated child (a background child''s registry row id, otherwise its session id); absent on the host''s own row.' }
14484
14664
  principal: { type: string, description: 'The submitting principal, when the deployment records one.' }
14485
14665
  createdAt: { type: integer, description: 'Creation time, epoch ms (NOTE — SessionRecord.createdAt is an ISO string).' }
14486
14666
  preview:
@@ -14839,6 +15019,11 @@ components:
14839
15019
  versions are 401 in both directions.
14840
15020
  ⚠️ The key name is final: `permissionModeAfter` (the build brief once said `nextPermissionMode`,
14841
15021
  which never shipped — zero aliases).
15022
+ decidedVia:
15023
+ allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
15024
+ description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
15025
+ mcpServers: { $ref: '#/components/schemas/ResumeRestatement/properties/mcpServers' }
15026
+ a2aPeers: { $ref: '#/components/schemas/ResumeRestatement/properties/a2aPeers' }
14842
15027
 
14843
15028
  SessionAgent:
14844
15029
  type: object
@@ -17533,6 +17718,9 @@ components:
17533
17718
  summaryMs: { type: integer }
17534
17719
  persistMs: { type: integer }
17535
17720
  ptlRetries: { type: integer }
17721
+ requestedBy:
17722
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
17723
+ description: 'server >= 7.143.0 (core 7.61.0): this compaction was requested by an extension registration through `$.session.compact`. Absent = a host / manual request, or an automatic compaction.'
17536
17724
  pass:
17537
17725
  type: string
17538
17726
  description: 'server >= 7.132.0 (core 7.53.0 #2008): the id of the compaction pass that LANDED — the same opaque value its `compaction_started.pass` carried. Pair the start with its end on `pass`, not on "the next `compacted`" (legs interleave on one stream). Absent = an older server / a pass that never announced a start.'
@@ -18421,9 +18609,16 @@ components:
18421
18609
  own submit-time image pre-check (ops-log line `images_omitted_no_vision_model` and counter `images_omitted_total`, both retired in 7.137.0: the engine mints the fact at the moment it really replaces the image);
18422
18610
  a reasoning knob the model declares off is not reported here (that is `effectiveReasoning.dropped`).
18423
18611
  server 7.138.0 adds two codes to the user whitelist (appendix D.3 44 -> 46; both audience `user` in core's register), described here because their `detail` is not self-evident:
18424
- `context.image_removed` (core 7.59.0) — the provider said an image in this turn's request could not be processed (the failed turn's `errorKind` is `image_unprocessable`), so the engine took the images out of the NEWEST message still
18425
- carrying any (each replaced by a one-line note), re-sent the turn without them, and every later request of the session reads the same removal; the session transcript keeps the original images. The way out is another image format (admission
18426
- separately refuses images whose header is incomplete for png / jpeg / gif / webp, and does not send this code). `{ images, sessionId, runId }` — `images` = how many were taken out of that message; no body text. Once per run per refusal.
18612
+ the image-removal code (core 7.59.0; RENAMED at server 7.143.0 / core 7.61.0 to `context.media_removed`, no alias — the old code no longer appears). `context.media_removed`
18613
+ (server >= 7.143.0) — media (images / documents) left a request the model saw; the session transcript keeps the originals; each block's place reads `[<image|document> N removed: <why>]`.
18614
+ `{ reason, images, documents, sessionId, runId }`: `reason` is `rejected_by_provider` (the provider could not process an image in this turn — the failed turn's `errorKind` is `image_unprocessable` — so the
18615
+ images of the NEWEST message still carrying any were taken out and the turn re-sent; every later request of the session reads the same removal; `documents` is 0; once per run per refusal) or
18616
+ `media_budget` (the request's media went over the block cap / the deployment's base64 budget: the oldest blocks were left out; `images` / `documents` count the blocks this notice is the first to report). No body text.
18617
+ The way out for `rejected_by_provider` is another image format (admission separately refuses png / jpeg / gif / webp images whose header is incomplete, without this code).
18618
+ server 7.143.0 also adds `classifier.seat_rate_limited` (`{ model, to, rung, consecutive, sessionId?, runId? }`: the classifier seat hit the provider's rate limit `consecutive` times in a row, so for the rest
18619
+ of the run every gated call is judged from `to` on — the seat left the ladder; once per run per seat) and `context.tool_schema_removed` (`{ tool, sessionId, runId }`: the provider refused the request because of one
18620
+ tool's input schema and named it — the failed turn's `errorKind` is `tool_schema_refused` — so that tool's parameters are sent as an empty object schema from then on for this transcript (MCP and A2A tools only,
18621
+ at most 8 per transcript; the model can still call the tool); once per refusal). All three audience `user`.
18427
18622
  `mcp.authorization_required` (core 7.59.0) — an MCP server the user must authorize before it serves them: the leg's dial failed `unauthorized`, or a request was refused that way and that refusal is its answer (a repeat-safe call refused with 401
18428
18623
  and sent once more on a renewed credential announces only if that send is refused too). The leg does not park on it. `{ server, reason, authorizeUrl?, principal?, sessionId, runId }` — `reason` is `rejected` (401) / `scope` (403
18429
18624
  `insufficient_scope`) / `none` (the authorization seat holds no authorization for this user), the engine's closed set, echoed by the server (read OPEN); `authorizeUrl` only ever comes from the deployment's authorization seat (this deployment
@@ -19224,9 +19419,16 @@ components:
19224
19419
  type: boolean
19225
19420
  enum: [true]
19226
19421
  description: 'Present ⇔ the ask comes from a DELEGATED background/nested child — the EXPLICIT discriminator (trusted engine fact).'
19227
- sourceTaskId:
19422
+ sourceSessionId:
19423
+ type: string
19424
+ description: 'server >= 7.143.0 (core 7.61.0 BREAKING rename of `sourceTaskId`, same value, no alias): the delegated child''s core SESSION id — row-join value. Read attribution off `fromSubagent`, not off this key''s presence.'
19425
+ agentId:
19228
19426
  type: string
19229
- description: 'Child''s core session id (same id domain as task_progress.taskId) — row-join value + fallback discriminator against a server predating fromSubagent.'
19427
+ description: 'server >= 7.143.0: the agent id of the leg that raised the ask (a background child''s registry row id `a…`, a foreground child''s session id); a directly started workflow''s agent carries it WITHOUT `fromSubagent`; absent on the host''s own ask.'
19428
+ askReasons:
19429
+ type: array
19430
+ items: { $ref: '#/components/schemas/AskReason' }
19431
+ description: 'server >= 7.143.0 (core 7.61.0): WHO asked and WHY — one entry per asker with its own words. Structured approval UIs render reason lines from this, not from `message`. Words are credential-redacted and length-capped; any malformed entry ⇒ the whole seat is withheld. Absent = an older engine / the engine''s generic question.'
19230
19432
  sourceAgentName: { type: string, description: 'Display name of the child agent, redacted. UNTRUSTED.' }
19231
19433
  delegation:
19232
19434
  type: object
@@ -19524,6 +19726,9 @@ components:
19524
19726
  readRootCandidate: { $ref: '#/components/schemas/ToolApprovalFrame/properties/readRootCandidate' }
19525
19727
  probeReason: { $ref: '#/components/schemas/ToolApprovalFrame/properties/probeReason' }
19526
19728
  requestedBy: { $ref: '#/components/schemas/ToolApprovalFrame/properties/requestedBy' }
19729
+ liveFactsUnknown:
19730
+ const: true
19731
+ description: 'server >= 7.143.0 — ONLY on a disconnect-replay frame: the row was minted before this version (its card envelope has no live-facts seat) or that seat cannot be read, so the top-level live facts are all absent and this key says "unknown" (not "none"). Absent = the live facts on this frame are verbatim (a live frame, or a replay frame whose envelope carries the seat).'
19527
19732
 
19528
19733
  ApprovalCard:
19529
19734
  type: object
@@ -19577,7 +19782,12 @@ components:
19577
19782
  the ABSENT != "you have no rule" clause and the separation from `governanceForced` are stated verbatim on ToolApprovalFrame.allowRuleShadowed
19578
19783
  — the live frame, the stored `card_json`, the replayed frame and the `approval_request` card carry the SAME material.
19579
19784
  fromSubagent: { type: boolean, enum: [true], description: 'Present ⇔ the ask comes from a DELEGATED child — the explicit discriminator (a worker cannot forge it).' }
19580
- sourceTaskId: { type: string, description: 'The child''s core session id — row-join value + fallback discriminator.' }
19785
+ sourceSessionId: { type: string, description: 'server >= 7.143.0 (rename of `sourceTaskId`, same value, no alias): the child''s core session id — same as ToolApprovalFrame.sourceSessionId.' }
19786
+ agentId: { type: string, description: 'server >= 7.143.0: same as ToolApprovalFrame.agentId.' }
19787
+ askReasons:
19788
+ type: array
19789
+ items: { $ref: '#/components/schemas/AskReason' }
19790
+ description: 'server >= 7.143.0: same value as ToolApprovalFrame.askReasons (one narrow read for frame, card and queue row).'
19581
19791
  sourceAgentName: { type: string, description: 'The child agent''s display name, redacted. UNTRUSTED.' }
19582
19792
  # A-057.④(#314):三键 server 早已随卡投出(与 tool_approval 帧同一窄读函数 ⇒ 帧与 card 同值),
19583
19793
  # 但本 schema 只在帧上公示过 —— 按 spec 生成的卡消费方拿不到。定义与帧上同构段逐字同源,
@@ -20520,6 +20730,9 @@ components:
20520
20730
  not move): a `policy` allow on a person-required card ⇒ 400 `request.field_conflict`; outside the closed set ⇒
20521
20731
  400 `request.field_invalid`; any value on a direct-door worker ⇒ 400 `decided_by_not_in_proof`. An older server
20522
20732
  (no `approvalDecidedBy` bit) has a strict body here ⇒ 400 `request.body_shape`, nothing decided.
20733
+ decidedVia:
20734
+ allOf: [{ $ref: '#/components/schemas/ApprovalDecidedVia' }]
20735
+ description: 'server >= 7.143.0 (capability `approvalDecidedVia`): see ApprovalDecision.decidedVia.'
20523
20736
 
20524
20737
  ApprovalDecideGateKind:
20525
20738
  type: string
@@ -20537,6 +20750,31 @@ components:
20537
20750
  description: >
20538
20751
  server >= 7.126.0 (sdk 21.1.0 `PLAN_REVIEW_GATE_KINDS`) — the parked gate kind the plan-review door
20539
20752
  `POST /v1/assistant/tasks/{taskId}/plan_review` accepts (3-state approve | edit | reject).
20753
+ AskReason:
20754
+ description: >
20755
+ server >= 7.143.0 (core 7.61.0) — one asker and its own words. Two arms: a hook / extension question `{ by: "hook", cause, registration?, words? }`
20756
+ (`cause` = engine `HOOK_QUESTION_CAUSES`), or a policy-chain question `{ by, words }` (`by` = the AskOrigin words minus `hook`).
20757
+ oneOf:
20758
+ - type: object
20759
+ additionalProperties: false
20760
+ required: [by, cause]
20761
+ properties:
20762
+ by: { const: hook }
20763
+ cause: { $ref: '#/components/schemas/HookQuestionCause' }
20764
+ registration: { type: string }
20765
+ words: { type: string }
20766
+ - type: object
20767
+ additionalProperties: false
20768
+ required: [by, words]
20769
+ properties:
20770
+ by: { type: string, enum: [content_question, plan_review, ancestor_marked, org_unavailable, org_rule, rule_store_unavailable, ask_rule, denial_limit_fallback, shell_gate_tighten, safety_tighten, policy], description: 'AskOrigin words minus `hook` (the server card schema''s table; an entry outside it withholds the whole seat).' }
20771
+ words: { type: string }
20772
+
20773
+ HookQuestionCause:
20774
+ type: string
20775
+ enum: [asked, verdict_unreadable, verdict_unfinished]
20776
+ description: 'server >= 7.143.0 (engine `HOOK_QUESTION_CAUSES`, verbatim and in order): why a hook / extension question asks — `asked` (it answered "ask"), `verdict_unreadable` (its verdict could not be read), `verdict_unfinished` (it did not finish in time). Only on the hook arm of AskReason.'
20777
+
20540
20778
  ApprovalDecidedBy:
20541
20779
  type: string
20542
20780
  enum: [person, policy]
@@ -20943,6 +21181,9 @@ components:
20943
21181
  so only on `failed` / `mooted` (a pass that ran its summary and did not land, or was cut while it ran — `mooted` with `reason: "task_ending"` = the task's
20944
21182
  own end cut the running summary, a form this frame closes since core 7.53.0). `blocked` / `suppressed` / `disabled` / `noop` and a manual request no
20945
21183
  boundary served carry none (those passes never started).
21184
+ requestedBy:
21185
+ allOf: [{ $ref: '#/components/schemas/ExtensionRequester' }]
21186
+ description: 'server >= 7.143.0 (core 7.61.0): the compaction was requested by an extension registration through `$.session.compact` (carried here when that requested pass did not land; same as `compacted.requestedBy`).'
20946
21187
  eventId: { type: string }
20947
21188
  parentToolCallId: { type: string }
20948
21189
  Event_compaction_started:
@@ -21353,7 +21594,13 @@ components:
21353
21594
  type:
21354
21595
  type: string
21355
21596
  description: 'Open on read. Known values: pending / resolved / synced / heartbeat / meta / error.'
21356
- sessionId: { type: string, description: '`resolved` frames: which pending settled.' }
21597
+ kind: { type: string, enum: [checkpoint, peer_inbound], description: 'server >= 7.143.0, `pending` / `resolved` frames: the row family. A `pending` frame spreads that family''s row (PendingCheckpoint or PeerInboundPendingRow); a `resolved` frame carries `sessionId` + `toolCallId` (checkpoint) or `id` (peer_inbound). Branch on it before settling a card; absent on servers <= 7.142.x.' }
21598
+ id: { type: string, description: 'server >= 7.143.0, `peer_inbound` `pending` / `resolved` frames: the door id (PeerInboundPendingRow.id).' }
21599
+ askReasons:
21600
+ type: array
21601
+ items: { $ref: '#/components/schemas/AskReason' }
21602
+ description: '`pending` frames only (server >= 7.143.0) — see PendingCheckpoint.askReasons.'
21603
+ sessionId: { type: string, description: '`resolved` frames (checkpoint family): which pending settled.' }
21357
21604
  toolCallId: { type: string, description: '`resolved` frames: the settled pending''s bound tool-call id (absent when the pending carried none).' }
21358
21605
  count: { type: integer, description: '`synced` frames: how many pendings the connect-time snapshot carried.' }
21359
21606
  checkpointId: { type: string, description: '`pending` frames only (server >= 7.133.0): the spread PendingCheckpoint row''s `checkpointId` (key absent when the row has no trusted value — read as "no joinable identity").' }
@@ -22838,8 +23085,8 @@ components:
22838
23085
  `http` / `stream_torn` / `refusal` / `length_empty`). ABSENT on success and on older servers.
22839
23086
  errorKind:
22840
23087
  type: string
22841
- enum: [input_too_long, degenerate, length_empty, image_unprocessable]
22842
- description: 'server >= 7.135.0 (failure only): the STRUCTURAL failure kind the reply carried, forwarded as is — `input_too_long` (the provider refused the request as over its window), `degenerate`, `length_empty`; server >= 7.138.0 (engine 7.59.0) also `image_unprocessable` (the provider could not process an image in the request). Absent when the reply carried none. Closed (the engine''s four words): adding a word is an output-type widening.'
23088
+ enum: [input_too_long, degenerate, length_empty, image_unprocessable, tool_schema_refused]
23089
+ description: 'server >= 7.135.0 (failure only): the STRUCTURAL failure kind the reply carried, forwarded as is — `input_too_long` (the provider refused the request as over its window), `degenerate`, `length_empty`; server >= 7.138.0 (engine 7.59.0) also `image_unprocessable` (the provider could not process an image in the request); server >= 7.143.0 (engine 7.61.0) also `tool_schema_refused` (the provider refused the request over one tool''s input schema — the side query does not carry the tool name; read `errorMessage` for display). Absent when the reply carried none. Closed (the engine''s five words): adding a word is an output-type widening.'
22843
23090
  account:
22844
23091
  allOf: [{ $ref: '#/components/schemas/SideQueryAccountRow' }]
22845
23092
  description: 'server >= 7.138.0 (engine 7.59.0; always present on newer servers, absent on older ones): this side query''s line in the session''s account — see `SideQueryAccountRow`. This server mints no session total.'
@@ -23587,21 +23834,31 @@ components:
23587
23834
  cloud deployment has no access to the user's filesystem — that is the deployment shape, not a bypass:
23588
23835
  what is read is still only the allow bucket.
23589
23836
 
23590
- 🔴 `root` follows the RuleScope rule (server >= 7.120.0: a complete absolute path; otherwise 400
23591
- `request.body_shape` and no ticket minted — the `error` is "layers[<i>].root must be an absolute path" on server >= 7.121.0,
23592
- naming the first refused layer, and the scope sentence on 7.120.x). It applies to ALL layers alike — a `userSettings` layer's root never becomes a scope, but it is the
23593
- same field under the same check. On <= 7.119.x only an empty root is refused (with the body-shape sentence).
23837
+ 🔴 TWO ARMS BY `layer` (server >= 7.143.0 / engine 7.61.0, BREAKING, no alias): a `userSettings` layer is `{ layer, path, content }` and carries
23838
+ NO `root` (a body sending one ⇒ 400 `request.body_shape`; its `/`-rooted path rules stay in the settings file, reported as
23839
+ `unsupported.layer_root:` candidates); a `projectSettings` / `localSettings` layer is `{ layer, path, root, content }`.
23840
+ `root` follows the RuleScope rule (server >= 7.120.0: a complete absolute path; otherwise 400 `request.body_shape` and no ticket minted — the `error` is
23841
+ "layers[<i>].root must be an absolute path" on server >= 7.121.0, naming the first refused layer).
23594
23842
  Its TRUTHFULNESS is deliberately NOT validated: the server has no such tree to check against, and pretending
23595
23843
  to validate would be a lie. It is the user's own label for "which cwds should this rule be live under".
23596
23844
  # 封闭:server 侧 zod 是 `.strict()`(把 `content` 拼成 `contents` 的客户端应当场 400,而不是拿到
23597
23845
  # 一份「零候选」的预览去纳闷)。
23598
- additionalProperties: false
23599
- required: [layer, path, root, content]
23600
- properties:
23601
- layer: { $ref: '#/components/schemas/CcImportSettingsLayer' }
23602
- path: { type: string, minLength: 1, maxLength: 1024 }
23603
- root: { type: string, minLength: 1, maxLength: 1024 }
23604
- content: { type: string, maxLength: 16384, description: 'The layer file''s raw JSON text (16 KiB cap — a settings file is hand-written, not a dataset; the cap keeps this from becoming an upload channel).' }
23846
+ oneOf:
23847
+ - type: object
23848
+ additionalProperties: false
23849
+ required: [layer, path, content]
23850
+ properties:
23851
+ layer: { const: userSettings }
23852
+ path: { type: string, minLength: 1, maxLength: 1024 }
23853
+ content: { type: string, maxLength: 16384, description: 'The layer file''s raw JSON text (16 KiB cap — a settings file is hand-written, not a dataset; the cap keeps this from becoming an upload channel).' }
23854
+ - type: object
23855
+ additionalProperties: false
23856
+ required: [layer, path, root, content]
23857
+ properties:
23858
+ layer: { type: string, enum: [projectSettings, localSettings] }
23859
+ path: { type: string, minLength: 1, maxLength: 1024 }
23860
+ root: { type: string, minLength: 1, maxLength: 1024 }
23861
+ content: { type: string, maxLength: 16384 }
23605
23862
 
23606
23863
  CcImportPreview:
23607
23864
  type: object