@sema-agent/core 7.67.2 → 7.68.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 (505) hide show
  1. package/CHANGELOG.md +1533 -0
  2. package/README.md +18 -9
  3. package/README.zh-CN.md +16 -8
  4. package/dist/agents/agent-definition.d.ts +1 -1
  5. package/dist/agents/agent-definition.js +4 -1
  6. package/dist/agents/cascade.d.ts +2 -2
  7. package/dist/agents/cascade.js +3 -1
  8. package/dist/agents/cumulative-stats.d.ts +2 -1
  9. package/dist/agents/cumulative-stats.js +4 -1
  10. package/dist/agents/list-agents-tool.d.ts +30 -0
  11. package/dist/agents/list-agents-tool.js +45 -3
  12. package/dist/agents/peer-admission.d.ts +2 -2
  13. package/dist/agents/peer-session-drain.d.ts +2 -0
  14. package/dist/agents/peer-session-drain.js +1 -0
  15. package/dist/agents/repair-loop.js +3 -1
  16. package/dist/agents/retain-ledger.d.ts +61 -8
  17. package/dist/agents/retain-ledger.js +25 -3
  18. package/dist/agents/roster-store.d.ts +4 -2
  19. package/dist/agents/send-message-tool.d.ts +1 -1
  20. package/dist/agents/send-message-tool.js +20 -15
  21. package/dist/agents/subagent-steps.js +2 -10
  22. package/dist/agents/subagent.d.ts +3 -0
  23. package/dist/agents/subagent.js +106 -76
  24. package/dist/agents/tool-filter.d.ts +20 -11
  25. package/dist/agents/tool-filter.js +8 -4
  26. package/dist/agents/verify.d.ts +3 -1
  27. package/dist/agents/verify.js +2 -0
  28. package/dist/brain/anthropic.js +4 -4
  29. package/dist/brain/errors.d.ts +20 -0
  30. package/dist/brain/errors.js +114 -0
  31. package/dist/brain/open-responses.js +3 -1
  32. package/dist/brain/openai.js +3 -1
  33. package/dist/brain/provider-message.d.ts +5 -3
  34. package/dist/brain/provider-message.js +35 -8
  35. package/dist/brain/reasoning-request.d.ts +73 -19
  36. package/dist/brain/reasoning-request.js +164 -72
  37. package/dist/brain/reasoning-stamp.d.ts +26 -0
  38. package/dist/brain/reasoning-stamp.js +10 -0
  39. package/dist/brain/reasoning.d.ts +95 -162
  40. package/dist/brain/reasoning.js +31 -86
  41. package/dist/brain/route-adjudicator.d.ts +9 -7
  42. package/dist/brain/route-adjudicator.js +12 -10
  43. package/dist/brain/status-sink.d.ts +19 -64
  44. package/dist/brain/status-sink.js +5 -21
  45. package/dist/brain/stream-engine.d.ts +11 -2
  46. package/dist/brain/stream-engine.js +10 -0
  47. package/dist/core/a2a.d.ts +17 -5
  48. package/dist/core/a2a.js +11 -3
  49. package/dist/core/allow-entry.d.ts +35 -15
  50. package/dist/core/allow-entry.js +47 -60
  51. package/dist/core/ask-headline.d.ts +68 -0
  52. package/dist/core/ask-headline.js +23 -0
  53. package/dist/core/ask-origin.d.ts +36 -8
  54. package/dist/core/ask-origin.js +17 -10
  55. package/dist/core/ask-question.d.ts +34 -7
  56. package/dist/core/ask-question.js +10 -1
  57. package/dist/core/ask-unresolvable-notice.d.ts +7 -0
  58. package/dist/core/ask-unresolvable-notice.js +9 -3
  59. package/dist/core/auto-strip.d.ts +53 -0
  60. package/dist/core/auto-strip.js +76 -0
  61. package/dist/core/background-agent-store.d.ts +45 -5
  62. package/dist/core/background-agent-store.js +69 -15
  63. package/dist/core/background-shell.d.ts +2 -2
  64. package/dist/core/caller-text.js +2 -2
  65. package/dist/core/canonical-json.d.ts +13 -0
  66. package/dist/core/canonical-json.js +7 -0
  67. package/dist/core/checkpoint-features.d.ts +66 -20
  68. package/dist/core/checkpoint-features.js +12 -1
  69. package/dist/core/checkpoint-generation.d.ts +1 -1
  70. package/dist/core/checkpoint-queries.d.ts +1 -1
  71. package/dist/core/checkpoint-queries.js +4 -1
  72. package/dist/core/checkpoint-requirements.d.ts +25 -1
  73. package/dist/core/checkpoint-requirements.js +5 -1
  74. package/dist/core/checkpoint-row-verdict.d.ts +1 -0
  75. package/dist/core/checkpoint-row-verdict.js +4 -0
  76. package/dist/core/checkpoint-store.d.ts +66 -38
  77. package/dist/core/checkpoint-store.js +15 -6
  78. package/dist/core/child-clamp-seats.d.ts +6 -0
  79. package/dist/core/child-clamp-seats.js +1 -0
  80. package/dist/core/config-refusal-codes.d.ts +1 -1
  81. package/dist/core/config-refusal-codes.js +1 -0
  82. package/dist/core/delegation-frames.d.ts +9 -12
  83. package/dist/core/delegation-frames.js +9 -8
  84. package/dist/core/engine-capabilities.d.ts +21 -8
  85. package/dist/core/engine-capabilities.js +1 -1
  86. package/dist/core/engine-notice.d.ts +147 -34
  87. package/dist/core/engine-notice.js +27 -16
  88. package/dist/core/engine-storage-backend.d.ts +2 -1
  89. package/dist/core/env-budget.js +3 -3
  90. package/dist/core/env-knob-announce.d.ts +10 -10
  91. package/dist/core/env-knob-announce.js +3 -6
  92. package/dist/core/file-history-store.d.ts +29 -4
  93. package/dist/core/file-history-store.js +13 -0
  94. package/dist/core/frame-settlement.d.ts +2 -1
  95. package/dist/core/gate-fold.js +1 -1
  96. package/dist/core/gate-lanes.js +56 -49
  97. package/dist/core/governance-codes.d.ts +39 -3
  98. package/dist/core/governance-codes.js +61 -3
  99. package/dist/core/hooks.d.ts +29 -11
  100. package/dist/core/hooks.js +5 -2
  101. package/dist/core/human-input-projection.js +3 -3
  102. package/dist/core/input-author.d.ts +17 -3
  103. package/dist/core/input-author.js +15 -3
  104. package/dist/core/leg-identity.d.ts +10 -28
  105. package/dist/core/leg-identity.js +1 -21
  106. package/dist/core/lsp.d.ts +18 -13
  107. package/dist/core/lsp.js +30 -22
  108. package/dist/core/mailbox-store.d.ts +1 -1
  109. package/dist/core/mailbox-store.js +4 -4
  110. package/dist/core/mcp-connection-pool.d.ts +93 -4
  111. package/dist/core/mcp-connection-pool.js +104 -1
  112. package/dist/core/mcp-failure.d.ts +38 -12
  113. package/dist/core/mcp-failure.js +9 -13
  114. package/dist/core/mcp-probe.d.ts +4 -3
  115. package/dist/core/mcp-server-link.d.ts +4 -2
  116. package/dist/core/mcp-server-link.js +4 -5
  117. package/dist/core/mcp-server-spec.d.ts +3 -3
  118. package/dist/core/mcp-server-unavailable-notice.d.ts +22 -8
  119. package/dist/core/mcp-server-unavailable-notice.js +18 -4
  120. package/dist/core/mcp.d.ts +40 -6
  121. package/dist/core/mcp.js +39 -13
  122. package/dist/core/memory-engine/content-origin.js +2 -2
  123. package/dist/core/memory-engine/control-objects.d.ts +2 -4
  124. package/dist/core/memory-engine/control-objects.js +2 -10
  125. package/dist/core/memory-engine/delegation-settlement.js +6 -1
  126. package/dist/core/memory-engine/dual-root.js +3 -0
  127. package/dist/core/memory-engine/engine.d.ts +6 -4
  128. package/dist/core/memory-engine/engine.js +32 -29
  129. package/dist/core/memory-engine/file-backend.d.ts +20 -5
  130. package/dist/core/memory-engine/file-backend.js +21 -31
  131. package/dist/core/memory-engine/frontmatter.d.ts +2 -0
  132. package/dist/core/memory-engine/frontmatter.js +4 -0
  133. package/dist/core/memory-engine/layout.d.ts +114 -20
  134. package/dist/core/memory-engine/layout.js +340 -22
  135. package/dist/core/memory-engine/memory-deployment.d.ts +7 -5
  136. package/dist/core/memory-engine/mount-failed-notice.d.ts +19 -7
  137. package/dist/core/memory-engine/mount-failed-notice.js +43 -10
  138. package/dist/core/memory-engine/sync-client.js +4 -5
  139. package/dist/core/model-fallbacks.d.ts +5 -1
  140. package/dist/core/model-fallbacks.js +3 -3
  141. package/dist/core/model-receipt.d.ts +2 -1
  142. package/dist/core/model-receipt.js +12 -1
  143. package/dist/core/mods/kernel/dispatch.d.ts +2 -2
  144. package/dist/core/mods/kernel/dispatch.js +14 -6
  145. package/dist/core/mods/kernel/events.d.ts +8 -5
  146. package/dist/core/mods/kernel/events.js +2 -2
  147. package/dist/core/mods/kernel/index.d.ts +1 -1
  148. package/dist/core/mods/kernel/registration.d.ts +9 -0
  149. package/dist/core/mods/package.js +1 -1
  150. package/dist/core/mods/session-append.d.ts +4 -2
  151. package/dist/core/mods/session-append.js +3 -0
  152. package/dist/core/mods/stations.d.ts +7 -11
  153. package/dist/core/mods/stations.js +4 -7
  154. package/dist/core/mods/tool-call.d.ts +10 -8
  155. package/dist/core/mods/tool-call.js +15 -18
  156. package/dist/core/mounted-mcp.d.ts +0 -4
  157. package/dist/core/mounted-mcp.js +1 -1
  158. package/dist/core/park-noun.d.ts +24 -0
  159. package/dist/core/park-noun.js +21 -0
  160. package/dist/core/park-resumability.d.ts +60 -0
  161. package/dist/core/park-resumability.js +30 -0
  162. package/dist/core/permission-rule-provider.d.ts +24 -2
  163. package/dist/core/permission-rule-provider.js +11 -8
  164. package/dist/core/permission-rule-store.d.ts +8 -1
  165. package/dist/core/permission-rule-store.js +2 -3
  166. package/dist/core/permission-rules.d.ts +2 -1
  167. package/dist/core/permission-rules.js +8 -4
  168. package/dist/core/persisted-rule-arms.d.ts +3 -0
  169. package/dist/core/persisted-rule-arms.js +2 -1
  170. package/dist/core/present-plan-tool.d.ts +47 -3
  171. package/dist/core/present-plan-tool.js +62 -4
  172. package/dist/core/principal-name.d.ts +1 -1
  173. package/dist/core/principal-name.js +5 -5
  174. package/dist/core/process-identity.js +10 -5
  175. package/dist/core/protocol-http-auth.d.ts +30 -9
  176. package/dist/core/protocol-http-auth.js +113 -59
  177. package/dist/core/read-only-shell.js +9 -5
  178. package/dist/core/redaction-marks.d.ts +4 -26
  179. package/dist/core/redaction-marks.js +9 -21
  180. package/dist/core/remote-env.d.ts +43 -16
  181. package/dist/core/remote-env.js +1 -1
  182. package/dist/core/request-copy-projection.d.ts +1 -1
  183. package/dist/core/request-copy-projection.js +40 -50
  184. package/dist/core/resume-config-judge.js +1 -1
  185. package/dist/core/resume-startup-cause.d.ts +35 -18
  186. package/dist/core/resume-startup-cause.js +13 -10
  187. package/dist/core/retention.d.ts +167 -25
  188. package/dist/core/retention.js +100 -20
  189. package/dist/core/roles.d.ts +6 -0
  190. package/dist/core/roles.js +11 -5
  191. package/dist/core/rule-lane-reads.d.ts +3 -0
  192. package/dist/core/rule-lane-reads.js +5 -1
  193. package/dist/core/rule-store-fault.d.ts +70 -0
  194. package/dist/core/rule-store-fault.js +102 -0
  195. package/dist/core/runner/advertised-writable-dirs.js +16 -31
  196. package/dist/core/runner/announce-once-ledger.d.ts +19 -2
  197. package/dist/core/runner/announce-once-ledger.js +24 -2
  198. package/dist/core/runner/assemble-result.d.ts +6 -0
  199. package/dist/core/runner/assemble-result.js +1 -1
  200. package/dist/core/runner/auto-strip-notice.d.ts +36 -0
  201. package/dist/core/runner/auto-strip-notice.js +59 -0
  202. package/dist/core/runner/branch-window.d.ts +3 -0
  203. package/dist/core/runner/branch-window.js +37 -0
  204. package/dist/core/runner/caller-roster.d.ts +8 -3
  205. package/dist/core/runner/capability-withheld-seat.js +3 -9
  206. package/dist/core/runner/clock-and-limits.d.ts +22 -1
  207. package/dist/core/runner/clock-and-limits.js +30 -0
  208. package/dist/core/runner/contracts.d.ts +58 -35
  209. package/dist/core/runner/credential-refusal-seat.d.ts +2 -0
  210. package/dist/core/runner/credential-refusal-seat.js +47 -0
  211. package/dist/core/runner/cross-boundary-lane.js +6 -4
  212. package/dist/core/runner/decide-continuation.js +1 -1
  213. package/dist/core/runner/file-history-restore.d.ts +53 -2
  214. package/dist/core/runner/file-history-restore.js +29 -10
  215. package/dist/core/runner/forward-sink.d.ts +14 -1
  216. package/dist/core/runner/forward-sink.js +14 -12
  217. package/dist/core/runner/gate-exit.d.ts +8 -7
  218. package/dist/core/runner/gate-exit.js +13 -13
  219. package/dist/core/runner/git-status-frame.js +2 -4
  220. package/dist/core/runner/initial-run-state.js +1 -1
  221. package/dist/core/runner/main-call-account.d.ts +3 -1
  222. package/dist/core/runner/main-call-account.js +5 -3
  223. package/dist/core/runner/mcp-redial.d.ts +2 -5
  224. package/dist/core/runner/mcp-redial.js +2 -2
  225. package/dist/core/runner/nested-memory-content.d.ts +7 -1
  226. package/dist/core/runner/nested-memory-content.js +73 -13
  227. package/dist/core/runner/nested-memory-lane.d.ts +44 -19
  228. package/dist/core/runner/nested-memory-lane.js +152 -76
  229. package/dist/core/runner/park-commit.js +3 -1
  230. package/dist/core/runner/permission-rule-lanes.d.ts +8 -2
  231. package/dist/core/runner/permission-rule-lanes.js +29 -3
  232. package/dist/core/runner/person-path-rows.d.ts +3 -11
  233. package/dist/core/runner/person-path-rows.js +21 -24
  234. package/dist/core/runner/prepare-acquire-reconcile.js +3 -1
  235. package/dist/core/runner/prepare-artifact.d.ts +1 -1
  236. package/dist/core/runner/prepare-artifact.js +20 -14
  237. package/dist/core/runner/prepare-ask-lane.d.ts +9 -6
  238. package/dist/core/runner/prepare-ask-lane.js +6 -5
  239. package/dist/core/runner/prepare-boundary-parks.d.ts +7 -1
  240. package/dist/core/runner/prepare-boundary-parks.js +27 -24
  241. package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -2
  242. package/dist/core/runner/prepare-caps-and-workflow.js +4 -3
  243. package/dist/core/runner/prepare-config-doors.d.ts +9 -24
  244. package/dist/core/runner/prepare-config-doors.js +58 -41
  245. package/dist/core/runner/prepare-context-lane.d.ts +2 -2
  246. package/dist/core/runner/prepare-context-lane.js +3 -5
  247. package/dist/core/runner/prepare-defer-classify.d.ts +1 -1
  248. package/dist/core/runner/prepare-defer-classify.js +1 -1
  249. package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
  250. package/dist/core/runner/prepare-delegation-surface.js +3 -2
  251. package/dist/core/runner/prepare-file-history.d.ts +62 -26
  252. package/dist/core/runner/prepare-file-history.js +117 -46
  253. package/dist/core/runner/prepare-gate-stations.d.ts +4 -0
  254. package/dist/core/runner/prepare-gate-stations.js +6 -5
  255. package/dist/core/runner/prepare-hands-readface.d.ts +9 -4
  256. package/dist/core/runner/prepare-hands-readface.js +8 -4
  257. package/dist/core/runner/prepare-inherited-gate.d.ts +11 -4
  258. package/dist/core/runner/prepare-inherited-gate.js +6 -6
  259. package/dist/core/runner/prepare-listings.d.ts +1 -1
  260. package/dist/core/runner/prepare-listings.js +1 -1
  261. package/dist/core/runner/prepare-memory.js +2 -2
  262. package/dist/core/runner/prepare-offload-wrappers.d.ts +1 -1
  263. package/dist/core/runner/prepare-offload-wrappers.js +1 -1
  264. package/dist/core/runner/prepare-park-ask.d.ts +10 -3
  265. package/dist/core/runner/prepare-park-ask.js +7 -9
  266. package/dist/core/runner/prepare-policy-chain.d.ts +18 -9
  267. package/dist/core/runner/prepare-policy-chain.js +18 -13
  268. package/dist/core/runner/prepare-project-context.d.ts +1 -1
  269. package/dist/core/runner/prepare-project-context.js +5 -3
  270. package/dist/core/runner/prepare-prompt-assembly.js +2 -1
  271. package/dist/core/runner/prepare-prompt-inputs.d.ts +2 -2
  272. package/dist/core/runner/prepare-prompt-inputs.js +1 -1
  273. package/dist/core/runner/prepare-protocol-tools.d.ts +4 -5
  274. package/dist/core/runner/prepare-protocol-tools.js +7 -7
  275. package/dist/core/runner/prepare-question-face.d.ts +4 -2
  276. package/dist/core/runner/prepare-run-refs.d.ts +7 -2
  277. package/dist/core/runner/prepare-run-refs.js +8 -7
  278. package/dist/core/runner/prepare-safety-scan.d.ts +4 -3
  279. package/dist/core/runner/prepare-suspend-saga.d.ts +3 -7
  280. package/dist/core/runner/prepare-suspend-saga.js +4 -3
  281. package/dist/core/runner/prepare-task.js +66 -53
  282. package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +3 -2
  283. package/dist/core/runner/prepare-tool-disclosure-mount.js +2 -1
  284. package/dist/core/runner/prepare-turn-wiring.d.ts +3 -1
  285. package/dist/core/runner/prepare-turn-wiring.js +1 -1
  286. package/dist/core/runner/prepare-wiring-manifest.d.ts +9 -4
  287. package/dist/core/runner/prepare-wiring-manifest.js +14 -6
  288. package/dist/core/runner/prepare-workspace-restore.d.ts +4 -4
  289. package/dist/core/runner/prepare-workspace-restore.js +15 -6
  290. package/dist/core/runner/remote-env-retry.d.ts +3 -3
  291. package/dist/core/runner/restore-seat.d.ts +41 -0
  292. package/dist/core/runner/restore-seat.js +38 -0
  293. package/dist/core/runner/resume-admission.js +1 -1
  294. package/dist/core/runner/resume-apply.js +4 -3
  295. package/dist/core/runner/resume-checkpoint-screen.js +2 -1
  296. package/dist/core/runner/resume-internals-and-config.js +2 -1
  297. package/dist/core/runner/resume-preflight.js +2 -1
  298. package/dist/core/runner/rewind-files.js +22 -6
  299. package/dist/core/runner/rule-store-unreadable-notice.d.ts +8 -0
  300. package/dist/core/runner/rule-store-unreadable-notice.js +11 -0
  301. package/dist/core/runner/run-brain-sinks.d.ts +3 -6
  302. package/dist/core/runner/run-brain-sinks.js +6 -6
  303. package/dist/core/runner/run-compaction-machinery.d.ts +2 -2
  304. package/dist/core/runner/run-git-lane.d.ts +2 -0
  305. package/dist/core/runner/run-git-lane.js +2 -1
  306. package/dist/core/runner/run-harness-handlers.js +5 -4
  307. package/dist/core/runner/run-identity-wiring.js +20 -12
  308. package/dist/core/runner/run-leg.js +31 -72
  309. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  310. package/dist/core/runner/run-notification-lane.js +2 -4
  311. package/dist/core/runner/run-reasoning-seat.d.ts +5 -6
  312. package/dist/core/runner/run-reasoning-seat.js +13 -18
  313. package/dist/core/runner/run-settle-and-teardown.js +13 -9
  314. package/dist/core/runner/run-terminal-adoption.js +4 -8
  315. package/dist/core/runner/run-turn-boundary.js +6 -3
  316. package/dist/core/runner/runtask.d.ts +9 -4
  317. package/dist/core/runner/runtask.js +29 -22
  318. package/dist/core/runner/session-rule-policy.d.ts +11 -1
  319. package/dist/core/runner/shell-env-withheld.js +2 -7
  320. package/dist/core/runner/side-call-account.d.ts +5 -6
  321. package/dist/core/runner/side-call-account.js +2 -2
  322. package/dist/core/runner/stream-lifecycle-verbs.d.ts +3 -0
  323. package/dist/core/runner/stream-lifecycle-verbs.js +5 -3
  324. package/dist/core/runner/stream-settle-backstop.js +4 -6
  325. package/dist/core/runner/stream-steer-verb.d.ts +1 -1
  326. package/dist/core/runner/stream-steer-verb.js +4 -4
  327. package/dist/core/runner/sub-agent-deny-lists.d.ts +8 -3
  328. package/dist/core/runner/sub-agent-deny-lists.js +7 -4
  329. package/dist/core/runner/teardown-bounded.d.ts +7 -0
  330. package/dist/core/runner/teardown-bounded.js +7 -0
  331. package/dist/core/runner/terminal-account.js +41 -13
  332. package/dist/core/runner/terminal-projection.d.ts +1 -5
  333. package/dist/core/runner/tool-end-body.d.ts +9 -3
  334. package/dist/core/runner/tool-end-body.js +6 -3
  335. package/dist/core/runner/tool-output-projection.d.ts +13 -4
  336. package/dist/core/runner/tool-output-projection.js +10 -14
  337. package/dist/core/runner/turn-attachments.d.ts +3 -2
  338. package/dist/core/runner/turn-attachments.js +12 -5
  339. package/dist/core/runner-deps.d.ts +6 -6
  340. package/dist/core/runtime-caps.d.ts +2 -1
  341. package/dist/core/secret-env.d.ts +20 -3
  342. package/dist/core/secret-env.js +13 -15
  343. package/dist/core/session-checkout.d.ts +115 -15
  344. package/dist/core/session-checkout.js +435 -136
  345. package/dist/core/session-policy-store.js +21 -3
  346. package/dist/core/session-reconcile.js +1 -0
  347. package/dist/core/session-store.js +2 -0
  348. package/dist/core/session.d.ts +11 -1
  349. package/dist/core/shell-run-candidates.d.ts +1 -0
  350. package/dist/core/shell-run-candidates.js +1 -1
  351. package/dist/core/shutdown-debug.d.ts +6 -5
  352. package/dist/core/shutdown-debug.js +5 -1
  353. package/dist/core/skill-grant.js +4 -1
  354. package/dist/core/skills-directory.js +5 -3
  355. package/dist/core/spec-contract.d.ts +1 -1
  356. package/dist/core/store-contracts/checkpoint-store-contract.js +2 -7
  357. package/dist/core/store-contracts/file-history-store-contract.js +26 -2
  358. package/dist/core/store-contracts/session-deletion-cascade-contract.js +130 -14
  359. package/dist/core/store-contracts/task-list-store-contract.d.ts +2 -1
  360. package/dist/core/store-contracts/task-list-store-contract.js +28 -1
  361. package/dist/core/task-event.d.ts +48 -27
  362. package/dist/core/task-notification.d.ts +15 -9
  363. package/dist/core/task-notification.js +12 -0
  364. package/dist/core/task-registry-agent.d.ts +24 -22
  365. package/dist/core/task-registry-agent.js +65 -46
  366. package/dist/core/task-registry-shared.d.ts +17 -5
  367. package/dist/core/task-registry.d.ts +17 -6
  368. package/dist/core/task-registry.js +6 -1
  369. package/dist/core/task-result.d.ts +71 -25
  370. package/dist/core/task-spec-members.d.ts +0 -1
  371. package/dist/core/task-spec-members.js +1 -1
  372. package/dist/core/task-spec.d.ts +60 -52
  373. package/dist/core/task-stream.d.ts +45 -12
  374. package/dist/core/terminal-cause.d.ts +45 -8
  375. package/dist/core/terminal-cause.js +5 -0
  376. package/dist/core/tool-card-bound.d.ts +32 -0
  377. package/dist/core/tool-card-bound.js +33 -0
  378. package/dist/core/tool-catalog-entries.d.ts +9 -0
  379. package/dist/core/tool-catalog-entries.js +48 -0
  380. package/dist/core/tool-errors.d.ts +4 -3
  381. package/dist/core/tool-face.d.ts +3 -3
  382. package/dist/core/tool-mount-facts.d.ts +3 -2
  383. package/dist/core/tool-mount-facts.js +1 -1
  384. package/dist/core/tool-mount-static.js +7 -5
  385. package/dist/core/tool-policy.d.ts +21 -19
  386. package/dist/core/tool-policy.js +5 -6
  387. package/dist/core/tool-registry.d.ts +3 -1
  388. package/dist/core/tool-registry.js +15 -1
  389. package/dist/core/tool-result-store.d.ts +9 -3
  390. package/dist/core/tool-result-store.js +14 -1
  391. package/dist/core/tool-roster.d.ts +6 -0
  392. package/dist/core/tool-roster.js +18 -0
  393. package/dist/core/tool-spec.d.ts +17 -8
  394. package/dist/core/trace.d.ts +35 -31
  395. package/dist/core/types.d.ts +2 -2
  396. package/dist/core/untrusted-egress.d.ts +19 -7
  397. package/dist/core/untrusted-egress.js +26 -7
  398. package/dist/core/untrusted-text.d.ts +6 -18
  399. package/dist/core/untrusted-text.js +11 -4
  400. package/dist/core/user-attachment.d.ts +9 -6
  401. package/dist/core/user-attachment.js +12 -10
  402. package/dist/core/user-row-origin.d.ts +44 -25
  403. package/dist/core/user-row-origin.js +30 -20
  404. package/dist/core/wiring-manifest.d.ts +26 -7
  405. package/dist/core/wiring-manifest.js +14 -11
  406. package/dist/core/workspace-snapshot.d.ts +3 -1
  407. package/dist/core/workspace-snapshot.js +1 -0
  408. package/dist/engine/execution-env/node-execution-env.d.ts +23 -16
  409. package/dist/engine/execution-env/node-execution-env.js +127 -67
  410. package/dist/engine/harness/agent-harness.d.ts +4 -5
  411. package/dist/engine/harness/agent-harness.js +2 -7
  412. package/dist/engine/harness/types.d.ts +51 -19
  413. package/dist/engine/harness/types.js +28 -1
  414. package/dist/engine/llm/types.d.ts +26 -14
  415. package/dist/engine/llm/types.js +2 -2
  416. package/dist/engine/loop/agent-loop.d.ts +2 -2
  417. package/dist/engine/loop/agent-loop.js +51 -275
  418. package/dist/engine/loop/types.d.ts +0 -18
  419. package/dist/engine/session/import-validate.d.ts +3 -0
  420. package/dist/engine/session/import-validate.js +34 -2
  421. package/dist/engine/session/repo-utils.d.ts +42 -4
  422. package/dist/engine/session/repo-utils.js +33 -5
  423. package/dist/engine/session/session.d.ts +41 -14
  424. package/dist/engine/session/session.js +96 -25
  425. package/dist/index.d.ts +21 -16
  426. package/dist/index.js +16 -10
  427. package/dist/orchestration/run-spec.d.ts +1 -1
  428. package/dist/orchestration/run-workflow-tool.d.ts +12 -9
  429. package/dist/orchestration/run-workflow-tool.js +15 -19
  430. package/dist/orchestration/workflow-governance.js +13 -21
  431. package/dist/orchestration/workflow-observe.d.ts +4 -3
  432. package/dist/orchestration/workflow-primitives.d.ts +1 -1
  433. package/dist/orchestration/workflow-record-artifact.d.ts +14 -0
  434. package/dist/orchestration/workflow-record-artifact.js +32 -0
  435. package/dist/orchestration/workflow-script-store.d.ts +9 -0
  436. package/dist/orchestration/workflow-script-store.js +20 -1
  437. package/dist/orchestration/workflow-types.d.ts +33 -3
  438. package/dist/orchestration/workflow.d.ts +24 -14
  439. package/dist/orchestration/workflow.js +52 -23
  440. package/dist/prompt-assembly/artifact.js +4 -8
  441. package/dist/prompt-assembly/catalog/engine.d.ts +263 -0
  442. package/dist/prompt-assembly/catalog/engine.js +30 -0
  443. package/dist/prompt-assembly/catalog/index.d.ts +1 -1
  444. package/dist/prompt-assembly/catalog/index.js +2 -2
  445. package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.d.ts +1 -1
  446. package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +29 -0
  447. package/dist/prompt-assembly/epoch.js +6 -8
  448. package/dist/prompt-assembly/turn-snapshot.js +8 -9
  449. package/dist/stores/file/background-agent-store.js +5 -6
  450. package/dist/stores/file/checkpoint-store.d.ts +0 -4
  451. package/dist/stores/file/checkpoint-store.js +7 -3
  452. package/dist/stores/file/file-history-store.d.ts +8 -0
  453. package/dist/stores/file/file-history-store.js +72 -0
  454. package/dist/stores/file/fs-atomic.js +17 -12
  455. package/dist/stores/file/index.js +11 -5
  456. package/dist/stores/file/mailbox-store.js +13 -4
  457. package/dist/stores/file/permission-rule-store.js +14 -13
  458. package/dist/stores/file/shared-ledger.d.ts +4 -0
  459. package/dist/stores/file/shared-ledger.js +4 -0
  460. package/dist/stores/file/task-list-store.js +12 -3
  461. package/dist/stores/file/workflow-run-store.js +1 -0
  462. package/dist/tools/fs/bash-program-position.d.ts +4 -2
  463. package/dist/tools/fs/bash-program-position.js +1 -1
  464. package/dist/tools/fs/bash-readonly-classifier.js +1 -1
  465. package/dist/tools/fs/bound-open.d.ts +97 -0
  466. package/dist/tools/fs/bound-open.js +103 -0
  467. package/dist/tools/fs/containment-face.d.ts +2 -2
  468. package/dist/tools/fs/fs-pdf.d.ts +7 -1
  469. package/dist/tools/fs/fs-pdf.js +31 -23
  470. package/dist/tools/fs/fs-read.d.ts +24 -17
  471. package/dist/tools/fs/fs-read.js +84 -53
  472. package/dist/tools/fs/fs-shared.d.ts +14 -12
  473. package/dist/tools/fs/fs-shared.js +5 -4
  474. package/dist/tools/fs/fs-write.d.ts +2 -2
  475. package/dist/tools/fs/fs-write.js +20 -12
  476. package/dist/tools/fs/index.d.ts +4 -4
  477. package/dist/tools/fs/index.js +2 -2
  478. package/dist/tools/fs/notebook.d.ts +1 -1
  479. package/dist/tools/fs/pdf.d.ts +12 -3
  480. package/dist/tools/fs/pdf.js +22 -9
  481. package/dist/tools/fs/read-deny-home.d.ts +3 -2
  482. package/dist/tools/fs/read-deny-home.js +8 -11
  483. package/dist/tools/fs/safety.d.ts +3 -2
  484. package/dist/tools/fs/shell-read-check.js +10 -9
  485. package/dist/tools/monitor.d.ts +6 -5
  486. package/dist/tools/task-list.d.ts +16 -6
  487. package/dist/tools/task-list.js +4 -0
  488. package/dist/tools/web.d.ts +9 -1
  489. package/dist/tools/web.js +8 -3
  490. package/dist/tools/worktree.d.ts +7 -5
  491. package/dist/tools/worktree.js +4 -3
  492. package/package.json +4 -3
  493. package/test/export-surface.snapshot.json +93 -7
  494. package/wire-changes/core-stores-sql@7.67.3.json +39 -0
  495. package/wire-changes/core-stores-sql@7.68.0.json +39 -0
  496. package/wire-changes/core@7.67.3.json +65 -0
  497. package/wire-changes/core@7.68.0.json +4257 -0
  498. package/wire-changes/mods-kernel@7.67.3.json +39 -0
  499. package/wire-changes/mods-kernel@7.68.0.json +129 -0
  500. package/wire-changes/primitives@7.67.3.json +39 -0
  501. package/wire-changes/primitives@7.68.0.json +253 -0
  502. package/wire-changes/wiki-gate@7.67.3.json +39 -0
  503. package/wire-changes/wiki-gate@7.68.0.json +39 -0
  504. package/dist/core/runner/credential-origin-seat.d.ts +0 -2
  505. package/dist/core/runner/credential-origin-seat.js +0 -20
