@sema-agent/core 7.48.0 → 7.49.1

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 (421) hide show
  1. package/CHANGELOG.md +457 -0
  2. package/README.md +2 -2
  3. package/dist/agents/cascade.d.ts +2 -5
  4. package/dist/agents/child-failure.d.ts +20 -0
  5. package/dist/agents/child-failure.js +28 -0
  6. package/dist/agents/cross-session-ref.d.ts +11 -3
  7. package/dist/agents/cross-session-ref.js +6 -0
  8. package/dist/agents/cumulative-stats.d.ts +12 -15
  9. package/dist/agents/cumulative-stats.js +1 -1
  10. package/dist/agents/extra-tool-names.js +1 -1
  11. package/dist/agents/inherited-tool-pool.d.ts +17 -13
  12. package/dist/agents/inherited-tool-pool.js +4 -3
  13. package/dist/agents/peer-session-drain.d.ts +3 -2
  14. package/dist/agents/peer-session-drain.js +5 -4
  15. package/dist/agents/send-message-tool.js +2 -9
  16. package/dist/agents/subagent.d.ts +10 -29
  17. package/dist/agents/subagent.js +65 -53
  18. package/dist/agents/suspend-guard.d.ts +1 -1
  19. package/dist/agents/tool-filter.d.ts +76 -65
  20. package/dist/agents/tool-filter.js +122 -92
  21. package/dist/agents/verify.d.ts +4 -7
  22. package/dist/agents/verify.js +6 -7
  23. package/dist/bench/metrics.d.ts +1 -2
  24. package/dist/brain/anthropic.js +133 -79
  25. package/dist/brain/errors.d.ts +53 -6
  26. package/dist/brain/errors.js +22 -2
  27. package/dist/brain/input-too-long.d.ts +40 -19
  28. package/dist/brain/input-too-long.js +3 -16
  29. package/dist/brain/open-responses.js +19 -10
  30. package/dist/brain/openai.js +123 -32
  31. package/dist/brain/provider-dialect.d.ts +214 -0
  32. package/dist/brain/provider-dialect.js +186 -0
  33. package/dist/brain/request-params.d.ts +27 -8
  34. package/dist/brain/request-params.js +7 -12
  35. package/dist/brain/request-route.d.ts +84 -0
  36. package/dist/brain/request-route.js +41 -0
  37. package/dist/brain/retry.d.ts +8 -0
  38. package/dist/brain/retry.js +10 -4
  39. package/dist/brain/route-adjudicator.d.ts +7 -0
  40. package/dist/brain/route-adjudicator.js +5 -1
  41. package/dist/brain/status-sink.d.ts +20 -0
  42. package/dist/brain/status-sink.js +11 -0
  43. package/dist/brain/stream-engine.d.ts +52 -1
  44. package/dist/brain/stream-engine.js +81 -24
  45. package/dist/brain/stream-shared.d.ts +57 -11
  46. package/dist/brain/stream-shared.js +28 -2
  47. package/dist/core/a2a.d.ts +1 -0
  48. package/dist/core/agent-config-dir.js +3 -2
  49. package/dist/core/allow-entry.d.ts +21 -12
  50. package/dist/core/allow-entry.js +38 -31
  51. package/dist/core/arg-summary.d.ts +21 -28
  52. package/dist/core/arg-summary.js +235 -88
  53. package/dist/core/ask-origin.d.ts +42 -24
  54. package/dist/core/ask-origin.js +18 -13
  55. package/dist/core/auto-mode-prompt-assets.d.ts +2 -2
  56. package/dist/core/auto-mode-prompt-assets.js +1 -1
  57. package/dist/core/auto-mode-prompt.d.ts +11 -1
  58. package/dist/core/auto-mode-prompt.js +13 -10
  59. package/dist/core/auto-mode-rebuild.d.ts +7 -0
  60. package/dist/core/auto-mode-rebuild.js +4 -1
  61. package/dist/core/canonical-json.d.ts +3 -0
  62. package/dist/core/canonical-json.js +2 -1
  63. package/dist/core/checkpoint-requirements.d.ts +892 -0
  64. package/dist/core/checkpoint-requirements.js +333 -0
  65. package/dist/core/checkpoint-store.d.ts +94 -65
  66. package/dist/core/checkpoint-store.js +14 -26
  67. package/dist/core/child-clamp-seats.d.ts +228 -69
  68. package/dist/core/child-clamp-seats.js +211 -17
  69. package/dist/core/classifier-unavailable-arm.d.ts +5 -1
  70. package/dist/core/classifier-unavailable-arm.js +3 -3
  71. package/dist/core/compliance.d.ts +3 -0
  72. package/dist/core/compliance.js +9 -4
  73. package/dist/core/credential-vocabulary.d.ts +140 -0
  74. package/dist/core/credential-vocabulary.js +131 -0
  75. package/dist/core/decision-receipt.js +1 -1
  76. package/dist/core/effective-path-target.d.ts +73 -16
  77. package/dist/core/effective-path-target.js +63 -33
  78. package/dist/core/engine-notice.d.ts +43 -11
  79. package/dist/core/file-history-store.js +2 -2
  80. package/dist/core/fs-write-gate-policy.d.ts +4 -0
  81. package/dist/core/fs-write-gate-policy.js +22 -5
  82. package/dist/core/gate-bounded-await.d.ts +28 -13
  83. package/dist/core/gate-bounded-await.js +41 -4
  84. package/dist/core/gate-fold.d.ts +1 -1
  85. package/dist/core/gate-fold.js +24 -25
  86. package/dist/core/gate-lanes.js +16 -15
  87. package/dist/core/gate-outcome.d.ts +20 -5
  88. package/dist/core/gate-outcome.js +5 -0
  89. package/dist/core/governance-codes.d.ts +11 -4
  90. package/dist/core/governance-codes.js +14 -3
  91. package/dist/core/hooks.d.ts +21 -0
  92. package/dist/core/locked-config.d.ts +8 -0
  93. package/dist/core/locked-config.js +14 -2
  94. package/dist/core/lsp.js +3 -5
  95. package/dist/core/mailbox-store.d.ts +3 -4
  96. package/dist/core/mcp-connection-pool.d.ts +75 -0
  97. package/dist/core/mcp-connection-pool.js +128 -0
  98. package/dist/core/mcp-failure.d.ts +2 -1
  99. package/dist/core/mcp-failure.js +13 -2
  100. package/dist/core/mcp.d.ts +4 -0
  101. package/dist/core/mcp.js +70 -43
  102. package/dist/core/memory-engine/content-origin.js +2 -14
  103. package/dist/core/memory-engine/engine.d.ts +32 -22
  104. package/dist/core/memory-engine/engine.js +103 -55
  105. package/dist/core/memory-engine/file-backend.d.ts +13 -30
  106. package/dist/core/memory-engine/file-backend.js +37 -252
  107. package/dist/core/memory-engine/index.d.ts +1 -1
  108. package/dist/core/memory-engine/index.js +1 -1
  109. package/dist/core/memory-engine/layout.d.ts +139 -9
  110. package/dist/core/memory-engine/layout.js +350 -7
  111. package/dist/core/memory-engine/scope-contract.d.ts +10 -0
  112. package/dist/core/memory-engine/scope-contract.js +8 -0
  113. package/dist/core/memory-engine/session-incarnation.d.ts +14 -4
  114. package/dist/core/memory-engine/session-incarnation.js +5 -2
  115. package/dist/core/memory-engine/types.d.ts +10 -1
  116. package/dist/core/memory.js +5 -17
  117. package/dist/core/model-seat.d.ts +4 -4
  118. package/dist/core/model-seat.js +1 -1
  119. package/dist/core/mounted-mcp.d.ts +57 -0
  120. package/dist/core/mounted-mcp.js +19 -0
  121. package/dist/core/namespaced-rule-name.d.ts +29 -0
  122. package/dist/core/namespaced-rule-name.js +52 -0
  123. package/dist/core/park-selfcheck.d.ts +1 -1
  124. package/dist/core/park-selfcheck.js +16 -6
  125. package/dist/core/path-guard-rows.d.ts +99 -0
  126. package/dist/core/path-guard-rows.js +45 -0
  127. package/dist/core/path-identity.d.ts +22 -16
  128. package/dist/core/path-identity.js +10 -10
  129. package/dist/core/path-rule-binding.d.ts +2 -1
  130. package/dist/core/path-rule-binding.js +3 -1
  131. package/dist/core/pause-registry.d.ts +16 -2
  132. package/dist/core/pause-registry.js +6 -0
  133. package/dist/core/permission-rule-consent.js +0 -7
  134. package/dist/core/permission-rule-model.d.ts +68 -24
  135. package/dist/core/permission-rule-model.js +105 -24
  136. package/dist/core/permission-rule-store.js +2 -2
  137. package/dist/core/permission-rules.d.ts +3 -30
  138. package/dist/core/permission-rules.js +4 -54
  139. package/dist/core/read-root-candidate.d.ts +1 -3
  140. package/dist/core/read-root-candidate.js +4 -15
  141. package/dist/core/real-approval.d.ts +4 -3
  142. package/dist/core/retired-keys.d.ts +13 -0
  143. package/dist/core/retired-keys.js +14 -0
  144. package/dist/core/roles.d.ts +2 -3
  145. package/dist/core/roles.js +15 -6
  146. package/dist/core/runner/assemble-result.d.ts +0 -7
  147. package/dist/core/runner/assemble-result.js +19 -31
  148. package/dist/core/runner/caller-roster.d.ts +78 -0
  149. package/dist/core/runner/caller-roster.js +219 -0
  150. package/dist/core/runner/checkpoint-scope.d.ts +16 -16
  151. package/dist/core/runner/checkpoint-scope.js +2 -2
  152. package/dist/core/runner/child-tree.js +2 -2
  153. package/dist/core/runner/contracts.d.ts +68 -35
  154. package/dist/core/runner/decide-continuation.d.ts +51 -3
  155. package/dist/core/runner/decide-continuation.js +76 -21
  156. package/dist/core/runner/denial-limit-arms.d.ts +17 -5
  157. package/dist/core/runner/denial-limit-arms.js +11 -9
  158. package/dist/core/runner/extra-body-dropped-seat.d.ts +8 -0
  159. package/dist/core/runner/extra-body-dropped-seat.js +22 -0
  160. package/dist/core/runner/finish-reason-seat.d.ts +9 -0
  161. package/dist/core/runner/finish-reason-seat.js +40 -0
  162. package/dist/core/runner/gate-exit.d.ts +44 -32
  163. package/dist/core/runner/gate-exit.js +112 -25
  164. package/dist/core/runner/inherited-ask-grants.js +6 -4
  165. package/dist/core/runner/mcp-redial.d.ts +3 -3
  166. package/dist/core/runner/mcp-redial.js +3 -4
  167. package/dist/core/runner/permission-rule-lanes.d.ts +1 -2
  168. package/dist/core/runner/permission-rule-lanes.js +5 -4
  169. package/dist/core/runner/prepare-artifact.d.ts +4 -0
  170. package/dist/core/runner/prepare-artifact.js +2 -1
  171. package/dist/core/runner/prepare-ask-lane.d.ts +2 -0
  172. package/dist/core/runner/prepare-ask-lane.js +12 -6
  173. package/dist/core/runner/prepare-boundary-parks.d.ts +5 -8
  174. package/dist/core/runner/prepare-boundary-parks.js +4 -7
  175. package/dist/core/runner/prepare-caps-and-workflow.d.ts +11 -15
  176. package/dist/core/runner/prepare-caps-and-workflow.js +19 -27
  177. package/dist/core/runner/prepare-config-doors.d.ts +9 -9
  178. package/dist/core/runner/prepare-config-doors.js +10 -5
  179. package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
  180. package/dist/core/runner/prepare-defer-classify.js +5 -3
  181. package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
  182. package/dist/core/runner/prepare-delegation-surface.js +3 -3
  183. package/dist/core/runner/prepare-gate-stations.d.ts +4 -4
  184. package/dist/core/runner/prepare-gate-stations.js +9 -7
  185. package/dist/core/runner/prepare-hands-readface.d.ts +7 -7
  186. package/dist/core/runner/prepare-hands-readface.js +7 -7
  187. package/dist/core/runner/prepare-inherited-gate.d.ts +7 -6
  188. package/dist/core/runner/prepare-inherited-gate.js +14 -15
  189. package/dist/core/runner/prepare-listings.d.ts +7 -24
  190. package/dist/core/runner/prepare-listings.js +4 -5
  191. package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -0
  192. package/dist/core/runner/prepare-memory-engine-session.js +4 -3
  193. package/dist/core/runner/prepare-memory.d.ts +6 -0
  194. package/dist/core/runner/prepare-memory.js +13 -13
  195. package/dist/core/runner/prepare-offload-wrappers.d.ts +5 -0
  196. package/dist/core/runner/prepare-offload-wrappers.js +3 -3
  197. package/dist/core/runner/prepare-park-ask.d.ts +7 -8
  198. package/dist/core/runner/prepare-park-ask.js +17 -10
  199. package/dist/core/runner/prepare-policy-chain.js +24 -44
  200. package/dist/core/runner/prepare-project-context.d.ts +1 -1
  201. package/dist/core/runner/prepare-project-context.js +3 -4
  202. package/dist/core/runner/prepare-protocol-tools.d.ts +9 -3
  203. package/dist/core/runner/prepare-protocol-tools.js +3 -4
  204. package/dist/core/runner/prepare-run-refs.d.ts +3 -0
  205. package/dist/core/runner/prepare-run-refs.js +2 -1
  206. package/dist/core/runner/prepare-safety-scan.d.ts +4 -8
  207. package/dist/core/runner/prepare-safety-scan.js +1 -2
  208. package/dist/core/runner/prepare-suspend-saga.d.ts +7 -1
  209. package/dist/core/runner/prepare-suspend-saga.js +28 -12
  210. package/dist/core/runner/prepare-task.d.ts +1 -1
  211. package/dist/core/runner/prepare-task.js +67 -56
  212. package/dist/core/runner/prepare-wiring-manifest.d.ts +11 -10
  213. package/dist/core/runner/prepare-wiring-manifest.js +5 -8
  214. package/dist/core/runner/resume-apply.js +7 -14
  215. package/dist/core/runner/resume-checkpoint-screen.js +11 -4
  216. package/dist/core/runner/resume-internals-and-config.js +2 -2
  217. package/dist/core/runner/resume-policy-outcome.js +5 -32
  218. package/dist/core/runner/resume-review-outcome.js +4 -1
  219. package/dist/core/runner/retired-runner-deps.d.ts +6 -0
  220. package/dist/core/runner/retired-runner-deps.js +10 -1
  221. package/dist/core/runner/run-brain-sinks.d.ts +4 -0
  222. package/dist/core/runner/run-brain-sinks.js +5 -2
  223. package/dist/core/runner/run-harness-handlers.js +29 -36
  224. package/dist/core/runner/run-leg.d.ts +0 -2
  225. package/dist/core/runner/run-leg.js +32 -33
  226. package/dist/core/runner/run-terminal-adoption.js +4 -3
  227. package/dist/core/runner/runtask.js +8 -8
  228. package/dist/core/runner/session-rule-policy.js +5 -5
  229. package/dist/core/runner/stream-settle-backstop.js +7 -4
  230. package/dist/core/runner/sub-agent-deny-lists.d.ts +51 -12
  231. package/dist/core/runner/sub-agent-deny-lists.js +111 -80
  232. package/dist/core/runner/terminal-account.d.ts +48 -0
  233. package/dist/core/runner/terminal-account.js +186 -0
  234. package/dist/core/runner/tool-end-body.d.ts +54 -17
  235. package/dist/core/runner/tool-end-body.js +27 -2
  236. package/dist/core/runner/tool-face-overlay.d.ts +3 -1
  237. package/dist/core/runner/tool-face-overlay.js +6 -4
  238. package/dist/core/runner/tool-occurrence.d.ts +106 -0
  239. package/dist/core/runner/tool-occurrence.js +123 -0
  240. package/dist/core/runner/tool-progress-lane.d.ts +16 -8
  241. package/dist/core/runner/tool-progress-lane.js +25 -34
  242. package/dist/core/runner/tool-turn-repair-seat.d.ts +28 -4
  243. package/dist/core/runner/tool-turn-repair-seat.js +36 -13
  244. package/dist/core/runner/turn-attachments.d.ts +1 -1
  245. package/dist/core/runner/write-protection-station.d.ts +21 -9
  246. package/dist/core/runner/write-protection-station.js +20 -17
  247. package/dist/core/runner-deps.d.ts +12 -22
  248. package/dist/core/secret-env.d.ts +16 -5
  249. package/dist/core/secret-env.js +23 -63
  250. package/dist/core/sensitive-path-policy.d.ts +19 -18
  251. package/dist/core/sensitive-path-policy.js +73 -49
  252. package/dist/core/session-reconcile.d.ts +3 -0
  253. package/dist/core/session-reconcile.js +5 -4
  254. package/dist/core/session-store.d.ts +5 -0
  255. package/dist/core/session-store.js +12 -0
  256. package/dist/core/session.d.ts +13 -0
  257. package/dist/core/shared-memory/normalize.d.ts +17 -4
  258. package/dist/core/shared-memory/normalize.js +7 -7
  259. package/dist/core/shell-lexer.js +5 -4
  260. package/dist/core/shell-wrapper-projection.js +1 -1
  261. package/dist/core/skill-grant.js +1 -1
  262. package/dist/core/store-contracts/checkpoint-store-contract.js +13 -0
  263. package/dist/core/store-contracts/mailbox-store-contract.d.ts +7 -14
  264. package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +27 -0
  265. package/dist/core/store-contracts/session-store-incarnation-contract.js +92 -0
  266. package/dist/core/stub-env.d.ts +2 -0
  267. package/dist/core/stub-env.js +1 -0
  268. package/dist/core/synthetic-read-verdict.js +2 -2
  269. package/dist/core/task-event.d.ts +59 -5
  270. package/dist/core/task-result.d.ts +1 -1
  271. package/dist/core/task-spec.d.ts +42 -9
  272. package/dist/core/terminal-cause.d.ts +94 -11
  273. package/dist/core/tighten-task-spec.d.ts +5 -4
  274. package/dist/core/tighten-task-spec.js +20 -25
  275. package/dist/core/tool-catalog-entries.d.ts +5 -7
  276. package/dist/core/tool-catalog-entries.js +14 -15
  277. package/dist/core/tool-face.d.ts +47 -0
  278. package/dist/core/tool-face.js +5 -0
  279. package/dist/core/tool-model-gate.d.ts +5 -5
  280. package/dist/core/tool-name-aliases.d.ts +26 -2
  281. package/dist/core/tool-name-aliases.js +13 -0
  282. package/dist/core/tool-name-list.d.ts +30 -0
  283. package/dist/core/tool-name-list.js +55 -0
  284. package/dist/core/tool-name-readings.d.ts +1 -9
  285. package/dist/core/tool-name-readings.js +1 -3
  286. package/dist/core/tool-policy.d.ts +195 -85
  287. package/dist/core/tool-policy.js +165 -380
  288. package/dist/core/tool-registry.d.ts +44 -1
  289. package/dist/core/tool-registry.js +26 -0
  290. package/dist/core/tool-roster.d.ts +19 -1
  291. package/dist/core/tool-roster.js +21 -2
  292. package/dist/core/tool-spec-members.d.ts +45 -0
  293. package/dist/core/tool-spec-members.js +169 -0
  294. package/dist/core/tool-spec.d.ts +46 -8
  295. package/dist/core/tools.d.ts +6 -2
  296. package/dist/core/tools.js +8 -4
  297. package/dist/core/untrusted-egress.js +29 -26
  298. package/dist/core/untrusted-text.d.ts +13 -10
  299. package/dist/core/untrusted-text.js +6 -44
  300. package/dist/core/workflow-journal-store.d.ts +4 -1
  301. package/dist/core/write-protect.d.ts +65 -29
  302. package/dist/core/write-protect.js +235 -177
  303. package/dist/engine/compaction/compaction.d.ts +2 -2
  304. package/dist/engine/execution-env/node-execution-env.d.ts +5 -23
  305. package/dist/engine/execution-env/node-execution-env.js +16 -38
  306. package/dist/engine/execution-env/symlink-chain.d.ts +23 -0
  307. package/dist/engine/execution-env/symlink-chain.js +32 -0
  308. package/dist/engine/harness/types.d.ts +7 -0
  309. package/dist/engine/llm/tool-turns.d.ts +3 -0
  310. package/dist/engine/llm/tool-turns.js +1 -0
  311. package/dist/engine/llm/types.d.ts +59 -23
  312. package/dist/engine/loop/agent-loop.js +16 -2
  313. package/dist/engine/session/memory-repo.js +11 -3
  314. package/dist/engine/session/repo-utils.d.ts +8 -0
  315. package/dist/engine/session/repo-utils.js +13 -0
  316. package/dist/index.d.ts +20 -23
  317. package/dist/index.js +17 -20
  318. package/dist/internal/harness.d.ts +1 -1
  319. package/dist/internal/harness.js +1 -1
  320. package/dist/internal/llm.d.ts +2 -2
  321. package/dist/internal/llm.js +1 -1
  322. package/dist/orchestration/governance-baseline-validity.js +1 -1
  323. package/dist/orchestration/run-spec.js +3 -3
  324. package/dist/orchestration/run-workflow-tool.d.ts +16 -35
  325. package/dist/orchestration/run-workflow-tool.js +38 -78
  326. package/dist/orchestration/workflow-governance.d.ts +21 -25
  327. package/dist/orchestration/workflow-governance.js +38 -78
  328. package/dist/orchestration/workflow-primitives.d.ts +7 -22
  329. package/dist/orchestration/workflow-primitives.js +5 -12
  330. package/dist/orchestration/workflow-types.d.ts +1 -1
  331. package/dist/orchestration/workflow.d.ts +61 -11
  332. package/dist/orchestration/workflow.js +189 -117
  333. package/dist/scenarios/full-body.d.ts +1 -1
  334. package/dist/shell/lex.d.ts +0 -21
  335. package/dist/shell/lex.js +250 -68
  336. package/dist/shell/shell-words.d.ts +35 -0
  337. package/dist/shell/shell-words.js +65 -0
  338. package/dist/stores/file/checkpoint-store.d.ts +5 -5
  339. package/dist/stores/file/checkpoint-store.js +5 -2
  340. package/dist/stores/file/index.d.ts +0 -8
  341. package/dist/stores/file/index.js +0 -12
  342. package/dist/stores/file/session-store.d.ts +3 -0
  343. package/dist/stores/file/session-store.js +44 -19
  344. package/dist/tools/artifact/artifact-tool.js +2 -0
  345. package/dist/tools/fs/bash-program-position.d.ts +12 -4
  346. package/dist/tools/fs/bash-program-position.js +32 -9
  347. package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
  348. package/dist/tools/fs/bash-readonly-classifier.js +8 -7
  349. package/dist/tools/fs/containment-face.d.ts +4 -0
  350. package/dist/tools/fs/containment-face.js +3 -0
  351. package/dist/tools/fs/fs-shared.d.ts +10 -0
  352. package/dist/tools/fs/fs-shared.js +18 -0
  353. package/dist/tools/fs/fs-write.js +4 -2
  354. package/dist/tools/fs/index.d.ts +1 -1
  355. package/dist/tools/fs/program-read-model.d.ts +46 -20
  356. package/dist/tools/fs/program-read-model.js +50 -20
  357. package/dist/tools/fs/program-read-model.rows.d.ts +0 -14
  358. package/dist/tools/fs/program-read-model.rows.js +16 -15
  359. package/dist/tools/fs/read-deny-home.d.ts +33 -47
  360. package/dist/tools/fs/read-deny-home.js +35 -49
  361. package/dist/tools/fs/read-deny.d.ts +23 -22
  362. package/dist/tools/fs/read-deny.js +114 -89
  363. package/dist/tools/fs/removal-targets.d.ts +56 -23
  364. package/dist/tools/fs/removal-targets.js +65 -87
  365. package/dist/tools/fs/safety.d.ts +29 -22
  366. package/dist/tools/fs/safety.js +17 -11
  367. package/dist/tools/fs/search.js +10 -8
  368. package/dist/tools/fs/shell-read-argv.js +1 -1
  369. package/dist/tools/fs/shell-read-bindings.d.ts +169 -37
  370. package/dist/tools/fs/shell-read-bindings.js +324 -86
  371. package/dist/tools/fs/shell-read-builtins.d.ts +35 -0
  372. package/dist/tools/fs/shell-read-builtins.js +43 -0
  373. package/dist/tools/fs/shell-read-check.d.ts +15 -1
  374. package/dist/tools/fs/shell-read-check.js +67 -43
  375. package/dist/tools/fs/shell-read-establish.js +6 -6
  376. package/dist/tools/fs/shell-read-functions.d.ts +22 -0
  377. package/dist/tools/fs/shell-read-functions.js +29 -0
  378. package/dist/tools/fs/shell-read-judge.d.ts +51 -18
  379. package/dist/tools/fs/shell-read-judge.js +40 -4
  380. package/dist/tools/fs/shell-read-plan.d.ts +12 -6
  381. package/dist/tools/fs/shell-read-plan.js +118 -113
  382. package/dist/tools/fs/shell-read-start.d.ts +29 -6
  383. package/dist/tools/fs/shell-read-start.js +16 -9
  384. package/dist/tools/fs/shell-read-word.js +4 -0
  385. package/dist/tools/fs/shell-read-workdir.d.ts +156 -0
  386. package/dist/tools/fs/shell-read-workdir.js +281 -0
  387. package/dist/tools/fs/shell-read-write-targets.d.ts +5 -2
  388. package/dist/tools/fs/shell-read-write-targets.js +14 -5
  389. package/dist/tools/fs/shell-reentry-text.d.ts +4 -6
  390. package/dist/tools/fs/shell-reentry-text.js +3 -11
  391. package/dist/tools/task-list.d.ts +1 -2
  392. package/dist/tools/web.js +1 -1
  393. package/package.json +4 -1
  394. package/test/export-surface.snapshot.json +107 -143
  395. package/wire-changes/core@7.49.0.json +4765 -0
  396. package/dist/agents/teacher.d.ts +0 -159
  397. package/dist/agents/teacher.js +0 -577
  398. package/dist/agents/team.d.ts +0 -226
  399. package/dist/agents/team.js +0 -257
  400. package/dist/core/strategy-store.d.ts +0 -238
  401. package/dist/core/strategy-store.js +0 -253
  402. package/dist/orchestration/builtin-workflows.d.ts +0 -133
  403. package/dist/orchestration/builtin-workflows.js +0 -159
  404. package/dist/scenarios/env.d.ts +0 -40
  405. package/dist/scenarios/env.js +0 -39
  406. package/dist/scenarios/scenario-registry.d.ts +0 -110
  407. package/dist/scenarios/scenario-registry.js +0 -140
  408. package/dist/scenarios/teacher-quickstart.d.ts +0 -40
  409. package/dist/scenarios/teacher-quickstart.js +0 -12
  410. package/dist/stores/cc/lockfile.d.ts +0 -10
  411. package/dist/stores/cc/lockfile.js +0 -98
  412. package/dist/stores/cc/mailbox-store.d.ts +0 -20
  413. package/dist/stores/cc/mailbox-store.js +0 -255
  414. package/dist/stores/cc/roster-adapter.d.ts +0 -12
  415. package/dist/stores/cc/roster-adapter.js +0 -117
  416. package/dist/stores/cc/sidecar-transcript.d.ts +0 -97
  417. package/dist/stores/cc/sidecar-transcript.js +0 -264
  418. package/dist/stores/cc/task-list-store.d.ts +0 -2
  419. package/dist/stores/cc/task-list-store.js +0 -125
  420. package/dist/stores/file/strategy-store.d.ts +0 -97
  421. package/dist/stores/file/strategy-store.js +0 -341
