@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
@@ -1,10 +1,10 @@
1
+ import { CheckpointError, type CheckpointErrorReason } from "./checkpoint-features.js";
1
2
  import type { GateOutcome, HostDecisionFacts } from "./gate-outcome.js";
2
3
  import { type ExecutionOutcomeRecordWord } from "./checkpoint-execution-record.js";
3
4
  import { type HolderJudge } from "./checkpoint-generation.js";
4
5
  import { type CheckpointPause } from "./pause-registry.js";
5
6
  import { type CheckpointDeleteGuard, type CheckpointOverdueCursor, type CheckpointOverdueQuery, type CheckpointPage, type CheckpointRowRead, type CheckpointSessionCursor, type CheckpointSessionQuery } from "./checkpoint-queries.js";
6
7
  import type { SystemInjectionPriority } from "./task-notification.js";
7
- import { type SteerReplayFacet } from "./steer-replay.js";
8
8
  import type { QuestionAnswer } from "./ask-question.js";
9
9
  import type { ReadEntry } from "../tools/fs/safety.js";
10
10
  import type { RepairBundle } from "../agents/repair-loop.js";
@@ -14,6 +14,7 @@ import type { NestedUsageAccum, PermissionMode, ShellGateDoctrine, TaskResult }
14
14
  import type { ActiveWorktreeSession, AgentMessage } from "../internal/harness-types.js";
15
15
  import type { ReopenReason } from "./resume-startup-cause.js";
16
16
  import { type RetentionDeclaration } from "./retention.js";
17
+ export { BINDING_CHECKPOINT_VERSION, CHECKPOINT_CONFIG_REFUSAL_CODES, CHECKPOINT_FEATURES, CheckpointError, checkpointVersionOf, CURRENT_CHECKPOINT_VERSION, encodeAtFidelity, F012_CHECKPOINT_VERSION, FACE_CHECKPOINT_VERSION, isCheckpointConfigRefusalCode, isPlainRecord, MAX_SUPPORTED_CHECKPOINT_VERSION, normalizeProbeCause, ORG_ADMISSION_CHECKPOINT_VERSION, REAL_APPROVAL_CHECKPOINT_VERSION, RESOURCE_CHECKPOINT_VERSION, safeDataValue, TOKEN_CHECKPOINT_VERSION, type CheckpointConfigRefusalCode, type CheckpointErrorField, type CheckpointErrorReason, type CheckpointFeature, type CheckpointFeatureRow, } from "./checkpoint-features.js";
17
18
  /**
18
19
  * design/45 — the **durable-checkpoint** primitive: cross-process / resumable `suspend`/`resume`.
19
20
  *
@@ -242,20 +243,6 @@ export interface ProbeCause {
242
243
  * for the same reason its `PROBE_CAUSE_PATH_MAX` sibling is homed there (a value import from tools/fs
243
244
  * back into this module closes an ESM cycle), so mint, gate and persist read ONE cap. */
244
245
  export { PROBE_REASON_MAX } from "./untrusted-text.js";
245
- /**
246
- * The ONE validator for a {@link ProbeCause} arriving from a probe.
247
- *
248
- * The value crosses a trust boundary twice — once at the gate (where a deployment-supplied probe hands
249
- * it over) and once at the persist boundary (where {@link buildRiskDescriptor} is an exported function a
250
- * caller may reach directly) — so both call it rather than each writing its own idea of "valid". A
251
- * malformed cause yields `undefined`: the ASK still stands (the verdict was never this member's to
252
- * decide), the card simply carries no account. Fail-closed on the disclosure, never on the gate.
253
- *
254
- * Every field is re-derived rather than trusted: strings are neutralized and capped individually, the
255
- * shown list is clamped, and `total` is coerced to a non-negative integer that cannot understate what is
256
- * shown (a `total` below `shown.length` would turn an honest count into a false reassurance).
257
- */
258
- export declare function normalizeProbeCause(value: unknown): ProbeCause | undefined;
259
246
  /**
260
247
  * design/80 §D-E: the DETERMINISTIC severity tier (1..5) for an escalation checkpoint, a PURE function of the
261
248
  * tripped {@link RiskDescriptor.axes} (NO LLM, NO clock/random) so the inbox's sort order is stable and
@@ -366,13 +353,6 @@ export interface PendingSteerInput {
366
353
  priority?: SystemInjectionPriority;
367
354
  runOrigin?: import("./run-origin.js").RunOrigin;
368
355
  }
369
- /** True ONLY for a PLAIN data record (not null / array / class-instance / proxy-with-odd-prototype) — the only
370
- * shape we safely digest. Adversarial args (a proxy, a getter that throws) must never crash the mint, so this +
371
- * {@link safeDataValue}/{@link safeKeys} make {@link buildRiskDescriptor} fully TOTAL. */
372
- export declare function isPlainRecord(x: unknown): x is Record<string, unknown>;
373
- /** Read `obj[key]` as a DATA property only — NEVER invokes a getter/accessor (so a throwing getter can't escape
374
- * AND a non-deterministic getter can't vary the digest); a trapped descriptor read ⇒ undefined. */
375
- export declare function safeDataValue(obj: Record<string, unknown>, key: string): unknown;
376
356
  /**
377
357
  * design/80 §D-E: build the DETERMINISTIC, REDACTED {@link RiskDescriptor} for an escalation checkpoint at
378
358
  * MINT. Pure — a function ONLY of (`toolName`, `args`, the D-2 `safety` axis, the `shellGated` flag); it reads
@@ -573,10 +553,10 @@ export type ResumeOutcome = {
573
553
  */
574
554
  boundCallId: string;
575
555
  /**
576
- * design/80 D-1 §2 (slice 1a.2): the **server-minted opaque** hash of the pending tool call's input
556
+ * design/80 D-1 §2 (slice 1a.2): the **server-minted opaque** hash of the pending tool call — its tool and the input
577
557
  * that the human actually saw/approved (`PendingAction.tool_approval.boundInputHash`, computed by the
578
- * engine at suspend-mint via {@link import("./canonical-json.js").boundInputHashOf} over the post-hook
579
- * `args`). The caller echoes it VERBATIM — it is opaque; the SDK/service NEVER re-canonicalize args
558
+ * engine at suspend-mint via {@link import("./canonical-json.js").exactBoundInputHashOf} over the call's `toolName` and
559
+ * post-hook `args`). The caller echoes it VERBATIM — it is opaque; the SDK/service NEVER re-canonicalize args
580
560
  * (a second runtime's serialization could diverge → false mismatch → fail-closed a
581
561
  * legitimate approval). The resume verifies it by **string equality** against the checkpoint's
582
562
  * persisted value (`checkpoint.invalid_outcome`, fail-closed, pre-CAS) — closing the TOCTOU "same call
@@ -864,9 +844,9 @@ export type PendingAction = {
864
844
  * list of well-formed entries; a row parked before it reads ABSENT. Display metadata — no gate, CAS or resume path reads it. */
865
845
  askReasons?: readonly import("./ask-origin.js").AskReason[];
866
846
  /**
867
- * design/80 D-1 §2 (slice 1a.2): the server-minted **opaque** boundInputHash of {@link args} — a
868
- * SHA-256 (hex) via {@link import("./canonical-json.js").boundInputHashOf}, computed ONCE here at
869
- * suspend-mint and persisted on the row. The operator sees it (surfaced on the pending record) and
847
+ * design/80 D-1 §2 (slice 1a.2): the server-minted **opaque** boundInputHash of {@link toolName} with {@link args} — a SHA-256 (hex)
848
+ * via {@link import("./canonical-json.js").exactBoundInputHashOf}, computed ONCE here at suspend-mint and persisted on the row, which says
849
+ * so with its `tool_binding` requirement word (a row that does not is refused `requirements_damaged`). The operator sees it (surfaced on the pending record) and
870
850
  * echoes it back as {@link ResumeOutcome} `boundInputHash`; the resume verifies opaque string equality
871
851
  * against THIS value (never re-serializing the args — see the field's doc). Absent only on a legacy
872
852
  * pre-1a.2 checkpoint (deserialized without it), in which case the resume skips the hash check.
@@ -1203,7 +1183,7 @@ export interface CheckpointState {
1203
1183
  * revive the mode where the redeeming deployment denies it, and an `auto` row arms only where a face is
1204
1184
  * wired. Absent on a task that declared nothing and inherited nothing (`default`). Rows written before this
1205
1185
  * member carried `autoModeRequested` / `approverPosture` / a doctrine `shellGate`; no engine since 7.39.0 reads
1206
- * them — such a row is refused before the claim ({@link refuseRetiredModeSeed}). */
1186
+ * them — such a row is refused before the claim (`retiredModeSeedRefusal`, checkpoint-row-verdict.ts). */
1207
1187
  permissionMode?: PermissionMode;
1208
1188
  /** Beside a recorded `plan`: the declared word the leg had when a steer or the model's `EnterPlanMode` moved it into
1209
1189
  * plan — the mode an approved or edited `plan_review` resumes under ({@link import("./mode-policy.js").modeRequestAfterResume}). */
