@sema-agent/core 7.61.0 → 7.62.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 (176) hide show
  1. package/CHANGELOG.md +312 -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.d.ts +6 -1
  8. package/dist/agents/subagent.js +66 -12
  9. package/dist/agents/suspend-guard.d.ts +38 -16
  10. package/dist/agents/suspend-guard.js +9 -4
  11. package/dist/agents/verify.js +4 -3
  12. package/dist/core/checkpoint-features.d.ts +722 -0
  13. package/dist/core/checkpoint-features.js +98 -0
  14. package/dist/core/checkpoint-requirements.d.ts +9 -2
  15. package/dist/core/checkpoint-requirements.js +9 -4
  16. package/dist/core/checkpoint-row-verdict.d.ts +99 -0
  17. package/dist/core/checkpoint-row-verdict.js +225 -0
  18. package/dist/core/checkpoint-store.d.ts +55 -745
  19. package/dist/core/checkpoint-store.js +39 -141
  20. package/dist/core/engine-notice.d.ts +19 -3
  21. package/dist/core/engine-notice.js +9 -2
  22. package/dist/core/gate-fold.js +2 -2
  23. package/dist/core/governance-codes.d.ts +3 -1
  24. package/dist/core/governance-codes.js +3 -0
  25. package/dist/core/hooks.d.ts +13 -0
  26. package/dist/core/human-input-projection.d.ts +1 -0
  27. package/dist/core/human-input-projection.js +3 -0
  28. package/dist/core/image-admission.d.ts +1 -1
  29. package/dist/core/locked-config.d.ts +2 -2
  30. package/dist/core/mcp-host-seat.js +6 -1
  31. package/dist/core/memory-engine/consolidation-driver.d.ts +1 -1
  32. package/dist/core/memory-vector.d.ts +1 -1
  33. package/dist/core/memory.d.ts +10 -10
  34. package/dist/core/mode-policy.js +1 -1
  35. package/dist/core/mods/classic-events.d.ts +9 -1
  36. package/dist/core/mods/dollar.d.ts +32 -1
  37. package/dist/core/mods/dollar.js +13 -1
  38. package/dist/core/mods/kernel/events.d.ts +11 -3
  39. package/dist/core/mods/kernel/events.js +13 -10
  40. package/dist/core/mods/lifecycle-stations.d.ts +36 -4
  41. package/dist/core/mods/lifecycle-stations.js +44 -9
  42. package/dist/core/mods/session-append.d.ts +4 -1
  43. package/dist/core/mods/session-append.js +7 -0
  44. package/dist/core/mods/session-receive.js +12 -15
  45. package/dist/core/mods/stations.d.ts +51 -6
  46. package/dist/core/mods/stations.js +124 -0
  47. package/dist/core/own-property-receipt.d.ts +7 -0
  48. package/dist/core/own-property-receipt.js +3 -0
  49. package/dist/core/read-root-candidate.js +1 -1
  50. package/dist/core/resume-startup-cause.d.ts +5 -4
  51. package/dist/core/runner/compact-session.js +5 -2
  52. package/dist/core/runner/contracts.d.ts +18 -8
  53. package/dist/core/runner/delegation-owner.d.ts +43 -0
  54. package/dist/core/runner/delegation-owner.js +59 -0
  55. package/dist/core/runner/lineage-reroot-view.d.ts +56 -0
  56. package/dist/core/runner/lineage-reroot-view.js +108 -0
  57. package/dist/core/runner/permission-rule-lanes.d.ts +2 -1
  58. package/dist/core/runner/permission-rule-lanes.js +2 -2
  59. package/dist/core/runner/person-path-rows.d.ts +15 -0
  60. package/dist/core/runner/person-path-rows.js +26 -3
  61. package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -1
  62. package/dist/core/runner/prepare-acquire-reconcile.js +7 -2
  63. package/dist/core/runner/prepare-caps-and-workflow.d.ts +1 -0
  64. package/dist/core/runner/prepare-caps-and-workflow.js +1 -1
  65. package/dist/core/runner/prepare-config-doors.d.ts +6 -6
  66. package/dist/core/runner/prepare-config-doors.js +3 -4
  67. package/dist/core/runner/prepare-hands-readface.d.ts +1 -1
  68. package/dist/core/runner/prepare-hands-readface.js +28 -7
  69. package/dist/core/runner/prepare-inherited-gate.d.ts +2 -0
  70. package/dist/core/runner/prepare-inherited-gate.js +7 -3
  71. package/dist/core/runner/prepare-task.js +10 -7
  72. package/dist/core/runner/resume-admission.d.ts +3 -3
  73. package/dist/core/runner/resume-admission.js +6 -3
  74. package/dist/core/runner/resume-apply.d.ts +4 -0
  75. package/dist/core/runner/resume-apply.js +11 -4
  76. package/dist/core/runner/resume-checkpoint-screen.d.ts +9 -0
  77. package/dist/core/runner/resume-checkpoint-screen.js +4 -84
  78. package/dist/core/runner/run-git-lane.d.ts +2 -0
  79. package/dist/core/runner/run-git-lane.js +4 -1
  80. package/dist/core/runner/run-harness-handlers.d.ts +2 -0
  81. package/dist/core/runner/run-harness-handlers.js +3 -2
  82. package/dist/core/runner/run-leg.js +24 -7
  83. package/dist/core/runner/run-settle-and-teardown.js +3 -2
  84. package/dist/core/runner/run-stop-and-final-verify.js +2 -1
  85. package/dist/core/runner/run-turn-boundary.js +7 -4
  86. package/dist/core/runner/runtask.js +6 -6
  87. package/dist/core/runner/steering-preview.d.ts +9 -0
  88. package/dist/core/runner/steering-preview.js +5 -0
  89. package/dist/core/runner/stream-steer-verb.js +8 -0
  90. package/dist/core/runner/tool-face-overlay.js +2 -0
  91. package/dist/core/runner/turn-attachments.d.ts +5 -0
  92. package/dist/core/runner/turn-attachments.js +1 -1
  93. package/dist/core/runner-deps.d.ts +2 -2
  94. package/dist/core/secret-env.d.ts +8 -5
  95. package/dist/core/secret-env.js +37 -18
  96. package/dist/core/session-store.d.ts +1 -1
  97. package/dist/core/session-store.js +5 -1
  98. package/dist/core/session.d.ts +14 -4
  99. package/dist/core/store-contracts/checkpoint-store-contract.d.ts +6 -0
  100. package/dist/core/store-contracts/checkpoint-store-contract.js +68 -0
  101. package/dist/core/store-contracts/session-store-contract.js +22 -8
  102. package/dist/core/task-event.d.ts +7 -1
  103. package/dist/core/task-notification.js +2 -1
  104. package/dist/core/task-registry-agent.d.ts +27 -7
  105. package/dist/core/task-registry-agent.js +12 -5
  106. package/dist/core/task-registry-shared.d.ts +7 -0
  107. package/dist/core/task-registry-workflow.js +4 -3
  108. package/dist/core/task-registry.d.ts +13 -2
  109. package/dist/core/task-registry.js +11 -4
  110. package/dist/core/task-result.d.ts +5 -5
  111. package/dist/core/task-spec.d.ts +1 -1
  112. package/dist/core/terminal-cause.d.ts +6 -6
  113. package/dist/core/tool-face.d.ts +6 -2
  114. package/dist/core/tool-face.js +1 -1
  115. package/dist/core/tool-policy.d.ts +2 -1
  116. package/dist/core/tool-roster.d.ts +4 -4
  117. package/dist/core/tool-spec.d.ts +4 -0
  118. package/dist/core/types.d.ts +1 -1
  119. package/dist/core/types.js +1 -1
  120. package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
  121. package/dist/engine/execution-env/node-execution-env.js +12 -5
  122. package/dist/engine/harness/types.d.ts +11 -0
  123. package/dist/engine/session/parent-chain-guard.d.ts +3 -3
  124. package/dist/engine/session/parent-chain-guard.js +1 -1
  125. package/dist/engine/session/path-to-root.d.ts +18 -3
  126. package/dist/engine/session/path-to-root.js +15 -1
  127. package/dist/engine/session/repo-utils.d.ts +12 -1
  128. package/dist/engine/session/repo-utils.js +41 -0
  129. package/dist/engine/session/session.js +1 -1
  130. package/dist/engine/session/storage-base.d.ts +20 -0
  131. package/dist/engine/session/storage-base.js +28 -9
  132. package/dist/index.d.ts +9 -8
  133. package/dist/index.js +4 -4
  134. package/dist/internal/harness.d.ts +4 -3
  135. package/dist/internal/harness.js +3 -2
  136. package/dist/orchestration/run-workflow-tool.d.ts +3 -0
  137. package/dist/orchestration/run-workflow-tool.js +27 -11
  138. package/dist/orchestration/workflow-governance.d.ts +1 -1
  139. package/dist/orchestration/workflow.d.ts +3 -0
  140. package/dist/orchestration/workflow.js +2 -7
  141. package/dist/stores/file/checkpoint-store.d.ts +2 -0
  142. package/dist/stores/file/checkpoint-store.js +7 -6
  143. package/dist/stores/file/fs-atomic.d.ts +0 -22
  144. package/dist/stores/file/fs-atomic.js +0 -17
  145. package/dist/stores/file/index.d.ts +2 -9
  146. package/dist/stores/file/index.js +2 -4
  147. package/dist/stores/file/session-store.d.ts +13 -7
  148. package/dist/stores/file/session-store.js +40 -17
  149. package/dist/tools/fs/bash-program-position.d.ts +3 -2
  150. package/dist/tools/fs/bash-program-position.js +7 -7
  151. package/dist/tools/fs/removal-targets.js +2 -2
  152. package/dist/tools/fs/shell-read-argv.d.ts +4 -2
  153. package/dist/tools/fs/shell-read-argv.js +14 -3
  154. package/dist/tools/fs/shell-read-bindings.d.ts +18 -2
  155. package/dist/tools/fs/shell-read-bindings.js +148 -68
  156. package/dist/tools/fs/shell-read-check.js +20 -4
  157. package/dist/tools/fs/shell-read-establish.js +22 -8
  158. package/dist/tools/fs/shell-read-functions.js +2 -2
  159. package/dist/tools/fs/shell-read-object-path.d.ts +59 -0
  160. package/dist/tools/fs/shell-read-object-path.js +119 -0
  161. package/dist/tools/fs/shell-read-plan.d.ts +8 -0
  162. package/dist/tools/fs/shell-read-plan.js +47 -30
  163. package/dist/tools/fs/shell-read-start.d.ts +66 -13
  164. package/dist/tools/fs/shell-read-start.js +89 -17
  165. package/dist/tools/fs/shell-read-workdir.d.ts +29 -8
  166. package/dist/tools/fs/shell-read-workdir.js +31 -8
  167. package/package.json +2 -2
  168. package/test/export-surface.snapshot.json +21 -33
  169. package/wire-changes/core-stores-sql@7.62.0.json +30 -0
  170. package/wire-changes/core@7.62.0.json +2181 -0
  171. package/wire-changes/mods-kernel@7.62.0.json +42 -0
  172. package/wire-changes/primitives@7.62.0.json +30 -0
  173. package/dist/core/consolidate-scope.d.ts +0 -93
  174. package/dist/core/consolidate-scope.js +0 -98
  175. package/dist/core/runner/memory-consolidation.d.ts +0 -109
  176. package/dist/core/runner/memory-consolidation.js +0 -251
