@sema-agent/core 7.62.0 → 7.64.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 (320) hide show
  1. package/CHANGELOG.md +936 -0
  2. package/dist/agents/cc-peer-directory.js +1 -0
  3. package/dist/agents/cc-peer-wire.d.ts +4 -0
  4. package/dist/agents/cc-peer-wire.js +1 -0
  5. package/dist/agents/cc-uds-peer-channel.js +5 -0
  6. package/dist/agents/cross-session-judge.d.ts +3 -1
  7. package/dist/agents/cross-session-judge.js +4 -1
  8. package/dist/agents/peer-directory.d.ts +8 -0
  9. package/dist/agents/peer-directory.js +4 -0
  10. package/dist/agents/peer-held-queue.d.ts +9 -3
  11. package/dist/agents/peer-held-queue.js +12 -9
  12. package/dist/agents/peer-idle.d.ts +20 -1
  13. package/dist/agents/peer-idle.js +23 -12
  14. package/dist/agents/peer-notice-route.d.ts +16 -5
  15. package/dist/agents/peer-notice-route.js +11 -9
  16. package/dist/agents/peer-notices.d.ts +25 -8
  17. package/dist/agents/peer-notices.js +6 -1
  18. package/dist/agents/peer-session-drain.d.ts +32 -6
  19. package/dist/agents/peer-session-drain.js +100 -26
  20. package/dist/agents/send-message-tool.d.ts +7 -0
  21. package/dist/agents/send-message-tool.js +18 -6
  22. package/dist/agents/subagent-transcript-placement.d.ts +23 -0
  23. package/dist/agents/subagent-transcript-placement.js +14 -0
  24. package/dist/agents/subagent.js +102 -54
  25. package/dist/brain/route-adjudicator.js +9 -4
  26. package/dist/core/allow-entry.d.ts +4 -0
  27. package/dist/core/approval-object.js +1 -1
  28. package/dist/core/arg-summary.js +1 -1
  29. package/dist/core/ask-origin.d.ts +1 -1
  30. package/dist/core/ask-origin.js +2 -2
  31. package/dist/core/ask-question.d.ts +2 -2
  32. package/dist/core/ask-unresolvable-notice.d.ts +13 -4
  33. package/dist/core/ask-unresolvable-notice.js +10 -3
  34. package/dist/core/auto-compaction.d.ts +7 -5
  35. package/dist/core/background-agent-store.d.ts +7 -0
  36. package/dist/core/background-agent-store.js +3 -0
  37. package/dist/core/canonical-json.d.ts +23 -13
  38. package/dist/core/canonical-json.js +4 -4
  39. package/dist/core/checkpoint-queries.d.ts +50 -4
  40. package/dist/core/checkpoint-queries.js +42 -17
  41. package/dist/core/checkpoint-requirements.d.ts +3 -3
  42. package/dist/core/checkpoint-requirements.js +2 -1
  43. package/dist/core/checkpoint-row-verdict.d.ts +15 -4
  44. package/dist/core/checkpoint-row-verdict.js +22 -2
  45. package/dist/core/checkpoint-store.d.ts +28 -11
  46. package/dist/core/checkpoint-store.js +45 -4
  47. package/dist/core/compliance.d.ts +6 -2
  48. package/dist/core/compliance.js +3 -3
  49. package/dist/core/context-settings.d.ts +40 -9
  50. package/dist/core/context-settings.js +32 -10
  51. package/dist/core/engine-attestation.d.ts +27 -7
  52. package/dist/core/engine-attestation.js +5 -1
  53. package/dist/core/engine-notice.d.ts +43 -5
  54. package/dist/core/extension-requester.d.ts +9 -0
  55. package/dist/core/extension-requester.js +7 -0
  56. package/dist/core/file-history-store.d.ts +28 -0
  57. package/dist/core/file-history-store.js +48 -5
  58. package/dist/core/fs-write-gate-policy.js +1 -1
  59. package/dist/core/gate-fold.js +2 -0
  60. package/dist/core/gate-lanes.js +2 -0
  61. package/dist/core/gate-outcome.d.ts +39 -2
  62. package/dist/core/gate-outcome.js +20 -1
  63. package/dist/core/git-worktree-env.d.ts +62 -3
  64. package/dist/core/git-worktree-env.js +91 -30
  65. package/dist/core/governance-codes.d.ts +9 -3
  66. package/dist/core/governance-codes.js +17 -3
  67. package/dist/core/leg-identity.d.ts +19 -1
  68. package/dist/core/leg-identity.js +12 -0
  69. package/dist/core/mailbox-store.d.ts +39 -4
  70. package/dist/core/mailbox-store.js +14 -2
  71. package/dist/core/memory-engine/consolidation-driver.d.ts +32 -17
  72. package/dist/core/memory-engine/consolidation-driver.js +99 -98
  73. package/dist/core/memory-engine/consolidation.d.ts +74 -10
  74. package/dist/core/memory-engine/consolidation.js +183 -11
  75. package/dist/core/memory-engine/control-objects.d.ts +25 -0
  76. package/dist/core/memory-engine/control-objects.js +151 -0
  77. package/dist/core/memory-engine/control-plane-adoption.d.ts +48 -0
  78. package/dist/core/memory-engine/control-plane-adoption.js +159 -0
  79. package/dist/core/memory-engine/data-plane.d.ts +8 -4
  80. package/dist/core/memory-engine/data-plane.js +11 -6
  81. package/dist/core/memory-engine/delegation-settlement.d.ts +58 -40
  82. package/dist/core/memory-engine/delegation-settlement.js +270 -85
  83. package/dist/core/memory-engine/dual-root.d.ts +12 -6
  84. package/dist/core/memory-engine/dual-root.js +11 -7
  85. package/dist/core/memory-engine/engine.d.ts +136 -58
  86. package/dist/core/memory-engine/engine.js +491 -394
  87. package/dist/core/memory-engine/entry-scan.d.ts +8 -0
  88. package/dist/core/memory-engine/entry-scan.js +3 -0
  89. package/dist/core/memory-engine/file-backend.d.ts +62 -60
  90. package/dist/core/memory-engine/file-backend.js +122 -198
  91. package/dist/core/memory-engine/index.d.ts +8 -7
  92. package/dist/core/memory-engine/index.js +7 -6
  93. package/dist/core/memory-engine/landing-admission.d.ts +5 -3
  94. package/dist/core/memory-engine/landing-admission.js +3 -3
  95. package/dist/core/memory-engine/layout.d.ts +127 -46
  96. package/dist/core/memory-engine/layout.js +264 -109
  97. package/dist/core/memory-engine/memory-backend-contract.d.ts +26 -1
  98. package/dist/core/memory-engine/memory-backend-contract.js +476 -0
  99. package/dist/core/memory-engine/memory-deployment.d.ts +42 -11
  100. package/dist/core/memory-engine/memory-deployment.js +54 -15
  101. package/dist/core/memory-engine/origin-clearance.d.ts +12 -3
  102. package/dist/core/memory-engine/origin-clearance.js +68 -9
  103. package/dist/core/memory-engine/scope-contract.d.ts +52 -11
  104. package/dist/core/memory-engine/scope-contract.js +68 -19
  105. package/dist/core/memory-engine/session-write-home.d.ts +37 -2
  106. package/dist/core/memory-engine/session-write-home.js +38 -11
  107. package/dist/core/memory-engine/sync-client.d.ts +3 -1
  108. package/dist/core/memory-engine/sync-client.js +7 -0
  109. package/dist/core/memory-engine/sync-report.d.ts +3 -2
  110. package/dist/core/memory-engine/sync-report.js +6 -2
  111. package/dist/core/memory-engine/tools.d.ts +2 -2
  112. package/dist/core/memory-engine/tools.js +10 -10
  113. package/dist/core/memory-engine/types.d.ts +155 -19
  114. package/dist/core/memory-engine/types.js +2 -0
  115. package/dist/core/memory.js +15 -6
  116. package/dist/core/mode-policy.js +3 -3
  117. package/dist/core/mods/agent-stations.d.ts +18 -0
  118. package/dist/core/mods/agent-stations.js +8 -6
  119. package/dist/core/mods/extension-call.d.ts +4 -0
  120. package/dist/core/mods/extension-call.js +8 -0
  121. package/dist/core/mods/stations.d.ts +20 -1
  122. package/dist/core/mods/stations.js +21 -2
  123. package/dist/core/mods/tool-call.js +3 -4
  124. package/dist/core/parent-spec-seat.d.ts +2 -2
  125. package/dist/core/park-selfcheck.js +2 -2
  126. package/dist/core/pause-registry.d.ts +2 -0
  127. package/dist/core/pause-registry.js +3 -0
  128. package/dist/core/peer-channel.d.ts +5 -0
  129. package/dist/core/permission-rule-consent.d.ts +26 -8
  130. package/dist/core/permission-rule-consent.js +76 -36
  131. package/dist/core/permission-rule-store.d.ts +72 -13
  132. package/dist/core/permission-rule-store.js +29 -8
  133. package/dist/core/read-only-shell.js +3 -2
  134. package/dist/core/redaction-marks.d.ts +8 -0
  135. package/dist/core/redaction-marks.js +6 -0
  136. package/dist/core/refusal-echo.d.ts +20 -0
  137. package/dist/core/refusal-echo.js +33 -0
  138. package/dist/core/remote-env.d.ts +12 -1
  139. package/dist/core/remote-env.js +3 -0
  140. package/dist/core/retention.d.ts +180 -10
  141. package/dist/core/retention.js +45 -0
  142. package/dist/core/retired-keys.d.ts +5 -0
  143. package/dist/core/retired-keys.js +3 -0
  144. package/dist/core/rule-offer-read.d.ts +0 -4
  145. package/dist/core/rule-offer-read.js +2 -18
  146. package/dist/core/runner/child-tree.d.ts +29 -3
  147. package/dist/core/runner/child-tree.js +39 -16
  148. package/dist/core/runner/classifier-ladder.d.ts +7 -1
  149. package/dist/core/runner/classifier-ladder.js +4 -2
  150. package/dist/core/runner/compact-session.js +10 -7
  151. package/dist/core/runner/compaction-call-options.d.ts +7 -7
  152. package/dist/core/runner/compaction-call-options.js +3 -2
  153. package/dist/core/runner/contracts.d.ts +39 -11
  154. package/dist/core/runner/delegation-owner.d.ts +10 -3
  155. package/dist/core/runner/delegation-owner.js +4 -1
  156. package/dist/core/runner/gate-exit.d.ts +6 -0
  157. package/dist/core/runner/gate-exit.js +13 -4
  158. package/dist/core/runner/inherited-ask-grants.js +1 -1
  159. package/dist/core/runner/memory-consolidation-driver.d.ts +10 -5
  160. package/dist/core/runner/memory-consolidation-driver.js +12 -9
  161. package/dist/core/runner/memory-consolidation-write-judge.d.ts +2 -1
  162. package/dist/core/runner/memory-consolidation-write-judge.js +3 -2
  163. package/dist/core/runner/person-path-rows.d.ts +8 -3
  164. package/dist/core/runner/person-path-rows.js +5 -1
  165. package/dist/core/runner/placement-fence.d.ts +12 -0
  166. package/dist/core/runner/placement-fence.js +20 -6
  167. package/dist/core/runner/prepare-ask-lane.js +5 -5
  168. package/dist/core/runner/prepare-caps-and-workflow.d.ts +7 -2
  169. package/dist/core/runner/prepare-caps-and-workflow.js +7 -4
  170. package/dist/core/runner/prepare-config-doors.js +4 -0
  171. package/dist/core/runner/prepare-delegation-surface.d.ts +3 -0
  172. package/dist/core/runner/prepare-delegation-surface.js +2 -2
  173. package/dist/core/runner/prepare-execution-env.js +17 -6
  174. package/dist/core/runner/prepare-gate-stations.d.ts +5 -0
  175. package/dist/core/runner/prepare-gate-stations.js +5 -5
  176. package/dist/core/runner/prepare-hands-readface.d.ts +2 -1
  177. package/dist/core/runner/prepare-hands-readface.js +5 -4
  178. package/dist/core/runner/prepare-inherited-gate.d.ts +13 -9
  179. package/dist/core/runner/prepare-inherited-gate.js +12 -6
  180. package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -4
  181. package/dist/core/runner/prepare-memory-engine-session.js +4 -4
  182. package/dist/core/runner/prepare-memory.d.ts +7 -2
  183. package/dist/core/runner/prepare-memory.js +41 -39
  184. package/dist/core/runner/prepare-park-ask.js +4 -3
  185. package/dist/core/runner/prepare-policy-chain.js +7 -7
  186. package/dist/core/runner/prepare-prompt-inputs.js +1 -1
  187. package/dist/core/runner/prepare-task.js +26 -18
  188. package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -1
  189. package/dist/core/runner/prepare-wiring-manifest.js +3 -2
  190. package/dist/core/runner/prepare-workspace-restore.js +3 -6
  191. package/dist/core/runner/resume-admission.d.ts +2 -2
  192. package/dist/core/runner/resume-admission.js +2 -23
  193. package/dist/core/runner/role-resolution-table.d.ts +98 -0
  194. package/dist/core/runner/role-resolution-table.js +62 -0
  195. package/dist/core/runner/run-compaction-machinery.js +2 -2
  196. package/dist/core/runner/run-identity-wiring.js +12 -9
  197. package/dist/core/runner/run-leg.js +9 -5
  198. package/dist/core/runner/run-notification-lane.js +22 -22
  199. package/dist/core/runner/run-recovery-lanes.js +3 -3
  200. package/dist/core/runner/run-settle-and-teardown.js +3 -2
  201. package/dist/core/runner/run-terminal-adoption.js +1 -1
  202. package/dist/core/runner/run-turn-boundary.js +14 -15
  203. package/dist/core/runner/runtask.js +1 -1
  204. package/dist/core/runner/terminal-account.js +1 -1
  205. package/dist/core/runner/tool-occurrence.d.ts +4 -2
  206. package/dist/core/runner/tool-occurrence.js +2 -2
  207. package/dist/core/runner-deps.d.ts +7 -3
  208. package/dist/core/secret-env.d.ts +1 -1
  209. package/dist/core/secret-env.js +4 -4
  210. package/dist/core/session-checkout.d.ts +168 -0
  211. package/dist/core/session-checkout.js +579 -0
  212. package/dist/core/session-store.d.ts +12 -4
  213. package/dist/core/session-store.js +23 -3
  214. package/dist/core/session.d.ts +16 -2
  215. package/dist/core/session.js +3 -0
  216. package/dist/core/shell-read-silence.js +8 -0
  217. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +0 -12
  218. package/dist/core/store-contracts/checkpoint-store-contract.js +6 -7
  219. package/dist/core/store-contracts/peer-directory-contract.js +8 -1
  220. package/dist/core/store-contracts/session-store-contract.js +39 -0
  221. package/dist/core/task-event.d.ts +30 -5
  222. package/dist/core/task-notification.d.ts +119 -32
  223. package/dist/core/task-notification.js +186 -100
  224. package/dist/core/task-registry-agent.d.ts +25 -2
  225. package/dist/core/task-registry-agent.js +56 -22
  226. package/dist/core/task-registry-shared.d.ts +33 -11
  227. package/dist/core/task-registry.d.ts +33 -9
  228. package/dist/core/task-registry.js +36 -18
  229. package/dist/core/task-spec-members.js +1 -1
  230. package/dist/core/task-spec.d.ts +27 -2
  231. package/dist/core/tool-errors.d.ts +14 -6
  232. package/dist/core/tool-errors.js +1 -1
  233. package/dist/core/tool-policy.d.ts +32 -13
  234. package/dist/core/tool-policy.js +27 -17
  235. package/dist/core/tool-result-store.d.ts +20 -0
  236. package/dist/core/tool-spec.d.ts +42 -19
  237. package/dist/core/trace.d.ts +3 -2
  238. package/dist/core/types.d.ts +1 -1
  239. package/dist/core/untrusted-egress.d.ts +15 -4
  240. package/dist/core/untrusted-egress.js +23 -22
  241. package/dist/core/workflow-journal-store.d.ts +11 -0
  242. package/dist/core/workflow-journal-store.js +7 -0
  243. package/dist/core/workflow-run-store.d.ts +9 -0
  244. package/dist/core/workflow-run-store.js +6 -0
  245. package/dist/core/workspace-snapshot.d.ts +3 -1
  246. package/dist/core/workspace-snapshot.js +1 -0
  247. package/dist/engine/compaction/compaction.d.ts +2 -1
  248. package/dist/engine/harness/types.d.ts +67 -1
  249. package/dist/engine/harness/types.js +108 -0
  250. package/dist/engine/session/import-validate.js +6 -1
  251. package/dist/engine/session/session.d.ts +30 -1
  252. package/dist/engine/session/session.js +48 -1
  253. package/dist/index.d.ts +12 -7
  254. package/dist/index.js +12 -7
  255. package/dist/internal/harness-types.d.ts +1 -1
  256. package/dist/orchestration/run-workflow-tool.d.ts +8 -1
  257. package/dist/orchestration/run-workflow-tool.js +8 -0
  258. package/dist/orchestration/workflow-types.d.ts +2 -1
  259. package/dist/orchestration/workflow.d.ts +6 -0
  260. package/dist/orchestration/workflow.js +5 -2
  261. package/dist/stores/file/checkpoint-store.d.ts +6 -0
  262. package/dist/stores/file/checkpoint-store.js +4 -1
  263. package/dist/stores/file/file-history-store.d.ts +13 -0
  264. package/dist/stores/file/file-history-store.js +75 -13
  265. package/dist/stores/file/index.d.ts +11 -1
  266. package/dist/stores/file/index.js +7 -11
  267. package/dist/stores/file/permission-rule-store.d.ts +23 -0
  268. package/dist/stores/file/permission-rule-store.js +75 -7
  269. package/dist/stores/file/session-store.js +2 -1
  270. package/dist/stores/file/tool-result-store.d.ts +14 -0
  271. package/dist/stores/file/tool-result-store.js +39 -2
  272. package/dist/stores/file/workflow-journal-store.d.ts +4 -0
  273. package/dist/stores/file/workflow-journal-store.js +17 -0
  274. package/dist/stores/file/workflow-run-store.d.ts +3 -0
  275. package/dist/stores/file/workflow-run-store.js +15 -0
  276. package/dist/tools/fs/bash-program-position.js +3 -3
  277. package/dist/tools/fs/program-read-model.d.ts +34 -10
  278. package/dist/tools/fs/program-read-model.js +37 -7
  279. package/dist/tools/fs/program-read-model.rows.js +13 -2
  280. package/dist/tools/fs/read-deny.d.ts +28 -3
  281. package/dist/tools/fs/read-deny.js +18 -2
  282. package/dist/tools/fs/removal-targets.js +3 -3
  283. package/dist/tools/fs/safety.d.ts +2 -0
  284. package/dist/tools/fs/safety.js +1 -1
  285. package/dist/tools/fs/shell-read-argv.d.ts +8 -1
  286. package/dist/tools/fs/shell-read-argv.js +34 -29
  287. package/dist/tools/fs/shell-read-bindings.d.ts +2 -0
  288. package/dist/tools/fs/shell-read-bindings.js +5 -1
  289. package/dist/tools/fs/shell-read-brace.d.ts +18 -0
  290. package/dist/tools/fs/shell-read-brace.js +79 -0
  291. package/dist/tools/fs/shell-read-check.d.ts +8 -2
  292. package/dist/tools/fs/shell-read-check.js +16 -14
  293. package/dist/tools/fs/shell-read-establish.js +23 -16
  294. package/dist/tools/fs/shell-read-judge.d.ts +11 -0
  295. package/dist/tools/fs/shell-read-judge.js +3 -3
  296. package/dist/tools/fs/shell-read-plan.d.ts +10 -0
  297. package/dist/tools/fs/shell-read-plan.js +189 -93
  298. package/dist/tools/fs/shell-read-start.d.ts +19 -9
  299. package/dist/tools/fs/shell-read-start.js +20 -12
  300. package/dist/tools/fs/shell-read-word.d.ts +10 -0
  301. package/dist/tools/fs/shell-read-word.js +9 -5
  302. package/dist/tools/fs/shell-read-workdir.d.ts +26 -7
  303. package/dist/tools/fs/shell-read-workdir.js +73 -12
  304. package/dist/tools/fs/shell-read-write-targets.js +13 -8
  305. package/dist/tools/worktree.d.ts +3 -2
  306. package/dist/tools/worktree.js +7 -35
  307. package/package.json +3 -2
  308. package/test/export-surface.snapshot.json +135 -11
  309. package/wire-changes/core-stores-sql@7.63.0.json +30 -0
  310. package/wire-changes/core-stores-sql@7.64.0.json +30 -0
  311. package/wire-changes/core@7.63.0.json +3523 -0
  312. package/wire-changes/core@7.64.0.json +2653 -0
  313. package/wire-changes/mods-kernel@7.63.0.json +30 -0
  314. package/wire-changes/mods-kernel@7.64.0.json +30 -0
  315. package/wire-changes/primitives@7.63.0.json +445 -0
  316. package/wire-changes/primitives@7.64.0.json +30 -0
  317. package/dist/core/credential-vocabulary.d.ts +0 -176
  318. package/dist/core/credential-vocabulary.js +0 -190
  319. package/dist/core/redaction-passes.d.ts +0 -82
  320. package/dist/core/redaction-passes.js +0 -377