@@ -1,4 +1,5 @@
1
1
  import { CheckpointError, type CheckpointConfigRefusalCode, type CheckpointErrorField, type CheckpointErrorReason } from "./checkpoint-features.js";
2
+ import { type CallRiskAxes } from "./ask-origin.js";
2
3
  import type { GateOutcome, HostDecisionFacts } from "./gate-outcome.js";
3
4
  import { type ExecutionOutcomeRecordWord } from "./checkpoint-execution-record.js";
4
5
  import { type HolderJudge } from "./checkpoint-generation.js";
@@ -138,6 +139,7 @@ export interface RiskDescriptor {
138
139
  irreversible?: boolean;
139
140
  shell?: boolean;
140
141
  };
142
+ /** What the call IS ({@link CallRiskAxes}: the live card's `AskRequest.riskAxes`, same type, same projection, read when the call parked) — not {@link axes}, which axes TRIPPED the gate. Absent when neither was judged and on rows parked before it existed. */ riskAxes?: CallRiskAxes;
141
143
  /** The tool whose call is gated (mirrors the gate's `toolName`). */
142
144
  toolName: string;
143
145
  /** The operator's shell floor (`"always"`), present ONLY when this ask was minted through the engine's shell
@@ -378,7 +380,7 @@ export interface PendingSteerInput {
378
380
  }
379
381
  /**
380
382
  * design/80 §D-E: build the DETERMINISTIC, REDACTED {@link RiskDescriptor} for an escalation checkpoint at
381
- * MINT. Pure — a function ONLY of (`toolName`, `args`, the D-2 `safety` axis, the `shellGated` flag); it reads
383
+ * MINT. Pure — a function ONLY of (`toolName`, `args`, the D-2 `safety` axis, the `shellGated` flag, the mint's `riskAxes`); it reads
382
384
  * NO clock/random, so the SAME call ⇒ an IDENTICAL descriptor (pinned by a test).
383
385
  *
384
386
  * **Determinism contract = plain-DATA args** (the real flow: model-JSON / hook-rewritten plain objects). A
@@ -427,6 +429,7 @@ export declare function buildRiskDescriptor(input: {
427
429
  * the same reason the prose sibling is re-neutralized — this function is exported, so a caller
428
430
  * reaching it directly must not be able to persist a shape the gate would have rejected. */
