@sema-agent/core 7.70.0 → 7.71.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 (439) hide show
  1. package/CHANGELOG.md +740 -0
  2. package/dist/agents/agent-transcript-tool.js +43 -19
  3. package/dist/agents/inherited-tool-pool.d.ts +5 -1
  4. package/dist/agents/inherited-tool-pool.js +6 -0
  5. package/dist/agents/retain-ledger.js +2 -0
  6. package/dist/agents/send-message-tool.d.ts +12 -1
  7. package/dist/agents/send-message-tool.js +47 -9
  8. package/dist/agents/subagent.js +31 -10
  9. package/dist/agents/tool-filter.js +1 -2
  10. package/dist/agents/verify.js +13 -2
  11. package/dist/agents/yield-adoption.js +11 -1
  12. package/dist/brain/claude-model-id.d.ts +11 -0
  13. package/dist/brain/claude-model-id.js +3 -1
  14. package/dist/config/catalog.js +10 -1
  15. package/dist/config/defaults.d.ts +3 -0
  16. package/dist/config/defaults.js +1 -0
  17. package/dist/core/allow-entry.js +1 -2
  18. package/dist/core/ask-origin.d.ts +55 -21
  19. package/dist/core/ask-origin.js +19 -11
  20. package/dist/core/ask-question.d.ts +4 -7
  21. package/dist/core/ask-question.js +2 -4
  22. package/dist/core/ask-unresolvable-notice.d.ts +17 -3
  23. package/dist/core/ask-unresolvable-notice.js +18 -4
  24. package/dist/core/attachment-source.d.ts +1 -1
  25. package/dist/core/attachment-source.js +2 -0
  26. package/dist/core/auto-compaction.d.ts +14 -4
  27. package/dist/core/auto-compaction.js +3 -2
  28. package/dist/core/auto-strip.js +2 -0
  29. package/dist/core/caller-text.d.ts +2 -33
  30. package/dist/core/caller-text.js +2 -23
  31. package/dist/core/caller-tool-name.js +1 -2
  32. package/dist/core/canonical-json.d.ts +9 -0
  33. package/dist/core/canonical-json.js +6 -0
  34. package/dist/core/checkpoint-features.d.ts +43 -80
  35. package/dist/core/checkpoint-features.js +10 -20
  36. package/dist/core/checkpoint-generation.d.ts +89 -19
  37. package/dist/core/checkpoint-generation.js +89 -14
  38. package/dist/core/checkpoint-queries.d.ts +95 -15
  39. package/dist/core/checkpoint-queries.js +108 -7
  40. package/dist/core/checkpoint-rekey.d.ts +2 -1
  41. package/dist/core/checkpoint-rekey.js +2 -2
  42. package/dist/core/checkpoint-requirements.d.ts +21 -7
  43. package/dist/core/checkpoint-requirements.js +2 -5
  44. package/dist/core/checkpoint-row-verdict.d.ts +3 -4
  45. package/dist/core/checkpoint-row-verdict.js +20 -41
  46. package/dist/core/checkpoint-store.d.ts +69 -41
  47. package/dist/core/checkpoint-store.js +28 -14
  48. package/dist/core/command-sandbox.d.ts +5 -3
  49. package/dist/core/command-sandbox.js +17 -9
  50. package/dist/core/config-refusal-codes.d.ts +1 -1
  51. package/dist/core/config-refusal-codes.js +1 -0
  52. package/dist/core/declaration-words.d.ts +2 -1
  53. package/dist/core/declaration-words.js +13 -2
  54. package/dist/core/effective-path-target.d.ts +23 -0
  55. package/dist/core/effective-path-target.js +15 -1
  56. package/dist/core/engine-attestation.d.ts +5 -1
  57. package/dist/core/engine-attestation.js +1 -0
  58. package/dist/core/engine-capabilities.d.ts +14 -9
  59. package/dist/core/engine-capabilities.js +1 -1
  60. package/dist/core/engine-notice.d.ts +62 -32
  61. package/dist/core/engine-version.js +1 -1
  62. package/dist/core/entries-not-applied.d.ts +1 -1
  63. package/dist/core/entries-not-applied.js +1 -0
  64. package/dist/core/file-history-store.d.ts +95 -11
  65. package/dist/core/file-history-store.js +117 -19
  66. package/dist/core/gate-fold.js +13 -7
  67. package/dist/core/gate-lanes.js +9 -9
  68. package/dist/core/governance-codes.d.ts +56 -7
  69. package/dist/core/governance-codes.js +105 -7
  70. package/dist/core/grant-holder.d.ts +53 -0
  71. package/dist/core/grant-holder.js +80 -0
  72. package/dist/core/hooks.d.ts +7 -3
  73. package/dist/core/hooks.js +2 -2
  74. package/dist/core/locked-config.d.ts +7 -1
  75. package/dist/core/locked-config.js +9 -2
  76. package/dist/core/mcp-call-meta.d.ts +52 -7
  77. package/dist/core/mcp-call-meta.js +21 -2
  78. package/dist/core/mcp-host-read.d.ts +1 -1
  79. package/dist/core/mcp-server-spec.d.ts +18 -0
  80. package/dist/core/mcp-server-spec.js +1 -0
  81. package/dist/core/mcp.js +2 -2
  82. package/dist/core/member-outcome.d.ts +22 -1
  83. package/dist/core/member-outcome.js +18 -6
  84. package/dist/core/memory-engine/delegation-settlement.js +5 -5
  85. package/dist/core/memory-engine/engine.js +19 -19
  86. package/dist/core/memory-engine/file-backend.d.ts +7 -2
  87. package/dist/core/memory-engine/file-backend.js +14 -12
  88. package/dist/core/memory-engine/frontmatter.js +1 -1
  89. package/dist/core/memory-engine/index.d.ts +1 -0
  90. package/dist/core/memory-engine/index.js +1 -0
  91. package/dist/core/memory-engine/layout.d.ts +34 -9
  92. package/dist/core/memory-engine/layout.js +36 -19
  93. package/dist/core/memory-engine/memory-deployment.js +8 -8
  94. package/dist/core/memory-engine/mount-failed-notice.d.ts +8 -5
  95. package/dist/core/memory-engine/mount-failed-notice.js +5 -2
  96. package/dist/core/mode-policy.d.ts +5 -0
  97. package/dist/core/mode-policy.js +6 -0
  98. package/dist/core/mods/host.d.ts +2 -1
  99. package/dist/core/mods/host.js +7 -6
  100. package/dist/core/mods/kernel/index.d.ts +1 -1
  101. package/dist/core/mods/kernel/index.js +1 -1
  102. package/dist/core/mods/kernel/registration.d.ts +5 -2
  103. package/dist/core/mods/kernel/registration.js +19 -3
  104. package/dist/core/mods/package.d.ts +12 -1
  105. package/dist/core/mods/package.js +36 -9
  106. package/dist/core/mods/stations.d.ts +7 -1
  107. package/dist/core/mods/stations.js +17 -3
  108. package/dist/core/mods/teammate-stations.d.ts +4 -1
  109. package/dist/core/mods/teammate-stations.js +1 -1
  110. package/dist/core/native-signal.d.ts +13 -0
  111. package/dist/core/native-signal.js +18 -0
  112. package/dist/core/park-resumability.d.ts +16 -14
  113. package/dist/core/park-resumability.js +9 -4
  114. package/dist/core/path-rule-binding.js +1 -1
  115. package/dist/core/permission-rule-model.d.ts +11 -5
  116. package/dist/core/permission-rule-model.js +5 -3
  117. package/dist/core/permission-rule-org.js +1 -1
  118. package/dist/core/permission-rule-provider.d.ts +5 -1
  119. package/dist/core/permission-rule-provider.js +6 -1
  120. package/dist/core/permission-rule-session.d.ts +35 -5
  121. package/dist/core/permission-rule-session.js +32 -1
  122. package/dist/core/permission-rule-store.d.ts +5 -1
  123. package/dist/core/permission-rule-store.js +28 -5
  124. package/dist/core/permission-rules.d.ts +2 -2
  125. package/dist/core/permission-rules.js +2 -3
  126. package/dist/core/principal-name.d.ts +12 -0
  127. package/dist/core/principal-name.js +6 -2
  128. package/dist/core/read-root-grant-screen.d.ts +7 -6
  129. package/dist/core/read-root-grant-screen.js +7 -8
  130. package/dist/core/remote-env.d.ts +42 -8
  131. package/dist/core/resume-config-judge.js +1 -1
  132. package/dist/core/resume-startup-cause.d.ts +19 -4
  133. package/dist/core/resume-startup-cause.js +25 -6
  134. package/dist/core/rewind-conversation.d.ts +4 -0
  135. package/dist/core/rewrite-rejudge.d.ts +9 -1
  136. package/dist/core/rewrite-rejudge.js +11 -1
  137. package/dist/core/rule-offer-read.js +3 -2
  138. package/dist/core/runner/assemble-result.d.ts +21 -11
  139. package/dist/core/runner/assemble-result.js +24 -4
  140. package/dist/core/runner/boundary-reminders.d.ts +104 -0
  141. package/dist/core/runner/boundary-reminders.js +108 -0
  142. package/dist/core/runner/branch-writeback.d.ts +21 -7
  143. package/dist/core/runner/branch-writeback.js +44 -6
  144. package/dist/core/runner/command-sandbox-frame.js +2 -1
  145. package/dist/core/runner/compact-session.js +11 -4
  146. package/dist/core/runner/constraint-layers.d.ts +24 -5
  147. package/dist/core/runner/constraint-layers.js +21 -2
  148. package/dist/core/runner/continuation-gate.js +3 -1
  149. package/dist/core/runner/contracts.d.ts +83 -13
  150. package/dist/core/runner/cross-boundary-lane.js +2 -1
  151. package/dist/core/runner/delegation-owner.d.ts +246 -45
  152. package/dist/core/runner/delegation-owner.js +237 -63
  153. package/dist/core/runner/expire-settle.d.ts +17 -0
  154. package/dist/core/runner/expire-settle.js +8 -2
  155. package/dist/core/runner/file-history-request.d.ts +4 -3
  156. package/dist/core/runner/file-history-request.js +4 -1
  157. package/dist/core/runner/file-history-restore.d.ts +11 -3
  158. package/dist/core/runner/file-history-restore.js +11 -3
  159. package/dist/core/runner/gate-exit.d.ts +22 -1
  160. package/dist/core/runner/gate-exit.js +12 -14
  161. package/dist/core/runner/nested-memory-content.js +1 -1
  162. package/dist/core/runner/nested-memory-lane.d.ts +10 -2
  163. package/dist/core/runner/nested-memory-lane.js +29 -8
  164. package/dist/core/runner/own-model-money-door.d.ts +13 -0
  165. package/dist/core/runner/own-model-money-door.js +17 -0
  166. package/dist/core/runner/park-commit.d.ts +4 -2
  167. package/dist/core/runner/park-commit.js +2 -1
  168. package/dist/core/runner/permission-rule-lanes.d.ts +4 -0
  169. package/dist/core/runner/permission-rule-lanes.js +7 -0
  170. package/dist/core/runner/person-path-rows.js +1 -1
  171. package/dist/core/runner/placement-fence.d.ts +8 -2
  172. package/dist/core/runner/placement-fence.js +8 -3
  173. package/dist/core/runner/policy-throw.d.ts +3 -2
  174. package/dist/core/runner/policy-throw.js +2 -2
  175. package/dist/core/runner/prepare-acquire-reconcile.d.ts +23 -14
  176. package/dist/core/runner/prepare-acquire-reconcile.js +33 -15
  177. package/dist/core/runner/prepare-artifact.d.ts +14 -1
  178. package/dist/core/runner/prepare-artifact.js +7 -2
  179. package/dist/core/runner/prepare-ask-lane.d.ts +8 -0
  180. package/dist/core/runner/prepare-ask-lane.js +14 -5
  181. package/dist/core/runner/prepare-boundary-parks.js +5 -4
  182. package/dist/core/runner/prepare-config-doors.d.ts +9 -4
  183. package/dist/core/runner/prepare-config-doors.js +25 -8
  184. package/dist/core/runner/prepare-defer-classify.d.ts +8 -4
  185. package/dist/core/runner/prepare-defer-classify.js +6 -6
  186. package/dist/core/runner/prepare-execution-env.d.ts +4 -1
  187. package/dist/core/runner/prepare-execution-env.js +8 -3
  188. package/dist/core/runner/prepare-file-history.d.ts +26 -0
  189. package/dist/core/runner/prepare-file-history.js +15 -1
  190. package/dist/core/runner/prepare-inherited-gate.d.ts +8 -3
  191. package/dist/core/runner/prepare-inherited-gate.js +9 -2
  192. package/dist/core/runner/prepare-leg-adoption.d.ts +2 -2
  193. package/dist/core/runner/prepare-park-ask.js +8 -5
  194. package/dist/core/runner/prepare-policy-chain.d.ts +5 -0
  195. package/dist/core/runner/prepare-policy-chain.js +18 -7
  196. package/dist/core/runner/prepare-prompt-assembly.d.ts +3 -0
  197. package/dist/core/runner/prepare-prompt-assembly.js +4 -3
  198. package/dist/core/runner/prepare-suspend-saga.d.ts +4 -1
  199. package/dist/core/runner/prepare-suspend-saga.js +19 -5
  200. package/dist/core/runner/prepare-task.d.ts +2 -5
  201. package/dist/core/runner/prepare-task.js +71 -26
  202. package/dist/core/runner/prepare-turn-wiring.js +7 -5
  203. package/dist/core/runner/prepare-workspace-restore.js +59 -28
  204. package/dist/core/runner/read-root-grant.d.ts +1 -0
  205. package/dist/core/runner/read-root-grant.js +1 -2
  206. package/dist/core/runner/resume-admission.d.ts +3 -0
  207. package/dist/core/runner/resume-admission.js +6 -4
  208. package/dist/core/runner/resume-apply.js +7 -5
  209. package/dist/core/runner/resume-claim.d.ts +2 -2
  210. package/dist/core/runner/resume-claim.js +4 -4
  211. package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
  212. package/dist/core/runner/resume-policy-outcome.js +6 -4
  213. package/dist/core/runner/resume-preflight.d.ts +3 -0
  214. package/dist/core/runner/resume-preflight.js +10 -3
  215. package/dist/core/runner/rewind-conversation.js +11 -4
  216. package/dist/core/runner/rewind-files.js +29 -14
  217. package/dist/core/runner/rewind-outcome.d.ts +27 -0
  218. package/dist/core/runner/rewind-outcome.js +14 -0
  219. package/dist/core/runner/run-attachment-seats.js +2 -1
  220. package/dist/core/runner/run-clock-and-content.js +2 -0
  221. package/dist/core/runner/run-identity-wiring.js +2 -0
  222. package/dist/core/runner/run-leg.js +11 -1
  223. package/dist/core/runner/run-notification-lane.d.ts +3 -0
  224. package/dist/core/runner/run-notification-lane.js +2 -2
  225. package/dist/core/runner/run-settle-and-teardown.d.ts +4 -2
  226. package/dist/core/runner/run-settle-and-teardown.js +52 -40
  227. package/dist/core/runner/run-stop-and-final-verify.d.ts +4 -0
  228. package/dist/core/runner/run-stop-and-final-verify.js +5 -4
  229. package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
  230. package/dist/core/runner/run-terminal-adoption.js +3 -3
  231. package/dist/core/runner/run-turn-boundary.js +7 -0
  232. package/dist/core/runner/runtask.d.ts +7 -4
  233. package/dist/core/runner/runtask.js +18 -9
  234. package/dist/core/runner/session-call-grant-station.d.ts +64 -0
  235. package/dist/core/runner/session-call-grant-station.js +119 -0
  236. package/dist/core/runner/session-file-state-replay.js +2 -2
  237. package/dist/core/runner/session-prompt-seats.d.ts +95 -0
  238. package/dist/core/runner/session-prompt-seats.js +62 -0
  239. package/dist/core/runner/session-rule-policy.js +1 -1
  240. package/dist/core/runner/session-write-ledger.d.ts +8 -0
  241. package/dist/core/runner/session-write-ledger.js +16 -0
  242. package/dist/core/runner/side-call-account.js +5 -1
  243. package/dist/core/runner/stop-tail-notice.d.ts +7 -0
  244. package/dist/core/runner/stop-tail-notice.js +23 -8
  245. package/dist/core/runner/stream-reap.js +4 -2
  246. package/dist/core/runner/stream-settle-backstop.d.ts +1 -1
  247. package/dist/core/runner/stream-settle-backstop.js +17 -18
  248. package/dist/core/runner/terminal-account.js +17 -8
  249. package/dist/core/runner/terminal-projection.d.ts +3 -2
  250. package/dist/core/runner/terminal-projection.js +1 -1
  251. package/dist/core/runner/tool-turn-repair-seat.d.ts +2 -2
  252. package/dist/core/runner/tool-turn-repair-seat.js +12 -7
  253. package/dist/core/runner/turn-attachments.d.ts +22 -1
  254. package/dist/core/runner/turn-attachments.js +20 -3
  255. package/dist/core/runner-deps.d.ts +6 -2
  256. package/dist/core/secret-env.d.ts +26 -6
  257. package/dist/core/secret-env.js +6 -6
  258. package/dist/core/session-call-grant-screen.d.ts +58 -0
  259. package/dist/core/session-call-grant-screen.js +18 -0
  260. package/dist/core/session-call-grant.d.ts +93 -0
  261. package/dist/core/session-call-grant.js +524 -0
  262. package/dist/core/session-checkout.d.ts +3 -0
  263. package/dist/core/session-checkout.js +8 -3
  264. package/dist/core/session-policy-store.d.ts +14 -0
  265. package/dist/core/session-policy-store.js +16 -2
  266. package/dist/core/session-store.d.ts +18 -1
  267. package/dist/core/session-store.js +20 -4
  268. package/dist/core/session.d.ts +36 -4
  269. package/dist/core/shared-artifact-reads.d.ts +93 -0
  270. package/dist/core/shared-artifact-reads.js +94 -0
  271. package/dist/core/skill-grant.js +1 -1
  272. package/dist/core/skills-directory.d.ts +9 -45
  273. package/dist/core/skills-directory.js +9 -722
  274. package/dist/core/spend-account.js +3 -0
  275. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +22 -4
  276. package/dist/core/store-contracts/checkpoint-store-contract.js +363 -29
  277. package/dist/core/store-contracts/file-history-store-contract.d.ts +11 -3
  278. package/dist/core/store-contracts/file-history-store-contract.js +62 -2
  279. package/dist/core/store-contracts/grant-fixture.d.ts +52 -0
  280. package/dist/core/store-contracts/grant-fixture.js +84 -0
  281. package/dist/core/store-contracts/session-repo-contract.js +18 -0
  282. package/dist/core/store-contracts/session-store-contract.d.ts +15 -1
  283. package/dist/core/store-contracts/session-store-contract.js +211 -2
  284. package/dist/core/store-contracts/workflow-journal-store-contract.js +47 -8
  285. package/dist/core/suspend-lane-reasons.d.ts +13 -0
  286. package/dist/core/suspend-lane-reasons.js +5 -0
  287. package/dist/core/synthetic-read-verdict.d.ts +5 -3
  288. package/dist/core/synthetic-read-verdict.js +1 -1
  289. package/dist/core/task-limits.d.ts +15 -0
  290. package/dist/core/task-notification.d.ts +33 -7
  291. package/dist/core/task-notification.js +34 -9
  292. package/dist/core/task-registry-agent.d.ts +1 -1
  293. package/dist/core/task-registry-agent.js +18 -7
  294. package/dist/core/task-registry-shared.d.ts +29 -4
  295. package/dist/core/task-registry-shared.js +7 -0
  296. package/dist/core/task-registry.d.ts +21 -1
  297. package/dist/core/task-registry.js +36 -9
  298. package/dist/core/task-result.d.ts +55 -1
  299. package/dist/core/task-spec.d.ts +17 -3
  300. package/dist/core/terminal-cause.d.ts +68 -5
  301. package/dist/core/tool-catalog-entries.js +1 -1
  302. package/dist/core/tool-check-reading.js +2 -1
  303. package/dist/core/tool-errors.js +1 -0
  304. package/dist/core/tool-list-grammar.d.ts +0 -47
  305. package/dist/core/tool-list-grammar.js +1 -75
  306. package/dist/core/tool-model-gate.d.ts +7 -11
  307. package/dist/core/tool-model-gate.js +5 -8
  308. package/dist/core/tool-name-aliases.js +2 -3
  309. package/dist/core/tool-name-readings.d.ts +4 -0
  310. package/dist/core/tool-name-readings.js +1 -0
  311. package/dist/core/tool-policy.d.ts +46 -4
  312. package/dist/core/tool-policy.js +47 -18
  313. package/dist/core/tool-result-store.d.ts +0 -24
  314. package/dist/core/tool-result-store.js +1 -36
  315. package/dist/core/tool-spec.d.ts +8 -4
  316. package/dist/core/untrusted-egress.js +2 -2
  317. package/dist/core/untrusted-text.d.ts +8 -0
  318. package/dist/core/untrusted-text.js +14 -0
  319. package/dist/core/user-attachment.d.ts +16 -1
  320. package/dist/core/user-attachment.js +42 -18
  321. package/dist/core/wiring-manifest.d.ts +4 -9
  322. package/dist/core/wiring-manifest.js +1 -1
  323. package/dist/core/workflow-journal-store.d.ts +55 -8
  324. package/dist/core/workflow-journal-store.js +34 -10
  325. package/dist/core/workflow-run-store-contract.js +56 -1
  326. package/dist/core/workflow-run-store.d.ts +43 -19
  327. package/dist/core/workflow-run-store.js +17 -2
  328. package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
  329. package/dist/engine/execution-env/node-execution-env.js +4 -0
  330. package/dist/engine/harness/agent-harness.d.ts +10 -5
  331. package/dist/engine/harness/agent-harness.js +12 -4
  332. package/dist/engine/harness/types.d.ts +18 -0
  333. package/dist/engine/llm/tool-turns.d.ts +1 -1
  334. package/dist/engine/llm/types.d.ts +5 -4
  335. package/dist/engine/session/memory-repo.d.ts +15 -3
  336. package/dist/engine/session/memory-repo.js +21 -3
  337. package/dist/engine/session/memory-storage.d.ts +5 -0
  338. package/dist/engine/session/memory-storage.js +8 -3
  339. package/dist/engine/session/repo-utils.d.ts +9 -0
  340. package/dist/engine/session/repo-utils.js +14 -0
  341. package/dist/engine/session/storage-base.d.ts +20 -7
  342. package/dist/engine/session/storage-base.js +13 -1
  343. package/dist/index.d.ts +39 -21
  344. package/dist/index.js +32 -17
  345. package/dist/internal/harness.d.ts +1 -1
  346. package/dist/internal/harness.js +1 -1
  347. package/dist/orchestration/run-workflow-tool.d.ts +13 -1
  348. package/dist/orchestration/run-workflow-tool.js +101 -32
  349. package/dist/orchestration/workflow-park-adoption.d.ts +309 -92
  350. package/dist/orchestration/workflow-park-adoption.js +588 -323
  351. package/dist/orchestration/workflow-tree-id.d.ts +66 -0
  352. package/dist/orchestration/workflow-tree-id.js +66 -0
  353. package/dist/orchestration/workflow-types.d.ts +90 -11
  354. package/dist/orchestration/workflow-types.js +10 -1
  355. package/dist/orchestration/workflow.d.ts +30 -4
  356. package/dist/orchestration/workflow.js +424 -114
  357. package/dist/prompt-assembly/catalog/constitution.js +5 -1
  358. package/dist/prompt-assembly/catalog/core-behavior.d.ts +3 -4
  359. package/dist/prompt-assembly/catalog/core-behavior.js +61 -22
  360. package/dist/prompt-assembly/catalog/environment.js +2 -2
  361. package/dist/prompt-assembly/catalog/events.d.ts +16 -0
  362. package/dist/prompt-assembly/catalog/events.js +2 -0
  363. package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +72 -44
  364. package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.js +2 -2
  365. package/dist/prompt-assembly/catalog/locales/zh-Hans/events.js +2 -0
  366. package/dist/prompt-assembly/catalog/schema.d.ts +5 -1
  367. package/dist/prompt-assembly/catalog/schema.js +2 -0
  368. package/dist/prompt-assembly/catalog/sections.js +3 -14
  369. package/dist/prompt-assembly/event-registry.js +2 -0
  370. package/dist/prompt-assembly/select.js +1 -0
  371. package/dist/prompt-assembly/tool-catalog.d.ts +10 -7
  372. package/dist/prompt-assembly/tool-catalog.js +21 -7
  373. package/dist/prompt-assembly/types.d.ts +3 -0
  374. package/dist/prompts/default.d.ts +4 -1
  375. package/dist/prompts/default.js +6 -0
  376. package/dist/stores/file/checkpoint-store.d.ts +11 -10
  377. package/dist/stores/file/checkpoint-store.js +36 -10
  378. package/dist/stores/file/file-history-store.d.ts +6 -0
  379. package/dist/stores/file/file-history-store.js +21 -4
  380. package/dist/stores/file/fs-atomic.d.ts +1 -1
  381. package/dist/stores/file/index.d.ts +14 -4
  382. package/dist/stores/file/index.js +21 -5
  383. package/dist/stores/file/process-anchor.d.ts +9 -1
  384. package/dist/stores/file/session-policy-store.js +2 -17
  385. package/dist/stores/file/session-store.d.ts +27 -0
  386. package/dist/stores/file/session-store.js +81 -9
  387. package/dist/stores/file/workflow-journal-store.d.ts +14 -4
  388. package/dist/stores/file/workflow-journal-store.js +32 -24
  389. package/dist/stores/file/workflow-run-store.d.ts +15 -4
  390. package/dist/stores/file/workflow-run-store.js +76 -0
  391. package/dist/tools/artifact/artifact-tool.d.ts +10 -3
  392. package/dist/tools/artifact/artifact-tool.js +16 -1
  393. package/dist/tools/fs/bash-program-position.d.ts +10 -4
  394. package/dist/tools/fs/bash-program-position.js +11 -8
  395. package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -1
  396. package/dist/tools/fs/bash-readonly-classifier.js +9 -2
  397. package/dist/tools/fs/find-actions.d.ts +30 -16
  398. package/dist/tools/fs/find-actions.js +272 -19
  399. package/dist/tools/fs/fs-bash.js +8 -5
  400. package/dist/tools/fs/fs-shared.d.ts +0 -29
  401. package/dist/tools/fs/fs-shared.js +0 -5
  402. package/dist/tools/fs/fs-write.js +2 -1
  403. package/dist/tools/fs/read-deny.d.ts +6 -1
  404. package/dist/tools/fs/read-deny.js +6 -1
  405. package/dist/tools/fs/read-floor.d.ts +6 -0
  406. package/dist/tools/fs/read-floor.js +5 -1
  407. package/dist/tools/fs/removal-actions.d.ts +43 -0
  408. package/dist/tools/fs/removal-actions.js +25 -0
  409. package/dist/tools/fs/removal-targets.d.ts +2 -21
  410. package/dist/tools/fs/removal-targets.js +2 -3
  411. package/dist/tools/fs/safety.d.ts +37 -1
  412. package/dist/tools/fs/safety.js +52 -0
  413. package/dist/tools/fs/shell-climb.d.ts +46 -0
  414. package/dist/tools/fs/shell-climb.js +79 -0
  415. package/dist/tools/fs/shell-read-check.js +47 -19
  416. package/dist/tools/fs/shell-read-establish.js +36 -22
  417. package/dist/tools/fs/shell-read-judge.d.ts +10 -2
  418. package/dist/tools/fs/shell-read-judge.js +4 -4
  419. package/dist/tools/fs/shell-read-plan.d.ts +3 -0
  420. package/dist/tools/fs/shell-read-plan.js +1 -1
  421. package/dist/tools/fs/shell-read-workdir.js +3 -2
  422. package/dist/tools/fs/shell-read-write-targets.d.ts +4 -3
  423. package/dist/tools/fs/shell-read-write-targets.js +3 -0
  424. package/package.json +2 -2
  425. package/test/export-surface.snapshot.json +173 -15
  426. package/wire-changes/core-stores-sql@7.71.0.json +40 -0
  427. package/wire-changes/core-stores-sql@7.71.1.json +40 -0
  428. package/wire-changes/core@7.71.0.json +5827 -0
  429. package/wire-changes/core@7.71.1.json +118 -0
  430. package/wire-changes/mods-kernel@7.71.0.json +52 -0
  431. package/wire-changes/mods-kernel@7.71.1.json +40 -0
  432. package/wire-changes/primitives@7.71.0.json +473 -0
  433. package/wire-changes/primitives@7.71.1.json +40 -0
  434. package/wire-changes/wiki-gate@7.71.0.json +40 -0
  435. package/wire-changes/wiki-gate@7.71.1.json +40 -0
  436. package/dist/core/frontmatter-fence.d.ts +0 -10
  437. package/dist/core/frontmatter-fence.js +0 -6
  438. package/dist/core/permission-rule-syntax.d.ts +0 -46
  439. package/dist/core/permission-rule-syntax.js +0 -52
