@sema-agent/server 7.145.0 → 7.146.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 (275) hide show
  1. package/MIGRATION.md +492 -0
  2. package/USAGE.md +218 -47
  3. package/deploy/facts/CHANGES.json +25 -0
  4. package/deploy/facts/README.md +57 -0
  5. package/deploy/facts/lanes.json +54 -0
  6. package/deploy/facts/lanes.schema.json +57 -0
  7. package/deploy/facts/sandbox-rbac.json +113 -0
  8. package/deploy/facts/sandbox-rbac.schema.json +74 -0
  9. package/deploy/facts/sealed-key.json +9 -0
  10. package/deploy/facts/sealed-key.schema.json +52 -0
  11. package/deploy/sema-up/chart/templates/_helpers.tpl +19 -0
  12. package/deploy/sema-up/chart/templates/sandbox-rbac.yaml +47 -7
  13. package/deploy/sema-up/chart/templates/server-v4pro.yaml +4 -0
  14. package/deploy/sema-up/chart/templates/server.yaml +4 -0
  15. package/deploy/sema-up/chart/values.yaml +7 -0
  16. package/deploy/sema-up/stack/sema-stack-cluster.yaml +30 -14
  17. package/dist/adoption/import-limits.d.ts +6 -0
  18. package/dist/adoption/import-limits.js +7 -0
  19. package/dist/adoption/import.d.ts +62 -0
  20. package/dist/adoption/import.js +107 -0
  21. package/dist/adoption/wire.d.ts +52 -0
  22. package/dist/adoption/wire.js +9 -0
  23. package/dist/approval-ask-machine.d.ts +2 -2
  24. package/dist/approval-card.d.ts +3 -12
  25. package/dist/approval-card.js +0 -4
  26. package/dist/approval-gate-currency.d.ts +1 -1
  27. package/dist/approval-gate-currency.js +1 -1
  28. package/dist/approval-reconciler.d.ts +1 -1
  29. package/dist/boot/deployment-mods.d.ts +11 -1
  30. package/dist/boot/deployment-mods.js +15 -2
  31. package/dist/boot/device-lane.js +2 -0
  32. package/dist/boot/engine-lease.d.ts +193 -21
  33. package/dist/boot/engine-lease.js +146 -20
  34. package/dist/boot/execution-env.d.ts +4 -0
  35. package/dist/boot/execution-env.js +12 -0
  36. package/dist/boot/exit-boundary.d.ts +50 -0
  37. package/dist/boot/exit-boundary.js +32 -0
  38. package/dist/boot/exit-last.d.ts +20 -4
  39. package/dist/boot/exit-last.js +21 -4
  40. package/dist/boot/governance-seams.js +1 -0
  41. package/dist/boot/memory-consolidation.d.ts +29 -17
  42. package/dist/boot/memory-consolidation.js +26 -15
  43. package/dist/boot/reapers.d.ts +12 -4
  44. package/dist/boot/reapers.js +39 -15
  45. package/dist/boot/resolve-spec.d.ts +2 -0
  46. package/dist/boot/resolve-spec.js +38 -15
  47. package/dist/boot/runner-deps.js +1 -1
  48. package/dist/boot/session-faces.js +3 -1
  49. package/dist/boot/shutdown.js +27 -9
  50. package/dist/boot/stage-01-config.js +1 -1
  51. package/dist/boot/stage-03-store-backend.d.ts +1 -0
  52. package/dist/boot/stage-03-store-backend.js +2 -2
  53. package/dist/boot/stage-04-stores.d.ts +1 -0
  54. package/dist/boot/stage-05-execution-env.d.ts +3 -0
  55. package/dist/boot/stage-05-execution-env.js +3 -3
  56. package/dist/boot/stage-06-runners.d.ts +3 -0
  57. package/dist/boot/stage-06-runners.js +11 -10
  58. package/dist/boot/stage-07-capability-layer.d.ts +3 -0
  59. package/dist/boot/stage-07-capability-layer.js +7 -2
  60. package/dist/boot/stage-08-reapers.d.ts +3 -0
  61. package/dist/boot/stage-08-reapers.js +3 -3
  62. package/dist/boot/stage-09-leader.d.ts +3 -0
  63. package/dist/boot/stage-10-http-server.d.ts +3 -0
  64. package/dist/boot/stage-10-http-server.js +3 -2
  65. package/dist/boot/stores.d.ts +1 -0
  66. package/dist/boot/stores.js +35 -19
  67. package/dist/boot/workflow-orchestration.d.ts +1 -1
  68. package/dist/boot/workflow-orchestration.js +2 -1
  69. package/dist/capabilities/composite-members.d.ts +3 -1
  70. package/dist/capabilities/composite-members.js +3 -1
  71. package/dist/capabilities/scenarios.d.ts +2 -2
  72. package/dist/capability-facts.d.ts +18 -1
  73. package/dist/capability-facts.js +25 -7
  74. package/dist/checkpoint-ctx-seal-m28.d.ts +1 -1
  75. package/dist/config-catalog.js +13 -4
  76. package/dist/config-provider.d.ts +2 -2
  77. package/dist/config-types.d.ts +43 -4
  78. package/dist/config.d.ts +6 -1
  79. package/dist/config.js +67 -11
  80. package/dist/deleted-session-ids.d.ts +19 -0
  81. package/dist/deleted-session-ids.js +26 -0
  82. package/dist/deploy-facts.d.ts +155 -0
  83. package/dist/deploy-facts.js +94 -0
  84. package/dist/device-ws-hub.d.ts +48 -3
  85. package/dist/device-ws-hub.js +48 -2
  86. package/dist/error-code-family.d.ts +35 -0
  87. package/dist/error-code-family.js +26 -0
  88. package/dist/fleet/drain-entry.d.ts +39 -3
  89. package/dist/fleet/drain-entry.js +6 -0
  90. package/dist/fleet/fleet-bus.d.ts +2 -1
  91. package/dist/hooks/branch-transcript.d.ts +1 -1
  92. package/dist/hooks/branch-transcript.js +1 -0
  93. package/dist/hooks/classic-stations.d.ts +25 -8
  94. package/dist/hooks/classic-stations.js +29 -3
  95. package/dist/hooks/hook-runner.d.ts +33 -16
  96. package/dist/hooks/hook-runner.js +166 -73
  97. package/dist/hooks/hook-source.d.ts +14 -2
  98. package/dist/hooks/hook-source.js +8 -0
  99. package/dist/http/active-run-conflict.d.ts +1 -1
  100. package/dist/http/active-run-conflict.js +1 -1
  101. package/dist/http/admission.js +11 -1
  102. package/dist/http/checkpoint-ctx.d.ts +59 -71
  103. package/dist/http/checkpoint-ctx.js +34 -40
  104. package/dist/http/dispatch.js +18 -2
  105. package/dist/http/durable-run-leg.d.ts +5 -0
  106. package/dist/http/durable-run-leg.js +1 -0
  107. package/dist/http/execution-context.d.ts +4 -0
  108. package/dist/http/execution-context.js +9 -0
  109. package/dist/http/health-self-report.d.ts +6 -2
  110. package/dist/http/health-self-report.js +3 -2
  111. package/dist/http/memory-compliance-failure-reply.d.ts +1 -1
  112. package/dist/http/memory-compliance-failure-reply.js +2 -15
  113. package/dist/http/memory-control-plane-corrupt-reply.d.ts +25 -0
  114. package/dist/http/memory-control-plane-corrupt-reply.js +19 -0
  115. package/dist/http/principal-gate.d.ts +35 -12
  116. package/dist/http/principal-gate.js +16 -12
  117. package/dist/http/request-guards.d.ts +1 -1
  118. package/dist/http/request-guards.js +5 -5
  119. package/dist/http/resume-legs.d.ts +22 -0
  120. package/dist/http/resume-legs.js +26 -17
  121. package/dist/http/route-ctx.d.ts +11 -10
  122. package/dist/http/route-table.js +2 -0
  123. package/dist/http/routes/adoption.d.ts +11 -0
  124. package/dist/http/routes/adoption.js +80 -6
  125. package/dist/http/routes/agents-roster.js +1 -0
  126. package/dist/http/routes/approvals-assistant.js +2 -1
  127. package/dist/http/routes/background.js +1 -0
  128. package/dist/http/routes/capabilities.js +4 -1
  129. package/dist/http/routes/diagnostics.d.ts +9 -14
  130. package/dist/http/routes/diagnostics.js +10 -20
  131. package/dist/http/routes/engine.d.ts +31 -0
  132. package/dist/http/routes/engine.js +81 -0
  133. package/dist/http/routes/memory-bundle.js +3 -0
  134. package/dist/http/routes/memory-consolidation.js +3 -5
  135. package/dist/http/routes/memory-origin.d.ts +1 -1
  136. package/dist/http/routes/memory-origin.js +2 -4
  137. package/dist/http/routes/memory-policy.js +5 -1
  138. package/dist/http/routes/observability.js +3 -6
  139. package/dist/http/routes/runs.js +7 -3
  140. package/dist/http/routes/session-sync.js +12 -25
  141. package/dist/http/routes/sessions-list.d.ts +1 -1
  142. package/dist/http/routes/sessions.js +4 -0
  143. package/dist/http/routes/tasks.js +23 -5
  144. package/dist/http/routes/trace-usage.js +1 -1
  145. package/dist/http/run-concurrency-cap.d.ts +86 -0
  146. package/dist/http/run-concurrency-cap.js +54 -0
  147. package/dist/http/server.d.ts +15 -12
  148. package/dist/http/server.js +18 -3
  149. package/dist/http/stored-body-replay.d.ts +9 -6
  150. package/dist/http/stored-body-replay.js +19 -5
  151. package/dist/http/wire-types.d.ts +8 -3
  152. package/dist/json-body-limit.d.ts +8 -0
  153. package/dist/json-body-limit.js +2 -0
  154. package/dist/leader/diffout.d.ts +1 -1
  155. package/dist/local-data-root.d.ts +2 -2
  156. package/dist/memory-operator-faces.d.ts +9 -4
  157. package/dist/memory-scope-stores.d.ts +9 -7
  158. package/dist/memory-scope-stores.js +3 -14
  159. package/dist/memory-scope.d.ts +36 -0
  160. package/dist/memory-scope.js +32 -1
  161. package/dist/net-address.d.ts +53 -0
  162. package/dist/net-address.js +111 -0
  163. package/dist/observability/fail-open.d.ts +14 -10
  164. package/dist/observability/fail-open.js +14 -10
  165. package/dist/orchestration/workflow-notify-journal.js +2 -3
  166. package/dist/org-delivery-gate.js +1 -1
  167. package/dist/peer-directory.d.ts +6 -12
  168. package/dist/peer-directory.js +5 -1
  169. package/dist/plugins/caching-session-store.d.ts +3 -1
  170. package/dist/plugins/caching-session-store.js +3 -0
  171. package/dist/plugins/checkpoint-store-face.d.ts +426 -0
  172. package/dist/plugins/checkpoint-store-face.js +152 -0
  173. package/dist/plugins/file-run-store.d.ts +0 -6
  174. package/dist/plugins/file-run-store.js +1 -12
  175. package/dist/plugins/fork-routing-session-store.d.ts +6 -2
  176. package/dist/plugins/fork-routing-session-store.js +2 -2
  177. package/dist/plugins/imported-layer-root-retirement.d.ts +10 -8
  178. package/dist/plugins/local-checkpoint-store.d.ts +2 -2
  179. package/dist/plugins/local-checkpoint-store.js +2 -1
  180. package/dist/plugins/local-session-store.d.ts +28 -5
  181. package/dist/plugins/local-session-store.js +32 -8
  182. package/dist/plugins/memory-engine-pg.d.ts +29 -6
  183. package/dist/plugins/memory-engine-pg.js +96 -214
  184. package/dist/plugins/memory-engine-sql-apply.d.ts +121 -0
  185. package/dist/plugins/memory-engine-sql-apply.js +358 -0
  186. package/dist/plugins/memory-engine-tidb.d.ts +35 -9
  187. package/dist/plugins/memory-engine-tidb.js +97 -227
  188. package/dist/plugins/memory-key-guards.d.ts +1 -1
  189. package/dist/plugins/memory-origin-law.d.ts +3 -3
  190. package/dist/plugins/one-time-migrations.d.ts +32 -56
  191. package/dist/plugins/one-time-migrations.js +25 -117
  192. package/dist/plugins/permission-rule-store-file.d.ts +17 -3
  193. package/dist/plugins/permission-rule-store-file.js +8 -1
  194. package/dist/plugins/pg-pool.js +1 -1
  195. package/dist/plugins/pg-session-storage.d.ts +17 -4
  196. package/dist/plugins/pg-session-storage.js +8 -4
  197. package/dist/plugins/run-store-sql.js +2 -2
  198. package/dist/plugins/schema-ensure-legs.js +2 -2
  199. package/dist/plugins/session-fork.d.ts +31 -9
  200. package/dist/plugins/session-fork.js +3 -2
  201. package/dist/plugins/session-placement.d.ts +4 -2
  202. package/dist/plugins/sql-json-column.d.ts +5 -1
  203. package/dist/plugins/store-backend.d.ts +11 -8
  204. package/dist/plugins/store-backend.js +8 -7
  205. package/dist/plugins/store-contracts.d.ts +1 -11
  206. package/dist/plugins/store-contracts.js +0 -9
  207. package/dist/plugins/store-sweep.d.ts +63 -0
  208. package/dist/plugins/store-sweep.js +48 -0
  209. package/dist/plugins/tidb-pool.js +1 -1
  210. package/dist/plugins/tidb-session-store.d.ts +16 -3
  211. package/dist/plugins/tidb-session-store.js +8 -4
  212. package/dist/prompt-screen.d.ts +6 -9
  213. package/dist/prompt-screen.js +2 -5
  214. package/dist/rules-consent.d.ts +20 -27
  215. package/dist/rules-consent.js +82 -6
  216. package/dist/run-cancel-context.d.ts +4 -1
  217. package/dist/run-cancel-context.js +2 -1
  218. package/dist/runs.js +1 -1
  219. package/dist/sandbox-egress-policy.js +6 -11
  220. package/dist/sandbox-rbac-rules.d.ts +88 -0
  221. package/dist/sandbox-rbac-rules.js +80 -0
  222. package/dist/sealed-key-layout.d.ts +17 -0
  223. package/dist/sealed-key-layout.js +4 -0
  224. package/dist/sealed-key.js +5 -5
  225. package/dist/security.d.ts +38 -6
  226. package/dist/security.js +9 -2
  227. package/dist/session-notify-door.d.ts +5 -3
  228. package/dist/session-resident-background.d.ts +57 -0
  229. package/dist/session-resident-background.js +20 -0
  230. package/dist/session-sync-kernel.d.ts +53 -14
  231. package/dist/session-sync-kernel.js +70 -1
  232. package/dist/session-sync.d.ts +5 -3
  233. package/dist/session-workspace.d.ts +1 -0
  234. package/dist/session-workspace.js +1 -0
  235. package/dist/sighup-idle.d.ts +9 -7
  236. package/dist/sighup-idle.js +4 -5
  237. package/dist/spec-fields.d.ts +16 -0
  238. package/dist/spec-fields.js +7 -0
  239. package/dist/stored-request-env-credentials-m38.d.ts +3 -0
  240. package/dist/stored-request-env-credentials-m38.js +8 -0
  241. package/dist/stored-request-prompt-profile-m30.d.ts +1 -1
  242. package/dist/{plugins → stores-sql}/checkpoint-store-sql.d.ts +13 -427
  243. package/dist/{plugins → stores-sql}/checkpoint-store-sql.js +33 -194
  244. package/dist/{plugins → stores-sql}/mailbox-store-sql.d.ts +2 -2
  245. package/dist/{plugins → stores-sql}/mailbox-store-sql.js +4 -4
  246. package/dist/{plugins → stores-sql}/roster-store-sql.d.ts +2 -2
  247. package/dist/{plugins → stores-sql}/roster-store-sql.js +1 -1
  248. package/dist/{plugins → stores-sql}/tool-result-store-sql.d.ts +2 -2
  249. package/dist/{plugins → stores-sql}/tool-result-store-sql.js +6 -6
  250. package/dist/{plugins → stores-sql}/workflow-journal-store-sql.d.ts +7 -12
  251. package/dist/{plugins → stores-sql}/workflow-journal-store-sql.js +3 -8
  252. package/dist/task-settings.d.ts +59 -4
  253. package/dist/task-settings.js +50 -4
  254. package/dist/tool-approval.d.ts +2 -2
  255. package/dist/trace/core-keyset-guard.d.ts +8 -7
  256. package/dist/trace/engine-notice-wire.d.ts +1 -1
  257. package/dist/trace/engine-notice-wire.js +2 -0
  258. package/dist/trace/exit-seat.d.ts +6 -0
  259. package/dist/trace/exit-seat.js +1 -0
  260. package/dist/trace/project.js +9 -0
  261. package/dist/trace/redact.d.ts +13 -2
  262. package/dist/trace/redact.js +305 -24
  263. package/dist/trace/self-minted-wire.d.ts +326 -8
  264. package/dist/trace/self-minted-wire.js +125 -7
  265. package/dist/trace/wire-projection-faces.d.ts +1 -1
  266. package/dist/trace/wire-projection-faces.js +1 -1
  267. package/dist/usage-analytics.d.ts +4 -0
  268. package/package.json +12 -4
  269. package/scripts/drain-check-local.mjs +8 -29
  270. package/scripts/drain-check.mysql.sql +3 -24
  271. package/scripts/drain-check.pg.sql +3 -24
  272. package/skills/update-config.md +1 -1
  273. package/wire-changes/server@7.146.0.json +3221 -0
  274. package/dist/approval-batch-census.d.ts +0 -27
  275. package/dist/approval-batch-census.js +0 -27
