@sema-agent/server 7.138.0 → 7.140.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 (332) hide show
  1. package/MIGRATION.md +457 -7
  2. package/README.md +7 -4
  3. package/README.zh-CN.md +6 -4
  4. package/USAGE.md +91 -41
  5. package/deploy/sema-up/README.md +1 -1
  6. package/deploy/sema-up/lib/lanes.json +3 -2
  7. package/dist/adoption/runner.js +1 -1
  8. package/dist/adoption/sql.js +1 -1
  9. package/dist/adoption/wire.d.ts +3 -3
  10. package/dist/approval-card.d.ts +26 -26
  11. package/dist/bench/s1/arms.d.ts +1 -1
  12. package/dist/bench/s1/arms.js +1 -3
  13. package/dist/bench/s1/live-deps.js +3 -2
  14. package/dist/bench/s1/row.d.ts +5 -2
  15. package/dist/bench/s1/row.js +2 -22
  16. package/dist/bench/s1/run-firm.js +2 -2
  17. package/dist/boot/adoption.js +1 -1
  18. package/dist/boot/device-lane.d.ts +8 -3
  19. package/dist/boot/device-lane.js +7 -2
  20. package/dist/boot/execution-env.d.ts +4 -2
  21. package/dist/boot/execution-env.js +28 -34
  22. package/dist/boot/execution-lane.d.ts +9 -1
  23. package/dist/boot/execution-lane.js +6 -1
  24. package/dist/boot/governance-seams.d.ts +3 -2
  25. package/dist/boot/governance-seams.js +9 -11
  26. package/dist/boot/memory-boundary.d.ts +14 -51
  27. package/dist/boot/memory-boundary.js +10 -20
  28. package/dist/boot/memory-consolidation.d.ts +15 -11
  29. package/dist/boot/memory-consolidation.js +25 -14
  30. package/dist/boot/resolve-spec.d.ts +4 -6
  31. package/dist/boot/resolve-spec.js +10 -13
  32. package/dist/boot/retention-lane.d.ts +5 -5
  33. package/dist/boot/retention-lane.js +0 -6
  34. package/dist/boot/runner-deps.d.ts +6 -4
  35. package/dist/boot/runner-deps.js +3 -1
  36. package/dist/boot/session-faces.d.ts +0 -3
  37. package/dist/boot/session-faces.js +15 -8
  38. package/dist/boot/stage-02-web-admin-pull.js +2 -2
  39. package/dist/boot/stage-03-store-backend.d.ts +2 -6
  40. package/dist/boot/stage-03-store-backend.js +2 -3
  41. package/dist/boot/stage-04-stores.d.ts +2 -6
  42. package/dist/boot/stage-04-stores.js +5 -5
  43. package/dist/boot/stage-05-execution-env.d.ts +2 -6
  44. package/dist/boot/stage-05-execution-env.js +2 -2
  45. package/dist/boot/stage-06-runners.d.ts +2 -6
  46. package/dist/boot/stage-06-runners.js +2 -3
  47. package/dist/boot/stage-07-capability-layer.d.ts +2 -6
  48. package/dist/boot/stage-08-reapers.d.ts +2 -6
  49. package/dist/boot/stage-09-leader.d.ts +2 -6
  50. package/dist/boot/stage-09-leader.js +1 -2
  51. package/dist/boot/stage-10-http-server.d.ts +2 -6
  52. package/dist/boot/stage-10-http-server.js +7 -6
  53. package/dist/boot/stores.d.ts +3 -6
  54. package/dist/boot/stores.js +27 -40
  55. package/dist/boot/task-list-lane.d.ts +1 -1
  56. package/dist/boot/task-list-lane.js +1 -1
  57. package/dist/boot/web-admin.js +37 -11
  58. package/dist/capabilities/execution-lane.d.ts +2 -2
  59. package/dist/capabilities/mcp-probe.js +1 -1
  60. package/dist/capabilities/scenarios.d.ts +1 -1
  61. package/dist/capability-facts.d.ts +15 -7
  62. package/dist/capability-facts.js +8 -3
  63. package/dist/config-catalog.js +9 -8
  64. package/dist/config-invariants.d.ts +23 -3
  65. package/dist/config-invariants.js +42 -0
  66. package/dist/config-provider.d.ts +33 -37
  67. package/dist/config-provider.js +51 -30
  68. package/dist/config-types.d.ts +21 -7
  69. package/dist/config.d.ts +33 -0
  70. package/dist/config.js +46 -16
  71. package/dist/delegated-session-owner.d.ts +4 -3
  72. package/dist/delegated-session-owner.js +1 -1
  73. package/dist/deployment-shape.d.ts +10 -9
  74. package/dist/deployment-shape.js +4 -4
  75. package/dist/device-enrollment.d.ts +41 -2
  76. package/dist/device-enrollment.js +27 -12
  77. package/dist/device-store.d.ts +58 -85
  78. package/dist/device-store.js +19 -49
  79. package/dist/device-ws-hub.js +2 -1
  80. package/dist/env-name-allowlist-knobs.d.ts +5 -4
  81. package/dist/exec-cut.d.ts +60 -0
  82. package/dist/exec-cut.js +36 -0
  83. package/dist/execution-lane-caps.d.ts +115 -105
  84. package/dist/execution-lane-caps.js +76 -82
  85. package/dist/execution-placement.d.ts +259 -0
  86. package/dist/execution-placement.js +199 -0
  87. package/dist/field-conflict.d.ts +3 -2
  88. package/dist/field-conflict.js +1 -0
  89. package/dist/hosted-posture.d.ts +2 -2
  90. package/dist/http/admission.js +8 -19
  91. package/dist/http/checkpoint-ctx.d.ts +21 -12
  92. package/dist/http/checkpoint-ctx.js +4 -2
  93. package/dist/http/claimed-run.d.ts +1 -1
  94. package/dist/http/durable-run-leg.js +9 -5
  95. package/dist/http/execution-context.d.ts +218 -0
  96. package/dist/http/execution-context.js +330 -0
  97. package/dist/http/memory-compliance-failure-reply.d.ts +3 -1
  98. package/dist/http/memory-compliance-failure-reply.js +5 -0
  99. package/dist/http/memory-layer-reply.d.ts +30 -0
  100. package/dist/http/memory-layer-reply.js +24 -0
  101. package/dist/http/resume-legs.js +63 -36
  102. package/dist/http/retired-service-deps.d.ts +1 -1
  103. package/dist/http/retired-service-deps.js +1 -1
  104. package/dist/http/route-ctx.d.ts +14 -8
  105. package/dist/http/routes/adoption.js +1 -1
  106. package/dist/http/routes/background.d.ts +29 -1
  107. package/dist/http/routes/background.js +29 -2
  108. package/dist/http/routes/devices.d.ts +13 -19
  109. package/dist/http/routes/devices.js +21 -26
  110. package/dist/http/routes/memory-bundle.js +3 -0
  111. package/dist/http/routes/memory-compliance.js +8 -1
  112. package/dist/http/routes/memory-consolidation.js +12 -1
  113. package/dist/http/routes/memory-origin.js +14 -2
  114. package/dist/http/routes/memory-policy.js +5 -0
  115. package/dist/http/routes/session-sync.js +110 -15
  116. package/dist/http/routes/sessions.d.ts +6 -0
  117. package/dist/http/routes/sessions.js +143 -22
  118. package/dist/http/routes/side-query.d.ts +12 -4
  119. package/dist/http/routes/side-query.js +4 -5
  120. package/dist/http/routes/tasks.js +41 -33
  121. package/dist/http/server.d.ts +40 -44
  122. package/dist/http/server.js +13 -2
  123. package/dist/http/session-inherit-env.d.ts +3 -4
  124. package/dist/http/session-inherit-env.js +1 -1
  125. package/dist/http/wire-types.d.ts +8 -12
  126. package/dist/identity-source.d.ts +1 -1
  127. package/dist/identity-source.js +1 -1
  128. package/dist/index.d.ts +1 -0
  129. package/dist/lane-home-probe.d.ts +68 -42
  130. package/dist/lane-home-probe.js +53 -30
  131. package/dist/leader/wire.js +5 -4
  132. package/dist/memory-bundle-engine.d.ts +16 -9
  133. package/dist/memory-bundle-engine.js +29 -6
  134. package/dist/memory-operator-faces.d.ts +85 -30
  135. package/dist/memory-operator-faces.js +136 -30
  136. package/dist/memory-project-layer.d.ts +3 -21
  137. package/dist/memory-project-layer.js +11 -8
  138. package/dist/memory-scope-stores.d.ts +73 -0
  139. package/dist/memory-scope-stores.js +86 -0
  140. package/dist/memory-scope.d.ts +29 -5
  141. package/dist/memory-scope.js +16 -4
  142. package/dist/memory-sync-client.d.ts +70 -18
  143. package/dist/memory-sync-client.js +215 -117
  144. package/dist/memory-sync.d.ts +1 -1
  145. package/dist/memory-sync.js +3 -2
  146. package/dist/observability/cost-taxonomy.d.ts +2 -2
  147. package/dist/observability/fail-open.d.ts +12 -0
  148. package/dist/observability/fail-open.js +12 -0
  149. package/dist/observability/run-terminal.js +0 -1
  150. package/dist/orchestration/workflow-notify-journal.js +4 -4
  151. package/dist/org-memory-admission.d.ts +4 -3
  152. package/dist/org-memory-admission.js +6 -6
  153. package/dist/parked-decide.d.ts +34 -9
  154. package/dist/parked-decide.js +12 -19
  155. package/dist/parked-revive-surface.d.ts +12 -15
  156. package/dist/parked-revive-surface.js +3 -6
  157. package/dist/peer-seat.d.ts +13 -7
  158. package/dist/peer-seat.js +37 -3
  159. package/dist/plugins/adoption-log-sql.js +4 -4
  160. package/dist/plugins/approval-ask-store-file.d.ts +7 -0
  161. package/dist/plugins/approval-ask-store-file.js +11 -0
  162. package/dist/plugins/approval-ask-store-memory.d.ts +6 -0
  163. package/dist/plugins/approval-ask-store-memory.js +12 -0
  164. package/dist/plugins/approval-ask-store-sql.d.ts +22 -5
  165. package/dist/plugins/approval-ask-store-sql.js +44 -26
  166. package/dist/plugins/approval-nonce-store.js +4 -4
  167. package/dist/plugins/blob-backend.d.ts +4 -4
  168. package/dist/plugins/blob-backend.js +7 -7
  169. package/dist/plugins/breaker-state-sql.js +2 -2
  170. package/dist/plugins/caching-session-store.d.ts +6 -2
  171. package/dist/plugins/caching-session-store.js +9 -3
  172. package/dist/plugins/checkpoint-index-columns.js +2 -2
  173. package/dist/plugins/checkpoint-store-sql.d.ts +6 -5
  174. package/dist/plugins/checkpoint-store-sql.js +21 -23
  175. package/dist/plugins/device-store-sql.d.ts +25 -51
  176. package/dist/plugins/device-store-sql.js +68 -122
  177. package/dist/plugins/ensure-index.d.ts +1 -2
  178. package/dist/plugins/execution-placement-sql.d.ts +151 -0
  179. package/dist/plugins/execution-placement-sql.js +223 -0
  180. package/dist/plugins/file-history-store-sql.d.ts +9 -8
  181. package/dist/plugins/file-history-store-sql.js +9 -9
  182. package/dist/plugins/file-run-store.d.ts +6 -1
  183. package/dist/plugins/file-run-store.js +4 -0
  184. package/dist/plugins/fork-routing-session-store.d.ts +6 -0
  185. package/dist/plugins/fork-routing-session-store.js +16 -0
  186. package/dist/plugins/image-bake-store-sql.js +9 -9
  187. package/dist/plugins/image-index-sql.js +11 -11
  188. package/dist/plugins/leader-run-store-sql.js +4 -4
  189. package/dist/plugins/local-session-store.d.ts +149 -50
  190. package/dist/plugins/local-session-store.js +382 -107
  191. package/dist/plugins/mailbox-store-sql.d.ts +2 -1
  192. package/dist/plugins/mailbox-store-sql.js +4 -4
  193. package/dist/plugins/memory-engine-tidb.js +5 -5
  194. package/dist/plugins/memory-key-guards.d.ts +4 -0
  195. package/dist/plugins/memory-key-guards.js +1 -0
  196. package/dist/plugins/memory-optout-grant-store-sql.js +1 -1
  197. package/dist/plugins/memory-run-store.d.ts +1 -1
  198. package/dist/plugins/memory-sync-store-tidb.js +3 -3
  199. package/dist/plugins/one-time-migrations.d.ts +117 -8
  200. package/dist/plugins/one-time-migrations.js +408 -38
  201. package/dist/plugins/org-delivery-quota-store.js +2 -2
  202. package/dist/plugins/outcome-ledger-sql.d.ts +2 -2
  203. package/dist/plugins/outcome-ledger-sql.js +2 -2
  204. package/dist/plugins/permission-rule-store-sql.d.ts +17 -19
  205. package/dist/plugins/permission-rule-store-sql.js +29 -32
  206. package/dist/plugins/pg-pool.d.ts +7 -3
  207. package/dist/plugins/pg-session-storage.d.ts +31 -20
  208. package/dist/plugins/pg-session-storage.js +120 -52
  209. package/dist/plugins/remote-env-adb.d.ts +18 -19
  210. package/dist/plugins/remote-env-adb.js +91 -66
  211. package/dist/plugins/remote-env-device.d.ts +23 -31
  212. package/dist/plugins/remote-env-device.js +19 -17
  213. package/dist/plugins/remote-env-e2b.d.ts +27 -21
  214. package/dist/plugins/remote-env-e2b.js +91 -45
  215. package/dist/plugins/remote-env-file-error.d.ts +3 -1
  216. package/dist/plugins/remote-env-file-error.js +9 -3
  217. package/dist/plugins/remote-env-host.d.ts +31 -34
  218. package/dist/plugins/remote-env-host.js +91 -72
  219. package/dist/plugins/remote-env-k8s.d.ts +13 -29
  220. package/dist/plugins/remote-env-k8s.js +63 -55
  221. package/dist/plugins/remote-env-local-docker.d.ts +24 -12
  222. package/dist/plugins/remote-env-local-docker.js +49 -61
  223. package/dist/plugins/remote-env-ssh.d.ts +11 -19
  224. package/dist/plugins/remote-env-ssh.js +74 -57
  225. package/dist/plugins/remote-shell.d.ts +100 -3
  226. package/dist/plugins/remote-shell.js +166 -2
  227. package/dist/plugins/resume-anchor-store-sql.js +2 -2
  228. package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
  229. package/dist/plugins/retention-lane-store-sql.js +2 -2
  230. package/dist/plugins/retention-store-sql.d.ts +10 -7
  231. package/dist/plugins/retention-store-sql.js +13 -7
  232. package/dist/plugins/run-store-sql.d.ts +13 -3
  233. package/dist/plugins/run-store-sql.js +20 -15
  234. package/dist/plugins/schema-consistency.d.ts +21 -11
  235. package/dist/plugins/schema-consistency.js +15 -9
  236. package/dist/plugins/schema-drift-sentence.d.ts +27 -0
  237. package/dist/plugins/schema-drift-sentence.js +38 -0
  238. package/dist/plugins/schema-ensure-legs.d.ts +2 -3
  239. package/dist/plugins/schema-ensure-legs.js +2 -2
  240. package/dist/plugins/schema-live-columns.d.ts +1 -1
  241. package/dist/plugins/session-capture-record-store-sql.js +1 -1
  242. package/dist/plugins/session-fork.d.ts +54 -0
  243. package/dist/plugins/session-fork.js +38 -1
  244. package/dist/plugins/session-row-sql.d.ts +22 -0
  245. package/dist/plugins/session-row-sql.js +81 -0
  246. package/dist/plugins/session-rules-column.d.ts +1 -1
  247. package/dist/plugins/session-rules-column.js +1 -1
  248. package/dist/plugins/session-store.d.ts +1 -1
  249. package/dist/plugins/session-workspace-cell.d.ts +1 -1
  250. package/dist/plugins/session-workspace-cell.js +1 -1
  251. package/dist/plugins/shared-memory-store-sql.js +2 -2
  252. package/dist/plugins/sql-driver.d.ts +10 -5
  253. package/dist/plugins/sql-driver.js +6 -6
  254. package/dist/plugins/sql-errors.js +1 -1
  255. package/dist/plugins/store-backend.d.ts +5 -7
  256. package/dist/plugins/store-backend.js +23 -11
  257. package/dist/plugins/store-contracts.d.ts +25 -5
  258. package/dist/plugins/task-list-store-sql.js +11 -11
  259. package/dist/plugins/tidb-pool.d.ts +12 -7
  260. package/dist/plugins/tidb-pool.js +13 -7
  261. package/dist/plugins/tidb-session-storage.js +4 -4
  262. package/dist/plugins/tidb-session-store.d.ts +57 -26
  263. package/dist/plugins/tidb-session-store.js +127 -59
  264. package/dist/plugins/tool-result-store-sql.d.ts +5 -4
  265. package/dist/plugins/tool-result-store-sql.js +21 -13
  266. package/dist/plugins/user-input-ledger-sql.js +2 -2
  267. package/dist/plugins/workflow-journal-store-sql.js +5 -5
  268. package/dist/plugins/workflow-run-store-sql.js +19 -19
  269. package/dist/plugins/write-behind-counter.d.ts +2 -3
  270. package/dist/plugins/write-behind-counter.js +5 -5
  271. package/dist/project-memory.d.ts +9 -15
  272. package/dist/project-memory.js +5 -4
  273. package/dist/request-key-closure.js +1 -1
  274. package/dist/request-value-closure.d.ts +6 -7
  275. package/dist/request-value-closure.js +1 -3
  276. package/dist/resource-suspend.d.ts +14 -12
  277. package/dist/resource-suspend.js +1 -1
  278. package/dist/resource-window.d.ts +4 -3
  279. package/dist/run-local.d.ts +6 -0
  280. package/dist/run-local.js +34 -35
  281. package/dist/runs.d.ts +10 -5
  282. package/dist/runs.js +52 -66
  283. package/dist/security.d.ts +38 -12
  284. package/dist/security.js +8 -2
  285. package/dist/server-secret-env.d.ts +9 -5
  286. package/dist/session-children-retire.d.ts +27 -9
  287. package/dist/session-children-retire.js +9 -5
  288. package/dist/session-incarnation.d.ts +20 -10
  289. package/dist/session-incarnation.js +5 -3
  290. package/dist/session-policy-wire.d.ts +1 -1
  291. package/dist/session-row.d.ts +114 -5
  292. package/dist/session-row.js +55 -5
  293. package/dist/session-titler.d.ts +2 -2
  294. package/dist/sql-engine-posture.d.ts +1 -1
  295. package/dist/sql-engine-posture.js +1 -1
  296. package/dist/{plugins → stores-sql}/background-agent-store-sql.d.ts +2 -2
  297. package/dist/{plugins → stores-sql}/background-agent-store-sql.js +8 -8
  298. package/dist/{plugins → stores-sql}/session-policy-store-sql.d.ts +7 -5
  299. package/dist/{plugins → stores-sql}/session-policy-store-sql.js +12 -12
  300. package/dist/{plugins → stores-sql}/usage-window-store-sql.d.ts +1 -1
  301. package/dist/{plugins → stores-sql}/usage-window-store-sql.js +3 -3
  302. package/dist/task-a2a.d.ts +1 -1
  303. package/dist/task-a2a.js +5 -6
  304. package/dist/task-cwd.d.ts +6 -1
  305. package/dist/task-mcp.d.ts +22 -9
  306. package/dist/task-mcp.js +17 -9
  307. package/dist/terminal.d.ts +27 -0
  308. package/dist/terminal.js +6 -0
  309. package/dist/tool-approval.d.ts +6 -0
  310. package/dist/tool-approval.js +8 -1
  311. package/dist/trace/project.d.ts +1 -0
  312. package/dist/trace/project.js +1 -0
  313. package/dist/trace/redact.d.ts +3 -1
  314. package/dist/trace/redact.js +80 -28
  315. package/dist/trace/self-minted-wire.d.ts +169 -2
  316. package/dist/trace/self-minted-wire.js +54 -1
  317. package/dist/url-refusal.d.ts +1 -1
  318. package/dist/web-admin-client/apply-effective.d.ts +17 -3
  319. package/dist/web-admin-client/apply-effective.js +20 -10
  320. package/dist/web-admin-client/candidate-gate.d.ts +11 -7
  321. package/dist/web-admin-client/candidate-gate.js +1 -1
  322. package/dist/web-admin-client/http-client.d.ts +5 -4
  323. package/dist/web-admin-client/http-client.js +2 -2
  324. package/dist/web-admin-client/read-warnings.d.ts +7 -17
  325. package/dist/web-admin-client/read-warnings.js +5 -9
  326. package/dist/web-admin-client/skills-mcp.js +3 -2
  327. package/dist/web-admin-client/types.d.ts +6 -0
  328. package/package.json +3 -3
  329. package/wire-changes/server@7.139.0.json +348 -0
  330. package/wire-changes/server@7.140.0.json +184 -0
  331. package/dist/http/device-placement.d.ts +0 -175
  332. package/dist/http/device-placement.js +0 -145