@@ -95,6 +95,15 @@ export declare function isTextContentHash(value: unknown): value is string;
95
95
  * the serializer's own (sorted), so the two members cannot be permuted.
96
96
  */
97
97
  export declare function exactBoundInputHashOf(tool: string, input: unknown): string | undefined;
98
+ /**
99
+ * THE reading of whether an answer edits a call: its `updatedInput` is an edit only when it is other bytes than the arguments the
100
+ * answer was handed, under the call's one binding — `shown` is their {@link exactBoundInputHashOf}, taken by the seat BEFORE it
101
+ * waits (a value read afterwards could have been moved to match). Bytes the binding reads as shown — keys in another order, a
102
+ * member holding `undefined` beside its absence, `-0` beside `0` — are the call handed back as shown: no edit, the same answer as
103
+ * one that carried none. Bytes with no digest (outside the bindable domain), or shown bytes with none, are an edit, refused where
104
+ * an edit is taken. Returns the edit, else `undefined`. Every reader of "did this answer edit the call" reads it.
105
+ */
106
+ export declare function editOfAnswer(tool: string, shown: string | undefined, updatedInput: unknown): unknown;
98
107
  /**
99
108
  * Why a value is outside the bindable domain: its top is not the payload's shape, a refusal of the receipt it is read by, or one of
100
109
  * JSON's own five — a number that is not finite, a hole in a list, a named member on a list, an `undefined` list element, one
@@ -34,6 +34,12 @@ export function exactBoundInputHashOf(tool, input) {
34
34
  const form = canonicalize({ tool, input: captured.value }, -1);
35
35
  return form === UNCANONICALIZABLE ? undefined : createHash("sha256").update(form, "utf8").digest("hex");
36
36
  }
37
+ export function editOfAnswer(tool, shown, updatedInput) {
38
+ if (updatedInput === undefined)
39
+ return undefined;
40
+ const edit = exactBoundInputHashOf(tool, updatedInput);
41
+ return edit !== undefined && edit === shown ? undefined : updatedInput;
42
+ }
37
43
  export function bindableValueOf(value, top = "record") {
38
44
  const received = receive(value, BINDING_RECEIPT);
39
45
  if (!received.ok)
@@ -34,63 +34,45 @@ export declare function copiedRiskAxes(given: unknown): {
34
34
  */