@@ -561,6 +561,31 @@ export declare const SELF_MINTED_WIRE: {
561
561
  };
562
562
  };
563
563
  };
564
+ /**
565
+ * `GET /health` 的 `auth` 段的键集(恒在场,`auth` 本身恒在)。7.121.0 的三键是补登记;`serviceTokenActsForDeployment` = 出示 service 凭据、不报主体的调用方
566
+ * 在这台部署上代不代部署本人(配了 service 凭据 ∧ 声明位 `SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT`;门 `actsForDeployment` 读同一格)。
567
+ */
568
+ readonly healthAuthKey: {
569
+ readonly at: "GET /health auth";
570
+ readonly members: {
571
+ required: {
572
+ attr: string;
573
+ since: string;
574
+ };
575
+ kinds: {
576
+ attr: string;
577
+ since: string;
578
+ };
579
+ identityAttach: {
580
+ attr: string;
581
+ since: string;
582
+ };
583
+ serviceTokenActsForDeployment: {
584
+ attr: string;
585
+ since: string;
586
+ };
587
+ };
588
+ };
564
589
  /** 7.121.0:`GET /health` 自报位 `auth.identityAttach`。 */
565
590
  readonly healthIdentityAttach: {
566
591
  readonly at: "GET /health auth.identityAttach";
@@ -653,6 +678,28 @@ export declare const SELF_MINTED_WIRE: {
653
678
  };
654
679
  };