@@ -1453,128 +1433,6 @@ export interface CheckpointState {
1453
1433
  export type SerializedCheckpointState = {
1454
1434
  [K in keyof Required<CheckpointState>]: CheckpointState[K];
1455
1435
  };
1456
- /**
1457
- * The checkpoint FEATURE TABLE — one row per feature that ever raised the row format: its schema version, and
1458
- * what a mint owed when the feature was present (`writes`, prose). The per-feature constants below ARE the rows'
1459
- * versions. The table is CLOSED at `requirements` (v10): every live mint stamps 10 and lists the row's
1460
- * reader-requirement words beside it (`Checkpoint.requires`, checkpoint-requirements.ts) — a later segment adds a
1461
- * word there, never a row here. Each feature key below (but `baseline` / `requirements`) is itself one of those
1462
- * words, and whether a v10 row carries the feature is read off the row's content by the requirement tables.
1463
- *
1464
- * A v≤9 row was stamped the HIGHEST feature it carried, so the number records only the top feature; the resume
1465
- * rules that read a v≤9 row by number are exact to the version at which their feature was the top
1466
- * (`realApproval` is version-recorded at v8 and marker-recorded — `readFace.realApproval` — at v9).
1467
- *
1468
- * v4 is a GAP, deliberately: the retired cross-slice wall-clock allocation. This worker still reads v4
1469
- * rows; a ledger carrying the retired axis is refused by FIELD (`walltime_axis_retired`) at any version.
1470
- */
1471
- export declare const CHECKPOINT_FEATURES: {
1472
- /** The baseline shape: a plain human-approval suspend before any feature raised the format. No live
1473
- * mint stamps it today; it is the floor of the ladder and the reading of a row written before any feature. */
1474
- readonly baseline: {
1475
- readonly version: 1;
1476
- readonly introduced: "design/49";
1477
- readonly writes: "the row itself";
1478
- };
1479
- /** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction an older worker
1480
- * cannot handle (it rejects pre-CAS; the row stays `pending`, retryable on a newer worker). */
1481
- readonly resource: {
1482
- readonly version: 2;
1483
- readonly introduced: "design/74";
1484
- readonly writes: "resourceLedger; gate/pendingAction kind resource_limit";
1485
- };
1486
- /** A HUMAN-DECISION park (tool approval or plan_review) of the binding era: the decision-action binding
1487
- * (`boundCallId` + `boundInputHash` on a tool_approval) is enforced ENTIRELY by the resuming worker, so a
1488
- * pre-binding worker must reject the row rather than execute the pending tool unverified. Like `resource`,
1489
- * this row is a park-kind FLOOR: a plan_review park carries it with no binding (it was introduced above it);
1490
- * whether a tool_approval row carries its hash is the resume binding rung's own conjunction. */
1491
- readonly binding: {
1492
- readonly version: 3;
1493
- readonly introduced: "design/80";
1494
- readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only";
1495
- };
1496
- /** A ledger carrying a cross-slice TOKEN allocation: the window clamp and the exhausted-resume fail-fast
1497
- * live in the resuming worker. A ledger with no token total keeps the historic stamps. */
1498
- readonly token: {
1499
- readonly version: 5;
1500
- readonly introduced: "design/164";
1501
- readonly writes: "resourceLedger.totalTokens";
1502
- };
1503
- /** Org-memory admission freeze state (the adjudicated-empty record included): the session/delegation
1504
- * freeze on resume and the tenant-admission door live in the resuming worker. */
1505
- readonly orgAdmission: {
1506
- readonly version: 6;
1507
- readonly introduced: "org-admission";
1508
- readonly writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned";
1509
- };
1510
- /** The F-012 durable enforcement fields: the frozen ancestor projection chain + its digest (one write, the
1511
- * resume-edit re-adjudication executes it) and/or the delegation-provenance aggregate a resume re-seeds. */
1512
- readonly f012: {
1513
- readonly version: 7;
1514
- readonly introduced: "F-012";
1515
- readonly writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance";
1516
- };
1517
- /** A gate carrying {@link RealApprovalGateBit}: the no-org-wiring refusal and the org_unavailable resume
1518
- * belt live in the resuming worker. Minted at ONE site (the approval park); the two always-mounted
1519
- * integrity policies mint it on any durable deployment, org-governed or not. */
1520
- readonly realApproval: {
1521
- readonly version: 8;
1522
- readonly introduced: "#130/#120";
1523
- readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it";
1524
- };
1525
- /** The READ-face section ({@link CheckpointState.readFace}): resolved face + normalized deny-set additions,
1526
- * written only for a non-default posture; the stricter-wins fold lives in the resuming worker. Carries the
1527
- * redundant governance marker for `realApproval` (see the table note above). Absent ⇒ default posture. */
1528
- readonly face: {
1529
- readonly version: 9;
1530
- readonly introduced: "design/199";
1531
- 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)";
1532
- };
1533
- /** The last row: the reader-requirement words ({@link CheckpointRow.requires}). Every live mint stamps it, so a
1534
- * worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted from here on, `version_newer`, pre-CAS. */
1535
- readonly requirements: {
1536
- readonly version: 10;
1537
- readonly introduced: "#1320";
1538
- readonly writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)";
1539
- };
1540
- };
1541
- /** One row of {@link CHECKPOINT_FEATURES}. */
1542
- export interface CheckpointFeatureRow {
1543
- readonly version: number;
1544
- /** Where the feature came from — a design or ticket tag, documentation only. */
1545
- readonly introduced: string;
1546
- /** What a mint wrote when the feature was present (prose; the mint sites are the code). */
1547
- readonly writes: string;
1548
- }
1549
- /** The feature words — the row keys of {@link CHECKPOINT_FEATURES}. */
1550
- export type CheckpointFeature = keyof typeof CHECKPOINT_FEATURES;
1551
- /** The BASELINE {@link Checkpoint} schema version — the `baseline` row. NOT the highest a resume accepts (that
1552
- * is {@link MAX_SUPPORTED_CHECKPOINT_VERSION}); resume stays forward-compatible by `<=` against MAX, never `===`. */
1553
- export declare const CURRENT_CHECKPOINT_VERSION: 1;
1554
- /** The `resource` row's version. */
1555
- export declare const RESOURCE_CHECKPOINT_VERSION: 2;
1556
- /** The `binding` row's version. */
1557
- export declare const BINDING_CHECKPOINT_VERSION: 3;
1558
- /** The `token` row's version. v4 (the retired wall-clock total) is deliberately not reused. */
1559
- export declare const TOKEN_CHECKPOINT_VERSION: 5;
1560
- /** The `orgAdmission` row's version. */
1561
- export declare const ORG_ADMISSION_CHECKPOINT_VERSION: 6;
1562
- /** The `f012` row's version. */
1563
- export declare const F012_CHECKPOINT_VERSION: 7;
1564
- /** The `realApproval` row's version. */
1565
- export declare const REAL_APPROVAL_CHECKPOINT_VERSION: 8;
1566
- /** The `face` row's version. */
1567
- export declare const FACE_CHECKPOINT_VERSION: 9;
1568
- /** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table, and the stamp
1569
- * of every live mint (the table is closed there); a higher one is rejected pre-CAS with {@link CheckpointError}
1570
- * `unsupported_version` (the row stays `pending`, retryable on a newer worker). */
1571
- export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 10;
1572
- /**
1573
- * Read a checkpoint's schema version, defaulting an absent field to **legacy `0`** (a 1.67-era checkpoint
1574
- * written before the field existed — it carries no `workspaceHandle`, so resuming it the v1 way is safe).
1575
- * Compare with `<= MAX_SUPPORTED_CHECKPOINT_VERSION`, never `=== CURRENT_CHECKPOINT_VERSION` (design/49 §3).
1576
- */
1577
- export declare function checkpointVersionOf(cp: Pick<Checkpoint, "version">): number;
1578
1436
  /**
1579
1437
  * design/74 R3-B: cross-slice resource accounting carried by a `resource_limit` {@link Checkpoint}. The
1580
1438
  * total budget is the human's allocation; `spent*` accumulate across the resume→re-suspend chain (debited
@@ -2010,6 +1868,28 @@ export declare function checkpointIndexFacts(cp: Checkpoint): CheckpointIndexFac
2010
1868
  * cause and the inbox summary both read it here.
2011
1869
  */
2012
1870
  export declare function planReviewRequesterOf(pendingAction: PendingAction): string | undefined;
1871
+ /**
1872
+ * A checkpoint row's own answer to "does anything in this row keep this engine from resuming it" — every refusal of the
1873
+ * resume ladder the row and this engine decide alone, ahead of every deployment fact, resume input and decision
1874
+ * (`judgeCheckpointRow`, checkpoint-row-verdict.ts). The resume throws it at its first rung; a listing carries it
1875
+ * ({@link CheckpointSummary.rowVerdict}). `ok` is not "the resume will run": a deployment fact (an env factory, organization
1876
+ * governance), a resume input or the decision can still refuse it then.
1877
+ * - `lacking` ⇔ `code` `checkpoint.unsupported_version` with `reason` `version_newer`: a newer engine can resume it;
1878
+ * `requires` names the reader words this engine lacks when the row's requirement list named them (words only, at most
1879
+ * eight, never the row's token).
1880
+ * - `damaged`: this engine does not resume these bytes; `code` / `reason` are the resume's refusal, `sentence` its fixed
1881
+ * engine sentence (the resume's error `message` starts with it and goes on with the row's own diagnostic).
1882
+ * A consumer that meets a `kind` it does not know reads it as not `ok`.
1883
+ */
1884
+ export type CheckpointRowVerdict = {
1885
+ readonly kind: "ok";
1886
+ } | {
1887
+ readonly kind: "lacking" | "damaged";
1888
+ readonly code: CheckpointError["code"];
1889
+ readonly reason?: CheckpointErrorReason;
1890
+ readonly requires?: readonly string[];
1891
+ readonly sentence: string;
1892
+ };
2013
1893
  /**
2014
1894
  * design/80 assistant-scheduler seam #1: a LIGHTWEIGHT projection of one PENDING
2015
1895
  * checkpoint, returned in bulk by {@link CheckpointStore.listByScope} so a supervisor scheduler can list a
@@ -2020,14 +1900,25 @@ export declare function planReviewRequesterOf(pendingAction: PendingAction): str
2020
1900
  export interface CheckpointSummary {
2021
1901
  /** The resume capability token ({@link Checkpoint.token}). */
2022
1902
  token: CheckpointToken;
1903
+ /** ALWAYS present — the row's own answer to whether anything in it keeps THIS engine from resuming it
1904
+ * ({@link CheckpointRowVerdict}; `judgeCheckpointRow`): the verdict the resume throws at its first rung, so a row this engine
1905
+ * refuses is not listed as an approvable card. `ok` is not "the resume will run": a deployment fact, a resume input or the
1906
+ * decision can still refuse it at the resume. Engine text and closed words only — no row content.
1907
+ *
1908
+ * **A ROW THE PROJECTION CANNOT READ** (a record the row lacks or holds as something else, a member that throws when read) is
1909
+ * still ONE row of the listing, never a failed page: its `rowVerdict` is never `ok` (the judge's verdict, else `damaged` /
1910
+ * `requirements_damaged`), it carries `token`, `sessionId` and `scope`, and — each only when it reads — `gateKind`, `createdAt`
1911
+ * and `deadline`; it carries no other member. A consumer renders such a row by its `rowVerdict`. */
1912
+ rowVerdict: CheckpointRowVerdict;
2023
1913
  /** Non-secret stable identity ({@link Checkpoint.checkpointId}) — absent on legacy rows. */
