@sema-agent/core 7.61.0 → 7.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/CHANGELOG.md +840 -0
  2. package/dist/agents/cascade.d.ts +11 -3
  3. package/dist/agents/cascade.js +1 -1
  4. package/dist/agents/peer-held-queue.d.ts +27 -4
  5. package/dist/agents/peer-held-queue.js +81 -36
  6. package/dist/agents/peer-session-drain.js +13 -3
  7. package/dist/agents/subagent-transcript-placement.d.ts +23 -0
  8. package/dist/agents/subagent-transcript-placement.js +14 -0
  9. package/dist/agents/subagent.d.ts +6 -1
  10. package/dist/agents/subagent.js +143 -58
  11. package/dist/agents/suspend-guard.d.ts +38 -16
  12. package/dist/agents/suspend-guard.js +9 -4
  13. package/dist/agents/verify.js +4 -3
  14. package/dist/brain/route-adjudicator.js +9 -4
  15. package/dist/core/approval-object.js +1 -1
  16. package/dist/core/arg-summary.js +1 -1
  17. package/dist/core/ask-question.d.ts +2 -2
  18. package/dist/core/canonical-json.d.ts +23 -13
  19. package/dist/core/canonical-json.js +4 -4
  20. package/dist/core/checkpoint-features.d.ts +722 -0
  21. package/dist/core/checkpoint-features.js +98 -0
  22. package/dist/core/checkpoint-queries.d.ts +47 -4
  23. package/dist/core/checkpoint-queries.js +36 -16
  24. package/dist/core/checkpoint-requirements.d.ts +12 -5
  25. package/dist/core/checkpoint-requirements.js +11 -5
  26. package/dist/core/checkpoint-row-verdict.d.ts +110 -0
  27. package/dist/core/checkpoint-row-verdict.js +245 -0
  28. package/dist/core/checkpoint-store.d.ts +76 -753
  29. package/dist/core/checkpoint-store.js +83 -144
  30. package/dist/core/compliance.d.ts +6 -2
  31. package/dist/core/compliance.js +3 -3
  32. package/dist/core/engine-attestation.d.ts +1 -1
  33. package/dist/core/engine-notice.d.ts +38 -7
  34. package/dist/core/engine-notice.js +9 -2
  35. package/dist/core/gate-fold.js +2 -2
  36. package/dist/core/git-worktree-env.d.ts +62 -3
  37. package/dist/core/git-worktree-env.js +91 -30
  38. package/dist/core/governance-codes.d.ts +9 -3
  39. package/dist/core/governance-codes.js +16 -3
  40. package/dist/core/hooks.d.ts +13 -0
  41. package/dist/core/human-input-projection.d.ts +1 -0
  42. package/dist/core/human-input-projection.js +3 -0
  43. package/dist/core/image-admission.d.ts +1 -1
  44. package/dist/core/locked-config.d.ts +2 -2
  45. package/dist/core/mcp-host-seat.js +6 -1
  46. package/dist/core/memory-engine/consolidation-driver.d.ts +33 -18
  47. package/dist/core/memory-engine/consolidation-driver.js +99 -98
  48. package/dist/core/memory-engine/consolidation.d.ts +73 -10
  49. package/dist/core/memory-engine/consolidation.js +167 -11
  50. package/dist/core/memory-engine/data-plane.d.ts +8 -4
  51. package/dist/core/memory-engine/data-plane.js +11 -6
  52. package/dist/core/memory-engine/delegation-settlement.d.ts +37 -35
  53. package/dist/core/memory-engine/delegation-settlement.js +53 -59
  54. package/dist/core/memory-engine/dual-root.d.ts +12 -6
  55. package/dist/core/memory-engine/dual-root.js +9 -5
  56. package/dist/core/memory-engine/engine.d.ts +98 -35
  57. package/dist/core/memory-engine/engine.js +477 -380
  58. package/dist/core/memory-engine/entry-scan.d.ts +8 -0
  59. package/dist/core/memory-engine/entry-scan.js +3 -0
  60. package/dist/core/memory-engine/file-backend.d.ts +29 -3
  61. package/dist/core/memory-engine/file-backend.js +66 -35
  62. package/dist/core/memory-engine/index.d.ts +7 -7
  63. package/dist/core/memory-engine/index.js +6 -6
  64. package/dist/core/memory-engine/landing-admission.d.ts +5 -3
  65. package/dist/core/memory-engine/landing-admission.js +3 -3
  66. package/dist/core/memory-engine/layout.d.ts +121 -45
  67. package/dist/core/memory-engine/layout.js +252 -102
  68. package/dist/core/memory-engine/memory-backend-contract.d.ts +19 -1
  69. package/dist/core/memory-engine/memory-backend-contract.js +320 -0
  70. package/dist/core/memory-engine/memory-deployment.d.ts +31 -8
  71. package/dist/core/memory-engine/memory-deployment.js +26 -12
  72. package/dist/core/memory-engine/scope-contract.d.ts +52 -11
  73. package/dist/core/memory-engine/scope-contract.js +68 -19
  74. package/dist/core/memory-engine/session-write-home.d.ts +3 -1
  75. package/dist/core/memory-engine/session-write-home.js +1 -1
  76. package/dist/core/memory-engine/sync-client.d.ts +3 -1
  77. package/dist/core/memory-engine/sync-client.js +7 -0
  78. package/dist/core/memory-engine/sync-report.d.ts +3 -2
  79. package/dist/core/memory-engine/sync-report.js +6 -2
  80. package/dist/core/memory-engine/tools.d.ts +2 -2
  81. package/dist/core/memory-engine/tools.js +10 -10
  82. package/dist/core/memory-engine/types.d.ts +118 -19
  83. package/dist/core/memory-engine/types.js +1 -0
  84. package/dist/core/memory-vector.d.ts +1 -1
  85. package/dist/core/memory.d.ts +10 -10
  86. package/dist/core/memory.js +15 -6
  87. package/dist/core/mode-policy.js +1 -1
  88. package/dist/core/mods/classic-events.d.ts +9 -1
  89. package/dist/core/mods/dollar.d.ts +32 -1
  90. package/dist/core/mods/dollar.js +13 -1
  91. package/dist/core/mods/kernel/events.d.ts +11 -3
  92. package/dist/core/mods/kernel/events.js +13 -10
  93. package/dist/core/mods/lifecycle-stations.d.ts +36 -4
  94. package/dist/core/mods/lifecycle-stations.js +44 -9
  95. package/dist/core/mods/session-append.d.ts +4 -1
  96. package/dist/core/mods/session-append.js +7 -0
  97. package/dist/core/mods/session-receive.js +12 -15
  98. package/dist/core/mods/stations.d.ts +70 -6
  99. package/dist/core/mods/stations.js +144 -1
  100. package/dist/core/own-property-receipt.d.ts +7 -0
  101. package/dist/core/own-property-receipt.js +3 -0
  102. package/dist/core/park-selfcheck.js +2 -2
  103. package/dist/core/pause-registry.d.ts +2 -0
  104. package/dist/core/pause-registry.js +3 -0
  105. package/dist/core/permission-rule-consent.d.ts +10 -3
  106. package/dist/core/permission-rule-consent.js +37 -24
  107. package/dist/core/permission-rule-store.d.ts +35 -1
  108. package/dist/core/permission-rule-store.js +27 -8
  109. package/dist/core/read-only-shell.js +3 -2
  110. package/dist/core/read-root-candidate.js +1 -1
  111. package/dist/core/redaction-marks.d.ts +8 -0
  112. package/dist/core/redaction-marks.js +6 -0
  113. package/dist/core/remote-env.d.ts +12 -1
  114. package/dist/core/remote-env.js +3 -0
  115. package/dist/core/resume-startup-cause.d.ts +5 -4
  116. package/dist/core/runner/child-tree.d.ts +29 -3
  117. package/dist/core/runner/child-tree.js +39 -16
  118. package/dist/core/runner/compact-session.js +5 -2
  119. package/dist/core/runner/contracts.d.ts +36 -17
  120. package/dist/core/runner/delegation-owner.d.ts +43 -0
  121. package/dist/core/runner/delegation-owner.js +59 -0
  122. package/dist/core/runner/gate-exit.js +2 -2
  123. package/dist/core/runner/inherited-ask-grants.js +1 -1
  124. package/dist/core/runner/lineage-reroot-view.d.ts +56 -0
  125. package/dist/core/runner/lineage-reroot-view.js +108 -0
  126. package/dist/core/runner/memory-consolidation-driver.d.ts +6 -3
  127. package/dist/core/runner/memory-consolidation-driver.js +4 -4
  128. package/dist/core/runner/memory-consolidation-write-judge.d.ts +2 -1
  129. package/dist/core/runner/memory-consolidation-write-judge.js +3 -2
  130. package/dist/core/runner/permission-rule-lanes.d.ts +2 -1
  131. package/dist/core/runner/permission-rule-lanes.js +2 -2
  132. package/dist/core/runner/person-path-rows.d.ts +23 -3
  133. package/dist/core/runner/person-path-rows.js +31 -4
  134. package/dist/core/runner/placement-fence.d.ts +12 -0
  135. package/dist/core/runner/placement-fence.js +20 -6
  136. package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -1
  137. package/dist/core/runner/prepare-acquire-reconcile.js +7 -2
  138. package/dist/core/runner/prepare-ask-lane.js +2 -2
  139. package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -1
  140. package/dist/core/runner/prepare-caps-and-workflow.js +6 -3
  141. package/dist/core/runner/prepare-config-doors.d.ts +6 -6
  142. package/dist/core/runner/prepare-config-doors.js +3 -4
  143. package/dist/core/runner/prepare-execution-env.js +17 -6
  144. package/dist/core/runner/prepare-hands-readface.d.ts +3 -2
  145. package/dist/core/runner/prepare-hands-readface.js +32 -10
  146. package/dist/core/runner/prepare-inherited-gate.d.ts +12 -8
  147. package/dist/core/runner/prepare-inherited-gate.js +14 -6
  148. package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -4
  149. package/dist/core/runner/prepare-memory-engine-session.js +4 -4
  150. package/dist/core/runner/prepare-memory.d.ts +3 -2
  151. package/dist/core/runner/prepare-memory.js +28 -20
  152. package/dist/core/runner/prepare-park-ask.js +4 -3
  153. package/dist/core/runner/prepare-task.js +22 -16
  154. package/dist/core/runner/prepare-workspace-restore.js +3 -6
  155. package/dist/core/runner/resume-admission.d.ts +3 -3
  156. package/dist/core/runner/resume-admission.js +6 -3
  157. package/dist/core/runner/resume-apply.d.ts +4 -0
  158. package/dist/core/runner/resume-apply.js +11 -4
  159. package/dist/core/runner/resume-checkpoint-screen.d.ts +9 -0
  160. package/dist/core/runner/resume-checkpoint-screen.js +4 -84
  161. package/dist/core/runner/run-git-lane.d.ts +2 -0
  162. package/dist/core/runner/run-git-lane.js +4 -1
  163. package/dist/core/runner/run-harness-handlers.d.ts +2 -0
  164. package/dist/core/runner/run-harness-handlers.js +3 -2
  165. package/dist/core/runner/run-leg.js +25 -8
  166. package/dist/core/runner/run-settle-and-teardown.js +6 -4
  167. package/dist/core/runner/run-stop-and-final-verify.js +2 -1
  168. package/dist/core/runner/run-turn-boundary.js +7 -4
  169. package/dist/core/runner/runtask.js +6 -6
  170. package/dist/core/runner/steering-preview.d.ts +9 -0
  171. package/dist/core/runner/steering-preview.js +5 -0
  172. package/dist/core/runner/stream-steer-verb.js +8 -0
  173. package/dist/core/runner/terminal-account.js +1 -1
  174. package/dist/core/runner/tool-face-overlay.js +2 -0
  175. package/dist/core/runner/turn-attachments.d.ts +5 -0
  176. package/dist/core/runner/turn-attachments.js +1 -1
  177. package/dist/core/runner-deps.d.ts +8 -4
  178. package/dist/core/secret-env.d.ts +9 -6
  179. package/dist/core/secret-env.js +41 -22
  180. package/dist/core/session-checkout.d.ts +108 -0
  181. package/dist/core/session-checkout.js +485 -0
  182. package/dist/core/session-store.d.ts +13 -5
  183. package/dist/core/session-store.js +28 -4
  184. package/dist/core/session.d.ts +29 -5
  185. package/dist/core/session.js +3 -0
  186. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +6 -12
  187. package/dist/core/store-contracts/checkpoint-store-contract.js +73 -6
  188. package/dist/core/store-contracts/session-store-contract.js +61 -8
  189. package/dist/core/task-event.d.ts +28 -1
  190. package/dist/core/task-notification.d.ts +9 -1
  191. package/dist/core/task-notification.js +8 -1
  192. package/dist/core/task-registry-agent.d.ts +40 -8
  193. package/dist/core/task-registry-agent.js +57 -24
  194. package/dist/core/task-registry-shared.d.ts +33 -11
  195. package/dist/core/task-registry-workflow.js +4 -3
  196. package/dist/core/task-registry.d.ts +27 -10
  197. package/dist/core/task-registry.js +19 -13
  198. package/dist/core/task-result.d.ts +5 -5
  199. package/dist/core/task-spec-members.js +1 -1
  200. package/dist/core/task-spec.d.ts +21 -1
  201. package/dist/core/terminal-cause.d.ts +6 -6
  202. package/dist/core/tool-face.d.ts +6 -2
  203. package/dist/core/tool-face.js +1 -1
  204. package/dist/core/tool-policy.d.ts +16 -13
  205. package/dist/core/tool-policy.js +11 -10
  206. package/dist/core/tool-roster.d.ts +4 -4
  207. package/dist/core/tool-spec.d.ts +42 -19
  208. package/dist/core/types.d.ts +2 -2
  209. package/dist/core/types.js +1 -1
  210. package/dist/core/untrusted-egress.d.ts +15 -4
  211. package/dist/core/untrusted-egress.js +23 -22
  212. package/dist/core/workspace-snapshot.d.ts +3 -1
  213. package/dist/core/workspace-snapshot.js +1 -0
  214. package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
  215. package/dist/engine/execution-env/node-execution-env.js +12 -5
  216. package/dist/engine/harness/types.d.ts +77 -1
  217. package/dist/engine/harness/types.js +108 -0
  218. package/dist/engine/session/import-validate.js +6 -1
  219. package/dist/engine/session/parent-chain-guard.d.ts +3 -3
  220. package/dist/engine/session/parent-chain-guard.js +1 -1
  221. package/dist/engine/session/path-to-root.d.ts +18 -3
  222. package/dist/engine/session/path-to-root.js +15 -1
  223. package/dist/engine/session/repo-utils.d.ts +12 -1
  224. package/dist/engine/session/repo-utils.js +41 -0
  225. package/dist/engine/session/session.d.ts +24 -1
  226. package/dist/engine/session/session.js +46 -2
  227. package/dist/engine/session/storage-base.d.ts +20 -0
  228. package/dist/engine/session/storage-base.js +28 -9
  229. package/dist/index.d.ts +16 -12
  230. package/dist/index.js +11 -8
  231. package/dist/internal/harness-types.d.ts +1 -1
  232. package/dist/internal/harness.d.ts +4 -3
  233. package/dist/internal/harness.js +3 -2
  234. package/dist/orchestration/run-workflow-tool.d.ts +7 -1
  235. package/dist/orchestration/run-workflow-tool.js +28 -11
  236. package/dist/orchestration/workflow-governance.d.ts +1 -1
  237. package/dist/orchestration/workflow.d.ts +6 -0
  238. package/dist/orchestration/workflow.js +5 -8
  239. package/dist/stores/file/checkpoint-store.d.ts +2 -0
  240. package/dist/stores/file/checkpoint-store.js +7 -6
  241. package/dist/stores/file/fs-atomic.d.ts +0 -22
  242. package/dist/stores/file/fs-atomic.js +0 -17
  243. package/dist/stores/file/index.d.ts +2 -9
  244. package/dist/stores/file/index.js +2 -4
  245. package/dist/stores/file/session-store.d.ts +13 -7
  246. package/dist/stores/file/session-store.js +42 -18
  247. package/dist/tools/fs/bash-program-position.d.ts +3 -2
  248. package/dist/tools/fs/bash-program-position.js +10 -10
  249. package/dist/tools/fs/program-read-model.d.ts +34 -10
  250. package/dist/tools/fs/program-read-model.js +37 -7
  251. package/dist/tools/fs/program-read-model.rows.js +13 -2
  252. package/dist/tools/fs/read-deny.d.ts +13 -1
  253. package/dist/tools/fs/read-deny.js +10 -2
  254. package/dist/tools/fs/removal-targets.js +5 -5
  255. package/dist/tools/fs/safety.d.ts +2 -0
  256. package/dist/tools/fs/safety.js +1 -1
  257. package/dist/tools/fs/shell-read-argv.d.ts +11 -2
  258. package/dist/tools/fs/shell-read-argv.js +45 -29
  259. package/dist/tools/fs/shell-read-bindings.d.ts +20 -2
  260. package/dist/tools/fs/shell-read-bindings.js +153 -69
  261. package/dist/tools/fs/shell-read-brace.d.ts +18 -0
  262. package/dist/tools/fs/shell-read-brace.js +79 -0
  263. package/dist/tools/fs/shell-read-check.js +29 -11
  264. package/dist/tools/fs/shell-read-establish.js +43 -22
  265. package/dist/tools/fs/shell-read-functions.js +2 -2
  266. package/dist/tools/fs/shell-read-judge.d.ts +11 -0
  267. package/dist/tools/fs/shell-read-judge.js +3 -3
  268. package/dist/tools/fs/shell-read-object-path.d.ts +59 -0
  269. package/dist/tools/fs/shell-read-object-path.js +119 -0
  270. package/dist/tools/fs/shell-read-plan.d.ts +18 -0
  271. package/dist/tools/fs/shell-read-plan.js +217 -104
  272. package/dist/tools/fs/shell-read-start.d.ts +76 -13
  273. package/dist/tools/fs/shell-read-start.js +97 -17
  274. package/dist/tools/fs/shell-read-word.d.ts +10 -0
  275. package/dist/tools/fs/shell-read-word.js +9 -5
  276. package/dist/tools/fs/shell-read-workdir.d.ts +54 -14
  277. package/dist/tools/fs/shell-read-workdir.js +103 -19
  278. package/dist/tools/fs/shell-read-write-targets.js +13 -8
  279. package/dist/tools/worktree.d.ts +3 -2
  280. package/dist/tools/worktree.js +7 -35
  281. package/package.json +3 -2
  282. package/test/export-surface.snapshot.json +93 -43
  283. package/wire-changes/core-stores-sql@7.62.0.json +30 -0
  284. package/wire-changes/core-stores-sql@7.63.0.json +30 -0
  285. package/wire-changes/core@7.62.0.json +2181 -0
  286. package/wire-changes/core@7.63.0.json +3523 -0
  287. package/wire-changes/mods-kernel@7.62.0.json +42 -0
  288. package/wire-changes/mods-kernel@7.63.0.json +30 -0
  289. package/wire-changes/primitives@7.62.0.json +30 -0
  290. package/wire-changes/primitives@7.63.0.json +445 -0
  291. package/dist/core/consolidate-scope.d.ts +0 -93
  292. package/dist/core/consolidate-scope.js +0 -98
  293. package/dist/core/credential-vocabulary.d.ts +0 -176
  294. package/dist/core/credential-vocabulary.js +0 -190
  295. package/dist/core/redaction-passes.d.ts +0 -82
  296. package/dist/core/redaction-passes.js +0 -377
  297. package/dist/core/runner/memory-consolidation.d.ts +0 -109
  298. package/dist/core/runner/memory-consolidation.js +0 -251