655
680
  };
681
+ /**
682
+ * `GET /health` 的 `inflightBreakdown` 段(7.146.0):`inflight` 的分项 —— `http` = 本副本 HTTP 腿(在飞 run 集 + 没有登记身份的同步计费腿 + admission 期的非探针请求),`leader` = leader 口的后台 run,
683
+ * `sessionResident` = 会话驻留的后台 shell / monitor(活过起它的那一条腿;不含 retain 行)。`inflight`(总数)恒等于三项之和(同一次读、`inflightTotal` 一处求和);判停读的阻断集 = `http + leader`(不上 wire),驻留项只报不阻断。
684
+ * present-iff `inflight` 在场(`drainState` 装了的部署);键集属主 = `InflightBreakdown`(加一键而本表没跟 ⇒ tsc 红)。
685
+ */
686
+ readonly healthInflightBreakdownKey: {
687
+ readonly at: "GET /health inflightBreakdown";
688
+ readonly members: {
689
+ http: {
690
+ attr: string;
691
+ since: string;
692
+ };
693
+ leader: {
694
+ attr: string;
695
+ since: string;
696
+ };
697
+ sessionResident: {
698
+ attr: string;
699
+ since: string;
700
+ };
701
+ };
702
+ };
656
703
  /**
657
704
  * `GET /health` 的 `engineLease` 段(7.141.0):引擎附着租约窗 —— `lingerMs` = 自退腿会执行的**最短**静默窗(父活着的窗与孤儿窗取小),`tickMs` = 自退检查采样拍。
658
705
  * present-iff 本进程装了租约腿(`ENGINE_AUTO_EXIT` 开或 `SEMA_PARENT_PID` 在场)∧ 腿还在观察 ∧ 窗会到期;键集属主 = `EngineLeaseFacts`(加一键而本表没跟 ⇒ tsc 红)。
@@ -668,6 +715,129 @@ export declare const SELF_MINTED_WIRE: {
668
715
  attr: string;
669
716
  since: string;
670
717
  };
718
+ firstAttach: {
719
+ attr: string;
720
+ since: string;
721
+ };
722
+ lane: {
723
+ attr: string;
724
+ since: string;
725
+ };
726
+ handover: {
727
+ attr: string;
728
+ since: string;
729
+ };
730
+ };
731
+ };
732
+ /**
733
+ * `GET /health` 的 `engineLease.firstAttach` 格(7.146.0):首次附着前的宽限窗 —— `windowMs` = 生效的候首触窗 `max(owned 窗, ENGINE_FIRST_ATTACH_MS)`,
734
+ * `since` = 窗开始(装配那一拍,epoch ms),`attachedAt` = 首个非探针请求的时刻(epoch ms;`null` = 还没有过)。键集属主 = `EngineLeaseFirstAttachFacts`(加一键而本表没跟 ⇒ tsc 红)。
735
+ */
736
+ readonly healthEngineLeaseFirstAttachKey: {
737
+ readonly at: "GET /health engineLease.firstAttach";
738
+ readonly members: {
739
+ windowMs: {
740
+ attr: string;
741
+ since: string;
742
+ };
743
+ since: {
744
+ attr: string;
745
+ since: string;
746
+ };
747
+ attachedAt: {
748
+ attr: string;
749
+ since: string;
750
+ };
751
+ };
752
+ };
753
+ /** `GET /health` 的 `engineLease.handover` 格:交接车道的事实 —— 进入时刻(epoch ms)、缘由、交接窗、退出边界此刻会硬收的后台 shell 数。只在 handover 车道在场;键集属主 = `EngineHandoverFacts`。 */
754
+ readonly healthEngineLeaseHandoverKey: {
755
+ readonly at: "GET /health engineLease.handover";
756
+ readonly members: {
757
+ since: {
758
+ attr: string;
759
+ since: string;
760
+ };
761
+ reason: {
762
+ attr: string;
763
+ since: string;
764
+ };
765
+ lingerMs: {
766
+ attr: string;
767
+ since: string;
768
+ };
769
+ backgroundShells: {
770
+ attr: string;
771
+ since: string;
772
+ };
773
+ };
774
+ };
775
+ /** 附着租约的车道词(`/health.engineLease.lane`、`POST /v1/engine/handover` · `POST /v1/engine/attach` 200 体的 `lane`、`exit-last.json` 的 `lane`)。 */
776
+ readonly engineLane: {
777
+ readonly at: "engine lease lane(/health engineLease.lane · POST /v1/engine/handover|attach lane · exit-last.json lane)";
778
+ readonly members: {
779
+ handover: {
780
+ attr: string;
781
+ since: string;
782
+ };
783
+ orphan: {
784
+ attr: string;
785
+ since: string;
786
+ };
787
+ awaitingFirstAttach: {
788
+ attr: string;
789
+ since: string;
790
+ };
791
+ owned: {
792
+ attr: string;
793
+ since: string;
794
+ };
795
+ };
796
+ };
797
+ /** 交接缘由闭集(交接口体的 `reason`、`/health.engineLease.handover.reason`)。 */
798
+ readonly engineHandoverReason: {
799
+ readonly at: "POST /v1/engine/handover reason · /health engineLease.handover.reason";
800
+ readonly members: {
801
+ background_exit: {
802
+ attr: string;
803
+ since: string;
804
+ };
805
+ };
806
+ };
807
+ /** `POST /v1/engine/handover` 200 体的键集(唯一铸点 = 租约腿交接门的 `enter`)。 */
808
+ readonly engineHandoverReplyKey: {
809
+ readonly at: "POST /v1/engine/handover 200 体键(<键> → 在场律)";
810
+ readonly members: {
811
+ lane: {
812
+ attr: string;
813
+ since: string;
814
+ };
815
+ since: {
816
+ attr: string;
817
+ since: string;
818
+ };
819
+ lingerMs: {
820
+ attr: string;
821
+ since: string;
822
+ };
823
+ backgroundShells: {
824
+ attr: string;
825
+ since: string;
826
+ };
827
+ };
828
+ };
829
+ /** `POST /v1/engine/attach` 200 体的键集(唯一铸点 = 租约腿交接门的 `attach`)。 */
830
+ readonly engineAttachReplyKey: {
831
+ readonly at: "POST /v1/engine/attach 200 体键(<键> → 在场律)";
832
+ readonly members: {
833
+ lane: {
834
+ attr: string;
835
+ since: string;
836
+ };
837
+ handedOverForMs: {
838
+ attr: string;
839
+ since: string;
840
+ };
671
841
  };
672
842
  };