429
431
  probeCause?: unknown;
432
+ /** The call's risk-axes judgment in the live card's type, read by the park's mint when it parked: copied (a member only when boolean), never judged here. */ riskAxes?: CallRiskAxes;
430
433
  }): RiskDescriptor;
431
434
  /**
432
435
  * The durable record of an ask's `requiresRealApproval` bit, which used
@@ -883,6 +886,11 @@ export type PendingAction = {
883
886
  * characters neutralized and past 16KiB replaced by an account naming the size; a row parked before it reads ABSENT.
884
887
  * **UNTRUSTED, ADVISORY** display metadata — no gate, CAS or resume path reads it. */
885
888
  cardMessage?: string;
889
+ /** The PARK twin of `AskRequest.headline`, under the same name: the card's first line for a person, minted at the park off
890
+ * the class word this row keeps ({@link askClass}), in the parking run's language (a resume does not re-mint it). For people
891
+ * to read, never a branch input; ABSENT on a row with no class word, on the agent's own question and on a row parked before
892
+ * it (show {@link cardMessage}). No gate, CAS or resume path reads it. */
893
+ headline?: string;
886
894
  /** The PARK twin of `AskRequest.matchedAskRule` (off the same disclosure mint as {@link cardMessage}): the written ask rule
887
895
  * this row's card stands for, as written; present only when the decision stamped a non-empty string. **UNTRUSTED**
888
896
  * display metadata — no gate, CAS or resume path reads it. The card and the row spell the two values differently on
@@ -1007,10 +1015,20 @@ export type PendingAction = {
1007
1015
  * still gates no call, `toolCallId` stays absent on this arm, and nothing on the resume path reads the id. Written
1008
1016
  * once, at the park mint, from the engine-bound call id (a tool cannot name another call's id); the paused
1009
1017
  * cause and the inbox summary echo it. ABSENT for a pause whose requester carried no call id (a revive context,
1010
- * a row a deployment minted itself, a row from an engine before this member). */
1018
+ * a row a deployment minted itself, a row from an engine before this member).
1019
+ *
1020
+ * `planContentHash` answers one question: is the text a reader holds the text SHOWN to the person at this pause? It is
1021
+ * the `textContentHashOf` value of the `plan` string on the `exit-plan-mode` card the requesting call's `tool_end`
1022
+ * CARRIED (`structured.plan` — not the fenced model text, not the plan file's bytes, not the arguments): a reader
1023
+ * digests the string it received, before any display normalization, and compares. It says what was shown, whoever
1024
+ * asked (a caller tool returning that card carries one too); written once at the park mint, never rewritten; not the
1025
+ * gate's identity (equal text, equal values, different `checkpointId`s) and never read by a resume. ABSENT when that
1026
+ * frame carried no plan card (an error, a withheld result, a card left off for size), on a deployment-minted row and on
1027
+ * an earlier engine's row: "nothing to compare", never "an empty plan". Unsalted: never in a trace, a metric or a log. */
1011
1028
  | {
1012
1029
  kind: "plan_review";
1013
1030
  requestedByCallId?: string;
1031
+ planContentHash?: string;
1014
1032
  }
1015
1033
  /** design/144 §3 (X2) — the NON-GATE arm: nothing pends a decision. The shape of a deployment-minted
1016
1034
  * PARK checkpoint (approval-timeout park / pure suspend; paired with `gate.kind === "task_done"`, the
@@ -1363,12 +1381,11 @@ export interface CheckpointState {
1363
1381
  * delegation-lifecycle observer's emission gate stayed shut and the resumed leg emitted NEITHER
1364
1382
  * frame — a deployment watching only that seat saw a human-approved delegation frozen at its
1365
1383
  * park-leg `"suspended"` terminal forever. Live internals still win when re-supplied (the in-engine
1366
- * resume lanes all do); the checkpoint key is the fallback for the deps-only leg. Only this ONE
1367
- * axis persists — `insideFork`/`agentName`/`parentToolCallId` stay internals-only, honestly absent
1368
- * on a deps-only resume rather than guessed; the accepted residue of the absent `insideFork` is
1369
- * that a FORK child resumed deps-only reads as a plain delegated child on the non-fork consumer
1370
- * facet (subagent persona/context trim) — documented here rather than fixed with a new
1371
- * persistence axis. Schema ADDITION (additive, old readers ignore it —
1384
+ * resume lanes all do); the checkpoint key is the fallback for the deps-only leg. Of the delegation
1385
+ * axes only this one and {@link fromSubagent} persist — `insideFork`/`agentName`/`parentToolCallId` stay internals-only, honestly absent
1386
+ * on a deps-only resume rather than guessed. `insideFork` needs no axis: no lane holds a fork leg's
1387
+ * parks (`RunInternals.parkLaneHeld` is set only by a background lane that can park and an armed
1388
+ * workflow), so a fork leg mints no row and no resume of one exists to read the facet back. Schema ADDITION (additive, old readers ignore it —
1372
1389
  * the Q5 posture; no version movement): an older worker resuming a newer row keeps the pre-key
1373
1390
  * behavior, and an older row without the key resumes frame-less by documented honest absence
1374
1391
  * (see {@link import("./types.js").DelegationLifecycleEvent}). Absent = the leg was not a
@@ -1378,6 +1395,12 @@ export interface CheckpointState {
1378
1395
  /** The registry row the suspended leg ran as (`RunInternals.rowTaskId`), stamped at every mint and restored by a resume that
1379
1396
  * hands no internals. Present only on a row-lane leg's park, which then requires `row_task_id` (an older engine refuses it). */
1380
1397
  rowTaskId?: string;
1398
+ /** The task id the parked leg's asks named it by (its prepare's one mint, `Prepared.taskId`: its registry row, else its spec's, else its
1399
+ * session id), stamped at every mint; the summary's {@link CheckpointSummary.agentId} reads it, no resume does. Absent ⇒ minted before the member. */
1400
+ legTaskId?: string;
1401
+ /** The attribution bit the parked leg's asks carry ({@link import("./tool-policy.js").AskRequest}.fromSubagent: a nameable parent task issued the leg), stamped at every mint
1402
+ * from the leg's one ask source; a resume handed no parent task reads it back. Not {@link isDelegatedChild} (a directly-started workflow's agent is delegated without it). */
1403
+ fromSubagent?: true;
1381
1404
  /**
1382
1405
  * design/380 O1③ — the run TREE's placement fixed point at suspend: the SAME three-segment fold the
1383
1406
  * env-factory ctx mint uses (explicit `RunInternals.placementRoot` > the delegation lanes'
@@ -1683,9 +1706,11 @@ export interface CheckpointRow {
1683
1706
  * `"unavailable"` and the row parks the bytes that answer was bound to (otherwise the row mints its own, {@link import("./runner/deferred-ask.js").parkedAskIdentity}). */
1684
1707
  checkpointId?: string;
1685
1708
  /** THE SYNCHRONOUS-CHILD BLOCK — four members ({@link parentSessionId}, {@link parentTaskId}, {@link rootSessionId}, {@link rootSessionIncarnation}),
1686
- * written by ONE predicate at ONE mint ({@link import("./leg-identity.js").syncChildBlockOf}) onto every row a synchronous child parks, and
1687
- * absent from a root run's row, a background agent's, a workflow agent's and a row an earlier engine parked. They name where the parked leg
1688
- * came from, in the spelling of the run internals they are read from. ECHO-ONLY: no gate / CAS / resume path decides on them.
1709
+ * written by earlier releases onto every row a synchronous child parked, and absent from a root run's row, a background agent's and a
1710
+ * workflow agent's. No release mints it now: a synchronous child's parks are not minted at all (nobody resumes that leg —
1711
+ * `approvalParkNotResumableOf`), so the block survives only on rows parked before; their listing and decision faces refuse such a row
1712
+ * (`checkpoint.unsupported_version`, reason `leg_not_resumable`: the row judge reads the block's presence). They name where the parked
1713
+ * leg came from, in the spelling of the run internals they were read from.
1689
1714
  * The session the parked leg was spawned by ({@link import("./runner/contracts.js").RunInternals.parentSessionId}). */
1690
1715
  parentSessionId?: string;
1691
1716
  /** The task the parked leg's parent ran as, ONLY when the leg is a synchronous child ({@link import("./contracts.js").RunInternals.parentTaskId}) —
@@ -1878,11 +1903,15 @@ export interface CheckpointRow {
1878
1903
  * consumer then falls back to the human-kind scope-only inference for legacy rows and injects NOTHING for
1879
1904
  * unattended parks, so a spawn that never opted in can never gain the opt-in through a resume). Engine-
1880
1905
  * minted from the task's own spec — a worker/tool cannot self-declare it (`durableApproval` never rides tool args).
1906
+ *
1907
+ * `false` on a RESOURCE row: the host declared that this run's decision parks cannot be resumed (`TaskSpec.durableApproval: false`) —
1908
+ * a resume whose config states no `durableApproval` keeps that word (the resume entry reads it back), and only a config that states an
1909
+ * opt-in object lifts it. A decision park is never minted under that word, so no approval row carries it.
1881
1910
  */
1882
1911
  durableApproval?: {
1883
1912
  scope: string;
1884
1913
  ttlMs?: number;
1885
- };
1914
+ } | false;
1886
1915
  /**
1887
1916
  * @contract checkpoint.execution_outcome — the settlement record of how the DECIDED action was
1888
1917
  * finally disposed on the resumed leg: the {@link GateOutcome} the resumed call's `tool_end` frame
@@ -1952,6 +1981,10 @@ export declare function checkpointIndexFacts(cp: Checkpoint): CheckpointIndexFac
1952
1981
  * cause and the inbox summary both read it here.
1953
1982
  */