@@ -45,7 +45,8 @@
45
45
  * `retentionSweepRuns`):开 ⇒ `managed`,关(缺省)⇒ `none`;local 形的店恒声明 `none`。删除的执行面是扫车道(`boot/retention-lane.ts`)与 SQL 店上的
46
46
  * 执行器,不在本装配点。所以本装配点对件D 只做两件事:①把策略与执行器递给 core 的启动期校验
47
47
  * (`assertRetentionCapability` —— 配对由引擎一个判官判:店声明 `managed` 而部署不跑执行器、执行器不是执行器,锁不锁都拒;锁着 + 店不能删 ⇒ 拒启,
48
- * 「策略锁着、数据永存」不许发生);②策略在场而没有任何 managed 店时打一条响亮 warn。**不**假装有执行面。
48
+ * 「策略锁着、数据永存」不许发生);②策略在场而扫车道关着(节律缺或为 0)时打一条响亮 warn,句说这个真因。**不**假装有执行面。
49
+ * 车道关着而策略在场只可能在 `audit-only` 档:`enforce` 而车道不齐在 `loadConfig` 就拒了(配置不变量 `retention-lane-complete`)。
49
50
  */
50
51
  import { type LockedKey, type ManagedRetentionCapability, type RunnerDeps } from "@sema-agent/core";