673
843
  /** `GET /v1/models` 的 `models[]` 行键(只登本版新出现的键;行的其余键不是本版新上 wire):`supportsThinkingOff` —— 「这只模型的推理能不能关」,恒在场的布尔,值 = 引擎唯一读法 `thinkingOffSpelled(条目)`。 */
@@ -939,6 +1109,39 @@ export declare const SELF_MINTED_WIRE: {
939
1109
  };
940
1110
  };
941
1111
  };
1112
+ /**
1113
+ * 429 `limit.rate_exceeded` 拒体的机读 `reason`(7.146.0 起;码是旧的、`reason` 键是新的 —— 其余 `limit.rate_exceeded` 的产地不带它)。词表属主 = `http/run-concurrency-cap.ts` 的
1114
+ * `RATE_EXCEEDED_REASONS`(唯一铸点 `runConcurrencyRefusalOf`);`satisfies Record<RateExceededReason, …>`。`run_concurrency_cap` = 本副本在飞 run 已到并发帽
1115
+ * (`RUN_MAX_CONCURRENT` / `RUN_MAX_CONCURRENT_PER_PRINCIPAL`;新提交的四个口,幂等重放之后),体另带 `retryAfterSec: 5`。
1116
+ */
1117
+ readonly rateExceededReason: {
1118
+ readonly at: "429 limit.rate_exceeded reason(在飞 run 并发帽;其余产地不带 reason)";
1119
+ readonly members: {
1120
+ run_concurrency_cap: {
1121
+ attr: string;
1122
+ since: string;
1123
+ };
1124
+ };
1125
+ };
1126
+ /**
1127
+ * 400 `request.env_credential_refused`(7.146.0 起;请求 `settings.env` 里有凭据)拒体 `entries[]` 每一条的 `match`:这一条为什么被判成凭据(体另带 `field: "settings.env"`、`entries[].key`;值从不进体)。
1128
+ * 词表属主 = `task-settings.ts` 的 `SETTINGS_ENV_CREDENTIAL_MATCHES`(唯一铸点 `settingsEnvCredentialIssue`;受理门 / `resolveSpec` 两腿 / 存体续跑预判同调);`satisfies Record<SettingsEnvCredentialMatch, …>`。
1129
+ * `name` = 名字是本引擎的凭据变量(配置目录 `secret` 行 ∪ 模型条目 `apiKeyEnv`,比名不分大小写);`value_shape` = 值是秘密形;两者都中报 `name`。续跑口 409 `resume_blocked_by_policy`(`blockedBy` = 本码)随体同一组机读位。
1130
+ * 行为钉:`test/settings-env-credential.test.ts`。
1131
+ */
1132
+ readonly settingsEnvCredentialMatch: {
1133
+ readonly at: "400 request.env_credential_refused entries[].match(settings.env 里被判成凭据的条目;续跑口 409 resume_blocked_by_policy 同一组机读位)";
1134
+ readonly members: {
1135
+ name: {
1136
+ attr: string;
1137
+ since: string;
1138
+ };
1139
+ value_shape: {
1140
+ attr: string;
1141
+ since: string;
1142
+ };
1143
+ };
1144
+ };
942
1145
  /**
943
1146
  * `inheritEnv` 的三只 400 `request.field_invalid`(值形 / 车道 / 无会话)拒体的 `reason`(体另带 `field: "inheritEnv"`;一种拒因一个词)。词表属主 = `request-value-closure.ts` 的
944
1147
  * `INHERIT_ENV_REFUSAL_REASONS`(唯一铸点 `inheritEnvFacts`;受理门与 resolveSpec 两腿只经它出机读位);`satisfies Record<InheritEnvRefusalReason, …>`。
@@ -1901,10 +2104,26 @@ export declare const SELF_MINTED_WIRE: {
1901
2104
  readonly attr: 503;
1902
2105
  readonly since: "7.143.0";
1903
2106
  };
1904
- readonly "POST /v1/rules/cc-import/redeem#member_refused(\u5151\u4ED8\u8D70\u5B8C\u3001\u5F15\u64CE\u7684\u5B8C\u6574\u6210\u5458\u8868\u91CC\u6709\u88AB\u62D2\u7684\u6210\u5458;\u4F53 = \u56DE\u6267 { members, rev },\u90A3\u51E0\u884C outcome indeterminate + reason store_refused + detail \u5F15\u64CE\u539F\u8BDD;\u7968\u7528\u6389,\u540C\u7968\u518D\u5151 404)": {
2107
+ readonly "POST /v1/rules/cc-import/redeem#member_refused(\u5151\u4ED8\u8D70\u5B8C\u3001\u5F15\u64CE\u7684\u5B8C\u6574\u6210\u5458\u8868\u91CC\u6709\u88AB\u62D2\u7684\u6210\u5458;\u4F53 = \u56DE\u6267 { members, rev },\u90A3\u51E0\u884C outcome refused(\u5F15\u64CE\u7B54 committed no;7.145.0 \u4E3A indeterminate + store_refused)+ reason = \u5F15\u64CE\u62D2\u56E0\u7801(RuleRefusalCode)+ detail \u5F15\u64CE\u539F\u8BDD;\u7968\u7528\u6389,\u540C\u7968\u518D\u5151 404)": {
1905
2108
  readonly attr: 200;
1906
2109
  readonly since: "7.145.0";
1907
2110
  };
2111
+ readonly "POST /v1/rules/cc-import/redeem|POST /v1/rules/local-import/redeem#member_outcome_unknown(\u5151\u4ED8\u8D70\u5B8C\u3001\u5F15\u64CE\u7684\u5B8C\u6574\u6210\u5458\u8868\u91CC\u6709\u4E00\u5458\u7B54 committed unknown:\u5199\u629B / \u8BFB\u56DE\u8BFB\u4E0D\u51FA / \u8BB0 dot \u7684 CAS \u6216 dot \u5206\u914D\u5931\u8D25;\u4E0D\u843D\u5B9A,\u8BA4\u9886\u653E\u56DE;\u4F53 state.rule_import_retry + retryAfterSec;\u540C\u7968\u91CD\u6765\u5373\u91CD\u8D70)": {
2112
+ readonly attr: 503;
2113
+ readonly since: "7.146.0";
2114
+ };
2115
+ readonly "POST /v1/tasks|/v1/tasks/stream|/v1/runs#settings.env \u5E26\u51ED\u636E\u6761\u76EE(\u540D\u5B57\u662F\u672C\u5F15\u64CE\u7684\u51ED\u636E\u53D8\u91CF / \u503C\u662F\u79D8\u5BC6\u5F62;\u65B0\u63D0\u4EA4;\u4F53 request.env_credential_refused + field settings.env + entries[{ key, match }],\u503C\u4E0D\u56DE\u663E)": {
2116
+ readonly attr: 400;
2117
+ readonly since: "7.146.0";
2118
+ };
2119
+ readonly "POST /v1/tasks|/v1/tasks/stream|/v1/runs#sessionId \u662F\u672C\u8FDB\u7A0B\u5220\u8FC7\u7684\u4F1A\u8BDD id\u3001\u6839\u4F1A\u8BDD\u884C\u4E0A\u7684\u4F4F\u5BA2\u4E0D\u662F\u5220\u524D\u5C5E\u4E3B(\u65B0\u63D0\u4EA4;\u6388\u6743\u53E3\u767B\u8BB0\u4E4B\u540E\u3001\u6267\u884C\u4E0A\u4E0B\u6587\u89E3\u6790\u5668\u6B65 \u2460;\u4F53 conflict.session_id_retired,\u4E0D\u56DE\u663E id / \u5C5E\u4E3B)": {
2120
+ readonly attr: 409;
2121
+ readonly since: "7.146.0";
2122
+ };
2123
+ readonly "POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#\u6839\u4F1A\u8BDD id \u662F\u672C\u8FDB\u7A0B\u5220\u8FC7\u7684\u4F1A\u8BDD id\u3001\u884C\u4E0A\u7684\u4F4F\u5BA2\u4E0D\u662F\u5220\u524D\u5C5E\u4E3B(\u7EED\u8DD1\u5BB6\u65CF / \u505C\u9A7B\u8D4E\u56DE / \u5DE5\u4F5C\u6D41\u51B3\u65AD\u540E\u7684\u5BBF\u4E3B\u65B0\u8F6E;\u8BA4\u9886\u4E4B\u524D,\u5361\u4ECD\u5F85\u51B3;\u4F53 resume_blocked_by_policy + blockedBy conflict.session_id_retired + retriable)": {
2124
+ readonly attr: 409;
2125
+ readonly since: "7.146.0";
2126
+ };
1908
2127
  };
1909
2128
  };
1910
2129
  /**
@@ -1925,13 +2144,6 @@ export declare const SELF_MINTED_WIRE: {
1925
2144
  since: string;
1926
2145
  };
1927
2146
  };
1928
- readonly retired: {
1929
- readonly "result(\u22647.144.0 \u7684 cc-import \u56DE\u6267:{ members: <\u5F15\u64CE RedeemedBatchMember \u539F\u5F62\u884C:candidateIndex / behavior / rule / scope \u5BF9\u8C61 / status / alreadyRedeemed / dot>, rev })": {
1930
- readonly attr: "always";
1931
- readonly since: "7.46.0";
1932
- readonly until: "7.145.0";
1933
- };
1934
- };
1935
2147
  };
1936
2148
  /** 同上回执 `members[]` 一行的键(<键> → 在场律)。键集属主 = `ImportOutcomeMember`(`satisfies` 穷举),唯一投影 = `rules-consent.ts` 的 `buildImportOutcomeMembers`(两口同调)。 */