@@ -1,9 +1,9 @@
1
- import type { GateOutcome, HostDecider } from "./gate-outcome.js";
1
+ import type { GateOutcome, HostDecisionFacts } from "./gate-outcome.js";
2
2
  import { type ExecutionOutcomeRecordWord } from "./checkpoint-execution-record.js";
3
3
  import type { CheckpointPause } from "./pause-registry.js";
4
4
  import type { SystemInjectionPriority } from "./task-notification.js";
5
5
  import { type SteerReplayFacet } from "./steer-replay.js";
6
- import { type QuestionAnswer } from "./ask-question.js";
6
+ import type { QuestionAnswer } from "./ask-question.js";
7
7
  import type { ReadEntry } from "../tools/fs/safety.js";
8
8
  import type { RepairBundle } from "../agents/repair-loop.js";
9
9
  import type { WorkspaceHandle } from "./remote-env.js";
@@ -450,11 +450,16 @@ export declare function realApprovalOrgFact(bit: RealApprovalGateBit | undefined
450
450
  export type CheckpointGate =
451
451
  /** F4: a human (or any external authority) must allow/deny a pending tool call. design/80 §D-E:
452
452
  * carries an OPTIONAL display-only {@link RiskDescriptor} (severity/axes/summary) for the supervisor
453
- * inbox to triage by — INERT (core never reads it to gate/budget). */
453
+ * inbox to triage by — INERT (core never reads it to gate/budget).
454
+ * Both approval arms carry `approvalCard`: which card the pending call renders under (the call's face's card,
455
+ * copied at the park). It is also the row's question mark — `"question"` is the reserved question tool, whose
456
+ * deadline voids it instead of denying it (`facetOf`). Absent on a row parked before the member (read as no
457
+ * card, never as a question) and on a call that carried no face. */
454
458
  {
455
459
  kind: "human";
456
460
  reason: string;
457
461
  toolName: string;
462
+ approvalCard?: import("./tool-face.js").ToolApprovalCard;
458
463
  riskDescriptor?: RiskDescriptor;
459
464
  }
460
465
  /** design/77 §4 (Gate 4) + design/80 D-2: a PRE-ACTION human approval before a SAFETY-tightened tool runs —
@@ -471,6 +476,7 @@ export type CheckpointGate =
471
476
  kind: "irreversible_ask";
472
477
  reason: string;
473
478
  toolName: string;
479
+ approvalCard?: import("./tool-face.js").ToolApprovalCard;
474
480
  safetyAxis?: SafetyAxis;
475
481
  realApproval?: RealApprovalGateBit;
476
482
  riskDescriptor?: RiskDescriptor;
@@ -624,10 +630,7 @@ export type ResumeOutcome = {
624
630
  * `env_failed` replay must reproduce exactly, and who reported a settlement is not part of that
625
631
  * authorization; a replay states its own facts.
626
632
  */
627
- hostDecision: {
628
- decidedBy: HostDecider;
629
- approver?: string;
630
- };
633
+ hostDecision: HostDecisionFacts;
631
634
  /**
632
635
  * CORE-MINTED, on the persisted twin only: the settlement record this decide produced. Present on
633
636
  * the row's `resolvedOutcome` after the resolve, and on the `tool_end` frame of the resolved call.
@@ -658,8 +661,8 @@ export type ResumeOutcome = {
658
661
  * proposed PLAN. `decision:"approve"` → proceed with the plan as-is; `decision:"edit"` → proceed with the
659
662
  * human's `editedPlan` (a TYPED sibling of the plan — NEVER a raw tool `updatedInput`; a plan is not a tool
660
663
  * arg, so this binds NO action and never enters the `policy_ask` boundCallId/boundInputHash machinery);
661
- * `decision:"reject"` → the model RE-PLANS (the rejected plan is discarded; a `reason` may steer the
662
- * re-plan). Kept DISJOINT from `policy_ask` (approval) AND `dry_run_review` (post-prediction review) so the
664
+ * `decision:"reject"` → the plan is discarded; a PERSON's refusal stops the model to wait for the user (a `reason` is their direction, fenced; with none the wait stands), a deployment POLICY's is attributed and the model re-plans.
665
+ * Kept DISJOINT from `policy_ask` (approval) AND `dry_run_review` (post-prediction review) so the
663
666
  * resume-side discriminant never confuses the three (the `plan_review`/`plan_review` gateMatch arm). It
664
667
  * binds no TOOL CALL, but since RB-64 it does record a winner: `winnerFromOutcome` returns the decision
665
668
  * (plus `editedPlan` as `updatedInput` and the reviewer `reason`) under the synthetic `gate:plan_review`
@@ -671,6 +674,11 @@ export type ResumeOutcome = {
671
674
  decision: "approve" | "edit" | "reject";
672
675
  editedPlan?: string;
673
676
  reason?: string;
677
+ /** Who ended this wait — the tool-approval arm's member, same shape, closed set, validation and refusals; REQUIRED.
678
+ * `reject` is the refusal direction; `"sla_timeout"` is refused here (a plan pause expires, a sweep never resolves it). */
679
+ hostDecision: HostDecisionFacts;
680
+ /** CORE-MINTED on the persisted twin only (origin `"plan_review"`; a plan pause has no `tool_end`, so the row is its only face); a supplied one is refused pre-CAS. */
681
+ gateOutcome?: import("./gate-outcome.js").GateOutcome;
674
682
  }