@@ -0,0 +1,722 @@
1
+ import type { Checkpoint, ProbeCause, StoreFidelity } from "./checkpoint-store.js";
2
+ import type { SteerReplayFacet } from "./steer-replay.js";
3
+ /** True ONLY for a PLAIN data record (not null / array / class-instance / proxy-with-odd-prototype) — the only
4
+ * shape we safely digest. Adversarial args (a proxy, a getter that throws) must never crash the mint, so this +
5
+ * {@link safeDataValue}/{@link safeKeys} make {@link buildRiskDescriptor} fully TOTAL. */
6
+ export declare function isPlainRecord(x: unknown): x is Record<string, unknown>;
7
+ /** Read `obj[key]` as a DATA property only — NEVER invokes a getter/accessor (so a throwing getter can't escape
8
+ * AND a non-deterministic getter can't vary the digest); a trapped descriptor read ⇒ undefined. */
9
+ export declare function safeDataValue(obj: Record<string, unknown>, key: string): unknown;
10
+ /**
11
+ * The ONE validator for a {@link ProbeCause} arriving from a probe.
12
+ *
13
+ * The value crosses a trust boundary twice — once at the gate (where a deployment-supplied probe hands
14
+ * it over) and once at the persist boundary (where {@link buildRiskDescriptor} is an exported function a
15
+ * caller may reach directly) — so both call it rather than each writing its own idea of "valid". A
16
+ * malformed cause yields `undefined`: the ASK still stands (the verdict was never this member's to
17
+ * decide), the card simply carries no account. Fail-closed on the disclosure, never on the gate.
18
+ *
19
+ * Every field is re-derived rather than trusted: strings are neutralized and capped individually, the
20
+ * shown list is clamped, and `total` is coerced to a non-negative integer that cannot understate what is
21
+ * shown (a `total` below `shown.length` would turn an honest count into a false reassurance).
22
+ */
23
+ export declare function normalizeProbeCause(value: unknown): ProbeCause | undefined;
24
+ /**
25
+ * The checkpoint FEATURE TABLE — one row per feature that ever raised the row format: its schema version, and
26
+ * what a mint owed when the feature was present (`writes`, prose). The per-feature constants below ARE the rows'
27
+ * versions. The table is CLOSED at `requirements` (v10): every live mint stamps 10 and lists the row's
28
+ * reader-requirement words beside it (`Checkpoint.requires`, checkpoint-requirements.ts) — a later segment adds a
29
+ * word there, never a row here. Each feature key below (but `baseline` / `requirements`) is itself one of those
30
+ * words, and whether a v10 row carries the feature is read off the row's content by the requirement tables.
31
+ *
32
+ * A v≤9 row was stamped the HIGHEST feature it carried, so the number records only the top feature; the resume
33
+ * rules that read a v≤9 row by number are exact to the version at which their feature was the top
34
+ * (`realApproval` is version-recorded at v8 and marker-recorded — `readFace.realApproval` — at v9).
35
+ *
36
+ * v4 is a GAP, deliberately: the retired cross-slice wall-clock allocation. This worker still reads v4
37
+ * rows; a ledger carrying the retired axis is refused by FIELD (`walltime_axis_retired`) at any version.
38
+ */
39
+ export declare const CHECKPOINT_FEATURES: {
40
+ /** The baseline shape: a plain human-approval suspend before any feature raised the format. No live
41
+ * mint stamps it today; it is the floor of the ladder and the reading of a row written before any feature. */
42
+ readonly baseline: {
43
+ readonly version: 1;
44
+ readonly introduced: "design/49";
45
+ readonly writes: "the row itself";
46
+ };
47
+ /** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction an older worker
48
+ * cannot handle (it rejects pre-CAS; the row stays `pending`, retryable on a newer worker). */
49
+ readonly resource: {
50
+ readonly version: 2;
51
+ readonly introduced: "design/74";
52
+ readonly writes: "resourceLedger; gate/pendingAction kind resource_limit";
53
+ };
54
+ /** A HUMAN-DECISION park (tool approval or plan_review) of the binding era: the decision-action binding
55
+ * (`boundCallId` + `boundInputHash` on a tool_approval) is enforced ENTIRELY by the resuming worker, so a
56
+ * pre-binding worker must reject the row rather than execute the pending tool unverified. Like `resource`,
57
+ * this row is a park-kind FLOOR: a plan_review park carries it with no binding (it was introduced above it);
58
+ * whether a tool_approval row carries its hash is the resume binding rung's own conjunction. */
59
+ readonly binding: {
60
+ readonly version: 3;
61
+ readonly introduced: "design/80";
62
+ readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only";
63
+ };
64
+ /** A ledger carrying a cross-slice TOKEN allocation: the window clamp and the exhausted-resume fail-fast
65
+ * live in the resuming worker. A ledger with no token total keeps the historic stamps. */
66
+ readonly token: {
67
+ readonly version: 5;
68
+ readonly introduced: "design/164";
69
+ readonly writes: "resourceLedger.totalTokens";
70
+ };
71
+ /** Org-memory admission freeze state (the adjudicated-empty record included): the session/delegation
72
+ * freeze on resume and the tenant-admission door live in the resuming worker. */
73
+ readonly orgAdmission: {
74
+ readonly version: 6;
75
+ readonly introduced: "org-admission";
76
+ readonly writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned";
77
+ };
78
+ /** The F-012 durable enforcement fields: the frozen ancestor projection chain + its digest (one write, the
79
+ * resume-edit re-adjudication executes it) and/or the delegation-provenance aggregate a resume re-seeds. */
80
+ readonly f012: {
81
+ readonly version: 7;
82
+ readonly introduced: "F-012";
83
+ readonly writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance";
84
+ };
85
+ /** A gate carrying {@link RealApprovalGateBit}: the no-org-wiring refusal and the org_unavailable resume
86
+ * belt live in the resuming worker. Minted at ONE site (the approval park); the two always-mounted
87
+ * integrity policies mint it on any durable deployment, org-governed or not. */
88
+ readonly realApproval: {
89
+ readonly version: 8;
90
+ readonly introduced: "#130/#120";
91
+ readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it";
92
+ };
93
+ /** The READ-face section ({@link CheckpointState.readFace}): resolved face + normalized deny-set additions,
94
+ * written only for a non-default posture; the stricter-wins fold lives in the resuming worker. Carries the
95
+ * redundant governance marker for `realApproval` (see the table note above). Absent ⇒ default posture. */
96
+ readonly face: {
97
+ readonly version: 9;
98
+ readonly introduced: "design/199";
99
+ 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)";
100
+ };
101
+ /** The last row: the reader-requirement words ({@link CheckpointRow.requires}). Every live mint stamps it, so a
102
+ * worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted from here on, `version_newer`, pre-CAS. */
103
+ readonly requirements: {
104
+ readonly version: 10;
105
+ readonly introduced: "#1320";
106
+ readonly writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)";
107
+ };
108
+ };
109
+ /** One row of {@link CHECKPOINT_FEATURES}. */
110
+ export interface CheckpointFeatureRow {
111
+ readonly version: number;
112
+ /** Where the feature came from — a design or ticket tag, documentation only. */
113
+ readonly introduced: string;
114
+ /** What a mint wrote when the feature was present (prose; the mint sites are the code). */
115
+ readonly writes: string;
116
+ }
117
+ /** The feature words — the row keys of {@link CHECKPOINT_FEATURES}. */
118
+ export type CheckpointFeature = keyof typeof CHECKPOINT_FEATURES;
119
+ /** The BASELINE {@link Checkpoint} schema version — the `baseline` row. NOT the highest a resume accepts (that
120
+ * is {@link MAX_SUPPORTED_CHECKPOINT_VERSION}); resume stays forward-compatible by `<=` against MAX, never `===`. */
121
+ export declare const CURRENT_CHECKPOINT_VERSION: 1;
122
+ /** The `resource` row's version. */
123
+ export declare const RESOURCE_CHECKPOINT_VERSION: 2;
124
+ /** The `binding` row's version. */
125
+ export declare const BINDING_CHECKPOINT_VERSION: 3;
126
+ /** The `token` row's version. v4 (the retired wall-clock total) is deliberately not reused. */
127
+ export declare const TOKEN_CHECKPOINT_VERSION: 5;
128
+ /** The `orgAdmission` row's version. */
129
+ export declare const ORG_ADMISSION_CHECKPOINT_VERSION: 6;
130
+ /** The `f012` row's version. */
131
+ export declare const F012_CHECKPOINT_VERSION: 7;
132
+ /** The `realApproval` row's version. */
133
+ export declare const REAL_APPROVAL_CHECKPOINT_VERSION: 8;
134
+ /** The `face` row's version. */
135
+ export declare const FACE_CHECKPOINT_VERSION: 9;
136
+ /** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table, and the stamp
137
+ * of every live mint (the table is closed there); a higher one is rejected pre-CAS with {@link CheckpointError}
138
+ * `unsupported_version` (the row stays `pending`, retryable on a newer worker). */
139
+ export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 10;
140
+ /**
141
+ * Read a checkpoint's schema version, defaulting an absent field to **legacy `0`** (a 1.67-era checkpoint
142
+ * written before the field existed — it carries no `workspaceHandle`, so resuming it the v1 way is safe).
143
+ * Compare with `<= MAX_SUPPORTED_CHECKPOINT_VERSION`, never `=== CURRENT_CHECKPOINT_VERSION` (design/49 §3).
144
+ */
145
+ export declare function checkpointVersionOf(cp: Pick<Checkpoint, "version">): number;
146
+ /**
147
+ * WHICH arm of a multi-arm {@link CheckpointError} `code` fired (requested 2026-08-10: a deployment retry
148
+ * policy needs to tell "a newer worker can redeem this row" from "this row is damaged/caller-declared and
149
+ * no worker ever will" — blanket-retriable and gate-shape heuristics were both refuted downstream, so the
150
+ * throw site carries the fact it always knew).
151
+ *
152
+ * A CLOSED SET with one home, registered in `docs/CLOSED-SETS.md`. It is carried in an OPTIONAL member, so
153
+ * the compiler is silent when a throw site omits it, and a site that omits it hands the host a refusal it
154
+ * cannot classify — the registry's mint-obligation leg is what makes the omission loud (every
155
+ * `checkpoint.unsupported_version` construction site must spell one of these words AT the site).
156
+ *
157
+ * · `unsupported_version` arms: `"version_newer"` (the row's format is newer than this worker's, or it lists a
158
+ * reader-requirement word this worker lacks — `detail.requires` names those words — retryable on a newer
159
+ * worker), `"env_factory_missing"` (retryable on a factory-wired worker),
160
+ * `"governed_unwired"` (retryable on an org-wired worker), `"origin_missing"` (a pending approval row
161
+ * minted before the ask's origin was persisted on the park — terminal for the row's bytes; the host
162
+ * decides the orphaned card itself, no worker version redeems it), `"tool_identity_missing"` (a pending approval row
163
+ * whose tool member is not whole — parked before 7.58.0 recorded the declaration, or damaged: an allow is refused, a deny
164
+ * settles it; a worker of the release that parked it still reads it), `"ledger_event_unknown"` (a durable
165
+ * LEDGER carries an event kind this binary does not know, so the replay is refused rather than served
166
+ * incomplete — the one arm that is not row-scoped: NO row in that data directory is readable here, so
167
+ * the host rolls the binary forward instead of routing one token elsewhere), `"seat_retired"` (the row
168
+ * carries a seat this engine no longer reads — terminal for the row's bytes: the retired pre-queue single
169
+ * steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
170
+ * `inheritedGate`, which an engine at 7.38.x or earlier still reads once).
171
+ * · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
172
+ * `"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
173
+ * current bytes — no worker version redeems a damaged row).
174
+ *
175
+ * 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
176
+ * ROW-INTEGRITY word and only that, `detail.field` ({@link CheckpointErrorField}) names the cell of the decision to act on, a refusal carries at most
177
+ * one of them, and a refusal with neither is never a damaged row.
178
+ */
179
+ 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"
180
+ /** `state.writeFace` is present but not a well-formed section. No `_forged` twin: the section is
181
+ * legal-and-absent at every version, so there is no version to judge a fabrication against — and a
182
+ * fabricated "open" still needs the LIVE resolution to say open too. */
183
+ | "write_face_damaged" | "skill_grants_damaged"
184
+ /** `state.skillScopes` is present but not a list of skill names (the active skills whose hooks the resumed leg reopens). */
185
+ | "skill_scopes_damaged" | "constraint_chain_missing"
186
+ /** `state.handsRoot` / `state.handsHome` / `state.handsCwd` is present but not an absolute path (the row's hands' coordinates). */
187
+ | "hands_coordinates_damaged"
188
+ /** The row's reader-requirement list ({@link CheckpointRow.requires}) is missing on a v10 row, is not a list of words,
189
+ * is present below v10, or does not equal the words the row's content carries (a segment dropped, or a word not
190
+ * declared) — terminal for the row's bytes. */
191
+ | "requirements_damaged"
192
+ /** A pending tool approval whose row format is at or above the binding era carries no persisted `boundInputHash` — every mint at that
193
+ * version writes one, so its absence is corruption or a caller-declared downgrade, and the decision-action input binding has nothing to
194
+ * 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). */
195
+ | "bound_input_hash_missing"
196
+ /** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
197
+ * no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
198
+ * entry / a record member naming no absolute root. */
199
+ | "installation_record_absent" | "installation_record_misaligned" | "installation_record_invalid"
200
+ /** On `checkpoint.config_refused` with `detail.code` `config.tool_face_control` — the arm prepare's own refusal carries as its `detail.reason`:
201
+ * 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
202
+ * the one spelling a row records (`"not_a_list"`, `"not_a_string"`, `"unknown_name"`, `"unsupported_pattern"`; the re-supplied config's own four lists —
203
+ * `allowTools`, `excludeTools`, `deferTools`, `alwaysLoadTools` — are refused as `"not_a_list"` / `"not_a_string"`); the record of the delegation tool that
204
+ * 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
205
+ * (`"renamed_mount"`); the process-wide table of declared names is occupied by a value that is not the engine's (`"registry_occupied"`). */
206
+ | "not_a_list" | "not_a_string" | "unknown_name" | "unsupported_pattern" | "invalid_record" | "renamed_mount" | "registry_occupied"
207
+ /** 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`)
208
+ * — 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
209
+ * 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`). */
210
+ | "unknown_model_ref" | "not_a_model_ref" | "unknown_role_word" | "no_model_for_role";
211
+ /**
212
+ * The codes a RESUME's pre-claim configuration screen carries as `detail.code` of a `checkpoint.config_refused` — the words prepare's
213
+ * doors throw, held unchanged so one refusal reads the same on a fresh run (`TaskResult.errorCode`) and on a resume: the mode, output-style,
214
+ * approval-reach, invoked-skill, attachment, recorded-mode and tool-face doors (`config.spec_retired_key` … `config.tool_face_control`, the first
215
+ * nine — `detail.reason` names the tool-face arm: {@link CheckpointErrorReason}), and every value door of the config-door phase over the
216
+ * re-supplied config and the deployment's deps (`configValueDoors`, the rest): the retired deps seats and caller-policy members
217
+ * (`config.deps_retired_key`), the peer presence, the restore selector, the microCompact knob, the prompt selectors, `resumeAt` on a resume
218
+ * (`resume_at.conflicts_resume`, `resume_at.mode_without_target` — a resume carrying `resumeAt` is refused as a conflict before its mode is
219
+ * 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,
220
+ * 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`,
221
+ * `config.locked_key`), an MCP server's content class, the skills-listing seats (`config.skill_listing_budget_invalid`), the limits and the
222
+ * 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
223
+ * would run on (`config.retention_policy`, `config.retention_capability`), and the checkpoint store seat itself (`config.invalid_checkpoint_store`: the
224
+ * retired `null` spelling, a store that declares no execution outcome), and the skills seat and the hands band (`config.invalid_argument`;
225
+ * a skill's `baseDir` by its own reader, `config.skill_base_dir_invalid`). A door not entered here (the leg's model, its rebuilt
226
+ * 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").
227
+ * 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:
228
+ * a member whose read throws (`config.spec_member_unreadable`) and a key the engine does not read (`config.spec_unknown_key`); its third,
229
+ * a retired key, is `config.spec_retired_key` (first).
230
+ */
231
+ 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"];
232
+ export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODES)[number];
233
+ export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
234
+ /** 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
235
+ * `docs/CLOSED-SETS.md`: a consumer holding a table over it is tsc-red on a new word until it places the word. */
236
+ export type CheckpointErrorField = "boundCallId" | "boundInputHash" | "boundGrantDigest" | "answer" | "hostDecision" | "approver" | "feedback" | "outcome" | "updatedInput" | "decision" | "reason" | "taskConfig" | "deps" | "inheritedGate";
237
+ /** A typed checkpoint-store error so callers branch on `code` (mirrors `SessionError`). */
238
+ export declare class CheckpointError extends Error {
239
+ readonly code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
240
+ /** `runner.resume` was handed an {@link ResumeOutcome} whose `gate` arm does not match the
241
+ * persisted {@link CheckpointGate} `kind` (council #3 — type confusion guard), or a gate v1
242
+ * resume does not serve (`task_done`). */
243
+ | "checkpoint.gate_mismatch"
244
+ /** The resume's `TaskSpec.signal` was aborted at the entrance — handed in ALREADY-ABORTED, or aborted
245
+ * while the wake screen / `resumePreflight` / pre-claim re-adjudication still ran: ONE code for a
246
+ * cancellation there (the seats' own codes keep what the hook itself did). Refused BEFORE the CAS, so
247
+ * the checkpoint stays `pending`; consuming the decision on a leg that aborts at once would lose it. */
248
+ | "checkpoint.resume_aborted"
249
+ /** `runner.resume` was handed an outcome whose payload is unsafe to apply — e.g. a deny `reason`
250
+ * carrying a `</system-reminder>` tag that would escape the model-facing wrapper (round-2 #1). */
251
+ | "checkpoint.invalid_outcome"
252
+ /** The checkpoint's {@link Checkpoint.version} is newer than this worker supports
253
+ * (`> MAX_SUPPORTED_CHECKPOINT_VERSION`), or it carries a remote `workspaceHandle` but no
254
+ * `executionEnvFactory` is wired to rebuild the env — either way this worker cannot safely resume it.
255
+ * Rejected pre-CAS so the checkpoint stays `pending` and a capable worker can still resume it
256
+ * (design/49 §2/§3, code-ready council round-2). */
257
+ | "checkpoint.unsupported_version"
258
+ /** The resume's re-supplied config, or a mode the checkpoint row recorded, is one prepare would refuse
259
+ * (a retired spec key, a malformed output style, a mode word outside the closed set, a retired shell-floor
260
+ * word). Refused PRE-CAS, so the checkpoint stays `pending` and byte-identical. `message` is prepare's own
261
+ * sentence; `detail.code` is prepare's own code ({@link CheckpointConfigRefusalCode}) and `detail.field`
262
+ * says which input carries it: `"taskConfig"` (correct the config and resume the SAME token) or
263
+ * `"inheritedGate"` (the recorded row — no config reaches it; expire the row). A fresh run of the same
264
+ * bad config reports the same `detail.code` as its `TaskResult.errorCode`. */
265
+ | "checkpoint.config_refused"
266
+ /** `resume`/`resumeStream` was handed `internals.requestedCwd` for a checkpoint that
267
+ * carries a remote `workspaceHandle`. The restored workspace's mountPath is authoritative for the
268
+ * task root, so the cwd would be ignored at best — and verifying it would touch the env BEFORE the
269
+ * VM restore (a lazy-connect adapter then connects a fresh empty sandbox, the design/49 disease).
270
+ * Rejected pre-CAS so the checkpoint stays `pending`; re-resume without `requestedCwd`. */
271
+ | "checkpoint.cwd_conflicts_restore"
272
+ /** design/164: the checkpoint was written by a pre-164 worker AND its ledger carries the RETIRED
273
+ * cross-slice wall-clock allocation (`resourceLedger.totalWalltimeSec`). The axis no longer exists,
274
+ * so resuming would run the leg with the operator's time ceiling silently unenforced. Refused
275
+ * PRE-CAS (the row stays `pending`, so a worker of the previous release can still finish it) rather
276
+ * than migrated: there is no honest conversion from a wall-clock allocation to a token one. */
277
+ | "checkpoint.walltime_axis_retired"
278
+ /** design/80 D-1 (reopen-by-reason): a re-resume of an `env_failed`-reopened checkpoint supplied an
279
+ * outcome that does NOT equal the persisted {@link ResolvedOutcome} winner. An `env_failed` reopen is
280
+ * a SYSTEM RETRY of the already-approved action (the infra failed, not the decision) — it must replay
281
+ * the exact winning binding, never a new vote. Rejected pre-CAS, fail-closed, so the checkpoint stays
282
+ * `pending` for the correctly-replayed retry. (A `tool_unavailable` reopen — P-7 — is exempt: it lets
283
+ * a human re-decide with the tool present, so a fresh decision is permitted there.) */
284
+ | "checkpoint.reopen_revote"
285
+ /** design/80 D-1 (atomicity fix): the resume validated its decision-action / reopen-by-reason guards
286
+ * against a `get()` snapshot, but a concurrent {@link CheckpointStore.resolve}/{@link CheckpointStore.reopen}
287
+ * cycle advanced the monotonic {@link Checkpoint.rev} in the get→resolve window, so the
288
+ * {@link CheckpointStore.resolve} CAS's optimistic-concurrency check lost (the validation is stale). The
289
+ * row is still `pending` — fail-closed; the caller must re-`get` and re-validate against the CURRENT state
290
+ * (a fresh resume), never blindly retry. */
291
+ | "checkpoint.reopened_concurrently"
292
+ /** A post-CAS compensation {@link CheckpointStore.reopen} returned `false` — the consumed row could not
293
+ * be flipped back to `pending` (missing, expired, or changed under a concurrent cycle), so no retryable
294
+ * checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
295
+ * caller's compensation path settles the token as terminally consumed. */
296
+ | "checkpoint.reopen_failed"
297
+ /** `Runner.voidVerifierPause` voided the card — the row IS expired and its env duty ran — but releasing the verifier
298
+ * session's pin threw or did not settle within the teardown bound: the session stays pinned until it is unpinned. */
299
+ | "checkpoint.void_unpin_failed"
300
+ /** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
301
+ * execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
302
+ * in-tree form of this code. Never a retry condition. */
303
+ | "checkpoint.execution_outcome_conflict"
304
+ /** design/80 D-A: {@link CheckpointStore.setPendingSteer} was handed `text` containing a
305
+ * `</system-reminder>` close tag — it would escape the model-facing `<system-reminder>` wrapper a
306
+ * trusted steer rides on resume. Rejected fail-closed so a dirty steer NEVER enters {@link CheckpointState}
307
+ * (§3 inv #2). Mirrors the trusted-steer reject at runtask.ts (`steering.invalid_content`). */
308
+ | "steering.invalid_content"
309
+ /** design/171 §6.3: the append would cross the parked-steer queue's entry-count or byte bound
310
+ * ({@link MAX_PENDING_STEER_ENTRIES} / {@link PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES}). Fail-loud
311
+ * rather than evicting: an already-accepted operator instruction is never dropped to make room —
312
+ * the caller delivers or removes a parked steer first. Nothing is written on this path. */
313
+ | "steering.queue_full"
314
+ /** design/171 §6.3 (falsification review adoption): the append reused an `inputId` already parked on
315
+ * this checkpoint, but with DIFFERENT content. Re-appending an IDENTICAL steer stays the idempotent
316
+ * no-op a retry needs; a differing one is refused, because swallowing it would lose the second
317
+ * operator's instruction — the exact silent loss the queue replaced. `detail.differs` names the facets
318
+ * that differ: with `text` among them it is another instruction (retry it under a fresh id); without,
319
+ * it is the parked one re-sent at another tier / trust / attribution (a fresh id would park it twice —
320
+ * replay it with its original values). Nothing is written on this path. */
321
+ | "steering.duplicate_input_id"
322
+ /** design/373 §4.3 (D2): the deployment's `userPromptSubmit` hook refused a wake resume's
323
+ * `message` at the entrance screen (block verdict, or a fail-closed timeout/crash — the
324
+ * message discriminates). Pre-CAS: the checkpoint stays `pending` and byte-identical, so the
325
+ * SAME token is redeemable once the screen clears — a refusal burns nothing. The live steer
326
+ * verb refuses under the same code word (its own Error face); one vocabulary, two entrances. */
327
+ | "steering.blocked_by_hook"
328
+ /** design/144 §3 (governance-gate purity, fail-closed pre-CAS): a `wake` outcome was supplied for a
329
+ * checkpoint that awaits a PENDING GATE DECISION (tool approval / dry-run review / plan review /
330
+ * resource-limit continue). Wake is a pure un-park verb and must never circumvent an approval — resume
331
+ * the checkpoint through its own decide entry instead (the error message names it). */
332
+ | "wake.gate_pending"
333
+ /** design/144 §3 (anti spin-wake): a `wake` outcome carried no `message` and the checkpoint has no
334
+ * parked steer either — there is nothing to deliver, so the wake is rejected pre-CAS
335
+ * (the checkpoint stays pending) instead of burning the token on an empty continuation. */
336
+ | "wake.nothing_to_deliver"
337
+ /** Parent effective-policy inheritance: the checkpoint records `state.inheritedGate.requiresParentConstraint`
338
+ * (the suspended task ran under inherited OPAQUE parent-policy constraints — live closures that cannot
339
+ * persist), but the resume supplied no `RunInternals.inheritedGate.parentConstraints` to re-instate them.
340
+ * Resuming anyway would silently DROP the ancestors' gate (a widening), so this rejects pre-CAS — the
341
+ * checkpoint stays `pending`; re-resume via `resumeStream(token, outcome, config, internals)` with the
342
+ * parent chain re-supplied. */
343
+ | "resume.parent_constraint_missing"
344
+ /** Parent effective-policy inheritance (shape check): the resume DID re-supply
345
+ * `internals.inheritedGate.parentConstraints`, but its length differs from the checkpoint's recorded
346
+ * `parentConstraintCount` — or (F-012 L1) its projection CONTENT digests differently from the
347
+ * recorded `constraintDigest` — or a screening entry names a `tool.check` guard beside a policy the
348
+ * constraint mint did not make (no chain to raise it on) — a partial/mismatched re-supply would silently run
349
+ * the child under a thinner (or different) ancestor chain than it suspended with. Rejected pre-CAS (the
350
+ * checkpoint stays `pending`); re-resume with the full original chain. */
351
+ | "resume.parent_constraint_mismatch"
352
+ /** #449 G1 (codex r2, pre-CAS entrance): a deployment usage-governance window for this resume's
353
+ * ledger key (the config's principal, else the row's recorded one, else the shared bucket) is
354
+ * EXHAUSTED, and the row still OWES a delivery a re-mint cannot carry (an approval/review
355
+ * decision, a wake, parked steers, a background-task obituary snapshot). Refused BEFORE the CAS,
356
+ * so nothing is consumed and nothing is unpinned — the SAME token with the SAME decision is
357
+ * redeemable once the window frees (`detail.retryAfterMs` carries the wait). A bare
358
+ * `resource_limit` continue with nothing parked does NOT take this refusal: it proceeds and
359
+ * re-suspends at turn 0 into a FRESH checkpoint carrying the new wait hint. */
360
+ | "resume.usage_window_exhausted"
361
+ /** #449 G2 (identity continuity): the resume config carries a NON-EMPTY `principal` that differs from
362
+ * the {@link Checkpoint.principal} recorded at the suspend mint. `ResumeTaskConfig`'s contract keeps
363
+ * the run's identity (its capability lists are the deployment's current ones), and the principal keys real lanes on the resumed leg
364
+ * (the usage-governance ledger bucket, later mints' scope derivation, session-rule reads, ask
365
+ * attribution) — silently running the leg under a different identity is the bad-value direction this
366
+ * refusal exists to close. Rejected PRE-CAS (the checkpoint stays `pending`); re-resume with the
367
+ * original principal, or omit the field to inherit the recorded one. */
368
+ | "resume.principal_mismatch"
369
+ /** design/380 O1③ (placement identity continuity — the `resume.principal_mismatch` rung's twin
370
+ * on the placement axis): the resume supplied trusted internals whose EXPLICIT
371
+ * `placementRoot` differs from the {@link CheckpointState.placementRootSessionId} recorded at
372
+ * the suspend mint. A target-bound env factory keys its placement lookup on that fixed point,
373
+ * so silently resuming under a different one would re-place the leg — and every descendant
374
+ * the child-internals chain hands it to — on another target than the parked workspace lives
375
+ * on. A supplied `rootSessionId` deliberately does NOT take this refusal: it is
376
+ * delegation identity, re-supplied by every revive leg, and legitimately differs from the
377
+ * recorded root whenever the spawner carried an explicit placement — the recorded root simply
378
+ * outranks it in prepare's restore fold. Rejected PRE-CAS (the checkpoint stays `pending`);
379
+ * re-resume with the recorded root, or omit `internals.placementRoot` to inherit it. Either
380
+ * side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
381
+ * — the honest degradation arm. */
382
+ | "resume.placement_mismatch"
383
+ /** The composition-leg twin of `resume.placement_mismatch`: the resume supplied trusted internals whose
384
+ * `compositionLeg` differs from the {@link CheckpointState.compositionLeg} recorded at the suspend mint — the
385
+ * composition's resume entry was handed another card's identity, and continuing would run this leg as a rung it is
386
+ * not, file its next card under another host session, or both. Rejected PRE-CAS (the checkpoint stays `pending`);
387
+ * re-resume with the recorded value, or omit `internals.compositionLeg` to inherit it. A row that records none skips
388
+ * the check (the live value becomes its first record). The same code refuses `Runner.voidVerifierPause` a card whose
389
+ * recorded leg is not a `verify` leg (another entry's, or none recorded): nothing is settled, the row stays as it was. */
390
+ | "resume.composition_mismatch"
391
+ /** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
392
+ * explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
393
+ * answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
394
+ * discriminated by the message: the default `retry_later` arm leaves the checkpoint `pending`
395
+ * and the SAME token redeemable once the obstacle clears (`detail.retryAfterMs` carries the
396
+ * deployment's wait hint when it gave one — the #449 G1 carrier); the explicit `terminal` arm
397
+ * has ALREADY settled the row out of `pending` via the single-shot `expire` CAS (reaper
398
+ * parity) before this throw — the token is NOT redeemable, by the deployment's own permanent
399
+ * verdict (a dead binding must not be redialed forever). */
400
+ | "resume.preflight_rejected"
401
+ /** The resume carried a claim holder ({@link ResolveExpectation.holder}) and lost its CAS while the row is still the one it
402
+ * validated — same scope, `pending`, the same generation — so the holder was not the deployment's current grant: nothing was
403
+ * applied and the row is unchanged by this resume. The run is superseded; do not retry it (the current holder delivers).
404
+ * Read off the CAS's own loss answer on `claimTerminal`; on the two-step route off its diagnostic read (a later instant —
405
+ * under a race the row's later state answers instead, fail-closed either way). */
406
+ | "resume.holder_superseded"
407
+ /** F-012 L3: the resume carried an approver EDIT (`updatedInput`) and a FROZEN inherited ancestor
408
+ * constraint (the persisted projection chain) — or the deployment's resume-edit policy — DENIES the
409
+ * 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
410
+ * the same token remains decidable (approve as shown, deny, or edit differently) — the rejection
411
+ * consumed the decision's INPUT, never the ask itself. */
412
+ | "resume.constraint_rejected"
413
+ /** F-012 L3: the resume carried an approver EDIT but the inherited ancestor chain cannot be
414
+ * re-adjudicated statically — an OPAQUE layer is present, a layer declares a live remainder beyond
415
+ * its projection, or the checkpoint predates the projection chain. "Would have been allowed" is not
416
+ * computable from a self-reported closure, so the edited resume is refused typed pre-CAS (the
417
+ * checkpoint stays `pending`, still decidable); an UNEDITED approval is untouched. */
418
+ | "resume.constraint_unprojectable";
419
+ /** Structured discrimination a caller can branch on where the code alone is ambiguous. `field`
420
+ * names WHICH part of the decision payload was rejected on a
421
+ * `checkpoint.invalid_outcome` — `"boundCallId"` (the action you decided on has been replaced:
422
+ * re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
423
+ * 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
424
+ * decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
425
+ * `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
426
+ * `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
427
+ * resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
428
+ * well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
429
+ * 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,
430
+ * 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
431
+ * 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
432
+ * 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
433
+ * 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"`
434
+ * (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
435
+ * 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
436
+ * sites always knew which arm fired; this carries that fact instead of dropping it (ruled
437
+ * 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
438
+ * discriminant. */
439
+ readonly detail?: {
440
+ field?: CheckpointErrorField;
441
+ /** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
442
+ * word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
443
+ code?: CheckpointConfigRefusalCode;
444
+ /** #449 G1 — on `resume.usage_window_exhausted`: how long until the binding window frees
445
+ * (the same wait a suspended row carries as `gate.resumeAfterMs`). design/380 O2 — on a
446
+ * retry-later `resume.preflight_rejected`: the deployment preflight's own wait hint, when it
447
+ * gave one (same carrier, same semantics: retry the SAME token after the wait). Absent on
448
+ * every other code. */
449
+ retryAfterMs?: number;
450
+ /** WHICH arm fired, where one `code` covers several — the word list and what each word means to a
451
+ * host live at {@link CheckpointErrorReason}, its one home. Additive and optional like `field`
452
+ * (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
453
+ * is a gate rather than a type: see the closed set's own doc. */
454
+ reason?: CheckpointErrorReason;
455
+ /** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
456
+ * (sorted, display only). Absent on every other arm. */
457
+ requires?: readonly string[];
458
+ /** On a `requirements_damaged` refusal of a row its judge could not read at all (a member that throws when read, a
459
+ * container that is not one): the name of what was thrown while judging it (bounded; never its message). Its presence
460
+ * tells an engine defect from a row whose content does not match what it says. Absent on every other refusal. */
461
+ thrownName?: string;
462
+ /** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
463
+ * {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
464
+ * every other code. The live verb's refusal carries the same value. */
465
+ differs?: readonly SteerReplayFacet[];
466
+ /** On `resume.constraint_rejected` ⇔ the resume-edit policy accepts the person's edit only rewritten: `acceptableForm`
467
+ * is that form, the outlet a host may offer; a decide carrying it as `updatedInput` runs exactly those bytes. */
468
+ editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
469
+ } | undefined;
470
+ constructor(code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
471
+ /** `runner.resume` was handed an {@link ResumeOutcome} whose `gate` arm does not match the
472
+ * persisted {@link CheckpointGate} `kind` (council #3 — type confusion guard), or a gate v1
473
+ * resume does not serve (`task_done`). */
474
+ | "checkpoint.gate_mismatch"
475
+ /** The resume's `TaskSpec.signal` was aborted at the entrance — handed in ALREADY-ABORTED, or aborted
476
+ * while the wake screen / `resumePreflight` / pre-claim re-adjudication still ran: ONE code for a
477
+ * cancellation there (the seats' own codes keep what the hook itself did). Refused BEFORE the CAS, so
478
+ * the checkpoint stays `pending`; consuming the decision on a leg that aborts at once would lose it. */
479
+ | "checkpoint.resume_aborted"
480
+ /** `runner.resume` was handed an outcome whose payload is unsafe to apply — e.g. a deny `reason`
481
+ * carrying a `</system-reminder>` tag that would escape the model-facing wrapper (round-2 #1). */
482
+ | "checkpoint.invalid_outcome"
483
+ /** The checkpoint's {@link Checkpoint.version} is newer than this worker supports
484
+ * (`> MAX_SUPPORTED_CHECKPOINT_VERSION`), or it carries a remote `workspaceHandle` but no
485
+ * `executionEnvFactory` is wired to rebuild the env — either way this worker cannot safely resume it.
486
+ * Rejected pre-CAS so the checkpoint stays `pending` and a capable worker can still resume it
487
+ * (design/49 §2/§3, code-ready council round-2). */
488
+ | "checkpoint.unsupported_version"
489
+ /** The resume's re-supplied config, or a mode the checkpoint row recorded, is one prepare would refuse
490
+ * (a retired spec key, a malformed output style, a mode word outside the closed set, a retired shell-floor
491
+ * word). Refused PRE-CAS, so the checkpoint stays `pending` and byte-identical. `message` is prepare's own
492
+ * sentence; `detail.code` is prepare's own code ({@link CheckpointConfigRefusalCode}) and `detail.field`
493
+ * says which input carries it: `"taskConfig"` (correct the config and resume the SAME token) or
494
+ * `"inheritedGate"` (the recorded row — no config reaches it; expire the row). A fresh run of the same
495
+ * bad config reports the same `detail.code` as its `TaskResult.errorCode`. */
496
+ | "checkpoint.config_refused"
497
+ /** `resume`/`resumeStream` was handed `internals.requestedCwd` for a checkpoint that
498
+ * carries a remote `workspaceHandle`. The restored workspace's mountPath is authoritative for the
499
+ * task root, so the cwd would be ignored at best — and verifying it would touch the env BEFORE the
500
+ * VM restore (a lazy-connect adapter then connects a fresh empty sandbox, the design/49 disease).
501
+ * Rejected pre-CAS so the checkpoint stays `pending`; re-resume without `requestedCwd`. */
502
+ | "checkpoint.cwd_conflicts_restore"
503
+ /** design/164: the checkpoint was written by a pre-164 worker AND its ledger carries the RETIRED
504
+ * cross-slice wall-clock allocation (`resourceLedger.totalWalltimeSec`). The axis no longer exists,
505
+ * so resuming would run the leg with the operator's time ceiling silently unenforced. Refused
506
+ * PRE-CAS (the row stays `pending`, so a worker of the previous release can still finish it) rather
507
+ * than migrated: there is no honest conversion from a wall-clock allocation to a token one. */
508
+ | "checkpoint.walltime_axis_retired"
509
+ /** design/80 D-1 (reopen-by-reason): a re-resume of an `env_failed`-reopened checkpoint supplied an
510
+ * outcome that does NOT equal the persisted {@link ResolvedOutcome} winner. An `env_failed` reopen is
511
+ * a SYSTEM RETRY of the already-approved action (the infra failed, not the decision) — it must replay
512
+ * the exact winning binding, never a new vote. Rejected pre-CAS, fail-closed, so the checkpoint stays
513
+ * `pending` for the correctly-replayed retry. (A `tool_unavailable` reopen — P-7 — is exempt: it lets
514
+ * a human re-decide with the tool present, so a fresh decision is permitted there.) */
515
+ | "checkpoint.reopen_revote"
516
+ /** design/80 D-1 (atomicity fix): the resume validated its decision-action / reopen-by-reason guards
517
+ * against a `get()` snapshot, but a concurrent {@link CheckpointStore.resolve}/{@link CheckpointStore.reopen}
518
+ * cycle advanced the monotonic {@link Checkpoint.rev} in the get→resolve window, so the
519
+ * {@link CheckpointStore.resolve} CAS's optimistic-concurrency check lost (the validation is stale). The
520
+ * row is still `pending` — fail-closed; the caller must re-`get` and re-validate against the CURRENT state
521
+ * (a fresh resume), never blindly retry. */
522
+ | "checkpoint.reopened_concurrently"
523
+ /** A post-CAS compensation {@link CheckpointStore.reopen} returned `false` — the consumed row could not
524
+ * be flipped back to `pending` (missing, expired, or changed under a concurrent cycle), so no retryable
525
+ * checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
526
+ * caller's compensation path settles the token as terminally consumed. */
527
+ | "checkpoint.reopen_failed"
528
+ /** `Runner.voidVerifierPause` voided the card — the row IS expired and its env duty ran — but releasing the verifier
529
+ * session's pin threw or did not settle within the teardown bound: the session stays pinned until it is unpinned. */
530
+ | "checkpoint.void_unpin_failed"
531
+ /** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
532
+ * execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
533
+ * in-tree form of this code. Never a retry condition. */
534
+ | "checkpoint.execution_outcome_conflict"
535
+ /** design/80 D-A: {@link CheckpointStore.setPendingSteer} was handed `text` containing a
536
+ * `</system-reminder>` close tag — it would escape the model-facing `<system-reminder>` wrapper a
537
+ * trusted steer rides on resume. Rejected fail-closed so a dirty steer NEVER enters {@link CheckpointState}
538
+ * (§3 inv #2). Mirrors the trusted-steer reject at runtask.ts (`steering.invalid_content`). */
539
+ | "steering.invalid_content"
540
+ /** design/171 §6.3: the append would cross the parked-steer queue's entry-count or byte bound
541
+ * ({@link MAX_PENDING_STEER_ENTRIES} / {@link PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES}). Fail-loud
542
+ * rather than evicting: an already-accepted operator instruction is never dropped to make room —
543
+ * the caller delivers or removes a parked steer first. Nothing is written on this path. */
544
+ | "steering.queue_full"
545
+ /** design/171 §6.3 (falsification review adoption): the append reused an `inputId` already parked on
546
+ * this checkpoint, but with DIFFERENT content. Re-appending an IDENTICAL steer stays the idempotent
547
+ * no-op a retry needs; a differing one is refused, because swallowing it would lose the second
548
+ * operator's instruction — the exact silent loss the queue replaced. `detail.differs` names the facets
549
+ * that differ: with `text` among them it is another instruction (retry it under a fresh id); without,
550
+ * it is the parked one re-sent at another tier / trust / attribution (a fresh id would park it twice —
551
+ * replay it with its original values). Nothing is written on this path. */
552
+ | "steering.duplicate_input_id"
553
+ /** design/373 §4.3 (D2): the deployment's `userPromptSubmit` hook refused a wake resume's
554
+ * `message` at the entrance screen (block verdict, or a fail-closed timeout/crash — the
555
+ * message discriminates). Pre-CAS: the checkpoint stays `pending` and byte-identical, so the
556
+ * SAME token is redeemable once the screen clears — a refusal burns nothing. The live steer
557
+ * verb refuses under the same code word (its own Error face); one vocabulary, two entrances. */
558
+ | "steering.blocked_by_hook"
559
+ /** design/144 §3 (governance-gate purity, fail-closed pre-CAS): a `wake` outcome was supplied for a
560
+ * checkpoint that awaits a PENDING GATE DECISION (tool approval / dry-run review / plan review /
561
+ * resource-limit continue). Wake is a pure un-park verb and must never circumvent an approval — resume
562
+ * the checkpoint through its own decide entry instead (the error message names it). */
563
+ | "wake.gate_pending"
564
+ /** design/144 §3 (anti spin-wake): a `wake` outcome carried no `message` and the checkpoint has no
565
+ * parked steer either — there is nothing to deliver, so the wake is rejected pre-CAS
566
+ * (the checkpoint stays pending) instead of burning the token on an empty continuation. */
567
+ | "wake.nothing_to_deliver"
568
+ /** Parent effective-policy inheritance: the checkpoint records `state.inheritedGate.requiresParentConstraint`
569
+ * (the suspended task ran under inherited OPAQUE parent-policy constraints — live closures that cannot
570
+ * persist), but the resume supplied no `RunInternals.inheritedGate.parentConstraints` to re-instate them.
571
+ * Resuming anyway would silently DROP the ancestors' gate (a widening), so this rejects pre-CAS — the
572
+ * checkpoint stays `pending`; re-resume via `resumeStream(token, outcome, config, internals)` with the
573
+ * parent chain re-supplied. */
574
+ | "resume.parent_constraint_missing"
575
+ /** Parent effective-policy inheritance (shape check): the resume DID re-supply
576
+ * `internals.inheritedGate.parentConstraints`, but its length differs from the checkpoint's recorded
577
+ * `parentConstraintCount` — or (F-012 L1) its projection CONTENT digests differently from the
578
+ * recorded `constraintDigest` — or a screening entry names a `tool.check` guard beside a policy the
579
+ * constraint mint did not make (no chain to raise it on) — a partial/mismatched re-supply would silently run
580
+ * the child under a thinner (or different) ancestor chain than it suspended with. Rejected pre-CAS (the
581
+ * checkpoint stays `pending`); re-resume with the full original chain. */
582
+ | "resume.parent_constraint_mismatch"
583
+ /** #449 G1 (codex r2, pre-CAS entrance): a deployment usage-governance window for this resume's
584
+ * ledger key (the config's principal, else the row's recorded one, else the shared bucket) is
585
+ * EXHAUSTED, and the row still OWES a delivery a re-mint cannot carry (an approval/review
586
+ * decision, a wake, parked steers, a background-task obituary snapshot). Refused BEFORE the CAS,
587
+ * so nothing is consumed and nothing is unpinned — the SAME token with the SAME decision is
588
+ * redeemable once the window frees (`detail.retryAfterMs` carries the wait). A bare
589
+ * `resource_limit` continue with nothing parked does NOT take this refusal: it proceeds and
590
+ * re-suspends at turn 0 into a FRESH checkpoint carrying the new wait hint. */
591
+ | "resume.usage_window_exhausted"
592
+ /** #449 G2 (identity continuity): the resume config carries a NON-EMPTY `principal` that differs from
593
+ * the {@link Checkpoint.principal} recorded at the suspend mint. `ResumeTaskConfig`'s contract keeps
594
+ * the run's identity (its capability lists are the deployment's current ones), and the principal keys real lanes on the resumed leg
595
+ * (the usage-governance ledger bucket, later mints' scope derivation, session-rule reads, ask
596
+ * attribution) — silently running the leg under a different identity is the bad-value direction this
597
+ * refusal exists to close. Rejected PRE-CAS (the checkpoint stays `pending`); re-resume with the
598
+ * original principal, or omit the field to inherit the recorded one. */
599
+ | "resume.principal_mismatch"
600
+ /** design/380 O1③ (placement identity continuity — the `resume.principal_mismatch` rung's twin
601
+ * on the placement axis): the resume supplied trusted internals whose EXPLICIT
602
+ * `placementRoot` differs from the {@link CheckpointState.placementRootSessionId} recorded at
603
+ * the suspend mint. A target-bound env factory keys its placement lookup on that fixed point,
604
+ * so silently resuming under a different one would re-place the leg — and every descendant
605
+ * the child-internals chain hands it to — on another target than the parked workspace lives
606
+ * on. A supplied `rootSessionId` deliberately does NOT take this refusal: it is
607
+ * delegation identity, re-supplied by every revive leg, and legitimately differs from the
608
+ * recorded root whenever the spawner carried an explicit placement — the recorded root simply
609
+ * outranks it in prepare's restore fold. Rejected PRE-CAS (the checkpoint stays `pending`);
610
+ * re-resume with the recorded root, or omit `internals.placementRoot` to inherit it. Either
611
+ * side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
612
+ * — the honest degradation arm. */
613
+ | "resume.placement_mismatch"
614
+ /** The composition-leg twin of `resume.placement_mismatch`: the resume supplied trusted internals whose
615
+ * `compositionLeg` differs from the {@link CheckpointState.compositionLeg} recorded at the suspend mint — the
616
+ * composition's resume entry was handed another card's identity, and continuing would run this leg as a rung it is
617
+ * not, file its next card under another host session, or both. Rejected PRE-CAS (the checkpoint stays `pending`);
618
+ * re-resume with the recorded value, or omit `internals.compositionLeg` to inherit it. A row that records none skips
619
+ * the check (the live value becomes its first record). The same code refuses `Runner.voidVerifierPause` a card whose
620
+ * recorded leg is not a `verify` leg (another entry's, or none recorded): nothing is settled, the row stays as it was. */
621
+ | "resume.composition_mismatch"
622
+ /** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
623
+ * explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
624
+ * answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
625
+ * discriminated by the message: the default `retry_later` arm leaves the checkpoint `pending`
626
+ * and the SAME token redeemable once the obstacle clears (`detail.retryAfterMs` carries the
627
+ * deployment's wait hint when it gave one — the #449 G1 carrier); the explicit `terminal` arm
628
+ * has ALREADY settled the row out of `pending` via the single-shot `expire` CAS (reaper
629
+ * parity) before this throw — the token is NOT redeemable, by the deployment's own permanent
630
+ * verdict (a dead binding must not be redialed forever). */
631
+ | "resume.preflight_rejected"
632
+ /** The resume carried a claim holder ({@link ResolveExpectation.holder}) and lost its CAS while the row is still the one it
633
+ * validated — same scope, `pending`, the same generation — so the holder was not the deployment's current grant: nothing was
634
+ * applied and the row is unchanged by this resume. The run is superseded; do not retry it (the current holder delivers).
635
+ * Read off the CAS's own loss answer on `claimTerminal`; on the two-step route off its diagnostic read (a later instant —
636
+ * under a race the row's later state answers instead, fail-closed either way). */
637
+ | "resume.holder_superseded"
638
+ /** F-012 L3: the resume carried an approver EDIT (`updatedInput`) and a FROZEN inherited ancestor
639
+ * constraint (the persisted projection chain) — or the deployment's resume-edit policy — DENIES the
640
+ * 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
641
+ * the same token remains decidable (approve as shown, deny, or edit differently) — the rejection
642
+ * consumed the decision's INPUT, never the ask itself. */
643
+ | "resume.constraint_rejected"
644
+ /** F-012 L3: the resume carried an approver EDIT but the inherited ancestor chain cannot be
645
+ * re-adjudicated statically — an OPAQUE layer is present, a layer declares a live remainder beyond
646
+ * its projection, or the checkpoint predates the projection chain. "Would have been allowed" is not
647
+ * computable from a self-reported closure, so the edited resume is refused typed pre-CAS (the
648
+ * checkpoint stays `pending`, still decidable); an UNEDITED approval is untouched. */
649
+ | "resume.constraint_unprojectable", message: string,
650
+ /** Structured discrimination a caller can branch on where the code alone is ambiguous. `field`
651
+ * names WHICH part of the decision payload was rejected on a
652
+ * `checkpoint.invalid_outcome` — `"boundCallId"` (the action you decided on has been replaced:
653
+ * re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
654
+ * 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
655
+ * decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
656
+ * `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
657
+ * `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
658
+ * resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
659
+ * well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
660
+ * 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,
661
+ * 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
662
+ * 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
663
+ * 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
664
+ * 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"`
665
+ * (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
666
+ * 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
667
+ * sites always knew which arm fired; this carries that fact instead of dropping it (ruled
668
+ * 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
669
+ * discriminant. */
670
+ detail?: {
671
+ field?: CheckpointErrorField;
672
+ /** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
673
+ * word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
674
+ code?: CheckpointConfigRefusalCode;
675
+ /** #449 G1 — on `resume.usage_window_exhausted`: how long until the binding window frees
676
+ * (the same wait a suspended row carries as `gate.resumeAfterMs`). design/380 O2 — on a
677
+ * retry-later `resume.preflight_rejected`: the deployment preflight's own wait hint, when it
678
+ * gave one (same carrier, same semantics: retry the SAME token after the wait). Absent on
679
+ * every other code. */
680
+ retryAfterMs?: number;
681
+ /** WHICH arm fired, where one `code` covers several — the word list and what each word means to a
682
+ * host live at {@link CheckpointErrorReason}, its one home. Additive and optional like `field`
683
+ * (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
684
+ * is a gate rather than a type: see the closed set's own doc. */
685
+ reason?: CheckpointErrorReason;
686
+ /** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
687
+ * (sorted, display only). Absent on every other arm. */
688
+ requires?: readonly string[];
689
+ /** On a `requirements_damaged` refusal of a row its judge could not read at all (a member that throws when read, a
690
+ * container that is not one): the name of what was thrown while judging it (bounded; never its message). Its presence
691
+ * tells an engine defect from a row whose content does not match what it says. Absent on every other refusal. */
692
+ thrownName?: string;
693
+ /** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
694
+ * {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
695
+ * every other code. The live verb's refusal carries the same value. */
696
+ differs?: readonly SteerReplayFacet[];
697
+ /** On `resume.constraint_rejected` ⇔ the resume-edit policy accepts the person's edit only rewritten: `acceptableForm`
698
+ * is that form, the outlet a host may offer; a decide carrying it as `updatedInput` runs exactly those bytes. */
699
+ editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
700
+ } | undefined);
701
+ }
702
+ /**
703
+ * Project an already-captured value onto what a backend of the given {@link StoreFidelity} can hold, so
704
+ * everything minted from it — the row's args, the approval preview, the binding hash, the risk
705
+ * descriptor — describes the value that comes BACK, not the one that went in.
706
+ *
707
+ * `"structured-clone"` is the identity: the caller's snapshot already is what such a backend stores.
708
+ * `"json"` runs the backend's own codec (`JSON.stringify` → `JSON.parse`, `toJSON` hooks included, since
709
+ * that is exactly what the backend will do to it). The input is expected to be an accessor-free snapshot
710
+ * already, so no property is read a second time here.
711
+ *
712
+ * A value JSON cannot ENCODE AT ALL (a `BigInt`, a cycle) fails instead of degrading — those would throw
713
+ * inside the backend's own write anyway, and failing here means the caller can say why while nothing has
714
+ * been committed. The thrown value rides out on `cause` so the caller decides how to word the refusal.
715
+ */
716
+ export declare function encodeAtFidelity(fidelity: StoreFidelity, value: unknown): {
717
+ ok: true;
718
+ value: unknown;
719
+ } | {
720
+ ok: false;
721
+ cause: unknown;
722
+ };