@sema-agent/core 7.60.0 → 7.61.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 (482) hide show
  1. package/CHANGELOG.md +605 -0
  2. package/README.md +2 -2
  3. package/dist/agents/agent-transcript-tool.d.ts +2 -2
  4. package/dist/agents/agent-transcript-tool.js +1 -1
  5. package/dist/agents/cascade.d.ts +61 -10
  6. package/dist/agents/cascade.js +60 -20
  7. package/dist/agents/composition-allowance.d.ts +53 -0
  8. package/dist/agents/composition-allowance.js +49 -0
  9. package/dist/agents/composition-placement.d.ts +29 -0
  10. package/dist/agents/composition-placement.js +24 -0
  11. package/dist/agents/cumulative-stats.d.ts +4 -0
  12. package/dist/agents/cumulative-stats.js +3 -0
  13. package/dist/agents/inherited-tool-pool.d.ts +5 -3
  14. package/dist/agents/inherited-tool-pool.js +2 -2
  15. package/dist/agents/list-agents-tool.d.ts +1 -1
  16. package/dist/agents/peer-notice-route.d.ts +1 -1
  17. package/dist/agents/peer-notice-route.js +4 -3
  18. package/dist/agents/peer-notices.d.ts +4 -4
  19. package/dist/agents/peer-notices.js +8 -4
  20. package/dist/agents/peer-session-drain.d.ts +8 -1
  21. package/dist/agents/peer-session-drain.js +36 -7
  22. package/dist/agents/repair-loop.js +16 -6
  23. package/dist/agents/retain-ledger.js +3 -1
  24. package/dist/agents/roster-store.d.ts +1 -1
  25. package/dist/agents/roster-store.js +7 -4
  26. package/dist/agents/send-message-tool.d.ts +8 -10
  27. package/dist/agents/send-message-tool.js +43 -23
  28. package/dist/agents/subagent-completion-gate.d.ts +35 -0
  29. package/dist/agents/subagent-completion-gate.js +62 -0
  30. package/dist/agents/subagent-steps.d.ts +7 -6
  31. package/dist/agents/subagent.d.ts +30 -40
  32. package/dist/agents/subagent.js +187 -196
  33. package/dist/agents/suspend-guard.d.ts +9 -0
  34. package/dist/agents/suspend-guard.js +4 -0
  35. package/dist/agents/verify.d.ts +41 -14
  36. package/dist/agents/verify.js +37 -27
  37. package/dist/brain/anthropic.js +1 -0
  38. package/dist/brain/errors.d.ts +7 -1
  39. package/dist/brain/errors.js +6 -0
  40. package/dist/brain/failover.js +2 -1
  41. package/dist/brain/open-responses.js +1 -0
  42. package/dist/brain/openai.js +1 -0
  43. package/dist/brain/provider-dialect.d.ts +10 -0
  44. package/dist/brain/provider-dialect.js +13 -2
  45. package/dist/brain/stream-engine.d.ts +3 -0
  46. package/dist/brain/stream-engine.js +4 -0
  47. package/dist/core/agent-state.d.ts +1 -1
  48. package/dist/core/allow-entry.d.ts +59 -23
  49. package/dist/core/allow-entry.js +131 -38
  50. package/dist/core/ask-origin.d.ts +79 -0
  51. package/dist/core/ask-origin.js +76 -0
  52. package/dist/core/ask-question.d.ts +19 -13
  53. package/dist/core/ask-question.js +8 -2
  54. package/dist/core/auto-compaction.d.ts +2 -0
  55. package/dist/core/auto-compaction.js +2 -1
  56. package/dist/core/auto-mode.js +3 -5
  57. package/dist/core/background-agent-store.d.ts +7 -5
  58. package/dist/core/background-agent-store.js +12 -11
  59. package/dist/core/checkpoint-requirements.d.ts +24 -3
  60. package/dist/core/checkpoint-requirements.js +9 -1
  61. package/dist/core/checkpoint-store.d.ts +78 -19
  62. package/dist/core/checkpoint-store.js +8 -4
  63. package/dist/core/child-clamp-seats.d.ts +3 -2
  64. package/dist/core/child-clamp-seats.js +4 -3
  65. package/dist/core/closest-name.d.ts +13 -0
  66. package/dist/core/closest-name.js +35 -0
  67. package/dist/core/context-settings.js +3 -5
  68. package/dist/core/cross-boundary-taint.d.ts +1 -1
  69. package/dist/core/decision-receipt.d.ts +14 -1
  70. package/dist/core/decision-receipt.js +6 -3
  71. package/dist/core/delegation-frames.d.ts +13 -9
  72. package/dist/core/effective-path-target.js +2 -3
  73. package/dist/core/engine-attestation.d.ts +11 -1
  74. package/dist/core/engine-attestation.js +2 -0
  75. package/dist/core/engine-notice.d.ts +49 -18
  76. package/dist/core/file-history-retention.d.ts +8 -0
  77. package/dist/core/file-history-retention.js +14 -11
  78. package/dist/core/file-history-store.d.ts +31 -1
  79. package/dist/core/file-history-store.js +31 -2
  80. package/dist/core/frame-settlement.d.ts +10 -0
  81. package/dist/core/frame-settlement.js +6 -1
  82. package/dist/core/fs-write-gate-policy.d.ts +3 -3
  83. package/dist/core/fs-write-gate-policy.js +8 -7
  84. package/dist/core/gate-fold.js +2 -1
  85. package/dist/core/gate-lanes.js +7 -4
  86. package/dist/core/gate-outcome.d.ts +40 -1
  87. package/dist/core/gate-outcome.js +10 -0
  88. package/dist/core/git-worktree-env.d.ts +7 -3
  89. package/dist/core/git-worktree-env.js +16 -13
  90. package/dist/core/governance-codes.d.ts +12 -4
  91. package/dist/core/governance-codes.js +16 -4
  92. package/dist/core/hooks.d.ts +12 -4
  93. package/dist/core/hooks.js +11 -4
  94. package/dist/core/host-floor.js +3 -5
  95. package/dist/core/image-admission.d.ts +48 -8
  96. package/dist/core/image-admission.js +35 -4
  97. package/dist/core/input-author.d.ts +36 -0
  98. package/dist/core/input-author.js +39 -0
  99. package/dist/core/leg-identity.d.ts +62 -0
  100. package/dist/core/leg-identity.js +18 -0
  101. package/dist/core/locked-config.d.ts +2 -1
  102. package/dist/core/locked-config.js +5 -3
  103. package/dist/core/lsp.d.ts +5 -3
  104. package/dist/core/lsp.js +3 -2
  105. package/dist/core/mailbox-store.d.ts +85 -10
  106. package/dist/core/mailbox-store.js +31 -10
  107. package/dist/core/mcp-connection-pool.d.ts +6 -20
  108. package/dist/core/mcp-connection-pool.js +10 -28
  109. package/dist/core/mcp-failure.d.ts +76 -15
  110. package/dist/core/mcp-failure.js +60 -33
  111. package/dist/core/mcp-host-seat.d.ts +92 -53
  112. package/dist/core/mcp-host-seat.js +220 -46
  113. package/dist/core/mcp-probe.js +2 -2
  114. package/dist/core/mcp-server-link.d.ts +18 -6
  115. package/dist/core/mcp-server-link.js +19 -4
  116. package/dist/core/mcp-server-spec.d.ts +2 -1
  117. package/dist/core/mcp-session-end.d.ts +1 -2
  118. package/dist/core/mcp-session-end.js +1 -1
  119. package/dist/core/mcp.d.ts +6 -49
  120. package/dist/core/mcp.js +115 -111
  121. package/dist/core/media-byte-cap.d.ts +21 -46
  122. package/dist/core/media-byte-cap.js +55 -55
  123. package/dist/core/member-group.d.ts +7 -0
  124. package/dist/core/member-group.js +35 -0
  125. package/dist/core/memory-engine/consolidation.d.ts +1 -1
  126. package/dist/core/memory-engine/consolidation.js +7 -1
  127. package/dist/core/memory-engine/dual-root.d.ts +31 -0
  128. package/dist/core/memory-engine/dual-root.js +59 -11
  129. package/dist/core/memory-engine/engine.js +27 -24
  130. package/dist/core/memory-engine/file-backend.d.ts +13 -0
  131. package/dist/core/memory-engine/file-backend.js +35 -15
  132. package/dist/core/memory-engine/layout.d.ts +3 -0
  133. package/dist/core/memory-engine/layout.js +13 -3
  134. package/dist/core/memory-engine/memory-deployment.d.ts +110 -0
  135. package/dist/core/memory-engine/memory-deployment.js +182 -0
  136. package/dist/core/memory-engine/sync-client.d.ts +39 -18
  137. package/dist/core/memory-engine/sync-client.js +72 -14
  138. package/dist/core/memory-engine/sync-report.d.ts +7 -4
  139. package/dist/core/memory-engine/sync.d.ts +9 -1
  140. package/dist/core/mode-policy.d.ts +8 -8
  141. package/dist/core/mode-policy.js +7 -5
  142. package/dist/core/mods/agent-stations.d.ts +39 -4
  143. package/dist/core/mods/agent-stations.js +59 -10
  144. package/dist/core/mods/dollar.d.ts +62 -0
  145. package/dist/core/mods/extension-call.d.ts +15 -1
  146. package/dist/core/mods/extension-call.js +7 -2
  147. package/dist/core/mods/kernel/dispatch.d.ts +4 -3
  148. package/dist/core/mods/kernel/dispatch.js +4 -4
  149. package/dist/core/mods/kernel/events.d.ts +4 -1
  150. package/dist/core/mods/kernel/events.js +6 -6
  151. package/dist/core/mods/kernel/registration.d.ts +3 -0
  152. package/dist/core/mods/kernel/registration.js +5 -0
  153. package/dist/core/mods/kernel/site-rules.d.ts +6 -3
  154. package/dist/core/mods/kernel/site-rules.js +10 -2
  155. package/dist/core/mods/session-append.d.ts +115 -0
  156. package/dist/core/mods/session-append.js +311 -0
  157. package/dist/core/mods/session-compact.d.ts +48 -0
  158. package/dist/core/mods/session-compact.js +194 -0
  159. package/dist/core/mods/session-receive.d.ts +93 -0
  160. package/dist/core/mods/session-receive.js +141 -0
  161. package/dist/core/mods/session-send.d.ts +72 -0
  162. package/dist/core/mods/session-send.js +88 -0
  163. package/dist/core/mods/stations.d.ts +38 -16
  164. package/dist/core/mods/stations.js +25 -11
  165. package/dist/core/mods/tool-call.d.ts +2 -0
  166. package/dist/core/mods/tool-call.js +4 -4
  167. package/dist/core/output-style.js +3 -4
  168. package/dist/core/own-property-receipt.d.ts +61 -2
  169. package/dist/core/own-property-receipt.js +42 -2
  170. package/dist/core/park-selfcheck.js +4 -2
  171. package/dist/core/path-identity.d.ts +11 -0
  172. package/dist/core/path-identity.js +4 -0
  173. package/dist/core/path-rule-binding.d.ts +3 -1
  174. package/dist/core/path-rule-binding.js +3 -1
  175. package/dist/core/peer-seat.d.ts +3 -3
  176. package/dist/core/peer-seat.js +20 -8
  177. package/dist/core/permission-rule-consent.d.ts +21 -5
  178. package/dist/core/permission-rule-consent.js +21 -1
  179. package/dist/core/permission-rule-model.d.ts +34 -11
  180. package/dist/core/permission-rule-model.js +47 -10
  181. package/dist/core/permission-rule-org.d.ts +1 -1
  182. package/dist/core/permission-rule-provider.js +4 -1
  183. package/dist/core/permission-rules.d.ts +4 -0
  184. package/dist/core/permission-rules.js +11 -16
  185. package/dist/core/remote-env.d.ts +74 -26
  186. package/dist/core/remote-env.js +20 -0
  187. package/dist/core/retention-policy.d.ts +24 -23
  188. package/dist/core/retention-policy.js +36 -2
  189. package/dist/core/retention.d.ts +4 -1
  190. package/dist/core/retired-keys.d.ts +4 -4
  191. package/dist/core/row-admission.d.ts +10 -0
  192. package/dist/core/row-admission.js +5 -0
  193. package/dist/core/runner/advisor-instructions.d.ts +2 -1
  194. package/dist/core/runner/advisor-instructions.js +2 -1
  195. package/dist/core/runner/announce-once-ledger.d.ts +4 -4
  196. package/dist/core/runner/assemble-result.d.ts +13 -3
  197. package/dist/core/runner/assemble-result.js +12 -7
  198. package/dist/core/runner/caller-roster.d.ts +12 -9
  199. package/dist/core/runner/caller-roster.js +5 -2
  200. package/dist/core/runner/checkpoint-scope.d.ts +16 -1
  201. package/dist/core/runner/checkpoint-scope.js +21 -0
  202. package/dist/core/runner/compact-session.js +14 -2
  203. package/dist/core/runner/compaction-call-options.d.ts +1 -1
  204. package/dist/core/runner/compaction-restate.d.ts +2 -2
  205. package/dist/core/runner/compaction-restate.js +4 -3
  206. package/dist/core/runner/construction-doors.d.ts +2 -2
  207. package/dist/core/runner/construction-doors.js +2 -2
  208. package/dist/core/runner/contracts.d.ts +98 -26
  209. package/dist/core/runner/cross-boundary-lane.d.ts +1 -1
  210. package/dist/core/runner/decide-continuation.d.ts +4 -2
  211. package/dist/core/runner/decide-continuation.js +7 -4
  212. package/dist/core/runner/denial-limit-arms.d.ts +15 -21
  213. package/dist/core/runner/denial-limit-arms.js +17 -10
  214. package/dist/core/runner/expire-settle.d.ts +44 -0
  215. package/dist/core/runner/expire-settle.js +55 -0
  216. package/dist/core/runner/git-status-frame.d.ts +3 -3
  217. package/dist/core/runner/git-status-frame.js +2 -1
  218. package/dist/core/runner/halt-attribution.d.ts +2 -1
  219. package/dist/core/runner/halt-attribution.js +2 -1
  220. package/dist/core/runner/local-claims.d.ts +17 -0
  221. package/dist/core/runner/local-claims.js +18 -0
  222. package/dist/core/runner/media-removed-seat.d.ts +46 -0
  223. package/dist/core/runner/media-removed-seat.js +88 -0
  224. package/dist/core/runner/park-commit.d.ts +2 -2
  225. package/dist/core/runner/permission-rule-lanes.d.ts +5 -1
  226. package/dist/core/runner/permission-rule-lanes.js +28 -9
  227. package/dist/core/runner/person-path-rows.js +1 -1
  228. package/dist/core/runner/placement-fence.d.ts +26 -0
  229. package/dist/core/runner/placement-fence.js +38 -0
  230. package/dist/core/runner/prepare-ask-lane.d.ts +6 -12
  231. package/dist/core/runner/prepare-ask-lane.js +4 -4
  232. package/dist/core/runner/prepare-boundary-parks.d.ts +4 -1
  233. package/dist/core/runner/prepare-boundary-parks.js +2 -2
  234. package/dist/core/runner/prepare-caps-and-workflow.d.ts +2 -0
  235. package/dist/core/runner/prepare-caps-and-workflow.js +1 -0
  236. package/dist/core/runner/prepare-config-doors.js +16 -17
  237. package/dist/core/runner/prepare-context-lane.d.ts +6 -2
  238. package/dist/core/runner/prepare-context-lane.js +13 -13
  239. package/dist/core/runner/prepare-delegation-surface.d.ts +9 -9
  240. package/dist/core/runner/prepare-delegation-surface.js +4 -5
  241. package/dist/core/runner/prepare-execution-env.d.ts +5 -2
  242. package/dist/core/runner/prepare-execution-env.js +7 -4
  243. package/dist/core/runner/prepare-gate-stations.d.ts +19 -14
  244. package/dist/core/runner/prepare-gate-stations.js +6 -4
  245. package/dist/core/runner/prepare-hands-readface.d.ts +5 -5
  246. package/dist/core/runner/prepare-hands-readface.js +4 -4
  247. package/dist/core/runner/prepare-inherited-gate.d.ts +6 -0
  248. package/dist/core/runner/prepare-inherited-gate.js +3 -0
  249. package/dist/core/runner/prepare-lsp.d.ts +3 -0
  250. package/dist/core/runner/prepare-lsp.js +2 -2
  251. package/dist/core/runner/prepare-park-ask.d.ts +5 -2
  252. package/dist/core/runner/prepare-park-ask.js +4 -5
  253. package/dist/core/runner/prepare-policy-chain.d.ts +10 -21
  254. package/dist/core/runner/prepare-policy-chain.js +16 -25
  255. package/dist/core/runner/prepare-project-context.d.ts +2 -2
  256. package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -4
  257. package/dist/core/runner/prepare-prompt-inputs.js +3 -2
  258. package/dist/core/runner/prepare-question-face.d.ts +6 -4
  259. package/dist/core/runner/prepare-question-face.js +2 -2
  260. package/dist/core/runner/prepare-run-refs.d.ts +3 -0
  261. package/dist/core/runner/prepare-run-refs.js +2 -2
  262. package/dist/core/runner/prepare-suspend-saga.d.ts +11 -7
  263. package/dist/core/runner/prepare-suspend-saga.js +17 -7
  264. package/dist/core/runner/prepare-task.d.ts +1 -1
  265. package/dist/core/runner/prepare-task.js +56 -28
  266. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +6 -0
  267. package/dist/core/runner/prepare-tool-disclosure-mount.js +3 -1
  268. package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -0
  269. package/dist/core/runner/prepare-wiring-manifest.js +2 -1
  270. package/dist/core/runner/prepare-workspace-restore.d.ts +5 -0
  271. package/dist/core/runner/prepare-workspace-restore.js +10 -6
  272. package/dist/core/runner/read-root-grant.d.ts +1 -1
  273. package/dist/core/runner/read-root-grant.js +2 -1
  274. package/dist/core/runner/resume-admission.d.ts +5 -3
  275. package/dist/core/runner/resume-admission.js +17 -3
  276. package/dist/core/runner/resume-apply.js +3 -1
  277. package/dist/core/runner/resume-claim.d.ts +8 -3
  278. package/dist/core/runner/resume-claim.js +28 -12
  279. package/dist/core/runner/resume-internals-and-config.d.ts +2 -2
  280. package/dist/core/runner/resume-internals-and-config.js +10 -1
  281. package/dist/core/runner/resume-preflight.d.ts +3 -2
  282. package/dist/core/runner/resume-preflight.js +13 -26
  283. package/dist/core/runner/retired-runner-deps.js +2 -0
  284. package/dist/core/runner/run-git-lane.js +2 -1
  285. package/dist/core/runner/run-harness-handlers.js +2 -2
  286. package/dist/core/runner/run-identity-wiring.d.ts +2 -2
  287. package/dist/core/runner/run-identity-wiring.js +14 -5
  288. package/dist/core/runner/run-leg.d.ts +3 -3
  289. package/dist/core/runner/run-leg.js +40 -29
  290. package/dist/core/runner/run-notification-lane.js +20 -2
  291. package/dist/core/runner/run-recovery-lanes.js +3 -2
  292. package/dist/core/runner/run-settle-and-teardown.js +9 -7
  293. package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +1 -1
  294. package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
  295. package/dist/core/runner/run-terminal-adoption.js +26 -17
  296. package/dist/core/runner/run-turn-boundary.js +27 -14
  297. package/dist/core/runner/runtask.d.ts +18 -3
  298. package/dist/core/runner/runtask.js +27 -11
  299. package/dist/core/runner/session-rule-policy.d.ts +1 -1
  300. package/dist/core/runner/session-rule-policy.js +6 -1
  301. package/dist/core/runner/shell-env-withheld.d.ts +1 -1
  302. package/dist/core/runner/stream-halt-verbs.d.ts +1 -14
  303. package/dist/core/runner/stream-halt-verbs.js +4 -3
  304. package/dist/core/runner/stream-reap.d.ts +7 -6
  305. package/dist/core/runner/stream-reap.js +13 -16
  306. package/dist/core/runner/stream-settle-backstop.d.ts +3 -2
  307. package/dist/core/runner/stream-settle-backstop.js +5 -3
  308. package/dist/core/runner/stream-steer-verb.d.ts +5 -2
  309. package/dist/core/runner/stream-steer-verb.js +8 -7
  310. package/dist/core/runner/terminal-account.d.ts +11 -1
  311. package/dist/core/runner/terminal-account.js +20 -0
  312. package/dist/core/runner/terminal-projection.d.ts +8 -2
  313. package/dist/core/runner/terminal-projection.js +2 -2
  314. package/dist/core/runner/tool-disclosure.d.ts +3 -0
  315. package/dist/core/runner/tool-disclosure.js +5 -2
  316. package/dist/core/runner/tool-end-body.d.ts +3 -3
  317. package/dist/core/runner/tool-end-body.js +1 -1
  318. package/dist/core/runner/tool-output-projection.d.ts +3 -3
  319. package/dist/core/runner/tool-output-projection.js +7 -6
  320. package/dist/core/runner/tool-table-view.d.ts +56 -0
  321. package/dist/core/runner/tool-table-view.js +51 -0
  322. package/dist/core/runner/turn-attachments.d.ts +3 -2
  323. package/dist/core/runner/turn-attachments.js +1 -1
  324. package/dist/core/runner/void-verifier-pause.d.ts +33 -0
  325. package/dist/core/runner/void-verifier-pause.js +41 -0
  326. package/dist/core/runner-deps.d.ts +24 -25
  327. package/dist/core/secret-env.d.ts +11 -11
  328. package/dist/core/secret-env.js +8 -9
  329. package/dist/core/session-log-transfer.js +9 -10
  330. package/dist/core/session-policy-store.d.ts +1 -1
  331. package/dist/core/session-policy-store.js +5 -2
  332. package/dist/core/session-reconcile.d.ts +3 -2
  333. package/dist/core/session-reconcile.js +7 -4
  334. package/dist/core/session-store.d.ts +2 -0
  335. package/dist/core/session-store.js +5 -7
  336. package/dist/core/session.d.ts +2 -1
  337. package/dist/core/shell-confinement.d.ts +37 -0
  338. package/dist/core/shell-confinement.js +56 -0
  339. package/dist/core/skill-grant.js +1 -1
  340. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +2 -2
  341. package/dist/core/store-contracts/checkpoint-store-contract.js +15 -2
  342. package/dist/core/store-contracts/file-history-store-contract.d.ts +5 -2
  343. package/dist/core/store-contracts/file-history-store-contract.js +25 -1
  344. package/dist/core/store-contracts/mailbox-store-contract.d.ts +12 -5
  345. package/dist/core/store-contracts/mailbox-store-contract.js +156 -9
  346. package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
  347. package/dist/core/store-contracts/tool-result-store-contract.js +30 -0
  348. package/dist/core/task-event.d.ts +17 -8
  349. package/dist/core/task-limits.d.ts +5 -0
  350. package/dist/core/task-notification.d.ts +89 -12
  351. package/dist/core/task-notification.js +87 -13
  352. package/dist/core/task-registry-agent.d.ts +5 -43
  353. package/dist/core/task-registry-agent.js +24 -51
  354. package/dist/core/task-registry-monitor.d.ts +1 -1
  355. package/dist/core/task-registry-monitor.js +15 -60
  356. package/dist/core/task-registry-shared.d.ts +15 -112
  357. package/dist/core/task-registry-shared.js +3 -41
  358. package/dist/core/task-registry-workflow.js +4 -21
  359. package/dist/core/task-registry.d.ts +19 -60
  360. package/dist/core/task-registry.js +19 -106
  361. package/dist/core/task-result.d.ts +24 -7
  362. package/dist/core/task-spec-members.d.ts +39 -0
  363. package/dist/core/task-spec-members.js +92 -0
  364. package/dist/core/task-spec.d.ts +10 -10
  365. package/dist/core/task-tool-shape.d.ts +7 -57
  366. package/dist/core/task-tool-shape.js +7 -66
  367. package/dist/core/terminal-cause.d.ts +30 -0
  368. package/dist/core/terminal-cause.js +1 -0
  369. package/dist/core/tool-catalog-entries.js +2 -5
  370. package/dist/core/tool-check-reading.js +16 -10
  371. package/dist/core/tool-conformance.js +1 -2
  372. package/dist/core/tool-errors.d.ts +6 -3
  373. package/dist/core/tool-errors.js +2 -0
  374. package/dist/core/tool-face-reader.js +3 -2
  375. package/dist/core/tool-face.d.ts +2 -3
  376. package/dist/core/tool-name-aliases.d.ts +5 -29
  377. package/dist/core/tool-name-aliases.js +9 -5
  378. package/dist/core/tool-name-readings.d.ts +14 -3
  379. package/dist/core/tool-name-readings.js +2 -0
  380. package/dist/core/tool-policy.d.ts +108 -18
  381. package/dist/core/tool-policy.js +84 -14
  382. package/dist/core/tool-result-store.d.ts +23 -0
  383. package/dist/core/tool-result-store.js +3 -2
  384. package/dist/core/tool-spec.d.ts +19 -6
  385. package/dist/core/trace.d.ts +18 -1
  386. package/dist/core/user-attachment.js +26 -21
  387. package/dist/core/workflow-journal-store.d.ts +1 -1
  388. package/dist/core/workflow-run-store.d.ts +2 -0
  389. package/dist/core/workflow-run-store.js +6 -5
  390. package/dist/core/workflow-settled-run.d.ts +5 -0
  391. package/dist/core/workflow-settled-run.js +7 -0
  392. package/dist/engine/execution-env/node-execution-env.d.ts +34 -9
  393. package/dist/engine/execution-env/node-execution-env.js +213 -21
  394. package/dist/engine/harness/agent-harness.d.ts +65 -18
  395. package/dist/engine/harness/agent-harness.js +90 -23
  396. package/dist/engine/harness/messages.d.ts +4 -3
  397. package/dist/engine/harness/messages.js +2 -2
  398. package/dist/engine/harness/types.d.ts +41 -7
  399. package/dist/engine/llm/media-removed.d.ts +14 -0
  400. package/dist/engine/llm/media-removed.js +9 -0
  401. package/dist/engine/llm/rejected-images.d.ts +35 -25
  402. package/dist/engine/llm/rejected-images.js +59 -10
  403. package/dist/engine/llm/types.d.ts +24 -3
  404. package/dist/engine/llm/types.js +7 -3
  405. package/dist/engine/loop/agent-loop.d.ts +6 -1
  406. package/dist/engine/loop/agent-loop.js +20 -11
  407. package/dist/engine/loop/types.d.ts +12 -3
  408. package/dist/engine/session/import-validate.js +7 -0
  409. package/dist/fixtures/index.d.ts +7 -5
  410. package/dist/fixtures/index.js +5 -3
  411. package/dist/index.d.ts +21 -11
  412. package/dist/index.js +15 -7
  413. package/dist/internal/harness-types.d.ts +2 -0
  414. package/dist/internal/llm.d.ts +2 -1
  415. package/dist/internal/llm.js +1 -0
  416. package/dist/orchestration/goal.d.ts +6 -2
  417. package/dist/orchestration/goal.js +6 -3
  418. package/dist/orchestration/run-workflow-tool.d.ts +11 -17
  419. package/dist/orchestration/run-workflow-tool.js +19 -42
  420. package/dist/orchestration/workflow-governance.d.ts +1 -1
  421. package/dist/orchestration/workflow-types.d.ts +2 -2
  422. package/dist/orchestration/workflow.d.ts +4 -0
  423. package/dist/orchestration/workflow.js +8 -5
  424. package/dist/stores/file/background-agent-store.js +18 -15
  425. package/dist/stores/file/checkpoint-store.js +7 -4
  426. package/dist/stores/file/file-history-store.js +3 -2
  427. package/dist/stores/file/index.d.ts +5 -3
  428. package/dist/stores/file/index.js +23 -8
  429. package/dist/stores/file/ledger-tuning.d.ts +23 -0
  430. package/dist/stores/file/ledger-tuning.js +21 -0
  431. package/dist/stores/file/mailbox-store.js +42 -22
  432. package/dist/stores/file/memory-store.js +3 -2
  433. package/dist/stores/file/permission-rule-adopt.js +24 -21
  434. package/dist/stores/file/permission-rule-store.js +6 -3
  435. package/dist/stores/file/session-policy-store.js +3 -2
  436. package/dist/stores/file/session-store.d.ts +16 -3
  437. package/dist/stores/file/session-store.js +21 -20
  438. package/dist/stores/file/tool-result-store.d.ts +11 -0
  439. package/dist/stores/file/tool-result-store.js +57 -3
  440. package/dist/stores/file/usage-window-store.js +3 -2
  441. package/dist/stores/file/workflow-journal-store.d.ts +0 -2
  442. package/dist/stores/file/workflow-journal-store.js +3 -18
  443. package/dist/stores/file/workflow-run-store.d.ts +1 -1
  444. package/dist/stores/file/workflow-run-store.js +15 -10
  445. package/dist/tools/fs/dead-cwd.d.ts +5 -5
  446. package/dist/tools/fs/dead-cwd.js +4 -11
  447. package/dist/tools/fs/fs-bash-background-text.d.ts +6 -0
  448. package/dist/tools/fs/fs-bash-background-text.js +6 -0
  449. package/dist/tools/fs/fs-bash.d.ts +3 -18
  450. package/dist/tools/fs/fs-bash.js +37 -124
  451. package/dist/tools/fs/fs-pdf.js +8 -6
  452. package/dist/tools/fs/fs-read.js +2 -2
  453. package/dist/tools/fs/fs-shared.d.ts +28 -3
  454. package/dist/tools/fs/fs-shared.js +15 -0
  455. package/dist/tools/fs/index.d.ts +1 -1
  456. package/dist/tools/fs/index.js +4 -14
  457. package/dist/tools/fs/pdf.d.ts +4 -4
  458. package/dist/tools/fs/pdf.js +6 -6
  459. package/dist/tools/fs/read-deny-home.js +8 -1
  460. package/dist/tools/fs/read-deny.d.ts +26 -2
  461. package/dist/tools/fs/read-deny.js +9 -2
  462. package/dist/tools/fs/read-floor.d.ts +13 -5
  463. package/dist/tools/fs/read-floor.js +206 -2
  464. package/dist/tools/fs/search.d.ts +3 -2
  465. package/dist/tools/fs/search.js +6 -6
  466. package/dist/tools/fs/shell-read-establish.js +3 -1
  467. package/dist/tools/fs/shell-read-identity.d.ts +3 -1
  468. package/dist/tools/fs/shell-read-identity.js +4 -2
  469. package/dist/tools/fs/shell-read-judge.d.ts +7 -1
  470. package/dist/tools/fs/shell-read-judge.js +1 -1
  471. package/dist/tools/monitor.d.ts +8 -7
  472. package/dist/tools/monitor.js +12 -10
  473. package/dist/tools/worktree.d.ts +5 -1
  474. package/dist/tools/worktree.js +20 -17
  475. package/package.json +6 -3
  476. package/test/export-surface.snapshot.json +92 -10
  477. package/wire-changes/core-stores-sql@7.61.0.json +480 -0
  478. package/wire-changes/core@7.61.0.json +4405 -0
  479. package/wire-changes/mods-kernel@7.61.0.json +65 -0
  480. package/wire-changes/primitives@7.61.0.json +30 -0
  481. package/dist/core/runner/image-removed-seat.d.ts +0 -12
  482. package/dist/core/runner/image-removed-seat.js +0 -19