1937
2149
  readonly ruleImportReceiptMemberKey: {
@@ -1983,6 +2195,7 @@ export declare const SELF_MINTED_WIRE: {
1983
2195
  /**
1984
2196
  * `GET /v1/sessions/:id/memory-status` 200 体上本版新出现的顶层键:`memorySync` —— 本部署记忆同步腿的停驻事实(部署事实,不随会话、不随层座 `?scope=`;
1985
2197
  * 唯一读口 = 同步执行器的 `parked()`)。形 `{ parked: Array<{ scope, wayOut }> }`,`parked: []` = 在同步、没有层停驻;游标盘路径不上 wire。
2198
+ * `writeHome` / `planes`(7.146.0)—— 会话的记忆写家:引擎给的 canonical 绝对目录(worker 文件系统路径),字节原样;`writeHome` 是店绑定的键(带层座 = 那只店的引擎答案,顶层原样;不带层座 = 引擎在店之间择好的会话级一值,顶层原样;逐店明细 `planes[]` 原样透出每行的 `writeHome`);在场律 = 引擎答了 ∧ 部署形表行 `callerOwnsWorkerDisk`(与能力位 `projectContext` 同一行)。
1986
2199
  */
1987
2200
  readonly sessionMemoryStatusKey: {
1988
2201
  readonly at: "GET /v1/sessions/:id/memory-status 200 体顶层键(<键> → 在场律)";
@@ -1991,6 +2204,14 @@ export declare const SELF_MINTED_WIRE: {
1991
2204
  readonly 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)";
1992
2205
  readonly since: "7.141.0";
1993
2206
  };
2207
+ readonly writeHome: {
2208
+ readonly 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)";
2209
+ readonly since: "7.146.0";
2210
+ };
2211
+ readonly planes: {
2212
+ readonly 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";
2213
+ readonly since: "7.146.0";
2214
+ };
1994
2215
  };
1995
2216
  };
1996
2217
  /** 停驻层出路 `memorySync.parked[].wayOut` 的闭集(同一只词也在运维行 `memory_sync_layer_parked` 的 `wayOut` 上)。`delete_cursor` = 删掉这一层的同步游标文件,下一轮从空基线重收敛(不推删除)。 */
@@ -2078,6 +2299,87 @@ export declare const SELF_MINTED_WIRE: {
2078
2299
  };
2079
2300
  };
2080
2301
  };