675
683
  /** design/144 §3 (message-wake): wake a PARKED (non-gate) checkpoint and drive it to continue — a pure
676
684
  * un-park verb, **NOT a gate decision**: it never allows/denies/approves anything. Governance-gate
@@ -1331,6 +1339,22 @@ export interface CheckpointState {
1331
1339
  * {@link placementRootSessionId} above and owned by the same version-lattice ticket).
1332
1340
  */
1333
1341
  externalContentTarget?: true;
1342
+ /** The scope this LEG's rows land in (its prepare's one `checkpointScopeOf` reading), stamped at every mint: a resume
1343
+ * that hands no live seat restores it, so the resume config cannot move the leg's next row. Not {@link Checkpoint.scope}
1344
+ * (where THIS row is filed — a resource slice's own declared scope). Absent ⇒ minted before the member: derived as before. */
1345
+ legScope?: string;
1346
+ /** The tool-selector layers this LEG was spawned under (`RunInternals.toolCeiling`), stamped at every mint: a resume that hands
1347
+ * no live ceiling restores it, so a resumed child can never use a tool its spawning run could not. Absent ⇒ the leg had no
1348
+ * ceiling (a root run) or the row was minted before the member. A reader that lacks the word would run the leg unbounded. */
1349
+ toolCeiling?: ReadonlyArray<{
1350
+ readonly allow?: readonly string[];
1351
+ readonly deny: readonly string[];
1352
+ }>;
1353
+ /** The evidence that the run that spawned this LEG judged its own tool lists (`RunInternals.toolListsJudged`: the digest of exactly
1354
+ * those lists), stamped at every mint while it holds: a resume that hands no internals and the same lists keeps the judgment, one
1355
+ * that hands different lists is judged again. Absent ⇒ the leg judged its own lists (or the row was minted before the member). A
1356
+ * reader that lacks the word would judge again a list judged against a wider universe, and refuse a leg that was valid. */
1357
+ toolListsJudged?: string;
1334
1358
  }