@@ -0,0 +1,98 @@
1
+ import { PROBE_CAUSE_PATH_MAX, PROBE_REASON_MAX, inlineUntrusted } from "./untrusted-text.js";
2
+ export function isPlainRecord(x) {
3
+ try {
4
+ if (x === null || typeof x !== "object" || Array.isArray(x))
5
+ return false;
6
+ const p = Object.getPrototypeOf(x);
7
+ return p === Object.prototype || p === null;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
13
+ export function safeDataValue(obj, key) {
14
+ try {
15
+ const d = Object.getOwnPropertyDescriptor(obj, key);
16
+ return d && "value" in d ? d.value : undefined;
17
+ }
18
+ catch {
19
+ return undefined;
20
+ }
21
+ }
22
+ const PROBE_CAUSE_MAX_SHOWN = 8;
23
+ export function normalizeProbeCause(value) {
24
+ if (!isPlainRecord(value))
25
+ return undefined;
26
+ const code = safeDataValue(value, "code");
27
+ if (typeof code !== "string" || code.trim().length === 0)
28
+ return undefined;
29
+ const family = (raw) => {
30
+ if (!isPlainRecord(raw))
31
+ return undefined;
32
+ const shownRaw = safeDataValue(raw, "shown");
33
+ if (!Array.isArray(shownRaw))
34
+ return undefined;
35
+ const shown = shownRaw
36
+ .filter((p) => typeof p === "string")
37
+ .slice(0, PROBE_CAUSE_MAX_SHOWN)
38
+ .map((p) => inlineUntrusted(p, PROBE_CAUSE_PATH_MAX));
39
+ const totalRaw = safeDataValue(raw, "total");
40
+ const total = typeof totalRaw === "number" && Number.isFinite(totalRaw) ? Math.max(0, Math.floor(totalRaw)) : shown.length;
41
+ return { shown, total: Math.max(total, shown.length) };
42
+ };
43
+ const roots = family(safeDataValue(value, "roots"));
44
+ if (roots === undefined)
45
+ return undefined;
46
+ const further = family(safeDataValue(value, "further"));
47
+ return {
48
+ code: inlineUntrusted(code, PROBE_REASON_MAX),
49
+ roots,
50
+ ...(further !== undefined && further.total > 0 ? { further } : {}),
51
+ };
52
+ }
53
+ export const CHECKPOINT_FEATURES = {
54
+ baseline: { version: 1, introduced: "design/49", writes: "the row itself" },
55
+ resource: { version: 2, introduced: "design/74", writes: "resourceLedger; gate/pendingAction kind resource_limit" },
56
+ binding: { version: 3, introduced: "design/80", writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only" },
57
+ token: { version: 5, introduced: "design/164", writes: "resourceLedger.totalTokens" },
58
+ orgAdmission: { version: 6, introduced: "org-admission", writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned" },
59
+ f012: { version: 7, introduced: "F-012", writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
60
+ realApproval: { version: 8, introduced: "#130/#120", writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it" },
61
+ 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)" },
62
+ requirements: { version: 10, introduced: "#1320", writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)" },
63
+ };
64
+ export const CURRENT_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.baseline.version;
65
+ export const RESOURCE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.resource.version;
66
+ export const BINDING_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.binding.version;
67
+ export const TOKEN_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.token.version;
68
+ export const ORG_ADMISSION_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.orgAdmission.version;
69
+ export const F012_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.f012.version;
70
+ export const REAL_APPROVAL_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.realApproval.version;
71
+ export const FACE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.face.version;
72
+ export const MAX_SUPPORTED_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.requirements.version;
73
+ export function checkpointVersionOf(cp) {
74
+ return cp.version ?? 0;
75
+ }
76
+ export const CHECKPOINT_CONFIG_REFUSAL_CODES = Object.freeze(["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.spec_member_unreadable", "config.spec_unknown_key"]);
77
+ export const isCheckpointConfigRefusalCode = (word) => CHECKPOINT_CONFIG_REFUSAL_CODES.some((w) => w === word);
78
+ export class CheckpointError extends Error {
79
+ code;
80
+ detail;
81
+ constructor(code, message, detail) {
82
+ super(message);
83
+ this.code = code;
84
+ this.detail = detail;
85
+ this.name = "CheckpointError";
86
+ }
87
+ }
88
+ export function encodeAtFidelity(fidelity, value) {
89
+ if (fidelity === "structured-clone")
90
+ return { ok: true, value };
91
+ try {
92
+ const encoded = JSON.stringify(value);
93
+ return { ok: true, value: encoded === undefined ? undefined : JSON.parse(encoded) };
94
+ }
95
+ catch (err) {
96
+ return { ok: false, cause: err };
97
+ }
98
+ }
@@ -159,13 +159,56 @@ export declare function deleteSessionRowsAtStart(rows: Iterable<readonly [string
159
159
  * {@link selectOverduePage} read this one rule.
160
160
  */
161
161
  export declare function checkpointDeadlinePassed(deadline: number | null | undefined, cutoff: number): boolean;
162
+ /** A row's members as the listing faces read them: each read once and widened to `unknown`, since the stored shape is what is judged
163
+ * (a row came back from storage; its type says what was written, not what is there). */
164
+ interface RowMembers {
165
+ /** The key the store files the row under — the authoritative token (the row's own `token` member is judged against it). */
166
+ readonly key: string;
167
+ readonly token: unknown;
168
+ readonly sessionId: unknown;
169
+ readonly scope: unknown;
170
+ readonly status: unknown;
171
+ readonly gate: unknown;
172
+ readonly pendingAction: unknown;
173
+ readonly createdAt: unknown;
174
+ readonly deadline: unknown;
175
+ readonly state: unknown;
176
+ readonly checkpointId: unknown;
177
+ }
178
+ /** The members {@link ROW_MEMBER_SHAPES} reads — no other (none a store's own transitions rewrite). */
179
+ type ShapeMembers = Pick<RowMembers, "gate" | "pendingAction" | "state" | "createdAt" | "deadline">;
180
+ /**
181
+ * THE ROW'S MEMBER SHAPES — the reading every reader of a stored row makes of the members it reaches into, written once: the row
182
+ * judge (`judgeCheckpointRow`, the resume's first rung), the listing projection (`summarizeCheckpoint`) and the listing faces read
183
+ * this table and no shape test of their own, so over these members no face answers `ok` for a row another cannot read. The gate a
184
+ * record of a registered gate kind; the pending action a record of a registered pending kind, a tool approval carrying a tool call
185
+ * id; the state a record; `createdAt` a finite number; `deadline` absent or a finite number. Each entry names the member by its
186
+ * shape, never its value; `undefined` = it reads.
187
+ */
188
+ declare const ROW_MEMBER_SHAPES: readonly [readonly ["gate", (m: ShapeMembers) => string | undefined], readonly ["pendingAction", (m: ShapeMembers) => string | undefined], readonly ["state", (m: ShapeMembers) => string | undefined], readonly ["createdAt", (m: ShapeMembers) => string | undefined], readonly ["deadline", (m: ShapeMembers) => string | undefined]];
189
+ /** A member {@link ROW_MEMBER_SHAPES} names. */
190
+ export type RowMemberName = (typeof ROW_MEMBER_SHAPES)[number][0];
191
+ /** The first member of a row that does not read as {@link ROW_MEMBER_SHAPES} says, and the table's words for it. */
192
+ export interface RowMemberProblem {
193
+ readonly member: RowMemberName;
194
+ readonly problem: string;
195
+ }
196
+ /**
197
+ * Where a row's members fail {@link ROW_MEMBER_SHAPES} — the one reading the row judge, the summary projection and the listing faces
198
+ * make of them: the first member that does not read and the table's words for it; `undefined` = every member reads. Reads the five
199
+ * members the table names, each once. May throw (a member that throws when read); the caller is total.
200
+ */
201
+ export declare function rowMemberProblem(cp: Checkpoint): RowMemberProblem | undefined;
162
202
  /**
163
203
  * The overdue page over a store's rows (`[key, row]` pairs — the key is the authoritative token): pending ∧
164
204
  * {@link checkpointDeadlinePassed} ∧ `facetOf(gate) === facet`, after the cursor, ordered (deadline key, token) ascending, filled up
165
- * to `limit` with the rows whose summary `project` mints. A candidate whose shape the face cannot read, or whose summary cannot be
166
- * projected, is left out and disclosed (`disclose` gets one sentence per such row, on every call) and the page fills on from the
167
- * next candidate; only the rows of the page are projected. `next` is present when a candidate remains after the page's last row
168
- * (a page after it can come back shorter, even empty, when every remaining candidate is damaged).
205
+ * to `limit` with the rows whose summary `project` mints. A candidate the face cannot place ({@link placementDamage}: no string
206
+ * session id, a token other than its key, no readable scope, status or gate kind — the facet reads them) is left out and disclosed
207
+ * (`disclose` gets one sentence per such row, on every call) and the page fills on from the next candidate. Every other row is
208
+ * answered, a damaged one in the summary's unreadable form (`project` is total, as `summarizeCheckpoint` is — the listing of a
209
+ * scope answers that row the same way); only the rows of the page are projected. A `project` of a caller's own that throws
210
+ * leaves its row out, disclosed. `next` is present when a candidate remains after the page's last row (a page after it can come
211
+ * back shorter, even empty, when every remaining candidate is unplaced).
169
212
  */
170
213
  export declare function selectOverduePage(rows: Iterable<readonly [string, Checkpoint]>, query: CheckpointOverdueQueryReading, project: (cp: Checkpoint) => CheckpointSummary, disclose?: (sentence: string) => void): CheckpointPage<CheckpointSummary, CheckpointOverdueCursor>;
171
214
  /**
@@ -1,5 +1,5 @@
1
1
  import { types } from "node:util";
2
- import { facetOf, isGateKind } from "./pause-registry.js";
2
+ import { facetOf, isGateKind, isPendingKind } from "./pause-registry.js";
3
3
  import { receiptRefusal, receiveOwnProperties } from "./own-property-receipt.js";
4
4
  import { principalNameOf } from "./principal-name.js";
5
5
  export const CHECKPOINT_LIST_LIMITS = Object.freeze({
@@ -134,30 +134,50 @@ function orderKey(value) {
134
134
  function membersOf(key, cp) {
135
135
  return { key, token: cp.token, sessionId: cp.sessionId, scope: cp.scope, status: cp.status, gate: cp.gate, pendingAction: cp.pendingAction, createdAt: cp.createdAt, deadline: cp.deadline, state: cp.state, checkpointId: cp.checkpointId };
136
136
  }
137
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
137
138
  function memberOf(value, key) {
138
- return typeof value === "object" && value !== null && key in value ? value[key] : undefined;
139
+ return isRecord(value) && key in value ? value[key] : undefined;
139
140
  }
140
141
  const isStatusWord = (v) => STATUSES.some((s) => s === v);
141
142
  const isFiniteNumber = (v) => typeof v === "number" && Number.isFinite(v);
142
- function listingDamage(m) {
143
+ const gateShape = (m) => (isGateKind(memberOf(m.gate, "kind")) ? undefined : "its gate is not an object of a registered gate kind");
144
+ const ROW_MEMBER_SHAPES = Object.freeze([
145
+ ["gate", gateShape],
146
+ [
147
+ "pendingAction",
148
+ (m) => {
149
+ const kind = memberOf(m.pendingAction, "kind");
150
+ if (!isPendingKind(kind))
151
+ return "its pending action is not an object of a registered pending kind";
152
+ return kind === "tool_approval" && typeof memberOf(m.pendingAction, "toolCallId") !== "string" ? "its tool approval carries no tool call id" : undefined;
153
+ },
154
+ ],
155
+ ["state", (m) => (isRecord(m.state) ? undefined : "its state is not an object")],
156
+ ["createdAt", (m) => (isFiniteNumber(m.createdAt) ? undefined : "its createdAt is not a finite number")],
157
+ ["deadline", (m) => (m.deadline === undefined || isFiniteNumber(m.deadline) ? undefined : "its deadline is not a finite number")],
158
+ ]);
159
+ function shapeProblemOf(m) {
160
+ for (const [member, shape] of ROW_MEMBER_SHAPES) {
161
+ const problem = shape(m);
162
+ if (problem !== undefined)
163
+ return { member, problem };
164
+ }
165
+ return undefined;
166
+ }
167
+ function placementDamage(m) {
143
168
  if (m.token !== m.key)
144
169
  return "its token member is not the key the store files it under";
145
170
  if (typeof m.scope !== "string")
146
171
  return "its scope is not a string";
147
172
  if (!isStatusWord(m.status))
148
173
  return "its status is not one of pending / resolved / expired";
149
- if (!isGateKind(memberOf(m.gate, "kind")))
150
- return "its gate is not an object of a registered gate kind";
151
- const actionKind = memberOf(m.pendingAction, "kind");
152
- if (typeof actionKind !== "string")
153
- return "its pending action is not an object with a kind";
154
- if (actionKind === "tool_approval" && typeof memberOf(m.pendingAction, "toolCallId") !== "string")
155
- return "its tool approval carries no tool call id";
156
- if (!isFiniteNumber(m.createdAt))
157
- return "its createdAt is not a finite number";
158
- if (typeof m.state !== "object" || m.state === null)
159
- return "its state is not an object";
160
- return undefined;
174
+ return gateShape(m);
175
+ }
176
+ function listingDamage(m) {
177
+ return placementDamage(m) ?? shapeProblemOf(m)?.problem;
178
+ }
179
+ export function rowMemberProblem(cp) {
180
+ return shapeProblemOf({ gate: cp.gate, pendingAction: cp.pendingAction, state: cp.state, createdAt: cp.createdAt, deadline: cp.deadline });
161
181
  }
162
182
  function thrownName(e) {
163
183
  return e instanceof Error ? e.constructor.name : typeof e;
@@ -181,7 +201,7 @@ export function selectOverduePage(rows, query, project, disclose) {
181
201
  const m = membersOf(token, cp);
182
202
  if (m.status !== "pending" || !checkpointDeadlinePassed(m.deadline, query.cutoff))
183
203
  continue;
184
- const damage = typeof m.sessionId !== "string" ? "its sessionId is not a string" : listingDamage(m);
204
+ const damage = typeof m.sessionId !== "string" ? "its sessionId is not a string" : placementDamage(m);
185
205
  if (damage !== undefined) {
186
206
  disclose?.(`${rowName(m)}: ${damage} — the overdue listing cannot read it, so it leaves it out`);
187
207
  continue;
@@ -1,12 +1,13 @@
1
1
  import type { AssertAllKeysHandled } from "./ask-origin.js";
2
- import { type StoreFidelity, type Checkpoint, type CheckpointFeature, type CheckpointGate, type PendingAction } from "./checkpoint-store.js";
2
+ import { type CheckpointFeature } from "./checkpoint-features.js";
3
+ import type { StoreFidelity, Checkpoint, CheckpointGate, PendingAction } from "./checkpoint-store.js";
3
4
  /**
4
5
  * The closed set of reader-requirement words this engine knows. The first seven are the feature table's keys
5
6
  * (the features that raised the row format before it froze); then the row digest's scheme; then the members a feature
6
7
  * had carried beside the one its word now names, and the members added after the table, each a capability a reader
7
8
  * must have. Downstream reads them for display only (`CheckpointError.detail.requires`).
8
9
  */
9
- export declare const REQUIREMENT_WORDS: readonly ["resource", "binding", "token", "orgAdmission", "f012", "realApproval", "face", "requirements_digest", "org_admission_inherited", "org_write_grant", "org_governed", "delegation_provenance", "skill_grants", "skill_card_binding", "hands_coordinates", "hands_home", "path_rule_anchors", "path_rule_installations", "permission_mode", "plan_mode_restore", "persisted_rule_mandate", "deployment_authored", "call_names", "write_face", "denial_limit_fallback", "leg_scope", "tool_ceiling", "tool_lists_judged", "own_tool_lists", "approval_targets", "approval_target_reads", "cross_boundary", "mount_site", "skill_scopes", "run_origin", "tool_declaration", "composition_leg", "row_task_id", "held_rows", "source_session"];
10
+ export declare const REQUIREMENT_WORDS: readonly ["resource", "binding", "token", "orgAdmission", "f012", "realApproval", "face", "requirements_digest", "org_admission_inherited", "org_write_grant", "org_governed", "delegation_provenance", "skill_grants", "skill_card_binding", "hands_coordinates", "hands_home", "path_rule_anchors", "path_rule_installations", "permission_mode", "plan_mode_restore", "persisted_rule_mandate", "deployment_authored", "call_names", "write_face", "denial_limit_fallback", "leg_scope", "tool_ceiling", "tool_lists_judged", "own_tool_lists", "approval_targets", "approval_target_reads", "cross_boundary", "mount_site", "skill_scopes", "run_origin", "tool_declaration", "composition_leg", "row_task_id", "held_rows", "source_session", "tool_binding"];
10
11
  export type RequirementWord = (typeof REQUIREMENT_WORDS)[number];
11
12
  /** Runtime twin of {@link RequirementWord}. */
12
13
  export declare function isRequirementWord(word: unknown): word is RequirementWord;
@@ -303,7 +304,7 @@ export declare const PENDING_ACTION_REQUIREMENTS: {
303
304
  readonly ignorable: "shown, never decided (card, listing, transcript or reported count): every read of the name renders, carries transcript or counts";
304
305
  };
305
306
  readonly boundInputHash: {
306
- readonly digest: "decision-read";
307
+ readonly word: "tool_binding";
307
308
  };
308
309
  readonly boundGrantDigest: {
309
310
  readonly word: "skill_card_binding";
@@ -839,7 +840,7 @@ export declare const CHECKPOINT_REQUIREMENTS: {
839
840
  readonly ignorable: "shown, never decided (card, listing, transcript or reported count): every read of the name renders, carries transcript or counts";
840
841
  };
841
842
  readonly boundInputHash: {
842
- readonly digest: "decision-read";
843
+ readonly word: "tool_binding";
843
844
  };
844
845
  readonly boundGrantDigest: {
845
846
  readonly word: "skill_card_binding";
@@ -944,7 +945,13 @@ export declare function requirementsDigestOf(cp: Checkpoint): string;
944
945
  * fidelity, and writes exactly the row returned here), with the frozen version, the row digest of that reading and
945
946
  * the words derived from it (the digest's word among them) — so a reader digests exactly what it read. A row that
946
947
  * store's codec or the digest cannot encode is returned WITHOUT a digest, so it fails its own judge — which the
947
- * commit asks before the write. */
948
+ * commit asks before the write.
949
+ *
950
+ * ONE ABSENCE FORM: the row's top level and its `state` are written with an absent member OMITTED — a mint site may
951
+ * spell one as a key holding `undefined` (the state serializer names every member), and the stamp leaves that key out —
952
+ * so every store holds an engine-written row with one key set, and a key-reading answers as the value-reading does. The
953
+ * members below those two levels are written as given: a tool call's arguments, a decision-read record and the
954
+ * resource ledger are data whose keys the binding hash, the digest and the park's argument comparison read. */
948
955
  export declare function stampCheckpointRequirements(row: Checkpoint, fidelity: StoreFidelity): Checkpoint;
949
956
  /** The row as the store at `fidelity` hands it back, judged — the commit's question before the write. */
950
957
  export declare function judgeAsStored(cp: Checkpoint, fidelity: StoreFidelity): CheckpointRequirementsVerdict;
@@ -1,6 +1,7 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { canonicalize, MAX_DEPTH, UNCANONICALIZABLE } from "./canonical-json.js";
3
- import { CHECKPOINT_FEATURES, checkpointVersionOf, encodeAtFidelity } from "./checkpoint-store.js";
3
+ import { CHECKPOINT_FEATURES, checkpointVersionOf, encodeAtFidelity } from "./checkpoint-features.js";
4
+ import { memberPresent } from "./own-property-receipt.js";
4
5
  export const REQUIREMENT_WORDS = Object.freeze([
5
6
  "resource",
6
7
  "binding",
@@ -42,6 +43,7 @@ export const REQUIREMENT_WORDS = Object.freeze([
42
43
  "row_task_id",
43
44
  "held_rows",
44
45
  "source_session",
46
+ "tool_binding",
45
47
  ]);
46
48
  export function isRequirementWord(word) {
47
49
  return typeof word === "string" && REQUIREMENT_WORDS.includes(word);
@@ -130,7 +132,7 @@ export const PENDING_ACTION_REQUIREMENTS = {
130
132
  askClass: DECISION_READ,
131
133
  classes: DECISION_READ,
132
134
  askReasons: SHOWN,
133
- boundInputHash: DECISION_READ,
135
+ boundInputHash: { word: "tool_binding" },
134
136
  boundGrantDigest: { word: "skill_card_binding" },
135
137
  boundGrants: SHOWN,
136
138
  boundGrantAbsence: SHOWN,
@@ -198,9 +200,9 @@ function digestedMembers(record, table, path, out) {
198
200
  for (const [key, cls] of Object.entries(table)) {
199
201
  if ("ignorable" in cls || "mutable" in cls)
200
202
  continue;
201
- const value = Reflect.get(record, key);
202
- if (value === undefined)
203
+ if (!memberPresent(record, key))
203
204
  continue;
205
+ const value = Reflect.get(record, key);
204
206
  const at = path === "" ? key : `${path}.${key}`;
205
207
  if ("word" in cls)
206
208
  out.push({ path: at, word: cls.word, value });
@@ -296,8 +298,12 @@ function digestOrUnencodable(cp) {
296
298
  }
297
299
  }
298
300
  const unencodableWhy = (at) => `a member a decision reads cannot be encoded: ${at.path} (${at.kind})`;
301
+ function presentMembersOf(record) {
302
+ return Object.fromEntries(Object.entries(record).filter(([name]) => memberPresent(record, name)));
303
+ }
299
304
  export function stampCheckpointRequirements(row, fidelity) {
300
- const { requirementsDigest: _stale, ...framed } = { ...row, version: CHECKPOINT_FEATURES.requirements.version };
305
+ const omitted = presentMembersOf(row);
306
+ const { requirementsDigest: _stale, ...framed } = { ...omitted, ...(typeof omitted.state === "object" && omitted.state !== null ? { state: presentMembersOf(omitted.state) } : {}), version: CHECKPOINT_FEATURES.requirements.version };
301
307
  const stored = encodeAtFidelity(fidelity, framed);
302
308
  const held = (stored.ok ? stored.value : framed);
303
309
  const got = stored.ok ? digestOrUnencodable(held) : { at: { path: "(row)", kind: "codec" } };
@@ -0,0 +1,110 @@
1
+ /**
2
+ * The checkpoint row's own answer to "does anything IN THIS ROW keep this engine from resuming it": every refusal of the
3
+ * resume ladder that the row and this engine decide alone — no deployment fact, no resume input, no decision — judged by
4
+ * one pure, total function ({@link judgeCheckpointRow}). Two readers ask it and no other site decides those refusals:
5
+ * - the resume ladder, at its first statement after the row is read `pending` (resume-admission): a non-`ok` verdict is
6
+ * thrown there, before the claim (the row stays `pending` and byte-identical);
7
+ * - the listing projection (`summarizeCheckpoint`, checkpoint-store.ts), which carries it as `CheckpointSummary.rowVerdict`,
8
+ * so a row this engine will refuse is listed as such instead of as an approvable card.
9
+ *
10
+ * ONE ANSWER, TWO FACES: the verdict's `sentence` is a fixed engine sentence chosen by the refusal's code and arm
11
+ * ({@link ROW_REFUSAL_SENTENCES}), never built from the row; the resume error's `message` is that sentence followed by the
12
+ * row's own diagnostic (member paths, a refused value), and its `detail` is the refusal's. So a listing carries no row
13
+ * content and the refusal a person gets on approving starts with the very sentence the listing showed.
14
+ *
15
+ * WHAT `ok` SAYS: nothing in the row keeps this engine from resuming it — not that the resume will run. The refusals a
16
+ * deployment fact, a resume input or the decision itself decides (no env factory for a remote workspace, organization
17
+ * governance unwired, an aborted signal, the re-supplied parent constraints, a decision that does not bind the parked call)
18
+ * are still told at the resume.
19
+ *
20
+ * ORDER (one law: the specific before the general): a newer row is refused as newer before any segment of it is read (the
21
+ * version ceiling, then a reader word this worker lacks); then a row whose members do not read as every reader reads them — its
22
+ * pause, its state, its stamps (a row with no segment for the arms below to read is damaged, whatever its version; the one table
23
+ * of those shapes is the listing faces' too); then the seats and the axis a release retired (each names what
24
+ * to do about it); then the reader-requirement list and the row digest — "its content does not read the way it was
25
+ * written", told only when nothing more specific is; then the recorded mode words, the sections by their shapes, the
26
+ * frozen chain's tool names, the recorded run origin, and the parent-constraint record's own integrity. The first refusal
27
+ * is the verdict.
28
+ *
29
+ * TOTAL: a row the judge cannot read (a member that throws when read) is `damaged` (`requirements_damaged`); the resume
30
+ * error's `detail.thrownName` names what was thrown, so an engine defect and a damaged row are told apart. A row whose member does
31
+ * not read as the member-shape table says (`rowMemberProblem`, checkpoint-queries.ts: the gate, the pending action, the state,
32
+ * `createdAt`, `deadline`) is the same word with nothing thrown: its refusal names the member in the table's words.
33
+ *
34
+ * The row-seat readers the judge asks and other readers share live here too — the retired seats' refusals and the recorded
35
+ * mode seed (prepare reads the seed; the parked-steer queue's read asks the retired steer seat's refusal).
36
+ */
37
+ import { CheckpointError } from "./checkpoint-features.js";
38
+ import type { Checkpoint, CheckpointRowVerdict, CheckpointState } from "./checkpoint-store.js";
39
+ import type { PermissionMode, ShellGateDoctrine } from "./types.js";
40
+ /**
41
+ * The fixed sentence of each row refusal, keyed by its code and arm (`code|reason`), or — for a recorded word the resume
42
+ * refuses through prepare's refusal channel (`checkpoint.config_refused`) — by prepare's own code (`detail.code`). Engine
43
+ * text only: no sentence names a value, a path or a word the row holds.
44
+ */
45
+ export declare const ROW_REFUSAL_SENTENCES: Readonly<{
46
+ readonly "checkpoint.unsupported_version|version_newer": "This engine cannot resume this checkpoint: it was parked by a newer engine release, whose row this release cannot read. The checkpoint stays pending; resume it on a worker at or above the release that parked it.";
47
+ readonly "checkpoint.unsupported_version|seat_retired": "This engine cannot resume this checkpoint: it carries a seat an earlier engine release wrote and this release retired. The checkpoint stays pending and nothing was consumed; finish it on a worker of a release that still reads that seat, or expire it.";
48
+ readonly "checkpoint.invalid_outcome|requirements_damaged": "This engine cannot resume this checkpoint: its content does not read the way it was written — it was parked by an earlier engine release whose reading this release changed, or it was changed in storage. The checkpoint stays pending; start the task again (a worker of the release that parked it may still resume it).";
49
+ readonly "checkpoint.invalid_outcome|real_approval_damaged": "This engine cannot resume this checkpoint: its real-approval mark is missing or malformed (a corruption or downgrade guard). The checkpoint stays pending.";
50
+ readonly "checkpoint.invalid_outcome|real_approval_forged": "This engine cannot resume this checkpoint: it carries a real-approval mark no release of its row format ever wrote (a corruption or forgery guard). The checkpoint stays pending.";
51
+ readonly "checkpoint.invalid_outcome|read_face_damaged": "This engine cannot resume this checkpoint: its read-face section is missing or malformed (a corruption or downgrade guard). The checkpoint stays pending.";
52
+ readonly "checkpoint.invalid_outcome|read_face_forged": "This engine cannot resume this checkpoint: it carries a read-face section no release of its row format ever wrote (a corruption or forgery guard). The checkpoint stays pending.";
53
+ readonly "checkpoint.invalid_outcome|write_face_damaged": "This engine cannot resume this checkpoint: its write-face section is malformed (a corruption guard). The checkpoint stays pending.";
54
+ readonly "checkpoint.invalid_outcome|skill_grants_damaged": "This engine cannot resume this checkpoint: its skill-grant section does not read as grant rows under this engine — damaged, or written by an earlier release whose entries this release reads differently. The checkpoint stays pending; finish it on a worker of the release that parked it, or expire it.";
55
+ readonly "checkpoint.invalid_outcome|skill_scopes_damaged": "This engine cannot resume this checkpoint: its skill-scope section does not read as a list of named skills (a damaged section). The checkpoint stays pending; finish it on a worker of the release that parked it, or expire it.";
56
+ readonly "checkpoint.invalid_outcome|hands_coordinates_damaged": "This engine cannot resume this checkpoint: one of its recorded workspace coordinates is not an absolute path (a corruption guard). The checkpoint stays pending.";
57
+ readonly "checkpoint.invalid_outcome|constraint_chain_missing": "This engine cannot resume this checkpoint: it requires parent constraints but does not carry both their frozen chain and its digest (a corruption or downgrade guard). The checkpoint stays pending.";
58
+ readonly "checkpoint.walltime_axis_retired|": "This engine cannot resume this checkpoint: its budget carries a wall-clock allocation, an axis this engine retired, so resuming here would run the work with that ceiling unenforced. The checkpoint stays pending; finish it on a worker of the previous release, or start a fresh task bounded by tokens or budget.";
59
+ readonly "resume.parent_constraint_mismatch|": "This engine cannot resume this checkpoint: its own recorded constraint chain does not match the digest it records (a corrupt or inconsistently minted row). The checkpoint stays pending.";
60
+ readonly "config.permission_mode_invalid": "This engine cannot resume this checkpoint: a permission mode it records is not one this engine reads (or not one a plan can return to). The checkpoint stays pending; finish it on a worker of the release that parked it, or expire it.";
61
+ readonly "config.run_origin_invalid": "This engine cannot resume this checkpoint: the run origin it records is not a word this engine knows. The checkpoint stays pending; finish it on a worker of the release that parked it, or expire it.";
62
+ readonly "config.tool_face_control": "This engine cannot resume this checkpoint: its frozen inherited constraint chain records a tool name in a spelling this engine does not replay. The checkpoint stays pending; finish it on a worker of the release that parked it, or expire it and run the work again.";
63
+ }>;
64
+ /**
65
+ * The verdict of a row nothing could read — one the judge threw on, or one the listing projection could not project: `damaged` /
66
+ * `requirements_damaged` under the fixed sentence. The total judge answers it, and the projection answers it for a row the judge
67
+ * called `ok` but a summary cannot be made of, so a listing never presents a row it cannot read as an approvable card.
68
+ */
69
+ export declare const UNREADABLE_ROW_VERDICT: CheckpointRowVerdict;
70
+ /**
71
+ * The ONE refusal of the RETIRED pre-queue single steer seat (`state.pendingSteer`, written before the queue existed): the
72
+ * seat has no `inputId`, `seq` or actor, so folding it in would mint a synthetic identity nothing else can name. The refusal is
73
+ * `checkpoint.unsupported_version` with `reason: "seat_retired"` — terminal for the row's bytes; the host decides the parked
74
+ * instruction on its own surface and parks it again through `setPendingSteer` if it still applies. The row's judge
75
+ * ({@link judgeCheckpointRow}) and the queue's read (`readPendingSteerQueue`, checkpoint-store.ts) ask it. Returns the
76
+ * refusal, `undefined` for none.
77
+ */
78
+ export declare function retiredSteerSeatRefusal(state: object): CheckpointError | undefined;
79
+ /**
80
+ * The ONE refusal of a retired mode seed — one of the row's own refusals ({@link judgeCheckpointRow}, read PRE-CAS on every
81
+ * resume kind and by every listing): a row whose `inheritedGate` still carries a retired member is refused as the engine refuses
82
+ * every retired row seat ({@link retiredSteerSeatRefusal}) — `checkpoint.unsupported_version` with `reason: "seat_retired"` —
83
+ * terminal for the row's bytes on this engine, and nothing consumed: the row stays byte-identical and `pending`. No engine
84
+ * reads the retired keys into a mode any more; an engine at 7.38.x or earlier still does, so the row can be resumed there once
85
+ * (its next suspend writes `permissionMode`), or expired (`CheckpointStore.expire`). Returns the refusal, `undefined` for none.
86
+ */
87
+ export declare function retiredModeSeedRefusal(state: Pick<CheckpointState, "inheritedGate">): CheckpointError | undefined;
88
+ /**
89
+ * The mode seed a row records (the 7.34.0 shape), read at prepare after the row's judge ({@link retiredModeSeedRefusal} among its refusals) has screened the row:
90
+ * `permissionMode` must be a member of the closed set and `prePlanMode` a mode a plan can return to (else
91
+ * `config.permission_mode_invalid`, the row cannot be resumed under a word this engine does not know); the shell floor is
92
+ * `"always"` or absent. Nothing here migrates or guesses.
93
+ */
94
+ export declare function recordedModeSeed(gate: Pick<NonNullable<CheckpointState["inheritedGate"]>, "permissionMode" | "prePlanMode" | "shellGate"> | undefined): {
95
+ permissionMode?: PermissionMode;
96
+ prePlanMode?: PermissionMode;
97
+ shellGate?: ShellGateDoctrine;
98
+ };
99
+ /** What a total judge carries when the row could not be judged: the name of what was thrown, bounded (never its message — a message can quote a stored value). */
100
+ export declare function boundedThrownName(e: unknown): string;
101
+ /**
102
+ * The row's verdict for THIS engine: `ok`, `lacking` (a newer engine can resume it: `checkpoint.unsupported_version` /
103
+ * `version_newer`, `requires` the reader words it lacks when its requirement list named them), or `damaged` (this engine
104
+ * does not resume these bytes). Pure (reads no clock, no random, no deployment) and total; the verdict is frozen. A store's
105
+ * listing carries it as `CheckpointSummary.rowVerdict`; a whole-row reader (`listBySession`, an operator queue) asks it here.
106
+ */
107
+ export declare function judgeCheckpointRow(cp: Checkpoint): CheckpointRowVerdict;
108
+ /** The refusal the resume throws for a row whose verdict is not `ok` — the verdict's code, its sentence then the row's
109
+ * diagnostic as the message, the refusal's own detail — or `undefined` for an `ok` row. Always judged now, never memoized. */
110
+ export declare function checkpointRowRefusal(cp: Checkpoint): CheckpointError | undefined;