@@ -66,12 +66,16 @@ export interface AskQuestionRequest {
66
66
  * actually CALLS a question face: the in-tool synchronous call, and the gate's pre-execution content-ask
67
67
  * routing. A durable suspend invokes no face at all, so it carries none. */
68
68
  readonly principal?: string;
69
- /** Runner-filled source-task identity (= issuing task's session id), for per-worker attribution by an
70
- * aggregating onQuestion. **worker-unforgeable for Runner-created delegated subagents/team members**
71
- * (those child specs do not pass TaskSpec.sessionId — the Runner mints the id); a top-level caller CAN
72
- * still set `TaskSpec.sessionId`, so this is NOT a globally unforgeable run id (design S1d §1.3).
73
- * `readonly` + same "only where a face is really called" caveat as `principal`. */
74
- readonly sourceTaskId?: string;
69
+ /** Runner-filled: the issuing leg's session id (the conversation the question was raised in), for per-worker
70
+ * attribution by an aggregating onQuestion. **worker-unforgeable for Runner-created delegated subagents/team
71
+ * members** (those child specs do not pass TaskSpec.sessionId — the Runner mints the id); a top-level caller CAN
72
+ * still set `TaskSpec.sessionId`, so this is NOT a globally unforgeable run id (design S1d §1.3). It names a
73
+ * conversation, never a task. `readonly` + same "only where a face is really called" caveat as `principal`. */
74
+ readonly sourceSessionId?: string;
75
+ /** Runner-filled: the issuing leg's task id when that leg is a delegated child — the same value and the same
76
+ * presence as {@link import("./tool-policy.js").AskRequest}.agentId (one mint for both); absent on a host's
77
+ * question. `readonly` + same caveat as `principal`. */
78
+ readonly agentId?: string;
75
79
  /**
76
80
  * The canonical hash of the tool-call arguments this question was built from, as computed by the
77
81
  * engine's one `boundInputHashOf` (the same digest the durable park binds its checkpoint to, so the
@@ -79,7 +83,7 @@ export interface AskQuestionRequest {
79
83
  * — a directly-mounted tool calling its own face carries none.
80
84
  *
81
85
  * The split to keep straight, because the two words are easy to swap:
82
- * - `(sourceTaskId, toolCallId, boundInputHash)` is the RECONCILIATION key — "is this the same
86
+ * - `(sourceSessionId, toolCallId, boundInputHash)` is the RECONCILIATION key — "is this the same
83
87
  * question, on the same call, in the same run?". It is what lets an in-stream delivery be matched
84
88
  * against a parked one, and what an audit trail joins on. It is NOT an identity: all three
85
89
  * components repeat for two sequential deliveries of an identical question.
@@ -96,7 +100,7 @@ export interface AskQuestionRequest {
96
100
  * refused instead of applied to a question nobody is waiting on any more.
97
101
  *
98
102
  * Why not the tuple you might reach for first: `toolCallId` comes from the model/provider and is not
99
- * guaranteed unique within a session, `sourceTaskId` can be caller-supplied, and the argument hash
103
+ * guaranteed unique within a session, `sourceSessionId` can be caller-supplied, and the argument hash
100
104
  * is identical for two identical questions. Their combination therefore repeats for two sequential
101
105
  * deliveries of the same question — under which a registry would close the second on the first's
102
106
  * ticket, or hand the second the first's late answer. That tuple remains the RECONCILIATION key
@@ -351,15 +355,17 @@ export declare function markBoundOnlyQuestionFace<F extends OnQuestion>(face: F)
351
355
  * Callers resolve the seat first (`spec.onQuestion ?? deps.onQuestion`) and pass the resolved value.
352
356
  */
353
357
  export declare function isLiveQuestionFace(face: unknown): face is OnQuestion;
358
+ /** The issuing leg's members of a question request. */
359
+ export type QuestionSource = Pick<AskQuestionRequest, "principal" | "sourceSessionId" | "agentId">;
360
+ /** The source members a question request carries, each only when present — the mounted tool's call and the gate's routing
361
+ * lane both read the leg's one ask source through this. */
362
+ export declare function questionSourceOf(source: QuestionSource | undefined): QuestionSource;
354
363
  /** Build the AskUserQuestion tool. When `onQuestion` is undefined the tool still mounts but returns the
355
364
  * headless default (so a run started without a human in the loop never hangs). */
356
365
  export declare function createAskUserQuestionTool(onQuestion?: OnQuestion,
357
366
  /** design S1d §1.2: Runner-filled source identity, merged into the {@link AskQuestionRequest} so an
358
- * aggregating onQuestion can attribute per worker/user. Omitted ⇒ fields stay undefined (no-op). */
359
- source?: {
360
- principal?: string;
361
- sourceTaskId?: string;
362
- }, opts?: AskUserQuestionToolOptions): AgentTool;
367
+ * aggregating onQuestion can attribute per worker/user. Omitted ⇒ the members stay absent (no-op). */
368
+ source?: QuestionSource, opts?: AskUserQuestionToolOptions): AgentTool;
363
369
  /**
364
370
  * The ONE producer of the "engine stripped the spawn turn's question face" fact. The strip (removing `onQuestion`
365
371
  * from a child spec — or from the parent SPEC seat a child is built from — when the child OUTLIVES the request that
@@ -94,6 +94,13 @@ export function markBoundOnlyQuestionFace(face) {
94
94
  export function isLiveQuestionFace(face) {
95
95
  return typeof face === "function" && face !== QUESTION_AWAITS_RESUME && !boundOnlyQuestionFaces.has(face);
96
96
  }
97
+ export function questionSourceOf(source) {
98
+ return {
99
+ ...(source?.principal !== undefined ? { principal: source.principal } : {}),
100
+ ...(source?.sourceSessionId !== undefined ? { sourceSessionId: source.sourceSessionId } : {}),
101
+ ...(source?.agentId !== undefined ? { agentId: source.agentId } : {}),
102
+ };
103
+ }
97
104
  export function createAskUserQuestionTool(onQuestion, source, opts) {
98
105
  const disclosedSyntheticContinuations = new Set();
99
106
  let approvalPostureSpent = false;
@@ -191,8 +198,7 @@ export function createAskUserQuestionTool(onQuestion, source, opts) {
191
198
  const outcome = await onQuestion({
192
199
  toolCallId: ctx.toolCallId,
193
200
  questions,
194
- principal: source?.principal,
195
- sourceTaskId: source?.sourceTaskId,
201
+ ...questionSourceOf(source),
196
202
  deliveryId: uuidv7(),
197
203
  }, ctx.signal);
198
204
  const reading = classifyQuestionOutcome(outcome);
@@ -140,6 +140,8 @@ export interface MaybeCompactOptions {
140
140
  /** The session to compact. Typed on the INTERFACE face (typecheck 车 2026-07-24): every member this
141
141
  * module touches lives on `Session` (the optional `getPromptEpoch` degrades honestly via `?.()`). */
