@sema-agent/server 7.146.0 → 7.148.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 (850) hide show
  1. package/MIGRATION.md +1423 -24
  2. package/README.md +21 -8
  3. package/README.zh-CN.md +15 -9
  4. package/USAGE.md +537 -216
  5. package/deploy/facts/lanes.json +7 -0
  6. package/deploy/sema-up/README.md +18 -7
  7. package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
  8. package/deploy/sema-up/chart/templates/_helpers.tpl +42 -4
  9. package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -4
  10. package/deploy/sema-up/chart/templates/server.yaml +5 -4
  11. package/deploy/sema-up/chart/values.yaml +4 -3
  12. package/deploy/sema-up/cluster-up.sh +75 -176
  13. package/deploy/sema-up/kube-up.sh +29 -49
  14. package/deploy/sema-up/lib/chart-run.sh +23 -0
  15. package/deploy/sema-up/lib/dataroot.sh +3 -3
  16. package/deploy/sema-up/lib/flagshape.sh +4 -0
  17. package/deploy/sema-up/lib/health.sh +62 -13
  18. package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
  19. package/deploy/sema-up/lib/helm-values-kube.py +35 -0
  20. package/deploy/sema-up/lib/lanes.json +2 -5
  21. package/deploy/sema-up/lib/regcred.py +8 -0
  22. package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
  23. package/deploy/sema-up/lib/remote/image-import.sh +6 -0
  24. package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
  25. package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
  26. package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
  27. package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
  28. package/deploy/sema-up/lib/render-stack.py +17 -0
  29. package/deploy/sema-up/lib/shell-text.sh +87 -0
  30. package/deploy/sema-up/lib/usage-flags.txt +10 -0
  31. package/deploy/sema-up/lib/usage-head.txt +1 -0
  32. package/deploy/sema-up/lib/usage-tail.txt +13 -0
  33. package/deploy/sema-up/preflight.sh +10 -8
  34. package/deploy/sema-up/sema-up.sh +26 -48
  35. package/deploy/sema-up/smoke.sh +7 -6
  36. package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
  37. package/deploy/sema-up/stack/compose.yaml +18 -5
  38. package/deploy/sema-up/stack/sema-stack-cluster.yaml +25 -3
  39. package/dist/adoption/plan.d.ts +24 -0
  40. package/dist/adoption/plan.js +53 -1
  41. package/dist/adoption/runner.d.ts +10 -1
  42. package/dist/adoption/runner.js +36 -16
  43. package/dist/adoption/wire.d.ts +3 -3
  44. package/dist/approval-card.d.ts +32 -34
  45. package/dist/approval-gate-currency.js +3 -2
  46. package/dist/approval-reconciler.d.ts +4 -13
  47. package/dist/approval-reconciler.js +2 -2
  48. package/dist/approval.d.ts +16 -14
  49. package/dist/approval.js +3 -3
  50. package/dist/audit.d.ts +10 -3
  51. package/dist/audit.js +17 -9
  52. package/dist/auth-bridge.d.ts +0 -14
  53. package/dist/auth-bridge.js +0 -7
  54. package/dist/auto-mode-face.d.ts +10 -7
  55. package/dist/auto-mode-face.js +7 -4
  56. package/dist/background-agent-name.d.ts +19 -1
  57. package/dist/background-agent-name.js +12 -2
  58. package/dist/background-session-reap.d.ts +1 -1
  59. package/dist/bake-runner/main.js +9 -6
  60. package/dist/bench/s1/arms.js +6 -5
  61. package/dist/bench/s1/live-deps.js +8 -3
  62. package/dist/bench/s1/run-firm.js +6 -5
  63. package/dist/bind-host.d.ts +25 -0
  64. package/dist/bind-host.js +25 -0
  65. package/dist/boot/adoption.d.ts +3 -0
  66. package/dist/boot/adoption.js +1 -0
  67. package/dist/boot/crash-last.js +2 -1
  68. package/dist/boot/deployment-mods.d.ts +1 -1
  69. package/dist/boot/device-lane.js +5 -5
  70. package/dist/boot/engine-lease.d.ts +12 -11
  71. package/dist/boot/execution-env.d.ts +19 -8
  72. package/dist/boot/execution-env.js +80 -62
  73. package/dist/boot/execution-lane.d.ts +37 -9
  74. package/dist/boot/execution-lane.js +74 -20
  75. package/dist/boot/exit-boundary.d.ts +3 -3
  76. package/dist/boot/exit-boundary.js +6 -5
  77. package/dist/boot/exit-last.js +2 -1
  78. package/dist/boot/fatal-exit.d.ts +3 -5
  79. package/dist/boot/fatal-exit.js +2 -2
  80. package/dist/boot/governance-seams.d.ts +2 -2
  81. package/dist/boot/leader.d.ts +15 -0
  82. package/dist/boot/leader.js +18 -16
  83. package/dist/boot/memory-boundary.d.ts +11 -11
  84. package/dist/boot/memory-boundary.js +3 -3
  85. package/dist/boot/memory-consolidation.d.ts +50 -53
  86. package/dist/boot/memory-consolidation.js +11 -18
  87. package/dist/boot/org-memory.js +4 -3
  88. package/dist/boot/parked-revive-gate.d.ts +1 -1
  89. package/dist/boot/parked-revive-gate.js +3 -3
  90. package/dist/boot/reapers.d.ts +4 -3
  91. package/dist/boot/reapers.js +20 -17
  92. package/dist/boot/resolve-spec.d.ts +5 -3
  93. package/dist/boot/resolve-spec.js +133 -165
  94. package/dist/boot/retention-lane.d.ts +7 -45
  95. package/dist/boot/retention-lane.js +2 -2
  96. package/dist/boot/runner-deps.d.ts +28 -7
  97. package/dist/boot/runner-deps.js +11 -4
  98. package/dist/boot/runtime-caps.d.ts +2 -2
  99. package/dist/boot/runtime-caps.js +16 -2
  100. package/dist/boot/session-faces.d.ts +17 -7
  101. package/dist/boot/session-faces.js +122 -96
  102. package/dist/boot/shutdown.d.ts +5 -4
  103. package/dist/boot/shutdown.js +6 -4
  104. package/dist/boot/stage-01-config.d.ts +1 -1
  105. package/dist/boot/stage-01-config.js +14 -2
  106. package/dist/boot/stage-02-web-admin-pull.d.ts +2 -1
  107. package/dist/boot/stage-02-web-admin-pull.js +15 -8
  108. package/dist/boot/stage-03-store-backend.d.ts +4 -1
  109. package/dist/boot/stage-03-store-backend.js +4 -3
  110. package/dist/boot/stage-04-stores.d.ts +3 -1
  111. package/dist/boot/stage-04-stores.js +2 -2
  112. package/dist/boot/stage-05-execution-env.d.ts +9 -5
  113. package/dist/boot/stage-05-execution-env.js +5 -5
  114. package/dist/boot/stage-06-runners.d.ts +13 -15
  115. package/dist/boot/stage-06-runners.js +24 -18
  116. package/dist/boot/stage-07-capability-layer.d.ts +14 -11
  117. package/dist/boot/stage-07-capability-layer.js +9 -12
  118. package/dist/boot/stage-08-reapers.d.ts +14 -11
  119. package/dist/boot/stage-08-reapers.js +3 -3
  120. package/dist/boot/stage-09-leader.d.ts +16 -18
  121. package/dist/boot/stage-09-leader.js +12 -4
  122. package/dist/boot/stage-10-http-server.d.ts +16 -18
  123. package/dist/boot/stage-10-http-server.js +9 -5
  124. package/dist/boot/store-evidence.d.ts +20 -0
  125. package/dist/boot/store-evidence.js +13 -0
  126. package/dist/boot/stores.d.ts +12 -0
  127. package/dist/boot/stores.js +39 -17
  128. package/dist/boot/task-list-lane.d.ts +4 -4
  129. package/dist/boot/web-admin.d.ts +4 -2
  130. package/dist/boot/web-admin.js +58 -38
  131. package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
  132. package/dist/boot-reclaim.d.ts +3 -1
  133. package/dist/boot-reclaim.js +1 -1
  134. package/dist/brain.d.ts +7 -18
  135. package/dist/brain.js +5 -17
  136. package/dist/budget.js +6 -6
  137. package/dist/capabilities/center-plugins.d.ts +9 -1
  138. package/dist/capabilities/center-plugins.js +37 -11
  139. package/dist/capabilities/center-wiring.js +1 -1
  140. package/dist/capabilities/composite-members.d.ts +3 -2
  141. package/dist/capabilities/composite-members.js +3 -2
  142. package/dist/capabilities/execution-lane.d.ts +7 -7
  143. package/dist/capabilities/execution-lane.js +2 -2
  144. package/dist/capabilities/hands-lane.d.ts +1 -1
  145. package/dist/capabilities/repo-tools.d.ts +2 -0
  146. package/dist/capabilities/repo-tools.js +14 -12
  147. package/dist/capabilities/scenarios.d.ts +38 -33
  148. package/dist/capabilities/scenarios.js +24 -25
  149. package/dist/capabilities/settings-contract.d.ts +29 -0
  150. package/dist/capabilities/settings-contract.js +14 -0
  151. package/dist/capabilities/skills.d.ts +6 -6
  152. package/dist/capabilities/tool-defer.d.ts +1 -1
  153. package/dist/capability-facts.d.ts +69 -4
  154. package/dist/capability-facts.js +77 -5
  155. package/dist/card-void.d.ts +4 -4
  156. package/dist/card-void.js +1 -1
  157. package/dist/center-credential-renewer.d.ts +6 -2
  158. package/dist/center-credential-renewer.js +10 -5
  159. package/dist/config-catalog.d.ts +16 -1
  160. package/dist/config-catalog.js +68 -61
  161. package/dist/config-dir-trust.d.ts +37 -4
  162. package/dist/config-dir-trust.js +88 -44
  163. package/dist/config-invariants.d.ts +58 -4
  164. package/dist/config-invariants.js +104 -23
  165. package/dist/config-lkg.d.ts +24 -2
  166. package/dist/config-lkg.js +22 -9
  167. package/dist/config-provider.d.ts +9 -9
  168. package/dist/config-provider.js +25 -108
  169. package/dist/config-pull-failure.d.ts +50 -0
  170. package/dist/config-pull-failure.js +48 -0
  171. package/dist/config-types.d.ts +215 -202
  172. package/dist/config.d.ts +69 -14
  173. package/dist/config.js +188 -96
  174. package/dist/degenerate-instrument.js +1 -1
  175. package/dist/delegated-session-owner.d.ts +1 -1
  176. package/dist/deleted-session-ids.d.ts +3 -2
  177. package/dist/deploy-facts.js +3 -2
  178. package/dist/deployment-governance.d.ts +3 -3
  179. package/dist/deployment-shape.d.ts +51 -16
  180. package/dist/deployment-shape.js +31 -6
  181. package/dist/egress-redirect.d.ts +25 -7
  182. package/dist/egress-redirect.js +20 -2
  183. package/dist/elicitation.d.ts +6 -5
  184. package/dist/elicitation.js +23 -22
  185. package/dist/engine-identity.d.ts +28 -0
  186. package/dist/engine-identity.js +10 -0
  187. package/dist/entry-problems.d.ts +5 -7
  188. package/dist/entry-problems.js +1 -1
  189. package/dist/env-facts.d.ts +7 -5
  190. package/dist/env-facts.js +12 -7
  191. package/dist/env-witness.d.ts +7 -0
  192. package/dist/env-witness.js +16 -0
  193. package/dist/execution-config-root.d.ts +5 -5
  194. package/dist/execution-config-root.js +5 -5
  195. package/dist/execution-env-purpose.d.ts +14 -0
  196. package/dist/execution-env-purpose.js +29 -0
  197. package/dist/execution-lane-caps.d.ts +53 -103
  198. package/dist/execution-lane-caps.js +51 -83
  199. package/dist/execution-placement.d.ts +65 -9
  200. package/dist/execution-placement.js +58 -0
  201. package/dist/field-conflict.d.ts +7 -11
  202. package/dist/field-conflict.js +3 -3
  203. package/dist/file-history-capture.d.ts +3 -3
  204. package/dist/file-history-disclosure.d.ts +2 -2
  205. package/dist/file-history-disclosure.js +1 -0
  206. package/dist/fleet/drain-entry.d.ts +17 -10
  207. package/dist/fleet/drain-entry.js +1 -1
  208. package/dist/fleet/fleet-bus.d.ts +21 -3
  209. package/dist/fleet/fleet-bus.js +35 -25
  210. package/dist/fleet/fleet-reconciler.js +2 -2
  211. package/dist/fleet/serving-lease.js +6 -7
  212. package/dist/fleet-client.js +3 -3
  213. package/dist/fleet-lease.d.ts +0 -1
  214. package/dist/fleet-lease.js +4 -5
  215. package/dist/history-anchor.d.ts +42 -0
  216. package/dist/history-anchor.js +34 -0
  217. package/dist/hitl-delivery.d.ts +90 -0
  218. package/dist/hitl-delivery.js +98 -0
  219. package/dist/hooks/classic-stations.d.ts +8 -11
  220. package/dist/hooks/classic-stations.js +0 -7
  221. package/dist/hooks/command-spawn.d.ts +1 -4
  222. package/dist/hooks/command-spawn.js +0 -11
  223. package/dist/hooks/hook-llm.d.ts +5 -1
  224. package/dist/hooks/hook-llm.js +24 -15
  225. package/dist/hooks/hook-runner.d.ts +119 -65
  226. package/dist/hooks/hook-runner.js +415 -217
  227. package/dist/host-lsp-manager.d.ts +22 -8
  228. package/dist/host-lsp-manager.js +4 -1
  229. package/dist/http/active-run-conflict.d.ts +2 -43
  230. package/dist/http/active-run-conflict.js +3 -7
  231. package/dist/http/admission.d.ts +4 -18
  232. package/dist/http/admission.js +75 -78
  233. package/dist/http/approval-sweeps.d.ts +5 -8
  234. package/dist/http/approval-sweeps.js +55 -30
  235. package/dist/http/caller-trust.d.ts +8 -10
  236. package/dist/http/caller-trust.js +1 -2
  237. package/dist/http/checkpoint-ctx.d.ts +17 -0
  238. package/dist/http/checkpoint-ctx.js +6 -0
  239. package/dist/http/claim-heartbeat.d.ts +49 -0
  240. package/dist/http/claim-heartbeat.js +46 -0
  241. package/dist/http/claim-latency.d.ts +10 -0
  242. package/dist/http/claim-latency.js +12 -0
  243. package/dist/http/claimed-run.d.ts +4 -3
  244. package/dist/http/dispatch.d.ts +8 -1
  245. package/dist/http/dispatch.js +77 -31
  246. package/dist/http/durable-run-leg.d.ts +3 -3
  247. package/dist/http/durable-run-leg.js +18 -12
  248. package/dist/http/execution-context.d.ts +18 -42
  249. package/dist/http/execution-context.js +11 -5
  250. package/dist/http/health-reader.d.ts +36 -0
  251. package/dist/http/health-reader.js +21 -0
  252. package/dist/http/health-self-report.d.ts +9 -9
  253. package/dist/http/health-self-report.js +4 -4
  254. package/dist/http/idempotency.d.ts +9 -5
  255. package/dist/http/idempotency.js +4 -4
  256. package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
  257. package/dist/http/memory-compliance-failure-reply.js +7 -2
  258. package/dist/http/memory-face-fault-reply.d.ts +67 -0
  259. package/dist/http/memory-face-fault-reply.js +71 -0
  260. package/dist/http/memory-store-refusal-reply.d.ts +3 -3
  261. package/dist/http/memory-store-refusal-reply.js +6 -0
  262. package/dist/http/owner-access.d.ts +391 -56
  263. package/dist/http/owner-access.js +372 -33
  264. package/dist/http/principal-gate.d.ts +26 -94
  265. package/dist/http/principal-gate.js +24 -81
  266. package/dist/http/refusal-body.d.ts +35 -2
  267. package/dist/http/refusal-body.js +34 -0
  268. package/dist/http/request-guards.d.ts +10 -14
  269. package/dist/http/request-guards.js +34 -68
  270. package/dist/http/resume-composition.d.ts +37 -0
  271. package/dist/http/resume-composition.js +18 -0
  272. package/dist/http/resume-ctx-read.d.ts +35 -12
  273. package/dist/http/resume-ctx-read.js +25 -6
  274. package/dist/http/resume-legs.d.ts +24 -24
  275. package/dist/http/resume-legs.js +260 -171
  276. package/dist/http/retired-skill-manifest.d.ts +1 -1
  277. package/dist/http/rewind-files-reply.d.ts +34 -0
  278. package/dist/http/rewind-files-reply.js +36 -0
  279. package/dist/http/route-ctx.d.ts +56 -47
  280. package/dist/http/route-table.js +2 -0
  281. package/dist/http/routes/a2a-serve.d.ts +43 -5
  282. package/dist/http/routes/a2a-serve.js +58 -37
  283. package/dist/http/routes/admin-config-refresh.js +2 -2
  284. package/dist/http/routes/admin-drain.js +2 -2
  285. package/dist/http/routes/admin-memory-optout.js +4 -3
  286. package/dist/http/routes/adoption.d.ts +3 -0
  287. package/dist/http/routes/adoption.js +17 -10
  288. package/dist/http/routes/agents-roster.js +13 -7
  289. package/dist/http/routes/approvals-assistant.js +73 -88
  290. package/dist/http/routes/attachments.js +2 -2
  291. package/dist/http/routes/background.d.ts +3 -3
  292. package/dist/http/routes/background.js +9 -17
  293. package/dist/http/routes/capabilities.js +23 -20
  294. package/dist/http/routes/config-catalog.js +2 -2
  295. package/dist/http/routes/devices.d.ts +3 -3
  296. package/dist/http/routes/devices.js +5 -5
  297. package/dist/http/routes/diagnostics.d.ts +27 -3
  298. package/dist/http/routes/diagnostics.js +27 -21
  299. package/dist/http/routes/engine.js +2 -2
  300. package/dist/http/routes/fleet.js +5 -3
  301. package/dist/http/routes/images.js +10 -6
  302. package/dist/http/routes/leader.d.ts +7 -2
  303. package/dist/http/routes/leader.js +12 -3
  304. package/dist/http/routes/mcp-reconnect.d.ts +1 -1
  305. package/dist/http/routes/mcp-reconnect.js +7 -15
  306. package/dist/http/routes/memory-bundle.js +4 -7
  307. package/dist/http/routes/memory-compliance.js +4 -4
  308. package/dist/http/routes/memory-consolidation.js +6 -9
  309. package/dist/http/routes/memory-origin.d.ts +3 -1
  310. package/dist/http/routes/memory-origin.js +7 -8
  311. package/dist/http/routes/memory-policy.js +17 -12
  312. package/dist/http/routes/notify-wake.js +12 -20
  313. package/dist/http/routes/observability.js +3 -3
  314. package/dist/http/routes/principal-inbox.d.ts +1 -1
  315. package/dist/http/routes/principal-inbox.js +2 -2
  316. package/dist/http/routes/projects.d.ts +70 -0
  317. package/dist/http/routes/projects.js +87 -0
  318. package/dist/http/routes/retention-ops.js +6 -9
  319. package/dist/http/routes/rules.js +50 -7
  320. package/dist/http/routes/run-memory-capture.d.ts +2 -2
  321. package/dist/http/routes/run-memory-capture.js +6 -12
  322. package/dist/http/routes/run-permission-mode.d.ts +2 -2
  323. package/dist/http/routes/run-permission-mode.js +10 -17
  324. package/dist/http/routes/runs.js +148 -233
  325. package/dist/http/routes/session-memory-sync.d.ts +2 -2
  326. package/dist/http/routes/session-memory-sync.js +7 -13
  327. package/dist/http/routes/session-sync.d.ts +4 -2
  328. package/dist/http/routes/session-sync.js +48 -30
  329. package/dist/http/routes/sessions-list.d.ts +3 -3
  330. package/dist/http/routes/sessions-list.js +9 -9
  331. package/dist/http/routes/sessions.d.ts +7 -1
  332. package/dist/http/routes/sessions.js +177 -112
  333. package/dist/http/routes/shared-memory.js +6 -6
  334. package/dist/http/routes/side-query.js +2 -2
  335. package/dist/http/routes/tasks.js +144 -122
  336. package/dist/http/routes/trace-usage.d.ts +0 -12
  337. package/dist/http/routes/trace-usage.js +40 -46
  338. package/dist/http/routes/workflows.d.ts +39 -4
  339. package/dist/http/routes/workflows.js +42 -14
  340. package/dist/http/run-concurrency-cap.d.ts +20 -12
  341. package/dist/http/run-concurrency-cap.js +39 -26
  342. package/dist/http/run-read-face.d.ts +3 -5
  343. package/dist/http/run-read-face.js +8 -13
  344. package/dist/http/send.d.ts +12 -3
  345. package/dist/http/send.js +42 -6
  346. package/dist/http/server.d.ts +63 -50
  347. package/dist/http/server.js +52 -16
  348. package/dist/http/sse-log.d.ts +17 -10
  349. package/dist/http/sse-log.js +7 -7
  350. package/dist/http/stored-body-replay.d.ts +17 -3
  351. package/dist/http/stored-body-replay.js +11 -2
  352. package/dist/http/submit-ctx.d.ts +16 -8
  353. package/dist/http/submit-ctx.js +6 -2
  354. package/dist/http/submit-replay.d.ts +19 -6
  355. package/dist/http/submit-replay.js +18 -6
  356. package/dist/http/sync-submit-body.d.ts +3 -4
  357. package/dist/http/sync-submit-body.js +4 -5
  358. package/dist/http/wire-types.d.ts +23 -13
  359. package/dist/identity-source.d.ts +36 -5
  360. package/dist/identity-source.js +27 -0
  361. package/dist/index.d.ts +3 -2
  362. package/dist/index.js +2 -1
  363. package/dist/instruction-source-notice.d.ts +1 -1
  364. package/dist/key-resolver.d.ts +32 -0
  365. package/dist/key-resolver.js +23 -9
  366. package/dist/leader/diffup.js +2 -1
  367. package/dist/leader/endpoint.d.ts +26 -5
  368. package/dist/leader/endpoint.js +154 -14
  369. package/dist/leader/fanout.d.ts +3 -0
  370. package/dist/leader/fanout.js +78 -63
  371. package/dist/leader/leader.d.ts +16 -0
  372. package/dist/leader/leader.js +43 -3
  373. package/dist/leader/merge.d.ts +9 -1
  374. package/dist/leader/merge.js +16 -1
  375. package/dist/leader/repair-wire.js +1 -1
  376. package/dist/leader/wire.d.ts +36 -3
  377. package/dist/leader/wire.js +59 -18
  378. package/dist/lsp-evict.d.ts +6 -4
  379. package/dist/lsp-evict.js +2 -3
  380. package/dist/memory-embedder-reembed.d.ts +38 -0
  381. package/dist/memory-embedder-reembed.js +20 -0
  382. package/dist/memory-incident-sink.d.ts +0 -28
  383. package/dist/memory-incident-sink.js +5 -0
  384. package/dist/memory-operator-faces.d.ts +5 -4
  385. package/dist/memory-operator-faces.js +1 -1
  386. package/dist/memory-scope.d.ts +31 -4
  387. package/dist/memory-scope.js +65 -16
  388. package/dist/memory-store-refusal.d.ts +20 -4
  389. package/dist/memory-store-refusal.js +1 -1
  390. package/dist/memory-sync-client.d.ts +5 -2
  391. package/dist/memory-sync-client.js +19 -14
  392. package/dist/memory-sync.js +1 -1
  393. package/dist/model-compat.d.ts +51 -28
  394. package/dist/model-compat.js +55 -23
  395. package/dist/model-context-window.d.ts +18 -0
  396. package/dist/model-context-window.js +2 -0
  397. package/dist/model-entry-headers.d.ts +46 -4
  398. package/dist/model-entry-headers.js +2 -2
  399. package/dist/model-entry-refusal.d.ts +46 -17
  400. package/dist/model-entry-refusal.js +47 -27
  401. package/dist/model-plane-face.d.ts +19 -11
  402. package/dist/model-plane-face.js +9 -1
  403. package/dist/model-plane-probe.d.ts +2 -0
  404. package/dist/model-plane-probe.js +17 -0
  405. package/dist/model-provider.d.ts +3 -3
  406. package/dist/model-route-endpoint.d.ts +9 -5
  407. package/dist/model-route-endpoint.js +29 -7
  408. package/dist/model-select.d.ts +16 -0
  409. package/dist/model-select.js +4 -0
  410. package/dist/mountinfo.d.ts +37 -0
  411. package/dist/mountinfo.js +47 -0
  412. package/dist/namespaced-rule-name.d.ts +28 -2
  413. package/dist/namespaced-rule-name.js +10 -1
  414. package/dist/net-address.d.ts +1 -1
  415. package/dist/observability/corrupt-read-seat.d.ts +4 -4
  416. package/dist/observability/corrupt-read-seat.js +5 -3
  417. package/dist/observability/fail-open.d.ts +75 -47
  418. package/dist/observability/fail-open.js +77 -47
  419. package/dist/observability/logger.d.ts +22 -1
  420. package/dist/observability/logger.js +89 -12
  421. package/dist/observability/metrics.d.ts +2 -0
  422. package/dist/observability/metrics.js +5 -4
  423. package/dist/observability/otel-exporter.js +2 -1
  424. package/dist/observability/principal-context.d.ts +14 -7
  425. package/dist/observability/principal-context.js +8 -3
  426. package/dist/observability/run-terminal.d.ts +7 -1
  427. package/dist/observability/run-terminal.js +5 -2
  428. package/dist/observability/secret-env-scrub.d.ts +30 -4
  429. package/dist/observability/secret-env-scrub.js +15 -3
  430. package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
  431. package/dist/orchestration/hardened-vm-runner.js +11 -5
  432. package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
  433. package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
  434. package/dist/orchestration/hardened-vm-worker.js +2 -1
  435. package/dist/orchestration/workflow-agent-session-index.d.ts +7 -12
  436. package/dist/orchestration/workflow-agent-session-index.js +1 -6
  437. package/dist/orchestration/workflow-completion-inbox.d.ts +29 -9
  438. package/dist/orchestration/workflow-completion-inbox.js +65 -46
  439. package/dist/org-delivery-gate.d.ts +5 -4
  440. package/dist/org-delivery-gate.js +7 -6
  441. package/dist/org-memory-admission.d.ts +5 -2
  442. package/dist/org-memory-admission.js +25 -10
  443. package/dist/outbound-dispatcher.d.ts +1 -1
  444. package/dist/outbound-dispatcher.js +6 -12
  445. package/dist/owner-brands.d.ts +81 -0
  446. package/dist/owner-brands.js +42 -0
  447. package/dist/owner-faces.d.ts +531 -0
  448. package/dist/owner-faces.js +126 -0
  449. package/dist/parked-decide.d.ts +100 -31
  450. package/dist/parked-decide.js +162 -48
  451. package/dist/parked-revive-surface.d.ts +14 -4
  452. package/dist/parked-revive-surface.js +5 -4
  453. package/dist/peer-directory.d.ts +6 -8
  454. package/dist/peer-directory.js +3 -2
  455. package/dist/permission-rule-vocab.d.ts +53 -8
  456. package/dist/permission-rule-vocab.js +30 -2
  457. package/dist/plugins/adoption-log-sql.d.ts +0 -22
  458. package/dist/plugins/adoption-log-sql.js +5 -3
  459. package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
  460. package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
  461. package/dist/plugins/approval-ask-store-file.d.ts +28 -9
  462. package/dist/plugins/approval-ask-store-file.js +74 -18
  463. package/dist/plugins/approval-ask-store-memory.d.ts +17 -7
  464. package/dist/plugins/approval-ask-store-memory.js +35 -12
  465. package/dist/plugins/approval-ask-store-sql.d.ts +42 -20
  466. package/dist/plugins/approval-ask-store-sql.js +44 -11
  467. package/dist/plugins/approval-exemption-skill-m46.d.ts +20 -0
  468. package/dist/plugins/approval-exemption-skill-m46.js +25 -0
  469. package/dist/plugins/approval-exemption-store.d.ts +6 -1
  470. package/dist/plugins/approval-exemption-store.js +14 -0
  471. package/dist/plugins/approval-nonce-store.d.ts +39 -12
  472. package/dist/plugins/approval-nonce-store.js +72 -23
  473. package/dist/plugins/blob-backend.d.ts +40 -195
  474. package/dist/plugins/blob-backend.js +41 -234
  475. package/dist/plugins/caching-session-store.d.ts +22 -5
  476. package/dist/plugins/caching-session-store.js +43 -4
  477. package/dist/plugins/checkpoint-index-columns.d.ts +33 -6
  478. package/dist/plugins/checkpoint-index-columns.js +39 -3
  479. package/dist/plugins/checkpoint-store-face.d.ts +84 -11
  480. package/dist/plugins/checkpoint-store-face.js +18 -1
  481. package/dist/plugins/device-store-sql.d.ts +2 -2
  482. package/dist/plugins/device-store-sql.js +6 -10
  483. package/dist/plugins/ensure-index.d.ts +13 -1
  484. package/dist/plugins/ensure-index.js +154 -21
  485. package/dist/plugins/ensure-schema-lock-policy.d.ts +0 -15
  486. package/dist/plugins/ensure-schema-lock-policy.js +3 -2
  487. package/dist/plugins/execution-lane-rename-m40.d.ts +20 -0
  488. package/dist/plugins/execution-lane-rename-m40.js +10 -0
  489. package/dist/plugins/execution-placement-sql.d.ts +63 -88
  490. package/dist/plugins/execution-placement-sql.js +94 -54
  491. package/dist/plugins/file-run-store.d.ts +89 -35
  492. package/dist/plugins/file-run-store.js +197 -142
  493. package/dist/plugins/host-platform.d.ts +24 -3
  494. package/dist/plugins/host-platform.js +15 -1
  495. package/dist/plugins/image-bake-store-sql.js +2 -0
  496. package/dist/plugins/imported-layer-root-retirement.d.ts +19 -10
  497. package/dist/plugins/imported-layer-root-retirement.js +4 -8
  498. package/dist/plugins/inbox-payload-column.d.ts +14 -0
  499. package/dist/plugins/inbox-payload-column.js +13 -0
  500. package/dist/plugins/k8s-pod-reaper.d.ts +1 -3
  501. package/dist/plugins/k8s-pod-reaper.js +0 -1
  502. package/dist/plugins/leader-run-store-sql.d.ts +22 -0
  503. package/dist/plugins/leader-run-store-sql.js +34 -4
  504. package/dist/plugins/local-checkpoint-store.d.ts +63 -23
  505. package/dist/plugins/local-checkpoint-store.js +204 -81
  506. package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
  507. package/dist/plugins/local-data-dir-modes-m39.js +183 -0
  508. package/dist/plugins/local-docker-capacity.d.ts +93 -0
  509. package/dist/plugins/local-docker-capacity.js +194 -0
  510. package/dist/plugins/local-docker-reaper.d.ts +92 -0
  511. package/dist/plugins/local-docker-reaper.js +102 -0
  512. package/dist/plugins/local-engine-high-water.d.ts +13 -0
  513. package/dist/plugins/local-engine-high-water.js +62 -0
  514. package/dist/plugins/local-session-store.d.ts +442 -143
  515. package/dist/plugins/local-session-store.js +941 -289
  516. package/dist/plugins/local-session-window.d.ts +3 -2
  517. package/dist/plugins/local-session-window.js +3 -2
  518. package/dist/plugins/local-sidecar-quarantine.js +3 -2
  519. package/dist/plugins/local-task-attachment-store.d.ts +20 -1
  520. package/dist/plugins/local-task-attachment-store.js +32 -12
  521. package/dist/plugins/memory-embedder-fingerprint.d.ts +33 -10
  522. package/dist/plugins/memory-embedder-fingerprint.js +52 -12
  523. package/dist/plugins/memory-embedder.d.ts +1 -1
  524. package/dist/plugins/memory-embedder.js +11 -9
  525. package/dist/plugins/memory-engine-pg.d.ts +7 -5
  526. package/dist/plugins/memory-engine-pg.js +18 -9
  527. package/dist/plugins/memory-engine-sql-apply.d.ts +21 -8
  528. package/dist/plugins/memory-engine-sql-apply.js +7 -9
  529. package/dist/plugins/memory-engine-tidb.d.ts +12 -7
  530. package/dist/plugins/memory-engine-tidb.js +18 -10
  531. package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
  532. package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
  533. package/dist/plugins/memory-run-store.d.ts +39 -27
  534. package/dist/plugins/memory-run-store.js +72 -70
  535. package/dist/plugins/one-time-migration-marker.d.ts +10 -0
  536. package/dist/plugins/one-time-migration-marker.js +7 -0
  537. package/dist/plugins/one-time-migrations.d.ts +325 -74
  538. package/dist/plugins/one-time-migrations.js +705 -230
  539. package/dist/plugins/org-delivery-quota-store.js +2 -1
  540. package/dist/plugins/owner-only-file-mode.d.ts +29 -0
  541. package/dist/plugins/owner-only-file-mode.js +141 -0
  542. package/dist/plugins/permission-rule-store-file.d.ts +11 -11
  543. package/dist/plugins/permission-rule-store-file.js +14 -2
  544. package/dist/plugins/permission-rule-store-sql.d.ts +4 -63
  545. package/dist/plugins/permission-rule-store-sql.js +6 -86
  546. package/dist/plugins/pg-pool.d.ts +3 -32
  547. package/dist/plugins/pg-pool.js +27 -11
  548. package/dist/plugins/release-version.d.ts +20 -0
  549. package/dist/plugins/release-version.js +28 -0
  550. package/dist/plugins/remote-env-adb.d.ts +20 -4
  551. package/dist/plugins/remote-env-adb.js +39 -11
  552. package/dist/plugins/remote-env-e2b.d.ts +19 -28
  553. package/dist/plugins/remote-env-e2b.js +40 -29
  554. package/dist/plugins/remote-env-host.d.ts +11 -10
  555. package/dist/plugins/remote-env-host.js +40 -27
  556. package/dist/plugins/remote-env-k8s.d.ts +45 -47
  557. package/dist/plugins/remote-env-k8s.js +122 -62
  558. package/dist/plugins/remote-env-local-docker.d.ts +152 -15
  559. package/dist/plugins/remote-env-local-docker.js +370 -75
  560. package/dist/plugins/remote-env-ssh.d.ts +8 -2
  561. package/dist/plugins/remote-env-ssh.js +26 -24
  562. package/dist/plugins/remote-scratchpad.js +4 -0
  563. package/dist/plugins/remote-shell.d.ts +59 -30
  564. package/dist/plugins/remote-shell.js +175 -62
  565. package/dist/plugins/retention-declaration.d.ts +37 -0
  566. package/dist/plugins/retention-declaration.js +9 -0
  567. package/dist/plugins/retention-deployment.d.ts +158 -0
  568. package/dist/plugins/retention-deployment.js +119 -0
  569. package/dist/plugins/retention-lane-store-sql.d.ts +74 -4
  570. package/dist/plugins/retention-lane-store-sql.js +103 -1
  571. package/dist/plugins/retention-sql.d.ts +29 -0
  572. package/dist/plugins/retention-sql.js +8 -0
  573. package/dist/plugins/run-preview-m45.d.ts +11 -0
  574. package/dist/plugins/run-preview-m45.js +19 -0
  575. package/dist/plugins/run-store-sql.d.ts +56 -68
  576. package/dist/plugins/run-store-sql.js +127 -116
  577. package/dist/plugins/s3-answer.d.ts +2 -1
  578. package/dist/plugins/sandbox-reaper.d.ts +26 -0
  579. package/dist/plugins/sandbox-reaper.js +2 -0
  580. package/dist/plugins/scenario-prefix-switch-m42.d.ts +54 -0
  581. package/dist/plugins/scenario-prefix-switch-m42.js +55 -0
  582. package/dist/plugins/scheduler-support.d.ts +16 -1
  583. package/dist/plugins/scheduler-support.js +22 -2
  584. package/dist/plugins/schema-consistency.d.ts +42 -15
  585. package/dist/plugins/schema-consistency.js +213 -13
  586. package/dist/plugins/schema-drift-sentence.d.ts +4 -1
  587. package/dist/plugins/schema-drift-sentence.js +4 -4
  588. package/dist/plugins/schema-ensure-legs.d.ts +10 -1
  589. package/dist/plugins/schema-ensure-legs.js +12 -2
  590. package/dist/plugins/schema-indexes.js +3 -0
  591. package/dist/plugins/schema-live-columns.d.ts +14 -5
  592. package/dist/plugins/schema-live-columns.js +10 -10
  593. package/dist/plugins/send-user-file.js +2 -1
  594. package/dist/plugins/session-birth.d.ts +37 -0
  595. package/dist/plugins/session-birth.js +38 -0
  596. package/dist/plugins/session-epoch-anchor.d.ts +40 -12
  597. package/dist/plugins/session-epoch-anchor.js +33 -11
  598. package/dist/plugins/session-ext-table.d.ts +98 -0
  599. package/dist/plugins/session-ext-table.js +134 -0
  600. package/dist/plugins/session-fork.d.ts +16 -2
  601. package/dist/plugins/session-fork.js +3 -0
  602. package/dist/plugins/session-ownership.d.ts +1 -1
  603. package/dist/plugins/session-placement.d.ts +22 -16
  604. package/dist/plugins/session-placement.js +15 -12
  605. package/dist/plugins/session-row-sql.d.ts +20 -7
  606. package/dist/plugins/session-row-sql.js +16 -8
  607. package/dist/plugins/session-run-rollup.d.ts +29 -0
  608. package/dist/plugins/session-run-rollup.js +40 -0
  609. package/dist/plugins/session-store-sql.d.ts +157 -0
  610. package/dist/plugins/session-store-sql.js +398 -0
  611. package/dist/plugins/session-withdraw-sql.d.ts +36 -0
  612. package/dist/plugins/session-withdraw-sql.js +42 -0
  613. package/dist/plugins/session-workspace-cell.d.ts +2 -2
  614. package/dist/plugins/session-workspace-cell.js +2 -2
  615. package/dist/plugins/shared-memory-store-sql.d.ts +10 -69
  616. package/dist/plugins/shared-memory-store-sql.js +15 -14
  617. package/dist/plugins/shell-sentinel-owner-m48.d.ts +20 -0
  618. package/dist/plugins/shell-sentinel-owner-m48.js +3 -0
  619. package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
  620. package/dist/plugins/snapshot-bucket-presence.js +1 -1
  621. package/dist/plugins/sql-driver.d.ts +24 -8
  622. package/dist/plugins/sql-driver.js +43 -9
  623. package/dist/plugins/sql-errors.d.ts +35 -5
  624. package/dist/plugins/sql-errors.js +55 -3
  625. package/dist/plugins/sql-json-column.d.ts +8 -7
  626. package/dist/plugins/sql-json-column.js +10 -6
  627. package/dist/plugins/store-backend.d.ts +114 -18
  628. package/dist/plugins/store-backend.js +340 -87
  629. package/dist/plugins/store-contracts.d.ts +97 -30
  630. package/dist/plugins/store-contracts.js +23 -1
  631. package/dist/plugins/store-fault.d.ts +28 -2
  632. package/dist/plugins/store-fault.js +20 -2
  633. package/dist/plugins/task-attachment-store.d.ts +21 -11
  634. package/dist/plugins/task-attachment-store.js +37 -19
  635. package/dist/plugins/task-list-store-sql.d.ts +1 -1
  636. package/dist/plugins/text-column-capacity.d.ts +21 -0
  637. package/dist/plugins/text-column-capacity.js +5 -0
  638. package/dist/plugins/tidb-pool.d.ts +3 -2
  639. package/dist/plugins/tidb-pool.js +42 -39
  640. package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
  641. package/dist/plugins/web-search.js +5 -3
  642. package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
  643. package/dist/plugins/workflow-run-store-sql.js +11 -5
  644. package/dist/principal-jwt.d.ts +4 -4
  645. package/dist/principal-jwt.js +20 -5
  646. package/dist/principal-shape.d.ts +41 -0
  647. package/dist/principal-shape.js +19 -0
  648. package/dist/question.d.ts +13 -23
  649. package/dist/question.js +21 -39
  650. package/dist/read-face-posture.d.ts +6 -6
  651. package/dist/read-face-posture.js +2 -2
  652. package/dist/request-declaration-refusal.d.ts +35 -12
  653. package/dist/request-declaration-refusal.js +21 -9
  654. package/dist/request-form.d.ts +58 -0
  655. package/dist/request-form.js +72 -0
  656. package/dist/request-image-urls.d.ts +8 -2
  657. package/dist/request-image-urls.js +2 -1
  658. package/dist/request-images.d.ts +20 -0
  659. package/dist/request-images.js +59 -0
  660. package/dist/request-key-closure.d.ts +6 -7
  661. package/dist/request-key-closure.js +15 -2
  662. package/dist/request-value-closure.d.ts +5 -5
  663. package/dist/request-value-closure.js +1 -1
  664. package/dist/resource-suspend.d.ts +7 -16
  665. package/dist/resource-suspend.js +1 -1
  666. package/dist/retired-name-host-notice.d.ts +21 -0
  667. package/dist/retired-name-host-notice.js +12 -0
  668. package/dist/rule-entry-list.d.ts +2 -2
  669. package/dist/rule-entry-list.js +3 -4
  670. package/dist/rule-issue-reading.d.ts +58 -0
  671. package/dist/rule-issue-reading.js +14 -0
  672. package/dist/rules-consent.d.ts +46 -16
  673. package/dist/rules-consent.js +102 -53
  674. package/dist/run-acceptance.d.ts +3 -1
  675. package/dist/run-acceptance.js +3 -0
  676. package/dist/run-local.d.ts +14 -6
  677. package/dist/run-local.js +109 -93
  678. package/dist/run-stale-default.d.ts +7 -0
  679. package/dist/run-stale-default.js +2 -0
  680. package/dist/runs.d.ts +73 -44
  681. package/dist/runs.js +65 -43
  682. package/dist/runtime-caps-resolver.d.ts +36 -14
  683. package/dist/runtime-caps-resolver.js +31 -14
  684. package/dist/runtime-governance.d.ts +2 -2
  685. package/dist/runtime-governance.js +5 -3
  686. package/dist/sealed-key-layout.d.ts +12 -6
  687. package/dist/sealed-key-layout.js +5 -1
  688. package/dist/sealed-key.d.ts +12 -2
  689. package/dist/sealed-key.js +116 -26
  690. package/dist/security.d.ts +133 -161
  691. package/dist/security.js +163 -59
  692. package/dist/sema-config-dir.d.ts +20 -0
  693. package/dist/sema-config-dir.js +27 -2
  694. package/dist/server-secret-env.d.ts +23 -5
  695. package/dist/server-secret-env.js +14 -4
  696. package/dist/service-version.d.ts +2 -1
  697. package/dist/service-version.js +2 -2
  698. package/dist/session-children-retire.d.ts +7 -5
  699. package/dist/session-children-retire.js +7 -2
  700. package/dist/session-deletion.d.ts +88 -0
  701. package/dist/session-deletion.js +8 -0
  702. package/dist/session-erase.d.ts +145 -0
  703. package/dist/session-erase.js +115 -0
  704. package/dist/session-error-wire.d.ts +6 -6
  705. package/dist/session-error-wire.js +1 -1
  706. package/dist/session-incarnation.d.ts +60 -10
  707. package/dist/session-incarnation.js +19 -2
  708. package/dist/session-policy-wire.d.ts +6 -3
  709. package/dist/session-policy-wire.js +11 -1
  710. package/dist/session-resident-background.d.ts +29 -47
  711. package/dist/session-resident-background.js +77 -8
  712. package/dist/session-row.d.ts +3 -2
  713. package/dist/session-rules-seat.d.ts +12 -0
  714. package/dist/session-rules-seat.js +19 -0
  715. package/dist/session-sync-kernel.d.ts +1 -1
  716. package/dist/session-titler.d.ts +7 -15
  717. package/dist/session-titler.js +1 -1
  718. package/dist/session-workspace.d.ts +11 -2
  719. package/dist/session-workspace.js +5 -0
  720. package/dist/sighup-idle.d.ts +1 -1
  721. package/dist/spec-fields.d.ts +57 -3
  722. package/dist/spec-fields.js +72 -51
  723. package/dist/store-posture.d.ts +138 -21
  724. package/dist/store-posture.js +188 -3
  725. package/dist/stored-request-hooks-m20.d.ts +3 -2
  726. package/dist/stored-request-hooks-m20.js +21 -16
  727. package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
  728. package/dist/stores-sql/background-agent-store-sql.js +73 -20
  729. package/dist/stores-sql/blob-index-sql.d.ts +148 -0
  730. package/dist/stores-sql/blob-index-sql.js +154 -0
  731. package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
  732. package/dist/stores-sql/checkpoint-store-sql.js +86 -71
  733. package/dist/{plugins → stores-sql}/file-history-store-sql.d.ts +23 -11
  734. package/dist/{plugins → stores-sql}/file-history-store-sql.js +23 -18
  735. package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
  736. package/dist/stores-sql/mailbox-store-sql.js +31 -32
  737. package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +30 -81
  738. package/dist/{plugins → stores-sql}/pg-session-storage.js +123 -244
  739. package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +197 -223
  740. package/dist/{plugins → stores-sql}/retention-store-sql.js +148 -207
  741. package/dist/{plugins → stores-sql}/session-event-payload.d.ts +1 -1
  742. package/dist/{plugins → stores-sql}/session-event-payload.js +1 -1
  743. package/dist/stores-sql/session-policy-store-sql.d.ts +33 -11
  744. package/dist/stores-sql/session-policy-store-sql.js +44 -36
  745. package/dist/stores-sql/session-write-hooks.d.ts +65 -0
  746. package/dist/stores-sql/session-write-hooks.js +2 -0
  747. package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +14 -15
  748. package/dist/{plugins → stores-sql}/tidb-session-storage.js +22 -28
  749. package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +67 -138
  750. package/dist/{plugins → stores-sql}/tidb-session-store.js +130 -200
  751. package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
  752. package/dist/stores-sql/tool-result-store-sql.js +1 -1
  753. package/dist/stores-sql/windowed-session-storage.d.ts +61 -0
  754. package/dist/stores-sql/windowed-session-storage.js +70 -0
  755. package/dist/submission-exit.d.ts +50 -0
  756. package/dist/submission-exit.js +108 -0
  757. package/dist/task-a2a.d.ts +7 -1
  758. package/dist/task-a2a.js +18 -17
  759. package/dist/task-cwd.d.ts +31 -3
  760. package/dist/task-cwd.js +25 -1
  761. package/dist/task-mcp.d.ts +11 -3
  762. package/dist/task-mcp.js +16 -19
  763. package/dist/task-settings.d.ts +23 -14
  764. package/dist/task-settings.js +35 -13
  765. package/dist/terminal.d.ts +25 -43
  766. package/dist/terminal.js +31 -11
  767. package/dist/tool-approval.d.ts +152 -137
  768. package/dist/tool-approval.js +199 -199
  769. package/dist/trace/core-keyset-guard.d.ts +22 -9
  770. package/dist/trace/core-vocab-wire.d.ts +95 -0
  771. package/dist/trace/core-vocab-wire.js +15 -0
  772. package/dist/trace/engine-notice-wire.d.ts +1 -1
  773. package/dist/trace/engine-notice-wire.js +2 -0
  774. package/dist/trace/exit-seat.d.ts +52 -4
  775. package/dist/trace/exit-seat.js +43 -36
  776. package/dist/trace/extension-call-face.d.ts +3 -2
  777. package/dist/trace/extension-call-face.js +3 -1
  778. package/dist/trace/ledger-events.d.ts +4 -7
  779. package/dist/trace/ledger-sink.d.ts +1 -30
  780. package/dist/trace/ledger-sink.js +0 -11
  781. package/dist/trace/model-segment.d.ts +5 -5
  782. package/dist/trace/model-segment.js +5 -5
  783. package/dist/trace/project.d.ts +88 -58
  784. package/dist/trace/project.js +64 -28
  785. package/dist/trace/redact.d.ts +124 -28
  786. package/dist/trace/redact.js +936 -328
  787. package/dist/trace/self-minted-wire.d.ts +750 -29
  788. package/dist/trace/self-minted-wire.js +262 -25
  789. package/dist/trace/sema-provenance.d.ts +45 -41
  790. package/dist/trace/sema-provenance.js +81 -10
  791. package/dist/trace/task-notification-facets.d.ts +70 -2
  792. package/dist/trace/task-notification-facets.js +71 -1
  793. package/dist/trace/wire-projection-faces.d.ts +43 -8
  794. package/dist/trace/wire-projection-faces.js +28 -3
  795. package/dist/unread-request-members.d.ts +66 -0
  796. package/dist/unread-request-members.js +41 -0
  797. package/dist/upstream-body.d.ts +23 -0
  798. package/dist/upstream-body.js +16 -0
  799. package/dist/url-refusal.d.ts +3 -3
  800. package/dist/url-refusal.js +11 -4
  801. package/dist/user-authored-text.d.ts +1 -1
  802. package/dist/user-input-ledger.d.ts +7 -8
  803. package/dist/user-input-ledger.js +1 -1
  804. package/dist/web-admin-client/apply-effective.d.ts +6 -3
  805. package/dist/web-admin-client/apply-effective.js +33 -40
  806. package/dist/web-admin-client/apply-ledger.d.ts +16 -7
  807. package/dist/web-admin-client/apply-ledger.js +5 -2
  808. package/dist/web-admin-client/candidate-gate.d.ts +35 -3
  809. package/dist/web-admin-client/candidate-gate.js +53 -5
  810. package/dist/web-admin-client/center-request.d.ts +6 -3
  811. package/dist/web-admin-client/center-request.js +17 -16
  812. package/dist/web-admin-client/effective-keys.d.ts +1 -1
  813. package/dist/web-admin-client/effective-keys.js +1 -2
  814. package/dist/web-admin-client/entry-metadata.d.ts +8 -0
  815. package/dist/web-admin-client/entry-metadata.js +13 -0
  816. package/dist/web-admin-client/facade.d.ts +1 -1
  817. package/dist/web-admin-client/http-client.d.ts +2 -1
  818. package/dist/web-admin-client/http-client.js +40 -13
  819. package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
  820. package/dist/web-admin-client/mcp-revocation.js +2 -1
  821. package/dist/web-admin-client/read-warnings.d.ts +1 -0
  822. package/dist/web-admin-client/read-warnings.js +1 -0
  823. package/dist/web-admin-client/restart-signal.js +13 -6
  824. package/dist/web-admin-client/skills-mcp.d.ts +22 -8
  825. package/dist/web-admin-client/skills-mcp.js +26 -21
  826. package/dist/web-admin-client/types.d.ts +35 -51
  827. package/dist/workspace-space.d.ts +3 -2
  828. package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
  829. package/package.json +16 -12
  830. package/scripts/drain-check-local.mjs +118 -173
  831. package/scripts/drain-check.mysql.sql +20 -16
  832. package/scripts/drain-check.pg.sql +20 -16
  833. package/wire-changes/server@7.147.0.json +813 -0
  834. package/wire-changes/server@7.148.0.json +1517 -0
  835. package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
  836. package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
  837. package/dist/http/memory-layer-reply.d.ts +0 -30
  838. package/dist/http/memory-layer-reply.js +0 -24
  839. package/dist/lsp/e2b-bridge.d.ts +0 -57
  840. package/dist/lsp/e2b-bridge.js +0 -139
  841. package/dist/lsp/e2b-manager.d.ts +0 -93
  842. package/dist/lsp/e2b-manager.js +0 -178
  843. package/dist/lsp/lsp-frames.d.ts +0 -14
  844. package/dist/lsp/lsp-frames.js +0 -25
  845. package/dist/lsp/manager.d.ts +0 -129
  846. package/dist/lsp/manager.js +0 -127
  847. package/dist/lsp/types.d.ts +0 -12
  848. package/dist/lsp/types.js +0 -2
  849. package/dist/lsp/ws-transport.d.ts +0 -40
  850. package/dist/lsp/ws-transport.js +0 -210