35
35
  export declare function normalizeProbeCause(value: unknown): ProbeCause | undefined;
36
36
  /**
37
- * The checkpoint FEATURE TABLE — one row per feature that ever raised the row format: its schema version, and
38
- * what a mint owed when the feature was present (`writes`, prose). The per-feature constants below ARE the rows'
39
- * versions. The table is CLOSED at `requirements` (v10): every live mint stamps 10 and lists the row's
37
+ * The checkpoint FEATURE TABLE — one row per feature whose presence a row's reader must know about: where it came
38
+ * from and what a mint owes when the feature is present (`writes`, prose). The row FORMAT is one number,
39
+ * {@link MAX_SUPPORTED_CHECKPOINT_VERSION} (10, the `requirements` row): every live mint stamps it and lists the row's
40
40
  * reader-requirement words beside it (`Checkpoint.requires`, checkpoint-requirements.ts) — a later segment adds a
41
- * word there, never a row here. Each feature key below (but `baseline` / `requirements`) is itself one of those
42
- * words, and whether a v10 row carries the feature is read off the row's content by the requirement tables.
41
+ * word there, never a row here. Each feature key below (but `requirements`) is itself one of those words, and whether
42
+ * a row carries the feature is read off the row's content by the requirement tables, never off a number.
43
43
  *
44
- * A v≤9 row was stamped the HIGHEST feature it carried, so the number records only the top feature; the resume
45
- * rules that read a v≤9 row by number are exact to the version at which their feature was the top
46
- * (`realApproval` is version-recorded at v8 and marker-recorded — `readFace.realApproval` — at v9).
47
- *
48
- * v4 is a GAP, deliberately: the retired cross-slice wall-clock allocation. This worker still reads v4
49
- * rows; a ledger carrying the retired axis is refused by FIELD (`walltime_axis_retired`) at any version.
44
+ * A row below the format (an earlier release's, stamped by the highest feature it carried, or with no version at
45
+ * all) is read by no rule here: the row's judge refuses it as a retired seat (checkpoint-row-verdict.ts) — it stays
46
+ * pending, nothing is consumed, and the way out is to expire it and run the work again.
50
47
  */