51
52
  import type { ServiceConfig } from "../config.js";
@@ -61,7 +62,7 @@ export interface GovernanceSeams {
61
62
  }
62
63
  /** 依赖收窄到真实消费面(接口隔离 —— 测试用真形字面量,零铸形)。 */
63
64
  export interface GovernanceSeamsCtx {
64
- config: Pick<ServiceConfig, "compliancePosture" | "lockedConfigKeys" | "retentionPolicy" | "mcpServers" | "requirePrincipal">;
65
+ config: Pick<ServiceConfig, "compliancePosture" | "lockedConfigKeys" | "retentionPolicy" | "retentionSweep" | "mcpServers" | "requirePrincipal">;
65
66
  logger: Pick<Logger, "info" | "warn">;
66
67
  /**
67
68
  * core 留存能力校验的对象集(名字进拒启文案)。喂的是**装配现场的真店**,不是「我以为装了什么」——
@@ -50,17 +50,15 @@ export function createGovernanceSeams(ctx) {
50
50
  const retentionPolicy = config.retentionPolicy;
51
51
  const locked = lockedKeys.has("retentionPolicy");
52
52
  assertRetentionCapability({ policy: retentionPolicy, locked, stores: retentionStores, executor: ctx.retentionExecutor });
53
- if (retentionPolicy !== undefined) {
54
- const managed = retentionStores.filter((s) => s.store?.retention === "managed");
55
- if (managed.length === 0) {
56
- logger.warn("retention_policy_not_executed", {
57
- maxAgeDays: retentionPolicy.maxAgeDays,
58
- note: "RETENTION_MAX_AGE_DAYS is configured but NO wired store declares retention:\"managed\" (the retention sweep lane is off — " +
59
- "RETENTION_SWEEP_INTERVAL_SEC unset or 0 — or the store medium has no sweep) — the policy is a DECLARATION only; nothing " +
60
- "deletes data on its account. It is relayed to the engine for the startup capability check; run the sweep lane on a SQL " +
61
- "backend to make it effective.",
62
- });
63
- }
53
+ if (retentionPolicy !== undefined && config.retentionSweep.intervalSec === 0) {
54
+ logger.warn("retention_policy_not_executed", {
55
+ maxAgeDays: retentionPolicy.maxAgeDays,
56
+ mode: config.retentionSweep.mode,
57
+ retentionSweepIntervalSec: config.retentionSweep.intervalSec,
58
+ note: "RETENTION_MAX_AGE_DAYS is set but RETENTION_SWEEP_INTERVAL_SEC is unset or 0, so the retention sweep lane is off: nothing deletes data — " +
59
+ "or records what it would delete — on this policy's account; the policy is a declaration relayed to the engine's startup capability check. " +
60
+ "To run the lane set RETENTION_SWEEP_INTERVAL_SEC above 0 on a SQL backend (RETENTION_MODE=audit-only records what would be deleted; enforce deletes it).",
61
+ });
64
62
  }
65
63
  return { compliancePostureResolver, lockedConfig, retentionPolicy, lockedKeys };
66
64
  }
@@ -56,35 +56,6 @@
56
56
  */
57
57
  import { type ExecutionLane, type RemoteExecProvider } from "../execution-lane-caps.js";
58
58
  import type { MemoryEngineBackend } from "@sema-agent/settings-schema/execution-lanes";
59
- /**
60
- * [ref] A3 源头修(黑板 [ref]/[ref]/[ref],[ref])—— `memoryPersistenceCapable` 的**装配层有效值**:
61
- * operator 显式 env 恒赢;env 缺席时,`REMOTE_EXEC=host` 腿自动补 `true`;其余一律缺席(现行为)。
62
- *
63
- * ## 为什么 host 腿可以自动声明(而且只有 host 腿)
64
- * core r13/r14 的 withhold 判据是「执行环境暴露 remote 面」——它对 host 腿是**误伤**:host 腿的文件
65
- * 工具就跑在**这台机器**的 fs 上(`hostSemanticsLane`,与 core 的 remote 判决是两根轴,见下方 facts 注),
66
- * 记忆根也在这台机器上,「执行车道与记忆根共享文件平面」这个 capable=true 所断言的**车道级事实**由
67
- * 构造成立。剩下的围栏维(记忆根是否落在该次任务的 fs 授权边界内)在 in-process 上**同样存在**而 core
68
- * 并不 withhold——它由本模块的 ② 号 warn、fs 门的 `path_not_in_root` 拒绝、以及 core 准入席自动放行写家
69
- * ([ref])这套既有处置管,不归 withhold 判据管。所以 host 腿自动 true 与 in-process 的默认行为**同等诚实**。
70
- * 沙箱腿(e2b/k8s/ssh/local-docker)文件平面在沙箱盘,withhold 是对的,恒不自动。
71
- *
72
- * ## 为什么不是「围栏覆盖记忆根」的更严合取
73
- * boot 期对 host 腿**算不出**围栏根(host factory 每任务另铸 `sema-host-*` 子目录、per-session cwd 可整个
74
- * 换掉 workspaceBase——见 boot/stores.ts 的 codex 已核注释),那个合取在恰恰需要它的腿上永不可满足;
75
- * 而且它断言的是 per-task 事实,不是本键的车道级语义。
76
- *
77
- * ## 位置与纪律
78
- * 单源:resolve-spec 的 spec 直通(引擎据它判「本会话没有持久记忆」的披露与四只记忆面臂)、boot 审计的 declared 位
79
- * 两处都必须读本函数,禁各自重算(operator-knob 律:显式 env 的优先权在这一个函数里执法一次)。
80
- * 自动补位在 boot 日志上必须可见(stores.ts 的 info 行),部署方随时可用显式 env 覆盖。
81
- */
82
- export declare function effectiveMemoryPersistenceCapable(config: {
83
- remoteExec?: {
84
- provider?: string;
85
- };
86
- memoryPersistenceCapable?: boolean;
87
- }): boolean | undefined;
88
59
  /** boot 期可知的全部事实。每一位都必须由调用点从真配置/真装配结果取,禁在本模块内重算(重算=第二真源)。 */
89
60
  export interface MemoryWriteBoundaryFacts {
90
61
  /** 引擎的**挂载平面**根 —— 引擎真正读写条目的那棵树,由 `memoryMountRootOf(backend, root)` 单铸点取
@@ -97,16 +68,9 @@ export interface MemoryWriteBoundaryFacts {
97
68
  memoryRoot: string | undefined;
98
69
  /** 执行车道名,只进文案(归一读口 `executionLaneOf` 的答案;[ref] 起不在调用点手写 `?? "in-process"`)。 */
99
70
  lane: ExecutionLane;
100
- /** 该车道的文件工具是否跑在**本机** fs 上(in-process / `REMOTE_EXEC=host`)。false = 沙箱盘,与记忆根分平面。
101
- * ⚠️ 这一位管的是**文件平面**,与下面的 `coreRemoteExecutionEnv` 是**两根轴**,别合并(codex round2
102
- * [medium] 就是把它们当成一根轴的后果):`host` 车道的文件平面就是本机(这一位 true),但 core 眼里它
103
- * 仍是 remote(那一位也 true)。 */
71
+ /** 该车道的路径是不是本机的文件(执行环境块 `hostLocalPaths`:in-process 的桩块 / `REMOTE_EXEC=host` 为真)。false = 沙箱 / 远端 / 设备盘,
72
+ * 与记忆根分平面 —— 引擎在这一形上不教 `# Memory` 写指令(除非部署声明 `memoryPersistenceCapable: true`),判的是同一键。 */
104
73
  hostSemanticsLane: boolean;
105
- /** core 的 `isRemoteExecutionEnv` 对本部署执行环境的判决 —— 判别位 = `REMOTE_EXEC` 有没有设(**含
106
- * `host`**:core 的判别是鸭子类型,`remote-env-host.ts` 把那几件全实现了,亲验坐实)。
107
- * 5.26.0 的 r13/r14 收窄按的是**这一位**,不是文件平面:凡 core 判 remote,`# Memory` 写指令一律撤,
108
- * 除非声明 `memoryPersistenceCapable: true`。 */
109
- coreRemoteExecutionEnv: boolean;
110
74
  /** 部署声明 `MEMORY_PERSISTENCE_CAPABLE`(三态)。两极都让本模块闭嘴,但理由不同 —— 见各臂注释。 */
111
75
  declaredCapable: boolean | undefined;
112
76
  /** 本部署的记忆引擎后端(`config.memoryEngineBackend`)。**只进文案**,不参与任何判决 —— 它在这里的
@@ -119,31 +83,30 @@ export interface MemoryWriteBoundaryFacts {
119
83
  containmentRoots: readonly string[];
120
84
  }
121
85
  /**
122
- * [ref] —— 审计的**车道那四位**由本函数从能力表派生(boot/stores.ts 的装配点只调它,不再就地手写):
123
- * 改前 stores 里是 `lane === undefined || lane === "host"`(同义折,门 D R3)+ `config.remoteExec !== undefined`
124
- * (座位上的裸缺席判,R4)+ `lane ?? "in-process"` ×3(R2)。两根轴各读表里各自那一位,不合并:
125
- * · `hostSemanticsLane` ⇐ `hostFilePlane`(文件平面在不在本机);
126
- * · `coreRemoteExecutionEnv` ⇐ 同名位(core 拿没拿到执行环境)。
127
- * 读数逐车道不变(对账:`test/execution-lane-caps.test.ts` 的真装配点联合覆盖格)。`processCwd` 由调用点传
128
- * (stores 传 `process.cwd()`),本函数保持纯。
86
+ * 审计的**车道三位**由本函数派生(boot/stores.ts 的装配点只调它,不就地手写):
87
+ * · `lane` ⇐ 归一读口 `executionLaneOf`;
88
+ * · `hostSemanticsLane` ⇐ 执行环境块 `hostLocalPaths`(唯一作者 `capabilitiesFor`;引擎撤不撤写指令读的是同一键);
89
+ * · `containmentRoots` ⇐ 只有 in-process 给得出(见下)。
90
+ * `processCwd` 由调用点传(stores 传 `process.cwd()`),本函数保持纯。
129
91
  */
130
92
  export declare function buildMemoryBoundaryLaneFacts(config: {
131
93
  readonly remoteExec?: {
132
94
  readonly provider: RemoteExecProvider;
95
+ readonly s3Snapshot?: unknown;
133
96
  } | undefined;
134
- }, processCwd: string): Pick<MemoryWriteBoundaryFacts, "lane" | "hostSemanticsLane" | "coreRemoteExecutionEnv" | "containmentRoots">;
97
+ }, processCwd: string): Pick<MemoryWriteBoundaryFacts, "lane" | "hostSemanticsLane" | "containmentRoots">;
135
98
  /** 一条启动告警:`tag` 进日志事件名(可被运维按名过滤/告警),`detail` 是给人读的整句(含恢复路径)。 */