1335
1359
  /**
1336
1360
  * {@link CheckpointState} with **every** field made required-PRESENT, while each value keeps its original
@@ -1346,20 +1370,16 @@ export type SerializedCheckpointState = {
1346
1370
  [K in keyof Required<CheckpointState>]: CheckpointState[K];
1347
1371
  };
1348
1372
  /**
1349
- * The checkpoint FEATURE TABLE — one row per feature that ever raised the row format. A row carries the
1350
- * feature's schema version, the persisted mark by which a reader tells the feature was written on a row
1351
- * (`recordedOn`, the READ face), and what a mint owes when the feature is present (`writes`, the WRITE
1352
- * face — the two faces are deliberately separate columns). Minting is derived from the rows
1353
- * ({@link checkpointVersionFor}: the highest version among the features present), the per-feature
1354
- * constants below ARE the rows' versions, and the resume screen reads the rows — so adding a feature is
1355
- * one row here plus an explicit answer at each mint site (the presence record's keys are mandatory).
1373
+ * The checkpoint FEATURE TABLE — one row per feature that ever raised the row format: its schema version, and
1374
+ * what a mint owed when the feature was present (`writes`, prose). The per-feature constants below ARE the rows'
1375
+ * versions. The table is CLOSED at `requirements` (v10): every live mint stamps 10 and lists the row's
1376
+ * reader-requirement words beside it (`Checkpoint.requires`, checkpoint-requirements.ts) — a later segment adds a
1377
+ * word there, never a row here. Each feature key below (but `baseline` / `requirements`) is itself one of those
1378
+ * words, and whether a v10 row carries the feature is read off the row's content by the requirement tables.
1356
1379
  *
1357
- * Because the stamp is a maximum, the version records only the HIGHEST feature on a row; whether a lower
1358
- * feature is present is said by that feature's own mark, never by the number. A resume rule keyed on the
1359
- * version alone is therefore exact to the version at which its feature was the top: `realApproval` is
1360
- * version-recorded at v8 and marker-recorded (`readFace.realApproval`) from v9 on. The same law binds the
1361
- * NEXT feature: once a row can be stamped above v9, "v9+ ⇒ read-face section present" no longer follows
1362
- * from the stamp, and the face needs a mark of its own (or the row a per-feature presence record).
1380
+ * A v≤9 row was stamped the HIGHEST feature it carried, so the number records only the top feature; the resume
1381
+ * rules that read a v≤9 row by number are exact to the version at which their feature was the top
1382
+ * (`realApproval` is version-recorded at v8 and marker-recorded — `readFace.realApproval` — at v9).
1363
1383
  *
1364
1384
  * v4 is a GAP, deliberately: the retired cross-slice wall-clock allocation. This worker still reads v4
1365
1385
  * rows; a ledger carrying the retired axis is refused by FIELD (`walltime_axis_retired`) at any version.
@@ -1370,7 +1390,6 @@ export declare const CHECKPOINT_FEATURES: {
1370
1390
  readonly baseline: {
1371
1391
  readonly version: 1;
1372
1392
  readonly introduced: "design/49";
1373
- readonly recordedOn: (_cp: Checkpoint) => boolean;
1374
1393
  readonly writes: "the row itself";
1375
1394
  };
1376
1395
  /** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction an older worker
@@ -1378,7 +1397,6 @@ export declare const CHECKPOINT_FEATURES: {
1378
1397
  readonly resource: {
1379
1398
  readonly version: 2;
1380
1399
  readonly introduced: "design/74";
1381
- readonly recordedOn: (cp: Checkpoint) => boolean;
1382
1400
  readonly writes: "resourceLedger; gate/pendingAction kind resource_limit";
1383
1401
  };
1384
1402
  /** A HUMAN-DECISION park (tool approval or plan_review) of the binding era: the decision-action binding
@@ -1389,7 +1407,6 @@ export declare const CHECKPOINT_FEATURES: {
1389
1407
  readonly binding: {
1390
1408
  readonly version: 3;
1391
1409
  readonly introduced: "design/80";
1392
- readonly recordedOn: (cp: Checkpoint) => boolean;
1393
1410
  readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only";
1394
1411
  };
1395
1412
  /** A ledger carrying a cross-slice TOKEN allocation: the window clamp and the exhausted-resume fail-fast
@@ -1397,7 +1414,6 @@ export declare const CHECKPOINT_FEATURES: {
1397
1414
  readonly token: {
1398
1415
  readonly version: 5;
1399
1416
  readonly introduced: "design/164";
1400
- readonly recordedOn: (cp: Checkpoint) => boolean;
1401
1417
  readonly writes: "resourceLedger.totalTokens";
1402
1418
  };
1403
1419
  /** Org-memory admission freeze state (the adjudicated-empty record included): the session/delegation
@@ -1405,7 +1421,6 @@ export declare const CHECKPOINT_FEATURES: {
1405
1421
  readonly orgAdmission: {
1406
1422
  readonly version: 6;
1407
1423
  readonly introduced: "org-admission";
1408
- readonly recordedOn: (cp: Checkpoint) => boolean;
1409
1424
  readonly writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned";
1410
1425
  };
1411
1426
  /** The F-012 durable enforcement fields: the frozen ancestor projection chain + its digest (one write, the
@@ -1413,7 +1428,6 @@ export declare const CHECKPOINT_FEATURES: {
1413
1428
  readonly f012: {
1414
1429
  readonly version: 7;
1415
1430
  readonly introduced: "F-012";
1416
- readonly recordedOn: (cp: Checkpoint) => boolean;
1417
1431
  readonly writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance";
1418
1432
  };
1419
1433
  /** A gate carrying {@link RealApprovalGateBit}: the no-org-wiring refusal and the org_unavailable resume
@@ -1422,7 +1436,6 @@ export declare const CHECKPOINT_FEATURES: {
1422
1436
  readonly realApproval: {
1423
1437
  readonly version: 8;
1424
1438
  readonly introduced: "#130/#120";
1425
- readonly recordedOn: (cp: Checkpoint) => boolean;
1426
1439
  readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it";
1427
1440
  };
1428
1441
  /** The READ-face section ({@link CheckpointState.readFace}): resolved face + normalized deny-set additions,
@@ -1431,18 +1444,22 @@ export declare const CHECKPOINT_FEATURES: {
1431
1444
  readonly face: {
1432
1445
  readonly version: 9;
1433
1446
  readonly introduced: "design/199";
1434
- readonly recordedOn: (cp: Checkpoint) => boolean;
1435
1447
  readonly writes: "state.readFace { face, denyEntries? } for a non-default posture; realApproval: true only at the mint whose gate carries the bit (a hands-less re-park never carries the seed's marker forward)";
1436
1448
  };
1449
+ /** The last row: the reader-requirement words ({@link CheckpointRow.requires}). Every live mint stamps it, so a
1450
+ * worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted from here on, `version_newer`, pre-CAS. */
1451
+ readonly requirements: {
1452
+ readonly version: 10;
1453
+ readonly introduced: "#1320";
1454
+ readonly writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)";
1455
+ };
1437
1456
  };