51
48
  export declare const CHECKPOINT_FEATURES: {
52
- /** The baseline shape: a plain human-approval suspend before any feature raised the format. No live
53
- * mint stamps it today; it is the floor of the ladder and the reading of a row written before any feature. */
54
- readonly baseline: {
55
- readonly version: 1;
56
- readonly introduced: "design/49";
57
- readonly writes: "the row itself";
58
- };
59
- /** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction an older worker
60
- * cannot handle (it rejects pre-CAS; the row stays `pending`, retryable on a newer worker). */
49
+ /** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction. */
61
50
  readonly resource: {
62
- readonly version: 2;
63
51
  readonly introduced: "design/74";
64
52
  readonly writes: "resourceLedger; gate/pendingAction kind resource_limit";
65
53
  };
66
- /** A HUMAN-DECISION park (tool approval or plan_review) of the binding era: the decision-action binding
67
- * (`boundCallId` + `boundInputHash` on a tool_approval) is enforced ENTIRELY by the resuming worker, so a
68
- * pre-binding worker must reject the row rather than execute the pending tool unverified. Like `resource`,
69
- * this row is a park-kind FLOOR: a plan_review park carries it with no binding (it was introduced above it);
70
- * whether a tool_approval row carries its hash is the resume binding rung's own conjunction. */
54
+ /** A HUMAN-DECISION park (tool approval or plan_review): the decision-action binding (`boundCallId` +
55
+ * `boundInputHash` on a tool_approval) is enforced ENTIRELY by the resuming worker; a tool approval without its
56
+ * hash is a damaged row (the resume binding rung). */
71
57
  readonly binding: {
72
- readonly version: 3;
73
58
  readonly introduced: "design/80";
74
- readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only";
59
+ readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries no binding";
75
60
  };
76
61
  /** A ledger carrying a cross-slice TOKEN allocation: the window clamp and the exhausted-resume fail-fast
77
- * live in the resuming worker. A ledger with no token total keeps the historic stamps. */
62
+ * live in the resuming worker. */
78
63
  readonly token: {
79
- readonly version: 5;
80
64
  readonly introduced: "design/164";
81
65
  readonly writes: "resourceLedger.totalTokens";
82
66
  };
83
67
  /** Org-memory admission freeze state (the adjudicated-empty record included): the session/delegation
84
68
  * freeze on resume and the tenant-admission door live in the resuming worker. */
85
69
  readonly orgAdmission: {
86
- readonly version: 6;
87
70
  readonly introduced: "org-admission";
88
71
  readonly writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned";
89
72
  };
90
73
  /** The F-012 durable enforcement fields: the frozen ancestor projection chain + its digest (one write, the
91
74
  * resume-edit re-adjudication executes it) and/or the delegation-provenance aggregate a resume re-seeds. */
92
75
  readonly f012: {
93
- readonly version: 7;
94
76
  readonly introduced: "F-012";
95
77
  readonly writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance";
96
78
  };
@@ -98,61 +80,41 @@ export declare const CHECKPOINT_FEATURES: {
98
80
  * belt live in the resuming worker. Minted at ONE site (the approval park); the two always-mounted
99
81
  * integrity policies mint it on any durable deployment, org-governed or not. */
100
82
  readonly realApproval: {
101
- readonly version: 8;
102
83
  readonly introduced: "#130/#120";
103
- readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it";
84
+ readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; readFace.realApproval = true beside it";
104
85
  };
105
86
  /** The READ-face section ({@link CheckpointState.readFace}): resolved face + normalized deny-set additions,
106
87
  * written only for a non-default posture; the stricter-wins fold lives in the resuming worker. Carries the
107
- * redundant governance marker for `realApproval` (see the table note above). Absent ⇒ default posture. */
88
+ * redundant governance marker for `realApproval`. Absent ⇒ default posture. */
108
89
  readonly face: {
109
- readonly version: 9;
110
90
  readonly introduced: "design/199";
111
91
  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)";
112
92
  };
113
- /** The last row: the reader-requirement words ({@link CheckpointRow.requires}). Every live mint stamps it, so a
114
- * worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted from here on, `version_newer`, pre-CAS. */
93
+ /** The frame: the reader-requirement words ({@link CheckpointRow.requires}) and the row digest. Every live mint
94
+ * writes them at the row format, so a worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted since,
95
+ * `version_newer`, pre-CAS. */
115
96
  readonly requirements: {
116
- readonly version: 10;
117
97
  readonly introduced: "#1320";
118
98
  readonly writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)";
119
99
  };