136
99
  export interface MemoryWriteBoundaryWarning {
137
100
  tag: "memory_root_outside_write_boundary" | "memory_remote_lane_write_instruction_dropped";
138
101
  detail: string;
139
102
  }
140
103
  /**
141
- * 判两件事,互斥(remote 上不叠 host 的围栏话 —— 围栏根本不在这台机器上,说了是噪音):
104
+ * 判两件事,互斥(路径不是本机的车道上不叠围栏话 —— 围栏根本不在这台机器上,说了是噪音):
142
105
  *
143
- * ① **remote 车道**(只可能因为 `MEMORY_ENGINE_REMOTE_LANE=allow` 才在这里还有引擎):core 5.26.0 的
144
- * r13/r14 收窄把 `# Memory` 写指令在 remote executionEnv 上撤了(沙箱手带够不着 host 记忆根),
145
- * 官方恢复路径是声明 `memoryPersistenceCapable: true`。未声明 ⇒ 点名 warn,把恢复旋钮写进句子里。
146
- * ② **host 车道**:记忆根不在任何一个已知围栏根内 ⇒ 模型被教着往一个 fs 工具够不到的路径写。
106
+ * ① **路径不是本机的车道**(块 `hostLocalPaths` 为假:沙箱 / 远端 / 设备;记忆引擎在这里只可能因为 `MEMORY_ENGINE_REMOTE_LANE=allow`
107
+ * 或 DB 记忆面才在):引擎不教 `# Memory` 写指令(手带够不着本机的记忆根),官方恢复路径是声明 `memoryPersistenceCapable: true`。
108
+ * 未声明 ⇒ 点名 warn,把恢复旋钮写进句子里。
109
+ * ② **路径是本机的车道**(in-process / host):记忆根不在任何一个已知围栏根内 ⇒ 模型被教着往一个 fs 工具够不到的路径写。
147
110
  *
148
111
  * 两极声明都让本模块闭嘴,但理由不同,别合并:
149
112
  * · `true` = operator 自证有推断看不见的持久通道(共享挂载 / 自定义 writer),我们的结构判断本就不该
@@ -1,17 +1,10 @@
1
1
  import { resolve } from "node:path";
2
- import { executionLaneCaps, executionLaneOf, laneWiresExecutionEnv } from "../execution-lane-caps.js";
3
- export function effectiveMemoryPersistenceCapable(config) {
4
- if (config.memoryPersistenceCapable !== undefined)
5
- return config.memoryPersistenceCapable;
6
- return config.remoteExec?.provider === "host" ? true : undefined;
7
- }
2
+ import { capabilitiesFor, executionLaneOf } from "../execution-lane-caps.js";
8
3
  export function buildMemoryBoundaryLaneFacts(config, processCwd) {
9
4
  const lane = executionLaneOf(config.remoteExec?.provider);
10
- const caps = executionLaneCaps(lane);
11
5
  return {
12
6
  lane,
13
- hostSemanticsLane: caps.hostFilePlane === "supported",
14
- coreRemoteExecutionEnv: laneWiresExecutionEnv(lane),
7
+ hostSemanticsLane: capabilitiesFor(config).hostLocalPaths,
15
8
  containmentRoots: lane === "in-process" ? [processCwd] : [],
16
9
  };
17
10
  }
@@ -21,25 +14,22 @@ function isInside(child, root) {
21
14
  return c === r || c.startsWith(r === "/" ? "/" : `${r}/`);
22
15
  }
23
16
  export function buildMemoryWriteBoundaryAudit(facts) {
24
- const { memoryRoot, lane, hostSemanticsLane, coreRemoteExecutionEnv, declaredCapable, containmentRoots, engineBackend } = facts;
17
+ const { memoryRoot, lane, hostSemanticsLane, declaredCapable, containmentRoots, engineBackend } = facts;
25
18
  if (memoryRoot === undefined)
26
19
  return { warnings: [] };
27
20
  if (declaredCapable !== undefined)
28
21
  return { warnings: [] };
29
- if (coreRemoteExecutionEnv) {
30
- const plane = hostSemanticsLane
31
- ? `the model's file tools DO run on this worker's filesystem, but core classifies this execution environment as ` +
32
- `remote (it exposes the remote-env surface), so the instruction is withheld anyway`
33
- : `the model's file tools write the SANDBOX filesystem while the memory root (${memoryRoot}) lives on this worker`;
22
+ if (!hostSemanticsLane) {
34
23
  return {
35
24
  warnings: [
36
25
  {
37
26
  tag: "memory_remote_lane_write_instruction_dropped",
38
- detail: `the memory engine is wired over the "${lane}" execution lane and ${plane}. ` +
39
- `Since core 5.26.0 the "# Memory" WRITE instruction is withheld on a remote execution environment, so this ` +
40
- `deployment reads memory but no longer teaches the model how to save into it. If this lane genuinely reaches ` +
41
- `the memory root, declare it: MEMORY_PERSISTENCE_CAPABLE=true restores the write instruction. If it does not, ` +
42
- `MEMORY_PERSISTENCE_CAPABLE=false makes the read-only state explicit to the model instead of leaving it silent.`,
27
+ detail: `the memory engine is wired over the "${lane}" execution lane and the model's file tools write the SANDBOX filesystem ` +
28
+ `while the memory root (${memoryRoot}) lives on this worker. The engine withholds the "# Memory" WRITE instruction when ` +
29
+ `the execution environment's paths are not this worker's files, so this deployment reads memory but does not teach ` +
30
+ `the model how to save into it. If this lane genuinely reaches the memory root, declare it: ` +
31
+ `MEMORY_PERSISTENCE_CAPABLE=true restores the write instruction. If it does not, MEMORY_PERSISTENCE_CAPABLE=false ` +
32
+ `makes the read-only state explicit to the model instead of leaving it silent.`,
43
33
  },
44
34
  ],
45
35
  };
@@ -1,7 +1,9 @@
1
1
  import { type LaneHomeDeployment } from "../execution-lane-caps.js";
2
+ import { type MemoryScopeStores } from "../memory-scope-stores.js";
3
+ import type { SessionCaptureRecordSource } from "../plugins/store-backend.js";
2
4
  import type { RestartSliceCtx } from "../web-admin-client/restart-signal.js";
3
5
  import type { MemoryConsolidationDriverConfig, ServiceConfig } from "../config-types.js";
4
- import { resolveMemoryConsolidationDriver, type ConsolidationWriteJudge, type ConsolidationWriteJudgeInput, type EngineNotice, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type MemoryBackend, type MemoryConsolidationDriverDeps, type PermissionRuleStoreProvider, type SessionCaptureRecordStore } from "@sema-agent/core";
6
+ import { resolveMemoryConsolidationDriver, type ConsolidationWriteJudge, type ConsolidationWriteJudgeInput, type EngineNotice, type ConsolidationDriverRunRow, type ConsolidationRunReceipt, type MemoryConsolidationDriverDeps, type PermissionRuleStoreProvider } from "@sema-agent/core";
5
7
  /**
6
8
  * 座解析的 options 形 = core 解析器交回的那只(core 7.50.0 起它**不含** `writeJudge`:判官不是模型席的一部分,由调用方在动词上带)。
7
9
  * 取解析器的返回型而不是自己写 `Omit<…>`:形的属主是 core 的解析器,本仓不持第二份。
@@ -462,14 +464,19 @@ export interface MemoryConsolidationFaces {
462
464
  lastRun(scope: string): ConsolidationDriverRunRow | undefined;
463
465
  }
464
466
  /**
465
- * 在**已装配的记忆后端**上建 consolidation 操作面。命名照 CLAUDE.md 工厂律:返回带行为的活对象 ⇒ `create*`。
467
+ * 在**记忆作用域店**上建 consolidation 操作面。命名照 CLAUDE.md 工厂律:返回带行为的活对象 ⇒ `create*`。
468
+ *
469
+ * ## 引擎建在哪只店上:被整理的那一层住的那只
470
+ * 整理一层 = 读这一层的库、把产物写回这一层 —— 店只问记忆作用域店(`memoryStoreForRequest(stores, [scope])`;读不出的层键 ⇒ `request.memory_layer`)。
471
+ * 一只店一只引擎,`lastRun` 读那只引擎的控制面(run 账住在被整理的那只店的控制面里)。修前恒在部署的店上建:目录钉住的部署上,
472
+ * 类型化个人层(`user:` / `userproj:` / `org:`)的库在个人挂载上的另一只店里,整理读到的是空库、产物落在会话不读的店。
466
473
  *
467
474
  * ## 为什么这里现构一只引擎(与 `createMemoryComplianceFaces` / `createMemoryBundleFaces` 同一条理由)
468
475
  *
469
476
  * 本仓**没有**一个长命的 `MemoryEngine` 实例:`boot/stores.ts` 装配出来的 `memoryEngine` 是
470
- * `{ backend, root }` 二元组,真引擎由 core 的 Runner **每任务现构**。HTTP 面要一个引擎就得自己构。
471
- * 两只引擎不会各说各话:控制面由后端写死(`backend.controlPlaneRoot`),gate / run 账 / plan 归档
472
- * 全住在那里,所以操作面引擎与每任务引擎看的是**同一本**账。
477
+ * 记忆作用域店,真引擎由 core 的 Runner **每任务现构**。HTTP 面要一个引擎就得自己构。
478
+ * 两只引擎不会各说各话:控制面由店写死(`backend.controlPlaneRoot`),gate / run 账 / plan 归档
479
+ * 全住在那里,所以操作面引擎与每任务引擎在同一只店上看的是**同一本**账。
473
480
  *
474
481
  * ## `consolidation: {}` = 出厂缺省,**显式在场**
475
482
  *
@@ -481,10 +488,7 @@ export interface MemoryConsolidationFaces {
481
488
  * `multiNode` 也**刻意不声明**:声明它就必须注入一只全局租约,而本仓今天没有(见顶注「v1 没有周期腿」
482
489
  * 那一段的同一条理由)——不声明 = 单机 plan-seat CAS 是唯一互斥,core 的契约原话如此,不是偷偷降级。
483
490
  */