2024
1914
  checkpointId?: string;
2025
1915
  /** The suspended task / session id ({@link Checkpoint.sessionId}). */
2026
1916
  sessionId: string;
2027
1917
  /** The multi-tenant scope this checkpoint lives in ({@link Checkpoint.scope}) — always equal to the query's. */
2028
1918
  scope: string;
2029
- /** The gate's discriminant ({@link CheckpointGate}.kind): which kind of pause this is. */
2030
- gateKind: CheckpointGate["kind"];
1919
+ /** The gate's discriminant ({@link CheckpointGate}.kind): which kind of pause this is. Present on every row the projection reads;
1920
+ * OMITTED only on a row whose gate does not read (see {@link rowVerdict}), whose verdict is then not `ok`. */
1921
+ gateKind?: CheckpointGate["kind"];
2031
1922
  /** The deterministic risk tier (1..5) when the gate carries a {@link RiskDescriptor} (the `human` /
2032
1923
  * `irreversible_ask` approval escalations), derived via {@link riskSeverity} from the descriptor's axes —
2033
1924
  * the SAME value as `gate.riskDescriptor.severity`, recomputed from the single source helper rather than
@@ -2040,7 +1931,8 @@ export interface CheckpointSummary {
2040
1931
  * present whenever the checkpoint carries a {@link Checkpoint.resourceLedger} (every resource_limit suspend,
2041
1932
  * and every approval suspend on the D-E-core budget-read path); `undefined` when no ledger is attached. */
2042
1933
  spentMicroUsd?: number;
2043
- /** The awaiting-human SLA / abandonment deadline ({@link Checkpoint.deadline}, epoch ms) when present. */
1934
+ /** The awaiting-human SLA / abandonment deadline ({@link Checkpoint.deadline}, epoch ms) when it is present and a finite number
1935
+ * (a stored value that is not one — a `NaN` a JSON round trip left, a value of another type — is left off, not echoed). */
2044
1936
  deadline?: number;
2045
1937
  /** design S1d (source-tag): the issuing worker's session id ({@link Checkpoint.sourceSessionId}) — projected so
2046
1938
  * a supervisor inbox attributes each pending checkpoint to its worker in ONE `listByScope` call (no N+1
@@ -2062,9 +1954,9 @@ export interface CheckpointSummary {
2062
1954
  * tool-less park (`resource_limit` / `plan_review` / `task_done` — none of which binds a tool call)
2063
1955
  * gets the key **OMITTED**, never `null` and never a present-but-`undefined` property. The
2064
1956
  * `PendingAction` arms for those kinds declare no tool/binding fields at all, so there is nothing to
2065
- * project; `summarizeCheckpoint` spreads them conditionally for exactly this reason. A consumer
2066
- * therefore tests presence (`"toolCallId" in summary`), and a re-projecting service (BFF / SDK wire
2067
- * face) must not materialize the keys as `null` on the way out. Pinned in
1957
+ * project; `summarizeCheckpoint` spreads them conditionally for exactly this reason. A consumer reads
1958
+ * presence by value (INTEGRATION-CORE reading rule 1; here key and value agree), and a re-projecting
1959
+ * service (BFF / SDK wire face) must not materialize the keys as `null` on the way out. Pinned in
2068
1960
  * `test/checkpoint-store.test.ts` ("tool-less park …"). */
2069
1961
  toolCallId?: string;
2070
1962
  /** The id of the tool call that asked for this plan pause ({@link PendingAction} `plan_review.requestedByCallId`) —
@@ -2211,560 +2103,29 @@ export interface CheckpointSummary {
2211
2103
  * {@link CheckpointSummary}. Shared by every {@link CheckpointStore} impl so the projection is IDENTICAL
2212
2104
  * across the in-memory, file, and durable backends (the anti-drift guard) — `severity` always derives from the
2213
2105
  * gate's {@link RiskDescriptor} via the single {@link riskSeverity} helper, `spentMicroUsd` always reads
2214
- * {@link ResourceLedger.spentMicroUsd}. Pure; reads no clock/random. `disclose` receives one sentence for a damage the
2215
- * projection reads past — descriptor axes that are not a plain record, or a mark that is not a boolean (the `severity`
2216
- * is then the valid marks' floor, or omitted) — naming the row by checkpoint id and session (never its token) and the member by its
2217
- * shape (never its value); it is called synchronously and every listing calls it again. A store hands it its own seat.
2218
- */
2219
- export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence: string) => void): CheckpointSummary;
2220
- /**
2221
- * WHICH arm of a multi-arm {@link CheckpointError} `code` fired (requested 2026-08-10: a deployment retry
2222
- * policy needs to tell "a newer worker can redeem this row" from "this row is damaged/caller-declared and
2223
- * no worker ever will" — blanket-retriable and gate-shape heuristics were both refuted downstream, so the
2224
- * throw site carries the fact it always knew).
2225
- *
2226
- * A CLOSED SET with one home, registered in `docs/CLOSED-SETS.md`. It is carried in an OPTIONAL member, so
2227
- * the compiler is silent when a throw site omits it, and a site that omits it hands the host a refusal it
2228
- * cannot classify — the registry's mint-obligation leg is what makes the omission loud (every
2229
- * `checkpoint.unsupported_version` construction site must spell one of these words AT the site).
2106
+ * {@link ResourceLedger.spentMicroUsd}, `rowVerdict` is the row's `judgeCheckpointRow`. Pure; reads no clock/random. The
2107
+ * summary holds no reference into the row (a display member that is a value of its own is a copy), so editing a summary
2108
+ * never edits the stored row.
2230
2109
  *
2231
- * · `unsupported_version` arms: `"version_newer"` (the row's format is newer than this worker's, or it lists a
2232
- * reader-requirement word this worker lacks — `detail.requires` names those words — retryable on a newer
2233
- * worker), `"env_factory_missing"` (retryable on a factory-wired worker),
2234
- * `"governed_unwired"` (retryable on an org-wired worker), `"origin_missing"` (a pending approval row
2235
- * minted before the ask's origin was persisted on the park — terminal for the row's bytes; the host
2236
- * decides the orphaned card itself, no worker version redeems it), `"tool_identity_missing"` (a pending approval row
2237
- * whose tool member is not whole — parked before 7.58.0 recorded the declaration, or damaged: an allow is refused, a deny
2238
- * settles it; a worker of the release that parked it still reads it), `"ledger_event_unknown"` (a durable
2239
- * LEDGER carries an event kind this binary does not know, so the replay is refused rather than served
2240
- * incomplete — the one arm that is not row-scoped: NO row in that data directory is readable here, so
2241
- * the host rolls the binary forward instead of routing one token elsewhere), `"seat_retired"` (the row
2242
- * carries a seat this engine no longer reads — terminal for the row's bytes: the retired pre-queue single
2243
- * steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
2244
- * `inheritedGate`, which an engine at 7.38.x or earlier still reads once).
2245
- * · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
2246
- * `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"skill_scopes_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"`, `"bound_input_hash_missing"` (all terminal for the row's
2247
- * current bytes — no worker version redeems a damaged row).
2110
+ * `disclose` receives one sentence for a damage the projection reads past — descriptor axes that are not a plain record, or
2111
+ * a mark that is not a boolean (the `severity` is then the valid marks' floor, or omitted) — naming the row by checkpoint id
2112
+ * and session (never its token) and the member by its shape (never its value); it is called synchronously and every listing
2113
+ * calls it again. A store hands it its own seat. `verdict` is a store's memo of this row's `judgeCheckpointRow` under this
2114
+ * engine (an in-tree store keeps it by the stored row object, so a replaced row is judged again; an external store by the stored
2115
+ * blob's sha256 plus the engine build, `CONTRACT_KIT_ENGINE_VERSION`); absent, the row is judged now. The resume never reads it.
2248
2116
  *
2249
- * THE ONE RULE for `checkpoint.invalid_outcome` (registered in `docs/CLOSED-SETS.md`, which also says what a host reads from it): `detail.reason` is a
2250
- * ROW-INTEGRITY word and only that, `detail.field` ({@link CheckpointErrorField}) names the cell of the decision to act on, a refusal carries at most
2251
- * one of them, and a refusal with neither is never a damaged row.
2117
+ * TOTAL, as the judge is: a row this projection cannot read (a record it lacks or holds as something else, a member that throws
2118
+ * when read) is answered, never thrown — as the row's identity alone ({@link CheckpointSummary.rowVerdict}'s unreadable form), with
2119
+ * a verdict that is not `ok` and one sentence to `disclose`. One damaged row never fails the page that lists it.
2252
2120
  */