1954
1983
  export declare function planReviewRequesterOf(pendingAction: PendingAction): string | undefined;
1984
+ /** The ONE reading of {@link PendingAction} `plan_review.planContentHash` (the digest of the plan shown at the pause): a value
1985
+ * of the form the mint writes on a `plan_review` pending action; every other kind, an absent member and a damaged value read as
1986
+ * `undefined`, so no consumer echoes a value the mint never wrote. The paused cause and the inbox summary both read it here. */
1987
+ export declare function planReviewContentHashOf(pendingAction: PendingAction): string | undefined;
1955
1988
  /**
1956
1989
  * A checkpoint row's own answer to "does anything in this row keep this engine from resuming it" — every refusal of the
1957
1990
  * resume ladder the row and this engine decide alone, ahead of every deployment fact, resume input and decision
@@ -2036,11 +2069,13 @@ export interface CheckpointSummary {
2036
2069
  * a supervisor inbox attributes each pending checkpoint to its worker in ONE `listByScope` call (no N+1
2037
2070
  * `getCheckpoint`). ECHO-ONLY display/triage; present exactly on an ask-origin row (`tool_approval` / `plan_review`), absent on a non-ask gate and on a row an earlier engine parked ({@link Checkpoint.sourceSessionId}). */
2038
2071
  sourceSessionId?: string;