@@ -145,7 +145,7 @@ export type NoticeAudience = "user" | "operator";
145
145
  * the union's catalog ({@link EngineNotice.code}). The groups below say only which family a row joins,
146
146
  * so the catalog is not written a second time here and the two cannot drift.
147
147
  */
148
- export declare const ENGINE_NOTICE_CODES: readonly ["config.autocompact_window_clamped", "config.env_timeout_discarded", "config.materialize_env_discarded", "config.models_swapped", "config.context_settings_swapped", "config.read_face_swapped", "config.read_face_deployment_clamped", "config.write_face_swapped", "config.write_face_deployment_clamped", "config.read_deny_swapped", "config.tool_model_gate_removed", "config.tool_model_gate_unknown_class", "config.tool_model_gate_env_invalid", "config.artifact_host_invalid", "config.task_root_not_canonical", "config.write_protection_target_view_absent", "config.path_view_unresolved", "config.execution_env_capability_invalid", "config.read_deny_floor_unkept", "config.read_floor_confinement_unavailable", "config.tool_card_undeclared", "config.tool_face_undeclared", "config.tool_face_invalid", "config.forward_sink_failed", "config.durable_gate_unavailable", "config.peer_admission_out_of_range", "config.peer_lane_unmounted", "config.secret_env_scrubbed", "inherit_env.names_withheld", "config.credential_not_withheld", "config.cross_boundary_posture_undeclared", "config.cross_boundary_record_unwritten", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "config.session_rules_earlier_grammar", "permission.allowed_tool_not_granted", "mods.registration_refused", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "classifier.fallback", "classifier.seat_rate_limited", "classifier.role_defaulted", "classifier.contract_broken", "classifier.unavailable", "checkpoint.execution_outcome_unrecorded", "delegation.transcript_integrity", "delegation.ask_unresolvable", "mcp.injection_dropped", "mcp.revocation_probe_failed", "mcp.server_redialed", "mcp.authorization_required", "mcp.credential_echoed", "workflow.governance_key_stripped", "workflow.agent_option_ignored", "memory.session_polluted", "memory.harvest_quarantined", "memory.delegation_static_mark_waived", "memory.content_class_declared", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "memory.consolidation_recommended", "memory.consolidation_committed", "memory.consolidation_conflict", "memory.consolidation_incomplete", "memory.consolidation_refused", "memory.consolidation_withheld", "memory.restore_withheld", "memory.project_scope_absent", "route.fallback_to_primary", "route.classifier_unroutable", "route.seat_detached", "advisor.not_attached", "route.credential_origin_mismatch", "route.credential_rebound", "route.response_model_mismatch", "route.tool_call_id_folded", "route.finish_reason_unknown", "route.stream_end_ignored", "route.extra_body_reserved_dropped", "model.capability_downgraded", "model.role_defaulted", "context.tool_turn_repaired", "context.media_removed", "context.tool_schema_removed", "task.user_steer_undrained", "task.user_followup_undrained", "steering.parked_input_blocked", "task.turn_interrupted", "task.halt_unconsumed", "task.late_approval", "task.interrupt_unconsumed", "task.tool_turn_incomplete", "approval.read_root_granted", "approval.read_root_grant_rejected", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "skills.listing_truncated", "agents.listing_truncated", "tool_result.offload_put_failed", "tool_result.media_refused", "config.image_processor_unavailable", "fs.staging_file_left", "fs.staging_file_swept", "session.lineage_rerooted", "instructions.source_changed", "session.records_skipped", "memory.layer_locked_legacy", "server.model_unreachable", "permission.entry_mode_clamped"];
148
+ export declare const ENGINE_NOTICE_CODES: readonly ["config.autocompact_window_clamped", "config.env_timeout_discarded", "config.materialize_env_discarded", "config.models_swapped", "config.context_settings_swapped", "config.read_face_swapped", "config.read_face_deployment_clamped", "config.write_face_swapped", "config.write_face_deployment_clamped", "config.read_deny_swapped", "config.tool_model_gate_removed", "config.tool_model_gate_unknown_class", "config.tool_model_gate_env_invalid", "config.artifact_host_invalid", "config.task_root_not_canonical", "config.write_protection_target_view_absent", "config.path_view_unresolved", "config.execution_env_capability_invalid", "config.read_deny_floor_unkept", "config.read_floor_confinement_unavailable", "config.tool_card_undeclared", "config.tool_face_undeclared", "config.tool_face_invalid", "config.forward_sink_failed", "config.durable_gate_unavailable", "config.peer_admission_out_of_range", "config.peer_lane_unmounted", "config.secret_env_scrubbed", "inherit_env.names_withheld", "config.credential_not_withheld", "config.cross_boundary_posture_undeclared", "config.cross_boundary_record_unwritten", "config.permission_mode_unavailable", "permission.ask_released_by_mode", "permission.read_deny_unapplied", "permission.rule_store_unavailable", "permission.rule_row_dropped", "config.session_rules_earlier_grammar", "permission.allowed_tool_not_granted", "mods.registration_refused", "peer.inbound_disposition", "peer.held_settled", "peer.idle_subscription", "classifier.denial_limit", "classifier.fallback", "classifier.seat_rate_limited", "classifier.role_defaulted", "classifier.contract_broken", "classifier.unavailable", "checkpoint.execution_outcome_unrecorded", "delegation.transcript_integrity", "delegation.ask_unresolvable", "delegation.resume_lane_missing", "delegation.delivery_discarded", "mcp.injection_dropped", "mcp.revocation_probe_failed", "mcp.server_redialed", "mcp.authorization_required", "mcp.credential_echoed", "workflow.governance_key_stripped", "workflow.agent_option_ignored", "memory.session_polluted", "memory.harvest_quarantined", "memory.harvest_refused", "memory.harvest_conflict", "memory.delegation_static_mark_waived", "memory.content_class_declared", "memory.hold_opened", "memory.hold_released", "memory.hold_disposed", "memory.consolidation_recommended", "memory.consolidation_committed", "memory.consolidation_conflict", "memory.consolidation_incomplete", "memory.consolidation_refused", "memory.consolidation_withheld", "memory.restore_withheld", "memory.project_scope_absent", "route.fallback_to_primary", "route.classifier_unroutable", "route.seat_detached", "advisor.not_attached", "route.credential_origin_mismatch", "route.credential_rebound", "route.response_model_mismatch", "route.tool_call_id_folded", "route.finish_reason_unknown", "route.stream_end_ignored", "route.extra_body_reserved_dropped", "model.capability_downgraded", "model.role_defaulted", "context.tool_turn_repaired", "context.media_removed", "context.tool_schema_removed", "task.user_steer_undrained", "task.user_followup_undrained", "steering.parked_input_blocked", "task.turn_interrupted", "task.halt_unconsumed", "task.late_approval", "task.interrupt_unconsumed", "task.tool_turn_incomplete", "approval.read_root_granted", "approval.read_root_grant_rejected", "memory.capture_opted_out", "memory.capture_optout_unpersisted", "skills.listing_truncated", "agents.listing_truncated", "tool_result.offload_put_failed", "tool_result.media_refused", "config.image_processor_unavailable", "fs.staging_file_left", "fs.staging_file_swept", "session.lineage_rerooted", "instructions.source_changed", "memory.layer_locked_legacy", "server.model_unreachable", "permission.entry_mode_clamped"];
149
149
  /** A catalogued code (see {@link ENGINE_NOTICE_CODES}); {@link NOTICE_MINTER} says who mints it. NOT the type of
150
150
  * `EngineNotice.code`, which stays `string` — a host forwarding its own notices through the same
151
151
  * sink is a supported shape, and narrowing that field would break it. */