120
100
  };
121
101
  /** One row of {@link CHECKPOINT_FEATURES}. */
122
102
  export interface CheckpointFeatureRow {
123
- readonly version: number;
124
103
  /** Where the feature came from — a design or ticket tag, documentation only. */
125
104
  readonly introduced: string;
126
- /** What a mint wrote when the feature was present (prose; the mint sites are the code). */
105
+ /** What a mint writes when the feature is present (prose; the mint sites are the code). */
127
106
  readonly writes: string;
128
107
  }
129
108
  /** The feature words — the row keys of {@link CHECKPOINT_FEATURES}. */
130
109
  export type CheckpointFeature = keyof typeof CHECKPOINT_FEATURES;
131
- /** The BASELINE {@link Checkpoint} schema version — the `baseline` row. NOT the highest a resume accepts (that
132
- * is {@link MAX_SUPPORTED_CHECKPOINT_VERSION}); resume stays forward-compatible by `<=` against MAX, never `===`. */
133
- export declare const CURRENT_CHECKPOINT_VERSION: 1;
134
- /** The `resource` row's version. */
135
- export declare const RESOURCE_CHECKPOINT_VERSION: 2;
136
- /** The `binding` row's version. */
137
- export declare const BINDING_CHECKPOINT_VERSION: 3;
138
- /** The `token` row's version. v4 (the retired wall-clock total) is deliberately not reused. */
139
- export declare const TOKEN_CHECKPOINT_VERSION: 5;
140
- /** The `orgAdmission` row's version. */
141
- export declare const ORG_ADMISSION_CHECKPOINT_VERSION: 6;
142
- /** The `f012` row's version. */
143
- export declare const F012_CHECKPOINT_VERSION: 7;
144
- /** The `realApproval` row's version. */
145
- export declare const REAL_APPROVAL_CHECKPOINT_VERSION: 8;
146
- /** The `face` row's version. */
147
- export declare const FACE_CHECKPOINT_VERSION: 9;
148
- /** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table, and the stamp
149
- * of every live mint (the table is closed there); a higher one is rejected pre-CAS with {@link CheckpointError}
150
- * `unsupported_version` (the row stays `pending`, retryable on a newer worker). */
151
- export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 10;
110
+ /** The checkpoint row FORMAT — the one {@link Checkpoint.version} this engine reads, and the stamp of every live mint
111
+ * (frozen: a later segment adds a reader-requirement word, never a number). A higher one is rejected pre-CAS with
112
+ * {@link CheckpointError} `unsupported_version` / `version_newer` (the row stays `pending`, retryable on a newer worker);
113
+ * a lower one with `unsupported_version` / `seat_retired` (the row stays `pending`; expire it and run the work again). */
114
+ export declare const MAX_SUPPORTED_CHECKPOINT_VERSION = 10;
152
115
  /**
153
- * Read a checkpoint's schema version, defaulting an absent field to **`0`** (the row of a 1.67-era checkpoint,
154
- * written before the field existed — it carries no `workspaceHandle`, so resuming it the v1 way is safe).
155
- * Compare with `<= MAX_SUPPORTED_CHECKPOINT_VERSION`, never `=== CURRENT_CHECKPOINT_VERSION` (design/49 §3).
116
+ * Read a checkpoint's schema version, defaulting an absent field to **`0`** (a row written before the field
117
+ * existed — below the format, so its judge refuses it as a retired seat).
156
118
  */
157
119
  export declare function checkpointVersionOf(cp: Pick<Checkpoint, "version">): number;