2039
- /** The parked leg's agent id when it is a delegated child (the parked twin of {@link import("./tool-policy.js").AskRequest}.agentId),
2040
- * derived from the row by the live ask's predicate — nothing more is stored: its registry row ({@link CheckpointState.rowTaskId}) when
2041
- * 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
2042
- * agent whose spec names a `taskId` summarizes as its session id while its live ask said the declared id. ECHO-ONLY display/triage. */
2072
+ /** The parked leg's agent id when it is a delegated child (the parked twin of {@link import("./tool-policy.js").AskRequest}.agentId): the ask's predicate
2073
+ * over the row's {@link CheckpointState.legTaskId} and {@link CheckpointState.isDelegatedChild}, the value the leg's asks carried; absent on a host's row.
2074
+ * A row minted before the task id member reads its registry row, else its session id (a workflow agent's declared `taskId` unread). ECHO-ONLY display/triage. */
2043
2075
  agentId?: string;
2076
+ /** The parked twin of {@link import("./tool-policy.js").AskRequest}.fromSubagent: `true` exactly when the row records it ({@link CheckpointState.fromSubagent}),
2077
+ * on any gate kind; not `agentId`'s presence. Absent on a host's row, a directly-started workflow's agent's, and a row minted before the member. ECHO-ONLY. */
2078
+ fromSubagent?: true;
2044
2079
  /** design S1d (source-tag): the issuing task's end-user principal ({@link Checkpoint.principal}) for per-user
2045
2080
  * inbox attribution. ECHO-ONLY display/triage; absent when the checkpoint carries no principal. */
2046
2081
  principal?: string;
@@ -2062,6 +2097,11 @@ export interface CheckpointSummary {
2062
2097
  * {@link toolCallId} absence-shape note applies). It names the call that PRESENTED the plan, not a call the pause
2063
2098
  * gates: `toolCallId` stays omitted on a plan_review row. */
2064
2099
  requestedByCallId?: string;
2100
+ /** The digest of the plan shown to the person at this pause ({@link PendingAction} `plan_review.planContentHash`, read
2101
+ * through {@link planReviewContentHashOf}) — present ONLY on a `plan_review` row that carries a well-formed one; OMITTED
2102
+ * on every other row (the {@link toolCallId} absence-shape note applies). It says what was SHOWN, not who asked and not
2103
+ * which gate: compare it with your own digest of the plan string you received; equal values on two rows mean equal text. */
2104
+ planContentHash?: string;
2065
2105
  /** The pending tool's name ({@link PendingAction} `tool_approval.toolName`) when this is an approval suspend — the very name
2066
2106
  * the row's `boundInputHash` was minted over (`exactBoundInputHashOf(toolName, args)`), as the row records it (an alias call
2067
2107
  * records the tool's own name). With {@link toolCallId} it is the listing's half of the approval binding: two parks of one
@@ -2169,6 +2209,9 @@ export interface CheckpointSummary {
2169
2209
  * present ⇔ the row holds a non-empty string, read through the screen the row's mint takes ({@link approvalMessageOf}); OMITTED
2170
2210
  * otherwise. **UNTRUSTED, ADVISORY** display text; ECHO-ONLY. */
2171
2211
  cardMessage?: string;
2212
+ /** The row's `PendingAction.tool_approval.headline` (the card's first line for a person), present ⇔ a non-empty string read through
2213
+ * {@link cardMessage}'s screen; OMITTED otherwise (show {@link cardMessage}). For people to read, never a branch input; ECHO-ONLY. */
2214
+ headline?: string;
2172
2215
  /** What opened the leg that parked this row — the row's `state.runOrigin` (`"scheduled"`: the deployment's scheduler, not a
2173
2216
  * person submitting just now), for every gate kind, so an inbox shows it in the one listing call. Echoed only as a member of
2174
2217
  * {@link import("./run-origin.js").RUN_ORIGINS} (the resume's screen refuses any other value loudly; this projection never
@@ -2337,23 +2380,10 @@ export interface CheckpointStore {
2337
2380
  * that still matches.
2338
2381
  */
2339
2382
  readonly fidelity?: StoreFidelity;
2340
- /**
2341
- * The EXECUTION-OUTCOME declaration — REQUIRED, and required to be exactly `{ outcome: true }`: the
2342
- * store promises that {@link recordExecutionOutcome} is the real CAS this contract describes (the
2343
- * predicate, the four words, the conflict throw) and that {@link reopen} honours the record. Same
2344
- * "declaration, never duck-typing" posture as the three optional axes above, but not optional: the
2345
- * durable resume lane records how every decided action was disposed, and a store that cannot keep
2346
- * that record would leave every resolved row it holds silently unreadable on that axis. A store
2347
- * without the declaration is refused at the FIRST read of the store seat
2348
- * ({@link resolveCheckpointStore}, code `config.invalid_checkpoint_store`) — a JavaScript caller that
2349
- * satisfies no type is told at prepare what the type would have told it.
2350
- */
2351
- readonly execution: {
2352
- readonly outcome: true;
2353
- };
2354
2383
  /**
2355
2384
  * The CLAIM-HOLDER declaration: this store judges {@link ResolveExpectation.holder} in the same atomic step as the resolve's flip.
2356
- * Same "declaration, never duck-typing" posture as {@link execution}: ABSENT reads as "does not judge holders", and a run handed a
2385
+ * Same "declaration, never duck-typing" posture as the optional axes above ({@link durability}, {@link fidelity}) — what it
2386
+ * declares happens inside {@link resolve}, so no verb's presence can say it: ABSENT reads as "does not judge holders", and a run handed a
2357
2387
  * holder over such a store is refused at its store seat (`config.invalid_checkpoint_store`) — a holder the store would ignore would
2358
2388
  * fence nothing while the deployment believed it fenced.
2359
2389
  */