142
142
  session: Session;
143
+ /** The leg's admission seat (`session.append`): a row this pass adds to the transcript passes it first. Absent ⇒ as made. */
144
+ admitRows?: import("../internal/harness.js").RowAdmission;
143
145
  /** This run's prompt identity inputs (and the pinned center layer's provenance): the compaction restates the
144
146
  * session's epoch when the identity is unchanged and advances it otherwise — the same identity the prepare-time
145
147
  * record names, so a compaction never flaps the record. Absent ⇒ no restatement (a host compacting outside a run). */
@@ -8,6 +8,7 @@ import { brainToRuntime } from "./runtime.js";
8
8
  import { defuseFenceMarkers, sanitizeUntrustedText } from "./untrusted-text.js";
9
9
  import { createSafeNotifier, observeThenableRejection } from "./safe-notify.js";
10
10
  import { thrownText } from "./thrown-value.js";
11
+ import { appendAdmittedRow } from "./row-admission.js";
11
12
  import { egressThrownText } from "./untrusted-egress.js";
12
13
  export const DEFAULT_COMPACTION_INSTRUCTIONS = "Preserve verbatim every code, identifier, name, number, file path, error message, credential " +
13
14
  "reference, and explicit user instruction or decision mentioned anywhere in the conversation. " +