1438
1457
  /** One row of {@link CHECKPOINT_FEATURES}. */
1439
1458
  export interface CheckpointFeatureRow {
1440
1459
  readonly version: number;
1441
1460
  /** Where the feature came from — a design or ticket tag, documentation only. */
1442
1461
  readonly introduced: string;
1443
- /** READ face: true iff the row carries the feature's persisted mark. */
1444
- readonly recordedOn: (cp: Checkpoint) => boolean;
1445
- /** WRITE face: what a mint must write when the feature is present (prose; the mint sites are the code). */
1462
+ /** What a mint wrote when the feature was present (prose; the mint sites are the code). */
1446
1463
  readonly writes: string;
1447
1464
  }
1448
1465
  /** The feature words — the row keys of {@link CHECKPOINT_FEATURES}. */
@@ -1464,17 +1481,10 @@ export declare const F012_CHECKPOINT_VERSION: 7;
1464
1481
  export declare const REAL_APPROVAL_CHECKPOINT_VERSION: 8;
1465
1482
  /** The `face` row's version. */
1466
1483
  export declare const FACE_CHECKPOINT_VERSION: 9;
1467
- /** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table; a higher one
1468
- * is rejected pre-CAS with {@link CheckpointError} `unsupported_version` (the row stays `pending`, retryable on
1469
- * a newer worker). This is the CEILING entrance: the storage-faithfulness probe stamps it directly on a
1470
- * synthetic row that is never resumed, and does not go through feature detection. */
1471
- export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 9;
1472
- /** What a mint site answers for: every row but the baseline, every key MANDATORY — a new row is a compile
1473
- * error at each mint site until that site says whether its rows carry the feature. */
1474
- export type CheckpointFeaturePresence = Record<Exclude<CheckpointFeature, "baseline">, boolean>;
1475
- /** The schema version a mint stamps: the highest version among the features PRESENT on the row, the baseline
1476
- * when none is. One rule for every mint site — the precedence between features is the version numbers. */
1477
- export declare function checkpointVersionFor(presence: CheckpointFeaturePresence): number;
1484
+ /** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table, and the stamp
1485
+ * of every live mint (the table is closed there); a higher one is rejected pre-CAS with {@link CheckpointError}
1486
+ * `unsupported_version` (the row stays `pending`, retryable on a newer worker). */
1487
+ export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 10;
1478
1488
  /**
1479
1489
  * Read a checkpoint's schema version, defaulting an absent field to **legacy `0`** (a 1.67-era checkpoint
1480
1490
  * written before the field existed — it carries no `workspaceHandle`, so resuming it the v1 way is safe).
@@ -1567,7 +1577,7 @@ export interface ResolvedOutcome {
1567
1577
  /** The operator's NOTE, if the decision carried one — the approval lane's deny `reason` and the review
1568
1578
  * lanes' reject `reason` alike. Recorded for the same reason `updatedInput` and `answer` are: the note
1569
1579
  * is the substance of the decision, not a decoration on it. It is the text the resume continuation
1570
- * fences into the model-facing reminder that steers the re-plan, so a replay keeping the verdict and
1580
+ * fences into the model-facing reminder that carries the refusal, so a replay keeping the verdict and
1571
1581
  * swapping the note delivers a different instruction under the same word. Omitted when absent.
1572
1582
  *
1573
1583
  * ADDITIVE and OPTIONAL by contract: rows persisted before this field existed carry no `reason` key,
@@ -1683,14 +1693,19 @@ export interface CheckpointRow {
1683
1693
  * since its introduction; absent ⇒ legacy row (read compatibly, no backfill). */