2302
+ /**
2303
+ * 收编批量导入 `POST /v1/adoption/:id/sessions` 逐元素结局的 `outcome`(三词闭集;属主 = `adoption/wire.ts` 的 `AdoptionImportResult` 判别联合 ——
2304
+ * 联合加一臂而本表没跟 / 多一个词 ⇒ tsc 红)。
2305
+ */
2306
+ readonly adoptionImportOutcome: {
2307
+ readonly at: "POST /v1/adoption/:id/sessions 200 results[].outcome";
2308
+ readonly members: {
2309
+ imported: {
2310
+ attr: string;
2311
+ since: string;
2312
+ };
2313
+ already_imported: {
2314
+ attr: string;
2315
+ since: string;
2316
+ };
2317
+ rejected: {
2318
+ attr: string;
2319
+ since: string;
2320
+ };
2321
+ };
2322
+ };
2323
+ /** 同口 `outcome: "rejected"` 的 `code`(三词闭集;属主 = `adoption/wire.ts` 的 `ADOPTION_IMPORT_REJECT_CODES`,与结局联合的拒臂两向编译钉)。属性 = 这一臂多带的键。 */
2324
+ readonly adoptionImportRejectCode: {
2325
+ readonly at: "POST /v1/adoption/:id/sessions 200 results[].code(present-iff outcome rejected)";
2326
+ readonly members: {
2327
+ too_large: {
2328
+ attr: string;
2329
+ since: string;
2330
+ };
2331
+ invalid_envelope: {
2332
+ attr: string;
2333
+ since: string;
2334
+ };
2335
+ duplicate_client_session_id: {
2336
+ attr: string;
2337
+ since: string;
2338
+ };
2339
+ };
2340
+ };
2341
+ /** 同口的体与结局键(`<面>#<键>` → 读法 / 在场律)。 */
2342
+ readonly adoptionImportWire: {
2343
+ readonly at: "POST /v1/adoption/:id/sessions(<面>#<键> → 读法 / 在场律)";
2344
+ readonly members: {
2345
+ readonly "body#sessions": {
2346
+ readonly attr: "required;the only key;array of envelopes;length > adoptionImport.maxSessions ⇒ 400 request.field_invalid (field sessions, reason over_cap)";
2347
+ readonly since: "7.146.0";
2348
+ };
2349
+ readonly "body.sessions[]#clientSessionId": {
2350
+ readonly attr: "required;string 1-255 chars;idempotency key with the adoption id";
2351
+ readonly since: "7.146.0";
2352
+ };
2353
+ readonly "body.sessions[]#entries": {
2354
+ readonly attr: "required;array of session entries oldest first;the only other key (any extra key ⇒ that element invalid_envelope)";
2355
+ readonly since: "7.146.0";
2356
+ };
2357
+ readonly "200#results": {
2358
+ readonly attr: "always;one per element, same order";
2359
+ readonly since: "7.146.0";
2360
+ };
2361
+ readonly "200.results[]#clientSessionId": {
2362
+ readonly attr: "always except invalid_envelope on an unreadable envelope";
2363
+ readonly since: "7.146.0";
2364
+ };
2365
+ readonly "200.results[]#sessionId": {
2366
+ readonly attr: "present-iff imported | already_imported;the cloud session id derived from (adoptionId, clientSessionId)";
2367
+ readonly since: "7.146.0";
2368
+ };
2369
+ readonly "200.results[]#count": {
2370
+ readonly attr: "present-iff code too_large";
2371
+ readonly since: "7.146.0";
2372
+ };
2373
+ readonly "200.results[]#cap": {
2374
+ readonly attr: "present-iff code too_large";
2375
+ readonly since: "7.146.0";
2376
+ };
2377
+ readonly "200.results[]#detail": {
2378
+ readonly attr: "present-iff code invalid_envelope";
2379
+ readonly since: "7.146.0";
2380
+ };
2381
+ };
2382
+ };
2081
2383
  /** 中心侧同步口(`<面>#<键>` → 读法 / 在场律)。只登本版新出现的(路径版本段、主张、答复游标的化身、化身拒答两键)。 */