484
- export declare function createMemoryConsolidationFaces(store: {
485
- backend: MemoryBackend;
486
- root: string;
487
- }, input: {
491
+ export declare function createMemoryConsolidationFaces(stores: MemoryScopeStores, input: {
488
492
  seat: ConsolidationDriverSeat;
489
493
  scopes: readonly string[];
490
494
  /** 部署的 provenance 姿态,原样交给引擎(缺席 ⇒ core 缺省 `carry`)。 */
@@ -496,13 +500,13 @@ export declare function createMemoryConsolidationFaces(store: {
496
500
  /** 停因自由文本的**运维日志**座(缺席 = 没人听,不影响任何行为)。载荷由 {@link buildStopDetailAudit}
497
501
  * 铸,调用点在单飞回调**之内** ⇒ 一轮真 run 一行,并入的等待者不各落一行。 */
498
502
  onStopDetail?: (audit: ReturnType<typeof buildStopDetailAudit>) => void;
499
- /** [ref]②(383 §2.1b):capture opt-out 记录的 SQL 载体(main.ts 单实例,与 Runner 同源)。
503
+ /** [ref]②(383 §2.1b):capture opt-out 记录的按平面取用源(main.ts 取一次,与 Runner 同源;每只引擎按它那只店的控制面取)。
500
504
  * 🔴 这只引擎是四只 operator 面里**真读名册**的那只:`consolidationEligibility` 第四臂
501
505
  * (engine.js `listCaptureOptOutSessions`)拿它筛掉 opt-out 会话的贡献条目 —— SQL 部署上漏喂
502
506
  * = 驱动器读文件空名册 ⇒ 蒸馏器放大用户明说不要记的内容(S-5 真实失效形;全站同批注入律,
503
507
  * 机器钉 capture-optout-lane ②)。[ref] 起 local 车道在引擎接线时也供(core 文件三腿,同一只控制面);
504
508
  * 缺席 ⇒ 记忆面暗(引擎未接线),与 Runner 同本。 */
505
- captureRecordStore?: SessionCaptureRecordStore;
509
+ captureRecords?: SessionCaptureRecordSource;
506
510
  /** core 7.50.0:整理跑的**写判官座**(必填 —— 缺席不是「没有规则」,core 也拒)。操作面不判任何东西,只把它原样递给驱动动词:
507
511
  * 早问库目录一次、应用时问每个产物文件,答 `no_objection` 以外一律拒写。装配层给哪一只见 {@link createOperatorValveWriteJudge}。 */
508
512
  writeJudge: ConsolidationWriteJudge;
@@ -4,8 +4,9 @@ import { buildOperatorRosterWayOut } from "../http/principal-gate.js";
4
4
  import { memoryMountRootOf } from "../memory-scope.js";
5
5
  import { executionLaneHomeDir } from "../execution-lane-caps.js";
6
6
  import { DEFAULT_MODEL_REF, resolveMainModel } from "../model-select.js";
7
- import { backendOwnsControlPlane } from "../memory-operator-faces.js";
8
- import { createConsolidationWriteJudge, deliverWriteRefusal, expandTiers, MemoryEngine, readConsolidationDriverRun, resolveMemoryConsolidationDriver, runMemoryConsolidationDriver, } from "@sema-agent/core";
7
+ import { backendOwnsControlPlane, captureRecordStoreOf } from "../memory-operator-faces.js";
8
+ import { memoryStoreForRequest } from "../memory-scope-stores.js";
9
+ import { createConsolidationWriteJudge, deliverWriteRefusal, expandTiers, MemoryEngine, modelOriginOf, readConsolidationDriverRun, resolveMemoryConsolidationDriver, runMemoryConsolidationDriver, } from "@sema-agent/core";
9
10
  export function resolveConsolidationDriverSeat(deps) {
10
11
  let options;
11
12
  try {
@@ -151,7 +152,7 @@ export function consolidationSeatBillingOf(plane) {
151
152
  catch (err) {
152
153
  return { kind: "unresolvable", fault: `the main model (${DEFAULT_MODEL_REF}) does not resolve: ${err instanceof Error ? err.message : String(err)}` };
153
154
  }
154
- return seat.entry === main ? { kind: "main-model", mainModel: main.id } : { kind: "own-model", seatModel: seat.entry.id, mainModel: main.id };
155
+ return modelOriginOf(seat.entry) === modelOriginOf(main) ? { kind: "main-model", mainModel: main.id } : { kind: "own-model", seatModel: seat.entry.id, mainModel: main.id };
155
156
  }
156
157
  export function resolveConsolidationValve(input) {
157
158
  const decided = decideConsolidationValve(input);
@@ -333,22 +334,32 @@ export function createOperatorValveWriteJudge(facts) {
333
334
  return judge(target);
334
335
  };
335
336
  }
336
- export function createMemoryConsolidationFaces(store, input) {
337
- const engine = new MemoryEngine({
338
- backend: store.backend,
339
- memoryDir: memoryMountRootOf(store.backend, store.root),
340
- consolidation: {},
341
- ...(input.provenance !== undefined ? { provenance: input.provenance } : {}),
342
- ...(input.onIncident !== undefined ? { onIncident: input.onIncident } : {}),
343
- ...(input.captureRecordStore !== undefined ? { captureRecordStore: input.captureRecordStore } : {}),
344
- });
337
+ export function createMemoryConsolidationFaces(stores, input) {
338
+ const engines = new Map();
339
+ const engineOf = (scope) => {
340
+ const store = memoryStoreForRequest(stores, [scope]);
341
+ const known = engines.get(store);
342
+ if (known !== undefined)
343
+ return known;
344
+ const records = captureRecordStoreOf(input.captureRecords, store);
345
+ const engine = new MemoryEngine({
346
+ backend: store,
347
+ memoryDir: memoryMountRootOf(store, stores.root),
348
+ consolidation: {},
349
+ ...(input.provenance !== undefined ? { provenance: input.provenance } : {}),
350
+ ...(input.onIncident !== undefined ? { onIncident: input.onIncident } : {}),
351
+ ...(records !== undefined ? { captureRecordStore: records } : {}),
352
+ });
353
+ engines.set(store, engine);
354
+ return engine;
355
+ };
345
356
  const flight = createPerScopeSingleFlight();
346
357
  return {
347
358
  seat: input.seat.seat,
348
359
  model: input.seat.model,
349
360
  scopes: input.scopes,
350
361
  run: (scope) => flight(scope, async () => {
351
- const receipt = await runMemoryConsolidationDriver(engine, scope, {
362
+ const receipt = await runMemoryConsolidationDriver(engineOf(scope), scope, {
352
363
  ...input.seat.options,
353
364
  writeJudge: input.writeJudge,
354
365
  ...(input.onNotice !== undefined ? { onNotice: input.onNotice } : {}),
@@ -361,7 +372,7 @@ export function createMemoryConsolidationFaces(store, input) {
361
372
  }
362
373
  return receipt;
363
374
  }),
364
- lastRun: (scope) => readConsolidationDriverRun(engine.controlPlaneRoot, scope),
375
+ lastRun: (scope) => readConsolidationDriverRun(engineOf(scope).controlPlaneRoot, scope),
365
376
  };
366
377
  }
367
378
  //# sourceMappingURL=memory-consolidation.js.map
@@ -1,4 +1,3 @@
1
- import { type MemoryBackend } from "@sema-agent/core";
2
1
  import { SessionEnvironmentSelection, selectEnvironmentTool } from "../capabilities/select-environment-tool.js";
3
2
  import { sendUserFileTool } from "../capabilities/send-user-file-tool.js";
4
3
  import { selectScenario } from "../capabilities/scenarios.js";
@@ -15,8 +14,9 @@ import type { Metrics } from "../observability/metrics.js";
15
14
  import { PerTaskImageRegistry } from "../per-task-image.js";
16
15
  import type { StoreBackend } from "../plugins/store-backend.js";
17
16
  import { type TaskAttachmentStore } from "../plugins/task-attachment-store.js";
18
- import { type createPrincipalEntitlementsClient } from "../runtime-caps-resolver.js";
17
+ import type { createPrincipalEntitlementsClient } from "../runtime-caps-resolver.js";
19
18
  import { type OwnerAwareSessionStore } from "../security.js";
19
+ import type { MemoryScopeStores } from "../memory-scope-stores.js";
20
20
  import type { MemorySyncRunner } from "../memory-sync-client.js";
21
21
  import type { PeerDesk } from "../peer-seat.js";
22
22
  import type { RunnerDepsOnAsk } from "./runner-deps.js";
@@ -55,10 +55,8 @@ export interface ResolveSpecCtx {
55
55
  taskTimeoutSec: number;
56
56
  selectEnvTool: ReturnType<typeof selectEnvironmentTool> | undefined;
57
57
  sendUserFileToolSpec: ReturnType<typeof sendUserFileTool> | undefined;
58
- memoryEngine: {
59
- backend: MemoryBackend;
60
- root: string;
61
- } | undefined;
58
+ /** 记忆引擎对象 = 记忆作用域店(`memory-scope-stores.ts`;项目层准备一步按层问它的店)。 */
59
+ memoryEngine: MemoryScopeStores | undefined;
62
60
  /** [ref]:记忆同步腿(开 `MEMORY_SYNC_*` 且记忆引擎接线时在场)—— 项目层准备一步把本任务的项目层交给它跟踪(`memory-project-layer.ts`)。 */
63
61
  memorySyncRunner: MemorySyncRunner | undefined;
64
62
  durableEnabled: boolean;
@@ -25,7 +25,6 @@ import { bindAttachmentsForTask } from "../plugins/task-attachment-store.js";
25
25
  import { resourceSuspendOptIn } from "../resource-suspend.js";
26
26
  import { routeServiceTask, supPostureOverrides } from "../router/route-orchestration.js";
27
27
  import { tightenGoverned } from "../governance-overrides.js";
28
- import { gateExecutionLane } from "../runtime-caps-resolver.js";
29
28
  import { applyRuntimeGovernance } from "../runtime-governance.js";
30
29
  import { HttpError, createCodedHttpError, encodeCheckpointScope } from "../security.js";
31
30
  import { headReadOf, sessionFaceOfHead } from "../session-incarnation.js";
@@ -52,9 +51,12 @@ import { TENANCY_WALL_CLOCK_BASE_SEC, enableForkFromBody, normalizeRetainSubagen
52
51
  import { redactSecrets } from "../trace/redact.js";
53
52
  import { DeferredSandboxPathEnv, sandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
54
53
  import { executionLaneHomeDir, executionLaneOf, laneWiresExecutionEnv } from "../execution-lane-caps.js";
55
- import { effectiveMemoryPersistenceCapable } from "./memory-boundary.js";
56
54
  import { withUnattendedLeg } from "../unattended-permission-mode.js";
57
55
  import { fieldConflictFacts } from "../field-conflict.js";
56
+ function unrooted(spec) {
57
+ const { sessionId: _neverWritten, ...resolved } = spec;
58
+ return resolved;
59
+ }
58
60
  export function createResolveSpec(ctx) {
59
61
  const { config, logger, metrics, localRoot, scenarios, principalCaps, centerRuntimeCapsResolver, getKeyResolver, taskAttachmentStore, perSessionCwd, setSessionCwd, setSessionShellEnv, fenceSessionOwner, hookLlm, hookAgent, fleetBus, hookWakeBus, resumeAnchorStore, ownerAware, taskLimitCaps, taskTimeoutSec, selectEnvTool, sendUserFileToolSpec, memoryEngine, memorySyncRunner, durableEnabled, approvalExemptionStore, checkpointStore, imageIndex, perTaskImage, sessionEnvSelection, liveQuestionFace, approverSeat, lockedKeys, loadedSkills, peerDesk, } = ctx;
60
62
  const deploymentSkillSources = new Map(loadedSkills.map((k) => [k.spec.name, k.source]));
@@ -72,7 +74,7 @@ export function createResolveSpec(ctx) {
72
74
  const sessionCwd = auth?.sessionId ? effectiveHostWorkspace(perSessionCwd.get(auth.sessionId), {}) : undefined;
73
75
  return sessionCwd ?? (executionLaneOf(config.remoteExec?.provider) === "in-process" ? process.cwd() : undefined);
74
76
  };
75
- const memoryProjectLayers = createMemoryProjectLayers({ backend: memoryEngine?.backend, syncRunner: memorySyncRunner, log: logger });
77
+ const memoryProjectLayers = createMemoryProjectLayers({ stores: memoryEngine, syncRunner: memorySyncRunner, log: logger });
76
78
  if (onlySensitiveBaseline)
77
79
  logger.warn(onlySensitiveBaseline.event, onlySensitiveBaseline.fields);
78
80
  const approvalGrantNotice = buildApprovalGrantNotice(config);
@@ -179,9 +181,9 @@ export function createResolveSpec(ctx) {
179
181
  };
180
182
  const gateScenarioAndAppend = async (body, auth, opts) => {
181
183
  const scenarioName = await scenarioGate(auth?.principal, body.scenario);
182
- gateExecutionLane(await principalCaps?.executionRuling(auth?.principal), executionLaneOf(config.remoteExec?.provider), logger);
183
- const sessionWitness = auth?.sessionId !== undefined ? { sessionId: auth.sessionId, incarnation: (sessionHeadOf === undefined ? undefined : sessionFaceOfHead(auth.sessionId, await sessionHeadOf(auth.sessionId)))?.incarnation ?? null } : undefined;
184
- const cap = selectScenario(scenarios, scenarioName)(body, auth?.principal, sessionWitness !== undefined ? { sessionId: sessionWitness.sessionId, delegationRoot: sessionWitness } : {});
184
+ const root = opts.execution.root;
185
+ const sessionWitness = { sessionId: root, incarnation: (sessionHeadOf === undefined ? undefined : sessionFaceOfHead(root, await sessionHeadOf(root)))?.incarnation ?? null };
186
+ const cap = selectScenario(scenarios, scenarioName)(body, auth?.principal, { sessionId: sessionWitness.sessionId, delegationRoot: sessionWitness });
185
187
  const acceptedAppend = acceptAppendSystemPrompt(body.appendSystemPrompt, (detail) => logger.warn("append_system_prompt_dropped", { detail, sessionId: auth?.sessionId ?? null }));
186
188
  const objective = typeof body.objective === "string" ? body.objective : "";
187
189
  const parsedSettings = parseTaskSettings(body.settings, opts?.leg === "fresh" || !taskHooksHonored(config) ? {} : { storedHooksReread: storedHooksRereadM20(new Date().toISOString().slice(0, 10)) });
@@ -375,7 +377,6 @@ export function createResolveSpec(ctx) {
375
377
  appendSystemPrompt: acceptedAppend,
376
378
  ...(body.outputStyle !== undefined ? { outputStyle: body.outputStyle } : {}),
377
379
  ...(body.projectMemory !== undefined ? { projectMemory: body.projectMemory } : {}),
378
- sessionId: auth?.sessionId,
379
380
  ...(legProjectId !== undefined ? { projectId: legProjectId } : {}),
380
381
  principal: auth?.principal,
381
382
  images: body.images,
@@ -396,7 +397,6 @@ export function createResolveSpec(ctx) {
396
397
  suggestNextPrompts: normalizeSuggestNextPrompts(body.suggestNextPrompts),
397
398
  restoreFiles: body.restoreFiles === true ? true : undefined,
398
399
  acceptPartialRestore: body.acceptPartialRestore === true ? true : undefined,
399
- ...(body.rewindFiles === true ? { rewindFiles: true } : {}),
400
400
  rewindFilesTo: rewindFilesToEntryId,
401
401
  ...(body.fileHistory === "disabled" ? { fileHistory: "disabled" } : {}),
402
402
  additionalDirectories,
@@ -492,7 +492,7 @@ export function createResolveSpec(ctx) {
492
492
  memory: memoryEngine
493
493
  ? memorySpecForRequest(auth?.memoryScope, projectKey, body.memoryWrite, s4DefaultScopes, { multiTenant: config.requirePrincipal === true }, { memory: body.memory, memoryCapture: body.memoryCapture })
494
494
  : undefined,
495
- ...((v) => (v !== undefined ? { memoryPersistenceCapable: v } : {}))(effectiveMemoryPersistenceCapable(config)),
495
+ ...(config.memoryPersistenceCapable !== undefined ? { memoryPersistenceCapable: config.memoryPersistenceCapable } : {}),
496
496
  tools: ((base) => {
497
497
  const extra = [...(selectEnvTool ? [selectEnvTool] : []), ...(sendUserFileToolSpec ? [sendUserFileToolSpec] : [])];
498
498
  const merged = extra.length > 0 ? [...(base ?? []), ...extra] : base;
@@ -523,7 +523,6 @@ export function createResolveSpec(ctx) {
523
523
  ...((rs) => (rs ? { resourceSuspend: rs } : {}))(resourceSuspendOptIn({
524
524
  enabled: config.resourceSuspend,
525
525
  ttlSec: config.resourceSuspendTtlSec,
526
- isVerify: body.verify === true,
527
526
  isCascade: body.cascade === true,
528
527
  scope: encodeCheckpointScope(auth?.principal),
529
528
  totalTokens: config.resourceSuspendTotalTokens,
@@ -670,9 +669,7 @@ export function createResolveSpec(ctx) {
670
669
  };
671
670
  const resolveSpecForLeg = async (body, req, auth, opts) => {
672
671
  const spec = await resolveSpec(body, req, auth, opts);
673
- if (opts?.unattendedLeg !== true)
674
- return spec;
675
- return withUnattendedLeg(spec);
672
+ return unrooted(opts.unattendedLeg !== true ? spec : withUnattendedLeg(spec));
676
673
  };
677
674
  return resolveSpecForLeg;
678
675
  }
@@ -158,14 +158,15 @@ export interface RetentionSweepOutcome {
158
158
  * · core 那道判**配对**,锁不锁都判(`executor` 必给):声明 `managed` 的店 × 没有执行器(`null`)⇒ 拒;执行器四个契约方法
159
159
  * (`listRetentionDomains` / `expireCheckpoints` / `deleteExpiredSessions` / `deleteOrphanToolResults`)缺一 ⇒ 拒;
160
160
  * **锁着**的策略盖在声明 `none` 的店上 ⇒ 拒。它不问 lane 开没开、策略在不在,也不拦没锁时「执行器在场 × 店声明 `none`」(部署可以持有执行器而不在某只店上跑);
161
- * · **本道**问的是「lane 开着的时候,它真的能删吗」——**不看 locked 状态**:策略在场、执行器在场、lane 调的**五**个方法都在
161
+ * · **本道**问的是「lane 开着的时候,它接得上能删的东西吗」——**不看 locked 状态**:执行器在场、lane 调的**五**个方法都在
162
162
  * (多出的 `previewRetention` 是 audit-only 档的读数口,不在 core 的四方法契约里,引擎的检查覆盖不到它)、每只被 lane 消费的店都声明 `managed`。
163
163
  * 「执行器在场」与「契约方法齐」两格和引擎的判官说的是同一件事(各自一句拒句),其余几格是引擎不问的。
164
164
  *
165
+ * 「lane 开着而没有视界(天数)」与「`RETENTION_MODE=enforce` 而车道不齐」不在本道:那是配置事实,判在 `loadConfig` 的配置不变量段
166
+ * (`config-invariants.ts` 的 `retentionLaneRefusal`,一条规则)—— 到得了本道的部署,lane 开着就一定有视界。本道只判**接线**(配置看不见的那几格)。
167
+ *
165
168
  * 为什么本道必须存在:引擎的门不拦
166
- * ① `RETENTION_SWEEP_INTERVAL_SEC>0` 而 policy 缺席 = 没有有效 cutoff 的 sweep(每 tick 什么都算不出来,
167
- * 读数一路 0,看起来像"没有候选");
168
- * ② 没锁时,执行器在场 × 一只 `"none"` 的店 —— 部署于是**广告了一个不执行的留存面**:能力位说
169
+ * · 没锁时,执行器在场 × 一只 `"none"` 的店 —— 部署于是**广告了一个不执行的留存面**:能力位说
169
170
  * `{mode,maxAgeDays}`、审计表也在长,而那只店的行谁都没在删。
170
171
  * 本仓的 SQL 后端按同一个事实(扫车道开不开,`plugins/retention-store-sql.ts` 的 `retentionSweepRuns`)给它铸的三只店声明词,所以 lane 开着时
171
172
  * 这三只店在这一格上恒是 `managed`;这一格防的是声明与 lane 脱钩的店(别的后端、替身)。
@@ -176,7 +177,6 @@ export interface RetentionSweepOutcome {
176
177
  */
177
178
  export declare function assertRetentionLaneWirable(input: {
178
179
  intervalSec: number;
179
- policy: RetentionPolicy | undefined;
180
180
  executor: RetentionExecutor | undefined;
181
181
  stores: ReadonlyArray<{
182
182
  name: string;
@@ -7,12 +7,6 @@ export function assertRetentionLaneWirable(input) {
7
7
  if (input.intervalSec <= 0)
8
8
  return;
9
9
  const lockNote = input.locked === true ? " (the retentionPolicy key is LOCKED, but this gate refuses either way)" : "";
10
- if (input.policy === undefined) {
11
- throw new Error(`RETENTION_SWEEP_INTERVAL_SEC=${input.intervalSec} arms the managed-retention sweep lane, but RETENTION_MAX_AGE_DAYS is not ` +
12
- `configured — the lane would run with NO horizon to compute a cutoff from, enumerate domains every tick and delete nothing, ` +
13
- `while the capability surface advertises a retention face that does not exist${lockNote}. Set RETENTION_MAX_AGE_DAYS, or set ` +
14
- `RETENTION_SWEEP_INTERVAL_SEC=0 to leave the lane off.`);
15
- }
16
10
  if (input.executor === undefined) {
17
11
  throw new Error(`RETENTION_SWEEP_INTERVAL_SEC=${input.intervalSec} arms the managed-retention sweep lane, but this deployment wires NO retention ` +
18
12
  `executor — the destructive store methods live on the SQL backends only (DB_BACKEND=mysql|pg); the local/file backend honestly ` +
@@ -66,7 +66,9 @@ export declare function createRunnerDepsOnAsk(toolApproval: ToolApprovalCoordina
66
66
  * [ref]:第五词 `shell-gate-off` 随 core 7.34.0 的 off 车道一起退役(引擎侧零发射点),同批删 —— 它唯一的本仓消费者
67
67
  * (「本 session 显式 bypass ⇒ 降级 info」那条回查腿与 `boot/session-shell-gate-registry.ts` 登记簿)一并删干净。所以这是「按实现亲读」的开集快照,不是 core 类型闭集——词表外的值原样进日志并标
68
68
  * `classificationKnown:false`(指标标签折 `unknown`),不吞不编;与安装包的锁步由 test/boot-runner-deps-shared-base.test.ts
69
- * 的 dist 扫描格钉住(两种发射写法都读;读不出词的经变量发射点本身红;core 加词/收进 d.ts 那天先红)。 */
69
+ * 的 dist 扫描格钉住(两种发射写法都读;读不出词的经变量发射点本身红;core 加词/收进 d.ts 那天先红)。
70
+ * 第七词 `peer-seat-hold`(runtask 的 `holdDeclarations`,字面量):对端座的三员对象里 `hold` / `release` 抛了 ⇒ 引擎报一次、该引用
71
+ * 不被持有;座是本仓的 desk,所以这是部署自己的故障,与其余六词同走 warn + 计数。 */
70
72
  export declare const CONFIG_ADVISORY_CLASSIFICATIONS: ReadonlySet<string>;
71
73
  /** [ref]:core 的 [ref] 前缀缓存**断裂**探测器交给宿主的根因**闭集**,以及每个词的日志级别。
72
74
  * 闭集**不抄词**:词源直接取 core 公开导出的 `CacheBreakFinding["cause"]`(`@sema-agent/core` 根导出,
@@ -181,7 +183,7 @@ export interface RunnerDepsCtx {
181
183
  * (`backend.sessionCaptureRecords()`,main.ts 取**一次**、与四只 operator 面引擎同一只源 —— 全站同批
182
184
  * 注入律,机器钉 = test/memory-capture-optout-lane.test.ts ②)。在场 ⇒ `capture:"off"` 声明与中途翻转
183
185
  * verb 真持久;缺席 ⇒ core 读作「无店」,而 core 的 `captureCarrierUnsupported` 判据是**席位在不在**
184
- * (不是「文件形能不能用」),叠上 `isRemoteExecutionEnv` 的接口形鸭子判 ⇒ 两条 ingress 都拒
186
+ * (不是「文件形能不能用」),叠上执行环境块 `hostLocalPaths` 为假(沙箱 / 远端 / 设备车道)⇒ 两条 ingress 都拒
185
187
  * `config.memory_capture_unsupported`。[ref] 起三条车道都供(SQL 双方言 twin / local 的控制面文件三腿),
186
188
  * 所以缺席今天只剩一个成因:**记忆面暗**的 local 部署(那时 core 的 capture 腿本就不参与)。 */
187
189
  sessionCaptureRecords: SessionCaptureRecordSource | undefined;
@@ -245,7 +247,7 @@ export interface RunnerDepsCtx {
245
247
  }
246
248
  /** [ref] A10 留档发现②:main runner `RunnerDeps` 与 main.ts subRunner 字面量之间此前手工重复
247
249
  * 的 ~15 个键,类型标注见 {@link createSharedRunnerDeps} 头注。 */
248
- export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "memoryEngineDir" | "allowedTools" | "crossBoundaryPosture" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "mods" | "toolResultStore" | "checkpointStore" | "hands" | "sessionPolicyStore" | "usageWindows" | "usageWindowStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "mcpRevocations" | "peerSeat">;
250
+ export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "readDenyFloorRequired" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "memoryEngineDir" | "allowedTools" | "crossBoundaryPosture" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "mods" | "toolResultStore" | "checkpointStore" | "hands" | "sessionPolicyStore" | "usageWindows" | "usageWindowStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "mcpRevocations" | "peerSeat">;
249
251
  /**
250
252
  * [ref] A10 留档发现②(review 2026-07-29,[ref]§三族A 同源修补的延续):main runner 的
251
253
  * `RunnerDeps` 字面量(下方 `createRunnerDeps`)与 `main.ts` 里 subRunner 的 `new Runner({...})`
@@ -320,7 +322,7 @@ export declare function createEngineNoticeSeat(logger: {
320
322
  * 「键为 undefined」与「键缺席」对引擎逐字等价)。**不复制引擎缺省**(`roots`/`static-face`/`carry`/`open`/
321
323
  * CC parity 20/200 一个都不抄):上游改缺省之日起本仓不会成为第二份真源。
322
324
  */
323
- export type DeploymentPostureSeats = Pick<RunnerDeps, "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "allowedTools" | "agentConfigDir" | "crossBoundaryPosture">;
325
+ export type DeploymentPostureSeats = Pick<RunnerDeps, "readFace" | "readDenyPatterns" | "readDenyBuiltinTiers" | "readDenyBuiltinExclude" | "readDenyFloorRequired" | "memoryDelegationEvidence" | "memoryProvenance" | "memoryCapturePolicy" | "delegationEntryCaps" | "crossSessionInbound" | "crossSessionDialogExpiry" | "writeProtectedPaths" | "allowedTools" | "agentConfigDir" | "crossBoundaryPosture">;
324
326
  /** 本族读的配置切面:席名与 config 键同名的那几席 + 运维 allow 表(席 `allowedTools` ← config `approvalGrant`,env 名 `APPROVAL_GRANT` 不改)
325
327
  * + LKG 覆写路径(`readDenyPatterns` 席并入它派生的读拒行,`lkgReadDenyRows`)+ 主体门(席 `crossBoundaryPosture` ← config `requirePrincipal`)。 */
326
328
  export type DeploymentPostureConfig = Pick<ServiceConfig, Exclude<keyof DeploymentPostureSeats, "allowedTools" | "crossBoundaryPosture"> | "approvalGrant" | "configLkgPath" | "requirePrincipal">;
@@ -32,6 +32,7 @@ export const CONFIG_ADVISORY_CLASSIFICATIONS = new Set([
32
32
  "file-history-no-store",
33
33
  "interaction-posture-refused",
34
34
  "memory-tools-not-mounted",
35
+ "peer-seat-hold",
35
36
  "sandbox-admission-unavailable",
36
37
  "shared-memory-not-mounted",
37
38
  ]);
@@ -78,6 +79,7 @@ export function buildDeploymentPostureSeats(config) {
78
79
  readDenyPatterns: readDenyAdditions ? readDenyAdditions : undefined,
79
80
  readDenyBuiltinTiers: config.readDenyBuiltinTiers ?? undefined,
80
81
  readDenyBuiltinExclude: config.readDenyBuiltinExclude ?? undefined,
82
+ readDenyFloorRequired: config.readDenyFloorRequired,
81
83
  agentConfigDir: config.agentConfigDir ?? undefined,
82
84
  memoryDelegationEvidence: config.memoryDelegationEvidence ?? undefined,
83
85
  memoryProvenance: config.memoryProvenance ?? undefined,
@@ -131,7 +133,7 @@ export function createSharedRunnerDeps(ctx) {
131
133
  lockedConfig: ctx.governanceSeams.lockedConfig,
132
134
  retentionPolicy: ctx.governanceSeams.retentionPolicy,
133
135
  mcpRevocations: ctx.mcpRevocations ? ctx.mcpRevocations : undefined,
134
- peerSeat: ctx.peerDesk.seat.answer,
136
+ peerSeat: ctx.peerDesk.seat,
135
137
  };
136
138
  return shared;
137
139
  }
@@ -21,7 +21,6 @@ import type { createSessionStore } from "../plugins/session-store.js";
21
21
  import type { TaskAttachmentStore } from "../plugins/task-attachment-store.js";
22
22
  import type { FileHistoryErasureFace } from "../file-history-capture.js";
23
23
  import type { OwnerAwareSessionStore } from "../security.js";
24
- import type { DeviceStore } from "../device-store.js";
25
24
  import { SessionWatchRegistry } from "../session-watch.js";
26
25
  import type { TaskListLane } from "./task-list-lane.js";
27
26
  import { type RunnerDeps } from "@sema-agent/core";
@@ -48,8 +47,6 @@ export interface SessionFacesCtx {
48
47
  workflowCompletionInbox: WorkflowCompletionInbox | undefined;
49
48
  /** [ref]:会话级任务清单车道(E21 级联的一条腿)。缺席 = 装配未接本车道 ⇒ 无清单可删。 */
50
49
  taskListLane: TaskListLane | undefined;
51
- /** device lane 的四表店(E21 级联的一条腿:`device_session` 绑定行随会话删)。缺席 = 非 SQL 后端。 */
52
- deviceStore: DeviceStore | undefined;
53
50
  /** per-session cwd/shellEnv 登记簿的清除口(E21 级联的一条腿,codex R1-F1)。缺席 = 装配未接。 */
54
51
  dropSessionScoped: ((sid: string) => void) | undefined;
55
52
  /** [ref]:会话盒(`session.<id>`)的信箱 + 它的收件人生命周期面(E21 级联的一条腿)。**成对**在场