@@ -18,12 +18,10 @@ export declare function buildFatalErrorText(err: unknown): string;
18
18
  * ── 修 ─────────────────────────────────────────────────────────────────────────────────────────
19
19
  * **同一只产物**再原样多行写一份到 stderr。刻意不做的三件:不铸第二份文案(两份措辞必然分叉)、不加
20
20
  * pretty 旋钮(一个只有出错时才走的出口不该有配置面)、JSON 行**照旧**(机读面零回退,scraper 不动)。
21
- * 两个面都在 stderr,次序=先机器行后人读段。**这个次序还承重**:`createLogger()` 的构造会装上 stdio 的
22
- * EPIPE 无害化监听(见 `observability/logger.ts` 那段注 —— 宿主把 stderr 接管道又先退时,下一次写会发一个
23
- * 异步 `'error'`,无监听即致命),所以那条裸 `process.stderr.write` **必须**排在它之后;同步抛由下面的
24
- * `try/finally` 兜住。
21
+ * 两个面都在 stderr,次序=先机器行后人读段;两个面都经日志出口接缝(`observability/logger.ts`:同一只秘密形筛、同一只
22
+ * 物理写,EPIPE 无害化监听由接缝在每次写之前装好),同步抛由下面的 `try/finally` 兜住。
25
23
  *