158
120
  /**
@@ -178,15 +140,16 @@ export declare function checkpointVersionOf(cp: Pick<Checkpoint, "version">): nu
178
140
  * incomplete — the one arm that is not row-scoped: NO row in that data directory is readable here, so
179
141
  * the host rolls the binary forward instead of routing one token elsewhere), `"seat_retired"` (the row
180
142
  * carries a seat this engine no longer reads — terminal for the row's bytes: the retired pre-queue single
181
- * steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
182
- * `inheritedGate`, which an engine at 7.38.x or earlier still reads once), `"leg_not_resumable"` (a row a synchronous child
143
+ * steer seat, which no worker version reads and the host decides itself, a retired mode-seed member of
144
+ * `inheritedGate`, which an engine at 7.38.x or earlier still reads once, or a row below the format, which an
145
+ * earlier engine read by its number — expire it and run the work again), `"leg_not_resumable"` (a row a synchronous child
183
146
  * parked under an earlier release — it carries the synchronous-child block — whose leg nobody resumes: its result has no road back to
184
147
  * the run that spawned it; terminal for the row's bytes on every worker of this release — expire it and run the work again),
185
148
  * `"reading_changed"` (the row is intact and an earlier release parked it, reading part of it the way this release no longer
186
149
  * does — a member a decision binds, which reads as written under the earlier reading the requirement tables record; or its
187
150
  * frozen inherited constraint chain, which matches its digest under the earlier projection meaning that digest's prefix names).
188
- * · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
189
- * `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"skill_scopes_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"`, `"execution_recorded"`, `"bound_input_hash_missing"`.
151
+ * · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`,
152
+ * `"read_face_damaged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"skill_scopes_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"`, `"execution_recorded"`, `"bound_input_hash_missing"`.
190
153
  * Whether ANY release still resumes a row its judge refuses is not restated per word here: it is the row judge's one table
191
154
  * (`checkpoint-row-verdict.ts`, read as the verdict's `terminal`), beside the refusal's fixed sentence.
192
155
  *
@@ -198,17 +161,16 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
198
161
  /** An intact row an earlier release parked, which this release reads differently: the input hash of a tool approval parked before
199
162
  * 7.63.0, or a member whose earlier reading the requirement tables record (`EarlierReading`) and the row's content cannot show
200
163
  * agrees with this release's. */
201
- | "reading_changed" | "real_approval_damaged" | "real_approval_forged" | "read_face_damaged" | "read_face_forged"
202
- /** `state.writeFace` is present but not a well-formed section. No `_forged` twin: the section is
203
- * legal-and-absent at every version, so there is no version to judge a fabrication against — and a
204
- * fabricated "open" still needs the LIVE resolution to say open too. */
164
+ | "reading_changed" | "real_approval_damaged" | "read_face_damaged"
165
+ /** `state.writeFace` is present but not a well-formed section (legal and absent on any row, so "missing" is never
166
+ * damage — and a fabricated "open" still needs the LIVE resolution to say open too). */
205
167
  | "write_face_damaged" | "skill_grants_damaged"
206
168
  /** `state.skillScopes` is present but not a list of skill names (the active skills whose hooks the resumed leg reopens). */
207
169
  | "skill_scopes_damaged" | "constraint_chain_missing"
208
170
  /** `state.handsRoot` / `state.handsHome` / `state.handsCwd` is present but not an absolute path (the row's hands' coordinates). */
209
171
  | "hands_coordinates_damaged"
210
172
  /** The row's content does not read the way it was recorded when it was parked: its reader-requirement list
211
- * ({@link CheckpointRow.requires}) is missing on a v10 row, is not a list of words, is present below v10, or does not equal
173
+ * ({@link CheckpointRow.requires}) is missing, is not a list of words, or does not equal
212
174
  * the words the row's content carries, or its digest does not equal its content's — and no earlier reading the requirement
213
175
  * tables record explains it (that is `reading_changed`); a member the shape table refuses; a row its judge cannot read. */
214
176
  | "requirements_damaged"
@@ -216,9 +178,8 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
216
178
  * in storage AFTER the action was taken up, so — unlike every other damaged row — the action may already have run or been refused.
217
179
  * Terminal for the row's bytes; its sentence says to check the recorded outcome before running the work again. */
218
180
  | "execution_recorded"
219
- /** A pending tool approval whose row format is at or above the binding era carries no persisted `boundInputHash` — every mint at that
220
- * version writes one, so its absence is corruption or a caller-declared downgrade, and the decision-action input binding has nothing to
221
- * bind to. Terminal for the row's bytes (a pre-binding row, which never minted a hash, binds on `boundCallId` alone and is not this). */
181
+ /** A pending tool approval that carries no persisted `boundInputHash` — every mint writes one, so its absence is corruption or a
182
+ * caller-declared downgrade, and the decision-action input binding has nothing to bind to. Terminal for the row's bytes. */
222
183
  | "bound_input_hash_missing"
223
184
  /** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
224
185
  * no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
@@ -258,7 +219,9 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
258
219
  * `config.locked_key`), an MCP server's content class, the skills-listing seats (`config.skill_listing_budget_invalid`), the limits and the
259
220
  * resource-suspend knobs, the attachment modes, the governance windows, the brain-call guardrail, the host floor (`config.host_floor_invalid`) and the retention declaration over the stores the leg
260
221
  * would run on (`config.retention_policy`, `config.retention_capability`), and the checkpoint store seat itself (`config.invalid_checkpoint_store`: the
261
- * retired `null` spelling, a store without a required verb), and the skills seat and the hands band (`config.invalid_argument`;
222
+ * retired `null` spelling, a store without a required verb, a grant holder over a store that does not judge it), the session store seat's holder
223
+ * door (`config.invalid_session_store`: a holder over a session store that does not declare the fence, a `requireHolder` store and a host
224
+ * resume without a holder, a declaration the seat refuses), and the skills seat and the hands band (`config.invalid_argument`;
262
225
  * a skill's `baseDir` by its own reader, `config.skill_base_dir_invalid`), and the value arms of three doors whose other arms need the leg:
263
226
  * the interaction posture's word and its contradiction with `interactiveTools: false` (`config.interaction_posture`), the requested role's
264
227
  * word (`config.unknown_role`, `detail.reason` `unknown_role_word`), and per-task agents beside a roster the receipt reads whole that mounts no
@@ -270,7 +233,7 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
270
233
  *
271
234
  * A SUBSET of {@link CONFIG_REFUSAL_CODES}, the family's whole refusal vocabulary: the words a resume's screen can produce, held to that set at compile time.
272
235
  */
273
- export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.language_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.interaction_posture", "config.agents.no_delegation_tool", "config.spec_member_unreadable", "config.spec_unknown_key", "config.agent_config_dir_invalid", "config.agent_home_dir_invalid"];
236
+ export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.language_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.invalid_session_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.interaction_posture", "config.agents.no_delegation_tool", "config.spec_member_unreadable", "config.spec_unknown_key", "config.agent_config_dir_invalid", "config.agent_home_dir_invalid"];
274
237
  export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODES)[number];
275
238
  export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
276
239
  /** The words of a {@link CheckpointError}'s optional `detail.field` (what each means: the `detail` member's doc). A CLOSED SET with one home, registered in
@@ -296,7 +259,7 @@ export type ResumePreflightSettler = "this_refusal" | "concurrent_actor" | "nobo
296
259
  * registered in `docs/CLOSED-SETS.md`. What each code means is written on its entry below. The codes a retained child's resume handle
297
260
  * rejects with (`Error.code`, minted outside this class) are their own set, {@link SPAWN_RESUME_REFUSAL_CODES}.
298
261
  */