2253
- export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "governed_unwired" | "origin_missing" | "tool_identity_missing" | "ledger_event_unknown" | "seat_retired" | "real_approval_damaged" | "real_approval_forged" | "read_face_damaged" | "read_face_forged"
2254
- /** `state.writeFace` is present but not a well-formed section. No `_forged` twin: the section is
2255
- * legal-and-absent at every version, so there is no version to judge a fabrication against — and a
2256
- * fabricated "open" still needs the LIVE resolution to say open too. */
2257
- | "write_face_damaged" | "skill_grants_damaged"
2258
- /** `state.skillScopes` is present but not a list of skill names (the active skills whose hooks the resumed leg reopens). */
2259
- | "skill_scopes_damaged" | "constraint_chain_missing"
2260
- /** `state.handsRoot` / `state.handsHome` / `state.handsCwd` is present but not an absolute path (the row's hands' coordinates). */
2261
- | "hands_coordinates_damaged"
2262
- /** The row's reader-requirement list ({@link CheckpointRow.requires}) is missing on a v10 row, is not a list of words,
2263
- * is present below v10, or does not equal the words the row's content carries (a segment dropped, or a word not
2264
- * declared) — terminal for the row's bytes. */
2265
- | "requirements_damaged"
2266
- /** A pending tool approval whose row format is at or above the binding era carries no persisted `boundInputHash` — every mint at that
2267
- * version writes one, so its absence is corruption or a caller-declared downgrade, and the decision-action input binding has nothing to
2268
- * 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). */
2269
- | "bound_input_hash_missing"
2270
- /** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
2271
- * no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
2272
- * entry / a record member naming no absolute root. */
2273
- | "installation_record_absent" | "installation_record_misaligned" | "installation_record_invalid"
2274
- /** On `checkpoint.config_refused` with `detail.code` `config.tool_face_control` — the arm prepare's own refusal carries as its `detail.reason`:
2275
- * a tool-name list the row recorded is not a list / has a member that is not a string / has a spelling no tool name can have / is not in
2276
- * the one spelling a row records (`"not_a_list"`, `"not_a_string"`, `"unknown_name"`, `"unsupported_pattern"`; the re-supplied config's own four lists —
2277
- * `allowTools`, `excludeTools`, `deferTools`, `alwaysLoadTools` — are refused as `"not_a_list"` / `"not_a_string"`); the record of the delegation tool that
2278
- * wrote the leg's lists is not one (`"invalid_record"`); the roster the resume hands mounts a delegation tool under another name than it declares
2279
- * (`"renamed_mount"`); the process-wide table of declared names is occupied by a value that is not the engine's (`"registry_occupied"`). */
2280
- | "not_a_list" | "not_a_string" | "unknown_name" | "unsupported_pattern" | "invalid_record" | "renamed_mount" | "registry_occupied"
2281
- /** On `config.unknown_role` (a fresh run's terminal `detail.detail.reason`; on a resume, `detail.reason` of `checkpoint.config_refused` with `detail.code` `config.unknown_role`)
2282
- * — a model binding or a role word the engine cannot read: a word the model catalog does not hold (`"unknown_model_ref"`), a value that is
2283
- * no model reference at all — a number, a boolean, a list (`"not_a_model_ref"`), or a role word outside the vocabulary — a `roles` key, a `modelRole` value (`"unknown_role_word"`) — or a task naming no model whose requested role and fallback chain supply none (`"no_model_for_role"`, `field` the requested role's seat). The sentence names the seat the refusal's `field` names (`roles.consolidate`, `tiers.pro`, `TaskSpec.model`). */
2284
- | "unknown_model_ref" | "not_a_model_ref" | "unknown_role_word" | "no_model_for_role";
2121
+ export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence: string) => void, verdict?: CheckpointRowVerdict): CheckpointSummary;
2285
2122
  /**
2286
- * The codes a RESUME's pre-claim configuration screen carries as `detail.code` of a `checkpoint.config_refused` — the words prepare's
2287
- * doors throw, held unchanged so one refusal reads the same on a fresh run (`TaskResult.errorCode`) and on a resume: the mode, output-style,
2288
- * approval-reach, invoked-skill, attachment, recorded-mode and tool-face doors (`config.spec_retired_key` … `config.tool_face_control`, the first
2289
- * nine — `detail.reason` names the tool-face arm: {@link CheckpointErrorReason}), and every value door of the config-door phase over the
2290
- * re-supplied config and the deployment's deps (`configValueDoors`, the rest): the retired deps seats and caller-policy members
2291
- * (`config.deps_retired_key`), the peer presence, the restore selector, the microCompact knob, the prompt selectors, `resumeAt` on a resume
2292
- * (`resume_at.conflicts_resume`, `resume_at.mode_without_target` — a resume carrying `resumeAt` is refused as a conflict before its mode is
2293
- * read, so `resume_at.invalid_mode` is a fresh run's word only), the containment faces, the add-only seats and the MCP / A2A `toolAxes` (`config.invalid_argument`), an MCP server's `toolFaces` (`config.tool_face_invalid`), the three memory seats, the cross-boundary posture, the advisor switch and the advisor model's shape,
2294
- * the auto-consolidation arming (its role key too, and the role seats and tier bindings it reads: `config.unknown_role`, `detail.reason` naming the arm), the materialize strategy and persistence flag, the lock layer (`config.locked_registry`,
2295
- * `config.locked_key`), an MCP server's content class, the skills-listing seats (`config.skill_listing_budget_invalid`), the limits and the
2296
- * 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
2297
- * would run on (`config.retention_policy`, `config.retention_capability`), and the checkpoint store seat itself (`config.invalid_checkpoint_store`: the
2298
- * retired `null` spelling, a store that declares no execution outcome), and the skills seat and the hands band (`config.invalid_argument`;
2299
- * a skill's `baseDir` by its own reader, `config.skill_base_dir_invalid`). A door not entered here (the leg's model, its rebuilt
2300
- * roster, its answer face, the approval seat's value) still refuses after the claim, each for a stated reason (INTEGRATION-CORE, "A resume's two doors").
2301
- * The re-supplied config's one read (`readCallerSpec`, the read a run takes of its spec) refuses with its own two words, last in the set:
2302
- * a member whose read throws (`config.spec_member_unreadable`) and a key the engine does not read (`config.spec_unknown_key`); its third,
2303
- * a retired key, is `config.spec_retired_key` (first).
2123
+ * An in-tree store's listing projection with its verdict memo: the verdict a store holds for this stored row object, else
2124
+ * the row judged now and held. The memo lives as long as the row object the store holds — a `put` (or a replay) holds a new
2125
+ * object, so a replaced row is judged again; the judge reads no member a store's own transitions rewrite (status, rev, the
2126
+ * decision and execution records, the steer queue — the requirement table's mutable members).
2304
2127
  */