1684
1694
  checkpointId?: string;
1685
1695
  /**
1686
- * Schema version of this checkpoint (design/49 v1.5). Every live suspend stamps the version of the
1687
- * FEATURE it carries (RESOURCE / BINDING / TOKEN / ORG_ADMISSION); {@link CURRENT_CHECKPOINT_VERSION}
1688
- * is the baseline at the bottom of that ladder, not the stamp of any current mint site.
1689
- * absent ⇒ legacy `0` (1.67-era, no `state.workspaceHandle`). Resume rejects `> MAX_SUPPORTED_CHECKPOINT_VERSION`
1690
- * pre-CAS so an old worker can't silently ignore fields a newer format relies on (forward-compatible by `<=`).
1691
- * Read via {@link checkpointVersionOf}.
1696
+ * Schema version of this checkpoint (design/49 v1.5), FROZEN at the `requirements` row's 10: every live mint
1697
+ * stamps 10 beside {@link requires}, and a segment added later adds a word there, never a number here. A v≤9 row
1698
+ * (stamped the highest feature it carried) is read by the feature table's numbers; absent ⇒ legacy `0`. Resume
1699
+ * rejects `> MAX_SUPPORTED_CHECKPOINT_VERSION` pre-CAS. Read via {@link checkpointVersionOf}.
1692
1700
  */
