@sema-agent/server 7.150.0 → 7.151.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 (341) hide show
  1. package/MIGRATION.md +185 -0
  2. package/USAGE.md +53 -25
  3. package/deploy/sema-up/README.md +7 -1
  4. package/deploy/sema-up/chart/Chart.yaml +1 -1
  5. package/deploy/sema-up/chart/templates/NOTES.txt +5 -0
  6. package/deploy/sema-up/chart/templates/_helpers.tpl +15 -16
  7. package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -3
  8. package/deploy/sema-up/chart/templates/server.yaml +5 -3
  9. package/deploy/sema-up/chart/values-full-single.yaml +3 -1
  10. package/deploy/sema-up/chart/values.yaml +8 -1
  11. package/deploy/sema-up/cluster-up.sh +1 -0
  12. package/deploy/sema-up/kube-up.sh +1 -1
  13. package/deploy/sema-up/lib/flagshape.sh +1 -1
  14. package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
  15. package/deploy/sema-up/lib/helm-values-kube.py +2 -0
  16. package/dist/adoption/import.js +3 -3
  17. package/dist/approval-ask-machine.d.ts +1 -1
  18. package/dist/approval-card.d.ts +2 -2
  19. package/dist/approval-gate-currency.d.ts +1 -1
  20. package/dist/auth-bridge.d.ts +20 -0
  21. package/dist/auth-bridge.js +9 -0
  22. package/dist/background-session-reap.d.ts +1 -1
  23. package/dist/bake-runner/main.d.ts +4 -2
  24. package/dist/bind-host.d.ts +2 -3
  25. package/dist/bind-host.js +2 -4
  26. package/dist/boot/budget-tracing.js +1 -1
  27. package/dist/boot/engine-lease.d.ts +5 -0
  28. package/dist/boot/engine-lease.js +1 -0
  29. package/dist/boot/execution-env.d.ts +8 -14
  30. package/dist/boot/execution-env.js +54 -17
  31. package/dist/boot/execution-lane.js +32 -5
  32. package/dist/boot/late-binds.d.ts +8 -4
  33. package/dist/boot/late-binds.js +7 -1
  34. package/dist/boot/memory-consolidation.d.ts +3 -2
  35. package/dist/boot/memory-consolidation.js +6 -6
  36. package/dist/boot/reapers.d.ts +5 -0
  37. package/dist/boot/reapers.js +12 -1
  38. package/dist/boot/resolve-spec.d.ts +3 -3
  39. package/dist/boot/resolve-spec.js +31 -22
  40. package/dist/boot/runner-deps.d.ts +9 -2
  41. package/dist/boot/runner-deps.js +3 -3
  42. package/dist/boot/session-age-out.d.ts +36 -0
  43. package/dist/boot/session-age-out.js +101 -0
  44. package/dist/boot/session-faces.d.ts +5 -14
  45. package/dist/boot/session-faces.js +9 -5
  46. package/dist/boot/stage-01-config.js +2 -0
  47. package/dist/boot/stage-05-execution-env.d.ts +5 -3
  48. package/dist/boot/stage-05-execution-env.js +2 -2
  49. package/dist/boot/stage-06-runners.d.ts +7 -4
  50. package/dist/boot/stage-06-runners.js +15 -6
  51. package/dist/boot/stage-07-capability-layer.d.ts +7 -4
  52. package/dist/boot/stage-07-capability-layer.js +2 -1
  53. package/dist/boot/stage-08-reapers.d.ts +7 -4
  54. package/dist/boot/stage-08-reapers.js +4 -2
  55. package/dist/boot/stage-09-leader.d.ts +11 -5
  56. package/dist/boot/stage-09-leader.js +12 -3
  57. package/dist/boot/stage-10-http-server.d.ts +11 -5
  58. package/dist/boot/stage-10-http-server.js +3 -6
  59. package/dist/boot/web-admin.js +3 -1
  60. package/dist/boot/workflow-orchestration.d.ts +7 -2
  61. package/dist/boot/workflow-orchestration.js +24 -7
  62. package/dist/bounded-rotation.d.ts +29 -0
  63. package/dist/bounded-rotation.js +24 -0
  64. package/dist/capability-facts.d.ts +22 -13
  65. package/dist/capability-facts.js +28 -18
  66. package/dist/center-credential.d.ts +25 -6
  67. package/dist/center-credential.js +25 -5
  68. package/dist/config-catalog.d.ts +26 -7
  69. package/dist/config-catalog.js +14 -11
  70. package/dist/config-invariants.d.ts +2 -1
  71. package/dist/config-invariants.js +4 -4
  72. package/dist/config-types.d.ts +10 -4
  73. package/dist/config.d.ts +51 -2
  74. package/dist/config.js +35 -24
  75. package/dist/deployment-shape.d.ts +9 -1
  76. package/dist/deployment-shape.js +2 -1
  77. package/dist/device-protocol.d.ts +5 -4
  78. package/dist/device-protocol.js +1 -1
  79. package/dist/device-ws-hub.js +3 -2
  80. package/dist/device-ws-protocol.d.ts +63 -10
  81. package/dist/device-ws-protocol.js +56 -25
  82. package/dist/engine-identity.d.ts +19 -7
  83. package/dist/engine-identity.js +10 -2
  84. package/dist/entry-mode-clamp-notice.d.ts +2 -1
  85. package/dist/execution-env-refusal.d.ts +23 -0
  86. package/dist/execution-env-refusal.js +5 -0
  87. package/dist/execution-lane-caps.d.ts +3 -1
  88. package/dist/field-conflict.d.ts +1 -1
  89. package/dist/file-history-capture.d.ts +11 -4
  90. package/dist/file-history-capture.js +9 -6
  91. package/dist/file-history-disclosure.d.ts +7 -5
  92. package/dist/file-history-disclosure.js +7 -5
  93. package/dist/fleet/drain-entry.d.ts +4 -0
  94. package/dist/hooks/hook-runner.js +2 -2
  95. package/dist/host-lsp-manager.d.ts +2 -2
  96. package/dist/http/admission.js +17 -2
  97. package/dist/http/approval-sweeps.js +5 -5
  98. package/dist/http/checkpoint-ctx.d.ts +2 -0
  99. package/dist/http/checkpoint-ctx.js +1 -0
  100. package/dist/http/dispatch.d.ts +2 -1
  101. package/dist/http/dispatch.js +34 -27
  102. package/dist/http/durable-run-leg.js +16 -16
  103. package/dist/http/health-self-report.d.ts +9 -1
  104. package/dist/http/health-self-report.js +2 -0
  105. package/dist/http/owner-access.d.ts +31 -11
  106. package/dist/http/owner-access.js +37 -6
  107. package/dist/http/resume-ctx-read.js +25 -3
  108. package/dist/http/resume-legs.d.ts +2 -1
  109. package/dist/http/resume-legs.js +259 -79
  110. package/dist/http/route-ctx.d.ts +18 -8
  111. package/dist/http/route-table.d.ts +1 -1
  112. package/dist/http/routes/admin-memory-optout.d.ts +1 -1
  113. package/dist/http/routes/agents-roster.js +2 -3
  114. package/dist/http/routes/approvals-assistant.js +4 -3
  115. package/dist/http/routes/background.d.ts +3 -3
  116. package/dist/http/routes/capabilities.js +8 -5
  117. package/dist/http/routes/fleet.js +10 -8
  118. package/dist/http/routes/projects.d.ts +3 -2
  119. package/dist/http/routes/projects.js +4 -5
  120. package/dist/http/routes/runs.js +102 -36
  121. package/dist/http/routes/session-sync.d.ts +4 -3
  122. package/dist/http/routes/session-sync.js +172 -77
  123. package/dist/http/routes/sessions-list.js +13 -7
  124. package/dist/http/routes/sessions.js +10 -6
  125. package/dist/http/routes/tasks.js +30 -16
  126. package/dist/http/routes/trace-usage.js +2 -2
  127. package/dist/http/server.d.ts +21 -27
  128. package/dist/http/server.js +2 -2
  129. package/dist/http/submit-ctx.js +5 -4
  130. package/dist/http/wire-types.d.ts +14 -4
  131. package/dist/identity-source.d.ts +20 -3
  132. package/dist/identity-source.js +14 -0
  133. package/dist/index.d.ts +4 -0
  134. package/dist/lane-home-probe.d.ts +3 -7
  135. package/dist/lane-home-probe.js +0 -1
  136. package/dist/leader/leader.d.ts +2 -1
  137. package/dist/leg-facts.d.ts +13 -5
  138. package/dist/leg-facts.js +2 -1
  139. package/dist/memory-scope.d.ts +5 -4
  140. package/dist/memory-scope.js +4 -4
  141. package/dist/memory-sync-client.d.ts +30 -2
  142. package/dist/memory-sync-client.js +16 -9
  143. package/dist/observability/err-text.d.ts +7 -0
  144. package/dist/observability/err-text.js +5 -0
  145. package/dist/observability/fail-open.d.ts +7 -3
  146. package/dist/observability/fail-open.js +7 -3
  147. package/dist/observability/metrics.js +1 -0
  148. package/dist/orchestration/workflow-notify-journal.d.ts +18 -1
  149. package/dist/orchestration/workflow-notify-journal.js +12 -1
  150. package/dist/orchestration/workflow-park-decision.d.ts +70 -18
  151. package/dist/orchestration/workflow-park-decision.js +49 -10
  152. package/dist/orchestration/workflow-park-holder.d.ts +65 -0
  153. package/dist/orchestration/workflow-park-holder.js +98 -0
  154. package/dist/orchestration/workflow-record-fence.d.ts +36 -0
  155. package/dist/orchestration/workflow-record-fence.js +42 -0
  156. package/dist/owner-faces.d.ts +1 -1
  157. package/dist/parked-decide.d.ts +104 -53
  158. package/dist/parked-decide.js +153 -117
  159. package/dist/peer-directory.d.ts +2 -2
  160. package/dist/peer-inbound-face.d.ts +2 -6
  161. package/dist/peer-inbound-face.js +0 -3
  162. package/dist/permission-mode-admission.d.ts +41 -5
  163. package/dist/permission-mode-admission.js +29 -3
  164. package/dist/plugins/adoption-log-sql.d.ts +3 -1
  165. package/dist/plugins/adoption-log-sql.js +7 -1
  166. package/dist/plugins/approval-ask-store-file.d.ts +10 -2
  167. package/dist/plugins/approval-ask-store-file.js +8 -0
  168. package/dist/plugins/approval-ask-store-memory.d.ts +6 -1
  169. package/dist/plugins/approval-ask-store-memory.js +28 -9
  170. package/dist/plugins/approval-ask-store-sql.d.ts +43 -2
  171. package/dist/plugins/approval-ask-store-sql.js +34 -5
  172. package/dist/plugins/approval-exemption-store.js +3 -0
  173. package/dist/plugins/approval-nonce-store.js +2 -0
  174. package/dist/plugins/breaker-state-sql.js +2 -0
  175. package/dist/plugins/caching-session-store.d.ts +9 -15
  176. package/dist/plugins/caching-session-store.js +6 -0
  177. package/dist/plugins/device-store-sql.js +6 -0
  178. package/dist/plugins/error-origin.d.ts +18 -0
  179. package/dist/plugins/error-origin.js +10 -0
  180. package/dist/plugins/execution-placement-sql.js +6 -6
  181. package/dist/plugins/image-bake-store-sql.js +6 -0
  182. package/dist/plugins/image-index-sql.js +4 -0
  183. package/dist/plugins/landed-attendants.d.ts +212 -0
  184. package/dist/plugins/landed-attendants.js +161 -0
  185. package/dist/plugins/leader-run-store-sql.js +4 -0
  186. package/dist/plugins/local-session-live-reference.d.ts +40 -0
  187. package/dist/plugins/local-session-live-reference.js +39 -0
  188. package/dist/plugins/local-session-store.d.ts +71 -33
  189. package/dist/plugins/local-session-store.js +129 -27
  190. package/dist/plugins/memory-engine-pg.js +4 -0
  191. package/dist/plugins/memory-engine-sql-apply.js +5 -2
  192. package/dist/plugins/memory-engine-tidb.js +4 -0
  193. package/dist/plugins/memory-optout-grant-store-sql.js +4 -0
  194. package/dist/plugins/memory-sync-store-pg.js +5 -0
  195. package/dist/plugins/memory-sync-store-tidb.js +5 -0
  196. package/dist/plugins/one-time-migrations.d.ts +57 -63
  197. package/dist/plugins/one-time-migrations.js +162 -90
  198. package/dist/plugins/org-delivery-quota-store.js +4 -1
  199. package/dist/plugins/outcome-ledger-sql.js +2 -0
  200. package/dist/plugins/permission-rule-store-sql.js +11 -4
  201. package/dist/plugins/pg-cost-quota.js +4 -0
  202. package/dist/plugins/pg-pool.js +24 -1
  203. package/dist/plugins/pg-rate-limiter.js +2 -0
  204. package/dist/plugins/posix-shell-fs.d.ts +6 -1
  205. package/dist/plugins/posix-shell-fs.js +4 -1
  206. package/dist/plugins/remote-env-adb.d.ts +19 -15
  207. package/dist/plugins/remote-env-adb.js +41 -15
  208. package/dist/plugins/remote-env-connect-seat.d.ts +105 -0
  209. package/dist/plugins/remote-env-connect-seat.js +72 -0
  210. package/dist/plugins/remote-env-device.d.ts +22 -5
  211. package/dist/plugins/remote-env-device.js +106 -8
  212. package/dist/plugins/remote-env-e2b.d.ts +15 -6
  213. package/dist/plugins/remote-env-e2b.js +42 -32
  214. package/dist/plugins/remote-env-file-error.js +6 -2
  215. package/dist/plugins/remote-env-host.d.ts +17 -0
  216. package/dist/plugins/remote-env-host.js +30 -38
  217. package/dist/plugins/remote-env-k8s.d.ts +41 -39
  218. package/dist/plugins/remote-env-k8s.js +53 -30
  219. package/dist/plugins/remote-env-local-docker.d.ts +13 -8
  220. package/dist/plugins/remote-env-local-docker.js +34 -41
  221. package/dist/plugins/remote-env-ssh.d.ts +18 -12
  222. package/dist/plugins/remote-env-ssh.js +60 -59
  223. package/dist/plugins/remote-shell.d.ts +98 -1
  224. package/dist/plugins/remote-shell.js +218 -0
  225. package/dist/plugins/resume-anchor-store-sql.d.ts +11 -2
  226. package/dist/plugins/resume-anchor-store-sql.js +12 -5
  227. package/dist/plugins/retention-lane-store-sql.js +4 -0
  228. package/dist/plugins/retention-sql.d.ts +20 -2
  229. package/dist/plugins/retention-sql.js +11 -0
  230. package/dist/plugins/run-store-sql.d.ts +21 -2
  231. package/dist/plugins/run-store-sql.js +31 -7
  232. package/dist/plugins/scenario-prefix-switch-m42.d.ts +1 -1
  233. package/dist/plugins/scenario-prefix-switch-m42.js +2 -2
  234. package/dist/plugins/schema-consistency.d.ts +4 -2
  235. package/dist/plugins/schema-consistency.js +19 -2
  236. package/dist/plugins/send-file-ledger.js +3 -0
  237. package/dist/plugins/serving-requirement.d.ts +26 -7
  238. package/dist/plugins/serving-requirement.js +11 -4
  239. package/dist/plugins/session-birth.d.ts +6 -2
  240. package/dist/plugins/session-capture-record-store-sql.js +2 -0
  241. package/dist/plugins/session-ext-table.d.ts +14 -1
  242. package/dist/plugins/session-ext-table.js +5 -1
  243. package/dist/plugins/session-row-sql.d.ts +49 -2
  244. package/dist/plugins/session-row-sql.js +56 -13
  245. package/dist/plugins/session-store-sql.d.ts +34 -18
  246. package/dist/plugins/session-store-sql.js +98 -17
  247. package/dist/plugins/shared-memory-store-sql.d.ts +1 -0
  248. package/dist/plugins/shared-memory-store-sql.js +6 -2
  249. package/dist/plugins/sql-driver.d.ts +2 -1
  250. package/dist/plugins/sql-driver.js +18 -3
  251. package/dist/plugins/sql-errors.d.ts +11 -6
  252. package/dist/plugins/sql-errors.js +5 -6
  253. package/dist/plugins/stop-then-start-sentence.d.ts +10 -4
  254. package/dist/plugins/stop-then-start-sentence.js +14 -10
  255. package/dist/plugins/stop-then-start.d.ts +109 -0
  256. package/dist/plugins/stop-then-start.js +104 -0
  257. package/dist/plugins/store-backend.d.ts +40 -13
  258. package/dist/plugins/store-backend.js +169 -27
  259. package/dist/plugins/store-boundary.d.ts +57 -0
  260. package/dist/plugins/store-boundary.js +139 -0
  261. package/dist/plugins/store-contracts.d.ts +17 -0
  262. package/dist/plugins/store-fault-sentence-m53.d.ts +7 -0
  263. package/dist/plugins/store-fault-sentence-m53.js +25 -0
  264. package/dist/plugins/store-fault.d.ts +26 -7
  265. package/dist/plugins/store-fault.js +18 -2
  266. package/dist/plugins/task-attachment-store.js +9 -0
  267. package/dist/plugins/task-list-store-sql.d.ts +2 -2
  268. package/dist/plugins/task-list-store-sql.js +10 -8
  269. package/dist/plugins/tidb-cost-quota.js +4 -0
  270. package/dist/plugins/tidb-pool.js +2 -1
  271. package/dist/plugins/tidb-rate-limiter.js +4 -0
  272. package/dist/plugins/user-input-ledger-sql.js +4 -0
  273. package/dist/plugins/workflow-run-store-sql.d.ts +28 -10
  274. package/dist/plugins/workflow-run-store-sql.js +64 -4
  275. package/dist/plugins/workspace-fill.d.ts +4 -7
  276. package/dist/plugins/workspace-fill.js +2 -1
  277. package/dist/plugins/write-behind-counter.js +5 -0
  278. package/dist/project-context.d.ts +0 -2
  279. package/dist/project-context.js +4 -8
  280. package/dist/project-registry.d.ts +46 -0
  281. package/dist/project-registry.js +44 -0
  282. package/dist/request-key-closure.js +1 -1
  283. package/dist/request-value-closure.d.ts +4 -0
  284. package/dist/request-value-closure.js +10 -0
  285. package/dist/run-acceptance.d.ts +3 -2
  286. package/dist/run-acceptance.js +4 -6
  287. package/dist/run-local.js +1 -0
  288. package/dist/runs.d.ts +37 -8
  289. package/dist/runs.js +53 -12
  290. package/dist/runtime-governance.d.ts +5 -4
  291. package/dist/security.d.ts +30 -32
  292. package/dist/security.js +41 -7
  293. package/dist/server-secret-env.d.ts +12 -10
  294. package/dist/server-secret-env.js +24 -15
  295. package/dist/session-bindings.d.ts +82 -0
  296. package/dist/session-bindings.js +18 -0
  297. package/dist/session-children-retire.d.ts +2 -2
  298. package/dist/session-children-retire.js +2 -6
  299. package/dist/session-deletion.d.ts +16 -1
  300. package/dist/session-error-wire.d.ts +3 -3
  301. package/dist/session-error-wire.js +3 -3
  302. package/dist/session-incarnation.d.ts +10 -0
  303. package/dist/session-incarnation.js +10 -1
  304. package/dist/session-kind.d.ts +57 -0
  305. package/dist/session-kind.js +22 -0
  306. package/dist/session-row.d.ts +21 -1
  307. package/dist/session-row.js +7 -1
  308. package/dist/session-sync-kernel.d.ts +24 -14
  309. package/dist/session-sync-kernel.js +3 -6
  310. package/dist/session-sync.d.ts +4 -98
  311. package/dist/session-sync.js +1 -71
  312. package/dist/session-titler.d.ts +10 -3
  313. package/dist/session-titler.js +19 -6
  314. package/dist/ssh-host-key.d.ts +5 -0
  315. package/dist/ssh-host-key.js +3 -0
  316. package/dist/stores-sql/file-history-store-sql.d.ts +52 -2
  317. package/dist/stores-sql/file-history-store-sql.js +108 -70
  318. package/dist/stores-sql/pg-session-storage.d.ts +34 -7
  319. package/dist/stores-sql/pg-session-storage.js +37 -13
  320. package/dist/stores-sql/retention-store-sql.d.ts +1 -9
  321. package/dist/stores-sql/retention-store-sql.js +2 -10
  322. package/dist/stores-sql/session-policy-store-sql.d.ts +30 -7
  323. package/dist/stores-sql/session-policy-store-sql.js +61 -44
  324. package/dist/stores-sql/session-write-hooks.d.ts +11 -0
  325. package/dist/stores-sql/tidb-session-store.d.ts +58 -7
  326. package/dist/stores-sql/tidb-session-store.js +37 -13
  327. package/dist/submission-exit.d.ts +3 -2
  328. package/dist/submission-exit.js +9 -1
  329. package/dist/task-cwd.d.ts +2 -2
  330. package/dist/task-settings.d.ts +6 -5
  331. package/dist/terminal.d.ts +33 -2
  332. package/dist/terminal.js +139 -9
  333. package/dist/tool-approval.d.ts +140 -6
  334. package/dist/tool-approval.js +165 -72
  335. package/dist/trace/self-minted-wire.d.ts +290 -27
  336. package/dist/trace/self-minted-wire.js +101 -13
  337. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +78 -27
  338. package/package.json +2 -2
  339. package/wire-changes/server@7.151.0.json +762 -0
  340. package/dist/http/session-inherit-env.d.ts +0 -36
  341. package/dist/http/session-inherit-env.js +0 -6
