@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.
- package/CHANGELOG.md +312 -0
- package/dist/agents/cascade.d.ts +11 -3
- package/dist/agents/cascade.js +1 -1
- package/dist/agents/peer-held-queue.d.ts +27 -4
- package/dist/agents/peer-held-queue.js +81 -36
- package/dist/agents/peer-session-drain.js +13 -3
- package/dist/agents/subagent.d.ts +6 -1
- package/dist/agents/subagent.js +66 -12
- package/dist/agents/suspend-guard.d.ts +38 -16
- package/dist/agents/suspend-guard.js +9 -4
- package/dist/agents/verify.js +4 -3
- package/dist/core/checkpoint-features.d.ts +722 -0
- package/dist/core/checkpoint-features.js +98 -0
- package/dist/core/checkpoint-requirements.d.ts +9 -2
- package/dist/core/checkpoint-requirements.js +9 -4
- package/dist/core/checkpoint-row-verdict.d.ts +99 -0
- package/dist/core/checkpoint-row-verdict.js +225 -0
- package/dist/core/checkpoint-store.d.ts +55 -745
- package/dist/core/checkpoint-store.js +39 -141
- package/dist/core/engine-notice.d.ts +19 -3
- package/dist/core/engine-notice.js +9 -2
- package/dist/core/gate-fold.js +2 -2
- package/dist/core/governance-codes.d.ts +3 -1
- package/dist/core/governance-codes.js +3 -0
- package/dist/core/hooks.d.ts +13 -0
- package/dist/core/human-input-projection.d.ts +1 -0
- package/dist/core/human-input-projection.js +3 -0
- package/dist/core/image-admission.d.ts +1 -1
- package/dist/core/locked-config.d.ts +2 -2
- package/dist/core/mcp-host-seat.js +6 -1
- package/dist/core/memory-engine/consolidation-driver.d.ts +1 -1
- package/dist/core/memory-vector.d.ts +1 -1
- package/dist/core/memory.d.ts +10 -10
- package/dist/core/mode-policy.js +1 -1
- package/dist/core/mods/classic-events.d.ts +9 -1
- package/dist/core/mods/dollar.d.ts +32 -1
- package/dist/core/mods/dollar.js +13 -1
- package/dist/core/mods/kernel/events.d.ts +11 -3
- package/dist/core/mods/kernel/events.js +13 -10
- package/dist/core/mods/lifecycle-stations.d.ts +36 -4
- package/dist/core/mods/lifecycle-stations.js +44 -9
- package/dist/core/mods/session-append.d.ts +4 -1
- package/dist/core/mods/session-append.js +7 -0
- package/dist/core/mods/session-receive.js +12 -15
- package/dist/core/mods/stations.d.ts +51 -6
- package/dist/core/mods/stations.js +124 -0
- package/dist/core/own-property-receipt.d.ts +7 -0
- package/dist/core/own-property-receipt.js +3 -0
- package/dist/core/read-root-candidate.js +1 -1
- package/dist/core/resume-startup-cause.d.ts +5 -4
- package/dist/core/runner/compact-session.js +5 -2
- package/dist/core/runner/contracts.d.ts +18 -8
- package/dist/core/runner/delegation-owner.d.ts +43 -0
- package/dist/core/runner/delegation-owner.js +59 -0
- package/dist/core/runner/lineage-reroot-view.d.ts +56 -0
- package/dist/core/runner/lineage-reroot-view.js +108 -0
- package/dist/core/runner/permission-rule-lanes.d.ts +2 -1
- package/dist/core/runner/permission-rule-lanes.js +2 -2
- package/dist/core/runner/person-path-rows.d.ts +15 -0
- package/dist/core/runner/person-path-rows.js +26 -3
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -1
- package/dist/core/runner/prepare-acquire-reconcile.js +7 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +1 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +1 -1
- package/dist/core/runner/prepare-config-doors.d.ts +6 -6
- package/dist/core/runner/prepare-config-doors.js +3 -4
- package/dist/core/runner/prepare-hands-readface.d.ts +1 -1
- package/dist/core/runner/prepare-hands-readface.js +28 -7
- package/dist/core/runner/prepare-inherited-gate.d.ts +2 -0
- package/dist/core/runner/prepare-inherited-gate.js +7 -3
- package/dist/core/runner/prepare-task.js +10 -7
- package/dist/core/runner/resume-admission.d.ts +3 -3
- package/dist/core/runner/resume-admission.js +6 -3
- package/dist/core/runner/resume-apply.d.ts +4 -0
- package/dist/core/runner/resume-apply.js +11 -4
- package/dist/core/runner/resume-checkpoint-screen.d.ts +9 -0
- package/dist/core/runner/resume-checkpoint-screen.js +4 -84
- package/dist/core/runner/run-git-lane.d.ts +2 -0
- package/dist/core/runner/run-git-lane.js +4 -1
- package/dist/core/runner/run-harness-handlers.d.ts +2 -0
- package/dist/core/runner/run-harness-handlers.js +3 -2
- package/dist/core/runner/run-leg.js +24 -7
- package/dist/core/runner/run-settle-and-teardown.js +3 -2
- package/dist/core/runner/run-stop-and-final-verify.js +2 -1
- package/dist/core/runner/run-turn-boundary.js +7 -4
- package/dist/core/runner/runtask.js +6 -6
- package/dist/core/runner/steering-preview.d.ts +9 -0
- package/dist/core/runner/steering-preview.js +5 -0
- package/dist/core/runner/stream-steer-verb.js +8 -0
- package/dist/core/runner/tool-face-overlay.js +2 -0
- package/dist/core/runner/turn-attachments.d.ts +5 -0
- package/dist/core/runner/turn-attachments.js +1 -1
- package/dist/core/runner-deps.d.ts +2 -2
- package/dist/core/secret-env.d.ts +8 -5
- package/dist/core/secret-env.js +37 -18
- package/dist/core/session-store.d.ts +1 -1
- package/dist/core/session-store.js +5 -1
- package/dist/core/session.d.ts +14 -4
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +6 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +68 -0
- package/dist/core/store-contracts/session-store-contract.js +22 -8
- package/dist/core/task-event.d.ts +7 -1
- package/dist/core/task-notification.js +2 -1
- package/dist/core/task-registry-agent.d.ts +27 -7
- package/dist/core/task-registry-agent.js +12 -5
- package/dist/core/task-registry-shared.d.ts +7 -0
- package/dist/core/task-registry-workflow.js +4 -3
- package/dist/core/task-registry.d.ts +13 -2
- package/dist/core/task-registry.js +11 -4
- package/dist/core/task-result.d.ts +5 -5
- package/dist/core/task-spec.d.ts +1 -1
- package/dist/core/terminal-cause.d.ts +6 -6
- package/dist/core/tool-face.d.ts +6 -2
- package/dist/core/tool-face.js +1 -1
- package/dist/core/tool-policy.d.ts +2 -1
- package/dist/core/tool-roster.d.ts +4 -4
- package/dist/core/tool-spec.d.ts +4 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.js +1 -1
- package/dist/engine/execution-env/node-execution-env.d.ts +3 -0
- package/dist/engine/execution-env/node-execution-env.js +12 -5
- package/dist/engine/harness/types.d.ts +11 -0
- package/dist/engine/session/parent-chain-guard.d.ts +3 -3
- package/dist/engine/session/parent-chain-guard.js +1 -1
- package/dist/engine/session/path-to-root.d.ts +18 -3
- package/dist/engine/session/path-to-root.js +15 -1
- package/dist/engine/session/repo-utils.d.ts +12 -1
- package/dist/engine/session/repo-utils.js +41 -0
- package/dist/engine/session/session.js +1 -1
- package/dist/engine/session/storage-base.d.ts +20 -0
- package/dist/engine/session/storage-base.js +28 -9
- package/dist/index.d.ts +9 -8
- package/dist/index.js +4 -4
- package/dist/internal/harness.d.ts +4 -3
- package/dist/internal/harness.js +3 -2
- package/dist/orchestration/run-workflow-tool.d.ts +3 -0
- package/dist/orchestration/run-workflow-tool.js +27 -11
- package/dist/orchestration/workflow-governance.d.ts +1 -1
- package/dist/orchestration/workflow.d.ts +3 -0
- package/dist/orchestration/workflow.js +2 -7
- package/dist/stores/file/checkpoint-store.d.ts +2 -0
- package/dist/stores/file/checkpoint-store.js +7 -6
- package/dist/stores/file/fs-atomic.d.ts +0 -22
- package/dist/stores/file/fs-atomic.js +0 -17
- package/dist/stores/file/index.d.ts +2 -9
- package/dist/stores/file/index.js +2 -4
- package/dist/stores/file/session-store.d.ts +13 -7
- package/dist/stores/file/session-store.js +40 -17
- package/dist/tools/fs/bash-program-position.d.ts +3 -2
- package/dist/tools/fs/bash-program-position.js +7 -7
- package/dist/tools/fs/removal-targets.js +2 -2
- package/dist/tools/fs/shell-read-argv.d.ts +4 -2
- package/dist/tools/fs/shell-read-argv.js +14 -3
- package/dist/tools/fs/shell-read-bindings.d.ts +18 -2
- package/dist/tools/fs/shell-read-bindings.js +148 -68
- package/dist/tools/fs/shell-read-check.js +20 -4
- package/dist/tools/fs/shell-read-establish.js +22 -8
- package/dist/tools/fs/shell-read-functions.js +2 -2
- package/dist/tools/fs/shell-read-object-path.d.ts +59 -0
- package/dist/tools/fs/shell-read-object-path.js +119 -0
- package/dist/tools/fs/shell-read-plan.d.ts +8 -0
- package/dist/tools/fs/shell-read-plan.js +47 -30
- package/dist/tools/fs/shell-read-start.d.ts +66 -13
- package/dist/tools/fs/shell-read-start.js +89 -17
- package/dist/tools/fs/shell-read-workdir.d.ts +29 -8
- package/dist/tools/fs/shell-read-workdir.js +31 -8
- package/package.json +2 -2
- package/test/export-surface.snapshot.json +21 -33
- package/wire-changes/core-stores-sql@7.62.0.json +30 -0
- package/wire-changes/core@7.62.0.json +2181 -0
- package/wire-changes/mods-kernel@7.62.0.json +42 -0
- package/wire-changes/primitives@7.62.0.json +30 -0
- package/dist/core/consolidate-scope.d.ts +0 -93
- package/dist/core/consolidate-scope.js +0 -98
- package/dist/core/runner/memory-consolidation.d.ts +0 -109
- 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
|
|
@@ -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 (
|
|
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,6 +1900,11 @@ 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
|
+
rowVerdict: CheckpointRowVerdict;
|
|
2023
1908
|
/** Non-secret stable identity ({@link Checkpoint.checkpointId}) — absent on legacy rows. */
|
|
2024
1909
|
checkpointId?: string;
|
|
2025
1910
|
/** The suspended task / session id ({@link Checkpoint.sessionId}). */
|
|
@@ -2062,9 +1947,9 @@ export interface CheckpointSummary {
|
|
|
2062
1947
|
* tool-less park (`resource_limit` / `plan_review` / `task_done` — none of which binds a tool call)
|
|
2063
1948
|
* gets the key **OMITTED**, never `null` and never a present-but-`undefined` property. The
|
|
2064
1949
|
* `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
|
-
*
|
|
2067
|
-
* face) must not materialize the keys as `null` on the way out. Pinned in
|
|
1950
|
+
* project; `summarizeCheckpoint` spreads them conditionally for exactly this reason. A consumer reads
|
|
1951
|
+
* presence by value (INTEGRATION-CORE reading rule 1; here key and value agree), and a re-projecting
|
|
1952
|
+
* service (BFF / SDK wire face) must not materialize the keys as `null` on the way out. Pinned in
|
|
2068
1953
|
* `test/checkpoint-store.test.ts` ("tool-less park …"). */
|
|
2069
1954
|
toolCallId?: string;
|
|
2070
1955
|
/** The id of the tool call that asked for this plan pause ({@link PendingAction} `plan_review.requestedByCallId`) —
|
|
@@ -2211,560 +2096,25 @@ export interface CheckpointSummary {
|
|
|
2211
2096
|
* {@link CheckpointSummary}. Shared by every {@link CheckpointStore} impl so the projection is IDENTICAL
|
|
2212
2097
|
* across the in-memory, file, and durable backends (the anti-drift guard) — `severity` always derives from the
|
|
2213
2098
|
* gate's {@link RiskDescriptor} via the single {@link riskSeverity} helper, `spentMicroUsd` always reads
|
|
2214
|
-
* {@link ResourceLedger.spentMicroUsd}
|
|
2215
|
-
*
|
|
2216
|
-
*
|
|
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).
|
|
2230
|
-
*
|
|
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).
|
|
2099
|
+
* {@link ResourceLedger.spentMicroUsd}, `rowVerdict` is the row's `judgeCheckpointRow`. Pure; reads no clock/random. The
|
|
2100
|
+
* summary holds no reference into the row (a display member that is a value of its own is a copy), so editing a summary
|
|
2101
|
+
* never edits the stored row.
|
|
2248
2102
|
*
|
|
2249
|
-
*
|
|
2250
|
-
*
|
|
2251
|
-
*
|
|
2103
|
+
* `disclose` receives one sentence for a damage the projection reads past — descriptor axes that are not a plain record, or
|
|
2104
|
+
* a mark that is not a boolean (the `severity` is then the valid marks' floor, or omitted) — naming the row by checkpoint id
|
|
2105
|
+
* and session (never its token) and the member by its shape (never its value); it is called synchronously and every listing
|
|
2106
|
+
* calls it again. A store hands it its own seat. `verdict` is a store's memo of this row's `judgeCheckpointRow` under this
|
|
2107
|
+
* 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
|
|
2108
|
+
* blob's sha256 plus the engine build, `CONTRACT_KIT_ENGINE_VERSION`); absent, the row is judged now. The resume never reads it.
|
|
2252
2109
|
*/
|
|
2253
|
-
export
|
|
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";
|
|
2110
|
+
export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence: string) => void, verdict?: CheckpointRowVerdict): CheckpointSummary;
|
|
2285
2111
|
/**
|
|
2286
|
-
*
|
|
2287
|
-
*
|
|
2288
|
-
*
|
|
2289
|
-
*
|
|
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).
|
|
2112
|
+
* An in-tree store's listing projection with its verdict memo: the verdict a store holds for this stored row object, else
|
|
2113
|
+
* 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
|
|
2114
|
+
* object, so a replaced row is judged again; the judge reads no member a store's own transitions rewrite (status, rev, the
|
|
2115
|
+
* decision and execution records, the steer queue — the requirement table's mutable members).
|
|
2304
2116
|
*/
|
|
2305
|
-
export declare
|
|
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
|
-
}
|
|
2117
|
+
export declare function summarizeStoredCheckpoint(cp: Checkpoint, memo: WeakMap<Checkpoint, CheckpointRowVerdict>, disclose?: (sentence: string) => void): CheckpointSummary;
|
|
2768
2118
|
/**
|
|
2769
2119
|
* The pluggable durable seam (design/45 §2.1). Symmetric with `ToolResultStore`/`MemoryStore`:
|
|
2770
2120
|
* create-once `put`, `get`, an **atomic CAS `resolve`** (the once-only foundation), and a `reap` for TTL
|
|
@@ -2818,7 +2168,8 @@ export type StoreDurability = "durable" | "process-local";
|
|
|
2818
2168
|
* backend (a `Date` comes back a `Date`, a `Map` a `Map`, `NaN` stays `NaN`); `"json"` states the
|
|
2819
2169
|
* backend serialises through JSON, so the row that comes back after a restart carries the JSON
|
|
2820
2170
|
* PROJECTION of what was filed (`Date` → string, `Map`/`Set` → `{}`, `NaN`/`Infinity` → `null`, `-0`
|
|
2821
|
-
* → `0`, an `undefined`-valued key gone
|
|
2171
|
+
* → `0`, an `undefined`-valued key gone — a real loss below a row's frame: a tool call's arguments, compared by own-key
|
|
2172
|
+
* set at the park; none at its top level or its `state`'s, which the engine writes with absences omitted).
|
|
2822
2173
|
*
|
|
2823
2174
|
* Why this has to be declared rather than inferred: the mint decides what a durable approval row may
|
|
2824
2175
|
* carry, and it decides it with `structuredClone` — which is WIDER than a JSON codec. A value can pass
|
|
@@ -2841,27 +2192,6 @@ export type StoreFidelity = "structured-clone" | "json";
|
|
|
2841
2192
|
export declare function resolveDeclaredFidelity(store: {
|
|
2842
2193
|
readonly fidelity?: StoreFidelity;
|
|
2843
2194
|
} | 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
2195
|
export interface CheckpointStore {
|
|
2866
2196
|
/**
|
|
2867
2197
|
* Managed-retention declaration (retention.ts), stated by the party that runs the sweep: `"managed"` says this store's
|
|
@@ -3227,11 +2557,9 @@ export declare const ACTOR_ASSERTION_FROZEN_FIELDS: readonly ["id", "hostAsserte
|
|
|
3227
2557
|
* Every consumer — the resume drain, the wake's nothing-to-deliver guard, a serving layer — goes through
|
|
3228
2558
|
* here, so no site can grow its own idea of what "the parked steer" is.
|
|
3229
2559
|
*
|
|
3230
|
-
* A row that still carries the RETIRED pre-queue single seat
|
|
3231
|
-
*
|
|
3232
|
-
*
|
|
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.
|
|
2560
|
+
* A row that still carries the RETIRED pre-queue single seat is refused here rather than read
|
|
2561
|
+
* (`retiredSteerSeatRefusal`, checkpoint-row-verdict.ts, thrown). A resume never reaches this refusal: the row's judge
|
|
2562
|
+
* refused the row before the claim, with the same refusal.
|
|
3235
2563
|
*/
|
|
3236
2564
|
export declare function readPendingSteerQueue(state: Pick<CheckpointState, "pendingSteerQueue">): PendingSteerEntry[];
|
|
3237
2565
|
/**
|
|
@@ -3299,6 +2627,8 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
|
|
|
3299
2627
|
readonly holder: true;
|
|
3300
2628
|
};
|
|
3301
2629
|
private cps;
|
|
2630
|
+
/** The listing's memo of each stored row object's verdict: a `put` stores a new object, so a replaced row is judged again. */
|
|
2631
|
+
private readonly rowVerdicts;
|
|
3302
2632
|
private fault;
|
|
3303
2633
|
private readonly disclose;
|
|
3304
2634
|
private readonly holderIsCurrent;
|
|
@@ -3378,23 +2708,3 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
|
|
|
3378
2708
|
/** Test/inspection helper: number of stored checkpoints. */
|
|
3379
2709
|
get size(): number;
|
|
3380
2710
|
}
|
|
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
|
-
};
|