@@ -166,6 +166,8 @@ export type EngineNoticeCode = (typeof ENGINE_NOTICE_CODES)[number];
166
166
  declare const NOTICE_AUDIENCE_TABLE: {
167
167
  readonly "memory.session_polluted": "user";
168
168
  readonly "memory.harvest_quarantined": "user";
169
+ readonly "memory.harvest_refused": "user";
170
+ readonly "memory.harvest_conflict": "user";
169
171
  readonly "memory.delegation_static_mark_waived": "user";
170
172
  readonly "memory.hold_opened": "user";
171
173
  readonly "memory.hold_released": "user";
@@ -236,6 +238,8 @@ declare const NOTICE_AUDIENCE_TABLE: {
236
238
  readonly "peer.held_settled": "user";
237
239
  readonly "peer.idle_subscription": "user";
238
240
  readonly "delegation.transcript_integrity": "operator";
241
+ readonly "delegation.resume_lane_missing": "operator";
242
+ readonly "delegation.delivery_discarded": "operator";
239
243
  readonly "checkpoint.execution_outcome_unrecorded": "operator";
240
244
  readonly "mcp.injection_dropped": "user";
241
245
  readonly "mcp.revocation_probe_failed": "operator";
@@ -275,7 +279,6 @@ declare const NOTICE_AUDIENCE_TABLE: {
275
279
  readonly "session.lineage_rerooted": "user";
276
280
  readonly "config.forward_sink_failed": "operator";
277
281
  readonly "instructions.source_changed": "user";
278
- readonly "session.records_skipped": "user";
279
282
  readonly "server.model_unreachable": "user";
280
283
  readonly "permission.entry_mode_clamped": "user";
281
284
  readonly "memory.layer_locked_legacy": "operator";
@@ -356,6 +359,8 @@ declare const NOTICE_MINTER_TABLE: {
356
359
  readonly "checkpoint.execution_outcome_unrecorded": "engine";
357
360
  readonly "delegation.transcript_integrity": "engine";
358
361
  readonly "delegation.ask_unresolvable": "engine";
362
+ readonly "delegation.resume_lane_missing": "engine";
363
+ readonly "delegation.delivery_discarded": "engine";
359
364
  readonly "mcp.injection_dropped": "engine";
360
365
  readonly "mcp.revocation_probe_failed": "engine";
361
366
  readonly "mcp.server_redialed": "engine";
@@ -365,6 +370,8 @@ declare const NOTICE_MINTER_TABLE: {
365
370
  readonly "workflow.agent_option_ignored": "engine";
366
371
  readonly "memory.session_polluted": "engine";
367
372
  readonly "memory.harvest_quarantined": "engine";
373
+ readonly "memory.harvest_refused": "engine";
374
+ readonly "memory.harvest_conflict": "engine";
368
375
  readonly "memory.delegation_static_mark_waived": "engine";
369
376
  readonly "memory.content_class_declared": "engine";
370
377
  readonly "memory.hold_opened": "engine";
@@ -415,7 +422,6 @@ declare const NOTICE_MINTER_TABLE: {
415
422
  readonly "fs.staging_file_swept": "engine";
416
423
  readonly "session.lineage_rerooted": "engine";
417
424
  readonly "instructions.source_changed": "server";
418
- readonly "session.records_skipped": "server";
419
425
  readonly "memory.layer_locked_legacy": "server";
420
426
  readonly "server.model_unreachable": "server";
421
427
  readonly "permission.entry_mode_clamped": "server";
@@ -27,6 +27,8 @@ export const NON_GOVERNANCE_MEMORY_CODES = new Set([
27
27
  "memory.session_incarnation_unreadable",
28
28
  "memory.session_polluted",
29
29
  "memory.harvest_quarantined",
30
+ "memory.harvest_refused",
31
+ "memory.harvest_conflict",
30
32
  "memory.delegation_static_mark_waived",
31
33
  "memory.content_class_declared",
32
34
  "memory.consolidation_driver_superseded",
@@ -58,6 +60,9 @@ export const NON_GOVERNANCE_MEMORY_CODES = new Set([
58
60
  "memory.challenge_ledger_oversize",
59
61
  "memory.control_plane_rebuilt",
60
62
  "memory.control_plane_not_corrupt",
63
+ "memory.control_plane_rebuild_unsupported",
64
+ "memory.governance_doc_unknown",
65
+ "memory.control_object_unknown",
61
66
  "memory.erasure_evidence_unavailable",
62
67
  "memory.erasure_selector_mismatch",
63
68
  "memory.erasure_census_incomplete",
@@ -176,6 +181,8 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
176
181
  "checkpoint.execution_outcome_unrecorded",
177
182
  "delegation.transcript_integrity",
178
183
  "delegation.ask_unresolvable",
184
+ "delegation.resume_lane_missing",
185
+ "delegation.delivery_discarded",
179
186
  "mcp.injection_dropped",
180
187
  "mcp.revocation_probe_failed",
181
188
  "mcp.server_redialed",
@@ -185,6 +192,8 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
185
192
  "workflow.agent_option_ignored",
186
193
  "memory.session_polluted",
187
194
  "memory.harvest_quarantined",
195
+ "memory.harvest_refused",
196
+ "memory.harvest_conflict",
188
197
  "memory.delegation_static_mark_waived",
189
198
  "memory.content_class_declared",
190
199
  "memory.hold_opened",
@@ -235,7 +244,6 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
235
244
  "fs.staging_file_swept",
236
245
  "session.lineage_rerooted",
237
246
  "instructions.source_changed",
238
- "session.records_skipped",
239
247
  "memory.layer_locked_legacy",
240
248
  "server.model_unreachable",
241
249
  "permission.entry_mode_clamped",
@@ -243,6 +251,8 @@ export const ENGINE_NOTICE_CODES = Object.freeze([
243
251
  const NOTICE_AUDIENCE_TABLE = {
244
252
  "memory.session_polluted": "user",
245
253
  "memory.harvest_quarantined": "user",
254
+ "memory.harvest_refused": "user",
255
+ "memory.harvest_conflict": "user",
246
256
  "memory.delegation_static_mark_waived": "user",
247
257
  "memory.hold_opened": "user",
248
258
  "memory.hold_released": "user",
@@ -313,6 +323,8 @@ const NOTICE_AUDIENCE_TABLE = {
313
323
  "peer.held_settled": "user",
314
324
  "peer.idle_subscription": "user",
315
325
  "delegation.transcript_integrity": "operator",
326
+ "delegation.resume_lane_missing": "operator",
327
+ "delegation.delivery_discarded": "operator",
316
328
  "checkpoint.execution_outcome_unrecorded": "operator",
317
329
  "mcp.injection_dropped": "user",
318
330
  "mcp.revocation_probe_failed": "operator",
@@ -352,7 +364,6 @@ const NOTICE_AUDIENCE_TABLE = {
352
364
  "session.lineage_rerooted": "user",
353
365
  "config.forward_sink_failed": "operator",
354
366
  "instructions.source_changed": "user",
355
- "session.records_skipped": "user",
356
367
  "server.model_unreachable": "user",
357
368
  "permission.entry_mode_clamped": "user",
358
369
  "memory.layer_locked_legacy": "operator",
@@ -414,6 +425,8 @@ const NOTICE_MINTER_TABLE = {
414
425
  "checkpoint.execution_outcome_unrecorded": "engine",
415
426
  "delegation.transcript_integrity": "engine",
416
427
  "delegation.ask_unresolvable": "engine",
428
+ "delegation.resume_lane_missing": "engine",
429
+ "delegation.delivery_discarded": "engine",
417
430
  "mcp.injection_dropped": "engine",
418
431
  "mcp.revocation_probe_failed": "engine",
419
432
  "mcp.server_redialed": "engine",
@@ -423,6 +436,8 @@ const NOTICE_MINTER_TABLE = {
423
436
  "workflow.agent_option_ignored": "engine",
424
437
  "memory.session_polluted": "engine",
425
438
  "memory.harvest_quarantined": "engine",
439
+ "memory.harvest_refused": "engine",
440
+ "memory.harvest_conflict": "engine",
426
441
  "memory.delegation_static_mark_waived": "engine",
427
442
  "memory.content_class_declared": "engine",
428
443
  "memory.hold_opened": "engine",
@@ -473,7 +488,6 @@ const NOTICE_MINTER_TABLE = {
473
488
  "fs.staging_file_swept": "engine",
474
489
  "session.lineage_rerooted": "engine",
475
490
  "instructions.source_changed": "server",
476
- "session.records_skipped": "server",
477
491
  "memory.layer_locked_legacy": "server",
478
492
  "server.model_unreachable": "server",
479
493
  "permission.entry_mode_clamped": "server",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * A leg's two identity readings, as pure functions with no runtime imports — so a store's projection reads them exactly as
2
+ * A leg's identity readings, as pure functions with no runtime imports — so a store's projection reads them exactly as
3
3
  * the prepare mint and the stations do (one predicate each, never a second spelling at a reader that cannot reach the
4
4
  * mods layer).
5
5
  */
@@ -60,3 +60,21 @@ export interface AskSourceFacts {
60
60
  * refusal texts speak the right posture (parent thread: stop and wait for the user; delegated child: adapt or report).
61
61
  */
62
62
  export declare function mintAskSourceIdentity(leg: AskSourceFacts): AskSourceIdentity;
63
+ /** Where a leg's user-face notice is addressed: {@link noticeAddressOf}. Spread into the notice's detail as-is. */
64
+ export interface NoticeAddress {
65
+ /** The session the notice routes to (lifted onto the typed key at the one throat): the leg's own on a top-level leg, the
66
+ * delegation tree's root on a delegated one. */
67
+ readonly sessionId: string;
68
+ /** Present exactly on a delegated leg: the leg whose call the notice is about (its ask source's session). */
69
+ readonly sourceSessionId?: string;
70
+ /** Present on a delegated leg that carries one ({@link agentIdOf}): the agent id the leg's events and its spawner's card name. */
71
+ readonly agentId?: string;
72
+ }
73
+ /**
74
+ * The address of a leg's user-face notice — one rule: a user-face notice goes to the end of the delegation tree a person
75
+ * watches, and says which leg it came from. A top-level leg's notice is addressed to its own session and carries no source
76
+ * keys. A delegated leg's notice is addressed to the tree's root session (`internals.rootSessionId`: an intermediate parent
77
+ * at depth ≥ 2 has no host leg of its own to read it on) and carries the delegated leg's session and agent id — the shape a
78
+ * subagent's permission denial takes upstream (the top-level session id plus the agent id).
79
+ */
80
+ export declare function noticeAddressOf(askSource: AskSourceIdentity, rootSessionId: string | undefined): NoticeAddress;
@@ -16,3 +16,15 @@ export function mintAskSourceIdentity(leg) {
16
16
  ...(leg.isDelegatedChild ? { isDelegatedChild: true } : {}),
17
17
  });
18
18
  }
19
+ export function noticeAddressOf(askSource, rootSessionId) {
20
+ const own = askSource.sourceSessionId;
21
+ if (own === undefined || own.length === 0)
22
+ throw new TypeError("noticeAddressOf: the leg's ask source carries no session");
23
+ if (askSource.isDelegatedChild !== true)
24
+ return { sessionId: own };
25
+ return {
26
+ sessionId: rootSessionId !== undefined && rootSessionId.length > 0 ? rootSessionId : own,
27
+ sourceSessionId: own,
28
+ ...(askSource.agentId !== undefined ? { agentId: askSource.agentId } : {}),
29
+ };
30
+ }
@@ -99,9 +99,22 @@ export interface MailboxPeerMeta {
99
99
  * ahead of the non-urgent ones of the same pass and counts it on the inbox notice; it never changes
100
100
  * WHEN the recipient reads (the recipient's setting decides that, never the sender). */
101
101
  urgent?: boolean;
102
+ /**
103
+ * WHO the record is for: the occupant (`SessionMetadata.incarnation`) of the session the writer addressed, as the writer
104
+ * resolved that address — a park seat from its leg's address, a sender from the recipient's directory row, a notice from the
105
+ * reply address it answers. A session box outlives its occupant (the id can be deleted and created again, the box stays), so a
106
+ * drain hands a record only to the occupant it names ({@link import("./runner/delegation-owner.js").sameOccupant}: absent on
107
+ * both sides is one occupant — a deployment whose store mints no tokens; absent on one side only is another occupant). A
108
+ * record for another occupant is discarded with an account, never delivered. An addressing fact, not a secret and not a
109
+ * credential: it proves nothing about who wrote the record.
110
+ */
111
+ occupant?: string;
112
+ /** The occupant of the SENDING session, beside `fromSession`: what a notice answering this record (a receipt, an idle notice)
113
+ * is addressed to ({@link occupant} of that notice). Absent = the sender stated none. */
114
+ fromOccupant?: string;
102
115
  }
103
116
  /** design/385 — the typed body of a notice-kind record. `state` is drawn from the receipt states on a
104
- * `delivery_notice` (`held|denied|expired|delivered|refused|dropped`) and from the idle kinds on an
117
+ * `delivery_notice` (`held|denied|expired|delivered|refused|dropped|held_by_policy`) and from the idle kinds on an
105
118
  * `idle_notice` (`idle|exited|unavailable|expired`); the validator admits the union, the drain checks
106
119
  * the pairing (a state that does not fit its kind is settled `notice_unrouted`, never rendered). */
107
120
  export interface MailboxPeerNoticeMeta {
@@ -142,8 +155,9 @@ export declare const MAILBOX_PEER_RECORD_KINDS: readonly ["peer_message", "idle_
142
155
  export type MailboxPeerRecordKind = (typeof MAILBOX_PEER_RECORD_KINDS)[number];
143
156
  /** The `notice.state` vocabulary the validator admits (the union of both notice families; the drain
144
157
  * checks the kind↔state pairing). Spelled here, beside the record kinds, so the store contract is
145
- * self-contained — the lane's own closed sets re-derive from these. */
146
- export declare const MAILBOX_PEER_NOTICE_STATES: readonly ["held", "denied", "expired", "delivered", "refused", "dropped", "idle", "exited", "unavailable"];
158
+ * self-contained — the lane's two closed sets (`PEER_DELIVERY_RECEIPT_STATES`, `PEER_IDLE_NOTICE_KINDS`)
159
+ * are spelled beside their renderers and together equal this one (a pin holds the two spellings together). */
160
+ export declare const MAILBOX_PEER_NOTICE_STATES: readonly ["held", "denied", "expired", "delivered", "refused", "dropped", "idle", "exited", "unavailable", "held_by_policy"];
147
161
  export type MailboxPeerNoticeState = (typeof MAILBOX_PEER_NOTICE_STATES)[number];
148
162
  /** The `append` refusal code for a malformed `peerMeta` (design/385): a garbage record is refused up
149
163
  * front with this code, never silently stripped or stored — a drain that reads a half-typed record
@@ -383,7 +397,15 @@ export interface MailboxStore {
383
397
  releaseLease(scope: string, handle: string, owner: string): Promise<void>;
384
398
  /** Observation face (the "N pending" receipt figure) — count of currently-visible messages. */
385
399
  peekCount(scope: string, handle: string): Promise<number>;
386
- /** Drop the WHOLE mailbox for (scope, handle) — the row-deletion companion (F-13). */
400
+ /**
401
+ * Drop the WHOLE mailbox for (scope, handle) — the row-deletion companion (F-13).
402
+ *
403
+ * @contract mailbox.session_box_outlives_its_occupant — deleting a session's row does not remove its box
404
+ * `(scope, session.<id>)`: a deployment's deletion cascade clears it with this verb (retention is the deployment's). What
405
+ * stays behind is never delivered to another occupant: every session-box record names the occupant it is for
406
+ * ({@link MailboxPeerMeta.occupant}), and a drain hands a record only to that occupant — a record for an earlier occupant
407
+ * of the id is discarded with an account (`delegation.delivery_discarded`) by the next occupant's drain.
408
+ */
387
409
  drop(scope: string, handle: string): Promise<void>;
388
410
  /** Age out mailboxes whose newest message BY `sentAt` (not by array/insertion order — RB-250②)
389
411
  * is older than maxAgeMs. Returns mailboxes dropped. */
@@ -444,6 +466,19 @@ export type MailboxCrossProcessVerdict = {
444
466
  * value of the wrong type (a malformed declaration is refused, not read as "probably fine").
445
467
  */
446
468
  export declare function mailboxCrossProcessMountVerdict(store: MailboxStore): MailboxCrossProcessVerdict;
469
+ /**
470
+ * THE mount verdict of the SESSION-BOX lane — a session's own `session.<id>` box, the drain that consumes it and every seat that
471
+ * appends to it: the mailbox's cross-process declaration ({@link mailboxCrossProcessMountVerdict}) AND a session store that reads a
472
+ * session's row by id (`SessionStore.headOf`). A box outlives its session's occupant (the id can be deleted and created again), and
473
+ * a drain discards a record addressed to another occupant only after it has read, by id, that its run's session still holds the
474
+ * occupant it acquired; over a store that cannot be read by id every such record is undecidable and the box would jam, so the lane
475
+ * does not mount, and the reason names the missing read. One judgment, read by the drain mount, the peer-lane mount and the send
476
+ * face, so where a record is parked and where it is drained cannot disagree. `sessions` absent = no session store at all: the same
477
+ * refusal.
478
+ */
479
+ export declare function sessionBoxMountVerdict(mailbox: MailboxStore, sessions: {
480
+ readonly headOf?: unknown;
481
+ } | undefined): MailboxCrossProcessVerdict;
447
482
  /** RB-250② (2026-07-28) class fix — the box age for `reap` is the MAX `sentAt`, not the
448
483
  * last array element: `sentAt` is caller-supplied, so append order need not be time order, and taking
449
484
  * the tail let a box whose freshest message was mid-array be swept — both bundled backends discarded
@@ -52,10 +52,10 @@ export function assertMailboxDecisionMove(seq, expect, next) {
52
52
  }
53
53
  export const MAILBOX_PEER_FROM_MODES = Object.freeze(["bypass", "prompting"]);
54
54
  export const MAILBOX_PEER_RECORD_KINDS = Object.freeze(["peer_message", "idle_notice", "delivery_notice", "idle_subscription", "engine_frame"]);
55
- export const MAILBOX_PEER_NOTICE_STATES = Object.freeze(["held", "denied", "expired", "delivered", "refused", "dropped", "idle", "exited", "unavailable"]);
55
+ export const MAILBOX_PEER_NOTICE_STATES = Object.freeze(["held", "denied", "expired", "delivered", "refused", "dropped", "idle", "exited", "unavailable", "held_by_policy"]);
56
56
  export const MAILBOX_INVALID_PEER_META_CODE = "mailbox.invalid_peer_meta";
57
57
  export const MAILBOX_CROSS_PROCESS_UNSAFE_CODE = "mailbox.cross_process_unsafe";
58
- const PEER_META_STRING_KEYS = ["fromSession", "fromRoot", "senderKey", "fromScope", "gateReceiptId"];
58
+ const PEER_META_STRING_KEYS = ["fromSession", "fromRoot", "senderKey", "fromScope", "gateReceiptId", "occupant", "fromOccupant"];
59
59
  export function readMailboxPeerMeta(raw) {
60
60
  if (raw === undefined)
61
61
  return undefined;
@@ -228,6 +228,18 @@ export function mailboxCrossProcessMountVerdict(store) {
228
228
  : `the mailbox backend's crossProcessSafe declaration is malformed (${typeof declared}, expected a boolean)`;
229
229
  return { ok: false, code: MAILBOX_CROSS_PROCESS_UNSAFE_CODE, reason };
230
230
  }
231
+ export function sessionBoxMountVerdict(mailbox, sessions) {
232
+ const store = mailboxCrossProcessMountVerdict(mailbox);
233
+ if (!store.ok)
234
+ return store;
235
+ if (typeof sessions?.headOf === "function")
236
+ return { ok: true };
237
+ return {
238
+ ok: false,
239
+ code: MAILBOX_CROSS_PROCESS_UNSAFE_CODE,
240
+ reason: "the session store has no by-id read (SessionStore.headOf): a session box outlives its session's occupant, and without that read a drain cannot confirm that its run's session still holds the occupant it acquired before it discards a record addressed to another, so a box shared across runs would hand one occupant's records to another on luck",
241
+ };
242
+ }
231
243
  export function newestSentAt(messages) {
232
244
  let newest;
233
245
  for (const m of messages) {
@@ -21,12 +21,12 @@
21
21
  * auto lane's task-boundary tick), never on a background schedule of core's own.
22
22
  */
23
23
  import type { EngineNotice } from "../types.js";
24
- import { CONSOLIDATION_DRIVER_PLANS_DIR, type ConsolidationGateRow, CONSOLIDATION_WRITE_REFUSED_CODE, type ConsolidationRunStopReason, type MemoryConsolidationOptions } from "./consolidation.js";
24
+ import type { MemoryGovernanceStore } from "./types.js";
25
+ import { type ConsolidationGateRow, CONSOLIDATION_WRITE_REFUSED_CODE, type ConsolidationRunStopReason, type MemoryConsolidationOptions } from "./consolidation.js";
25
26
  import { type ConsolidationPlanFoldEvidence, type ConsolidationPlanSummary } from "./engine.js";
27
+ import { type ComplianceCapability, type CompliancePostureSeat } from "../compliance.js";
26
28
  import type { SyntheticWriteVerdict } from "../synthetic-read-verdict.js";
27
- import { mintLlmConsolidationPlan, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationFoldState, type DistillerChatFn, type LlmConsolidationPlan, type LlmConsolidationPlanProduct, type LlmDistillerContract } from "./distiller.js";
28
- export declare const CONSOLIDATION_DRIVER_RUNS_FILE = "distiller-runs.json";
29
- export { CONSOLIDATION_DRIVER_PLANS_DIR };
29
+ import { mintLlmConsolidationPlan, type ConsolidationDriveCycleRow, type ConsolidationDriveEngine, type ConsolidationFoldState, type DistillerChatFn, type LlmConsolidationPlanProduct, type LlmDistillerContract } from "./distiller.js";
30
30
  export interface ConsolidationDriverRunRow {
31
31
  runId: string;
32
32
  scope: string;
@@ -79,7 +79,7 @@ export interface ConsolidationDriverRunRow {
79
79
  * dies with a discarded cache, and "your data never left this machine" must not become
80
80
  * unanswerable because an unrelated guard fired. */
81
81
  withheldNeverSent?: number;
82
- /** The archived mint transcript's file name under {@link CONSOLIDATION_DRIVER_PLANS_DIR}. */
82
+ /** The archived mint transcript's name in the consolidation store (`MemoryGovernanceStore.readMint`). */
83
83
  planArchive?: string;
84
84
  /** COMMITTED cycles only (the store moved): a refused/fuse-blocked/zero-delta cycle row does
85
85
  * not count — the receipt's "committed cycle(s)" label and the incomplete notice's zero-cycle
@@ -124,26 +124,20 @@ export interface ConsolidationDriverRunRow {
124
124
  /** The next moment a snapshot can pass the hard throttle (resume scheduling hint). */
125
125
  nextEligibleAt?: number;
126
126
  }
127
- /** Host read face: the scope's latest driver run row (pending = resumable; settled = audit). */
128
- export declare function readConsolidationDriverRun(controlDir: string, scope: string): ConsolidationDriverRunRow | undefined;
129
- /** Archive one mint (prompts + transcript verbatim) beside the run account. The name carries the
130
- * CLAIM (`attempt`): two invocations that raced onto one run each archive
131
- * under their own name, so a superseded worker can never overwrite the winning transcript — the
132
- * run row's `planArchive` (written under the attempt guard) names the one that counts. */
133
- export declare function distillerPlanArchiveName(runId: string, attempt: number): string;
134
- export declare function archiveDistillerPlan(controlDir: string, runId: string, plan: LlmConsolidationPlan, attempt?: number): string;
135
127
  /** The engine face this verb consumes — `MemoryEngine` satisfies it structurally.
136
128
  * (`readConsolidationPlanFoldEvidence` joined in design/376 slice ③, #436: the conservation
137
129
  * wall's terminal witness is member-level, so the face is REQUIRED — an engine without it could
138
130
  * only offer the store-delta counts an interleaved fold can numerically offset.) */
139
131
  export interface ConsolidationDriverEngine extends ConsolidationDriveEngine {
140
- readConsolidationGate(scope: string): ConsolidationGateRow | undefined;
141
- listConsolidationPlans(): ConsolidationPlanSummary[];
142
- readConsolidationPlanFoldEvidence(planId: string): ConsolidationPlanFoldEvidence;
132
+ readConsolidationGate(scope: string): Promise<ConsolidationGateRow | undefined>;
133
+ listConsolidationPlans(): Promise<ConsolidationPlanSummary[]>;
134
+ readConsolidationPlanFoldEvidence(planId: string): Promise<ConsolidationPlanFoldEvidence>;
143
135
  readConsolidationFoldState(scope: string): Promise<ConsolidationFoldState>;
144
136
  /** The canonical directory a commit lands the scope's products in (the write judge's early question). */
145
137
  consolidationWriteHome(scope: string): string;
146
- readonly controlPlaneRoot: string;
138
+ /** The store the engine keeps its consolidation state in (the run account, the mint archive and the run's
139
+ * announcements — its `announcements` document — are written through it). */
140
+ readonly governance: MemoryGovernanceStore;
147
141
  }
148
142
  /** One write the judge is asked about: `path` is a file (or the library directory) of `scope`'s library, absolute and canonical. */
149
143
  export interface ConsolidationWriteTarget {
@@ -153,6 +147,24 @@ export interface ConsolidationWriteTarget {
153
147
  /** The write judge's seat: one target in, the synthetic-write judge's verdict out (only `no_objection` permits the write). */
154
148
  export type ConsolidationWriteJudge = (target: ConsolidationWriteTarget) => Promise<SyntheticWriteVerdict> | SyntheticWriteVerdict;
155
149
  export { CONSOLIDATION_WRITE_REFUSED_CODE };
150
+ /**
151
+ * A consolidation run's compliance veto. The posture asked is the one of the scope's OWNER (`memoryScopeOwnerOf`, read
152
+ * under `scopeContract`): a principal's own layer asks `postureOf` with that principal; a tenant's layer and an opaque key
153
+ * ask it with no principal (the deployment's posture — the seat is keyed by principals). Outside the v2 contract the
154
+ * principal a key's spelling names is asked too, refuse-only (a stored `user:<P>` layer stays P's whichever contract a
155
+ * task declares). `denies` are the caller's own,
156
+ * added to the owner's (add-only: the Runner's automatic run passes the leg's `TaskSpec.complianceAdditionalDenies`).
157
+ * `memory_consolidation` among them refuses `config.compliance_denied`; a seat that throws or answers an unparseable
158
+ * posture refuses `config.compliance_required` (fail-closed). Both are {@link ConsolidationRefusedError}s, and nothing
159
+ * has been read or written.
160
+ */
161
+ export interface ConsolidationCompliance {
162
+ /** The deployment's posture seat (`RunnerDeps.compliancePostureResolver`); absent ⇒ only `denies` apply. */
163
+ postureOf?: CompliancePostureSeat;
164
+ /** The scope contract the scope was minted under (`TaskSpec.memory.scopeContract`) — a required key. */
165
+ scopeContract: "v2" | undefined;
166
+ denies?: readonly ComplianceCapability[];
167
+ }
156
168
  export interface RunMemoryConsolidationOptions {
157
169
  /** The explicit model seat (design/339 §1.1: the ENGINE holds none). Build one with
158
170
  * `openAiCompatChatSeat` or hand any JSON-only completion function. */
@@ -170,6 +182,9 @@ export interface RunMemoryConsolidationOptions {
170
182
  * throw — refuses the run with `memory.consolidation_write_refused`, and nothing is written. A host that holds no rules
171
183
  * says so by passing a judge that answers `no_objection`; an absent seat refuses, it never reads as "no rules". */
172
184
  writeJudge: ConsolidationWriteJudge;
185
+ /** The compliance veto of the capability `memory_consolidation`, asked once per invocation and FIRST — before the write
186
+ * judge and before any read, seat, lock or model call. Absent ⇒ no posture applies (a deployment that holds none). */
187
+ compliance?: ConsolidationCompliance;
173
188
  /** Audit locator recorded into the archive when the seat is endpoint-shaped. */
174
189
  baseUrl?: string;
175
190
  /** The frozen prompt contract; default = the product v1 (dl-3 byte-identical). A different