2082
2384
  readonly centralMemorySyncWire: {
2083
2385
  readonly at: "POST /v2/memory/sync/:scope(<面>#<键> → 读法 / 在场律)";
@@ -2153,6 +2455,14 @@ export declare const SELF_MINTED_WIRE: {
2153
2455
  readonly refusalSentenceForm: {
2154
2456
  readonly at: "拒体 message 的句型(<码>#<座> → 句型骨架;码 / 状态 / 机读位不变)";
2155
2457
  readonly members: {
2458
+ readonly "401 auth.unauthorized#operator(/metrics* \u00B7 GET /v1/tasks/source-summary)": {
2459
+ readonly 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 (…)";
2460
+ readonly since: "7.146.0";
2461
+ };
2462
+ readonly "422 invalid_entries#row_contract(\u4F1A\u8BDD\u540C\u6B65\u63A8\u9001\u7B2C\u4E8C\u9636\u6BB5;\u6536\u7F16\u6279\u91CF\u5BFC\u5165\u540C\u53E5\u8FDB\u9010\u5143\u7D20 detail)": {
2463
+ readonly attr: "malformed entry (id and parentId must be strings of 1-64 characters, type a string of 1-32 characters)";
2464
+ readonly since: "7.146.0";
2465
+ };
2156
2466
  readonly "409 decide.row_unrevivable#no_root_anchor": {
2157
2467
  readonly attr: "ends: deny it to close the card (the agent then ends as failed)";
2158
2468
  readonly since: "7.136.0";
@@ -2481,6 +2791,14 @@ export declare const SELF_MINTED_WIRE: {
2481
2791
  readonly attr: "memory";
2482
2792
  readonly since: "7.142.0";
2483
2793
  };
2794
+ readonly DEVICE_TRUSTED_PROXY_CIDRS: {
2795
+ readonly attr: "orchestration";
2796
+ readonly since: "7.146.0";
2797
+ };
2798
+ readonly SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT: {
2799
+ readonly attr: "auth";
2800
+ readonly since: "7.146.0";
2801
+ };
2484
2802
  };
2485
2803
  };
2486
2804
  /**
@@ -191,6 +191,15 @@ export const SELF_MINTED_WIRE = {
191
191
  direct_door_jwt: { attr: "-", since: "7.121.0" },
192
192
  },
193
193
  },
194
+ healthAuthKey: {
195
+ at: "GET /health auth",
196
+ members: {
197
+ required: { attr: "always", since: "7.121.0" },
198
+ kinds: { attr: "always", since: "7.121.0" },
199
+ identityAttach: { attr: "always", since: "7.121.0" },
200
+ serviceTokenActsForDeployment: { attr: "always (boolean: service credential configured ∧ SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT)", since: "7.146.0" },
201
+ },
202
+ },
194
203
  healthIdentityAttach: {
195
204
  at: "GET /health auth.identityAttach",
196
205
  members: {
@@ -234,11 +243,70 @@ export const SELF_MINTED_WIRE = {
234
243
  deploymentPackages: { attr: "present-iff deployment mod packages loaded at boot", since: "7.138.0" },
235
244
  },
236
245
  },
246
+ healthInflightBreakdownKey: {
247
+ at: "GET /health inflightBreakdown",
248
+ members: {
249
+ http: { attr: "always within inflightBreakdown", since: "7.146.0" },
250
+ leader: { attr: "always within inflightBreakdown", since: "7.146.0" },
251
+ sessionResident: { attr: "always within inflightBreakdown", since: "7.146.0" },
252
+ },
253
+ },
237
254
  healthEngineLeaseKey: {
238
255
  at: "GET /health engineLease",
239
256
  members: {
240
257
  lingerMs: { attr: "present-iff engine lease leg armed and observing", since: "7.141.0" },
241
258
  tickMs: { attr: "present-iff engine lease leg armed and observing", since: "7.141.0" },
259
+ firstAttach: { attr: "present-iff engineLease present and the owned window is finite", since: "7.146.0" },
260
+ lane: { attr: "always within engineLease", since: "7.146.0" },
261
+ handover: { attr: "present-iff lane is handover", since: "7.146.0" },
262
+ },
263
+ },
264
+ healthEngineLeaseFirstAttachKey: {
265
+ at: "GET /health engineLease.firstAttach",
266
+ members: {
267
+ windowMs: { attr: "always within firstAttach", since: "7.146.0" },
268
+ since: { attr: "always within firstAttach (epoch ms)", since: "7.146.0" },
269
+ attachedAt: { attr: "epoch ms, null until the first non-probe request", since: "7.146.0" },
270
+ },
271
+ },
272
+ healthEngineLeaseHandoverKey: {
273
+ at: "GET /health engineLease.handover",
274
+ members: {
275
+ since: { attr: "always within handover (epoch ms)", since: "7.146.0" },
276
+ reason: { attr: "always within handover", since: "7.146.0" },
277
+ lingerMs: { attr: "always within handover", since: "7.146.0" },
278
+ backgroundShells: { attr: "always within handover (running shell rows the exit boundary would hard-kill now)", since: "7.146.0" },
279
+ },
280
+ },
281
+ engineLane: {
282
+ at: "engine lease lane(/health engineLease.lane · POST /v1/engine/handover|attach lane · exit-last.json lane)",
283
+ members: {
284
+ handover: { attr: "-", since: "7.146.0" },
285
+ orphan: { attr: "-", since: "7.146.0" },
286
+ awaitingFirstAttach: { attr: "-", since: "7.146.0" },
287
+ owned: { attr: "-", since: "7.146.0" },
288
+ },
289
+ },
290
+ engineHandoverReason: {
291
+ at: "POST /v1/engine/handover reason · /health engineLease.handover.reason",
292
+ members: {
293
+ background_exit: { attr: "-", since: "7.146.0" },
294
+ },
295
+ },
296
+ engineHandoverReplyKey: {
297
+ at: "POST /v1/engine/handover 200 体键(<键> → 在场律)",
298
+ members: {
299
+ lane: { attr: "always (handover)", since: "7.146.0" },
300
+ since: { attr: "always (epoch ms; the same value on a repeated handover)", since: "7.146.0" },
301
+ lingerMs: { attr: "always", since: "7.146.0" },
302
+ backgroundShells: { attr: "always", since: "7.146.0" },
303
+ },
304
+ },
305
+ engineAttachReplyKey: {
306
+ at: "POST /v1/engine/attach 200 体键(<键> → 在场律)",
307
+ members: {
308
+ lane: { attr: "always", since: "7.146.0" },
309
+ handedOverForMs: { attr: "present-iff this attach cleared a handover", since: "7.146.0" },
242
310
  },
243
311
  },
244
312
  modelsRowKey: {
@@ -353,6 +421,19 @@ export const SELF_MINTED_WIRE = {
353
421
  not_object: { attr: "-", since: "7.133.0" },
354
422
  },
355
423
  },
424
+ rateExceededReason: {
425
+ at: "429 limit.rate_exceeded reason(在飞 run 并发帽;其余产地不带 reason)",
426
+ members: {
427
+ run_concurrency_cap: { attr: "-", since: "7.146.0" },
428
+ },
429
+ },
430
+ settingsEnvCredentialMatch: {
431
+ at: "400 request.env_credential_refused entries[].match(settings.env 里被判成凭据的条目;续跑口 409 resume_blocked_by_policy 同一组机读位)",
432
+ members: {
433
+ name: { attr: "-", since: "7.146.0" },
434
+ value_shape: { attr: "-", since: "7.146.0" },
435
+ },
436
+ },
356
437
  inheritEnvRefusalReason: {
357
438
  at: "400 request.field_invalid reason(inheritEnv 的值形 / 车道 / 无会话三只拒;另带 field: \"inheritEnv\")",
358
439
  members: {
@@ -664,7 +745,11 @@ export const SELF_MINTED_WIRE = {
664
745
  "GET /v1/capabilities/mcp#engine_name_collision(中心声明两台归一后同挂一个工具命名空间前缀,引擎在任何传输被触碰之前整集拒;体 config.mcp_server_name_collision + 引擎原句;与同步提交腿同一张码 → 状态表)": { attr: 409, since: "7.143.0" },
665
746
  "POST /v1/tasks#engine_name_collision(同步腿;同一份声明集被引擎整集拒;零工作的拒;体 config.mcp_server_name_collision)": { attr: 409, since: "7.143.0" },
666
747
  "POST /v1/rules/local-import/prepare#tightening_write_failed(一条收下的 deny / ask 写不进店;这一批的放行扣下、没有票;体 state.rule_write_failed + committed,同 POST /v1/rules)": { attr: 503, since: "7.143.0" },
667
- "POST /v1/rules/cc-import/redeem#member_refused(兑付走完、引擎的完整成员表里有被拒的成员;体 = 回执 { members, rev },那几行 outcome indeterminate + reason store_refused + detail 引擎原话;票用掉,同票再兑 404)": { attr: 200, since: "7.145.0" },
748
+ "POST /v1/rules/cc-import/redeem#member_refused(兑付走完、引擎的完整成员表里有被拒的成员;体 = 回执 { members, rev },那几行 outcome refused(引擎答 committed no;7.145.0 为 indeterminate + store_refused)+ reason = 引擎拒因码(RuleRefusalCode)+ detail 引擎原话;票用掉,同票再兑 404)": { attr: 200, since: "7.145.0" },
749
+ "POST /v1/rules/cc-import/redeem|POST /v1/rules/local-import/redeem#member_outcome_unknown(兑付走完、引擎的完整成员表里有一员答 committed unknown:写抛 / 读回读不出 / 记 dot 的 CAS 或 dot 分配失败;不落定,认领放回;体 state.rule_import_retry + retryAfterSec;同票重来即重走)": { attr: 503, since: "7.146.0" },
750
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#settings.env 带凭据条目(名字是本引擎的凭据变量 / 值是秘密形;新提交;体 request.env_credential_refused + field settings.env + entries[{ key, match }],值不回显)": { attr: 400, since: "7.146.0" },
751
+ "POST /v1/tasks|/v1/tasks/stream|/v1/runs#sessionId 是本进程删过的会话 id、根会话行上的住客不是删前属主(新提交;授权口登记之后、执行上下文解析器步 ①;体 conflict.session_id_retired,不回显 id / 属主)": { attr: 409, since: "7.146.0" },
752
+ "POST /v1/approvals/:sessionId/decide|/v1/sessions/:id/wake|/v1/assistant/tasks/:id/resume|/v1/assistant/tasks/:id/plan_review#根会话 id 是本进程删过的会话 id、行上的住客不是删前属主(续跑家族 / 停驻赎回 / 工作流决断后的宿主新轮;认领之前,卡仍待决;体 resume_blocked_by_policy + blockedBy conflict.session_id_retired + retriable)": { attr: 409, since: "7.146.0" },
668
753
  },
669
754
  },
670
755
  ruleImportReceiptKey: {
@@ -673,17 +758,14 @@ export const SELF_MINTED_WIRE = {
673
758
  members: { attr: "always", since: "7.145.0" },
674
759
  rev: { attr: "always", since: "7.145.0" },
675
760
  },
676
- retired: {
677
- "result(≤7.144.0 的 cc-import 回执:{ members: <引擎 RedeemedBatchMember 原形行:candidateIndex / behavior / rule / scope 对象 / status / alreadyRedeemed / dot>, rev })": { attr: "always", since: "7.46.0", until: "7.145.0" },
678
- },
679
761
  },
680
762
  ruleImportReceiptMemberKey: {
681
763
  at: "POST /v1/rules/cc-import/redeem 200 回执 members[] 行键(<键> → 在场律;与 POST /v1/rules/local-import/redeem 同形)",
682
764
  members: {
683
765
  key: { attr: "always; { behavior, rule, scope } — scope is the GET /v1/rules discriminated string (global | project:<root>)", since: "7.145.0" },
684
- outcome: { attr: "always; persisted | no-op | indeterminate (refused reserved for a typed engine verdict bit, not minted)", since: "7.145.0" },
685
- reason: { attr: "present-iff outcome indeterminate; store_refused", since: "7.145.0" },
686
- detail: { attr: "present-iff outcome indeterminate; the engine's refusal sentence verbatim", since: "7.145.0" },
766
+ outcome: { attr: "always; persisted | no-op | refused (engine refusal, committed no) | indeterminate (engine refusal, committed unknown; 7.145.0 minted every engine refusal as indeterminate)", since: "7.145.0" },
767
+ reason: { attr: "present-iff outcome refused | indeterminate; the engine's RuleRefusalCode verbatim (7.145.0: the one word store_refused)", since: "7.145.0" },
768
+ detail: { attr: "present-iff outcome refused | indeterminate; the engine's refusal sentence verbatim", since: "7.145.0" },
687
769
  },
688
770
  },
689
771
  memoryLayerSeatKey: {
@@ -699,6 +781,8 @@ export const SELF_MINTED_WIRE = {
699
781
  at: "GET /v1/sessions/:id/memory-status 200 体顶层键(<键> → 在场律)",
700
782
  members: {
701
783
  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" },
784
+ 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" },
785
+ 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" },
702
786
  },
703
787
  },
704
788
  memorySyncWayOut: {
@@ -732,6 +816,36 @@ export const SELF_MINTED_WIRE = {
732
816
  "409 conflict.session_memory_unobserved#reason": { attr: "always;closed set sessionMemoryUnobservedReason, judged in read order (no settled run → the latest settled run's observation gives no read set: empty observation or memory not mounted → no leaf);the message is a function of reason", since: "7.143.0" },
733
817
  },
734
818
  },
819
+ adoptionImportOutcome: {
820
+ at: "POST /v1/adoption/:id/sessions 200 results[].outcome",
821
+ members: {
822
+ imported: { attr: "-", since: "7.146.0" },
823
+ already_imported: { attr: "-", since: "7.146.0" },
824
+ rejected: { attr: "-", since: "7.146.0" },
825
+ },
826
+ },
827
+ adoptionImportRejectCode: {
828
+ at: "POST /v1/adoption/:id/sessions 200 results[].code(present-iff outcome rejected)",
829
+ members: {
830
+ too_large: { attr: "count = the envelope's JSON byte length;cap = maxSessionBytes at the time", since: "7.146.0" },
831
+ invalid_envelope: { attr: "detail = a fixed sentence (envelope shape, or which import invariant failed);clientSessionId present-iff readable", since: "7.146.0" },
832
+ duplicate_client_session_id: { attr: "an earlier element of the same batch used this clientSessionId (whatever its own outcome)", since: "7.146.0" },
833
+ },
834
+ },
835
+ adoptionImportWire: {
836
+ at: "POST /v1/adoption/:id/sessions(<面>#<键> → 读法 / 在场律)",
837
+ members: {
838
+ "body#sessions": { attr: "required;the only key;array of envelopes;length > adoptionImport.maxSessions ⇒ 400 request.field_invalid (field sessions, reason over_cap)", since: "7.146.0" },
839
+ "body.sessions[]#clientSessionId": { attr: "required;string 1-255 chars;idempotency key with the adoption id", since: "7.146.0" },
840
+ "body.sessions[]#entries": { attr: "required;array of session entries oldest first;the only other key (any extra key ⇒ that element invalid_envelope)", since: "7.146.0" },
841
+ "200#results": { attr: "always;one per element, same order", since: "7.146.0" },
842
+ "200.results[]#clientSessionId": { attr: "always except invalid_envelope on an unreadable envelope", since: "7.146.0" },
843
+ "200.results[]#sessionId": { attr: "present-iff imported | already_imported;the cloud session id derived from (adoptionId, clientSessionId)", since: "7.146.0" },
844
+ "200.results[]#count": { attr: "present-iff code too_large", since: "7.146.0" },
845
+ "200.results[]#cap": { attr: "present-iff code too_large", since: "7.146.0" },
846
+ "200.results[]#detail": { attr: "present-iff code invalid_envelope", since: "7.146.0" },
847
+ },
848
+ },
735
849
  centralMemorySyncWire: {
736
850
  at: "POST /v2/memory/sync/:scope(<面>#<键> → 读法 / 在场律)",
737
851
  members: {
@@ -761,6 +875,8 @@ export const SELF_MINTED_WIRE = {
761
875
  refusalSentenceForm: {
762
876
  at: "拒体 message 的句型(<码>#<座> → 句型骨架;码 / 状态 / 机读位不变)",
763
877
  members: {
878
+ "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" },
879
+ "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" },
764
880
  "409 decide.row_unrevivable#no_root_anchor": { attr: "ends: deny it to close the card (the agent then ends as failed)", since: "7.136.0" },
765
881
  "400 request.field_invalid#mcpServers.over_cap(受理口 · POST /v1/capabilities/mcp/probe 同句)": { attr: "head: <field> has <count> entries — at most <cap> are accepted", since: "7.136.0" },
766
882
  "400 request.field_invalid#a2aPeers.over_cap": { attr: "tail: 声明列表拒绝骨架的句尾(与 mcpServers 共用 request-declaration-refusal)", since: "7.136.0" },
@@ -866,6 +982,8 @@ export const SELF_MINTED_WIRE = {
866
982
  members: {
867
983
  SEALED_KEY_DIR: { attr: "store", since: "7.136.0" },
868
984
  MEMORY_SYNC_SERVE_IDENTITY: { attr: "memory", since: "7.142.0" },
985
+ DEVICE_TRUSTED_PROXY_CIDRS: { attr: "orchestration", since: "7.146.0" },
986
+ SERVICE_TOKEN_ACTS_FOR_DEPLOYMENT: { attr: "auth", since: "7.146.0" },
869
987
  },
870
988
  },
871
989
  deviceProtocolRevision: {
@@ -171,7 +171,7 @@ export declare const WIRE_PROJECTION_FACES: {
171
171
  readonly workspace_changed: {
172
172
  readonly projector: "workspaceChangedEventData";
173
173
  readonly coreType: string;
174
- readonly excluded: readonly ["root", "remote", "entered", "project"];
174
+ readonly excluded: readonly ["root", "remote", "entered", "project", "session"];
175
175
  readonly minted: readonly [];
176
176
  };
177
177
  readonly status: {
@@ -34,7 +34,7 @@ export const WIRE_PROJECTION_FACES = {
34
34
  tool_roster_delta: { projector: "toolRosterDeltaEventData", coreType: arm("tool_roster_delta"), excluded: [], minted: [] },
35
35
  diagnostics: { projector: "diagnosticsEventData", coreType: arm("diagnostics"), excluded: [], minted: [] },
36
36
  steering_injected: { projector: "steeringInjectedEventData", coreType: arm("steering_injected"), excluded: [], minted: [] },
37
- workspace_changed: { projector: "workspaceChangedEventData", coreType: arm("workspace_changed"), excluded: ["root", "remote", "entered", "project"], minted: [] },
37
+ workspace_changed: { projector: "workspaceChangedEventData", coreType: arm("workspace_changed"), excluded: ["root", "remote", "entered", "project", "session"], minted: [] },
38
38
  status: { projector: "brainStatusEventData", coreType: `BrainStatus & ${arm("status")}`, excluded: [], minted: [] },
39
39
  compacted: { projector: "compactedEventData", coreType: arm("compacted"), excluded: [], minted: [] },
40
40
  context_usage: { projector: "contextUsageEventData", coreType: arm("context_usage"), excluded: [], minted: [] },
@@ -16,6 +16,10 @@
16
16
  * 第二种口径不完整:**有 echo 行但缺数值键**(该键按 0 计入 ⇒ 总量偏低)——两臂同义:别把总数当精确值;
17
17
  * - 行内数值键一律走 {@link numOf} 守卫:数据源是 DB 里的 JSON,裸算术遇缺席/非数会 NaN 毒掉整窗(#59);
18
18
  * - 扫窗有行数上限(store 侧 LIMIT)——触顶时结果携带 `truncated:true`(诚实截断,绝不静默)。
19
+ *
20
+ * 窗契约(三个后端同一条,`usageScan(fromMs, toMs)`):窗是**半开 `[fromMs, toMs)`** —— 创建毫秒 `t` 满足 `fromMs <= t < toMs` 的行才计
21
+ * (内存 / 文件腿 `t < fromMs || t >= toMs` 跳过;SQL 腿 `created_at >= ? AND created_at < ?`,列是毫秒精度)。上界**不含**。
22
+ * 路由 `/v1/usage/*` 的**缺省** `to` 取 `now + 1`(「到此刻为止,含此刻」是缺省值的定义,店不为它开特例);请求显式给的 `to` 原义不变(不含)。
19
23
  */
20
24
  /** store 侧 usageScan 的行投影(所有后端同形状;createdAtMs=epoch ms)。 */
21
25
  export interface UsageRow {