2305
- export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.run_origin_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid", "config.host_floor_invalid", "config.credential_in_declaration", "config.credential_ref_invalid", "config.peer_seat_missing", "config.spec_member_unreadable", "config.spec_unknown_key"];
2306
- export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODES)[number];
2307
- export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
2308
- /** The words of a {@link CheckpointError}'s optional `detail.field` (what each means: the `detail` member's doc). A CLOSED SET with one home, registered in
2309
- * `docs/CLOSED-SETS.md`: a consumer holding a table over it is tsc-red on a new word until it places the word. */
2310
- export type CheckpointErrorField = "boundCallId" | "boundInputHash" | "boundGrantDigest" | "answer" | "hostDecision" | "approver" | "feedback" | "outcome" | "updatedInput" | "decision" | "reason" | "taskConfig" | "deps" | "inheritedGate";
2311
- /** A typed checkpoint-store error so callers branch on `code` (mirrors `SessionError`). */
2312
- export declare class CheckpointError extends Error {
2313
- readonly code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
2314
- /** `runner.resume` was handed an {@link ResumeOutcome} whose `gate` arm does not match the
2315
- * persisted {@link CheckpointGate} `kind` (council #3 — type confusion guard), or a gate v1
2316
- * resume does not serve (`task_done`). */
2317
- | "checkpoint.gate_mismatch"
2318
- /** The resume's `TaskSpec.signal` was aborted at the entrance — handed in ALREADY-ABORTED, or aborted
2319
- * while the wake screen / `resumePreflight` / pre-claim re-adjudication still ran: ONE code for a
2320
- * cancellation there (the seats' own codes keep what the hook itself did). Refused BEFORE the CAS, so
2321
- * the checkpoint stays `pending`; consuming the decision on a leg that aborts at once would lose it. */
2322
- | "checkpoint.resume_aborted"
2323
- /** `runner.resume` was handed an outcome whose payload is unsafe to apply — e.g. a deny `reason`
2324
- * carrying a `</system-reminder>` tag that would escape the model-facing wrapper (round-2 #1). */
2325
- | "checkpoint.invalid_outcome"
2326
- /** The checkpoint's {@link Checkpoint.version} is newer than this worker supports
2327
- * (`> MAX_SUPPORTED_CHECKPOINT_VERSION`), or it carries a remote `workspaceHandle` but no
2328
- * `executionEnvFactory` is wired to rebuild the env — either way this worker cannot safely resume it.
2329
- * Rejected pre-CAS so the checkpoint stays `pending` and a capable worker can still resume it
2330
- * (design/49 §2/§3, code-ready council round-2). */
2331
- | "checkpoint.unsupported_version"
2332
- /** The resume's re-supplied config, or a mode the checkpoint row recorded, is one prepare would refuse
2333
- * (a retired spec key, a malformed output style, a mode word outside the closed set, a retired shell-floor
2334
- * word). Refused PRE-CAS, so the checkpoint stays `pending` and byte-identical. `message` is prepare's own
2335
- * sentence; `detail.code` is prepare's own code ({@link CheckpointConfigRefusalCode}) and `detail.field`
2336
- * says which input carries it: `"taskConfig"` (correct the config and resume the SAME token) or
2337
- * `"inheritedGate"` (the recorded row — no config reaches it; expire the row). A fresh run of the same
2338
- * bad config reports the same `detail.code` as its `TaskResult.errorCode`. */
2339
- | "checkpoint.config_refused"
2340
- /** `resume`/`resumeStream` was handed `internals.requestedCwd` for a checkpoint that
2341
- * carries a remote `workspaceHandle`. The restored workspace's mountPath is authoritative for the
2342
- * task root, so the cwd would be ignored at best — and verifying it would touch the env BEFORE the
2343
- * VM restore (a lazy-connect adapter then connects a fresh empty sandbox, the design/49 disease).
2344
- * Rejected pre-CAS so the checkpoint stays `pending`; re-resume without `requestedCwd`. */
2345
- | "checkpoint.cwd_conflicts_restore"
2346
- /** design/164: the checkpoint was written by a pre-164 worker AND its ledger carries the RETIRED
2347
- * cross-slice wall-clock allocation (`resourceLedger.totalWalltimeSec`). The axis no longer exists,
2348
- * so resuming would run the leg with the operator's time ceiling silently unenforced. Refused
2349
- * PRE-CAS (the row stays `pending`, so a worker of the previous release can still finish it) rather
2350
- * than migrated: there is no honest conversion from a wall-clock allocation to a token one. */
2351
- | "checkpoint.walltime_axis_retired"
2352
- /** design/80 D-1 (reopen-by-reason): a re-resume of an `env_failed`-reopened checkpoint supplied an
2353
- * outcome that does NOT equal the persisted {@link ResolvedOutcome} winner. An `env_failed` reopen is
2354
- * a SYSTEM RETRY of the already-approved action (the infra failed, not the decision) — it must replay
2355
- * the exact winning binding, never a new vote. Rejected pre-CAS, fail-closed, so the checkpoint stays
2356
- * `pending` for the correctly-replayed retry. (A `tool_unavailable` reopen — P-7 — is exempt: it lets
2357
- * a human re-decide with the tool present, so a fresh decision is permitted there.) */
2358
- | "checkpoint.reopen_revote"
2359
- /** design/80 D-1 (atomicity fix): the resume validated its decision-action / reopen-by-reason guards
2360
- * against a `get()` snapshot, but a concurrent {@link CheckpointStore.resolve}/{@link CheckpointStore.reopen}
2361
- * cycle advanced the monotonic {@link Checkpoint.rev} in the get→resolve window, so the
2362
- * {@link CheckpointStore.resolve} CAS's optimistic-concurrency check lost (the validation is stale). The
2363
- * row is still `pending` — fail-closed; the caller must re-`get` and re-validate against the CURRENT state
2364
- * (a fresh resume), never blindly retry. */
2365
- | "checkpoint.reopened_concurrently"
2366
- /** A post-CAS compensation {@link CheckpointStore.reopen} returned `false` — the consumed row could not
2367
- * be flipped back to `pending` (missing, expired, or changed under a concurrent cycle), so no retryable
2368
- * checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
2369
- * caller's compensation path settles the token as terminally consumed. */
2370
- | "checkpoint.reopen_failed"
2371
- /** `Runner.voidVerifierPause` voided the card — the row IS expired and its env duty ran — but releasing the verifier
2372
- * session's pin threw or did not settle within the teardown bound: the session stays pinned until it is unpinned. */
2373
- | "checkpoint.void_unpin_failed"
2374
- /** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
2375
- * execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
2376
- * in-tree form of this code. Never a retry condition. */
2377
- | "checkpoint.execution_outcome_conflict"
2378
- /** design/80 D-A: {@link CheckpointStore.setPendingSteer} was handed `text` containing a
2379
- * `</system-reminder>` close tag — it would escape the model-facing `<system-reminder>` wrapper a
2380
- * trusted steer rides on resume. Rejected fail-closed so a dirty steer NEVER enters {@link CheckpointState}
2381
- * (§3 inv #2). Mirrors the trusted-steer reject at runtask.ts (`steering.invalid_content`). */
2382
- | "steering.invalid_content"
2383
- /** design/171 §6.3: the append would cross the parked-steer queue's entry-count or byte bound
2384
- * ({@link MAX_PENDING_STEER_ENTRIES} / {@link PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES}). Fail-loud
2385
- * rather than evicting: an already-accepted operator instruction is never dropped to make room —
2386
- * the caller delivers or removes a parked steer first. Nothing is written on this path. */
2387
- | "steering.queue_full"
2388
- /** design/171 §6.3 (falsification review adoption): the append reused an `inputId` already parked on
2389
- * this checkpoint, but with DIFFERENT content. Re-appending an IDENTICAL steer stays the idempotent
2390
- * no-op a retry needs; a differing one is refused, because swallowing it would lose the second
2391
- * operator's instruction — the exact silent loss the queue replaced. `detail.differs` names the facets
2392
- * that differ: with `text` among them it is another instruction (retry it under a fresh id); without,
2393
- * it is the parked one re-sent at another tier / trust / attribution (a fresh id would park it twice —
2394
- * replay it with its original values). Nothing is written on this path. */
2395
- | "steering.duplicate_input_id"
2396
- /** design/373 §4.3 (D2): the deployment's `userPromptSubmit` hook refused a wake resume's
2397
- * `message` at the entrance screen (block verdict, or a fail-closed timeout/crash — the
2398
- * message discriminates). Pre-CAS: the checkpoint stays `pending` and byte-identical, so the
2399
- * SAME token is redeemable once the screen clears — a refusal burns nothing. The live steer
2400
- * verb refuses under the same code word (its own Error face); one vocabulary, two entrances. */
2401
- | "steering.blocked_by_hook"
2402
- /** design/144 §3 (governance-gate purity, fail-closed pre-CAS): a `wake` outcome was supplied for a
2403
- * checkpoint that awaits a PENDING GATE DECISION (tool approval / dry-run review / plan review /
2404
- * resource-limit continue). Wake is a pure un-park verb and must never circumvent an approval — resume
2405
- * the checkpoint through its own decide entry instead (the error message names it). */
2406
- | "wake.gate_pending"
2407
- /** design/144 §3 (anti spin-wake): a `wake` outcome carried no `message` and the checkpoint has no
2408
- * parked steer either — there is nothing to deliver, so the wake is rejected pre-CAS
2409
- * (the checkpoint stays pending) instead of burning the token on an empty continuation. */
2410
- | "wake.nothing_to_deliver"
2411
- /** Parent effective-policy inheritance: the checkpoint records `state.inheritedGate.requiresParentConstraint`
2412
- * (the suspended task ran under inherited OPAQUE parent-policy constraints — live closures that cannot
2413
- * persist), but the resume supplied no `RunInternals.inheritedGate.parentConstraints` to re-instate them.
2414
- * Resuming anyway would silently DROP the ancestors' gate (a widening), so this rejects pre-CAS — the
2415
- * checkpoint stays `pending`; re-resume via `resumeStream(token, outcome, config, internals)` with the
2416
- * parent chain re-supplied. */
2417
- | "resume.parent_constraint_missing"
2418
- /** Parent effective-policy inheritance (shape check): the resume DID re-supply
2419
- * `internals.inheritedGate.parentConstraints`, but its length differs from the checkpoint's recorded
2420
- * `parentConstraintCount` — or (F-012 L1) its projection CONTENT digests differently from the
2421
- * recorded `constraintDigest` — or a screening entry names a `tool.check` guard beside a policy the
2422
- * constraint mint did not make (no chain to raise it on) — a partial/mismatched re-supply would silently run
2423
- * the child under a thinner (or different) ancestor chain than it suspended with. Rejected pre-CAS (the
2424
- * checkpoint stays `pending`); re-resume with the full original chain. */
2425
- | "resume.parent_constraint_mismatch"
2426
- /** #449 G1 (codex r2, pre-CAS entrance): a deployment usage-governance window for this resume's
2427
- * ledger key (the config's principal, else the row's recorded one, else the shared bucket) is
2428
- * EXHAUSTED, and the row still OWES a delivery a re-mint cannot carry (an approval/review
2429
- * decision, a wake, parked steers, a background-task obituary snapshot). Refused BEFORE the CAS,
2430
- * so nothing is consumed and nothing is unpinned — the SAME token with the SAME decision is
2431
- * redeemable once the window frees (`detail.retryAfterMs` carries the wait). A bare
2432
- * `resource_limit` continue with nothing parked does NOT take this refusal: it proceeds and
2433
- * re-suspends at turn 0 into a FRESH checkpoint carrying the new wait hint. */
2434
- | "resume.usage_window_exhausted"
2435
- /** #449 G2 (identity continuity): the resume config carries a NON-EMPTY `principal` that differs from
2436
- * the {@link Checkpoint.principal} recorded at the suspend mint. `ResumeTaskConfig`'s contract is
2437
- * "the same TaskSpec the run suspended with", and the principal keys real lanes on the resumed leg
2438
- * (the usage-governance ledger bucket, later mints' scope derivation, session-rule reads, ask
2439
- * attribution) — silently running the leg under a different identity is the bad-value direction this
2440
- * refusal exists to close. Rejected PRE-CAS (the checkpoint stays `pending`); re-resume with the
2441
- * original principal, or omit the field to inherit the recorded one. */
2442
- | "resume.principal_mismatch"
2443
- /** design/380 O1③ (placement identity continuity — the `resume.principal_mismatch` rung's twin
2444
- * on the placement axis): the resume supplied trusted internals whose EXPLICIT
2445
- * `placementRoot` differs from the {@link CheckpointState.placementRootSessionId} recorded at
2446
- * the suspend mint. A target-bound env factory keys its placement lookup on that fixed point,
2447
- * so silently resuming under a different one would re-place the leg — and every descendant
2448
- * the child-internals chain hands it to — on another target than the parked workspace lives
2449
- * on. A supplied `rootSessionId` deliberately does NOT take this refusal: it is
2450
- * delegation identity, re-supplied by every revive leg, and legitimately differs from the
2451
- * recorded root whenever the spawner carried an explicit placement — the recorded root simply
2452
- * outranks it in prepare's restore fold. Rejected PRE-CAS (the checkpoint stays `pending`);
2453
- * re-resume with the recorded root, or omit `internals.placementRoot` to inherit it. Either
2454
- * side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
2455
- * — the honest degradation arm. */
2456
- | "resume.placement_mismatch"
2457
- /** The composition-leg twin of `resume.placement_mismatch`: the resume supplied trusted internals whose
2458
- * `compositionLeg` differs from the {@link CheckpointState.compositionLeg} recorded at the suspend mint — the
2459
- * composition's resume entry was handed another card's identity, and continuing would run this leg as a rung it is
2460
- * not, file its next card under another host session, or both. Rejected PRE-CAS (the checkpoint stays `pending`);
2461
- * re-resume with the recorded value, or omit `internals.compositionLeg` to inherit it. A row that records none skips
2462
- * the check (the live value becomes its first record). The same code refuses `Runner.voidVerifierPause` a card whose
2463
- * recorded leg is not a `verify` leg (another entry's, or none recorded): nothing is settled, the row stays as it was. */
2464
- | "resume.composition_mismatch"
2465
- /** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
2466
- * explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
2467
- * answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
2468
- * discriminated by the message: the default `retry_later` arm leaves the checkpoint `pending`
2469
- * and the SAME token redeemable once the obstacle clears (`detail.retryAfterMs` carries the
2470
- * deployment's wait hint when it gave one — the #449 G1 carrier); the explicit `terminal` arm
2471
- * has ALREADY settled the row out of `pending` via the single-shot `expire` CAS (reaper
2472
- * parity) before this throw — the token is NOT redeemable, by the deployment's own permanent
2473
- * verdict (a dead binding must not be redialed forever). */
2474
- | "resume.preflight_rejected"
2475
- /** The resume carried a claim holder ({@link ResolveExpectation.holder}) and lost its CAS while the row is still the one it
2476
- * validated — same scope, `pending`, the same generation — so the holder was not the deployment's current grant: nothing was
2477
- * applied and the row is unchanged by this resume. The run is superseded; do not retry it (the current holder delivers).
2478
- * Read off the CAS's own loss answer on `claimTerminal`; on the two-step route off its diagnostic read (a later instant —
2479
- * under a race the row's later state answers instead, fail-closed either way). */
2480
- | "resume.holder_superseded"
2481
- /** F-012 L3: the resume carried an approver EDIT (`updatedInput`) and a FROZEN inherited ancestor
2482
- * constraint (the persisted projection chain) — or the deployment's resume-edit policy — DENIES the
2483
- * edited args, or the policy accepts them only rewritten (`detail.editRewritten` names that form). Refused PRE-CAS with fresh-redecision semantics: the checkpoint stays `pending` and
2484
- * the same token remains decidable (approve as shown, deny, or edit differently) — the rejection
2485
- * consumed the decision's INPUT, never the ask itself. */
2486
- | "resume.constraint_rejected"
2487
- /** F-012 L3: the resume carried an approver EDIT but the inherited ancestor chain cannot be
2488
- * re-adjudicated statically — an OPAQUE layer is present, a layer declares a live remainder beyond
2489
- * its projection, or the checkpoint predates the projection chain. "Would have been allowed" is not
2490
- * computable from a self-reported closure, so the edited resume is refused typed pre-CAS (the
2491
- * checkpoint stays `pending`, still decidable); an UNEDITED approval is untouched. */
2492
- | "resume.constraint_unprojectable";
2493
- /** Structured discrimination a caller can branch on where the code alone is ambiguous. `field`
2494
- * names WHICH part of the decision payload was rejected on a
2495
- * `checkpoint.invalid_outcome` — `"boundCallId"` (the action you decided on has been replaced:
2496
- * re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
2497
- * action: re-review), `"boundGrantDigest"` (a parked `Skill` approval does not cover the skill the decision selects — another skill, or the card's with other lists: deny, re-activate), or `"answer"` (the content-ask answer is missing, or was attached to a
2498
- * decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
2499
- * `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
2500
- * `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
2501
- * resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
2502
- * well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
2503
- * it), or `"feedback"` (the allow's `feedback` is not fit to deliver — it carries the engine's `<system-reminder>` tag, is not a string, rides a deny,
2504
- * or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change), or — an approval decide's own
2505
- * payload — `"outcome"` (the resume's outcome is not an object naming its gate: send one), `"updatedInput"` (the person's edit is not plain JSON data the
2506
- * engine can capture: re-decide with a plain edit, or without one), `"decision"` (the verdict word is neither `allow` nor `deny`) or `"reason"` (the deny's
2507
- * words are not a plain string, or carry the engine's `<system-reminder>` tag: change or drop them; the binding did not change). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
2508
- * (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
2509
- * caller re-supplies as inherited constraints: correct them and resume the same token) or `"inheritedGate"` (the row's record: no config reaches it; expire the row). The throw
2510
- * sites always knew which arm fired; this carries that fact instead of dropping it (ruled
2511
- * 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
2512
- * discriminant. */
2513
- readonly detail?: {
2514
- field?: CheckpointErrorField;
2515
- /** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
2516
- * word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
2517
- code?: CheckpointConfigRefusalCode;
2518
- /** #449 G1 — on `resume.usage_window_exhausted`: how long until the binding window frees
2519
- * (the same wait a suspended row carries as `gate.resumeAfterMs`). design/380 O2 — on a
2520
- * retry-later `resume.preflight_rejected`: the deployment preflight's own wait hint, when it
2521
- * gave one (same carrier, same semantics: retry the SAME token after the wait). Absent on
2522
- * every other code. */
2523
- retryAfterMs?: number;
2524
- /** WHICH arm fired, where one `code` covers several — the word list and what each word means to a
2525
- * host live at {@link CheckpointErrorReason}, its one home. Additive and optional like `field`
2526
- * (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
2527
- * is a gate rather than a type: see the closed set's own doc. */
2528
- reason?: CheckpointErrorReason;
2529
- /** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
2530
- * (sorted, display only). Absent on every other arm. */
2531
- requires?: readonly string[];
2532
- /** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
2533
- * {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
2534
- * every other code. The live verb's refusal carries the same value. */
2535
- differs?: readonly SteerReplayFacet[];
2536
- /** On `resume.constraint_rejected` ⇔ the resume-edit policy accepts the person's edit only rewritten: `acceptableForm`
2537
- * is that form, the outlet a host may offer; a decide carrying it as `updatedInput` runs exactly those bytes. */
2538
- editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
2539
- } | undefined;
2540
- constructor(code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
2541
- /** `runner.resume` was handed an {@link ResumeOutcome} whose `gate` arm does not match the
2542
- * persisted {@link CheckpointGate} `kind` (council #3 — type confusion guard), or a gate v1
2543
- * resume does not serve (`task_done`). */
2544
- | "checkpoint.gate_mismatch"
2545
- /** The resume's `TaskSpec.signal` was aborted at the entrance — handed in ALREADY-ABORTED, or aborted
2546
- * while the wake screen / `resumePreflight` / pre-claim re-adjudication still ran: ONE code for a
2547
- * cancellation there (the seats' own codes keep what the hook itself did). Refused BEFORE the CAS, so
2548
- * the checkpoint stays `pending`; consuming the decision on a leg that aborts at once would lose it. */
2549
- | "checkpoint.resume_aborted"
2550
- /** `runner.resume` was handed an outcome whose payload is unsafe to apply — e.g. a deny `reason`
2551
- * carrying a `</system-reminder>` tag that would escape the model-facing wrapper (round-2 #1). */
2552
- | "checkpoint.invalid_outcome"
2553
- /** The checkpoint's {@link Checkpoint.version} is newer than this worker supports
2554
- * (`> MAX_SUPPORTED_CHECKPOINT_VERSION`), or it carries a remote `workspaceHandle` but no
2555
- * `executionEnvFactory` is wired to rebuild the env — either way this worker cannot safely resume it.
2556
- * Rejected pre-CAS so the checkpoint stays `pending` and a capable worker can still resume it
2557
- * (design/49 §2/§3, code-ready council round-2). */
2558
- | "checkpoint.unsupported_version"
2559
- /** The resume's re-supplied config, or a mode the checkpoint row recorded, is one prepare would refuse
2560
- * (a retired spec key, a malformed output style, a mode word outside the closed set, a retired shell-floor
2561
- * word). Refused PRE-CAS, so the checkpoint stays `pending` and byte-identical. `message` is prepare's own
2562
- * sentence; `detail.code` is prepare's own code ({@link CheckpointConfigRefusalCode}) and `detail.field`
2563
- * says which input carries it: `"taskConfig"` (correct the config and resume the SAME token) or
2564
- * `"inheritedGate"` (the recorded row — no config reaches it; expire the row). A fresh run of the same
2565
- * bad config reports the same `detail.code` as its `TaskResult.errorCode`. */
2566
- | "checkpoint.config_refused"
2567
- /** `resume`/`resumeStream` was handed `internals.requestedCwd` for a checkpoint that
2568
- * carries a remote `workspaceHandle`. The restored workspace's mountPath is authoritative for the
2569
- * task root, so the cwd would be ignored at best — and verifying it would touch the env BEFORE the
2570
- * VM restore (a lazy-connect adapter then connects a fresh empty sandbox, the design/49 disease).
2571
- * Rejected pre-CAS so the checkpoint stays `pending`; re-resume without `requestedCwd`. */
2572
- | "checkpoint.cwd_conflicts_restore"
2573
- /** design/164: the checkpoint was written by a pre-164 worker AND its ledger carries the RETIRED
2574
- * cross-slice wall-clock allocation (`resourceLedger.totalWalltimeSec`). The axis no longer exists,
2575
- * so resuming would run the leg with the operator's time ceiling silently unenforced. Refused
2576
- * PRE-CAS (the row stays `pending`, so a worker of the previous release can still finish it) rather
2577
- * than migrated: there is no honest conversion from a wall-clock allocation to a token one. */
2578
- | "checkpoint.walltime_axis_retired"
2579
- /** design/80 D-1 (reopen-by-reason): a re-resume of an `env_failed`-reopened checkpoint supplied an
2580
- * outcome that does NOT equal the persisted {@link ResolvedOutcome} winner. An `env_failed` reopen is
2581
- * a SYSTEM RETRY of the already-approved action (the infra failed, not the decision) — it must replay
2582
- * the exact winning binding, never a new vote. Rejected pre-CAS, fail-closed, so the checkpoint stays
2583
- * `pending` for the correctly-replayed retry. (A `tool_unavailable` reopen — P-7 — is exempt: it lets
2584
- * a human re-decide with the tool present, so a fresh decision is permitted there.) */
2585
- | "checkpoint.reopen_revote"
2586
- /** design/80 D-1 (atomicity fix): the resume validated its decision-action / reopen-by-reason guards
2587
- * against a `get()` snapshot, but a concurrent {@link CheckpointStore.resolve}/{@link CheckpointStore.reopen}
2588
- * cycle advanced the monotonic {@link Checkpoint.rev} in the get→resolve window, so the
2589
- * {@link CheckpointStore.resolve} CAS's optimistic-concurrency check lost (the validation is stale). The
2590
- * row is still `pending` — fail-closed; the caller must re-`get` and re-validate against the CURRENT state
2591
- * (a fresh resume), never blindly retry. */
2592
- | "checkpoint.reopened_concurrently"
2593
- /** A post-CAS compensation {@link CheckpointStore.reopen} returned `false` — the consumed row could not
2594
- * be flipped back to `pending` (missing, expired, or changed under a concurrent cycle), so no retryable
2595
- * checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
2596
- * caller's compensation path settles the token as terminally consumed. */
2597
- | "checkpoint.reopen_failed"
2598
- /** `Runner.voidVerifierPause` voided the card — the row IS expired and its env duty ran — but releasing the verifier
2599
- * session's pin threw or did not settle within the teardown bound: the session stays pinned until it is unpinned. */
2600
- | "checkpoint.void_unpin_failed"
2601
- /** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
2602
- * execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
2603
- * in-tree form of this code. Never a retry condition. */
2604
- | "checkpoint.execution_outcome_conflict"
2605
- /** design/80 D-A: {@link CheckpointStore.setPendingSteer} was handed `text` containing a
2606
- * `</system-reminder>` close tag — it would escape the model-facing `<system-reminder>` wrapper a
2607
- * trusted steer rides on resume. Rejected fail-closed so a dirty steer NEVER enters {@link CheckpointState}
2608
- * (§3 inv #2). Mirrors the trusted-steer reject at runtask.ts (`steering.invalid_content`). */
2609
- | "steering.invalid_content"
2610
- /** design/171 §6.3: the append would cross the parked-steer queue's entry-count or byte bound
2611
- * ({@link MAX_PENDING_STEER_ENTRIES} / {@link PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES}). Fail-loud
2612
- * rather than evicting: an already-accepted operator instruction is never dropped to make room —
2613
- * the caller delivers or removes a parked steer first. Nothing is written on this path. */
2614
- | "steering.queue_full"
2615
- /** design/171 §6.3 (falsification review adoption): the append reused an `inputId` already parked on
2616
- * this checkpoint, but with DIFFERENT content. Re-appending an IDENTICAL steer stays the idempotent
2617
- * no-op a retry needs; a differing one is refused, because swallowing it would lose the second
2618
- * operator's instruction — the exact silent loss the queue replaced. `detail.differs` names the facets
2619
- * that differ: with `text` among them it is another instruction (retry it under a fresh id); without,
2620
- * it is the parked one re-sent at another tier / trust / attribution (a fresh id would park it twice —
2621
- * replay it with its original values). Nothing is written on this path. */
2622
- | "steering.duplicate_input_id"
2623
- /** design/373 §4.3 (D2): the deployment's `userPromptSubmit` hook refused a wake resume's
2624
- * `message` at the entrance screen (block verdict, or a fail-closed timeout/crash — the
2625
- * message discriminates). Pre-CAS: the checkpoint stays `pending` and byte-identical, so the
2626
- * SAME token is redeemable once the screen clears — a refusal burns nothing. The live steer
2627
- * verb refuses under the same code word (its own Error face); one vocabulary, two entrances. */
2628
- | "steering.blocked_by_hook"
2629
- /** design/144 §3 (governance-gate purity, fail-closed pre-CAS): a `wake` outcome was supplied for a
2630
- * checkpoint that awaits a PENDING GATE DECISION (tool approval / dry-run review / plan review /
2631
- * resource-limit continue). Wake is a pure un-park verb and must never circumvent an approval — resume
2632
- * the checkpoint through its own decide entry instead (the error message names it). */
2633
- | "wake.gate_pending"
2634
- /** design/144 §3 (anti spin-wake): a `wake` outcome carried no `message` and the checkpoint has no
2635
- * parked steer either — there is nothing to deliver, so the wake is rejected pre-CAS
2636
- * (the checkpoint stays pending) instead of burning the token on an empty continuation. */
2637
- | "wake.nothing_to_deliver"
2638
- /** Parent effective-policy inheritance: the checkpoint records `state.inheritedGate.requiresParentConstraint`
2639
- * (the suspended task ran under inherited OPAQUE parent-policy constraints — live closures that cannot
2640
- * persist), but the resume supplied no `RunInternals.inheritedGate.parentConstraints` to re-instate them.
2641
- * Resuming anyway would silently DROP the ancestors' gate (a widening), so this rejects pre-CAS — the
2642
- * checkpoint stays `pending`; re-resume via `resumeStream(token, outcome, config, internals)` with the
2643
- * parent chain re-supplied. */
2644
- | "resume.parent_constraint_missing"
2645
- /** Parent effective-policy inheritance (shape check): the resume DID re-supply
2646
- * `internals.inheritedGate.parentConstraints`, but its length differs from the checkpoint's recorded
2647
- * `parentConstraintCount` — or (F-012 L1) its projection CONTENT digests differently from the
2648
- * recorded `constraintDigest` — or a screening entry names a `tool.check` guard beside a policy the
2649
- * constraint mint did not make (no chain to raise it on) — a partial/mismatched re-supply would silently run
2650
- * the child under a thinner (or different) ancestor chain than it suspended with. Rejected pre-CAS (the
2651
- * checkpoint stays `pending`); re-resume with the full original chain. */
2652
- | "resume.parent_constraint_mismatch"
2653
- /** #449 G1 (codex r2, pre-CAS entrance): a deployment usage-governance window for this resume's
2654
- * ledger key (the config's principal, else the row's recorded one, else the shared bucket) is
2655
- * EXHAUSTED, and the row still OWES a delivery a re-mint cannot carry (an approval/review
2656
- * decision, a wake, parked steers, a background-task obituary snapshot). Refused BEFORE the CAS,
2657
- * so nothing is consumed and nothing is unpinned — the SAME token with the SAME decision is
2658
- * redeemable once the window frees (`detail.retryAfterMs` carries the wait). A bare
2659
- * `resource_limit` continue with nothing parked does NOT take this refusal: it proceeds and
2660
- * re-suspends at turn 0 into a FRESH checkpoint carrying the new wait hint. */
2661
- | "resume.usage_window_exhausted"
2662
- /** #449 G2 (identity continuity): the resume config carries a NON-EMPTY `principal` that differs from
2663
- * the {@link Checkpoint.principal} recorded at the suspend mint. `ResumeTaskConfig`'s contract is
2664
- * "the same TaskSpec the run suspended with", and the principal keys real lanes on the resumed leg
2665
- * (the usage-governance ledger bucket, later mints' scope derivation, session-rule reads, ask
2666
- * attribution) — silently running the leg under a different identity is the bad-value direction this
2667
- * refusal exists to close. Rejected PRE-CAS (the checkpoint stays `pending`); re-resume with the
2668
- * original principal, or omit the field to inherit the recorded one. */
2669
- | "resume.principal_mismatch"
2670
- /** design/380 O1③ (placement identity continuity — the `resume.principal_mismatch` rung's twin
2671
- * on the placement axis): the resume supplied trusted internals whose EXPLICIT
2672
- * `placementRoot` differs from the {@link CheckpointState.placementRootSessionId} recorded at
2673
- * the suspend mint. A target-bound env factory keys its placement lookup on that fixed point,
2674
- * so silently resuming under a different one would re-place the leg — and every descendant
2675
- * the child-internals chain hands it to — on another target than the parked workspace lives
2676
- * on. A supplied `rootSessionId` deliberately does NOT take this refusal: it is
2677
- * delegation identity, re-supplied by every revive leg, and legitimately differs from the
2678
- * recorded root whenever the spawner carried an explicit placement — the recorded root simply
2679
- * outranks it in prepare's restore fold. Rejected PRE-CAS (the checkpoint stays `pending`);
2680
- * re-resume with the recorded root, or omit `internals.placementRoot` to inherit it. Either
2681
- * side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
2682
- * — the honest degradation arm. */
2683
- | "resume.placement_mismatch"
2684
- /** The composition-leg twin of `resume.placement_mismatch`: the resume supplied trusted internals whose
2685
- * `compositionLeg` differs from the {@link CheckpointState.compositionLeg} recorded at the suspend mint — the
2686
- * composition's resume entry was handed another card's identity, and continuing would run this leg as a rung it is
2687
- * not, file its next card under another host session, or both. Rejected PRE-CAS (the checkpoint stays `pending`);
2688
- * re-resume with the recorded value, or omit `internals.compositionLeg` to inherit it. A row that records none skips
2689
- * the check (the live value becomes its first record). The same code refuses `Runner.voidVerifierPause` a card whose
2690
- * recorded leg is not a `verify` leg (another entry's, or none recorded): nothing is settled, the row stays as it was. */
2691
- | "resume.composition_mismatch"
2692
- /** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
2693
- * explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
2694
- * answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
2695
- * discriminated by the message: the default `retry_later` arm leaves the checkpoint `pending`
2696
- * and the SAME token redeemable once the obstacle clears (`detail.retryAfterMs` carries the
2697
- * deployment's wait hint when it gave one — the #449 G1 carrier); the explicit `terminal` arm
2698
- * has ALREADY settled the row out of `pending` via the single-shot `expire` CAS (reaper
2699
- * parity) before this throw — the token is NOT redeemable, by the deployment's own permanent
2700
- * verdict (a dead binding must not be redialed forever). */
2701
- | "resume.preflight_rejected"
2702
- /** The resume carried a claim holder ({@link ResolveExpectation.holder}) and lost its CAS while the row is still the one it
2703
- * validated — same scope, `pending`, the same generation — so the holder was not the deployment's current grant: nothing was
2704
- * applied and the row is unchanged by this resume. The run is superseded; do not retry it (the current holder delivers).
2705
- * Read off the CAS's own loss answer on `claimTerminal`; on the two-step route off its diagnostic read (a later instant —
2706
- * under a race the row's later state answers instead, fail-closed either way). */
2707
- | "resume.holder_superseded"
2708
- /** F-012 L3: the resume carried an approver EDIT (`updatedInput`) and a FROZEN inherited ancestor
2709
- * constraint (the persisted projection chain) — or the deployment's resume-edit policy — DENIES the
2710
- * edited args, or the policy accepts them only rewritten (`detail.editRewritten` names that form). Refused PRE-CAS with fresh-redecision semantics: the checkpoint stays `pending` and
2711
- * the same token remains decidable (approve as shown, deny, or edit differently) — the rejection
2712
- * consumed the decision's INPUT, never the ask itself. */
2713
- | "resume.constraint_rejected"
2714
- /** F-012 L3: the resume carried an approver EDIT but the inherited ancestor chain cannot be
2715
- * re-adjudicated statically — an OPAQUE layer is present, a layer declares a live remainder beyond
2716
- * its projection, or the checkpoint predates the projection chain. "Would have been allowed" is not
2717
- * computable from a self-reported closure, so the edited resume is refused typed pre-CAS (the
2718
- * checkpoint stays `pending`, still decidable); an UNEDITED approval is untouched. */
2719
- | "resume.constraint_unprojectable", message: string,
2720
- /** Structured discrimination a caller can branch on where the code alone is ambiguous. `field`
2721
- * names WHICH part of the decision payload was rejected on a
2722
- * `checkpoint.invalid_outcome` — `"boundCallId"` (the action you decided on has been replaced:
2723
- * re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
2724
- * action: re-review), `"boundGrantDigest"` (a parked `Skill` approval does not cover the skill the decision selects — another skill, or the card's with other lists: deny, re-activate), or `"answer"` (the content-ask answer is missing, or was attached to a
2725
- * decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
2726
- * `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
2727
- * `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
2728
- * resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
2729
- * well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
2730
- * it), or `"feedback"` (the allow's `feedback` is not fit to deliver — it carries the engine's `<system-reminder>` tag, is not a string, rides a deny,
2731
- * or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change), or — an approval decide's own
2732
- * payload — `"outcome"` (the resume's outcome is not an object naming its gate: send one), `"updatedInput"` (the person's edit is not plain JSON data the
2733
- * engine can capture: re-decide with a plain edit, or without one), `"decision"` (the verdict word is neither `allow` nor `deny`) or `"reason"` (the deny's
2734
- * words are not a plain string, or carry the engine's `<system-reminder>` tag: change or drop them; the binding did not change). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
2735
- * (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
2736
- * caller re-supplies as inherited constraints: correct them and resume the same token) or `"inheritedGate"` (the row's record: no config reaches it; expire the row). The throw
2737
- * sites always knew which arm fired; this carries that fact instead of dropping it (ruled
2738
- * 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
2739
- * discriminant. */
2740
- detail?: {
2741
- field?: CheckpointErrorField;
2742
- /** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
2743
- * word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
2744
- code?: CheckpointConfigRefusalCode;
2745
- /** #449 G1 — on `resume.usage_window_exhausted`: how long until the binding window frees
2746
- * (the same wait a suspended row carries as `gate.resumeAfterMs`). design/380 O2 — on a
2747
- * retry-later `resume.preflight_rejected`: the deployment preflight's own wait hint, when it
2748
- * gave one (same carrier, same semantics: retry the SAME token after the wait). Absent on
2749
- * every other code. */
2750
- retryAfterMs?: number;
2751
- /** WHICH arm fired, where one `code` covers several — the word list and what each word means to a
2752
- * host live at {@link CheckpointErrorReason}, its one home. Additive and optional like `field`
2753
- * (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
2754
- * is a gate rather than a type: see the closed set's own doc. */
2755
- reason?: CheckpointErrorReason;
2756
- /** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
2757
- * (sorted, display only). Absent on every other arm. */
2758
- requires?: readonly string[];
2759
- /** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
2760
- * {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
2761
- * every other code. The live verb's refusal carries the same value. */
2762
- differs?: readonly SteerReplayFacet[];
2763
- /** On `resume.constraint_rejected` ⇔ the resume-edit policy accepts the person's edit only rewritten: `acceptableForm`
2764
- * is that form, the outlet a host may offer; a decide carrying it as `updatedInput` runs exactly those bytes. */
2765
- editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
2766
- } | undefined);
2767
- }
2128
+ export declare function summarizeStoredCheckpoint(cp: Checkpoint, memo: WeakMap<Checkpoint, CheckpointRowVerdict>, disclose?: (sentence: string) => void): CheckpointSummary;
2768
2129
  /**
2769
2130
  * The pluggable durable seam (design/45 §2.1). Symmetric with `ToolResultStore`/`MemoryStore`:
2770
2131
  * create-once `put`, `get`, an **atomic CAS `resolve`** (the once-only foundation), and a `reap` for TTL
@@ -2818,7 +2179,8 @@ export type StoreDurability = "durable" | "process-local";
2818
2179
  * backend (a `Date` comes back a `Date`, a `Map` a `Map`, `NaN` stays `NaN`); `"json"` states the
2819
2180
  * backend serialises through JSON, so the row that comes back after a restart carries the JSON
2820
2181
  * PROJECTION of what was filed (`Date` → string, `Map`/`Set` → `{}`, `NaN`/`Infinity` → `null`, `-0`
2821
- * → `0`, an `undefined`-valued key gone).
2182
+ * → `0`, an `undefined`-valued key gone — a real loss below a row's frame: a tool call's arguments, compared by own-key
2183
+ * set at the park; none at its top level or its `state`'s, which the engine writes with absences omitted).
2822
2184
  *
2823
2185
  * Why this has to be declared rather than inferred: the mint decides what a durable approval row may
2824
2186
  * carry, and it decides it with `structuredClone` — which is WIDER than a JSON codec. A value can pass
@@ -2841,27 +2203,6 @@ export type StoreFidelity = "structured-clone" | "json";
2841
2203
  export declare function resolveDeclaredFidelity(store: {
2842
2204
  readonly fidelity?: StoreFidelity;
2843
2205
  } | undefined, storeName: string): StoreFidelity;
2844
- /**
2845
- * Project an already-captured value onto what a backend of the given {@link StoreFidelity} can hold, so
2846
- * everything minted from it — the row's args, the approval preview, the binding hash, the risk
2847
- * descriptor — describes the value that comes BACK, not the one that went in.
2848
- *
2849
- * `"structured-clone"` is the identity: the caller's snapshot already is what such a backend stores.
2850
- * `"json"` runs the backend's own codec (`JSON.stringify` → `JSON.parse`, `toJSON` hooks included, since
2851
- * that is exactly what the backend will do to it). The input is expected to be an accessor-free snapshot
2852
- * already, so no property is read a second time here.
2853
- *
2854
- * A value JSON cannot ENCODE AT ALL (a `BigInt`, a cycle) fails instead of degrading — those would throw
2855
- * inside the backend's own write anyway, and failing here means the caller can say why while nothing has
2856
- * been committed. The thrown value rides out on `cause` so the caller decides how to word the refusal.
2857
- */
2858
- export declare function encodeAtFidelity(fidelity: StoreFidelity, value: unknown): {
2859
- ok: true;
2860
- value: unknown;
2861
- } | {
2862
- ok: false;
2863
- cause: unknown;
2864
- };
2865
2206
  export interface CheckpointStore {
2866
2207
  /**
2867
2208
  * Managed-retention declaration (retention.ts), stated by the party that runs the sweep: `"managed"` says this store's
@@ -3135,6 +2476,8 @@ export interface CheckpointStore {
3135
2476
  * the once-only resolve. The PENDING predicate is byte-for-byte the {@link resolve} CAS's (`scope === scope &&
3136
2477
  * status === 'pending'`), so the list reflects exactly the rows that are still resumable. Order is unspecified
3137
2478
  * (the inbox sorts by `severity`/`deadline` itself). An empty scope returns `[]`. Required: every store answers it.
2479
+ * A row whose summary cannot be read is one row of the answer in its unreadable form ({@link CheckpointSummary.rowVerdict}),
2480
+ * never a failed page: the rows beside it are listed as they would be without it.
3138
2481
  */
3139
2482
  listByScope(scope: string): Promise<CheckpointSummary[]>;
3140
2483
  /**
@@ -3227,11 +2570,9 @@ export declare const ACTOR_ASSERTION_FROZEN_FIELDS: readonly ["id", "hostAsserte
3227
2570
  * Every consumer — the resume drain, the wake's nothing-to-deliver guard, a serving layer — goes through
3228
2571
  * here, so no site can grow its own idea of what "the parked steer" is.
3229
2572
  *
3230
- * A row that still carries the RETIRED pre-queue single seat (`state.pendingSteer`, written before the
3231
- * queue existed) is refused here rather than read: the seat has no `inputId`, `seq` or actor, so folding
3232
- * it in would mint a synthetic identity nothing else can name. The refusal is `checkpoint.unsupported_version`
3233
- * with `reason: "seat_retired"` — terminal for the row's bytes; the host decides the parked instruction
3234
- * on its own surface and parks it again through `setPendingSteer` if it still applies.
2573
+ * A row that still carries the RETIRED pre-queue single seat is refused here rather than read
2574
+ * (`retiredSteerSeatRefusal`, checkpoint-row-verdict.ts, thrown). A resume never reaches this refusal: the row's judge
2575
+ * refused the row before the claim, with the same refusal.
3235
2576
  */
3236
2577
  export declare function readPendingSteerQueue(state: Pick<CheckpointState, "pendingSteerQueue">): PendingSteerEntry[];
3237
2578
  /**
@@ -3299,6 +2640,8 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
3299
2640
  readonly holder: true;
3300
2641
  };
3301
2642
  private cps;
2643
+ /** The listing's memo of each stored row object's verdict: a `put` stores a new object, so a replaced row is judged again. */
2644
+ private readonly rowVerdicts;
3302
2645
  private fault;
3303
2646
  private readonly disclose;
3304
2647
  private readonly holderIsCurrent;
@@ -3378,23 +2721,3 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
3378
2721
  /** Test/inspection helper: number of stored checkpoints. */
3379
2722
  get size(): number;
3380
2723
  }