@@ -2431,7 +2461,9 @@ export interface CheckpointStore {
2431
2461
  /**
2432
2462
  * Record how the DECIDED action was finally disposed on the resumed leg — the {@link GateOutcome} its
2433
2463
  * `tool_end` frame carried (see {@link CheckpointRow.executionOutcome} for what the record means and why
2434
- * it is a column of its own beside the immutable decision). REQUIRED (declared by {@link execution}).
2464
+ * it is a column of its own beside the immutable decision). REQUIRED, and the verb is the contract: the store seat reads its presence
2465
+ * ({@link resolveCheckpointStore}, code `config.invalid_checkpoint_store`), no declaration stands for it, and the kit holds every
2466
+ * backend to what it does (the CAS below, and {@link reopen} refusing a recorded row).
2435
2467
  *
2436
2468
  * The CAS: `UPDATE … SET execution_outcome=?, execution_at_ms=? WHERE token=? AND scope=? AND
2437
2469
  * status='resolved' AND execution_outcome IS NULL`. The answer is a word of the closed
@@ -2649,8 +2681,8 @@ export declare function resolveCheckpointStore(spec: {
2649
2681
  }, deps: {
2650
2682
  checkpointStore?: CheckpointStore;
2651
2683
  }): CheckpointStore | undefined;
2652
- /** The ONE refusal of a store seat whose {@link CheckpointStore} lacks a required member (the {@link CheckpointStore.execution}
2653
- * declaration, the {@link CheckpointStore.reopen} verb) — every missing one named, with the seat and the store's constructor when it
2684
+ /** The ONE refusal of a store seat whose {@link CheckpointStore} lacks a required member (the {@link CheckpointStore.recordExecutionOutcome}
2685
+ * verb, the {@link CheckpointStore.reopen} verb) — every missing one named, with the seat and the store's constructor when it
2654
2686
  * has one — or `undefined` when the store carries them all. Same door, same code, as the retired-`null` refusal below: a configuration
2655
2687
  * the run cannot honour is refused at the first read, never carried. */
2656
2688
  export declare function checkpointStoreIncomplete(seat: "TaskSpec.checkpointStore" | "RunnerDeps.checkpointStore", store: object): (Error & {
@@ -2757,10 +2789,6 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
2757
2789
  /** Honest declaration on the fidelity axis: `put`/`get` are `structuredClone`, so a row keeps the
2758
2790
  * whole structured-clone domain — a `Date` filed here is a `Date` when it comes back. */
2759
2791
  readonly fidelity: "structured-clone";
2760
- /** The execution-outcome record verb below is the contract's CAS, and `reopen` honours the record. */
2761
- readonly execution: {
2762
- readonly outcome: true;
2763
- };
2764
2792
  /** Declared exactly when the store was built with a `holderIsCurrent` judge ({@link CheckpointStore.fence}). */
2765
2793
  readonly fence?: {
2766
2794
  readonly holder: true;
@@ -2,9 +2,10 @@ import { randomBytes, randomUUID } from "node:crypto";
2
2
  import { types } from "node:util";
3
3
  import { uuidv7 } from "../internal/harness.js";
4
4
  import { PROBE_REASON_MAX, inlineUntrusted, sanitizeUntrustedText } from "./untrusted-text.js";
5
- import { CheckpointError, checkpointVersionOf, isPlainRecord, normalizeProbeCause, safeDataValue } from "./checkpoint-features.js";
5
+ import { CheckpointError, checkpointVersionOf, copiedRiskAxes, isPlainRecord, normalizeProbeCause, safeDataValue } from "./checkpoint-features.js";
6
6
  import { judgeCheckpointRow, retiredSteerSeatRefusal, UNREADABLE_ROW_VERDICT } from "./checkpoint-row-verdict.js";
7
7
  import { boundedThrownName } from "./thrown-value.js";
8
+ import { isTextContentHash } from "./canonical-json.js";
8
9
  import { carriesBidiControls } from "./tool-policy.js";
9
10
  import { agentIdOf, legTaskIdOf } from "./leg-identity.js";
10
11
  import { isAutoModeFallbackCause, readDenialLimitFallback } from "./auto-mode.js";
@@ -130,7 +131,7 @@ export function buildRiskDescriptor(input) {
130
131
  const touchedPaths = touched.length > 0 ? touched.slice(0, MAX_TOUCHED_PATHS) : undefined;
131
132
  return {
132
133
  severity: riskSeverity(axes),
133
- axes,
134
+ axes, ...copiedRiskAxes(input.riskAxes),
134
135
  toolName,
135
136
  ...(input.shellGated && input.shellGateDoctrine !== undefined ? { shellGateDoctrine: input.shellGateDoctrine } : {}),
136
137
  ...(input.allowRuleShadowed !== undefined && input.allowRuleShadowed.length > 0 ? { allowRuleShadowed: input.allowRuleShadowed.map((r) => ({ member: r.member, entries: r.entries.map((e) => renderUntrustedCommandText(e, 200)), ...(r.omitted !== undefined ? { omitted: r.omitted } : {}) })) } : {}),
@@ -244,6 +245,12 @@ export function planReviewRequesterOf(pendingAction) {
244
245
  const id = pendingAction.requestedByCallId;
245
246
  return typeof id === "string" && id !== "" ? id : undefined;
246
247
  }
248
+ export function planReviewContentHashOf(pendingAction) {
249
+ if (pendingAction.kind !== "plan_review")
250
+ return undefined;
251
+ const hash = pendingAction.planContentHash;
252
+ return isTextContentHash(hash) ? hash : undefined;
253
+ }
247
254
  export function summarizeCheckpoint(cp, disclose, verdict) {
248
255
  const rowVerdict = verdict ?? judgeCheckpointRow(cp);
249
256
  let why;
@@ -298,6 +305,7 @@ function projectCheckpoint(cp, rowVerdict, disclose) {
298
305
  const cardReading = parkedApprovalCardOf(cp.gate);
299
306
  const tool = cp.pendingAction.kind === "tool_approval" ? cp.pendingAction : undefined;
300
307
  const requestedByCallId = planReviewRequesterOf(cp.pendingAction);
308
+ const planContentHash = planReviewContentHashOf(cp.pendingAction);
301
309
  let toolInput;
302
310
  if (tool !== undefined) {
303
311
  try {
@@ -314,7 +322,7 @@ function projectCheckpoint(cp, rowVerdict, disclose) {
314
322
  const hasBidi = tool !== undefined &&
315
323
  (facts.hasBidiControls === true ||
316
324
  carriesBidiControls([toolInput, shownPreview], { maxNodes: BIDI_BACKFILL_MAX_NODES, maxChars: BIDI_BACKFILL_MAX_CHARS }));
317
- const agentId = agentIdOf({ taskId: legTaskIdOf({}, cp.state, cp.sessionId), isDelegatedChild: cp.state.isDelegatedChild === true });
325
+ const agentId = agentIdOf({ taskId: cp.state.legTaskId ?? legTaskIdOf({}, cp.state, cp.sessionId), isDelegatedChild: cp.state.isDelegatedChild === true });
318
326
  const preview = (() => {
319
327
  if (shownPreview === undefined)
320
328
  return {};
@@ -342,10 +350,11 @@ function projectCheckpoint(cp, rowVerdict, disclose) {
342
350
  ...(isFiniteMember(facts.deadline) ? { deadline: facts.deadline } : {}),
343
351
  createdAt: facts.createdAt,
344
352
  ...(cp.sourceSessionId !== undefined ? { sourceSessionId: cp.sourceSessionId } : {}),
345
- ...(agentId !== undefined ? { agentId } : {}),
353
+ ...(agentId !== undefined ? { agentId } : {}), ...(cp.state.fromSubagent === true ? { fromSubagent: true } : {}),
346
354
  ...(cp.principal !== undefined ? { principal: cp.principal } : {}),
347
355
  ...(facts.toolCallId !== null ? { toolCallId: facts.toolCallId } : {}),
348
356
  ...(requestedByCallId !== undefined ? { requestedByCallId } : {}),
357
+ ...(planContentHash !== undefined ? { planContentHash } : {}),
349
358
  ...(facts.toolName !== null ? { toolName: facts.toolName } : {}),
350
359
  ...(cardReading.kind === "card" ? { approvalCard: cardReading.card } : {}),
351
360
  ...(toolInput !== undefined ? { toolInput } : {}),
@@ -370,6 +379,7 @@ function projectCheckpoint(cp, rowVerdict, disclose) {
370
379
  })(),
371
380
  ...((askReasons) => (askReasons !== undefined ? { askReasons } : {}))(receiveAskReasons(tool?.askReasons)),
372
381
  ...((cardMessage) => (cardMessage !== undefined ? { cardMessage } : {}))(approvalMessageOf(tool?.cardMessage)),
382
+ ...((headline) => (headline !== undefined ? { headline } : {}))(approvalMessageOf(tool?.headline)),
373
383
  ...(tool !== undefined ? readBoundBinding(tool) : {}),
374
384
  ...(hasBidi ? { hasBidiControls: true } : {}),
375
385
  };
@@ -412,7 +422,7 @@ export function resolveCheckpointStore(spec, deps) {
412
422
  return deps.checkpointStore;
413
423
  }
414
424
  const REQUIRED_STORE_MEMBERS = [
415
- { carried: (store) => store?.execution?.outcome === true, lacks: "does not declare `execution = { outcome: true }`", cost: "the execution-outcome record (recordExecutionOutcome, and reopen refusing a recorded row) — without it no reader can settle how a resumed approval was disposed" },
425
+ { carried: (store) => typeof store?.recordExecutionOutcome === "function", lacks: "does not carry the `recordExecutionOutcome` verb", cost: "the execution-outcome record (recordExecutionOutcome, and reopen refusing a recorded row) — without it no reader can settle how a resumed approval was disposed" },
416
426
  { carried: (store) => typeof store?.reopen === "function", lacks: "does not carry the `reopen` verb", cost: "the claim's reversal (reopen) — without it a resume the engine claimed and then refused before its decided action was disposed would consume the approval" },
417
427
  ];
418
428
  export function checkpointStoreIncomplete(seat, store) {
@@ -631,7 +641,6 @@ export class InMemoryCheckpointStore {
631
641
  retention;
632
642
  durability = "process-local";
633
643
  fidelity = "structured-clone";
634
- execution = { outcome: true };
635
644
  cps = new Map();
636
645
  rowVerdicts = new WeakMap();
637
646
  fault = null;
@@ -89,6 +89,12 @@ export declare const CLAMP_SET: Readonly<{
89
89
  readonly script: true;
90
90
  readonly carrier: "clamp";
91
91
  }>;
92
+ durableApproval: Readonly<{
93
+ readonly law: "restricting";
94
+ readonly value: false;
95
+ readonly script: false;
96
+ readonly carrier: "clamp";
97
+ }>;
92
98
  readDenyPatterns: Readonly<{
93
99
  readonly law: "addOnly";
94
100
  readonly identity: typeof readDenyIdentity;
@@ -82,6 +82,7 @@ export const CLAMP_SET = Object.freeze({
82
82
  approvalReach: Object.freeze({ law: "restricting", value: "none", script: true, carrier: "clamp" }),
83
83
  readFace: Object.freeze({ law: "restricting", value: "roots", script: true, carrier: "clamp" }),
84
84
  writeFace: Object.freeze({ law: "restricting", value: "roots", script: true, carrier: "clamp" }),
85
+ durableApproval: Object.freeze({ law: "restricting", value: false, script: false, carrier: "clamp" }),
85
86
  readDenyPatterns: Object.freeze({ law: "addOnly", identity: readDenyIdentity, entry: readDenyEntryProblem, script: READ_DENY_SCRIPT_LAW, deploymentLayer: "readDenyPatterns", carrier: "clamp" }),
86
87
  writeProtectedAdditions: Object.freeze({ law: "addOnly", identity: writeProtectedEntryIdentity, entry: writeProtectedEntryProblem, script: WRITE_PROTECTED_SCRIPT_LAW, deploymentLayer: "writeProtectedPaths", carrier: "clamp" }),
87
88
  complianceAdditionalDenies: Object.freeze({ law: "addOnly", identity: complianceIdentity, entry: complianceCapabilityProblem, script: COMPLIANCE_SCRIPT_LAW, deploymentLayer: "compliancePostureResolver", carrier: "clamp" }),
@@ -18,5 +18,5 @@
18
18
  * A CLOSED SET with one home, registered in `docs/CLOSED-SETS.md`; `gate:closed-sets` holds the whole family to it: every family literal under
19
19
  * `src/` is a member, a notice word in a notice's `code`, or a ledgered non-word, and every member is still spelled somewhere.
20
20
  */
21
- export declare const CONFIG_REFUSAL_CODES: readonly ["config.a2a_peer_name_collision", "config.advisor_model_invalid", "config.advisor_tool_invalid", "config.agent.duplicate", "config.agent.invalid", "config.agent.reserved_name", "config.agent.unknown_model", "config.agent.unknown_tool", "config.agent_config_dir_invalid", "config.agents.no_delegation_tool", "config.approval_reach_invalid", "config.attachment_invalid", "config.auto_consolidation", "config.auto_mode_classifier_fallback_invalid", "config.auto_mode_denial_limit_invalid", "config.auto_mode_rate_limit_break_invalid", "config.auto_mode_timeout_invalid", "config.brain_call_guardrail_invalid", "config.cascade_invalid", "config.circuit_breaker_invalid", "config.command_sandbox_unavailable", "config.compliance_denied", "config.compliance_posture", "config.compliance_required", "config.context_settings_unknown_word", "config.credential_in_declaration", "config.credential_ref_invalid", "config.cross_boundary_posture", "config.cwd_conflicts_restore", "config.cwd_not_honored", "config.cwd_outside_root", "config.cwd_unsupported", "config.defer_mode_invalid", "config.delegation_entry_caps", "config.deps_retired_key", "config.egress_requires_write_effect", "config.empty_objective", "config.env_lifetime_invalid", "config.execution_env_home_dir_invalid", "config.extra_body_output_cap", "config.extra_tool_names", "config.host_floor_invalid", "config.host_floor_refused", "config.image_invalid", "config.interaction_posture", "config.interaction_wiring", "config.invalid_argument", "config.invalid_checkpoint_store", "config.invalid_file_history_capture", "config.invalid_file_history_store", "config.invalid_governance_baseline", "config.invalid_on_track_failure", "config.invalid_output_schema", "config.invalid_permission_rules", "config.invalid_task_registry", "config.invalid_tool_name_set", "config.language_invalid", "config.legacy_tool_name", "config.limit_invalid", "config.limit_unknown_key", "config.locked_key", "config.locked_registry", "config.mcp_content_class", "config.mcp_dialable_failed", "config.mcp_fingerprint_invalid", "config.mcp_host_seat_missing", "config.mcp_host_seat_undeclared", "config.mcp_pool_foreign_connection", "config.mcp_probe_option", "config.mcp_server_name_collision", "config.mcp_startup_timeout_invalid", "config.memory_capture_policy", "config.memory_capture_spelling", "config.memory_capture_unsupported", "config.memory_challenge_request", "config.memory_consolidation", "config.memory_consolidation_driver", "config.memory_consolidation_lease_required", "config.memory_consolidation_provenance_off", "config.memory_consolidation_replica_local", "config.memory_consolidation_write_gate", "config.memory_delegation_evidence", "config.memory_dir_not_backend_root", "config.memory_distiller_purity_contract", "config.memory_dual_root_overlap", "config.memory_erasure_request", "config.memory_erasure_scope", "config.memory_export_request", "config.memory_hold_timeout", "config.memory_import_request", "config.memory_persistence_invalid", "config.memory_project_identity", "config.memory_project_key_spelling", "config.memory_project_marker", "config.memory_project_marker_nested", "config.memory_provenance", "config.memory_reanchor", "config.memory_rebuild_reason", "config.memory_scope_key", "config.memory_scope_placement", "config.memory_scope_spelling", "config.memory_sync_cursor_mismatch", "config.memory_sync_store", "config.memory_sync_target_mismatch", "config.memory_write_scope_mismatch", "config.microcompact_invalid", "config.missing_scope", "config.model_fallback_invalid", "config.mods_invalid", "config.nothing_to_wake", "config.output_style_invalid", "config.parent_spec_seat_missing", "config.peer_answer_invalid", "config.peer_presence_invalid", "config.peer_seat_missing", "config.permission_mode_invalid", "config.placement_not_honored", "config.placement_root_invalid", "config.plan_file_invalid", "config.principal_inbox_consumer_invalid", "config.project_id_invalid", "config.project_identity_mismatch", "config.prompt_selector_invalid", "config.prompt_trait_unknown", "config.protocol_endpoint_unbound", "config.protocol_header_collision", "config.protocol_plaintext_credentials", "config.read_deny_floor_unkept", "config.read_face_invalid", "config.read_face_org_task_escalation", "config.read_face_readonly_conflict", "config.read_face_seat", "config.registry_scope_mismatch", "config.reserved_tool_name", "config.retention_capability", "config.retention_policy", "config.retention_policy_invalid", "config.run_origin_invalid", "config.safe_vars_reserved_name", "config.sandbox_admission_unavailable", "config.sandbox_settings_invalid", "config.session_rules_unreadable", "config.session_workspace_changed", "config.session_workspace_invalid", "config.shell_gate_value_retired", "config.skill_base_dir_invalid", "config.skill_deny_unreadable", "config.skill_listing_budget_invalid", "config.spec_member_unreadable", "config.spec_retired_key", "config.spec_unknown_key", "config.stale_tool_result_offload_invalid", "config.stall_timeout_invalid", "config.stall_timeout_retired", "config.store_durability_invalid", "config.store_fidelity_invalid", "config.tool_contract_too_long", "config.tool_face_control", "config.tool_face_invalid", "config.tool_materialize_invalid", "config.tool_materialize_unreachable", "config.tool_model_gate_env_invalid", "config.tool_model_gate_invalid", "config.tool_mount_denied", "config.tool_name_invalid", "config.tool_name_too_long", "config.tool_roster_bound", "config.tool_roster_mount_tag", "config.tool_roster_origin", "config.tool_schema_bound", "config.tool_search_invalid", "config.toolpolicy.unmatched_names", "config.unknown_role", "config.usage_window_invalid", "config.usage_window_unpriced", "config.user_attachment_invalid", "config.user_invoked_skill_unknown", "config.verify_internals_invalid", "config.web_max_bytes_invalid", "config.web_search_max_results_invalid", "config.web_summary_max_content_invalid", "config.web_timeout_invalid", "config.write_exempt_dir_covers_root", "config.write_face_invalid", "config.write_face_org_task_escalation", "config.write_face_readonly_conflict", "resume_at.before_root_unsupported", "resume_at.before_target_not_user", "resume_at.conflicts_resume", "resume_at.invalid_mode", "resume_at.mode_without_target", "resume_at.no_session", "resume_at.not_a_message", "resume_at.not_found"];
21
+ export declare const CONFIG_REFUSAL_CODES: readonly ["config.a2a_peer_name_collision", "config.advisor_model_invalid", "config.advisor_tool_invalid", "config.agent.duplicate", "config.agent.invalid", "config.agent.reserved_name", "config.agent.unknown_model", "config.agent.unknown_tool", "config.agent_config_dir_invalid", "config.agents.no_delegation_tool", "config.approval_reach_invalid", "config.attachment_invalid", "config.auto_consolidation", "config.auto_mode_classifier_fallback_invalid", "config.auto_mode_denial_limit_invalid", "config.auto_mode_rate_limit_break_invalid", "config.auto_mode_timeout_invalid", "config.brain_call_guardrail_invalid", "config.cascade_invalid", "config.circuit_breaker_invalid", "config.command_sandbox_unavailable", "config.compliance_denied", "config.compliance_posture", "config.compliance_required", "config.context_settings_unknown_word", "config.credential_in_declaration", "config.credential_ref_invalid", "config.cross_boundary_posture", "config.cwd_conflicts_restore", "config.cwd_not_honored", "config.cwd_outside_root", "config.cwd_unsupported", "config.defer_mode_invalid", "config.delegation_entry_caps", "config.deps_retired_key", "config.egress_requires_write_effect", "config.empty_objective", "config.env_lifetime_invalid", "config.execution_env_home_dir_invalid", "config.extra_body_output_cap", "config.extra_tool_names", "config.host_floor_invalid", "config.host_floor_refused", "config.image_invalid", "config.interaction_posture", "config.interaction_wiring", "config.invalid_argument", "config.invalid_checkpoint_store", "config.invalid_file_history_capture", "config.invalid_file_history_store", "config.invalid_governance_baseline", "config.invalid_on_track_failure", "config.invalid_output_schema", "config.invalid_permission_rules", "config.invalid_task_registry", "config.invalid_tool_name_set", "config.language_invalid", "config.legacy_tool_name", "config.limit_invalid", "config.limit_unknown_key", "config.locked_key", "config.locked_registry", "config.mcp_content_class", "config.mcp_dialable_failed", "config.mcp_fingerprint_invalid", "config.mcp_host_seat_missing", "config.mcp_host_seat_undeclared", "config.mcp_pool_foreign_connection", "config.mcp_probe_option", "config.mcp_server_name_collision", "config.mcp_startup_timeout_invalid", "config.memory_capture_policy", "config.memory_capture_spelling", "config.memory_capture_unsupported", "config.memory_challenge_request", "config.memory_consolidation", "config.memory_consolidation_driver", "config.memory_consolidation_lease_required", "config.memory_consolidation_provenance_off", "config.memory_consolidation_replica_local", "config.memory_consolidation_write_gate", "config.memory_delegation_evidence", "config.memory_dir_not_backend_root", "config.memory_distiller_purity_contract", "config.memory_dual_root_overlap", "config.memory_erasure_request", "config.memory_erasure_scope", "config.memory_export_request", "config.memory_hold_timeout", "config.memory_import_request", "config.memory_persistence_invalid", "config.memory_project_identity", "config.memory_project_key_spelling", "config.memory_project_marker", "config.memory_project_marker_nested", "config.memory_provenance", "config.memory_reanchor", "config.memory_rebuild_reason", "config.memory_scope_key", "config.memory_scope_placement", "config.memory_scope_spelling", "config.memory_sync_cursor_mismatch", "config.memory_sync_store", "config.memory_sync_target_mismatch", "config.memory_write_scope_mismatch", "config.microcompact_invalid", "config.missing_scope", "config.model_fallback_invalid", "config.mods_invalid", "config.nothing_to_wake", "config.output_style_invalid", "config.parent_spec_seat_missing", "config.peer_answer_invalid", "config.peer_presence_invalid", "config.peer_seat_missing", "config.permission_mode_invalid", "config.placement_not_honored", "config.placement_root_invalid", "config.plan_file_invalid", "config.principal_inbox_consumer_invalid", "config.project_id_invalid", "config.project_identity_mismatch", "config.prompt_selector_invalid", "config.prompt_trait_unknown", "config.protocol_endpoint_unbound", "config.protocol_header_collision", "config.protocol_plaintext_credentials", "config.read_deny_floor_unkept", "config.read_face_invalid", "config.read_face_org_task_escalation", "config.read_face_readonly_conflict", "config.read_face_seat", "config.registry_scope_mismatch", "config.reserved_tool_name", "config.retention_capability", "config.retention_policy", "config.retention_policy_invalid", "config.run_origin_invalid", "config.safe_vars_reserved_name", "config.sandbox_admission_unavailable", "config.sandbox_settings_invalid", "config.session_rules_unreadable", "config.session_workspace_changed", "config.session_workspace_invalid", "config.shell_gate_value_retired", "config.skill_base_dir_invalid", "config.skill_deny_unreadable", "config.skill_listing_budget_invalid", "config.spec_member_unreadable", "config.spec_retired_key", "config.spec_unknown_key", "config.stale_tool_result_offload_invalid", "config.stall_timeout_invalid", "config.stall_timeout_retired", "config.store_durability_invalid", "config.store_fidelity_invalid", "config.tool_contract_too_long", "config.tool_face_control", "config.tool_face_invalid", "config.tool_materialize_invalid", "config.tool_materialize_unreachable", "config.tool_model_gate_env_invalid", "config.tool_model_gate_invalid", "config.tool_mount_denied", "config.tool_name_invalid", "config.tool_name_too_long", "config.tool_roster_bound", "config.tool_roster_mount_tag", "config.tool_roster_origin", "config.tool_schema_bound", "config.tool_search_invalid", "config.toolpolicy.unmatched_names", "config.unknown_role", "config.usage_window_invalid", "config.usage_window_unpriced", "config.user_attachment_invalid", "config.user_invoked_skill_unknown", "config.verify_internals_invalid", "config.web_max_bytes_invalid", "config.web_search_max_results_invalid", "config.web_summary_max_content_invalid", "config.web_timeout_invalid", "config.write_exempt_dir_covers_root", "config.write_face_invalid", "config.write_face_org_task_escalation", "config.write_face_readonly_conflict", "resume_at.before_root_unsupported", "resume_at.before_target_not_user", "resume_at.conflicts_resume", "resume_at.invalid_mode", "resume_at.mode_without_target", "resume_at.no_session", "resume_at.not_a_message", "resume_at.not_found", "resume_at.outside_window"];
22
22
  export type ConfigRefusalCode = (typeof CONFIG_REFUSAL_CODES)[number];
@@ -193,4 +193,5 @@ export const CONFIG_REFUSAL_CODES = Object.freeze([
193
193
  "resume_at.no_session",
194
194
  "resume_at.not_a_message",
195
195
  "resume_at.not_found",
196
+ "resume_at.outside_window",
196
197
  ]);
@@ -187,14 +187,13 @@ export interface BackgroundChildEvent {
187
187
  * `stoppedBy`, `summary`, `result`, the residuals, `resumable`, `usage`, `completionId`), read from
188
188
  * the settle's one completion frame by {@link backgroundChildTerminal}, never re-stated beside it. */
189
189
  status?: "completed" | "killed" | "failed";
190
- /** terminal + spawn/tick (#258 widened the carriers): the stop-cycle number — on a TERMINAL frame
191
- * the completion frame's `TaskNotificationPayload.seq` (same settle, same X3 snapshot), or the
192
- * row's generation when that frame states none; on SPAWN and TICK frames the registry row's generation at emit (fresh spawn = 1, a
193
- * revived cycle's bumped counter), so a fleet consumer can tell a LATE first frame from a revived
194
- * cycle's frame without waiting for the terminal. One axis with `task_progress`'s `seq` — the tick
195
- * mirrors the frame's own stamp. Same honest downgrade as ever: present whenever a cycle number is
196
- * knowable (the registry handle / retain ledger's `cycleSeq`, the durable row's `seq` on a tier-3
197
- * revival / parked resume), absent when no carrier exists (forging a period would lie). */
190
+ /** terminal + spawn/tick (#258 widened the carriers): the row's stop-cycle number — one number per cycle, the one
191
+ * the claim that opened the cycle wrote on the row (fresh spawn = 1; every wake, in whichever lane or process, one
192
+ * step past the row's), so it rises strictly across a row's cycles and a fleet consumer can tell a LATE first
193
+ * frame from a revived cycle's frame without waiting for the terminal. On a TERMINAL frame it is the completion
194
+ * frame's `TaskNotificationPayload.seq` (same settle, same snapshot); on SPAWN and TICK frames the registry's
195
+ * reading at emit — a resumed parked cycle's spawn frame goes out only once its consume flip has won. One axis
196
+ * with `task_progress`'s `seq` — the tick mirrors the frame's own stamp. */
198
197
  seq?: number;
199
198
  /** terminal: the cross-channel completion correlation id — the completion frame's
200
199
  * `TaskNotificationPayload.completionId` (one minted value for every face of one completion). Absent
@@ -243,8 +242,6 @@ export interface BackgroundChildRow {
243
242
  /** The read handle to the child's transcript — absent when it was released (a stillborn fork branch). */
244
243
  transcriptId?: string;
245
244
  parentToolCallId?: string;
246
- /** The row's registry generation: the cycle the terminal names when the completion frame states none. */
247
- generation?: number;
248
245
  }
249
246
  /**
250
247
  * The ONE constructor of a background child's TERMINAL {@link BackgroundChildEvent}: a projection of the
@@ -381,7 +378,7 @@ export declare function __resetMalformedDelegationSeatAnnouncement(): void;
381
378
  * · a PRESENT NON-function seat is a bad deployment value; #123 forbids folding it to silence. There
382
379
  * is no per-frame console fallback (this is a frame-rate observer stream, not an announcement
383
380
  * channel — an unwired seat means UNOBSERVED, and echoing every spawn to stderr would flood), so
384
- * the loud exit is the seat DEFECT itself: announced via `console.warn` once per process.
381
+ * the loud exit is the seat DEFECT itself: `config.seat_malformed` on `onNotice`, once per process.
385
382
  * · an ABSENT seat is a plain no-op (the deployment chose not to observe).
386
383
  */
387
- export declare function deliverDelegationLifecycle(seat: RunnerDeps["onDelegationLifecycle"], event: DelegationLifecycleEvent, notifier: import("./safe-notify.js").SafeNotifier, site: string): void;
384
+ export declare function deliverDelegationLifecycle(seat: RunnerDeps["onDelegationLifecycle"], event: DelegationLifecycleEvent, notifier: import("./safe-notify.js").SafeNotifier, site: string, onNotice: RunnerDeps["onNotice"]): void;
@@ -1,6 +1,7 @@
1
1
  import { observeThenableRejection } from "./safe-notify.js";
2
+ import { deliverEngineNotice } from "./engine-notice.js";
2
3
  export function backgroundChildTerminal(completion, row) {
3
- const seq = completion.seq ?? row.generation;
4
+ const seq = completion.seq;
4
5
  const usage = fleetUsageOf(completion.usage);
5
6
  return {
6
7
  kind: "terminal",
@@ -59,7 +60,7 @@ let malformedDelegationSeatAnnounced = false;
59
60
  export function __resetMalformedDelegationSeatAnnouncement() {
60
61
  malformedDelegationSeatAnnounced = false;
61
62
  }
62
- export function deliverDelegationLifecycle(seat, event, notifier, site) {
63
+ export function deliverDelegationLifecycle(seat, event, notifier, site, onNotice) {
63
64
  if (typeof seat === "function") {
64
65
  const frame = Object.freeze(Object.assign(Object.create(null), event));
65
66
  notifier.notify(() => observeThenableRejection(seat(frame), notifier, site), site);
@@ -67,11 +68,11 @@ export function deliverDelegationLifecycle(seat, event, notifier, site) {
67
68
  }
68
69
  if (seat !== undefined && !malformedDelegationSeatAnnounced) {
69
70
  malformedDelegationSeatAnnounced = true;
70
- try {
71
- console.warn(`The delegation-lifecycle sink (RunnerDeps.onDelegationLifecycle) holds ${seat === null ? "null" : typeof seat} — not a ` +
72
- `function. Delegation spawn/terminal frames are NOT delivered until the wiring is fixed (omit the key, or wire a function).`);
73
- }
74
- catch {
75
- }
71
+ deliverEngineNotice(onNotice, {
72
+ code: "config.seat_malformed",
73
+ message: `The delegation-lifecycle sink (RunnerDeps.onDelegationLifecycle) holds ${seat === null ? "null" : typeof seat} — not a ` +
74
+ `function. Delegation spawn/terminal frames are NOT delivered until the wiring is fixed (omit the key, or wire a function).`,
75
+ detail: { seat: "onDelegationLifecycle" },
76
+ });
76
77
  }
77
78
  }
@@ -19,14 +19,27 @@
19
19
  * - `mods.skill_seat` — a skill carries its own hooks: `SkillSpec.mods` registrations are admitted on every leg that loads
20
20
  * the skill and take part only while the skill is active there (from its activation to the run's end, a park and its
21
21
  * resume included); they are the leg's own (no delegated child dispatches them or is screened by them).
22
- * - `user_attachments.read_state` — a request carries a file's contents once (`request-copy-projection.ts`): every copy
23
- * of a `path` attachment's or a Read's contents in a request is the contents, or the "not repeated" sentence beside an
24
- * earlier copy of the same contents in that same request, or a pointer sentence that says only that the contents are
25
- * not included; within one chain (no write call to the file between, both whole and non-empty) a request never carries
26
- * the same contents twice; a pointer sentence comes only from a de-duplication sentence an earlier release stored, or
27
- * from a running request whose irreducible core cannot hold the contents. A host-held entry (`content_text`) is sent
28
- * as given, every time.
22
+ * - `user_attachments.read_state` — a request de-duplicates a `path` attachment's copies, and only those
23
+ * (`request-copy-projection.ts`; THE one statement of this word — the docs and the outcome type point here): a
24
+ * `path` attachment frame in a request is its contents, or the "not repeated" sentence beside an earlier copy of the
25
+ * same contents in that same request (an earlier frame, or a Read result; no write call to the file between, both
26
+ * whole and non-empty), or — a whole frame of a file the leg seeded into its system prompt, unchanged — the "already
27
+ * in your context" sentence, or a pointer sentence that says only that the contents are not included. The earlier
28
+ * copy a "not repeated" sentence stands beside is always in that same request — never one a compaction summarized,
29
+ * the stale-result clear emptied, the trim left out or an earlier request carried: the request's own view is judged
30
+ * after they took what they took, so a frame whose earlier copy is gone carries the contents. A Read result is its
31
+ * contents on every request — a repeated Read costs its contents — or the pointer sentence. Across the two carriers:
32
+ * a Read, then an attachment of the same unchanged file ⇒ the frame is the "not repeated" sentence and the Read's
33
+ * contents are in that same request; an attachment, then a Read of it ⇒ the Read is its contents and the frame is
34
+ * as it was. A pointer sentence comes only from a de-duplication sentence an earlier release stored, or from a running
35
+ * request whose irreducible core cannot hold the contents. A host-held entry (`content_text`) is sent as given,
36
+ * every time.
37
+ * - `task.wake` — the engine reads `TaskSpec.wake` (`TASK_WAKE_SOURCES`, one word today: `parked_notifications`):
38
+ * `runTask({ objective: "", wake })` opens a leg on the notifications parked for this session's occupant and on nothing
39
+ * else, each handed to the model once, and a wake with nothing handed over ends `config.nothing_to_wake` before any model
40
+ * request. An engine without the word refuses the key (`config.spec_unknown_key`), so a shell that wakes a session gates
41
+ * on the word.
29
42
  */
30
- export declare const ENGINE_CAPABILITIES: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state"];
43
+ export declare const ENGINE_CAPABILITIES: readonly ["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake"];
31
44
  /** One word of {@link ENGINE_CAPABILITIES}. */
32
45
  export type EngineCapability = (typeof ENGINE_CAPABILITIES)[number];
@@ -1 +1 @@
1
- export const ENGINE_CAPABILITIES = Object.freeze(["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state"]);
1
+ export const ENGINE_CAPABILITIES = Object.freeze(["inherit_env.own_credentials_withheld", "inherit_env.own_credential_values_withheld", "mods.skill_seat", "user_attachments.read_state", "task.wake"]);