299
- export declare const CHECKPOINT_ERROR_CODES: readonly ["checkpoint.already_exists", "checkpoint.already_resolved", "checkpoint.not_found", "checkpoint.gate_mismatch", "checkpoint.resume_aborted", "checkpoint.invalid_outcome", "checkpoint.unsupported_version", "checkpoint.config_refused", "checkpoint.cwd_conflicts_restore", "checkpoint.walltime_axis_retired", "checkpoint.reopen_revote", "checkpoint.reopened_concurrently", "checkpoint.reopen_failed", "checkpoint.void_unpin_failed", "checkpoint.execution_outcome_conflict", "steering.invalid_content", "steering.queue_full", "steering.duplicate_input_id", "steering.blocked_by_hook", "wake.gate_pending", "wake.nothing_to_deliver", "resume.parent_constraint_missing", "resume.parent_constraint_mismatch", "resume.parent_constraint_unrebuildable", "resume.usage_window_exhausted", "resume.principal_mismatch", "resume.isolation_scope_mismatch", "resume.placement_mismatch", "resume.composition_mismatch", "resume.agent_definition_mismatch", "resume.preflight_rejected", "resume.holder_superseded", "resume.constraint_rejected", "resume.constraint_unprojectable"];
262
+ export declare const CHECKPOINT_ERROR_CODES: readonly ["checkpoint.already_exists", "checkpoint.already_resolved", "checkpoint.not_found", "checkpoint.gate_mismatch", "checkpoint.resume_aborted", "checkpoint.invalid_outcome", "checkpoint.unsupported_version", "checkpoint.config_refused", "checkpoint.cwd_conflicts_restore", "checkpoint.walltime_axis_retired", "checkpoint.reopen_revote", "checkpoint.reopened_concurrently", "checkpoint.reopen_failed", "checkpoint.void_unpin_failed", "checkpoint.execution_outcome_conflict", "steering.invalid_content", "steering.queue_full", "steering.duplicate_input_id", "steering.blocked_by_hook", "wake.gate_pending", "wake.nothing_to_deliver", "resume.parent_constraint_missing", "resume.parent_constraint_mismatch", "resume.parent_constraint_unrebuildable", "resume.usage_window_exhausted", "resume.principal_mismatch", "resume.isolation_scope_mismatch", "resume.placement_mismatch", "resume.composition_mismatch", "resume.agent_definition_mismatch", "resume.preflight_rejected", "resume.constraint_rejected", "resume.constraint_unprojectable"];
300
263
  /** The code of a {@link CheckpointError} — derived from {@link CHECKPOINT_ERROR_CODES}, its one home. */
301
264
  export type CheckpointErrorCode = (typeof CHECKPOINT_ERROR_CODES)[number];
302
265
  export declare const isCheckpointErrorCode: (word: unknown) => word is CheckpointErrorCode;
@@ -62,29 +62,20 @@ export function normalizeProbeCause(value) {
62
62
  };
63
63
  }