3381
- /**
3382
- * The ONE refusal of a retired mode seed, read PRE-CAS on every resume kind (resume-admission): a row whose `inheritedGate`
3383
- * still carries a retired member is refused as the engine refuses every retired row seat (`readPendingSteerQueue`) —
3384
- * `checkpoint.unsupported_version` with `reason: "seat_retired"` — terminal for the row's bytes on this engine, and
3385
- * nothing consumed: the row stays byte-identical and `pending`. No engine reads the retired keys into a mode any more; an
3386
- * engine at 7.38.x or earlier still does, so the row can be resumed there once (its next suspend writes `permissionMode`), or
3387
- * expired (`CheckpointStore.expire`).
3388
- */
3389
- export declare function refuseRetiredModeSeed(state: Pick<CheckpointState, "inheritedGate">): void;
3390
- /**
3391
- * The mode seed a row records (the 7.34.0 shape), read at prepare after {@link refuseRetiredModeSeed} has screened the row:
3392
- * `permissionMode` must be a member of the closed set and `prePlanMode` a mode a plan can return to (else
3393
- * `config.permission_mode_invalid`, the row cannot be resumed under a word this engine does not know); the shell floor is
3394
- * `"always"` or absent. Nothing here migrates or guesses.
3395
- */
3396
- export declare function recordedModeSeed(gate: Pick<NonNullable<CheckpointState["inheritedGate"]>, "permissionMode" | "prePlanMode" | "shellGate"> | undefined): {
3397
- permissionMode?: PermissionMode;
3398
- prePlanMode?: PermissionMode;
3399
- shellGate?: ShellGateDoctrine;
3400
- };