@@ -493,7 +494,7 @@ export async function maybeCompact(opts) {
493
494
  const delivered = [];
494
495
  for (const f of restoreFrames) {
495
496
  try {
496
- await opts.session.appendMessage({ role: "user", content: [...f.seed.content], timestamp: Date.now(), provenance: "engine-note", attachment: f.seed.attachment });
497
+ await appendAdmittedRow(opts.admitRows, opts.session, { role: "user", content: [...f.seed.content], timestamp: Date.now(), provenance: "engine-note", attachment: f.seed.attachment });
497
498
  delivered.push(f);
498
499
  }
499
500
  catch (err) {
@@ -3,6 +3,7 @@ import { withStatusSeat } from "../brain/status-sink.js";
3
3
  import { thrownIs } from "./thrown-value.js";
4
4
  import { describeRejectedValue } from "./tool-search-setting.js";
5
5
  import { isPlainRecord } from "./mods/kernel/receive.js";
6
+ import { optionKeys, receiveMembers } from "./own-property-receipt.js";
6
7
  export const AUTO_MODE_UNAVAILABLE_CAUSES = Object.freeze(["error", "timeout"]);
7
8
  const AUTO_MODE_UNAVAILABLE_CAUSE_SET = new Set(AUTO_MODE_UNAVAILABLE_CAUSES);
8
9
  export function isAutoModeUnavailableCause(v) {
@@ -382,7 +383,7 @@ export function unarmedWindow(fallback) {
382
383
  function countsOf(fallback) {
383
384
  return { consecutive: fallback.consecutive, total: fallback.total, limit: fallback.limit };
384
385
  }
385
- const DENIAL_LIMIT_MEMBERS = new Set(["maxConsecutive", "maxTotal", "autoDenyAfterMs"]);
386
+ const DENIAL_LIMIT_KEYS = optionKeys()({ maxConsecutive: 0, maxTotal: 0, autoDenyAfterMs: 0 });
386
387
  export function autoModeDenialLimitOf(v) {
387
388
  const refuse = (what) => {
388
389
  const e = new Error(`RunnerDeps.autoMode.denialLimit${what}`);
@@ -393,10 +394,7 @@ export function autoModeDenialLimitOf(v) {
393
394
  return { ...AUTO_MODE_DENIAL_LIMIT_DEFAULTS, autoDenyAfterMs: AUTO_MODE_DENIAL_AUTO_DENY_DEFAULT_MS };
394
395
  if (typeof v !== "object" || v === null || Array.isArray(v))
395
396
  return refuse(` must be a record of bounds (got ${describeRejectedValue(v)}) — omit it for the defaults`);
396
- const opts = v;
397
- const stray = Object.keys(opts).find((k) => !DENIAL_LIMIT_MEMBERS.has(k));
398
- if (stray !== undefined)
399
- return refuse(` has no member ${JSON.stringify(stray)} — its members are maxConsecutive, maxTotal and autoDenyAfterMs`);
397
+ const opts = receiveMembers(v, { subject: "RunnerDeps.autoMode.denialLimit", unit: "member", moment: "when the knob is read" }, DENIAL_LIMIT_KEYS, (_, [stray]) => refuse(` has no member ${JSON.stringify(String(stray))} — its members are maxConsecutive, maxTotal and autoDenyAfterMs`));
400
398
  const bound = (name, dflt) => {
401
399
  const b = opts[name];
402
400
  if (b === undefined)
@@ -85,7 +85,7 @@ export interface BackgroundAgentRecord {
85
85
  stoppedBy?: string;
86
86
  /** The cross-channel completion correlation id
87
87
  * (task-registry `SemaTaskHandle.completionId` mirror). Written alongside `status`/`settledAt` at
88
- * the same durable terminal write that lands them, so a cross-restart fallback read (`TaskOutput`
88
+ * the same durable terminal write that lands them, so a cross-restart fallback read (a host poll
89
89
  * after the writing process is gone) REPLAYS this exact value — there is no second mint point here,
90
90
  * this field only ever receives what the in-memory handle already minted before the write. */
91
91
  completionId?: string;
@@ -311,10 +311,12 @@ export interface BackgroundAgentReapOptions {
311
311
  * Must be a finite, non-negative number of milliseconds. */
312
312
  staleRunningMaxAgeMs?: number;
313
313
  }
314
- /** knob-hygiene #98 — refuse a malformed reap policy before any row is touched. Delegates to the one
315
- * shared validator ({@link assertRetentionPolicy}) both bundled stores and the sibling mailbox /
316
- * workflow-run / roster retention seams run through, so no implementation can drift from another. */
317
- export declare function assertBackgroundAgentReapOptions(opts: BackgroundAgentReapOptions | undefined): void;
314
+ /** The retention knobs a background-agent `reap` takes (and the durable-agent joint reap beside it). */
315
+ export declare const BACKGROUND_AGENT_REAP_KNOBS: readonly ["maxAgeMs", "keep", "staleRunningMaxAgeMs"];
316
+ /** knob-hygiene #98 — read a reap policy once and refuse a malformed one before any row is touched. Delegates to the one
317
+ * shared reading ({@link receiveRetentionPolicy}) both bundled stores and the sibling mailbox / workflow-run retention
318
+ * seams run through, so no implementation can drift from another; the sweep deletes by the copy this returns. */
319
+ export declare function receiveBackgroundAgentReapOptions(opts: BackgroundAgentReapOptions | undefined): Readonly<BackgroundAgentReapOptions>;
318
320
  export interface BackgroundAgentStore {
319
321
  put(record: BackgroundAgentRecord): Promise<void>;
320
322
  get(handle: string, scope: string): Promise<BackgroundAgentRecord | null>;
@@ -1,5 +1,5 @@
1
1
  import { uuidv7 } from "../internal/harness.js";
2
- import { assertRetentionPolicy } from "./retention-policy.js";
2
+ import { receiveRetentionPolicy } from "./retention-policy.js";
3
3
  export const REVIVED_ROW_CLEARED_FIELDS = Object.freeze([
4
4
  "settledAt",
5
5
  "stoppedBy",
@@ -59,8 +59,9 @@ export function canAccessAgentRecord(record, access) {
59
59
  return false;
60
60
  }
61
61
  export const STALE_RUNNING_REAP_ATTRIBUTION = "the host process was interrupted while this agent was running — its in-process state was lost. Check its worktree / output file for partial work before assuming the task landed (stale running row reaped).";
62
- export function assertBackgroundAgentReapOptions(opts) {
63
- assertRetentionPolicy("BackgroundAgentStore.reap", opts);
62
+ export const BACKGROUND_AGENT_REAP_KNOBS = Object.freeze(["maxAgeMs", "keep", "staleRunningMaxAgeMs"]);
63
+ export function receiveBackgroundAgentReapOptions(opts) {
64
+ return receiveRetentionPolicy("BackgroundAgentStore.reap", opts, BACKGROUND_AGENT_REAP_KNOBS);
64
65
  }
65
66
  export async function reconcileParkedAgents(stores, scope, now, opts) {
66
67
  const out = { failed: 0, rolledBack: 0 };
@@ -275,15 +276,15 @@ export class InMemoryBackgroundAgentStore {
275
276
  return [...new Set([...this.rows.values()].map((r) => r.scope))].sort();
276
277
  }
277
278
  async reap(scope, now, opts) {
278
- assertBackgroundAgentReapOptions(opts);
279
- if (!opts || (opts.maxAgeMs === undefined && opts.keep === undefined && opts.staleRunningMaxAgeMs === undefined))
279
+ const policy = receiveBackgroundAgentReapOptions(opts);
280
+ if (policy.maxAgeMs === undefined && policy.keep === undefined && policy.staleRunningMaxAgeMs === undefined)
280
281
  return 0;
281
282
  const flippedKeys = new Set();
282
- if (opts.staleRunningMaxAgeMs !== undefined) {
283
+ if (policy.staleRunningMaxAgeMs !== undefined) {
283
284
  for (const [k, r] of this.rows) {
284
285
  if (r.scope !== scope || r.status !== "running")
285
286
  continue;
286
- if (now - r.updatedAt <= opts.staleRunningMaxAgeMs)
287
+ if (now - r.updatedAt <= policy.staleRunningMaxAgeMs)
287
288
  continue;
288
289
  const flipped = structuredClone(r);
289
290
  flipped.status = "failed";
@@ -301,14 +302,14 @@ export class InMemoryBackgroundAgentStore {
301
302
  .filter(([, r]) => r.scope === scope && r.status !== "running" && r.status !== "parked")
302
303
  .sort(([, a], [, b]) => b.spawnedAt - a.spawnedAt);
303
304
  const doomed = new Set();
304
- if (opts.maxAgeMs !== undefined) {
305
+ if (policy.maxAgeMs !== undefined) {
305
306
  for (const [k, r] of terminal) {
306
- if ((r.settledAt ?? r.spawnedAt) < now - opts.maxAgeMs)
307
+ if ((r.settledAt ?? r.spawnedAt) < now - policy.maxAgeMs)
307
308
  doomed.add(k);
308
309
  }
309
310
  }
310
- if (opts.keep !== undefined) {
311
- for (const [k] of terminal.slice(Math.max(0, opts.keep)))
311
+ if (policy.keep !== undefined) {
312
+ for (const [k] of terminal.slice(Math.max(0, policy.keep)))
312
313
  doomed.add(k);
313
314
  }
314
315
  for (const k of doomed)
@@ -6,7 +6,7 @@ import { type StoreFidelity, type Checkpoint, type CheckpointFeature, type Check
6
6
  * had carried beside the one its word now names, and the members added after the table, each a capability a reader
7
7
  * must have. Downstream reads them for display only (`CheckpointError.detail.requires`).
8
8
  */
9
- export declare const REQUIREMENT_WORDS: readonly ["resource", "binding", "token", "orgAdmission", "f012", "realApproval", "face", "requirements_digest", "org_admission_inherited", "org_write_grant", "org_governed", "delegation_provenance", "skill_grants", "skill_card_binding", "hands_coordinates", "hands_home", "path_rule_anchors", "path_rule_installations", "permission_mode", "plan_mode_restore", "persisted_rule_mandate", "deployment_authored", "call_names", "write_face", "denial_limit_fallback", "leg_scope", "tool_ceiling", "tool_lists_judged", "own_tool_lists", "approval_targets", "approval_target_reads", "cross_boundary", "mount_site", "skill_scopes", "run_origin", "tool_declaration"];
9
+ export declare const REQUIREMENT_WORDS: readonly ["resource", "binding", "token", "orgAdmission", "f012", "realApproval", "face", "requirements_digest", "org_admission_inherited", "org_write_grant", "org_governed", "delegation_provenance", "skill_grants", "skill_card_binding", "hands_coordinates", "hands_home", "path_rule_anchors", "path_rule_installations", "permission_mode", "plan_mode_restore", "persisted_rule_mandate", "deployment_authored", "call_names", "write_face", "denial_limit_fallback", "leg_scope", "tool_ceiling", "tool_lists_judged", "own_tool_lists", "approval_targets", "approval_target_reads", "cross_boundary", "mount_site", "skill_scopes", "run_origin", "tool_declaration", "composition_leg", "row_task_id", "held_rows", "source_session"];
10
10
  export type RequirementWord = (typeof REQUIREMENT_WORDS)[number];
11
11
  /** Runtime twin of {@link RequirementWord}. */
12
12
  export declare function isRequirementWord(word: unknown): word is RequirementWord;
@@ -212,9 +212,15 @@ export declare const CHECKPOINT_STATE_REQUIREMENTS: {
212
212
  readonly isDelegatedChild: {
213
213
  readonly digest: "decision-read";
214
214
  };
215
+ readonly rowTaskId: {
216
+ readonly word: "row_task_id";
217
+ };
215
218
  readonly placementRootSessionId: {
216
219
  readonly digest: "decision-read";
217
220
  };
221
+ readonly compositionLeg: {
222
+ readonly word: "composition_leg";
223
+ };
218
224
  readonly externalContentTarget: {
219
225
  readonly digest: "decision-read";
220
226
  };
@@ -293,6 +299,9 @@ export declare const PENDING_ACTION_REQUIREMENTS: {
293
299
  readonly classes: {
294
300
  readonly digest: "decision-read";
295
301
  };
302
+ readonly askReasons: {
303
+ readonly ignorable: "shown, never decided (card, listing, transcript or reported count): every read of the name renders, carries transcript or counts";
304
+ };
296
305
  readonly boundInputHash: {
297
306
  readonly digest: "decision-read";
298
307
  };
@@ -480,6 +489,9 @@ export declare const CHECKPOINT_REQUIREMENTS: {
480
489
  readonly leafId: {
481
490
  readonly digest: "decision-read";
482
491
  };
492
+ readonly heldRows: {
493
+ readonly word: "held_rows";
494
+ };
483
495
  readonly state: {
484
496
  readonly members: {
485
497
  readonly activeTools: {
@@ -591,9 +603,15 @@ export declare const CHECKPOINT_REQUIREMENTS: {
591
603
  readonly isDelegatedChild: {
592
604
  readonly digest: "decision-read";
593
605
  };
606
+ readonly rowTaskId: {
607
+ readonly word: "row_task_id";
608
+ };
594
609
  readonly placementRootSessionId: {
595
610
  readonly digest: "decision-read";
596
611
  };
612
+ readonly compositionLeg: {
613
+ readonly word: "composition_leg";
614
+ };
597
615
  readonly externalContentTarget: {
598
616
  readonly digest: "decision-read";
599
617
  };
@@ -669,8 +687,8 @@ export declare const CHECKPOINT_REQUIREMENTS: {
669
687
  readonly rev: {
670
688
  readonly mutable: "store state-machine member; integrity = CAS contract + kit, see #1580";
671
689
  };
672
- readonly sourceTaskId: {
673
- readonly digest: "decision-read";
690
+ readonly sourceSessionId: {
691
+ readonly word: "source_session";
674
692
  };
675
693
  readonly principal: {
676
694
  readonly digest: "decision-read";
@@ -817,6 +835,9 @@ export declare const CHECKPOINT_REQUIREMENTS: {
817
835
  readonly classes: {
818
836
  readonly digest: "decision-read";
819
837
  };
838
+ readonly askReasons: {
839
+ readonly ignorable: "shown, never decided (card, listing, transcript or reported count): every read of the name renders, carries transcript or counts";
840
+ };
820
841
  readonly boundInputHash: {
821
842
  readonly digest: "decision-read";
822
843
  };
@@ -38,6 +38,10 @@ export const REQUIREMENT_WORDS = Object.freeze([
38
38
  "skill_scopes",
39
39
  "run_origin",
40
40
  "tool_declaration",
41
+ "composition_leg",
42
+ "row_task_id",
43
+ "held_rows",
44
+ "source_session",
41
45
  ]);
42
46
  export function isRequirementWord(word) {
43
47
  return typeof word === "string" && REQUIREMENT_WORDS.includes(word);
@@ -94,7 +98,9 @@ export const CHECKPOINT_STATE_REQUIREMENTS = {
94
98
  gitAnnouncement: SHOWN,
95
99
  delegationProvenance: { word: "delegation_provenance" },
96
100
  isDelegatedChild: DECISION_READ,
101
+ rowTaskId: { word: "row_task_id" },
97
102
  placementRootSessionId: DECISION_READ,
103
+ compositionLeg: { word: "composition_leg" },
98
104
  externalContentTarget: DECISION_READ,
99
105
  legScope: { word: "leg_scope" },
100
106
  runOrigin: { word: "run_origin" },
@@ -123,6 +129,7 @@ export const PENDING_ACTION_REQUIREMENTS = {
123
129
  origin: DECISION_READ,
124
130
  askClass: DECISION_READ,
125
131
  classes: DECISION_READ,
132
+ askReasons: SHOWN,
126
133
  boundInputHash: DECISION_READ,
127
134
  boundGrantDigest: { word: "skill_card_binding" },
128
135
  boundGrants: SHOWN,
@@ -165,6 +172,7 @@ export const CHECKPOINT_REQUIREMENTS = {
165
172
  scope: DECISION_READ,
166
173
  sessionId: DECISION_READ,
167
174
  leafId: DECISION_READ,
175
+ heldRows: { word: "held_rows" },
168
176
  state: { members: CHECKPOINT_STATE_REQUIREMENTS },
169
177
  resourceLedger: { members: RESOURCE_LEDGER_REQUIREMENTS },
170
178
  deadline: DECISION_READ,
@@ -176,7 +184,7 @@ export const CHECKPOINT_REQUIREMENTS = {
176
184
  resolvedOutcome: STATE_MACHINE,
177
185
  reopenReason: STATE_MACHINE,
178
186
  rev: STATE_MACHINE,
179
- sourceTaskId: DECISION_READ,
187
+ sourceSessionId: { word: "source_session" },
180
188
  principal: DECISION_READ,
181
189
  durableApproval: DECISION_READ,
182
190
  executionOutcome: STATE_MACHINE,
@@ -11,7 +11,7 @@ import type { RepairBundle } from "../agents/repair-loop.js";
11
11
  import type { WorkspaceHandle } from "./remote-env.js";
12
12
  import type { SessionPermissionRules } from "./session-policy-store.js";
13
13
  import type { NestedUsageAccum, PermissionMode, ShellGateDoctrine, TaskResult } from "./types.js";
14
- import type { ActiveWorktreeSession } from "../internal/harness-types.js";
14
+ import type { ActiveWorktreeSession, AgentMessage } from "../internal/harness-types.js";
15
15
  import type { ReopenReason } from "./resume-startup-cause.js";
16
16
  import { type RetentionDeclaration } from "./retention.js";
17
17
  /**
@@ -587,7 +587,7 @@ export type ResumeOutcome = {
587
587
  * no persisted hash → the resume skips this check, binding on `boundCallId` alone; new mints enforce.)
588
588
  */
589
589
  boundInputHash: string;
590
- /** `allow` → execute the pending tool call; `deny` → inject a denial result and continue. */
590
+ /** `allow` → execute the pending tool call; `deny` → inject a denial result, then: a person's deny with no (or an empty) `reason` on a leg that is not a delegated child ends the turn awaiting the user (the run completes with `haltedOnUserRejection`) unless the resume also delivers a parked steer, which the model answers; any other deny continues. */
591
591
  decision: "allow" | "deny";
592
592
  /** A re-written arg payload (design/37 policy `allow` rewrite); re-validated on execute. */
593
593
  updatedInput?: unknown;
@@ -649,6 +649,9 @@ export type ResumeOutcome = {
649
649
  * characters, refused pre-CAS (`checkpoint.invalid_outcome`) otherwise — refused rather than dropped,
650
650
  * because a settlement that silently lost its attributed party reads as unattributed.
651
651
  *
652
+ * `decidedVia` — which machine seat answered a `"policy"` decision ({@link import("./gate-outcome.js").DECIDED_VIA}); the
653
+ * captured facts carry it to the resumed leg (refusal sentence, reminder's decider); refused pre-CAS outside the set or beside another decider.
654
+ *
652
655
  * SCOPE — the facts ride the settlement, not the persisted winner: `winnerFromOutcome` records what an
653
656
  * `env_failed` replay must reproduce exactly, and who reported a settlement is not part of that
654
657
  * authorization; a replay states its own facts.
@@ -857,6 +860,9 @@ export type PendingAction = {
857
860
  /** The PARK twin of `AskRequest.classes`: every class of the parked ask, in `ASK_CLASSES` order
858
861
  * (`classes[0] === askClass`). Present exactly when {@link askClass} is. */
859
862
  classes?: readonly import("./ask-origin.js").AskClass[];
863
+ /** The PARK twin of `AskRequest.askReasons` (the synchronous card's value, through the park's one carry): written only as a
864
+ * list of well-formed entries; a row parked before it reads ABSENT. Display metadata — no gate, CAS or resume path reads it. */
865
+ askReasons?: readonly import("./ask-origin.js").AskReason[];
860
866
  /**
861
867
  * design/80 D-1 §2 (slice 1a.2): the server-minted **opaque** boundInputHash of {@link args} — a
862
868
  * SHA-256 (hex) via {@link import("./canonical-json.js").boundInputHashOf}, computed ONCE here at
@@ -1126,8 +1132,8 @@ export interface CheckpointState {
1126
1132
  * alive in the resume leg's registry is an ORPHAN — aggregated into ONE "The container
1127
1133
  * was restarted…" reminder appended to the resume continuation (single message: header +
1128
1134
  * `- description (task id)` list + re-create instruction; never a per-task barrage). A survivor
1129
- * (session-resident shell / in-window monitor) is excluded — still reachable via TaskOutput/
1130
- * TaskStop, it needs no obituary. CC's per-orphan `Ku(task_id,"stopped")` status write (:707399)
1135
+ * (session-resident shell / in-window monitor) is excluded — its output file and TaskStop
1136
+ * still reach it, it needs no obituary. CC's per-orphan `Ku(task_id,"stopped")` status write (:707399)
1131
1137
  * is N/A here: the suspend teardown already settled them killed with receipts. Absent for a run
1132
1138
  * with no live background tasks at suspend, and for pre-1.262 checkpoints (deserialized without
1133
1139
  * the field) — both resume silently, exactly like CC with an empty list.
@@ -1343,6 +1349,9 @@ export interface CheckpointState {
1343
1349
  * delegated child (never `false` — presence-coded like the other monotonic bits here).
1344
1350
  */
1345
1351
  isDelegatedChild?: true;
1352
+ /** The registry row the suspended leg ran as (`RunInternals.rowTaskId`), stamped at every mint and restored by a resume that
1353
+ * hands no internals. Present only on a row-lane leg's park, which then requires `row_task_id` (an older engine refuses it). */
1354
+ rowTaskId?: string;
1346
1355
  /**
1347
1356
  * design/380 O1③ — the run TREE's placement fixed point at suspend: the SAME three-segment fold the
1348
1357
  * env-factory ctx mint uses (explicit `RunInternals.placementRoot` > the delegation lanes'
@@ -1365,6 +1374,18 @@ export interface CheckpointState {
1365
1374
  * resolved empty on a factory-less run (never persisted as garbage).
1366
1375
  */
1367
1376
  placementRootSessionId?: string;
1377
+ /**
1378
+ * Which composition leg parked this row and which host session it belongs to
1379
+ * ({@link import("./runner/contracts.js").CompositionLeg}): stamped at every mint from the ONE value the leg's prepare resolved
1380
+ * (the live `RunInternals.compositionLeg`, else this member restored from the row being resumed), so a re-suspend chain carries
1381
+ * it unchanged. A host links the row to its run by `hostSessionId` — the row's own {@link Checkpoint.sessionId} is the leg's
1382
+ * session, not the host's — and settles it by `entry`: a `cascade` card goes back to the cascade's resume entry, which reads
1383
+ * `leg` to know which rung it continues; a `verify` card is a verifier's own pause (resume it by its token, or void it with
1384
+ * `Runner.voidVerifierPause`). A resume that hands a CONTRADICTING live value is refused pre-CAS (`resume.composition_mismatch`); a live value
1385
+ * over a row without this member is that row's first record. Absent ⇒ the leg was not handed out by a composition entry, its
1386
+ * composition minted none (a cascade whose caller named no session), or the row was minted before the member.
1387
+ */
1388
+ compositionLeg?: import("./runner/contracts.js").CompositionLeg;
1368
1389
  /**
1369
1390
  * design/380 O9a — MONOTONIC presence bit: this run's hand-tool content fold was EXTERNAL-TARGET
1370
1391
  * armed (the env declared `capabilities.externalContentTarget`, or an earlier leg of this suspend
@@ -1775,6 +1796,12 @@ export interface CheckpointRow {
1775
1796
  sessionId: string;
1776
1797
  /** The session leaf the suspend happened at — the resume point (CAS write base, §5). */
1777
1798
  leafId: string;
1799
+ /** The conversation rows the leg had admitted but not yet stored when it parked (a note an extension added while the turn
1800
+ * ran), in the order they were admitted — what the conversation owes after {@link leafId}. Written by the park's commit
1801
+ * alone, in the same step as the row; the resumed leg writes each once, at its transcript's first legal point (after the
1802
+ * parked batch's last result, before the continuation), never through the admission seat again. Absent ⇒ none were held;
1803
+ * present ⇒ the row carries the `held_rows` requirement word. */
1804
+ heldRows?: readonly AgentMessage[];
1778
1805
  state: CheckpointState;
1779
1806
  /** design/74 R3-B: cross-slice resource accounting. Present for a `resource_limit` gate (debited at the
1780
1807
  * suspend's `put`; read on resume to size the next slice + aggregate the final stats). **design/80 D-E-core
@@ -1865,26 +1892,28 @@ export interface CheckpointRow {
1865
1892
  */
1866
1893
  rev?: number;
1867
1894
  /**
1868
- * design S1d (source-tag persistence): the issuing task's session id, stamped at the
1869
- * APPROVAL suspend mint so a supervisor inbox can attribute a paused/awaiting checkpoint to the worker that
1870
- * raised it (the durable analog of {@link import("./tool-policy.js").AskRequest}.sourceTaskId — the durable
1895
+ * design S1d (source-tag persistence): the issuing leg's session id, stamped at the APPROVAL and the
1896
+ * plan_review suspend mints so a supervisor inbox can attribute a paused/awaiting checkpoint to the worker that
1897
+ * raised it (the durable analog of {@link import("./tool-policy.js").AskRequest}.sourceSessionId — the durable
1871
1898
  * suspend path does NOT invoke `onAsk`, so the synchronous source identity is captured here instead). It is
1872
- * the SAME value the synchronous ask carries: `= sessionId` at the mint.
1899
+ * the SAME value the synchronous ask carries, read from the same one mint. It names a conversation, never a
1900
+ * task: the parked leg's agent id is {@link CheckpointSummary.agentId}, derived from the row.
1873
1901
  *
1874
1902
  * **Security invariant (carried verbatim from the 1.113.0 ask-bubbling contract):** for a Runner-created
1875
1903
  * DELEGATED subagent this is **worker-unforgeable** (a child never sets its own sessionId — the Runner mints
1876
1904
  * it); a top-level caller MAY continue its own session id via {@link import("./types.js").TaskSpec.sessionId},
1877
1905
  * so this is NOT a global "never forgeable" run id — aggregation only aggregates delegated workers, where it
1878
1906
  * holds. **ECHO-ONLY triage metadata, NEVER a gate input:** no gate / CAS / winner / resume-validation path
1879
- * reads it (a contract-test pins this). Absent ⇒ no source task id (a non-ask gate, or a legacy checkpoint).
1907
+ * reads it (a contract-test pins this). A row that carries it requires `source_session` (an older engine
1908
+ * refuses it). Absent ⇒ a non-ask gate, or a row an earlier engine parked (it named the member `sourceTaskId`).
1880
1909
  */
1881
- sourceTaskId?: string;
1910
+ sourceSessionId?: string;
1882
1911
  /**
1883
1912
  * design S1d (source-tag persistence): the issuing task's authenticated end-user {@link
1884
1913
  * import("./types.js").TaskSpec.principal} (design/62), stamped at the APPROVAL suspend mint — and, since
1885
1914
  * #449 G2, at the `resource_limit` mint too — so an aggregating inbox can attribute a paused checkpoint
1886
1915
  * per-user — the durable analog of {@link import("./tool-policy.js").AskRequest}.principal. Caller-set
1887
- * (never a tool/worker arg), and like {@link sourceTaskId} it is **NEVER a gate input**: no gate / CAS /
1916
+ * (never a tool/worker arg), and like {@link sourceSessionId} it is **NEVER a gate input**: no gate / CAS /
1888
1917
  * winner path reads it. The RESUME ENTRY however does read it as the row's identity record (#449 G2):
1889
1918
  * a resume config that omits `principal` inherits this value for the resumed leg (usage-ledger bucket,
1890
1919
  * later mints' scope derivation, ask attribution — a dropped field must not silently move the leg onto
@@ -2013,10 +2042,15 @@ export interface CheckpointSummary {
2013
2042
  spentMicroUsd?: number;
2014
2043
  /** The awaiting-human SLA / abandonment deadline ({@link Checkpoint.deadline}, epoch ms) when present. */
2015
2044
  deadline?: number;
2016
- /** design S1d (source-tag): the issuing worker's session id ({@link Checkpoint.sourceTaskId}) — projected so
2045
+ /** design S1d (source-tag): the issuing worker's session id ({@link Checkpoint.sourceSessionId}) — projected so
2017
2046
  * a supervisor inbox attributes each pending checkpoint to its worker in ONE `listByScope` call (no N+1
2018
- * `getCheckpoint`). ECHO-ONLY display/triage; absent on a non-ask gate / legacy checkpoint. */
2019
- sourceTaskId?: string;
2047
+ * `getCheckpoint`). ECHO-ONLY display/triage; absent on a non-ask gate and on a row an earlier engine parked. */
2048
+ sourceSessionId?: string;
2049
+ /** The parked leg's agent id when it is a delegated child (the parked twin of {@link import("./tool-policy.js").AskRequest}.agentId),
2050
+ * derived from the row by the live ask's predicate — nothing more is stored: its registry row ({@link CheckpointState.rowTaskId}) when
2051
+ * it ran as one, else its session id; absent on a host's row. The row does not record a task id the leg's spec declared, so a workflow
2052
+ * agent whose spec names a `taskId` summarizes as its session id while its live ask said the declared id. ECHO-ONLY display/triage. */
2053
+ agentId?: string;
2020
2054
  /** design S1d (source-tag): the issuing task's end-user principal ({@link Checkpoint.principal}) for per-user
2021
2055
  * inbox attribution. ECHO-ONLY display/triage; absent when the checkpoint carries no principal. */
2022
2056
  principal?: string;
@@ -2069,7 +2103,7 @@ export interface CheckpointSummary {
2069
2103
  * `toolInput` is the raw-data sibling for a consumer that wants the actual args.)
2070
2104
  * - **same data as the full {@link Checkpoint}** — it is a projection of `pendingAction.args`, which the
2071
2105
  * caller could already read via `get`; this adds NO new exposure, it only saves the round-trip.
2072
- * - **ECHO-ONLY, like {@link sourceTaskId}** — NO gate / CAS / resume / {@link winnerFromOutcome} path reads
2106
+ * - **ECHO-ONLY, like {@link sourceSessionId}** — NO gate / CAS / resume / {@link winnerFromOutcome} path reads
2073
2107
  * it (a contract test pins this); it is pure display/triage metadata, never a control input.
2074
2108
  */
2075
2109
  toolInput?: string;
@@ -2168,7 +2202,7 @@ export interface CheckpointSummary {
2168
2202
  * itself a TOTAL, bounded traversal (cycle-safe, per-type output forms, throwing getters to a
2169
2203
  * placeholder, depth/node/char budgets with a truncation marker — never "full `JSON.stringify` then
2170
2204
  * truncate", which does all the work and takes all the throws before the cap). ECHO-ONLY, like
2171
- * {@link sourceTaskId}: a warning to a person, never a control input — resume/gate/CAS never read it.
2205
+ * {@link sourceSessionId}: a warning to a person, never a control input — resume/gate/CAS never read it.
2172
2206
  */
2173
2207
  hasBidiControls?: true;
2174
2208
  }
@@ -2264,8 +2298,11 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
2264
2298
  * retired `null` spelling, a store that declares no execution outcome), and the skills seat and the hands band (`config.invalid_argument`;
2265
2299
  * a skill's `baseDir` by its own reader, `config.skill_base_dir_invalid`). A door not entered here (the leg's model, its rebuilt
2266
2300
  * roster, its answer face, the approval seat's value) still refuses after the claim, each for a stated reason (INTEGRATION-CORE, "A resume's two doors").
2301
+ * The re-supplied config's one read (`readCallerSpec`, the read a run takes of its spec) refuses with its own two words, last in the set:
2302
+ * a member whose read throws (`config.spec_member_unreadable`) and a key the engine does not read (`config.spec_unknown_key`); its third,
2303
+ * a retired key, is `config.spec_retired_key` (first).
2267
2304
  */
2268
- export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing"];
2305
+ export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.spec_member_unreadable", "config.spec_unknown_key"];
2269
2306
  export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODES)[number];
2270
2307
  export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
2271
2308
  /** The words of a {@link CheckpointError}'s optional `detail.field` (what each means: the `detail` member's doc). A CLOSED SET with one home, registered in
@@ -2331,6 +2368,9 @@ export declare class CheckpointError extends Error {
2331
2368
  * checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
2332
2369
  * caller's compensation path settles the token as terminally consumed. */
2333
2370
  | "checkpoint.reopen_failed"
2371
+ /** `Runner.voidVerifierPause` voided the card — the row IS expired and its env duty ran — but releasing the verifier
2372
+ * session's pin threw or did not settle within the teardown bound: the session stays pinned until it is unpinned. */
2373
+ | "checkpoint.void_unpin_failed"
2334
2374
  /** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
2335
2375
  * execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
2336
2376
  * in-tree form of this code. Never a retry condition. */
@@ -2414,6 +2454,14 @@ export declare class CheckpointError extends Error {
2414
2454
  * side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
2415
2455
  * — the honest degradation arm. */
2416
2456
  | "resume.placement_mismatch"
2457
+ /** The composition-leg twin of `resume.placement_mismatch`: the resume supplied trusted internals whose
2458
+ * `compositionLeg` differs from the {@link CheckpointState.compositionLeg} recorded at the suspend mint — the
2459
+ * composition's resume entry was handed another card's identity, and continuing would run this leg as a rung it is
2460
+ * not, file its next card under another host session, or both. Rejected PRE-CAS (the checkpoint stays `pending`);
2461
+ * re-resume with the recorded value, or omit `internals.compositionLeg` to inherit it. A row that records none skips
2462
+ * the check (the live value becomes its first record). The same code refuses `Runner.voidVerifierPause` a card whose
2463
+ * recorded leg is not a `verify` leg (another entry's, or none recorded): nothing is settled, the row stays as it was. */
2464
+ | "resume.composition_mismatch"
2417
2465
  /** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
2418
2466
  * explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
2419
2467
  * answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
@@ -2547,6 +2595,9 @@ export declare class CheckpointError extends Error {
2547
2595
  * checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
2548
2596
  * caller's compensation path settles the token as terminally consumed. */
2549
2597
  | "checkpoint.reopen_failed"
2598
+ /** `Runner.voidVerifierPause` voided the card — the row IS expired and its env duty ran — but releasing the verifier
2599
+ * session's pin threw or did not settle within the teardown bound: the session stays pinned until it is unpinned. */
2600
+ | "checkpoint.void_unpin_failed"
2550
2601
  /** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
2551
2602
  * execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
2552
2603
  * in-tree form of this code. Never a retry condition. */
@@ -2630,6 +2681,14 @@ export declare class CheckpointError extends Error {
2630
2681
  * side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
2631
2682
  * — the honest degradation arm. */
2632
2683
  | "resume.placement_mismatch"
2684
+ /** The composition-leg twin of `resume.placement_mismatch`: the resume supplied trusted internals whose
2685
+ * `compositionLeg` differs from the {@link CheckpointState.compositionLeg} recorded at the suspend mint — the
2686
+ * composition's resume entry was handed another card's identity, and continuing would run this leg as a rung it is
2687
+ * not, file its next card under another host session, or both. Rejected PRE-CAS (the checkpoint stays `pending`);
2688
+ * re-resume with the recorded value, or omit `internals.compositionLeg` to inherit it. A row that records none skips
2689
+ * the check (the live value becomes its first record). The same code refuses `Runner.voidVerifierPause` a card whose
2690
+ * recorded leg is not a `verify` leg (another entry's, or none recorded): nothing is settled, the row stays as it was. */
2691
+ | "resume.composition_mismatch"
2633
2692
  /** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
2634
2693
  * explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
2635
2694
  * answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
@@ -2973,8 +3032,8 @@ export interface CheckpointStore {
2973
3032
  * **Load-bearing contract (design/51 §2/§4):** `expire` and {@link resolve} race the **same `pending`
2974
3033
  * row**, so the store serializes them — exactly one wins. This is what makes {@link TaskStream.destroy}
2975
3034
  * a correct *fence-then-reap*: `destroy` calls `expire` FIRST to fence any concurrent `resume` (which
2976
- * goes through `resolve`); only the `expire` winner then destroys the paused env, so the same checkpoint
2977
- * is **never both reaped and resumed**. `scope` is in the WHERE for multi-tenant isolation, like
3035
+ * goes through `resolve`); the paused env is destroyed only once the row is `expired` (this call won, or a loser
3036
+ * reads it so), so the same checkpoint is **never both reaped and resumed**. `scope` is in the WHERE for multi-tenant isolation, like
2978
3037
  * `resolve`/`reap`.
2979
3038
  */
2980
3039
  expire(token: CheckpointToken, scope: string): Promise<boolean>;