@@ -254,6 +254,22 @@ export const SELF_MINTED_WIRE = {
254
254
  absent: { attr: "-", since: "7.121.0" },
255
255
  },
256
256
  },
257
+ healthCenterKey: {
258
+ at: "GET /health center",
259
+ members: {
260
+ issuer: { attr: "present-iff auth bridge configured", since: "7.121.0" },
261
+ webBaseUrl: { attr: "present-iff the center web console base is configured", since: "7.121.0" },
262
+ sessionsVisible: { attr: "always", since: "7.121.0" },
263
+ assertionToken: { attr: "present-iff center configured", since: "7.151.0" },
264
+ },
265
+ },
266
+ healthAssertionToken: {
267
+ at: "GET /health center.assertionToken",
268
+ members: {
269
+ declared: { attr: "-", since: "7.151.0" },
270
+ absent: { attr: "-", since: "7.151.0" },
271
+ },
272
+ },
257
273
  healthSessionsVisible: {
258
274
  at: "GET /health center.sessionsVisible",
259
275
  members: {
@@ -341,6 +357,7 @@ export const SELF_MINTED_WIRE = {
341
357
  tickMs: { attr: "present-iff engine lease leg armed and observing", since: "7.141.0" },
342
358
  firstAttach: { attr: "present-iff engineLease present and the owned window is finite", since: "7.146.0" },
343
359
  lane: { attr: "always within engineLease", since: "7.146.0" },
360
+ attached: { attr: "always within engineLease (open SSE attach stream count on this replica; 0 is legal for a polling-only shell)", since: "7.151.0" },
344
361
  handover: { attr: "present-iff lane is handover", since: "7.146.0" },
345
362
  },
346
363
  },
@@ -429,6 +446,13 @@ export const SELF_MINTED_WIRE = {
429
446
  members: {
430
447
  rowTag: { attr: "present-iff the row can be written conditionally (the store has the row write primitive and the row carries an incarnation)", since: "7.139.0" },
431
448
  unreadable: { attr: "present-iff the session head's leaf cannot be read (the file backend: the archive header is corrupt / truncated, or the archive cannot be read); the SQL backends never carry it; PATCH answers 500 for such a session before writing, so its 200 / 409 rows never carry it", since: "7.142.0" },
449
+ sessionKind: { attr: "present-iff the session was created by a submission that declared sessionKind (the default view lists only sessions without one)", since: "7.151.0" },
450
+ },
451
+ },
452
+ sessionKind: {
453
+ at: "POST /v1/tasks · /v1/tasks/stream · /v1/runs 体 sessionKind = GET /v1/sessions?sessionKind= = sessions[].sessionKind = GET /v1/sessions/:id sessionKind = GET /v1/capabilities sessionKinds[](<词> → -)",
454
+ members: {
455
+ sidechain: { attr: "-", since: "7.151.0" },
432
456
  },
433
457
  },
434
458
  projectRowKey: {
@@ -459,6 +483,7 @@ export const SELF_MINTED_WIRE = {
459
483
  at: "GET /v1/sessions/:id 体顶层键(本版新出现;<键> → 在场律)",
460
484
  members: {
461
485
  projectId: { attr: "present-iff the session row's last own workspace_changed frame carried a project", since: "7.147.0" },
486
+ sessionKind: { attr: "present-iff the session was created by a submission that declared sessionKind", since: "7.151.0" },
462
487
  },
463
488
  },
464
489
  sessionsListRowUnreadableKey: {
@@ -516,11 +541,6 @@ export const SELF_MINTED_WIRE = {
516
541
  "SSE tool_end#structured.authorization": { attr: "present-iff structured.code unauthorized and reason in the closed set; members = reason", since: "7.138.0" },
517
542
  "GET /v1/runs/:id/events#tool_end.structured.authorization": { attr: "present-iff structured.code unauthorized and reason in the closed set; members = reason", since: "7.138.0" },
518
543
  },
519
- retired: {
520
- "GET /v1/sessions/:id#messages[].details.authorization.resourceMetadataUrl": { attr: "remote-claimed URL from the endpoint's challenge (deep-scrubbed text)", since: "7.138.0", until: "7.150.0" },
521
- "SSE tool_end#structured.authorization(reason 以外的成员)": { attr: "card members passed through the text redactor (resourceMetadataUrl, a custom card's own members)", since: "7.138.0", until: "7.150.0" },
522
- "GET /v1/runs/:id/events#tool_end.structured.authorization(reason 以外的成员)": { attr: "card members passed through the text redactor (resourceMetadataUrl, a custom card's own members)", since: "7.138.0", until: "7.150.0" },
523
- },
524
544
  },
525
545
  wiringModProvenance: {
526
546
  at: "wiring_manifest mods[].provenance",
@@ -608,14 +628,23 @@ export const SELF_MINTED_WIRE = {
608
628
  },
609
629
  },
610
630
  workflowParkDeliveryResult: {
611
- at: "POST /v1/approvals/:id/decide · 应答口(workflow 子代停驻卡,持有它的 run 在本进程里跑):引擎答词 → 应答",
631
+ at: "POST /v1/approvals/:id/decide · 应答口(workflow 子代停驻卡,持有它的 run 读作 running、决定行已在记录栅栏里立住):引擎答词 → 应答",
612
632
  members: {
613
633
  driving: { attr: "200 {taskId: <workflow runId>, status: resuming, decision}(无结清证据)", since: "7.148.0" },
614
- already_taken: { attr: "同一决定 ⇒ 首张回执原样回放;另一个决定 ⇒ 409 decide.claim_lost", since: "7.148.0" },
634
+ already_taken: { attr: "200 同一张回执(单一仲裁之下 run 收下过的只可能是这同一个决定)", since: "7.151.0" },
615
635
  settled: { attr: "409 decide.gate_moved", since: "7.148.0" },
616
- not_parked_here: { attr: "409 decide.gate_moved", since: "7.148.0" },
617
- unreadable: { attr: "503 decide.store_unreachable", since: "7.148.0" },
618
- kept_parked: { attr: "400 decide.parked_restatement_unsupported(只在决断带续跑重述键时可达)", since: "7.148.0" },
636
+ not_parked_here: { attr: "200 同一张回执(决定已立住;run 收场后由收场送达交给宿主会话的下一跑)", since: "7.151.0" },
637
+ unreadable: { attr: "200 同一张回执(决定已立住;持有进程在下一个维护拍再交)", since: "7.151.0" },
638
+ kept_parked: { attr: "不可达(恒送决定;重述键在记录栅栏里判 ⇒ 400 decide.parked_restatement_unsupported)", since: "7.151.0" },
639
+ },
640
+ },
641
+ workflowParkDeliveryKind: {
642
+ at: "POST /v1/approvals/:id/decide · 应答口(workflow 子代停驻卡,持有它的 run 读作 running、决定行已在记录栅栏里立住):引擎答形 → 应答",
643
+ members: {
644
+ live: { attr: "按 results[0] 答(集 workflowParkDeliveryResult)", since: "7.148.0" },
645
+ suspending: { attr: "200 {taskId: <workflow runId>, status: resuming, decision}(决定已立住;run 收场后由收场送达交给宿主会话的下一跑)", since: "7.151.0" },
646
+ not_active: { attr: "200 {taskId: <workflow runId>, status: resuming, decision}(决定已立住;持有进程在下一个维护拍交,或 run 收场后由收场送达交)", since: "7.151.0" },
647
+ not_armed: { attr: "500(引擎不变量破:没有 checkpoint 座的 run 停驻不出这张卡)", since: "7.148.0" },
619
648
  },
620
649
  },
621
650
  settingsEnvCredentialMatch: {
@@ -922,6 +951,8 @@ export const SELF_MINTED_WIRE = {
922
951
  "POST /v1/tool-approvals/:id/respond#edited_rule_text_refused_after_adoption(匿名活卡收编给具名主体后新属主交坏规则文本;体 request.body_shape;契约成文的判据,今天经 /v1/adoption 到不了)": { attr: 400, since: "7.136.0" },
923
952
  "POST /v1/tasks|/v1/runs#command_line_slots_without_sealed_key_store(stdio MCP 的 command / args 与 command hook 的 command / args;体 conflict.checkpoint_ctx_unsealable + field + reason no_key_store;POST /v1/tasks/stream 在终局帧上带本码;本服务自己的装配下不可达(装配期已对「店在而封签器缺席」拒启,见 submit-ctx.ts 自述))": { attr: 409, since: "7.136.0" },
924
953
  "ALL authenticated routes#bearer_token_without_scope_claim(鉴权桥验证腿;配了 service 凭据或多租 REQUIRE_PRINCIPAL 的部署;体通用 auth.unauthorized)": { attr: 401, since: "7.136.0" },
954
+ "ALL routes after the auth-bridge pre-authentication (not GET /health)#sso_token_foreign_scope(fleet 成员 FLEET_GENERATION 在场;验过签的登记中心登录令牌 scope ≠ FLEET_SCOPE〔缺席 = 缺省 scope〕;同一枚 Bearer 是本部署 service 凭据的不在此列;体 auth.scope_mismatch)": { attr: 403, since: "7.151.0" },
955
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs|其余 fail-closed 写口(计费提交 · bake · 改写门 · 破坏性会话写)与 POST /v1/tool-approvals/:id/respond 的停驻赎回臂#verified_sign_in_token_without_service_credential(部署只接了鉴权桥 —— AUTH_BRIDGE_ISSUER 或接了中心的回退 issuer —— 没配 SERVICE_AUTH_TOKEN(S)、没开 ALLOW_UNAUTHED_WRITES;请求出示鉴权桥验过的登记中心登录令牌;没带过门凭据的请求仍 503)": { attr: "该口自己的受理(POST /v1/runs 202 · POST /v1/tasks 同步 200 …)", revises: ["errorCode:auth.service_token_required"], since: "7.151.0" },
925
956
  "ALL principal-reading routes#principal_not_a_name(主体头 / SSO 令牌的 sub / 直连门 JWT 的 sub 不是一位主体的名字:空 / 空白 / 带控制、行段分隔或不可见格式字符;体 principal_not_a_name)": { attr: 400, since: "7.137.0" },
926
957
  "POST /v1/tasks|/v1/tasks/stream|/v1/runs#promptProfile(新提交;体 request.body_shape + unknownKeys [promptProfile])": { attr: 400, since: "7.137.0" },
927
958
  "POST /v1/tasks|/v1/tasks/stream|/v1/runs#skills[i].mods|agents[i].skills[j].mods(新提交;体 request.field_invalid)": { attr: 400, since: "7.137.0" },
@@ -1001,6 +1032,22 @@ export const SELF_MINTED_WIRE = {
1001
1032
  "POST /v1/sessions/:id/sync/plan|POST /v1/sessions/:id/sync/import|PUT /v1/sessions/:id/sync/blobs/:hash#foreign_session_deleting(推送三口的门:id 上是别的主体正在删除的会话 —— 删除围栏已立、尚未删净;「被占着」读活行 ∪ 在删行,与对别人的活行同答;本人 / fleet 对自己在删的会话不变,拉取口仍只认活行;体 not_found.session,与对不存在 id 的拉取答复逐字节同)": { attr: 404, since: "7.149.0" },
1002
1033
  "POST /v1/sessions/:id/sync/import#idle_id_other_principal_in_flight(第一阶段:id 上还没有会话行,而另一个主体在这只 id 上的第一阶段正在飞;导入租约键 = 落点属主格 + 会话 id,空闲 id 上各占各的;体 = 第一阶段的暂存回执 stagingId;先提交者得,输的那一份在提交前复判答 404 not_found.session,与赢家的提交撞在同一刻时由店的属主 CAS 拒 409 conflict)": { attr: 200, since: "7.149.0" },
1003
1034
  "POST /v1/tasks|/v1/tasks/stream|/v1/runs#a2aPeers_headers_reserved_member(新提交;a2aPeers[i].headers 的成员名是 constructor / prototype —— 与 mcpServers[i].transport.headers / .env 同一张保留成员名表、同一只读法,大小写敏感;体 request.field_invalid + field 成员级路径 a2aPeers[i].headers.<名>;存盘续跑体里同形 ⇒ 续跑家族既有一面 #stored_unread_members 409)": { attr: 400, since: "7.149.0" },
1035
+ "POST /v1/tasks|/v1/runs#rewindFilesTo_with_cascade(新提交;提交体同带非空串 `rewindFilesTo` 与 `cascade: true` —— 梯级每一级在引擎现铸的会话里跑、不取根,文件回退无处落地;拒在任何副作用之前、梯子一级都不起;体 request.field_conflict + reason cascade_verify + fields [rewindFilesTo, cascade];`/v1/tasks/stream` 上带 `cascade` 的提交本来就 400(同码),不入此面)": { attr: 400, since: "7.151.0" },
1036
+ "POST /v1/tasks/:taskId/asks/:askId/decision#parked_redeemed(问已转停驻、门仍开着,部署接了停驻赎回 —— 非直连门;交与 live 应答口停驻臂同一只赎回;体 = 本口基本键 + accepted parked_redeemed + 赎回受理体;受理之后决定记在问行上)": { attr: 200, revises: ["errorCode:gone.ask_parked"], since: "7.151.0" },
1037
+ "POST /v1/tasks/:taskId/asks/:askId/decision#parked_standing_same_key(问已转停驻、门上已站着一次决定,本次请求的 idempotencyKey 就是问行上记录的那一把;体 = 首决回放,与 DECIDED 行的回放同一只渲染)": { attr: 200, revises: ["errorCode:gone.ask_parked"], since: "7.151.0" },
1038
+ "POST /v1/tasks/:taskId/asks/:askId/decision#parked_standing_conflict(问已转停驻、门上已站着一次决定,本次请求不是记录上那一把键 / 没带键;体 conflict.ask_decided 回显首决;首决取问行上答的就是门上这一次的那份记录,否则取停驻门)": { attr: 409, revises: ["errorCode:gone.ask_parked"], since: "7.151.0" },
1039
+ "POST /v1/tasks/:taskId/asks/:askId/decision#parked_redemption_refused(问已转停驻、门仍开着,停驻赎回没生效且门此刻仍没决;体 = 赎回的拒原样:429 成本配额 + Retry-After / 503 服务凭据或就绪 / 409 approval_stale 或 conflict.not_resumable / 400 decide_requires_binding / 500;赎回的 404 改答本口的 not_found.ask)": { attr: "as the shared parked redemption answers (429 / 503 / 409 / 400 / 500; its 404 ⇒ 404 not_found.ask)", revises: ["errorCode:gone.ask_parked"], since: "7.151.0" },
1040
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#userAttachments 的 path 条目在 e2b / k8s / local-docker / adb 车道上(目标给得出那一次观测:Linux、挂着 /proc、有 timeout / readlink / stat / head / base64)与 device 车道上(执行器声明修订号 ≥ 6 且在 hello.supports 声明了 openBound)—— human_input.attachments[].outcome": { attr: "attached", since: "7.151.0" },
1041
+ "GET /v1/device/ws#instruction kind openBound(server → executor;协议修订号 6 的 kind,只派发给声明修订号 ≥ 6 且 hello.supports 声明了它的执行器;args { path, op: open|size|readBytes|list, identity?, kind?, max? })": { attr: "dispatched-iff-declared", since: "7.151.0" },
1042
+ "GET /v1/device/ws#result outcome stat.identity(openBound 开答的 <device>:<inode>;可选串,不是串 ⇒ bad_shape)": { attr: "accepted", since: "7.151.0" },
1043
+ "POST /v1/sessions/:id/sync/import/:stagingId/entries|POST /v1/sessions/:id/sync/import#landed_occupant_gone(条目已提交 / identical 短路之后,写文件历史 · 会话规则 · 回退锚 · 行两位的落定段段首锁会话根行,读出落定的那一位住客已不在:会话被删、或同 id 被重建 —— 含同一属主;段体零字节写;体 conflict + sync conflict,不带 relation;运维 warn session_sync_landed_occupant_gone)": { attr: 409, since: "7.151.0" },
1044
+ "POST /v1/sessions/:id/sync/import/:stagingId/entries#staged_commit_occupant_changed(暂存提交时这只 id 上的会话已不是第一阶段门判过的那一位住客:属主或化身不同 —— 含同一属主删建;提交事务回滚;体 conflict + 暂存导入住客已变的固定句)": { attr: 409, since: "7.151.0" },
1045
+ "GET /v1/sessions/:id/sync/manifest|/v1/sessions/:id/sync/entries|/v1/sessions/:id/sync/history/blobs/:hash#occupant_changed_after_gate(门读到住客之后、答复发出之前复判:这只 id 上已不是门承认的那一位 —— 删了 / 同 id 重建;含否定答复 404 not_found.blob;entries 在应答头发出之前;体 not_found.session,与门后被删同体)": { attr: 404, since: "7.151.0" },
1046
+ "GET /v1/sessions/:id/sync/entries#occupant_changed_mid_stream(应答头已发;每页交出之前复判不中 ⇒ 流结束、不写尾行 = 截断;运维 info session_sync_pull_occupant_changed)": { attr: 200, since: "7.151.0" },
1047
+ "POST /v1/sessions/:id/sync/plan|POST /v1/sessions/:id/sync/import#occupant_changed_after_gate(门读到住客之后、非故障出口发出之前复判占位头:已不是那一位;含关系体、422 缺块、409 写者 / 活跃拒;体 conflict + sync conflict,不带 relation)": { attr: 409, since: "7.151.0" },
1048
+ "POST /v1/sessions/:id/sync/import/:stagingId/entries#pre_commit_activity_occupant_changed(提交前的活性复查:门读到住客、读到一份活 run / 活子代之后,复判这只 id 上已不是那一位 —— 那份活性是别一代的;暂存放掉;体 conflict + sync conflict,不带 activeTaskId / children)": { attr: 409, since: "7.151.0" },
1049
+ "PATCH /v1/sessions/:id#session_deleting(门那一读之后会话进了在删:删除围栏已立、尚未删净;行格判官把在删读作行不在;零写;体 not_found.session)": { attr: 404, since: "7.151.0" },
1050
+ "PUT /v1/sessions/:id/policy#occupant_changed_after_gate(门读到的那一位住客在写规则的落定段段首已不在:删了 / 同 id 重建;零写;体 not_found.session,与门同体)": { attr: 404, since: "7.151.0" },
1004
1051
  },
1005
1052
  retired: {},
1006
1053
  },
@@ -1032,11 +1079,44 @@ export const SELF_MINTED_WIRE = {
1032
1079
  sessionMemoryStatusKey: {
1033
1080
  at: "GET /v1/sessions/:id/memory-status 200 体顶层键(<键> → 在场律)",
1034
1081
  members: {
1035
- memorySync: { attr: "present-iff this deployment runs a memory sync leg;{parked:[{scope,wayOut}]} in sync order;parked:[] ⇔ no layer parked;deployment fact (same for every session, ?scope= not applied)", since: "7.141.0" },
1082
+ memorySync: { attr: "present-iff this deployment runs a memory sync leg;{parked:[entry]} in sync order (entry keys: memorySyncParkedKey);parked:[] ⇔ no layer parked;deployment fact (same for every session, ?scope= not applied)", since: "7.151.0" },
1036
1083
  writeHome: { attr: "present-iff the engine answered it ∧ the single-user host lane (the capability bit projectContext's range predicate: hosted / sandbox / device / no-hands lanes ⇒ absent);the engine's absolute directory, byte for byte;with ?scope= that store's engine answer;without ?scope= the session-level home the engine chose across the stores (the newest store's own home;absent while any store's reading is unreadable, on a same-instant tie, or when no store names one)", since: "7.146.0" },
1037
1084
  planes: { attr: "present-iff no ?scope= ∧ the single-user host lane (same predicate as writeHome);[{plane:\"project\"|\"personal\", writeHome?}] one row per store in the engine's store order, each row the engine's own answer for that store (writeHome verbatim, absent when that store names none);the rows' other keys are not on the wire", since: "7.146.0" },
1038
1085
  },
1039
1086
  },
1087
+ memorySyncParkedKey: {
1088
+ at: "GET /v1/sessions/:id/memory-status memorySync.parked[] 条目键(<键> → 在场律)",
1089
+ members: {
1090
+ scope: { attr: "always;the layer's key (the sync layer first, then the owner's project layers by key)", since: "7.141.0" },
1091
+ wayOut: { attr: "always;closed set memorySyncWayOut", since: "7.141.0" },
1092
+ cause: { attr: "always;closed set memorySyncParkCause;why the layer is parked (not the trigger of the round that hit it)", since: "7.151.0" },
1093
+ axis: { attr: "present-iff cause is cursor_refused ∧ the engine's reading is inside both closed sets (axis in memorySyncCursorAxis ∧ found in memorySyncCursorFound;an unknown word in either ⇒ both keys absent);the axis the engine refused the cursor on", since: "7.151.0" },
1094
+ found: { attr: "present-iff axis is present (the two keys come as a pair);closed set memorySyncCursorFound;whether the cursor has no binding on that axis (absent) or is bound to another value (other)", since: "7.151.0" },
1095
+ },
1096
+ },
1097
+ memorySyncParkCause: {
1098
+ at: "GET /v1/sessions/:id/memory-status memorySync.parked[].cause",
1099
+ members: {
1100
+ cursor_refused: { attr: "-", since: "7.151.0" },
1101
+ cursor_unusable: { attr: "-", since: "7.151.0" },
1102
+ },
1103
+ },
1104
+ memorySyncCursorAxis: {
1105
+ at: "GET /v1/sessions/:id/memory-status memorySync.parked[].axis",
1106
+ members: {
1107
+ scope: { attr: "-", since: "7.151.0" },
1108
+ peer: { attr: "-", since: "7.151.0" },
1109
+ store: { attr: "-", since: "7.151.0" },
1110
+ incarnation: { attr: "-", since: "7.151.0" },
1111
+ },
1112
+ },
1113
+ memorySyncCursorFound: {
1114
+ at: "GET /v1/sessions/:id/memory-status memorySync.parked[].found",
1115
+ members: {
1116
+ absent: { attr: "-", since: "7.151.0" },
1117
+ other: { attr: "-", since: "7.151.0" },
1118
+ },
1119
+ },
1040
1120
  memorySyncWayOut: {
1041
1121
  at: "GET /v1/sessions/:id/memory-status memorySync.parked[].wayOut",
1042
1122
  members: {
@@ -1169,6 +1249,7 @@ export const SELF_MINTED_WIRE = {
1169
1249
  refusalSentenceForm: {
1170
1250
  at: "拒体 message 的句型(<码>#<座> → 句型骨架;码 / 状态 / 机读位不变)",
1171
1251
  members: {
1252
+ "409 conflict#staged_import_commit(会话同步推送第二阶段的提交:暂存提交的住客 CAS 没过)": { attr: "session changed hands while the import streamed (deleted, re-created or re-owned); nothing was imported — start the sync again", since: "7.151.0" },
1172
1253
  "401 auth.unauthorized#operator(/metrics* · GET /v1/tasks/source-summary)": { attr: "… send the deployment's service token … without a principal header where this deployment lets its service token act for the deployment itself (GET /health reports it as auth.serviceTokenActsForDeployment; …), or a read-only token this endpoint accepts (…)", since: "7.146.0" },
1173
1254
  "422 invalid_entries#row_contract(会话同步推送第二阶段;收编批量导入同句进逐元素 detail)": { attr: "malformed entry (id and parentId must be strings of 1-64 characters, type a string of 1-32 characters)", since: "7.146.0" },
1174
1255
  "404 not_found.run#a*/wa* id(compact · detach · 子代动词口;各 run 口的非属主臂)": { attr: "run not found — \"<id>\" looks like an agent handle (a*/wa* domain) … (the handle hint, same sentence as the missing-row arm)", since: "7.148.0" },
@@ -1179,7 +1260,7 @@ export const SELF_MINTED_WIRE = {
1179
1260
  "400 request.field_invalid#title.no_visible_character(PATCH /v1/sessions/:id · 会话同步 2c 导入的 title)": { attr: "title must contain at least one visible character", since: "7.136.0" },
1180
1261
  "503 state.file_history_unreadable#store_connection_fault(会话同步三条拉取读腿)": { attr: "this session's stored state could not be read right now (the store connection failed), so nothing was exported — retry later", since: "7.136.0" },
1181
1262
  "503 state.file_history_unreadable#store_deployment_fault(会话同步三条拉取口)": { attr: "this session's stored state cannot be read: the store does not match what this deployment requires (a table is missing or the database account lacks a privilege), so nothing was exported — retrying will not help until an operator repairs the store", since: "7.137.0" },
1182
- "connect_failed(run 失败终局)#snapshot_bucket_missing(k8s 车道读 latest 得 404 NoSuchBucket;连沙箱失败,一只 pod 都不建)": { attr: "workspace space pointer read failed (snapshot_bucket_missing): the workspace snapshot bucket <name> (WORKSPACE_SNAPSHOT_BUCKET; default workspaces) does not exist in the object store — refusing to start this run … Ways out: create the bucket, or set WORKSPACE_SNAPSHOT_BUCKET to one that exists, or set WORKSPACE_PERSIST=off …", since: "7.136.0" },
1263
+ "env.snapshot_bucket_missing#snapshot_bucket_missing(k8s 车道读 latest / 取快照归档得 404 NoSuchBucket;建连的立定拒 —— 不留 pod〔读 latest 不建,取归档建的那只释放〕,执行环境记住它直到销毁)": { attr: "workspace space pointer read failed (snapshot_bucket_missing): the workspace snapshot bucket <name> (WORKSPACE_SNAPSHOT_BUCKET; default workspaces) does not exist in the object store — refusing to start this run … Ways out: create the bucket, or set WORKSPACE_SNAPSHOT_BUCKET to one that exists, or set WORKSPACE_PERSIST=off …", since: "7.151.0" },
1183
1264
  "400 request.field_invalid#images[i].url.credential": { attr: "<field> <规则句> — the URL is kept as written (a parked task's resume context, logs), while images[i] can carry the image bytes inline: send { data, mimeType } instead of a URL that holds the credential", since: "7.136.0" },
1184
1265
  "400 request.field_invalid#images.not_array": { attr: "head: images is <shape>, not an array of image entries", since: "7.148.0" },
1185
1266
  "400 request.field_invalid#images[i].not_object": { attr: "head: images[i] is <shape>, not an image entry (an object)", since: "7.148.0" },
@@ -1215,6 +1296,11 @@ export const SELF_MINTED_WIRE = {
1215
1296
  "409 conflict.session_memory_unobserved#no_leaf": { attr: "this session has no transcript yet, so there is no revision to sync from — run a task in it (…), then sync", since: "7.143.0" },
1216
1297
  "400 request.field_invalid#unread_request_members(新提交:settings.env 有成员不是帽内的串;嵌入方直调装配时四座同句)": { attr: "this request carries a member|members this server version's readers cannot take as written, on a deployment that would apply it|them: <坐标,至多 8 处>[ (and <n> more)] — running it would silently leave that member|those members out (a hook that guards a tool, an MCP server's credentials); submit it again with this member|these members in the current form", since: "7.147.0" },
1217
1298
  "409 resume_blocked_by_policy#unread_members(续跑四门 · steer 铸唤醒卡之前)": { attr: "resume blocked by an admission policy change: <同上一句>", since: "7.147.0" },
1299
+ "503 auth.service_token_required#task_submissions(计费提交 · bake · 改写门;停驻赎回席同句)": { attr: "this worker requires a service auth token (set SERVICE_AUTH_TOKEN) or a verified registry sign-in token before accepting task submissions", since: "7.151.0" },
1300
+ "503 auth.service_token_required#destructive_session_writes": { attr: "this worker requires a service auth token (set SERVICE_AUTH_TOKEN) or a verified registry sign-in token before accepting destructive session writes (policy / sync-import / fork / delete)", since: "7.151.0" },
1301
+ "413 request.payload_too_large#store_row_too_large(POST /v1/tasks|/v1/tasks/stream|/v1/runs;续跑输入一行装不下,row / statement / value 三墙)": { attr: "the database refused to store this task: it is larger than the database keeps in one row|accepts in one statement|PostgreSQL holds in one value — nothing was run; <出路>", since: "7.151.0" },
1302
+ "adopt_failed|track_failed|snapshot_failed|restore_failed#store_fault(文件历史店的失败句:会话同步推送与 blob 交换的拒体 · rewind / restore 的逐文件失败句)": { attr: "<动作> failed: <类别句> [original code: <原码>]", since: "7.151.0" },
1303
+ "子代失败句#store_fault(tool_end 子代卡 structured.errorMessage · 后台子代通告的 summary · GET /v1/runs/:id/subagents/:handle/output 的 content / output · 父模型读到的子代报告行)": { attr: "<类别句> [original code: <原码>](与 run 终局 terminal.failed.message 同一句)", since: "7.151.0" },
1218
1304
  },
1219
1305
  },
1220
1306
  decisionBodyKey: {
@@ -1289,13 +1375,14 @@ export const SELF_MINTED_WIRE = {
1289
1375
  },
1290
1376
  },
1291
1377
  deviceProtocolRevision: {
1292
- at: "GET /v1/capabilities deviceExecutor.protocolVersion 与 device WS challenge 帧的修订号(<修订号> → 它加进结局码闭集的词;零加词的语义修订 → 变更名)",
1378
+ at: "GET /v1/capabilities deviceExecutor.protocolVersion 与 device WS challenge 帧的修订号(<修订号> → 它加的词:结局码 `+词`、下发指令 kind `+kind:词`;两张表都零加词的语义修订 → 变更名)",
1293
1379
  members: {
1294
1380
  1: { attr: "base", since: "7.51.0" },
1295
1381
  2: { attr: "+liveness_no_output", since: "7.133.0" },
1296
1382
  3: { attr: "+name_too_long", since: "7.137.0" },
1297
1383
  4: { attr: "+symlink_loop", since: "7.143.0" },
1298
1384
  5: { attr: "paths-unfolded", since: "7.150.0" },
1385
+ 6: { attr: "+kind:openBound", since: "7.151.0" },
1299
1386
  },
1300
1387
  },
1301
1388
  hookNonBlockingFailureReason: {
@@ -1363,6 +1450,7 @@ export const SELF_MINTED_WIRE = {
1363
1450
  "GET /v1/config/catalog#rows[MODEL_ROUTER_ID].derivedDefaultNote": { attr: "absent=>classifier-role-in-served-table", since: "7.143.0" },
1364
1451
  "GET /v1/config/catalog#rows[MINIO_BUCKET].semantics": { attr: "leader-diff-out-bucket;independent-of-WORKSPACE_SNAPSHOT_BUCKET", since: "7.148.0" },
1365
1452
  "GET /v1/config/catalog#rows[MINIO_BUCKET].derivedDefaultNote": { attr: "absent=>WORKSPACE_SNAPSHOT_BUCKET_DEFAULT(not-the-explicit-value)", since: "7.148.0" },
1453
+ "GET /v1/config/catalog#rows[ALLOW_UNAUTHED_WRITES].semantics": { attr: "write-gate-admits-requests-without-a-gate-credential(service-token|verified-sign-in-token);submissions+rewrites+destructive-session-writes", since: "7.151.0" },
1366
1454
  "GET /v1/sessions/:id/mcp#servers[].error": { attr: "exit-seat:mcp-remote-text(engine-mark=masked-value)+truncate:200", since: "7.138.0" },
1367
1455
  "POST /v1/sessions/:id/mcp/reconnect#reason|status.error|listingIncomplete.error": { attr: "exit-seat:mcp-remote-text(engine-mark=masked-value)+truncate:200", since: "7.138.0" },
1368
1456
  "GET /v1/config/catalog#rows[MODEL_VISION].semantics": { attr: "names-engine-notice:model.capability_downgraded", since: "7.137.0" },
@@ -152,8 +152,9 @@ pre-auth frame closes the connection outright.
152
152
 
153
153
  **Which revision to declare.** `challenge.protocolVersion` is the highest protocol revision this server speaks
154
154
  (`DEVICE_MIN_PROTOCOL_VERSION` is the lowest it accepts, §2.1). Put the highest revision *you* implement that is
155
- not above `challenge.protocolVersion` into `hello.protocolVersion` — the same integer you sign (§1.3) — and emit
156
- only the `errorCode` words of that revision (the revision table in §2.1). Nothing is renegotiated after `hello`:
155
+ not above `challenge.protocolVersion` into `hello.protocolVersion` — the same integer you sign (§1.3) — declare in
156
+ `supports` only the instruction kinds of that revision, and emit only the `errorCode` words of that revision (the revision
157
+ table in §2.1). Nothing is renegotiated after `hello`:
157
158
  the revision you declared is the contract for the whole connection. If the highest revision you implement is below
158
159
  `DEVICE_MIN_PROTOCOL_VERSION`, the server answers `helloReject: protocol_version_unsupported` (§1.4).
159
160
  Revisions are cumulative on the executor's side: an executor that implements revision *N* implements every revision
@@ -345,7 +346,7 @@ base64 inside JSON fields.
345
346
  | Constant | Value | Meaning |
346
347
  |---|---|---|
347
348
  | `DEVICE_WS_PATH` | `/v1/device/ws` | the upgrade path (prefer the `wsPath` from `/v1/capabilities`) |
348
- | `DEVICE_PROTOCOL_VERSION` | `5` | the protocol revision this server speaks (the highest it accepts) |
349
+ | `DEVICE_PROTOCOL_VERSION` | `6` | the protocol revision this server speaks (the highest it accepts) |
349
350
  | `DEVICE_MIN_PROTOCOL_VERSION` | `5` | the lowest revision it accepts (the revision table says why); below it (or above the highest), a loud `helloReject` — never a silent downgrade |
350
351
  | `DEVICE_HELLO_DOMAIN_TAG` | `sema.device.hello.v1` | the handshake signature domain tag (§1.3) |
351
352
 
@@ -366,36 +367,43 @@ cap. An instruction whose frame would be over it is refused before dispatch (you
366
367
  chunks are sliced so that a chunk frame, base64 and envelope included, fits. You can therefore cap the frames you
367
368
  accept at `maxFrameBytes`.
368
369
 
369
- #### Protocol revisions and the `errorCode` set
370
+ #### Protocol revisions: the `errorCode` set and the instruction kinds
370
371
 
371
372
  The protocol revision is the only thing an executor can read *before* it sends `hello` (the `challenge` frame
372
373
  carries it), so everything you must know to be correct on this server is a function of the revision, not a
373
- separate list: the set of `errorCode` words the server accepts from you, and what the frames it sends you mean.
374
- The table gives, per revision, the words **added** at that revision and any other change made at it; the word set
375
- at revision *N* is the union of the rows up to *N*, and the full set at the current revision is the §3.3 table.
374
+ separate list: the set of `errorCode` words the server accepts from you, the set of instruction kinds it may send you,
375
+ and what the frames it sends you mean. The table gives, per revision, the words **added** to each set at that revision
376
+ and any other change made at it; a set at revision *N* is the union of its column's rows up to *N*, and the full sets at
377
+ the current revision are the §3.3 table (`errorCode`) and the §3.1 table (instruction kinds, in this order).
376
378
 
377
379
  <!-- closed-set: DEVICE_OUTCOME_ERROR_CODES_BY_REVISION -->
378
380
 
379
- | Revision | `errorCode` words added at this revision | Other change at this revision |
380
- |---|---|---|
381
- | `1` | `aborted`, `already_exists`, `auth_failed`, `callback_error`, `invalid`, `is_directory`, `not_directory`, `not_found`, `not_supported`, `outcome_unknown`, `permission_denied`, `precondition_failed`, `shell_unavailable`, `spawn_error`, `suspended`, `target_unavailable`, `timeout`, `transport_lost`, `unknown` | — |
382
- | `2` | `liveness_no_output` | — |
383
- | `3` | `name_too_long` | — |
384
- | `4` | `symlink_loop` | — |
385
- | `5` | — | every path an instruction carries (`args.path`, `args.paths`, `cwd`) arrives **unfolded** (since server 7.150.0): absolute as written, or anchored at the session's working directory, with `.` / `..` / empty segments kept — the server anchors and never folds. Resolve it as your filesystem does and judge containment on where it resolves (§3.1, §6 item 6). An executor written for revision 4 or below expects folded paths, so this is also the lowest revision the server accepts |
381
+ | Revision | `errorCode` words added at this revision | Instruction kinds added at this revision | Other change at this revision |
382
+ |---|---|---|---|
383
+ | `1` | `aborted`, `already_exists`, `auth_failed`, `callback_error`, `invalid`, `is_directory`, `not_directory`, `not_found`, `not_supported`, `outcome_unknown`, `permission_denied`, `precondition_failed`, `shell_unavailable`, `spawn_error`, `suspended`, `target_unavailable`, `timeout`, `transport_lost`, `unknown` | `exec`, `execStream`, `readTextFile`, `readTextLines`, `readBinaryFile`, `writeFile`, `writeFileExclusive`, `writeFileGuarded`, `appendFile`, `fileInfo`, `listDir`, `canonicalPath`, `exists`, `readLink`, `createDir`, `remove`, `createTempDir`, `createTempFile`, `statBatch` | — |
384
+ | `2` | `liveness_no_output` | — | — |
385
+ | `3` | `name_too_long` | — | — |
386
+ | `4` | `symlink_loop` | — | — |
387
+ | `5` | — | — | every path an instruction carries (`args.path`, `args.paths`, `cwd`) arrives **unfolded** (since server 7.150.0): absolute as written, or anchored at the session's working directory, with `.` / `..` / empty segments kept — the server anchors and never folds. Resolve it as your filesystem does and judge containment on where it resolves (§3.1, §6 item 6). An executor written for revision 4 or below expects folded paths, so this is also the lowest revision the server accepts |
388
+ | `6` | — | `openBound` | — |
386
389
 
387
390
  Rules: adding a frame or a field is additive and does not raise the revision. Every other change
388
- raises `DEVICE_PROTOCOL_VERSION` and adds a row here — a word added to a closed set the server *accepts from you*
389
- (today: the `errorCode` set; second column), or a **semantic change**, a change in what a frame the server sends you
390
- means (third column): a semantic change raises the revision. A released row never changes. When an executor written for
391
+ raises `DEVICE_PROTOCOL_VERSION` and adds a row here — a word added to either closed set of the instruction exchange:
392
+ an `errorCode` word the server *accepts from you* (second column) or an instruction kind the server *sends you*
393
+ (third column) — or a **semantic change**, a change in what a frame the server sends you means (fourth column):
394
+ a semantic change raises the revision. A released row never changes. The server sends a kind only on a connection
395
+ whose declared revision is at or above the row that added it, and only if that connection's `supports` declares it
396
+ (§3.2): a kind above your revision is never sent to you, so an executor written for the older revision still honors
397
+ the newer one and the lowest accepted revision stays where it was (revision 6 added `openBound`; a revision-5 executor
398
+ never receives it). When an executor written for
391
399
  an older revision cannot honor the change, the same release raises `DEVICE_MIN_PROTOCOL_VERSION` to the new
392
400
  revision, so such an executor is refused once at `hello` (§1.4) instead of failing call by call.
393
- Declare a revision as §1.2 says and send only the words of that revision: an executor
401
+ Declare a revision as §1.2 says and use only the words of that revision: an executor
394
402
  that declared revision 1 never sends `liveness_no_output` (the server does not police this per connection — it
395
403
  decodes every connection against the current revision's full set — but a word above your declared revision is outside
396
- your contract). The same sets are importable:
397
- `DEVICE_OUTCOME_ERROR_CODES_BY_REVISION` and `deviceOutcomeErrorCodesAt(revision)` from
398
- `@sema-agent/server/device-protocol`.
404
+ your contract), and a kind above your declared revision in `supports` is ignored like a word the server does not know.
405
+ The same sets are importable: `DEVICE_OUTCOME_ERROR_CODES_BY_REVISION` / `deviceOutcomeErrorCodesAt(revision)` and
406
+ `DEVICE_INSTRUCTION_KINDS_BY_REVISION` / `deviceInstructionKindsAt(revision)` from `@sema-agent/server/device-protocol`.
399
407
 
400
408
  ### 2.2 Device → server frames
401
409
 
@@ -532,6 +540,7 @@ entry can be asked again as written.
532
540
  | `createTempDir` | `{ prefix? }` | `{ok:true, kind:"write", canonicalPath}` | the created directory's path **is** the receipt |
533
541
  | `createTempFile` | `{ prefix?, suffix? }` | `{ok:true, kind:"write", canonicalPath}` | same |
534
542
  | `statBatch` | `{ paths: string[] }` | `{ok:true, kind:"stat", …}` | declared but **not dispatched today** (see §8) |
543
+ | `openBound` | `{ path, op, identity?, kind?, max? }` | per `op`: `open` / `size` / `list` ⇒ `{ok:true, kind:"stat", …}`, `readBytes` ⇒ `{ok:true, kind:"read"}` | **optional face**, revision 6 — a bound read: the object judged is the object read (§3.7) |
535
544
 
536
545
  The server checks the outcome *kind* against the instruction kind. Answering an `execStream` with
537
546
  `{ok:true, kind:"void"}` — a perfectly well-formed frame — is refused as a protocol violation and the
@@ -540,22 +549,26 @@ outcome are always accepted.
540
549
 
541
550
  ### 3.2 Declaring what you implement: `hello.supports`
542
551
 
543
- `supports` is a plain `string[]` of instruction kinds. The server intersects it with its own closed set;
544
- **a kind you do not declare is never dispatched to you**, and a call that needs it fails loudly with
545
- `not_supported` instead of silently doing something else. A kind the server does not recognize is simply
546
- ignored (that is how a newer executor talks to an older server without breaking it).
552
+ `supports` is a plain `string[]` of instruction kinds. The server intersects it with the kinds of the revision you declared
553
+ (§2.1); **a kind you do not declare is never dispatched to you**, and a call that needs it fails loudly with
554
+ `not_supported` instead of silently doing something else. A kind the server does not recognize — or one above the
555
+ revision you declared — is simply ignored (that is how a newer executor talks to an older server without breaking it).
547
556
 
548
- Three faces are **presence-typed**, which is a stronger statement than "optional":
557
+ Four faces are **presence-typed**, which is a stronger statement than "optional":
549
558
 
550
559
  - `writeFileExclusive` — atomic create-if-absent
551
560
  - `writeFileGuarded` — verify-and-write in one atomic step
552
561
  - `readLink` — read a symlink target
562
+ - `openBound` — a bound read (§3.7): every answer is about the object that was opened and checked
553
563
 
554
564
  The engine decides *at environment-construction time* whether these exist, and when they do not it
555
565
  degrades honestly (an advisory check instead of an atomic one). **Therefore: absence is absence. Never
556
566
  emulate a guarded or exclusive write with a two-step "check then write".** A two-step emulation reopens
557
567
  exactly the race the atomic primitive exists to close, while wearing the face of an atomic operation —
558
- which is worse than not having it, because nothing downstream can tell.
568
+ which is worse than not having it, because nothing downstream can tell. The same holds for `openBound`:
569
+ **never emulate it with `fileInfo` + `readBinaryFile`** (two path reads cannot tell that the bytes came from the
570
+ object that was judged); without it, the engine simply does not bind a read on this device (a path attachment is
571
+ accepted and reported `not_attached`).
559
572
 
560
573
  Two more consequences you must design for:
561
574
 
@@ -712,8 +725,45 @@ side**. Verifying with `stat` and then writing is exactly the emulation that is
712
725
  - `readLink` — optional but strongly recommended: it is the fourth governance read, and its absence makes
713
726
  symlink adjudication coarser.
714
727
  - `writeFileExclusive`, `writeFileGuarded` — optional; implement them only if you can do them atomically.
728
+ - `openBound` — optional (revision 6); without it a path attachment on this device is accepted but not attached (§3.7).
715
729
  - `statBatch` — safe to omit today.
716
730
 
731
+
732
+ ### 3.7 `openBound` and its four answers
733
+
734
+ `openBound` is a revision-6 kind: the server sends it only on a connection whose `hello.protocolVersion` is 6 or above
735
+ **and** whose `supports` declares it. On a revision-5 connection the face is absent, exactly as if you had not declared
736
+ it (the engine does not bind a read; a path attachment is reported `not_attached`).
737
+
738
+ The protocol has no handle that lives across instructions, so the engine's bound-read object is answered one
739
+ instruction per answer. Every `openBound` instruction is a **complete rebinding**: open `path` locally (do not
740
+ follow a final symbolic link), ask the kernel **once, through that open**, which path the opened object now has and
741
+ what it is, answer **through that same open**, then close it. Never read the path a second time to answer.
742
+
743
+ <!-- closed-set: DEVICE_BOUND_READ_OPS -->
744
+
745
+ | `op` | Carries | Answer with | Refuse with |
746
+ |---|---|---|---|
747
+ | `open` | `path` | `{ok:true, kind:"stat", identity, info}` — `identity` = the opened object's `<device>:<inode>`; `info.kind` is `file` or `dir` | `precondition_failed` (the final component is a link, or the opened object is not at `path`); `invalid` (neither a regular file nor a directory) |
748
+ | `size` | `path`, `identity`, `kind` | `{ok:true, kind:"stat", info}` — `info.size` = the current size | `precondition_failed` when the object opened now is not `identity` / `kind` or not at `path` |
749
+ | `readBytes` | `path`, `identity`, `kind`, `max` | `{ok:true, kind:"read"}`, the bytes as `data` chunks | as `size`, plus `invalid` when the file is over `max` bytes when the read starts (read nothing) |
750
+ | `list` | `path`, `identity`, `kind` | `{ok:true, kind:"stat", entries}` — the opened directory's direct children, links not followed; the server reads only each entry's leaf name | as `size` |
751
+
752
+ Rules:
753
+
754
+ - **One observation per answer.** The check that the opened object is at `path` must be a single observation of
755
+ that open (Linux: `readlink("/proc/self/fd/<fd>")`; macOS: an open with `O_NOFOLLOW_ANY` refuses a link on any
756
+ component, so the open itself is the observation). Separate `fstat` / `lstat` / `realpath` calls are three
757
+ observations that a directory swapped in and out between them gets through. If your platform cannot give one
758
+ observation, answer `not_supported` — the engine reads that as "this face is absent here".
759
+ - **Identity and kind both.** For `size` / `readBytes` / `list`, the object you opened must equal both `identity`
760
+ and `kind` from the `open` answer, else `precondition_failed`. Two opens whose identities are equal do not prove
761
+ they opened one object after an inode number was reused; that residue is accepted by the engine's contract.
762
+ - **Bounded.** An open can block (a FIFO swapped in under the path); the whole answer must finish within the
763
+ instruction's `timeoutMs` and your executor must not leave the blocked open behind.
764
+ - **No privilege above the session's own commands.** Open as the same user that runs the session's `exec`.
765
+ - Error codes are the words of your declared revision (§2.1); nothing new is needed.
766
+
717
767
  ---
718
768
 
719
769
  ## 4. Streaming execution
@@ -1055,6 +1105,7 @@ These two are a real distinction to the caller: `not_started` is safely retryabl
1055
1105
 
1056
1106
  - [ ] `readLink` (recommended soon after — it is the fourth governance read)
1057
1107
  - [ ] `writeFileExclusive`, `writeFileGuarded` — declare only when atomic (§3.2)
1108
+ - [ ] `openBound` — declare only with one observation per answer, and only when you declare revision 6 or above (§3.7)
1058
1109
  - [ ] `statBatch` — not dispatched today
1059
1110
 
1060
1111
  **Process shape (recommended)**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sema-agent/server",
3
- "version": "7.150.0",
3
+ "version": "7.151.0",
4
4
  "description": "Sema Server — the server/API implementation layer for Sema, wiring core, registry, model providers, and cloud agent execution. Built on @sema-agent/core.",
5
5
  "type": "module",
6
6
  "license": "BUSL-1.1",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "dependencies": {
85
85
  "@modelcontextprotocol/server": "2.4.0",
86
- "@sema-agent/core": "7.66.0",
86
+ "@sema-agent/core": "7.66.1",
87
87
  "@sema-agent/settings-schema": "25.1.0",
88
88
  "e2b": "2.36.0",
89
89
  "libsodium-wrappers": "0.8.4",