64
64
  export const CHECKPOINT_FEATURES = {
65
- baseline: { version: 1, introduced: "design/49", writes: "the row itself" },
66
- resource: { version: 2, introduced: "design/74", writes: "resourceLedger; gate/pendingAction kind resource_limit" },
67
- binding: { version: 3, introduced: "design/80", writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only" },
68
- token: { version: 5, introduced: "design/164", writes: "resourceLedger.totalTokens" },
69
- orgAdmission: { version: 6, introduced: "org-admission", writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned" },
70
- f012: { version: 7, introduced: "F-012", writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
71
- realApproval: { version: 8, introduced: "#130/#120", writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it" },
72
- 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)" },
73
- requirements: { version: 10, introduced: "#1320", writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)" },
65
+ resource: { introduced: "design/74", writes: "resourceLedger; gate/pendingAction kind resource_limit" },
66
+ binding: { introduced: "design/80", writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries no binding" },
67
+ token: { introduced: "design/164", writes: "resourceLedger.totalTokens" },
68
+ orgAdmission: { introduced: "org-admission", writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned" },
69
+ f012: { introduced: "F-012", writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
70
+ realApproval: { introduced: "#130/#120", writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; readFace.realApproval = true beside it" },
71
+ face: { 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)" },
72
+ requirements: { introduced: "#1320", writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)" },
74
73
  };
75
- export const CURRENT_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.baseline.version;
76
- export const RESOURCE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.resource.version;
77
- export const BINDING_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.binding.version;
78
- export const TOKEN_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.token.version;
79
- export const ORG_ADMISSION_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.orgAdmission.version;
80
- export const F012_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.f012.version;
81
- export const REAL_APPROVAL_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.realApproval.version;
82
- export const FACE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.face.version;
83
- export const MAX_SUPPORTED_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.requirements.version;
74
+ export const MAX_SUPPORTED_CHECKPOINT_VERSION = 10;
84
75
  export function checkpointVersionOf(cp) {
85
76
  return cp.version ?? 0;
86
77
  }
87
- export const CHECKPOINT_CONFIG_REFUSAL_CODES = Object.freeze(["config.spec_retired_key", "config.output_style_invalid", "config.language_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.interaction_posture", "config.agents.no_delegation_tool", "config.spec_member_unreadable", "config.spec_unknown_key", "config.agent_config_dir_invalid", "config.agent_home_dir_invalid"]);
78
+ export const CHECKPOINT_CONFIG_REFUSAL_CODES = Object.freeze(["config.spec_retired_key", "config.output_style_invalid", "config.language_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.invalid_session_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.interaction_posture", "config.agents.no_delegation_tool", "config.spec_member_unreadable", "config.spec_unknown_key", "config.agent_config_dir_invalid", "config.agent_home_dir_invalid"]);
88
79
  export const isCheckpointConfigRefusalCode = (word) => CHECKPOINT_CONFIG_REFUSAL_CODES.some((w) => w === word);
89
80
  export const CHECKPOINT_ERROR_CODES = Object.freeze([
90
81
  "checkpoint.already_exists",
@@ -118,7 +109,6 @@ export const CHECKPOINT_ERROR_CODES = Object.freeze([
118
109
  "resume.composition_mismatch",
119
110
  "resume.agent_definition_mismatch",
120
111
  "resume.preflight_rejected",
121
- "resume.holder_superseded",
122
112
  "resume.constraint_rejected",
123
113
  "resume.constraint_unprojectable",
124
114
  ]);
@@ -4,7 +4,7 @@
4
4
  * reads as 0" is written once.
5
5
  * A leaf: it types against `checkpoint-store.ts` (type only), so the store module can call it without a load-order cycle.
6
6
  */
7
- import type { Checkpoint, CheckpointStore, ResolveExpectation } from "./checkpoint-store.js";
7
+ import type { Checkpoint, ResolveExpectation } from "./checkpoint-store.js";
8
8
  /**
9
9
  * THE generation of a checkpoint row: its monotonic {@link Checkpoint.rev}, where an absent `rev` (a row
10
10
  * minted before the field existed, never mutated) reads as `0`. This is the one place that rule is
@@ -31,30 +31,100 @@ export declare function checkpointOccMatches(cp: Checkpoint, expect?: Pick<Resol
31
31
  */
32
32
  export declare function checkpointClaimRevOf(read: Pick<Checkpoint, "rev">): number;
33
33
  /**
34
- * The deployment's judge of a claim holder, handed to an in-tree store (`holderIsCurrent`): `true` while the grant `holder` names is
35
- * the current one, `false` once it is not. Exactly `true` is current; any answer that is not a boolean — a promise from an async judge
36
- * included — is refused loudly ({@link checkpointHolderMatches}), never read by its truthiness and never as a lost grant.
37
- * SYNCHRONOUS — the store calls it inside its atomic step, right before the commit, so the judgement and the flip
38
- * are one step with respect to code in THIS process. That closes the race only when the deployment's claim transfers happen in this
39
- * process and synchronously (an in-process claim table); a claim another process can transfer needs a store whose CAS and the claim
40
- * table share one transaction (a SQL backend's WHERE).
34
+ * The deployment's judge of a grant holder, handed to an in-tree store (`holderIsCurrent`) — the ONE judge every write that carries a
35
+ * holder is judged by (a session append or leaf move, a card's `put`, steer, `expire` and `resolve`).
36
+ *
37
+ * THE SENTENCE: `true` exactly when the grant `holder` names is the run's CURRENT leg AND that run has not ended (it is running or
38
+ * parked); `false` otherwise. A run row whose status is a word outside the host's own live set (a status the judge does not know) is
39
+ * NOT held: the judge answers `false` — fail-closed, never read as live. A value the judge cannot read as a grant is not an answer:
40
+ * the judge throws (a host's judge over `decodeGrantHolder` throws `holder.malformed`), and the write throws with nothing written.
41
+ *
42
+ * Exactly `true` is current; any answer that is not a boolean — a promise from an async judge included — is refused loudly
43
+ * ({@link holderJudgedCurrent}), never read by its truthiness and never as a lost grant.
44
+ *
45
+ * WHEN A HOST ENDS A RUN: a run that finishes normally is marked ended only once its settled result is in the host's hands — the
46
+ * leg writes its last records after it reports its end (`task.end`), and a judge reading that report as "ended" refuses the leg's
47
+ * own tail. Cancelling or superseding a run may withdraw its grant earlier; the writes refused then are the ones meant to be refused.
48
+ *
49
+ * SYNCHRONOUS — the store calls it inside its atomic step, right before the commit, so the judgement and the write are one step with
50
+ * respect to code in THIS process. That closes the race only when the deployment's grant transfers happen in this process and
51
+ * synchronously (an in-process grant table); a grant another process can transfer needs a store whose write and the grant table
52
+ * share one transaction (a SQL backend: the write's condition and a locked read of the run row, in one transaction).
53
+ * "One step" is with respect to OTHER writers and to the grant table's own transfers: the values the caller hands the write (the row, the
54
+ * entry, the outcome, the options) are the caller's, read by the store as it writes them — a caller whose own objects run code when read
55
+ * (an accessor that moves its own grant) is outside what the fence promises.
41
56
  */
42
57
  export type HolderJudge = (holder: string) => boolean;
58
+ /** THE reading of a store's `holderIsCurrent` option (`subject` names the option): absent, or a function — anything else is refused
59
+ * when the store is built (`config.invalid_argument`), never read as "no judge" and never left to fail at the first write. */
60
+ export declare function readHolderJudge(subject: string, value: unknown): HolderJudge | undefined;
43
61
  /**
44
- * THE holder half of the same predicate ({@link ResolveExpectation.holder}), shared by every backend that judges holders through a
45
- * function: no holder ⇒ nothing to judge; a holder ⇒ the store's judge answers whether that grant is still the current one. A store
46
- * with no judge loses a holder-bearing CAS — it never ignores a precondition it was handed. Called inside the store's atomic step,
47
- * right before the commit; a judge that throws makes the CAS throw with the row untouched. The judge's answer is current only when it
48
- * is exactly `true`; an answer that is not a boolean throws `config.invalid_checkpoint_store` (the row untouched): a wiring error is
49
- * named as one, not passed as a grant (by truthiness) nor reported as a superseded holder (by refusal).
62
+ * THE rule of a judge over a SHARED authority (one log, one ledger, one in-process view several store instances join): the judge
63
+ * belongs to the authority, not to the instance that happened to build it — every instance that joins must bring the SAME judge (the
64
+ * same function object, or none beside none), else the join is refused with the store kind's code, naming both sides. `authority` is
65
+ * the shared object; `judges` the kind's table of the judge each authority was built with (weak: it dies with the authority).
66
+ * A deployment whose judge is built after its stores hands every store one trampoline function and wires its body later.
67
+ */
68
+ export declare function joinHolderJudge(judges: WeakMap<object, HolderJudge | null>, authority: object, judge: HolderJudge | undefined, kind: HolderStoreKind, what: string): void;
69
+ /** The store kinds that judge a holder, each refused at its own seat with its own code. */
70
+ export type HolderStoreKind = "checkpoint" | "session";
71
+ /**
72
+ * THE judgement of one write's holder, shared by every store that judges holders through a function (both session storages, both
73
+ * checkpoint stores, on every verb that carries one): no holder ⇒ nothing to judge (`true` — the write is judged as before); a holder
74
+ * and no judge ⇒ `false` (a store never ignores a precondition it was handed); otherwise the judge's answer, current only when it is
75
+ * exactly `true`. An answer that is not a boolean throws the store's own seat code (`config.invalid_checkpoint_store` /
76
+ * `config.invalid_session_store`) with nothing written: a wiring error is named as one, not passed as a grant (by truthiness) nor
77
+ * reported as a superseded holder (by refusal). A judge that throws makes the write throw, nothing written. Called inside the store's
78
+ * atomic step, BEFORE any other condition of the write (an expected leaf, a row's state) — a write that fails both is answered
79
+ * `holder.superseded`.
80
+ */
81
+ export declare function holderJudgedCurrent(holder: string | undefined, holderIsCurrent: HolderJudge | undefined, kind: HolderStoreKind): boolean;
82
+ /**
83
+ * The holder half of `resolve`'s CAS predicate ({@link ResolveExpectation.holder}): {@link holderJudgedCurrent} over `expect.holder`
84
+ * for the checkpoint store. A miss is an ordinary CAS loss — the row is untouched.
50
85
  */
51
86
  export declare function checkpointHolderMatches(expect: ResolveExpectation | undefined, holderIsCurrent: HolderJudge | undefined): boolean;
87
+ /**
88
+ * THE holder declaration of a store — one shape, one meaning, for the session store (`SessionStore.fence`, mirrored from
89
+ * `SessionRepo.fence` by `TtlSessionStore`) and the checkpoint store (`CheckpointStore.fence`): `holder: "writes"` = this store judges
90
+ * the holder of EVERY write it is handed that carries one, in that write's own atomic step, by the one sentence of {@link HolderJudge}
91
+ * (a session store: append and leaf move; a checkpoint store: `put`, `setPendingSteer`, `expire`, `resolve` and each arm of
92
+ * `claimTerminal`). `requireHolder: true` additionally tells the engine's run and verb doors to refuse a run or verb the HOST starts
93
+ * without a holder (a leg the engine itself starts — a delegated child, a workflow member, an observer — is exempt); the store itself
94
+ * never refuses a write for carrying none (a host's own maintenance writes carry none). A wrapper store forwards its inner store's
95
+ * declaration member by member (a wrapper that drops it is refused at the door); a routing store declares only when every store it
96
+ * routes to judges.
97
+ */
98
+ export interface StoreHolderFence {
99
+ readonly holder: "writes";
100
+ readonly requireHolder?: true;
101
+ }
102
+ /**
103
+ * THE reading of a store's `fence` declaration ({@link StoreHolderFence}), for the store kind's seat: absent ⇒ `undefined` (the store
104
+ * judges no holder); `{ holder: "writes" }` with an optional boolean `requireHolder` ⇒ the declaration, frozen (`requireHolder: false`
105
+ * reads as absent). Every other form refuses with the seat's code, naming the seat:
106
+ * - the retired `holder: true` (it promised `resolve` alone; a store that kept it judges no other write) — the sentence
107
+ * names the law that replaced it;
108
+ * - any other `holder`, a `requireHolder` that is not a boolean, a member outside the two, a declaration that is not an object or
109
+ * cannot be read.
110
+ */
111
+ export declare function readStoreFence(kind: HolderStoreKind, seat: string, store: unknown): StoreHolderFence | undefined;
112
+ /** Who started the run or verb a store seat's door judges: the host (a run it starts or resumes, or one of the out-of-run session
113
+ * verbs), or an engine lane of a run (`engineLaneLegOf` — a delegated child, a workflow member, an observer sidecar). */
114
+ export type HolderSeatStarter = "host" | "engine";
115
+ /**
116
+ * THE store-seat door of a grant holder — one function for both store kinds and for every entrance (a run's prepare, a resume's screen
117
+ * before its claim, the out-of-run session verbs), each seat refused with its own code:
118
+ * - the seat's `fence` is read ({@link readStoreFence} — a retired or malformed declaration refuses whether or not the run carries a
119
+ * holder, since a declaration is a claim the engine reads at the seat);
120
+ * - a run or verb that carries a holder over a store that does not declare `holder: "writes"` is refused — a holder the store would
121
+ * ignore would fence nothing while the deployment believed it fenced;
122
+ * - a store that declares `requireHolder: true` refuses a run or verb the HOST started without a holder (`startedBy: "host"`); a leg an
123
+ * engine lane started (`"engine"`) carries no holder of its own and passes.
124
+ * No store (a disarmed seat) has nothing to judge. Answers the declaration read. The holder's value is never named.
125
+ */
126
+ export declare function assertStoreJudgesHolder(kind: HolderStoreKind, seat: string, store: unknown, holder: string | undefined, startedBy: HolderSeatStarter): StoreHolderFence | undefined;
52
127
  /** `RunInternals.holder` when present: a non-empty string (the deployment's credential for one claim grant). A provided value that
53
128
  * is empty or not a string names no grant and is refused at the door (`config.invalid_argument`), never carried into a CAS where a
54
129
  * judge would read it as a grant that lost. The value itself is never printed — only its kind. */
55
130
  export declare function assertHolderValue(holder: unknown): void;
56
- /** The store-seat refusal of a claim holder the seat's store cannot judge: a run handed {@link ResolveExpectation.holder} (through
57
- * `RunInternals.holder`) whose store does not declare `fence = { holder: true }`. The store seat's door and code
58
- * (`config.invalid_checkpoint_store`, as for a store without a required verb); no store (a disarmed run) has nothing to
59
- * judge. The holder's value is never named. */
60
- export declare function assertCheckpointStoreJudgesHolder(seat: "TaskSpec.checkpointStore" | "RunnerDeps.checkpointStore", store: CheckpointStore | undefined, holder: string | undefined): void;