1693
1701
  version?: number;
1702
+ /** The reader-requirement words of a v10 row: what a resuming worker must know to resume it right, derived from
1703
+ * the row's own content at the mint (`checkpointRequirementsFor`, checkpoint-requirements.ts) — present on every
1704
+ * v10 row (possibly empty), absent below. Typed as plain strings: a newer release's word is a word this one lacks. */
1705
+ requires?: readonly string[];
1706
+ /** The row digest of a v10 row: sha256 over the canonical JSON of every member a decision reads (`requirementsDigestOf`,
1707
+ * checkpoint-requirements.ts) — a lost member, element or changed value is refused `requirements_damaged`. */
1708
+ requirementsDigest?: string;
1694
1709
  /** Multi-tenant isolation key (forced through `resolve`/`reap` WHERE, §2.1 service [4]). */
1695
1710
  scope: string;
1696
1711
  /** The session to resume (via the SessionStore). */
@@ -1912,13 +1927,14 @@ export interface CheckpointSummary {
1912
1927
  /** The pending tool's name ({@link PendingAction} `tool_approval.toolName`) when this is an approval suspend.
1913
1928
  * OMITTED (not `null`) for a non-`tool_approval` pendingAction — see {@link toolCallId}'s absence-shape note. */
1914
1929
  toolName?: string;
1915
- /** design/99 MF-14 (design-review DoR): the DERIVED content-gate classification — `"content_ask"` when this
1916
- * `tool_approval` gates the reserved AskUserQuestion tool (a question TO the user, not a side-effecting tool).
1917
- * A TYPED discriminant so a shell renders the question UI without sniffing `toolName` or parsing the bounded
1918
- * `toolInput` preview. The full typed questions ride the drilled-in Checkpoint's `pendingAction.args` (kept off
1919
- * this lightweight `listByScope` projection). Deliberately NOT a new `content_ask` checkpoint gate kind (that
1920
- * would cross the durable-checkpoint once-only-winner / reaper-deadline / batch invariants — the DoR). */
1921
- contentKind?: "content_ask";
1930
+ /** Which approval card the pending call renders under — the gate's {@link CheckpointGate} `approvalCard` echoed when
1931
+ * it is a member of the closed set `TOOL_APPROVAL_CARDS` (a stored word outside the set is no card). The one typed
1932
+ * discriminant a shell routes on: `"question"` is a question TO the user (the reserved AskUserQuestion tool, whose
1933
+ * typed questions ride the drilled-in Checkpoint's `pendingAction.args`, kept off this lightweight projection), not a
1934
+ * side-effecting tool; the other words pick the card family. Present on an approval suspend (`human` /
1935
+ * `irreversible_ask`) that carries one; OMITTED for a row parked before the member and for every non-approval park —
1936
+ * see {@link toolCallId}'s absence-shape note. */
1937
+ approvalCard?: import("./tool-face.js").ToolApprovalCard;
1922
1938
  /** design S1e: when the checkpoint was created ({@link Checkpoint.createdAt}, epoch ms) —
1923
1939
  * projected so a supervisor inbox can sort/age pending entries (oldest-first triage) in ONE `listByScope`
1924
1940
  * call, no N+1 `getCheckpoint`. ECHO-ONLY display/triage; always present (a Checkpoint always has a
@@ -2055,8 +2071,9 @@ export declare function summarizeCheckpoint(cp: Checkpoint): CheckpointSummary;
2055
2071
  * cannot classify — the registry's mint-obligation leg is what makes the omission loud (every
2056
2072
  * `checkpoint.unsupported_version` construction site must spell one of these words AT the site).
2057
2073
  *
2058
- * · `unsupported_version` arms: `"version_newer"` (the row's format is newer than this worker's —
2059
- * retryable on a newer worker), `"env_factory_missing"` (retryable on a factory-wired worker),
2074
+ * · `unsupported_version` arms: `"version_newer"` (the row's format is newer than this worker's, or it lists a
2075
+ * reader-requirement word this worker lacks — `detail.requires` names those words — retryable on a newer
2076
+ * worker), `"env_factory_missing"` (retryable on a factory-wired worker),
2060
2077
  * `"governed_unwired"` (retryable on an org-wired worker), `"origin_missing"` (a pending approval row
2061
2078
  * minted before the ask's origin was persisted on the park — terminal for the row's bytes; the host
2062
2079
  * decides the orphaned card itself, no worker version redeems it), `"ledger_event_unknown"` (a durable
@@ -2067,7 +2084,7 @@ export declare function summarizeCheckpoint(cp: Checkpoint): CheckpointSummary;
2067
2084
  * steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
2068
2085
  * `inheritedGate`, which an engine at 7.38.x or earlier still reads once).
2069
2086
  * · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
2070
- * `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"` (all terminal for the row's
2087
+ * `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"` (all terminal for the row's
2071
2088
  * current bytes — no worker version redeems a damaged row).
2072
2089
  */
2073
2090
  export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "governed_unwired" | "origin_missing" | "ledger_event_unknown" | "seat_retired" | "real_approval_damaged" | "real_approval_forged" | "read_face_damaged" | "read_face_forged"
@@ -2077,6 +2094,10 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
2077
2094
  | "write_face_damaged" | "skill_grants_damaged" | "constraint_chain_missing"
2078
2095
  /** `state.handsRoot` / `state.handsHome` / `state.handsCwd` is present but not an absolute path (the row's hands' coordinates). */
2079
2096
  | "hands_coordinates_damaged"
2097
+ /** The row's reader-requirement list ({@link CheckpointRow.requires}) is missing on a v10 row, is not a list of words,
2098
+ * is present below v10, or does not equal the words the row's content carries (a segment dropped, or a word not
2099
+ * declared) — terminal for the row's bytes. */
2100
+ | "requirements_damaged"
2080
2101
  /** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
2081
2102
  * no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
2082
2103
  * entry / a record member naming no absolute root. */
@@ -2263,8 +2284,9 @@ export declare class CheckpointError extends Error {
2263
2284
  * re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
2264
2285
  * action: re-review), `"boundGrantDigest"` (a parked `Skill` approval does not cover the skill the decision selects — another skill, or the card's with other lists: deny, re-activate), or `"answer"` (the content-ask answer is missing, or was attached to a
2265
2286
  * decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
2266
- * `"hostDecision"` (the decision facts are missing, name a decider outside `person`/`sla_timeout`/`policy`,
2267
- * pair the sweep's `sla_timeout` with an allow, or try to supply the minted word), or — design/252 G-7 — `"approver"` (the attribution is not a
2287
+ * `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
2288
+ * `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
2289
+ * resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
2268
2290
  * well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
2269
2291
  * it). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
2270
2292
  * (the re-supplied config: correct it and resume the same token) or `"inheritedGate"` (the mode the row
@@ -2288,6 +2310,9 @@ export declare class CheckpointError extends Error {
2288
2310
  * (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
2289
2311
  * is a gate rather than a type: see the closed set's own doc. */
2290
2312
  reason?: CheckpointErrorReason;
2313
+ /** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
2314
+ * (sorted, display only). Absent on every other arm. */
2315
+ requires?: readonly string[];
2291
2316
  /** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
2292
2317
  * {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
2293
2318
  * every other code. The live verb's refusal carries the same value. */
@@ -2461,8 +2486,9 @@ export declare class CheckpointError extends Error {
2461
2486
  * re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
2462
2487
  * action: re-review), `"boundGrantDigest"` (a parked `Skill` approval does not cover the skill the decision selects — another skill, or the card's with other lists: deny, re-activate), or `"answer"` (the content-ask answer is missing, or was attached to a
2463
2488
  * decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
2464
- * `"hostDecision"` (the decision facts are missing, name a decider outside `person`/`sla_timeout`/`policy`,
2465
- * pair the sweep's `sla_timeout` with an allow, or try to supply the minted word), or — design/252 G-7 — `"approver"` (the attribution is not a
2489
+ * `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
2490
+ * `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
2491
+ * resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
2466
2492
  * well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
2467
2493
  * it). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
2468
2494
  * (the re-supplied config: correct it and resume the same token) or `"inheritedGate"` (the mode the row
@@ -2486,6 +2512,9 @@ export declare class CheckpointError extends Error {
2486
2512
  * (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
2487
2513
  * is a gate rather than a type: see the closed set's own doc. */
2488
2514
  reason?: CheckpointErrorReason;
2515
+ /** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
2516
+ * (sorted, display only). Absent on every other arm. */
2517
+ requires?: readonly string[];
2489
2518
  /** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
2490
2519
  * {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
2491
2520
  * every other code. The live verb's refusal carries the same value. */
@@ -9,9 +9,8 @@ import { checkpointExecutionRecorded, executionRecordDisposition, ExecutionOutco
9
9
  import { renderUntrustedCommandText, stripFormatCharacters } from "./permission-rule-model.js";
10
10
  import { redactSecrets } from "./untrusted-egress.js";
11
11
  import { steerReplayRefusal } from "./steer-replay.js";
12
- import { ASK_USER_QUESTION_TOOL_NAME } from "./ask-question.js";
12
+ import { isToolApprovalCard } from "./tool-face.js";
13
13
  import { isPermissionMode } from "./ask-origin.js";
14
- import { wireOf } from "./tool-name-readings.js";
15
14
  export function mintCheckpointToken() {
16
15
  return randomBytes(16).toString("hex");
17
16
  }
@@ -191,19 +190,15 @@ export function realApprovalOrgFact(bit) {
191
190
  return bit.origin === "org_rule" ? "rule" : bit.origin === "org_unavailable" ? "unavailable" : undefined;
192
191
  }
193
192
  export const CHECKPOINT_FEATURES = {
194
- baseline: { version: 1, introduced: "design/49", recordedOn: (_cp) => true, writes: "the row itself" },
195
- resource: { version: 2, introduced: "design/74", recordedOn: (cp) => cp.gate.kind === "resource_limit", writes: "resourceLedger; gate/pendingAction kind resource_limit" },
196
- binding: { version: 3, introduced: "design/80", recordedOn: (cp) => cp.pendingAction.kind === "tool_approval" || cp.pendingAction.kind === "plan_review", writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only" },
197
- token: { version: 5, introduced: "design/164", recordedOn: (cp) => cp.resourceLedger?.totalTokens !== undefined, writes: "resourceLedger.totalTokens" },
198
- orgAdmission: {
199
- version: 6,
200
- introduced: "org-admission",
201
- recordedOn: (cp) => cp.state.inheritedGate?.admittedOrgScopes !== undefined || cp.state.inheritedGate?.ownAdmittedOrgScopes !== undefined || cp.state.inheritedGate?.ownAdmittedOrgWriteScope !== undefined || cp.state.inheritedGate?.orgAdmissionGoverned === true,
202
- writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned",
203
- },
204
- f012: { version: 7, introduced: "F-012", recordedOn: (cp) => cp.state.inheritedGate?.constraintChain !== undefined || cp.state.delegationProvenance !== undefined, writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
205
- realApproval: { version: 8, introduced: "#130/#120", recordedOn: (cp) => cp.gate.kind === "irreversible_ask" && cp.gate.realApproval !== undefined, writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it" },
206
- face: { version: 9, introduced: "design/199", recordedOn: (cp) => cp.state.readFace !== undefined, writes: "state.readFace { face, denyEntries? } for a non-default posture; realApproval: true only at the mint whose gate carries the bit (a hands-less re-park never carries the seed's marker forward)" },
193
+ baseline: { version: 1, introduced: "design/49", writes: "the row itself" },
194
+ resource: { version: 2, introduced: "design/74", writes: "resourceLedger; gate/pendingAction kind resource_limit" },
195
+ binding: { version: 3, introduced: "design/80", writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only" },
196
+ token: { version: 5, introduced: "design/164", writes: "resourceLedger.totalTokens" },
197
+ orgAdmission: { version: 6, introduced: "org-admission", writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned" },
198
+ f012: { version: 7, introduced: "F-012", writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
199
+ realApproval: { version: 8, introduced: "#130/#120", writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it" },
200
+ face: { version: 9, introduced: "design/199", writes: "state.readFace { face, denyEntries? } for a non-default posture; realApproval: true only at the mint whose gate carries the bit (a hands-less re-park never carries the seed's marker forward)" },
201
+ requirements: { version: 10, introduced: "#1320", writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)" },
207
202
  };
208
203
  export const CURRENT_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.baseline.version;
209
204
  export const RESOURCE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.resource.version;
@@ -213,16 +208,7 @@ export const ORG_ADMISSION_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.orgAdmission
213
208
  export const F012_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.f012.version;
214
209
  export const REAL_APPROVAL_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.realApproval.version;
215
210
  export const FACE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.face.version;
216
- export const MAX_SUPPORTED_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.face.version;
217
- export function checkpointVersionFor(presence) {
218
- let version = CHECKPOINT_FEATURES.baseline.version;
219
- for (const feature of Object.keys(CHECKPOINT_FEATURES)) {
220
- const row = CHECKPOINT_FEATURES[feature];
221
- if (presence[feature] === true && row.version > version)
222
- version = row.version;
223
- }
224
- return version;
225
- }
211
+ export const MAX_SUPPORTED_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.requirements.version;
226
212
  export function checkpointVersionOf(cp) {
227
213
  return cp.version ?? 0;
228
214
  }
@@ -264,6 +250,7 @@ export function remainingTokens(ledger) {
264
250
  export function summarizeCheckpoint(cp) {
265
251
  const riskDescriptor = cp.gate.kind === "human" || cp.gate.kind === "irreversible_ask" ? cp.gate.riskDescriptor : undefined;
266
252
  const severity = riskDescriptor !== undefined ? riskSeverity(riskDescriptor.axes) : undefined;
253
+ const gateCard = cp.gate.kind === "human" || cp.gate.kind === "irreversible_ask" ? cp.gate.approvalCard : undefined;
267
254
  const tool = cp.pendingAction.kind === "tool_approval" ? cp.pendingAction : undefined;
268
255
  let toolInput;
269
256
  if (tool !== undefined) {
@@ -293,7 +280,7 @@ export function summarizeCheckpoint(cp) {
293
280
  ...(cp.sourceTaskId !== undefined ? { sourceTaskId: cp.sourceTaskId } : {}),
294
281
  ...(cp.principal !== undefined ? { principal: cp.principal } : {}),
295
282
  ...(tool !== undefined ? { toolCallId: tool.toolCallId, toolName: tool.toolName } : {}),
296
- ...(tool !== undefined && wireOf("park.contentKindProjection", tool) === ASK_USER_QUESTION_TOOL_NAME ? { contentKind: "content_ask" } : {}),
283
+ ...(isToolApprovalCard(gateCard) ? { approvalCard: gateCard } : {}),
297
284
  ...(toolInput !== undefined ? { toolInput } : {}),
298
285
  ...(cp.state.workspaceHandle !== undefined
299
286
  ? { restoreMode: cp.state.workspaceHandle.restoreMode === "park_only" ? "park_only" : "snapshot" }
@@ -441,6 +428,7 @@ export function winnerFromOutcome(outcome) {
441
428
  decision: outcome.decision,
442
429
  ...(editedPlan !== undefined ? { updatedInput: editedPlan } : {}),
443
430
  ...(outcome.reason !== undefined ? { reason: outcome.reason } : {}),
431
+ ...(outcome.gate === "plan_review" && outcome.gateOutcome !== undefined ? { gateOutcome: outcome.gateOutcome } : {}),
444
432
  };
445
433
  }
446
434
  if (outcome.gate !== "policy_ask")