26
- * 全仓两个 fatal 出口(`main.ts` 的 `main().catch` 与 `run-local.ts` 的同名尾巴)都经这里 —— 后者此前
24
+ * 全仓三个 fatal 出口(`main.ts` 的 `main().catch`、起服前探针 `model-plane-probe.ts` 的同名尾巴与 `run-local.ts` 的那一只)都经这里 —— run-local 此前
27
25
  * 连形状律都没过(裸 `String(err)`),两处各写一遍正是「同类不同命」的土壤。
28
26
  */
29
27
  export declare function fatalExit(err: unknown): never;
@@ -1,5 +1,5 @@
1
1
  import { redactSecrets } from "../trace/redact.js";
2
- import { createLogger } from "../observability/logger.js";
2
+ import { createLogger, writeLogText } from "../observability/logger.js";
3
3
  export function buildFatalErrorText(err) {
4
4
  const code = err instanceof Error ? err.code : undefined;
5
5
  return redactSecrets(typeof code === "string" && err instanceof Error ? `${err.name} [${code}]: ${err.message}` : String(err));
@@ -8,7 +8,7 @@ export function fatalExit(err) {
8
8
  const text = buildFatalErrorText(err);
9
9
  try {
10
10
  createLogger().error("fatal", { err: text });
11
- process.stderr.write(text + "\n");
11
+ writeLogText("stderr", text);
12
12
  }
13
13
  finally {
14
14
  process.exit(1);
@@ -48,7 +48,7 @@
48
48
  *
49
49
  * ## 件D 的边界(成文,别读成「数据会被删」)
50
50
  *
51
- * 三只被托管的 SQL 店(session / checkpoint / tool-result)的 `retention` 声明读一个事实 —— 留存扫车道开不开(`plugins/retention-store-sql.ts` 的
51
+ * 三只被托管的 SQL 店(session / checkpoint / tool-result)的 `retention` 声明读一个事实 —— 留存扫车道开不开(`plugins/retention-declaration.ts` 的
52
52
  * `retentionSweepRuns`):开 ⇒ `managed`,关(缺省)⇒ `none`;local 形的店恒声明 `none`。删除的执行面是扫车道(`boot/retention-lane.ts`)与 SQL 店上的
53
53
  * 执行器,不在本装配点。所以本装配点对件D 只做两件事:①把策略与执行器递给 core 的启动期校验
54
54
  * (`assertRetentionCapability` —— 配对由引擎一个判官判:店声明 `managed` 而部署不跑执行器、执行器不是执行器,锁不锁都拒;锁着 + 店不能删 ⇒ 拒启,
@@ -83,7 +83,7 @@ export interface GovernanceSeamsCtx {
83
83
  /**
84
84
  * 交给引擎启动检查的留存执行器 —— 本部署跑扫车道 ⇒ 那只执行器(`backend.retention`),不跑 ⇒ `null`(必填:漏递即编译红,
85
85
  * 引擎对 `undefined` 也拒启)。「店说 managed」与「有执行器」的配对由引擎一个判官判(引擎 7.58.0:锁不锁都判);
86
- * 店的词与这一格读同一个事实(`retention-store-sql.ts` 的 `retentionSweepRuns`),本仓不再另判一遍。
86
+ * 店的词与这一格读同一个事实(`retention-declaration.ts` 的 `retentionSweepRuns`),本仓不再另判一遍。
87
87
  */
88
88
  retentionExecutor: ManagedRetentionCapability | null;
89
89
  }
@@ -81,5 +81,20 @@ export declare function leaderK8sMinioGap(leaderEnabled: boolean, leaderProvider
81
81
  * 而承担的方式是重复的真实推送。
82
82
  */
83
83
  export declare function assertLeaderDurableStore(leaderEnabled: boolean, hasLeaderRunStore: boolean): void;
84
+ /**
85
+ * leader 的对象存储座(F2(a) 工厂模式的 diff-out:worker 自传补丁到 `<桶>/leader-diff/…`,leader 用同桶的 presigned GET 取回)。纯数据:三键齐(`MINIO_ENDPOINT` /
86
+ * `MINIO_ACCESS_KEY` / `MINIO_SECRET_KEY`)⇒ `{ s3 }`,否则 `{}`(静态兼容模式;k8s 车道要它)。
87
+ * 桶 = `MINIO_BUCKET`,缺席 = 工作区快照桶的**缺省名**(`WORKSPACE_SNAPSHOT_BUCKET_DEFAULT`,同一只常量)。两根旋钮各自独立:改了 `WORKSPACE_SNAPSHOT_BUCKET` 的部署,
88
+ * leader 的补丁仍落 `MINIO_BUCKET` 那一只 —— 要同桶就两根同设(目录两行写明)。
89
+ */
90
+ export declare function buildLeaderObjectStore(env?: NodeJS.ProcessEnv): {
91
+ readonly s3?: {
92
+ endpoint: string;
93
+ bucket: string;
94
+ accessKey: string;
95
+ secretKey: string;
96
+ region?: string;
97
+ };
98
+ };
84
99
  export declare function createLeaderFace(ctx: LeaderCtx): ReturnType<typeof createLeaderEndpoint> | undefined;
85
100
  //# sourceMappingURL=leader.d.ts.map
@@ -1,8 +1,10 @@
1
1
  import { createLeaderEndpoint } from "../leader/endpoint.js";
2
- import { createLeaderRunVisibility } from "../http/owner-access.js";
3
- import { createLeaderRunner } from "../leader/wire.js";
4
- import { buildDeploymentPostureSeats } from "./runner-deps.js";
2
+ import { seesRunAs } from "../http/owner-access.js";
3
+ import { claimCallerOf } from "../security.js";
4
+ import { createLeaderParkExpirer, createLeaderRunner } from "../leader/wire.js";
5
+ import { buildDeploymentPostureSeats, buildHandsBand } from "./runner-deps.js";
5
6
  import { hasApprovalListIntent } from "../approval.js";
7
+ import { WORKSPACE_SNAPSHOT_BUCKET_DEFAULT } from "../object-store-buckets.js";
6
8
  export function leaderK8sMinioGap(leaderEnabled, leaderProvider, hasS3) {
7
9
  if (!(leaderEnabled && leaderProvider === "k8s" && !hasS3))
8
10
  return null;
@@ -21,20 +23,18 @@ export function assertLeaderDurableStore(leaderEnabled, hasLeaderRunStore) {
21
23
  "without it a retry starts a SECOND real git push. Fix the database (or unset LEADER_ENABLED) and restart " +
22
24
  "(#193 车4 件2 capability gate; the DB_BACKEND literal check in config.ts is the intent half of the same rule)");
23
25
  }
26
+ export function buildLeaderObjectStore(env = process.env) {
27
+ const endpoint = env.MINIO_ENDPOINT;
28
+ const accessKey = env.MINIO_ACCESS_KEY;
29
+ const secretKey = env.MINIO_SECRET_KEY;
30
+ if (!endpoint || !accessKey || !secretKey)
31
+ return {};
32
+ return { s3: { endpoint, bucket: env.MINIO_BUCKET ?? WORKSPACE_SNAPSHOT_BUCKET_DEFAULT, accessKey, secretKey, ...(env.MINIO_REGION ? { region: env.MINIO_REGION } : {}) } };
33
+ }
24
34
  export function createLeaderFace(ctx) {
25
35
  const { config, logger, brain, pricing, executionEnvFactory, toolResultStore, sessionStore, checkpointStore, checkpointCtxSealing, governanceSeams } = ctx;
26
- const leaderMinio = process.env.MINIO_ENDPOINT && process.env.MINIO_ACCESS_KEY && process.env.MINIO_SECRET_KEY
27
- ? {
28
- s3: {
29
- endpoint: process.env.MINIO_ENDPOINT,
30
- bucket: process.env.MINIO_BUCKET ?? "workspaces",
31
- accessKey: process.env.MINIO_ACCESS_KEY,
32
- secretKey: process.env.MINIO_SECRET_KEY,
33
- ...(process.env.MINIO_REGION ? { region: process.env.MINIO_REGION } : {}),
34
- },
35
- }
36
- : {};
37
- const leaderProvider = config.remoteExec?.provider;
36
+ const leaderMinio = buildLeaderObjectStore();
37
+ const leaderProvider = config.remoteExec.provider;
38
38
  const leaderRunStore = ctx.backend?.leaderRun?.();
39
39
  assertLeaderDurableStore(config.leaderEnabled, leaderRunStore !== undefined);
40
40
  const minioGap = leaderK8sMinioGap(config.leaderEnabled, leaderProvider, "s3" in leaderMinio);
@@ -60,6 +60,7 @@ export function createLeaderFace(ctx) {
60
60
  ...(ctx.promptSource ? { promptSource: ctx.promptSource } : {}),
61
61
  ...(ctx.onError ? { onError: ctx.onError } : {}),
62
62
  mods: ctx.deploymentMods,
63
+ hands: buildHandsBand(config, undefined),
63
64
  fanoutEnabled: config.leaderFanoutEnabled,
64
65
  ...(process.env.MODEL_ROUTER_ID ? { routerModel: process.env.MODEL_ROUTER_ID } : {}),
65
66
  ...(leaderProvider === "e2b" ? { e2bApiKey: config.remoteExec.apiKey } : {}),
@@ -87,7 +88,8 @@ export function createLeaderFace(ctx) {
87
88
  logger,
88
89
  requiredFields: ["objective", "durableRemote", "testCmd", "seedCmd", "baseSha"],
89
90
  ...(leaderRunStore ? { store: leaderRunStore } : {}),
90
- ownerVisible: createLeaderRunVisibility(config),
91
+ ownerVisible: (subject, owner) => seesRunAs("run.leader", claimCallerOf(subject ?? undefined, config), owner ?? null),
92
+ ...(checkpointStore ? { expireWorkerParks: createLeaderParkExpirer(checkpointStore) } : {}),
91
93
  })
92
94
  : undefined;
93
95
  if (leaderEndpoint)
@@ -14,9 +14,9 @@
14
14
  * 这条链**结构上**走不通」——那句必须说出来。围栏根算不出来时**不说话**(判不了就闭嘴,别把猜测当告警)。
15
15
  *
16
16
  * 🔴 **已登记的判据限度(不在本批射程,别把它读成「判据已闭合」)**:② 号 warn 今天唯一算得出围栏根的
17
- * 腿是 `REMOTE_EXEC` 未设的 in-process 形(`boot/stores.ts` 的 `containmentRoots`),而**恰恰是这条腿
17
+ * 腿是无手的 `none` 形(`boot/stores.ts` 的 `containmentRoots`),而**恰恰是这条腿
18
18
  * 没有文件工具** —— 亲读装的这台 core:`prepare-execution-env.js` 的
19
- * `handsEnabled = ownedEnv !== undefined || deps.executionEnv !== undefined`,本仓不设 `REMOTE_EXEC` 时
19
+ * `handsEnabled = ownedEnv !== undefined || deps.executionEnv !== undefined`,`REMOTE_EXEC=none` 时
20
20
  * `executionEnvFactory` 恒 `undefined` ⇒ `handsEnabled=false` ⇒ `prepareHandsMount` 整个不跑。所以这条
21
21
  * warn 描述的失败形(「模型照提示词去 Write,拿回 `path_not_in_root`」)在该腿上并不成立:真相是**一只
22
22
  * 文件工具都没有**,而按它给的第一条恢复路径(把根挪进 workspace)会让 warn 闭嘴却仍然写不成。
@@ -54,7 +54,7 @@
54
54
  * `TaskSpec.memoryPersistenceCapable` 一条路进去(`boot/resolve-spec.ts` 直通),我方显式**不铸**受限会话、
55
55
  * 也**不投**这个读面(硬造一个消费点 = 造给自己看的 wire 键)。哪天真要在诊断面露它,先有消费方需求。
56
56
  */
57
- import { type ExecutionLane, type RemoteExecProvider } from "../execution-lane-caps.js";
57
+ import { type ExecutionLane } from "../execution-lane-caps.js";
58
58
  import type { MemoryEngineBackend } from "@sema-agent/settings-schema/execution-lanes";
59
59
  /** boot 期可知的全部事实。每一位都必须由调用点从真配置/真装配结果取,禁在本模块内重算(重算=第二真源)。 */
60
60
  export interface MemoryWriteBoundaryFacts {
@@ -66,9 +66,9 @@ export interface MemoryWriteBoundaryFacts {
66
66
  * core 7.16.0([ref])之后写家还要再深一层(`<平面>/<label>`),但 label 归引擎注册簿,boot 期说不出口;
67
67
  * 平面是**包含关系上等价**的那一只(家恒为平面的直接子目录),所以判据停在平面,不猜 label。 */
68
68
  memoryRoot: string | undefined;
69
- /** 执行车道名,只进文案(归一读口 `executionLaneOf` 的答案;[ref] 起不在调用点手写 `?? "in-process"`)。 */
69
+ /** 执行车道名,只进文案(已合成配置上的车道词,直读)。 */
70
70
  lane: ExecutionLane;
71
- /** 该车道的路径是不是本机的文件(执行环境块 `hostLocalPaths`:in-process 的桩块 / `REMOTE_EXEC=host` 为真)。false = 沙箱 / 远端 / 设备盘,
71
+ /** 该车道的路径是不是本机的文件(执行环境块 `hostLocalPaths`:`none` 的桩块 / `REMOTE_EXEC=host` 为真)。false = 沙箱 / 远端 / 设备盘,
72
72
  * 与记忆根分平面 —— 引擎在这一形上不教 `# Memory` 写指令(除非部署声明 `memoryPersistenceCapable: true`),判的是同一键。 */
73
73
  hostSemanticsLane: boolean;
74
74
  /** 部署声明 `MEMORY_PERSISTENCE_CAPABLE`(三态)。两极都让本模块闭嘴,但理由不同 —— 见各臂注释。 */
@@ -84,16 +84,16 @@ export interface MemoryWriteBoundaryFacts {
84
84
  }
85
85
  /**
86
86
  * 审计的**车道三位**由本函数派生(boot/stores.ts 的装配点只调它,不就地手写):
87
- * · `lane` ⇐ 归一读口 `executionLaneOf`;
87
+ * · `lane` ⇐ 已合成配置上的车道词;
88
88
  * · `hostSemanticsLane` ⇐ 执行环境块 `hostLocalPaths`(唯一作者 `capabilitiesFor`;引擎撤不撤写指令读的是同一键);
89
- * · `containmentRoots` ⇐ 只有 in-process 给得出(见下)。
89
+ * · `containmentRoots` ⇐ 只有无手车道(`none`)给得出(见下)。
90
90
  * `processCwd` 由调用点传(stores 传 `process.cwd()`),本函数保持纯。
91
91
  */
92
92
  export declare function buildMemoryBoundaryLaneFacts(config: {
93
- readonly remoteExec?: {
94
- readonly provider: RemoteExecProvider;
93
+ readonly remoteExec: {
94
+ readonly provider: ExecutionLane;
95
95
  readonly s3Snapshot?: unknown;
96
- } | undefined;
96
+ };
97
97
  }, processCwd: string): Pick<MemoryWriteBoundaryFacts, "lane" | "hostSemanticsLane" | "containmentRoots">;
98
98
  /** 一条启动告警:`tag` 进日志事件名(可被运维按名过滤/告警),`detail` 是给人读的整句(含恢复路径)。 */
99
99
  export interface MemoryWriteBoundaryWarning {
@@ -106,7 +106,7 @@ export interface MemoryWriteBoundaryWarning {
106
106
  * ① **路径不是本机的车道**(块 `hostLocalPaths` 为假:沙箱 / 远端 / 设备;记忆引擎在这里只可能因为 `MEMORY_ENGINE_REMOTE_LANE=allow`
107
107
  * 或 DB 记忆面才在):引擎不教 `# Memory` 写指令(手带够不着本机的记忆根),官方恢复路径是声明 `memoryPersistenceCapable: true`。
108
108
  * 未声明 ⇒ 点名 warn,把恢复旋钮写进句子里。
109
- * ② **路径是本机的车道**(in-process / host):记忆根不在任何一个已知围栏根内 ⇒ 模型被教着往一个 fs 工具够不到的路径写。
109
+ * ② **路径是本机的车道**(none / host):记忆根不在任何一个已知围栏根内 ⇒ 模型被教着往一个 fs 工具够不到的路径写。
110
110
  *
111
111
  * 两极声明都让本模块闭嘴,但理由不同,别合并:
112
112
  * · `true` = operator 自证有推断看不见的持久通道(共享挂载 / 自定义 writer),我们的结构判断本就不该
@@ -1,11 +1,11 @@
1
1
  import { resolve } from "node:path";
2
- import { capabilitiesFor, executionLaneOf } from "../execution-lane-caps.js";
2
+ import { capabilitiesFor } from "../execution-lane-caps.js";
3
3
  export function buildMemoryBoundaryLaneFacts(config, processCwd) {
4
- const lane = executionLaneOf(config.remoteExec?.provider);
4
+ const lane = config.remoteExec.provider;
5
5
  return {
6
6
  lane,
7
7
  hostSemanticsLane: capabilitiesFor(config).hostLocalPaths,
8
- containmentRoots: lane === "in-process" ? [processCwd] : [],
8
+ containmentRoots: capabilitiesFor(config).io ? [] : [processCwd],
9
9
  };
10
10
  }
11
11
  function isInside(child, root) {
@@ -13,7 +13,7 @@ type ConsolidationSeatOptions = ReturnType<typeof resolveMemoryConsolidationDriv
13
13
  /** D3 投影的座标签闭集。`role:<name>` 里的 name 只可能是 core 的 role 链两跳之一。 */
14
14
  export type ConsolidationSeatLabel = "explicit" | "role:consolidate" | "role:summarize";
15
15
  /** {@link buildConsolidationValveAudit} 的告警名闭集(事件名进日志 ⇒ 运维可按名过滤/告警)。 */
16
- export type ConsolidationValveWarningTag = "memory_consolidation_valve_unreachable" | "memory_consolidation_run_credential_gated";
16
+ export type ConsolidationValveWarningTag = "memory_consolidation_run_credential_gated";
17
17
  /** {@link resolveConsolidationValve} 的起服提示名闭集([ref] / [ref];事件名进日志 ⇒ 运维可按名过滤/告警)。 */
18
18
  export type ConsolidationValveNoticeTag = "memory_consolidation_default_off_no_cheap_model" | "memory_consolidation_on_main_model";
19
19
  /**
@@ -55,6 +55,8 @@ export type ConsolidationSeatBilling = {
55
55
  readonly kind: "unresolvable";
56
56
  readonly fault: string;
57
57
  };
58
+ /** 整理席解座的输入 = core 解析器的输入(凭据席除外 —— 由本函数按冻结的钥匙表铸)+ 部署的两张 per-model 钥匙表(与 `models` 同一代,同一刻读)。 */
59
+ export type ConsolidationSeatDeps = Omit<MemoryConsolidationDriverDeps, "getApiKeyAndHeaders"> & Pick<ServiceConfig, "modelApiKeyEnv" | "modelApiKeys">;
58
60
  /** 座解析的产物:core 的 options 原样 + 给投影用的两位自证。 */
59
61
  export interface ConsolidationDriverSeat {
60
62
  /** `runMemoryConsolidationDriver` 第三参的**模型席那一半**,core 的 `resolveMemoryConsolidationDriver` 原样产出(写判官另由操作面的座给)。 */
@@ -81,7 +83,7 @@ export interface ConsolidationDriverSeat {
81
83
  * 体内的注 —— 那里才是它真正生效的地方,写在这里会随实现漂。
82
84
  * (探针只构造闭包、不发任何请求、无副作用。)
83
85
  */
84
- export declare function resolveConsolidationDriverSeat(deps: MemoryConsolidationDriverDeps): ConsolidationDriverSeat;
86
+ export declare function resolveConsolidationDriverSeat(input: ConsolidationSeatDeps): ConsolidationDriverSeat;
85
87
  /**
86
88
  * [ref] 波 0([ref] §3)—— 整理驱动席的 **restart 读数**。过渡件:**波 1 转热后删**(那时每轮 run 起手
87
89
  * 现取当前代的席,不再有 boot 烤死的席,这只表也就没有要比的东西了)。
@@ -117,6 +119,8 @@ export interface ConsolidationSeatWatch {
117
119
  }
118
120
  /** 解席的输入面 = boot 期真席用的同三件(活引用:refresh 就地换代,`read()` 每次现取)。 */
119
121
  export type ConsolidationSeatPlane = Pick<MemoryConsolidationDriverDeps, "models" | "tiers" | "roles">;
122
+ /** 重启读数的输入面 = 解席三件 + 座随之冻结的两张钥匙表(座位指纹带凭据身份)。 */
123
+ export type ConsolidationSeatWeldPlane = ConsolidationSeatPlane & Pick<ServiceConfig, "modelApiKeyEnv" | "modelApiKeys">;
120
124
  /**
121
125
  * **每 scope 单飞**(codex 交叉复审 [high],验真后修)—— 同一 scope 上在飞的那一轮被后来者**并入**,
122
126
  * 而不是各起一轮。`create*`:返回带状态的活对象。
@@ -258,7 +262,7 @@ export declare function resolveConsolidationValve(input: {
258
262
  export declare function createConsolidationValveWatch(input: {
259
263
  driver: MemoryConsolidationDriverConfig;
260
264
  unwirable: Parameters<typeof resolveConsolidationValve>[0]["unwirable"];
261
- plane: () => ConsolidationSeatPlane;
265
+ plane: () => ConsolidationSeatWeldPlane;
262
266
  }): ConsolidationSeatWatch | undefined;
263
267
  /**
264
268
  * 阀门的**装配点**(车PI 修复轮 ⑦(a)(e):boot 第 4 段调它,测试调同一只 —— 不在测试里手抄接线)。`create*`:产出带行为的 watch。
@@ -279,7 +283,7 @@ export declare function createConsolidationValve(input: ConsolidationValveInput
279
283
  };
280
284
  /** 阀门判决的两件输入(装配点与纯判共用一只形 —— 两个入口递的是同一组事实)。 */
281
285
  export interface ConsolidationValveInput {
282
- readonly config: Pick<ServiceConfig, "memoryConsolidationDriver" | "memoryEngineBackend" | "memoryProvenance" | "compliancePosture" | "models" | "tiers" | "roles">;
286
+ readonly config: Pick<ServiceConfig, "memoryConsolidationDriver" | "memoryEngineBackend" | "memoryProvenance" | "compliancePosture" | "models" | "tiers" | "roles" | "modelApiKeyEnv" | "modelApiKeys">;
283
287
  /** 只读两件:在不在(记忆引擎接没接线)、整理状态随不随后端走(引擎的 `memoryGovernanceDurability` 答)。 */
284
288
  readonly memoryEngine: {
285
289
  readonly backend: MemoryBackend;
@@ -301,38 +305,27 @@ export declare function judgeConsolidationValve(input: ConsolidationValveInput):
301
305
  unwirable: Parameters<typeof resolveConsolidationValve>[0]["unwirable"];
302
306
  };
303
307
  /**
304
- * 阀门上了场之后的**可达性**告警两条(自查 + codex 交叉复审;姿态=warn 不拒启)。
308
+ * 阀门上了场之后的**可达性**告警(自查 + codex 交叉复审;姿态=warn 不拒启)。
305
309
  *
306
- * ## 病(结构性,而且**只在**这条阀门够得着的那种部署上成立)
310
+ * ## 「没有运维」那一条为什么不在这里了
307
311
  *
308
- * consolidation 要后端自带引擎控制面归属 ⇒ 今天只有 file 记忆后端满足 ⇒ 本仓只在**单用户**形
309
- * (`REQUIRE_PRINCIPAL !== true`)上装配记忆引擎 —— 而那种部署的 `OPERATOR_PRINCIPALS` 通常是**空的**。
310
- * 没有运维名册(名单空且没有单用户声明 `OPERATOR_SINGLE_USER`)时 `explicitOperatorOk` 对任何身份恒假(「谁是 operator」的唯一读法:空名单绝不等于
311
- * 「人人都是 operator」),于是:阀门开着、启动成功、两口挂着、**每一次调用 501 `capability.operator_principals_required`**(运维面同一只拒发口;403 只留给名单非空而你不在名单上),
312
- * 能力位诚实地报 `false` —— 唯独运维不知道为什么,而他刚刚显式拧了一根写着 "on" 的旋钮。
313
- *
314
- * ## 为什么是 warn 而不是拒启(与 D1 的三条拒启臂**刻意不同档**)
315
- *
316
- * `OPERATOR_PRINCIPALS` 是**跨面共用**的部署级旋钮(adoption / retention-ops / memory-bundle /
317
- * memory-compliance / admin-drain 全在同一张名单上)。为一条阀门拒掉整台机器,比这条阀门本身的价值重;
318
- * 而那三条拒启臂拒的是「这台机器**结构上**跑不了这件事」(没有库 / 账会丢 / 折叠法铸不出标记),
319
- * 本条拒的是「配齐了但没人够得着」——后者是一次**配置遗漏**,补一行 env 即可,不该要一次重启失败来教。
320
- * 同族先例逐字:`permission_rules_lane_unavailable`(旋钮开着却上不了场 ⇒ 打一行,不拒启)。
321
- * 反过来说,**沉默**同样不行:那正是「设了但没生效」病族,而这一形连能力位都是诚实的假,唯一缺的
322
- * 就是一句把因果说清楚的话。
312
+ * 曾经还有一条「阀门够不着」告警(事件名已删,不再出现在日志里):阀门开着、两口挂着,而这台部署没有运维名册 ⇒ 两口对谁都 501。
313
+ * 它的在场条件今天在服务腿上不可达,前提链三环:① 显式开得起来的阀门要 file 记忆后端(SQL 两只孪生不发布控制面 ⇒ 第 4 段的
314
+ * {@link assertConsolidationDriverWirable} 拒启),而 file 记忆引擎只在单用户形上装配(`fileMemoryPlaneFor`);② 单用户形过了起服第 1 段就一定有运维
315
+ * (不变量 `operator-declaration-required`:`OPERATOR_SINGLE_USER=true` 或具名名单,都没有 ⇒ 第 1 段早拒;装运维面的兜底座 `createHttpServer` 同判);
316
+ * ③ 本函数的唯一调用点在服务腿第 6 段。读一个不可能状态的告警是死臂,随那条不变量一起退役(钉:`test/operator-declaration-required.test.ts` ⑥,
317
+ * 前提链每环一格,任何一环将来不成立 ⇒ 那一格红)。
323
318
  *
324
319
  * ## 只审**显式**开的阀门([ref] / [ref] 起)
325
320
  *
326
- * 两条告警的前提都是「运维**显式**拧了 on」(上面那句原话)——它们是一次**表态**够不着的诊断。出厂缺省**派生**开的
327
- * 那台(配了便宜模型的单用户部署)没有表态可审:引擎面的自动整理照跑(不走这两个口),手动口是一件它没要过的东西。
328
- * 照审的后果是每一台这样的部署升级后每次起服多两行 warn,点名一根它从没设过的 `MEMORY_CONSOLIDATION_DRIVER=on`,
329
- * 教它去配一个它不需要的操作面。判据读阀门判决的 `source`,不读表态原词(判决是阀门开关的唯一属主)。
321
+ * 告警的前提是「运维**显式**拧了 on」——它是一次**表态**够不着的诊断。出厂缺省**派生**开的那台(配了便宜模型的单用户部署)
322
+ * 没有表态可审:引擎面的自动整理照跑(不走手动口),手动口是一件它没要过的东西。照审的后果是每一台这样的部署升级后每次起服
323
+ * 多一行 warn,点名一根它从没设过的 `MEMORY_CONSOLIDATION_DRIVER=on`,教它去配一个它不需要的操作面。判据读阀门判决的 `source`,
324
+ * 不读表态原词(判决是阀门开关的唯一属主)。
330
325
  */
331
326
  export declare function buildConsolidationValveAudit(input: {
332
327
  /** 阀门判决({@link resolveConsolidationValve} 的 `enabled` + `source`)。 */
333
328
  valve: Pick<ConsolidationValve, "enabled" | "source">;
334
- /** 这台部署有没有运维名册(`operatorRosterPresent`:名单非空 ∨ 单用户声明)—— 判据不在本函数里另写一份。 */
335
- operatorRosterPresent: boolean;
336
329
  /** 这台部署配了任何一把 service 凭证吗(`config.authToken` 或 `config.authTokens` 非空)。 */
337
330
  hasServiceAuth: boolean;
338
331
  /** 本地开发的显式逃生口(`ALLOW_UNAUTHED_WRITES=true`)。 */
@@ -414,35 +407,37 @@ export declare function assertAutoConsolidationWirable(input: {
414
407
  * 「这条路径能不能写」在引擎里只有**一只**判官(合成写判官:技能拒行 / 收窄折叠 / 调用方与继承策略 / 人的持久规则车道 / 组织车道,一条走法一个优先序)。
415
408
  * 引擎的自动整理腿(有腿:名册上的 `Write` 脸、引擎盖的豁免根、人的持久规则读者)与本腿(运维手动阀门:没有腿)用的是**同一个构造器** ——
416
409
  * 同样的行给同样的答案,本仓不手搭第二只({@link createOperatorValveWriteJudge} 恰一处调用它,见 `test/memory-consolidation-write-judge.test.ts` ⑥)。
410
+ * 判官**按次铸**:每一次真跑(单飞里起跑的那一次,并入的等待者不另铸)现铸一只,所以人读的是发起这一轮的那位。
417
411
  *
418
- * ## 本仓供的两个部署事实(其余键一律缺席,缺席的语义见引擎:那一层不存在)
412
+ * ## 本仓供的部署事实(其余键一律缺席,缺席的语义见引擎:那一层不存在)
419
413
  *
420
414
  * · `ruleStoreProvider` = 部署唯一的那只合成规则店(`RunnerDeps.permissionRuleStore` 的同一个变量,装配第 4 段铸一次)。规则店没装配 ⇒ 缺席 ⇒ 没有规则层。
415
+ * · 人(`principal` / `localOwnerDeclared`)= **发起这一轮的调用方**:带主体 ⇒ 读那个主体的桶;不带主体 ⇒ 读本机属主的桶,当且仅当部署声明了它
416
+ * (`localOwnerDeclared` = Runner 下发的 `localOwnerRules` 同一只判据 `localOwnerRulesDeclared` 的答案;多租形不声明 ⇒ 匿名地板,而多租形的阀门口本来就要主体)。
417
+ * 整理 run 按 scope 单飞、可续跑:并入正在跑的那一轮的调用方用起跑者的判官(它们拿到的是同一份收执);续跑一条 pending run 的那一次,发起者就是这一次的调用方。
421
418
  * · `anchors.home` = `executionLaneHomeDir(config)` —— `~/` 行的基,与引擎执行环境的 `homeDir` 座、下单 422 门、规则基 `taskHome` 是**同一只函数**
422
419
  * (车道没有自己的 home 时诚实缺席;缺席 ⇒ 引擎读到人持有的 `~/` 收紧行时无处锚定 = 按异议处置,拒闭)。**刻意不另调 `os.homedir()`**:
423
- * 那会在非 host 车道上造出第二个读法 —— 阀门答「可解析」而腿内答「读不出」。⚠️ 今天这一键在生产座上**空转**:阀门不带主体(下面的 `principal`),
424
- * 引擎读匿名地板、不读任何人的持久行,「`~/` 行无锚 ⇒ 拒闭」走不到;留着它是为了主体有了来源之后不必再回来改这里。
425
- *
426
- * ## 刻意缺席的键(披露,不是遗漏)—— 三层没喂,所以这条腿仍是**响亮的放行座**(P-DEBT,见 {@link createOperatorValveWriteJudge})
427
- *
428
- * · `principal` / `localOwnerDeclared`(人的持久规则层):阀门是 operator 面的一次调用,本仓没有一个能回答「这个库属于谁」的来源 ——
429
- * 单用户 + file 后端(阀门结构上能起的唯一形,见 {@link assertConsolidationDriverWirable})里记忆是部署级全局层 / 任务根散列的项目层,principal 标签从不分盘,
430
- * 本仓也从不声明 `localOwnerRules`;整理 run 又是按 scope 单飞、可续跑的持久作业,「谁的规则」对并入 / 续跑的调用方没有定义。
431
- * · `callerPolicy`(部署的调用方策略层):`APPROVAL_REQUIRE` / `APPROVAL_DENY` / `AUTONOMY` / 敏感路径守卫集是**每任务现合成**的(`deployment-governance.ts`,
432
- * 读热可改的活配置,「禁 memoize」),没有部署级单例;boot 期铸一份喂进来就是冻结一份会过期的策略(收紧不生效 = 静默放行)。喂它需要一份设计:取哪几层、
433
- * 活配置怎么读、审批席取什么形;其中敏感路径层还要引擎的豁免根(`RunnerDeps.memoryEngineDir` 盖在每个请求上),而宿主构造器的输入没有这一位 —— 要向 core 请托,
434
- * 不在本层造第二条豁免根的读法。
435
- * · `anchors.root`:阀门按 scope 跑,手里没有项目根 —— 项目层 scope 键是任务根的单向散列(`project-identity.ts` 的 `repo:<sha256[:24]>`),反推不出根;
436
- * 全局层根本没有根。⇒ 人持有的相对 deny / ask 行无处锚定 = 异议,拒闭(引擎契约:判官不猜一行原本指向哪里)。
420
+ * 那会在非 host 车道上造出第二个读法 —— 阀门答「可解析」而腿内答「读不出」。
437
421
  *
438
- * 所以今天这条腿的放行范围与 7.128.x 相同(人的规则、部署的审批名单 / 敏感路径守卫都拦不住手动阀门这一轮折叠);变的只是「判官不再是代答」—— 往后每喂一层,
439
- * 只在本函数加键,钉 = `test/memory-consolidation-write-judge.test.ts` ⑦。
422
+ * ## 刻意缺席的键(披露,不是遗漏)—— 这两样没喂,所以这条腿仍记一笔债(P-DEBT,见 {@link createOperatorValveWriteJudge})
423
+ *
424
+ * · `callerPolicy`(部署的调用方策略层):腿上它是任务的整条部署治理链(审批名单 + 敏感路径守卫与誊本门 + 命令策略,经 `createDeploymentGovernanceInputs` /
425
+ * `createApprovalBaselinePolicy` / `applyRuntimeGovernance` 同一组构造口铸)。只喂其中一层(例如只喂审批名单)= 这条腿上半条治理链 —— 构造口的每个消费者都要挂
426
+ * 部署旋钮矩阵的一条腿、背齐全部旋钮(`test/operator-knob-client-posture-matrix.test.ts` 的消费腿对账),半条链背不齐。整条链喂进来又卡在敏感路径守卫:
427
+ * 腿上的守卫靠引擎盖在每个请求上的豁免根(`RunnerDeps.memoryEngineDir`)放过记忆库自己的写,宿主构造器的输入没有这一位 —— 不带豁免根喂进去会把库里的写当守卫目标拒掉
428
+ * (与腿不同答);在本层另造一条豁免根的读法是第二个写者。⇒ 等引擎的宿主输入收这一位,再整条喂、挂矩阵腿。
429
+ * · `anchors.root`:阀门按 scope 跑,手里没有项目根 —— 项目层 scope 键是任务根的单向散列(`project-identity.ts` 的 `repo:<sha256[:24]>`),反推不出根;
430
+ * 全局层根本没有根。⇒ 人持有的相对 deny / ask 行无处锚定 = 异议,拒闭(引擎契约:判官不猜一行原本指向哪里)。这一格没有来源,永久缺席。
440
431
  *
441
432
  * 自动整理腿不受影响:它走引擎腿自己的判官,人的持久规则与部署策略照判。
442
433
  */
443
434
  export declare function createOperatorValveJudgeInput(facts: {
444
435
  /** 部署唯一的合成规则店(装配第 4 段铸一次,`RunnerDeps.permissionRuleStore` 与本座读同一只)。缺席 = 规则店没装配。 */
445
436
  readonly ruleStoreProvider: PermissionRuleStoreProvider | undefined;
437
+ /** 部署是否声明本机属主的规则桶(`boot/runner-deps.ts` 的 `localOwnerRulesDeclared` —— Runner 下发 `localOwnerRules` 的同一只判据)。 */
438
+ readonly localOwnerDeclared: boolean;
439
+ /** 发起这一轮的调用方(阀门口的已验主体;不带主体 = `undefined`)。 */
440
+ readonly initiator: string | undefined;
446
441
  /** 只读 `executionLaneHomeDir` 读的两位(`ServiceConfig` 结构满足)。 */
447
442
  readonly config: LaneHomeDeployment;
448
443
  }): ConsolidationWriteJudgeInput;
@@ -450,10 +445,10 @@ export declare function createOperatorValveJudgeInput(facts: {
450
445
  * 运维阀门腿的写判官座:引擎的判官构造器喂 {@link createOperatorValveJudgeInput},**外加一个响亮的债计数**(P-DEBT)。
451
446
  *
452
447
  * 构造器只有引擎那一只,本函数不判任何东西:`judge(target)` 的答案原样返回。它只在每次被问时记一次
453
- * `server.memory-consolidation.operator-valve-layers-unfed`(计数 + 探针行 + 一次性告警)—— 因为人的规则层、部署策略层、项目根三样都没喂
454
- * ({@link createOperatorValveJudgeInput} 头注),放行的最坏后果没变:运维手动整理时,一条点名记忆库路径的人的持久规则或部署写策略拦不住这一轮折叠
455
- * (与 7.128.x 逐字同)。债在遥测里显形,而不是随着「判官已换成引擎的」这句话消失。自动整理腿不受影响,走引擎腿自己的判官。
456
- * 收口 = 三层各自有了来源(人:「读谁的桶」裁定;策略:设计 + 引擎的豁免根入参;根:无来源则永久缺席并改写本债)那一版,本 tag 删。
448
+ * `server.memory-consolidation.operator-valve-layers-unfed`(计数 + 探针行 + 一次性告警)—— 人已喂;没喂的是部署的调用方策略层
449
+ * (整条治理链等引擎的宿主输入收豁免根)与项目根(没有来源)({@link createOperatorValveJudgeInput} 头注)。放行的最坏后果:运维手动整理时,
450
+ * 部署的写策略(例如 `APPROVAL_DENY=Write`、点名记忆库路径的敏感路径守卫)拦不住这一轮折叠;人的 deny 行拦得住,人持有的相对行照旧拒闭。
451
+ * 自动整理腿不受影响,走引擎腿自己的判官。收口 = 引擎的宿主输入收豁免根、整条部署治理链喂上并挂矩阵腿那一版,本 tag 删(项目根改写成永久缺席的披露)。
457
452
  */
458
453
  export declare function createOperatorValveWriteJudge(facts: Parameters<typeof createOperatorValveJudgeInput>[0]): ConsolidationWriteJudge;
459
454
  /** 两个 admin 口消费的窄能力面(`ServiceDeps.memoryConsolidation` 的实参来源)。 */
@@ -465,8 +460,9 @@ export interface MemoryConsolidationFaces {
465
460
  /** 配置表的 scope(`MEMORY_CONSOLIDATION_SCOPES`)。恰好一条时是两个口的**唯一**缺省。 */
466
461
  readonly scopes: readonly string[];
467
462
  /** 跑(或**续跑**)一轮。core 的 run 行是持久的:同一 scope 上有 pending run 时本调用 CONTINUE 它
468
- * (同一 plan 缓存、同一 force requestId、零新 mint)—— 所以这一口对**重试安全**。 */
469
- run(scope: string): Promise<ConsolidationRunReceipt>;
463
+ * (同一 plan 缓存、同一 force requestId、零新 mint)—— 所以这一口对**重试安全**。
464
+ * `initiator` = 发起这一次的调用方(已验主体;不带主体 = `undefined`):写判官按它读人的规则桶;并入正在跑的那一轮的调用方用起跑者的判官。 */
465
+ run(scope: string, initiator: string | undefined): Promise<ConsolidationRunReceipt>;
470
466
  /** 该 scope 最近一次 driver run 的账(`undefined` = 从没跑过 —— 诚实缺席,不编一个空壳)。core 7.63.0([ref])起经引擎的治理店座读、异步。 */
471
467
  lastRun(scope: string): Promise<ConsolidationDriverRunRow | undefined>;
472
468
  }
@@ -507,9 +503,10 @@ export declare function createMemoryConsolidationFaces(stores: MemoryScopeStores
507
503
  /** 停因自由文本的**运维日志**座(缺席 = 没人听,不影响任何行为)。载荷由 {@link buildStopDetailAudit}
508
504
  * 铸,调用点在单飞回调**之内** ⇒ 一轮真 run 一行,并入的等待者不各落一行。 */
509
505
  onStopDetail?: (audit: ReturnType<typeof buildStopDetailAudit>) => void;
510
- /** core 7.50.0:整理跑的**写判官座**(必填 —— 缺席不是「没有规则」,core 也拒)。操作面不判任何东西,只把它原样递给驱动动词:
511
- * 早问库目录一次、应用时问每个产物文件,答 `no_objection` 以外一律拒写。装配层给哪一只见 {@link createOperatorValveWriteJudge}。 */
512
- writeJudge: ConsolidationWriteJudge;
506
+ /** core 7.50.0:整理跑的**写判官座**(必填 —— 缺席不是「没有规则」,core 也拒),按发起者铸:每一次真跑(单飞里起跑的那一次)调一次,
507
+ * 拿到的判官原样递给驱动动词 —— 早问库目录一次、应用时问每个产物文件,答 `no_objection` 以外一律拒写。操作面不判任何东西。
508
+ * 装配层给哪一只见 {@link createOperatorValveWriteJudge}。 */
509
+ writeJudgeFor: (initiator: string | undefined) => ConsolidationWriteJudge;
513
510
  /** 引擎通告的**运维行**座(与 Runner 的 `onNotice` 同一只转发器)。缺席 ⇒ 通告只在回执上。判官拒的两种时机都经它走一次:
514
511
  * 应用时拒 = 引擎在驱动里铸的 `memory.consolidation_incomplete`;早问拒 = 驱动抛出的拒绝经引擎导出的投递口(`deliverWriteRefusal`)转成的
515
512
  * `memory.consolidation_refused`(本仓不读通告名、不自铸通告形)。 */
@@ -1,6 +1,5 @@
1
1
  import { redactSecrets } from "../trace/redact.js";
2
2
  import { recordFailOpen } from "../observability/fail-open.js";
3
- import { buildOperatorRosterWayOut } from "../http/principal-gate.js";
4
3
  import { memoryMountRootOf, memoryScopeContractOf } from "../memory-scope.js";
5
4
  import { executionLaneHomeDir } from "../execution-lane-caps.js";
6
5
  import { DEFAULT_MODEL_REF, resolveMainModel } from "../model-select.js";
@@ -8,7 +7,11 @@ import { captureRecordStoreOf } from "../memory-operator-faces.js";
8
7
  import { memoryStoreForRequest } from "../memory-scope-stores.js";
9
8
  import { createConsolidationWriteJudge, deliverWriteRefusal, expandTiers, MemoryEngine, memoryGovernanceDurability, modelOriginOf, resolveComplianceDenies, resolveMemoryConsolidationDriver, runMemoryConsolidationDriver, } from "@sema-agent/core";
10
9
  import { seatText } from "../trace/exit-seat.js";
11
- export function resolveConsolidationDriverSeat(deps) {
10
+ import { createKeyResolver, credentialIdentityFingerprint, credentialIdentityOf } from "../key-resolver.js";
11
+ export function resolveConsolidationDriverSeat(input) {
12
+ const { modelApiKeyEnv, modelApiKeys, ...seatDeps } = input;
13
+ const frozenKeys = createKeyResolver({ ...modelApiKeyEnv }, process.env, { ...modelApiKeys });
14
+ const deps = { ...seatDeps, ...(frozenKeys !== undefined ? { getApiKeyAndHeaders: frozenKeys } : {}) };
12
15
  let options;
13
16
  try {
14
17
  options = resolveMemoryConsolidationDriver(deps);
@@ -58,7 +61,7 @@ function consolidationSeatFingerprint(plane) {
58
61
  if ("unresolvable" in seat)
59
62
  return seat;
60
63
  const { cost: _cost, ...route } = seat.entry;
61
- return route;
64
+ return { ...route, credential: credentialIdentityFingerprint(credentialIdentityOf(plane, seat.entry.name)) };
62
65
  }
63
66
  function seatLabel(deps) {
64
67
  if (deps.memoryConsolidationDriver?.chat !== undefined)
@@ -196,7 +199,7 @@ export function createConsolidationValve(input) {
196
199
  if (valve.notice !== undefined)
197
200
  logger.warn(valve.notice.tag, { detail: valve.notice.detail });
198
201
  assertConsolidationDriverWirable({ ...wiring, enabled: valve.enabled });
199
- const plane = () => ({ models: config.models, tiers: config.tiers, roles: config.roles });
202
+ const plane = () => ({ models: config.models, tiers: config.tiers, roles: config.roles, modelApiKeyEnv: config.modelApiKeyEnv, modelApiKeys: config.modelApiKeys });
200
203
  return { valve, watch: createConsolidationValveWatch({ driver: config.memoryConsolidationDriver, unwirable, plane }) };
201
204
  }
202
205
  export function judgeConsolidationValve(input) {
@@ -279,18 +282,6 @@ export function buildConsolidationValveAudit(input) {
279
282
  if (!input.valve.enabled || input.valve.source !== "explicit")
280
283
  return { warnings: [] };
281
284
  const warnings = [];
282
- if (!input.operatorRosterPresent) {
283
- warnings.push({
284
- tag: "memory_consolidation_valve_unreachable",
285
- detail: "MEMORY_CONSOLIDATION_DRIVER=on armed the consolidation valve and both admin endpoints are mounted, but " +
286
- "this worker has no operator: OPERATOR_PRINCIPALS is EMPTY and OPERATOR_SINGLE_USER is not set — an empty operator list means NO ONE " +
287
- "is an operator (it deliberately does not mean 'everyone'), so POST /v1/admin/memory/consolidation/run and GET /v1/admin/memory/consolidation " +
288
- "answer 501 capability.operator_principals_required to every caller and capabilities.memoryConsolidationDriver reports false. " +
289
- `To fix: ${buildOperatorRosterWayOut()}. With OPERATOR_PRINCIPALS, callers must send a listed principal in the configured principal header; a single-user declaration needs no principal. ` +
290
- "(Not a startup refusal: the operator roster is shared by every operator " +
291
- "endpoint on this worker, so one valve must not decide whether the whole worker starts.)",
292
- });
293
- }
294
285
  if (!input.hasServiceAuth && !input.allowUnauthedWrites) {
295
286
  warnings.push({
296
287
  tag: "memory_consolidation_run_credential_gated",
@@ -335,6 +326,8 @@ export function createOperatorValveJudgeInput(facts) {
335
326
  const home = executionLaneHomeDir(facts.config);
336
327
  return {
337
328
  ...(facts.ruleStoreProvider !== undefined ? { ruleStoreProvider: facts.ruleStoreProvider } : {}),
329
+ ...(facts.initiator !== undefined && facts.initiator !== "" ? { principal: facts.initiator } : {}),
330
+ ...(facts.localOwnerDeclared ? { localOwnerDeclared: true } : {}),
338
331
  anchors: home !== undefined ? { home } : {},
339
332
  };
340
333
  }
@@ -369,10 +362,10 @@ export function createMemoryConsolidationFaces(stores, input) {
369
362
  seat: input.seat.seat,
370
363
  model: input.seat.model,
371
364
  scopes: input.scopes,
372
- run: (scope) => flight(scope, async () => {
365
+ run: (scope, initiator) => flight(scope, async () => {
373
366
  const receipt = await runMemoryConsolidationDriver(engineOf(scope), scope, {
374
367
  ...input.seat.options,
375
- writeJudge: input.writeJudge,
368
+ writeJudge: input.writeJudgeFor(initiator),
376
369
  compliance: { ...(input.postureOf !== undefined ? { postureOf: input.postureOf } : {}), scopeContract: memoryScopeContractOf([scope]) },
377
370
  ...(input.onNotice !== undefined ? { onNotice: input.onNotice } : {}),
378
371
  }).catch((err) => {
@@ -8,7 +8,7 @@ function collectDeploymentOrgScopes(config) {
8
8
  scopes.add(config.memoryScope);
9
9
  if (config.requirePrincipal !== true) {
10
10
  for (const project of Object.values(config.projects)) {
11
- for (const s of project.defaultScopes ?? [])
11
+ for (const s of project.defaultScopes)
12
12
  if (s.startsWith(ORG_PREFIX))
13
13
  scopes.add(s);
14
14
  }
@@ -28,9 +28,10 @@ export function createOrgMemoryAdmissionWiring(opts) {
28
28
  const directory = centerLeg !== undefined
29
29
  ? (() => {
30
30
  const directoryNow = createIdentityBins(centerLeg.credential, (credential) => createOrgMemoryDirectory({
31
- fetchSection: (principal) => fetchPrincipalOrgMemory({ baseUrl: centerLeg.baseUrl, credential }, principal, fetch, centerLeg.worker),
31
+ fetchSection: (principal) => fetchPrincipalOrgMemory({ baseUrl: centerLeg.baseUrl, credential }, principal, undefined, centerLeg.worker),
32
32
  grantTtlMs: config.memoryOrgGrantTtlMs,
33
33
  unavailableBackoffMs: config.memoryOrgUnavailableBackoffMs,
34
+ logger,
34
35
  })).now;
35
36
  return { lookup: (principal) => directoryNow().lookup(principal) };
36
37
  })()
@@ -44,7 +45,7 @@ export function createOrgMemoryAdmissionWiring(opts) {
44
45
  const memoryPlaneLive = config.memoryEngineEnabled && config.memoryEngineBackend !== "file";
45
46
  if (directory === undefined && config.requirePrincipal === true && memoryPlaneLive) {
46
47
  const orgProjects = Object.entries(config.projects)
47
- .filter(([, p]) => (p.defaultScopes ?? []).some((s) => s.startsWith(ORG_PREFIX)))
48
+ .filter(([, p]) => p.defaultScopes.some((s) => s.startsWith(ORG_PREFIX)))
48
49
  .map(([id]) => id);
49
50
  if (orgProjects.length > 0) {
50
51
  throw new Error(`multi-tenant deployment has org: keys in projects[${orgProjects.join(", ")}].defaultScopes but NO org-memory directory source ` +
@@ -6,7 +6,7 @@ import { type SandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
6
6
  import type { ApprovalExemptionStore } from "../plugins/approval-exemption-store.js";
7
7
  /** 本腿读的配置切面(`ServiceConfig` 结构满足)。两个构造口各自的切面 + lane 判别式读的 `remoteExec`。 */
8
8
  export interface ParkedReviveGateConfigView extends DeploymentGovernanceConfigView, ApprovalBaselineConfigView {
9
- readonly remoteExec?: ServiceConfig["remoteExec"];
9
+ readonly remoteExec: ServiceConfig["remoteExec"];
10
10
  /** [ref]④:`executionLaneHomeDir` 读的运维声明(切面必须点名本腿消费的每一个字段,否则窄视图字面量会静默丢掉旋钮)。 */
11
11
  readonly remoteExecHomeDir?: ServiceConfig["remoteExecHomeDir"];
12
12
  /** host 腿裁决 env 的 cwd 占位根(见下方 `hostGateCwd`)。 */
@@ -7,7 +7,7 @@ import { applyRuntimeGovernance } from "../runtime-governance.js";
7
7
  import { DeferredSandboxPathEnv, sandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
8
8
  import { DEPLOYMENT_SHAPE_PREDICATES } from "../deployment-shape.js";
9
9
  import { executionLaneHomeDir } from "../execution-lane-caps.js";
10
- import { createDeploymentListExemption } from "../approval.js";
10
+ import { createSessionExemptionRead } from "../approval.js";
11
11
  import { seatText } from "../trace/exit-seat.js";
12
12
  function hostGateCwd(config, localRoot) {
13
13
  return join(config.localDataRoot ?? localRoot, "parked-revive-unrooted");
@@ -24,7 +24,7 @@ export function createParkedReviveInheritedGate(deps) {
24
24
  env: new DeferredSandboxPathEnv({
25
25
  sessionId: row.sessionId,
26
26
  slots,
27
- logger: { warn: (event, fields) => logger.warn(event, { ...(fields ?? {}), lane: config.remoteExec?.provider, leg: "parked_revive" }) },
27
+ logger: { warn: (event, fields) => logger.warn(event, { ...(fields ?? {}), lane: config.remoteExec.provider, leg: "parked_revive" }) },
28
28
  }),
29
29
  ...homeBase,
30
30
  }
@@ -33,7 +33,7 @@ export function createParkedReviveInheritedGate(deps) {
33
33
  const baseline = createApprovalBaselinePolicy(config, {
34
34
  kind: "durable",
35
35
  question,
36
- ...(approvalExemptionStore !== undefined && rootSessionId ? { exemption: createDeploymentListExemption(approvalExemptionStore, rootSessionId, logger, "parked_revive") } : {}),
36
+ ...(approvalExemptionStore !== undefined && rootSessionId ? { exemption: createSessionExemptionRead(approvalExemptionStore, rootSessionId, logger, "deployment_list", "parked_revive") } : {}),
37
37
  });
38
38
  const governed = applyRuntimeGovernance({ objective: "", toolPolicy: baseline }, createDeploymentGovernanceInputs(config, pathAdjudication));
39
39
  return {
@@ -26,7 +26,7 @@ import type { ApprovalNonceStore, CheckpointStoreFull, CostQuotaStore, ImageBake
26
26
  import { type StoreSweep, type StoreSweepLeg } from "../plugins/store-sweep.js";
27
27
  import type { ToolApprovalCoordinator } from "../tool-approval.js";
28
28
  import type { ParkCommitWatch } from "../plugins/park-commit-watch.js";
29
- import { type SandboxPodReaper } from "../plugins/k8s-pod-reaper.js";
29
+ import { type SandboxReaper } from "../plugins/sandbox-reaper.js";
30
30
  import { type AuditRotationPort } from "../approval-ask-retention.js";
31
31
  /** [ref] / [ref]§五(sema-comms `audits/failopen-governance-176.md` §7 "Z 类 1 条"):default consecutive-failure
32
32
  * count before a reaper leg's swallowed error gets a `warn` line. The ~15 `.catch(() => undefined)` sites
@@ -122,8 +122,9 @@ export interface ReapersCtx {
122
122
  approvalAskAudit: AuditRotationPort | undefined;
123
123
  /** 晚绑(server 造出来才有)——见文件头「位置即契约」①。 */
124
124
  getRunDenySweep: () => ((now: number) => Promise<void>) | undefined;
125
- /** k8s 车道的沙箱 Pod reaper(`plugins/k8s-pod-reaper.ts`;第 5 段与 run 工厂同一份 k8s 配置铸)。缺席 = 非 k8s 车道 ⇒ 本腿零调用。 */
126
- sandboxPodReaper?: SandboxPodReaper;
125
+ /** 本车道的沙箱回收座(`plugins/sandbox-reaper.ts`;第 5 段与 run 工厂同一份车道配置铸):k8s 车道 = 沙箱 Pod reaper(`plugins/k8s-pod-reaper.ts`),local-docker 车道 = 无主容器 reaper
126
+ * (`plugins/local-docker-reaper.ts`)。缺席 = 别的车道 ⇒ 本腿零调用。一次部署一条执行车道 ⇒ 一只座、一个节拍。 */
127
+ sandboxReaper?: SandboxReaper;
127
128
  }
128
129
  /** core 5.48 `reapDurableAgents` 的 `deps.sessions` 面(结构形,只列本仓要填的三格)。 */
129
130
  export interface ReapSessionsFacade {