@sema-agent/core 7.60.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 +917 -0
- package/README.md +2 -2
- package/dist/agents/agent-transcript-tool.d.ts +2 -2
- package/dist/agents/agent-transcript-tool.js +1 -1
- package/dist/agents/cascade.d.ts +71 -12
- package/dist/agents/cascade.js +61 -21
- package/dist/agents/composition-allowance.d.ts +53 -0
- package/dist/agents/composition-allowance.js +49 -0
- package/dist/agents/composition-placement.d.ts +29 -0
- package/dist/agents/composition-placement.js +24 -0
- package/dist/agents/cumulative-stats.d.ts +4 -0
- package/dist/agents/cumulative-stats.js +3 -0
- package/dist/agents/inherited-tool-pool.d.ts +5 -3
- package/dist/agents/inherited-tool-pool.js +2 -2
- package/dist/agents/list-agents-tool.d.ts +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-notice-route.d.ts +1 -1
- package/dist/agents/peer-notice-route.js +4 -3
- package/dist/agents/peer-notices.d.ts +4 -4
- package/dist/agents/peer-notices.js +8 -4
- package/dist/agents/peer-session-drain.d.ts +8 -1
- package/dist/agents/peer-session-drain.js +49 -10
- package/dist/agents/repair-loop.js +16 -6
- package/dist/agents/retain-ledger.js +3 -1
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/roster-store.js +7 -4
- package/dist/agents/send-message-tool.d.ts +8 -10
- package/dist/agents/send-message-tool.js +43 -23
- package/dist/agents/subagent-completion-gate.d.ts +35 -0
- package/dist/agents/subagent-completion-gate.js +62 -0
- package/dist/agents/subagent-steps.d.ts +7 -6
- package/dist/agents/subagent.d.ts +36 -41
- package/dist/agents/subagent.js +245 -200
- package/dist/agents/suspend-guard.d.ts +47 -16
- package/dist/agents/suspend-guard.js +13 -4
- package/dist/agents/verify.d.ts +41 -14
- package/dist/agents/verify.js +41 -30
- package/dist/brain/anthropic.js +1 -0
- package/dist/brain/errors.d.ts +7 -1
- package/dist/brain/errors.js +6 -0
- package/dist/brain/failover.js +2 -1
- package/dist/brain/open-responses.js +1 -0
- package/dist/brain/openai.js +1 -0
- package/dist/brain/provider-dialect.d.ts +10 -0
- package/dist/brain/provider-dialect.js +13 -2
- package/dist/brain/stream-engine.d.ts +3 -0
- package/dist/brain/stream-engine.js +4 -0
- package/dist/core/agent-state.d.ts +1 -1
- package/dist/core/allow-entry.d.ts +59 -23
- package/dist/core/allow-entry.js +131 -38
- package/dist/core/ask-origin.d.ts +79 -0
- package/dist/core/ask-origin.js +76 -0
- package/dist/core/ask-question.d.ts +19 -13
- package/dist/core/ask-question.js +8 -2
- package/dist/core/auto-compaction.d.ts +2 -0
- package/dist/core/auto-compaction.js +2 -1
- package/dist/core/auto-mode.js +3 -5
- package/dist/core/background-agent-store.d.ts +7 -5
- package/dist/core/background-agent-store.js +12 -11
- package/dist/core/checkpoint-features.d.ts +722 -0
- package/dist/core/checkpoint-features.js +98 -0
- package/dist/core/checkpoint-requirements.d.ts +33 -5
- package/dist/core/checkpoint-requirements.js +18 -5
- 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 +107 -738
- package/dist/core/checkpoint-store.js +45 -143
- package/dist/core/child-clamp-seats.d.ts +3 -2
- package/dist/core/child-clamp-seats.js +4 -3
- package/dist/core/closest-name.d.ts +13 -0
- package/dist/core/closest-name.js +35 -0
- package/dist/core/context-settings.js +3 -5
- package/dist/core/cross-boundary-taint.d.ts +1 -1
- package/dist/core/decision-receipt.d.ts +14 -1
- package/dist/core/decision-receipt.js +6 -3
- package/dist/core/delegation-frames.d.ts +13 -9
- package/dist/core/effective-path-target.js +2 -3
- package/dist/core/engine-attestation.d.ts +11 -1
- package/dist/core/engine-attestation.js +2 -0
- package/dist/core/engine-notice.d.ts +68 -21
- package/dist/core/engine-notice.js +9 -2
- package/dist/core/file-history-retention.d.ts +8 -0
- package/dist/core/file-history-retention.js +14 -11
- package/dist/core/file-history-store.d.ts +31 -1
- package/dist/core/file-history-store.js +31 -2
- package/dist/core/frame-settlement.d.ts +10 -0
- package/dist/core/frame-settlement.js +6 -1
- package/dist/core/fs-write-gate-policy.d.ts +3 -3
- package/dist/core/fs-write-gate-policy.js +8 -7
- package/dist/core/gate-fold.js +4 -3
- package/dist/core/gate-lanes.js +7 -4
- package/dist/core/gate-outcome.d.ts +40 -1
- package/dist/core/gate-outcome.js +10 -0
- package/dist/core/git-worktree-env.d.ts +7 -3
- package/dist/core/git-worktree-env.js +16 -13
- package/dist/core/governance-codes.d.ts +14 -4
- package/dist/core/governance-codes.js +19 -4
- package/dist/core/hooks.d.ts +25 -4
- package/dist/core/hooks.js +11 -4
- package/dist/core/host-floor.js +3 -5
- 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 +47 -7
- package/dist/core/image-admission.js +35 -4
- package/dist/core/input-author.d.ts +36 -0
- package/dist/core/input-author.js +39 -0
- package/dist/core/leg-identity.d.ts +62 -0
- package/dist/core/leg-identity.js +18 -0
- package/dist/core/locked-config.d.ts +4 -3
- package/dist/core/locked-config.js +5 -3
- package/dist/core/lsp.d.ts +5 -3
- package/dist/core/lsp.js +3 -2
- package/dist/core/mailbox-store.d.ts +85 -10
- package/dist/core/mailbox-store.js +31 -10
- package/dist/core/mcp-connection-pool.d.ts +6 -20
- package/dist/core/mcp-connection-pool.js +10 -28
- package/dist/core/mcp-failure.d.ts +76 -15
- package/dist/core/mcp-failure.js +60 -33
- package/dist/core/mcp-host-seat.d.ts +92 -53
- package/dist/core/mcp-host-seat.js +225 -46
- package/dist/core/mcp-probe.js +2 -2
- package/dist/core/mcp-server-link.d.ts +18 -6
- package/dist/core/mcp-server-link.js +19 -4
- package/dist/core/mcp-server-spec.d.ts +2 -1
- package/dist/core/mcp-session-end.d.ts +1 -2
- package/dist/core/mcp-session-end.js +1 -1
- package/dist/core/mcp.d.ts +6 -49
- package/dist/core/mcp.js +115 -111
- package/dist/core/media-byte-cap.d.ts +21 -46
- package/dist/core/media-byte-cap.js +55 -55
- package/dist/core/member-group.d.ts +7 -0
- package/dist/core/member-group.js +35 -0
- package/dist/core/memory-engine/consolidation-driver.d.ts +1 -1
- package/dist/core/memory-engine/consolidation.d.ts +1 -1
- package/dist/core/memory-engine/consolidation.js +7 -1
- package/dist/core/memory-engine/dual-root.d.ts +31 -0
- package/dist/core/memory-engine/dual-root.js +59 -11
- package/dist/core/memory-engine/engine.js +27 -24
- package/dist/core/memory-engine/file-backend.d.ts +13 -0
- package/dist/core/memory-engine/file-backend.js +35 -15
- package/dist/core/memory-engine/layout.d.ts +3 -0
- package/dist/core/memory-engine/layout.js +13 -3
- package/dist/core/memory-engine/memory-deployment.d.ts +110 -0
- package/dist/core/memory-engine/memory-deployment.js +182 -0
- package/dist/core/memory-engine/sync-client.d.ts +39 -18
- package/dist/core/memory-engine/sync-client.js +72 -14
- package/dist/core/memory-engine/sync-report.d.ts +7 -4
- package/dist/core/memory-engine/sync.d.ts +9 -1
- package/dist/core/memory-vector.d.ts +1 -1
- package/dist/core/memory.d.ts +10 -10
- package/dist/core/mode-policy.d.ts +8 -8
- package/dist/core/mode-policy.js +8 -6
- package/dist/core/mods/agent-stations.d.ts +39 -4
- package/dist/core/mods/agent-stations.js +59 -10
- package/dist/core/mods/classic-events.d.ts +9 -1
- package/dist/core/mods/dollar.d.ts +94 -1
- package/dist/core/mods/dollar.js +13 -1
- package/dist/core/mods/extension-call.d.ts +15 -1
- package/dist/core/mods/extension-call.js +7 -2
- package/dist/core/mods/kernel/dispatch.d.ts +4 -3
- package/dist/core/mods/kernel/dispatch.js +4 -4
- package/dist/core/mods/kernel/events.d.ts +14 -3
- package/dist/core/mods/kernel/events.js +18 -15
- package/dist/core/mods/kernel/registration.d.ts +3 -0
- package/dist/core/mods/kernel/registration.js +5 -0
- package/dist/core/mods/kernel/site-rules.d.ts +6 -3
- package/dist/core/mods/kernel/site-rules.js +10 -2
- 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 +118 -0
- package/dist/core/mods/session-append.js +318 -0
- package/dist/core/mods/session-compact.d.ts +48 -0
- package/dist/core/mods/session-compact.js +194 -0
- package/dist/core/mods/session-receive.d.ts +93 -0
- package/dist/core/mods/session-receive.js +138 -0
- package/dist/core/mods/session-send.d.ts +72 -0
- package/dist/core/mods/session-send.js +88 -0
- package/dist/core/mods/stations.d.ts +88 -21
- package/dist/core/mods/stations.js +149 -11
- package/dist/core/mods/tool-call.d.ts +2 -0
- package/dist/core/mods/tool-call.js +4 -4
- package/dist/core/output-style.js +3 -4
- package/dist/core/own-property-receipt.d.ts +68 -2
- package/dist/core/own-property-receipt.js +45 -2
- package/dist/core/park-selfcheck.js +4 -2
- package/dist/core/path-identity.d.ts +11 -0
- package/dist/core/path-identity.js +4 -0
- package/dist/core/path-rule-binding.d.ts +3 -1
- package/dist/core/path-rule-binding.js +3 -1
- package/dist/core/peer-seat.d.ts +3 -3
- package/dist/core/peer-seat.js +20 -8
- package/dist/core/permission-rule-consent.d.ts +21 -5
- package/dist/core/permission-rule-consent.js +21 -1
- package/dist/core/permission-rule-model.d.ts +34 -11
- package/dist/core/permission-rule-model.js +47 -10
- package/dist/core/permission-rule-org.d.ts +1 -1
- package/dist/core/permission-rule-provider.js +4 -1
- package/dist/core/permission-rules.d.ts +4 -0
- package/dist/core/permission-rules.js +11 -16
- package/dist/core/read-root-candidate.js +1 -1
- package/dist/core/remote-env.d.ts +74 -26
- package/dist/core/remote-env.js +20 -0
- package/dist/core/resume-startup-cause.d.ts +5 -4
- package/dist/core/retention-policy.d.ts +24 -23
- package/dist/core/retention-policy.js +36 -2
- package/dist/core/retention.d.ts +4 -1
- package/dist/core/retired-keys.d.ts +4 -4
- package/dist/core/row-admission.d.ts +10 -0
- package/dist/core/row-admission.js +5 -0
- package/dist/core/runner/advisor-instructions.d.ts +2 -1
- package/dist/core/runner/advisor-instructions.js +2 -1
- package/dist/core/runner/announce-once-ledger.d.ts +4 -4
- package/dist/core/runner/assemble-result.d.ts +13 -3
- package/dist/core/runner/assemble-result.js +12 -7
- package/dist/core/runner/caller-roster.d.ts +12 -9
- package/dist/core/runner/caller-roster.js +5 -2
- package/dist/core/runner/checkpoint-scope.d.ts +16 -1
- package/dist/core/runner/checkpoint-scope.js +21 -0
- package/dist/core/runner/compact-session.js +18 -3
- package/dist/core/runner/compaction-call-options.d.ts +1 -1
- package/dist/core/runner/compaction-restate.d.ts +2 -2
- package/dist/core/runner/compaction-restate.js +4 -3
- package/dist/core/runner/construction-doors.d.ts +2 -2
- package/dist/core/runner/construction-doors.js +2 -2
- package/dist/core/runner/contracts.d.ts +116 -34
- package/dist/core/runner/cross-boundary-lane.d.ts +1 -1
- package/dist/core/runner/decide-continuation.d.ts +4 -2
- package/dist/core/runner/decide-continuation.js +7 -4
- package/dist/core/runner/delegation-owner.d.ts +43 -0
- package/dist/core/runner/delegation-owner.js +59 -0
- package/dist/core/runner/denial-limit-arms.d.ts +15 -21
- package/dist/core/runner/denial-limit-arms.js +17 -10
- package/dist/core/runner/expire-settle.d.ts +44 -0
- package/dist/core/runner/expire-settle.js +55 -0
- package/dist/core/runner/git-status-frame.d.ts +3 -3
- package/dist/core/runner/git-status-frame.js +2 -1
- package/dist/core/runner/halt-attribution.d.ts +2 -1
- package/dist/core/runner/halt-attribution.js +2 -1
- 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/local-claims.d.ts +17 -0
- package/dist/core/runner/local-claims.js +18 -0
- package/dist/core/runner/media-removed-seat.d.ts +46 -0
- package/dist/core/runner/media-removed-seat.js +88 -0
- package/dist/core/runner/park-commit.d.ts +2 -2
- package/dist/core/runner/permission-rule-lanes.d.ts +7 -2
- package/dist/core/runner/permission-rule-lanes.js +28 -9
- package/dist/core/runner/person-path-rows.d.ts +15 -0
- package/dist/core/runner/person-path-rows.js +27 -4
- package/dist/core/runner/placement-fence.d.ts +26 -0
- package/dist/core/runner/placement-fence.js +38 -0
- 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-ask-lane.d.ts +6 -12
- package/dist/core/runner/prepare-ask-lane.js +4 -4
- package/dist/core/runner/prepare-boundary-parks.d.ts +4 -1
- package/dist/core/runner/prepare-boundary-parks.js +2 -2
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +3 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +2 -1
- package/dist/core/runner/prepare-config-doors.d.ts +6 -6
- package/dist/core/runner/prepare-config-doors.js +19 -21
- package/dist/core/runner/prepare-context-lane.d.ts +6 -2
- package/dist/core/runner/prepare-context-lane.js +13 -13
- package/dist/core/runner/prepare-delegation-surface.d.ts +9 -9
- package/dist/core/runner/prepare-delegation-surface.js +4 -5
- package/dist/core/runner/prepare-execution-env.d.ts +5 -2
- package/dist/core/runner/prepare-execution-env.js +7 -4
- package/dist/core/runner/prepare-gate-stations.d.ts +19 -14
- package/dist/core/runner/prepare-gate-stations.js +6 -4
- package/dist/core/runner/prepare-hands-readface.d.ts +6 -6
- package/dist/core/runner/prepare-hands-readface.js +32 -11
- package/dist/core/runner/prepare-inherited-gate.d.ts +8 -0
- package/dist/core/runner/prepare-inherited-gate.js +10 -3
- package/dist/core/runner/prepare-lsp.d.ts +3 -0
- package/dist/core/runner/prepare-lsp.js +2 -2
- package/dist/core/runner/prepare-park-ask.d.ts +5 -2
- package/dist/core/runner/prepare-park-ask.js +4 -5
- package/dist/core/runner/prepare-policy-chain.d.ts +10 -21
- package/dist/core/runner/prepare-policy-chain.js +16 -25
- package/dist/core/runner/prepare-project-context.d.ts +2 -2
- package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -4
- package/dist/core/runner/prepare-prompt-inputs.js +3 -2
- package/dist/core/runner/prepare-question-face.d.ts +6 -4
- package/dist/core/runner/prepare-question-face.js +2 -2
- package/dist/core/runner/prepare-run-refs.d.ts +3 -0
- package/dist/core/runner/prepare-run-refs.js +2 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +11 -7
- package/dist/core/runner/prepare-suspend-saga.js +17 -7
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.js +61 -30
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +6 -0
- package/dist/core/runner/prepare-tool-disclosure-mount.js +3 -1
- package/dist/core/runner/prepare-wiring-manifest.d.ts +3 -0
- package/dist/core/runner/prepare-wiring-manifest.js +2 -1
- package/dist/core/runner/prepare-workspace-restore.d.ts +5 -0
- package/dist/core/runner/prepare-workspace-restore.js +10 -6
- package/dist/core/runner/read-root-grant.d.ts +1 -1
- package/dist/core/runner/read-root-grant.js +2 -1
- package/dist/core/runner/resume-admission.d.ts +8 -6
- package/dist/core/runner/resume-admission.js +23 -6
- package/dist/core/runner/resume-apply.d.ts +4 -0
- package/dist/core/runner/resume-apply.js +14 -5
- 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/resume-claim.d.ts +8 -3
- package/dist/core/runner/resume-claim.js +28 -12
- package/dist/core/runner/resume-internals-and-config.d.ts +2 -2
- package/dist/core/runner/resume-internals-and-config.js +10 -1
- package/dist/core/runner/resume-preflight.d.ts +3 -2
- package/dist/core/runner/resume-preflight.js +13 -26
- package/dist/core/runner/retired-runner-deps.js +2 -0
- package/dist/core/runner/run-git-lane.d.ts +2 -0
- package/dist/core/runner/run-git-lane.js +6 -2
- package/dist/core/runner/run-harness-handlers.d.ts +2 -0
- package/dist/core/runner/run-harness-handlers.js +5 -4
- package/dist/core/runner/run-identity-wiring.d.ts +2 -2
- package/dist/core/runner/run-identity-wiring.js +14 -5
- package/dist/core/runner/run-leg.d.ts +3 -3
- package/dist/core/runner/run-leg.js +64 -36
- package/dist/core/runner/run-notification-lane.js +20 -2
- package/dist/core/runner/run-recovery-lanes.js +3 -2
- package/dist/core/runner/run-settle-and-teardown.js +12 -9
- package/dist/core/runner/run-stop-and-final-verify.js +2 -1
- package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +1 -1
- package/dist/core/runner/run-terminal-adoption.d.ts +1 -1
- package/dist/core/runner/run-terminal-adoption.js +26 -17
- package/dist/core/runner/run-turn-boundary.js +34 -18
- package/dist/core/runner/runtask.d.ts +18 -3
- package/dist/core/runner/runtask.js +33 -17
- package/dist/core/runner/session-rule-policy.d.ts +1 -1
- package/dist/core/runner/session-rule-policy.js +6 -1
- package/dist/core/runner/shell-env-withheld.d.ts +1 -1
- package/dist/core/runner/steering-preview.d.ts +9 -0
- package/dist/core/runner/steering-preview.js +5 -0
- package/dist/core/runner/stream-halt-verbs.d.ts +1 -14
- package/dist/core/runner/stream-halt-verbs.js +4 -3
- package/dist/core/runner/stream-reap.d.ts +7 -6
- package/dist/core/runner/stream-reap.js +13 -16
- package/dist/core/runner/stream-settle-backstop.d.ts +3 -2
- package/dist/core/runner/stream-settle-backstop.js +5 -3
- package/dist/core/runner/stream-steer-verb.d.ts +5 -2
- package/dist/core/runner/stream-steer-verb.js +16 -7
- package/dist/core/runner/terminal-account.d.ts +11 -1
- package/dist/core/runner/terminal-account.js +20 -0
- package/dist/core/runner/terminal-projection.d.ts +8 -2
- package/dist/core/runner/terminal-projection.js +2 -2
- package/dist/core/runner/tool-disclosure.d.ts +3 -0
- package/dist/core/runner/tool-disclosure.js +5 -2
- package/dist/core/runner/tool-end-body.d.ts +3 -3
- package/dist/core/runner/tool-end-body.js +1 -1
- package/dist/core/runner/tool-face-overlay.js +2 -0
- package/dist/core/runner/tool-output-projection.d.ts +3 -3
- package/dist/core/runner/tool-output-projection.js +7 -6
- package/dist/core/runner/tool-table-view.d.ts +56 -0
- package/dist/core/runner/tool-table-view.js +51 -0
- package/dist/core/runner/turn-attachments.d.ts +8 -2
- package/dist/core/runner/turn-attachments.js +2 -2
- package/dist/core/runner/void-verifier-pause.d.ts +33 -0
- package/dist/core/runner/void-verifier-pause.js +41 -0
- package/dist/core/runner-deps.d.ts +26 -27
- package/dist/core/secret-env.d.ts +19 -16
- package/dist/core/secret-env.js +45 -27
- package/dist/core/session-log-transfer.js +9 -10
- package/dist/core/session-policy-store.d.ts +1 -1
- package/dist/core/session-policy-store.js +5 -2
- package/dist/core/session-reconcile.d.ts +3 -2
- package/dist/core/session-reconcile.js +7 -4
- package/dist/core/session-store.d.ts +3 -1
- package/dist/core/session-store.js +10 -8
- package/dist/core/session.d.ts +16 -5
- package/dist/core/shell-confinement.d.ts +37 -0
- package/dist/core/shell-confinement.js +56 -0
- package/dist/core/skill-grant.js +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.d.ts +8 -2
- package/dist/core/store-contracts/checkpoint-store-contract.js +83 -2
- package/dist/core/store-contracts/file-history-store-contract.d.ts +5 -2
- package/dist/core/store-contracts/file-history-store-contract.js +25 -1
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +12 -5
- package/dist/core/store-contracts/mailbox-store-contract.js +156 -9
- package/dist/core/store-contracts/session-store-contract.js +22 -8
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +30 -0
- package/dist/core/task-event.d.ts +24 -9
- package/dist/core/task-limits.d.ts +5 -0
- package/dist/core/task-notification.d.ts +89 -12
- package/dist/core/task-notification.js +89 -14
- package/dist/core/task-registry-agent.d.ts +32 -50
- package/dist/core/task-registry-agent.js +36 -56
- package/dist/core/task-registry-monitor.d.ts +1 -1
- package/dist/core/task-registry-monitor.js +15 -60
- package/dist/core/task-registry-shared.d.ts +22 -112
- package/dist/core/task-registry-shared.js +3 -41
- package/dist/core/task-registry-workflow.js +5 -21
- package/dist/core/task-registry.d.ts +32 -62
- package/dist/core/task-registry.js +30 -110
- package/dist/core/task-result.d.ts +29 -12
- package/dist/core/task-spec-members.d.ts +39 -0
- package/dist/core/task-spec-members.js +92 -0
- package/dist/core/task-spec.d.ts +11 -11
- package/dist/core/task-tool-shape.d.ts +7 -57
- package/dist/core/task-tool-shape.js +7 -66
- package/dist/core/terminal-cause.d.ts +36 -6
- package/dist/core/terminal-cause.js +1 -0
- package/dist/core/tool-catalog-entries.js +2 -5
- package/dist/core/tool-check-reading.js +16 -10
- package/dist/core/tool-conformance.js +1 -2
- package/dist/core/tool-errors.d.ts +6 -3
- package/dist/core/tool-errors.js +2 -0
- package/dist/core/tool-face-reader.js +3 -2
- package/dist/core/tool-face.d.ts +8 -5
- package/dist/core/tool-face.js +1 -1
- package/dist/core/tool-name-aliases.d.ts +5 -29
- package/dist/core/tool-name-aliases.js +9 -5
- package/dist/core/tool-name-readings.d.ts +14 -3
- package/dist/core/tool-name-readings.js +2 -0
- package/dist/core/tool-policy.d.ts +109 -18
- package/dist/core/tool-policy.js +84 -14
- package/dist/core/tool-result-store.d.ts +23 -0
- package/dist/core/tool-result-store.js +3 -2
- package/dist/core/tool-roster.d.ts +4 -4
- package/dist/core/tool-spec.d.ts +23 -6
- package/dist/core/trace.d.ts +18 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.js +1 -1
- package/dist/core/user-attachment.js +26 -21
- package/dist/core/workflow-journal-store.d.ts +1 -1
- package/dist/core/workflow-run-store.d.ts +2 -0
- package/dist/core/workflow-run-store.js +6 -5
- package/dist/core/workflow-settled-run.d.ts +5 -0
- package/dist/core/workflow-settled-run.js +7 -0
- package/dist/engine/execution-env/node-execution-env.d.ts +37 -9
- package/dist/engine/execution-env/node-execution-env.js +221 -22
- package/dist/engine/harness/agent-harness.d.ts +65 -18
- package/dist/engine/harness/agent-harness.js +90 -23
- package/dist/engine/harness/messages.d.ts +4 -3
- package/dist/engine/harness/messages.js +2 -2
- package/dist/engine/harness/types.d.ts +52 -7
- package/dist/engine/llm/media-removed.d.ts +14 -0
- package/dist/engine/llm/media-removed.js +9 -0
- package/dist/engine/llm/rejected-images.d.ts +35 -25
- package/dist/engine/llm/rejected-images.js +59 -10
- package/dist/engine/llm/types.d.ts +24 -3
- package/dist/engine/llm/types.js +7 -3
- package/dist/engine/loop/agent-loop.d.ts +6 -1
- package/dist/engine/loop/agent-loop.js +20 -11
- package/dist/engine/loop/types.d.ts +12 -3
- package/dist/engine/session/import-validate.js +7 -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/fixtures/index.d.ts +7 -5
- package/dist/fixtures/index.js +5 -3
- package/dist/index.d.ts +29 -18
- package/dist/index.js +19 -11
- package/dist/internal/harness-types.d.ts +2 -0
- package/dist/internal/harness.d.ts +4 -3
- package/dist/internal/harness.js +3 -2
- package/dist/internal/llm.d.ts +2 -1
- package/dist/internal/llm.js +1 -0
- package/dist/orchestration/goal.d.ts +6 -2
- package/dist/orchestration/goal.js +6 -3
- package/dist/orchestration/run-workflow-tool.d.ts +14 -17
- package/dist/orchestration/run-workflow-tool.js +43 -50
- package/dist/orchestration/workflow-types.d.ts +2 -2
- package/dist/orchestration/workflow.d.ts +7 -0
- package/dist/orchestration/workflow.js +10 -12
- package/dist/stores/file/background-agent-store.js +18 -15
- package/dist/stores/file/checkpoint-store.d.ts +2 -0
- package/dist/stores/file/checkpoint-store.js +13 -9
- package/dist/stores/file/file-history-store.js +3 -2
- 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 +7 -12
- package/dist/stores/file/index.js +25 -12
- package/dist/stores/file/ledger-tuning.d.ts +23 -0
- package/dist/stores/file/ledger-tuning.js +21 -0
- package/dist/stores/file/mailbox-store.js +42 -22
- package/dist/stores/file/memory-store.js +3 -2
- package/dist/stores/file/permission-rule-adopt.js +24 -21
- package/dist/stores/file/permission-rule-store.js +6 -3
- package/dist/stores/file/session-policy-store.js +3 -2
- package/dist/stores/file/session-store.d.ts +26 -7
- package/dist/stores/file/session-store.js +59 -35
- package/dist/stores/file/tool-result-store.d.ts +11 -0
- package/dist/stores/file/tool-result-store.js +57 -3
- package/dist/stores/file/usage-window-store.js +3 -2
- package/dist/stores/file/workflow-journal-store.d.ts +0 -2
- package/dist/stores/file/workflow-journal-store.js +3 -18
- package/dist/stores/file/workflow-run-store.d.ts +1 -1
- package/dist/stores/file/workflow-run-store.js +15 -10
- 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/dead-cwd.d.ts +5 -5
- package/dist/tools/fs/dead-cwd.js +4 -11
- package/dist/tools/fs/fs-bash-background-text.d.ts +6 -0
- package/dist/tools/fs/fs-bash-background-text.js +6 -0
- package/dist/tools/fs/fs-bash.d.ts +3 -18
- package/dist/tools/fs/fs-bash.js +37 -124
- package/dist/tools/fs/fs-pdf.js +8 -6
- package/dist/tools/fs/fs-read.js +2 -2
- package/dist/tools/fs/fs-shared.d.ts +28 -3
- package/dist/tools/fs/fs-shared.js +15 -0
- package/dist/tools/fs/index.d.ts +1 -1
- package/dist/tools/fs/index.js +4 -14
- package/dist/tools/fs/pdf.d.ts +4 -4
- package/dist/tools/fs/pdf.js +6 -6
- package/dist/tools/fs/read-deny-home.js +8 -1
- package/dist/tools/fs/read-deny.d.ts +26 -2
- package/dist/tools/fs/read-deny.js +9 -2
- package/dist/tools/fs/read-floor.d.ts +13 -5
- package/dist/tools/fs/read-floor.js +206 -2
- package/dist/tools/fs/removal-targets.js +2 -2
- package/dist/tools/fs/search.d.ts +3 -2
- package/dist/tools/fs/search.js +6 -6
- 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 +25 -9
- package/dist/tools/fs/shell-read-functions.js +2 -2
- package/dist/tools/fs/shell-read-identity.d.ts +3 -1
- package/dist/tools/fs/shell-read-identity.js +4 -2
- package/dist/tools/fs/shell-read-judge.d.ts +7 -1
- package/dist/tools/fs/shell-read-judge.js +1 -1
- 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/dist/tools/monitor.d.ts +8 -7
- package/dist/tools/monitor.js +12 -10
- package/dist/tools/worktree.d.ts +5 -1
- package/dist/tools/worktree.js +20 -17
- package/package.json +6 -3
- package/test/export-surface.snapshot.json +112 -42
- package/wire-changes/core-stores-sql@7.61.0.json +480 -0
- package/wire-changes/core-stores-sql@7.62.0.json +30 -0
- package/wire-changes/core@7.61.0.json +4405 -0
- package/wire-changes/core@7.62.0.json +2181 -0
- package/wire-changes/mods-kernel@7.61.0.json +65 -0
- package/wire-changes/mods-kernel@7.62.0.json +42 -0
- package/wire-changes/primitives@7.61.0.json +30 -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/image-removed-seat.d.ts +0 -12
- package/dist/core/runner/image-removed-seat.js +0 -19
- package/dist/core/runner/memory-consolidation.d.ts +0 -109
- package/dist/core/runner/memory-consolidation.js +0 -251
|
@@ -1,19 +1,20 @@
|
|
|
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";
|
|
11
11
|
import type { WorkspaceHandle } from "./remote-env.js";
|
|
12
12
|
import type { SessionPermissionRules } from "./session-policy-store.js";
|
|
13
13
|
import type { NestedUsageAccum, PermissionMode, ShellGateDoctrine, TaskResult } from "./types.js";
|
|
14
|
-
import type { ActiveWorktreeSession } from "../internal/harness-types.js";
|
|
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
|
|
@@ -587,7 +567,7 @@ export type ResumeOutcome = {
|
|
|
587
567
|
* no persisted hash → the resume skips this check, binding on `boundCallId` alone; new mints enforce.)
|
|
588
568
|
*/
|
|
589
569
|
boundInputHash: string;
|
|
590
|
-
/** `allow` → execute the pending tool call; `deny` → inject a denial result
|
|
570
|
+
/** `allow` → execute the pending tool call; `deny` → inject a denial result, then: a person's deny with no (or an empty) `reason` on a leg that is not a delegated child ends the turn awaiting the user (the run completes with `haltedOnUserRejection`) unless the resume also delivers a parked steer, which the model answers; any other deny continues. */
|
|
591
571
|
decision: "allow" | "deny";
|
|
592
572
|
/** A re-written arg payload (design/37 policy `allow` rewrite); re-validated on execute. */
|
|
593
573
|
updatedInput?: unknown;
|
|
@@ -649,6 +629,9 @@ export type ResumeOutcome = {
|
|
|
649
629
|
* characters, refused pre-CAS (`checkpoint.invalid_outcome`) otherwise — refused rather than dropped,
|
|
650
630
|
* because a settlement that silently lost its attributed party reads as unattributed.
|
|
651
631
|
*
|
|
632
|
+
* `decidedVia` — which machine seat answered a `"policy"` decision ({@link import("./gate-outcome.js").DECIDED_VIA}); the
|
|
633
|
+
* captured facts carry it to the resumed leg (refusal sentence, reminder's decider); refused pre-CAS outside the set or beside another decider.
|
|
634
|
+
*
|
|
652
635
|
* SCOPE — the facts ride the settlement, not the persisted winner: `winnerFromOutcome` records what an
|
|
653
636
|
* `env_failed` replay must reproduce exactly, and who reported a settlement is not part of that
|
|
654
637
|
* authorization; a replay states its own facts.
|
|
@@ -857,6 +840,9 @@ export type PendingAction = {
|
|
|
857
840
|
/** The PARK twin of `AskRequest.classes`: every class of the parked ask, in `ASK_CLASSES` order
|
|
858
841
|
* (`classes[0] === askClass`). Present exactly when {@link askClass} is. */
|
|
859
842
|
classes?: readonly import("./ask-origin.js").AskClass[];
|
|
843
|
+
/** The PARK twin of `AskRequest.askReasons` (the synchronous card's value, through the park's one carry): written only as a
|
|
844
|
+
* list of well-formed entries; a row parked before it reads ABSENT. Display metadata — no gate, CAS or resume path reads it. */
|
|
845
|
+
askReasons?: readonly import("./ask-origin.js").AskReason[];
|
|
860
846
|
/**
|
|
861
847
|
* design/80 D-1 §2 (slice 1a.2): the server-minted **opaque** boundInputHash of {@link args} — a
|
|
862
848
|
* SHA-256 (hex) via {@link import("./canonical-json.js").boundInputHashOf}, computed ONCE here at
|
|
@@ -1126,8 +1112,8 @@ export interface CheckpointState {
|
|
|
1126
1112
|
* alive in the resume leg's registry is an ORPHAN — aggregated into ONE "The container
|
|
1127
1113
|
* was restarted…" reminder appended to the resume continuation (single message: header +
|
|
1128
1114
|
* `- description (task id)` list + re-create instruction; never a per-task barrage). A survivor
|
|
1129
|
-
* (session-resident shell / in-window monitor) is excluded —
|
|
1130
|
-
*
|
|
1115
|
+
* (session-resident shell / in-window monitor) is excluded — its output file and TaskStop
|
|
1116
|
+
* still reach it, it needs no obituary. CC's per-orphan `Ku(task_id,"stopped")` status write (:707399)
|
|
1131
1117
|
* is N/A here: the suspend teardown already settled them killed with receipts. Absent for a run
|
|
1132
1118
|
* with no live background tasks at suspend, and for pre-1.262 checkpoints (deserialized without
|
|
1133
1119
|
* the field) — both resume silently, exactly like CC with an empty list.
|
|
@@ -1197,7 +1183,7 @@ export interface CheckpointState {
|
|
|
1197
1183
|
* revive the mode where the redeeming deployment denies it, and an `auto` row arms only where a face is
|
|
1198
1184
|
* wired. Absent on a task that declared nothing and inherited nothing (`default`). Rows written before this
|
|
1199
1185
|
* member carried `autoModeRequested` / `approverPosture` / a doctrine `shellGate`; no engine since 7.39.0 reads
|
|
1200
|
-
* them — such a row is refused before the claim (
|
|
1186
|
+
* them — such a row is refused before the claim (`retiredModeSeedRefusal`, checkpoint-row-verdict.ts). */
|
|
1201
1187
|
permissionMode?: PermissionMode;
|
|
1202
1188
|
/** Beside a recorded `plan`: the declared word the leg had when a steer or the model's `EnterPlanMode` moved it into
|
|
1203
1189
|
* plan — the mode an approved or edited `plan_review` resumes under ({@link import("./mode-policy.js").modeRequestAfterResume}). */
|
|
@@ -1343,6 +1329,9 @@ export interface CheckpointState {
|
|
|
1343
1329
|
* delegated child (never `false` — presence-coded like the other monotonic bits here).
|
|
1344
1330
|
*/
|
|
1345
1331
|
isDelegatedChild?: true;
|
|
1332
|
+
/** The registry row the suspended leg ran as (`RunInternals.rowTaskId`), stamped at every mint and restored by a resume that
|
|
1333
|
+
* hands no internals. Present only on a row-lane leg's park, which then requires `row_task_id` (an older engine refuses it). */
|
|
1334
|
+
rowTaskId?: string;
|
|
1346
1335
|
/**
|
|
1347
1336
|
* design/380 O1③ — the run TREE's placement fixed point at suspend: the SAME three-segment fold the
|
|
1348
1337
|
* env-factory ctx mint uses (explicit `RunInternals.placementRoot` > the delegation lanes'
|
|
@@ -1365,6 +1354,18 @@ export interface CheckpointState {
|
|
|
1365
1354
|
* resolved empty on a factory-less run (never persisted as garbage).
|
|
1366
1355
|
*/
|
|
1367
1356
|
placementRootSessionId?: string;
|
|
1357
|
+
/**
|
|
1358
|
+
* Which composition leg parked this row and which host session it belongs to
|
|
1359
|
+
* ({@link import("./runner/contracts.js").CompositionLeg}): stamped at every mint from the ONE value the leg's prepare resolved
|
|
1360
|
+
* (the live `RunInternals.compositionLeg`, else this member restored from the row being resumed), so a re-suspend chain carries
|
|
1361
|
+
* it unchanged. A host links the row to its run by `hostSessionId` — the row's own {@link Checkpoint.sessionId} is the leg's
|
|
1362
|
+
* session, not the host's — and settles it by `entry`: a `cascade` card goes back to the cascade's resume entry, which reads
|
|
1363
|
+
* `leg` to know which rung it continues; a `verify` card is a verifier's own pause (resume it by its token, or void it with
|
|
1364
|
+
* `Runner.voidVerifierPause`). A resume that hands a CONTRADICTING live value is refused pre-CAS (`resume.composition_mismatch`); a live value
|
|
1365
|
+
* over a row without this member is that row's first record. Absent ⇒ the leg was not handed out by a composition entry, its
|
|
1366
|
+
* composition minted none (a cascade whose caller named no session), or the row was minted before the member.
|
|
1367
|
+
*/
|
|
1368
|
+
compositionLeg?: import("./runner/contracts.js").CompositionLeg;
|
|
1368
1369
|
/**
|
|
1369
1370
|
* design/380 O9a — MONOTONIC presence bit: this run's hand-tool content fold was EXTERNAL-TARGET
|
|
1370
1371
|
* armed (the env declared `capabilities.externalContentTarget`, or an earlier leg of this suspend
|
|
@@ -1432,128 +1433,6 @@ export interface CheckpointState {
|
|
|
1432
1433
|
export type SerializedCheckpointState = {
|
|
1433
1434
|
[K in keyof Required<CheckpointState>]: CheckpointState[K];
|
|
1434
1435
|
};
|
|
1435
|
-
/**
|
|
1436
|
-
* The checkpoint FEATURE TABLE — one row per feature that ever raised the row format: its schema version, and
|
|
1437
|
-
* what a mint owed when the feature was present (`writes`, prose). The per-feature constants below ARE the rows'
|
|
1438
|
-
* versions. The table is CLOSED at `requirements` (v10): every live mint stamps 10 and lists the row's
|
|
1439
|
-
* reader-requirement words beside it (`Checkpoint.requires`, checkpoint-requirements.ts) — a later segment adds a
|
|
1440
|
-
* word there, never a row here. Each feature key below (but `baseline` / `requirements`) is itself one of those
|
|
1441
|
-
* words, and whether a v10 row carries the feature is read off the row's content by the requirement tables.
|
|
1442
|
-
*
|
|
1443
|
-
* A v≤9 row was stamped the HIGHEST feature it carried, so the number records only the top feature; the resume
|
|
1444
|
-
* rules that read a v≤9 row by number are exact to the version at which their feature was the top
|
|
1445
|
-
* (`realApproval` is version-recorded at v8 and marker-recorded — `readFace.realApproval` — at v9).
|
|
1446
|
-
*
|
|
1447
|
-
* v4 is a GAP, deliberately: the retired cross-slice wall-clock allocation. This worker still reads v4
|
|
1448
|
-
* rows; a ledger carrying the retired axis is refused by FIELD (`walltime_axis_retired`) at any version.
|
|
1449
|
-
*/
|
|
1450
|
-
export declare const CHECKPOINT_FEATURES: {
|
|
1451
|
-
/** The baseline shape: a plain human-approval suspend before any feature raised the format. No live
|
|
1452
|
-
* mint stamps it today; it is the floor of the ladder and the reading of a row written before any feature. */
|
|
1453
|
-
readonly baseline: {
|
|
1454
|
-
readonly version: 1;
|
|
1455
|
-
readonly introduced: "design/49";
|
|
1456
|
-
readonly writes: "the row itself";
|
|
1457
|
-
};
|
|
1458
|
-
/** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction an older worker
|
|
1459
|
-
* cannot handle (it rejects pre-CAS; the row stays `pending`, retryable on a newer worker). */
|
|
1460
|
-
readonly resource: {
|
|
1461
|
-
readonly version: 2;
|
|
1462
|
-
readonly introduced: "design/74";
|
|
1463
|
-
readonly writes: "resourceLedger; gate/pendingAction kind resource_limit";
|
|
1464
|
-
};
|
|
1465
|
-
/** A HUMAN-DECISION park (tool approval or plan_review) of the binding era: the decision-action binding
|
|
1466
|
-
* (`boundCallId` + `boundInputHash` on a tool_approval) is enforced ENTIRELY by the resuming worker, so a
|
|
1467
|
-
* pre-binding worker must reject the row rather than execute the pending tool unverified. Like `resource`,
|
|
1468
|
-
* this row is a park-kind FLOOR: a plan_review park carries it with no binding (it was introduced above it);
|
|
1469
|
-
* whether a tool_approval row carries its hash is the resume binding rung's own conjunction. */
|
|
1470
|
-
readonly binding: {
|
|
1471
|
-
readonly version: 3;
|
|
1472
|
-
readonly introduced: "design/80";
|
|
1473
|
-
readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only";
|
|
1474
|
-
};
|
|
1475
|
-
/** A ledger carrying a cross-slice TOKEN allocation: the window clamp and the exhausted-resume fail-fast
|
|
1476
|
-
* live in the resuming worker. A ledger with no token total keeps the historic stamps. */
|
|
1477
|
-
readonly token: {
|
|
1478
|
-
readonly version: 5;
|
|
1479
|
-
readonly introduced: "design/164";
|
|
1480
|
-
readonly writes: "resourceLedger.totalTokens";
|
|
1481
|
-
};
|
|
1482
|
-
/** Org-memory admission freeze state (the adjudicated-empty record included): the session/delegation
|
|
1483
|
-
* freeze on resume and the tenant-admission door live in the resuming worker. */
|
|
1484
|
-
readonly orgAdmission: {
|
|
1485
|
-
readonly version: 6;
|
|
1486
|
-
readonly introduced: "org-admission";
|
|
1487
|
-
readonly writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned";
|
|
1488
|
-
};
|
|
1489
|
-
/** The F-012 durable enforcement fields: the frozen ancestor projection chain + its digest (one write, the
|
|
1490
|
-
* resume-edit re-adjudication executes it) and/or the delegation-provenance aggregate a resume re-seeds. */
|
|
1491
|
-
readonly f012: {
|
|
1492
|
-
readonly version: 7;
|
|
1493
|
-
readonly introduced: "F-012";
|
|
1494
|
-
readonly writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance";
|
|
1495
|
-
};
|
|
1496
|
-
/** A gate carrying {@link RealApprovalGateBit}: the no-org-wiring refusal and the org_unavailable resume
|
|
1497
|
-
* belt live in the resuming worker. Minted at ONE site (the approval park); the two always-mounted
|
|
1498
|
-
* integrity policies mint it on any durable deployment, org-governed or not. */
|
|
1499
|
-
readonly realApproval: {
|
|
1500
|
-
readonly version: 8;
|
|
1501
|
-
readonly introduced: "#130/#120";
|
|
1502
|
-
readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it";
|
|
1503
|
-
};
|
|
1504
|
-
/** The READ-face section ({@link CheckpointState.readFace}): resolved face + normalized deny-set additions,
|
|
1505
|
-
* written only for a non-default posture; the stricter-wins fold lives in the resuming worker. Carries the
|
|
1506
|
-
* redundant governance marker for `realApproval` (see the table note above). Absent ⇒ default posture. */
|
|
1507
|
-
readonly face: {
|
|
1508
|
-
readonly version: 9;
|
|
1509
|
-
readonly introduced: "design/199";
|
|
1510
|
-
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)";
|
|
1511
|
-
};
|
|
1512
|
-
/** The last row: the reader-requirement words ({@link CheckpointRow.requires}). Every live mint stamps it, so a
|
|
1513
|
-
* worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted from here on, `version_newer`, pre-CAS. */
|
|
1514
|
-
readonly requirements: {
|
|
1515
|
-
readonly version: 10;
|
|
1516
|
-
readonly introduced: "#1320";
|
|
1517
|
-
readonly writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)";
|
|
1518
|
-
};
|
|
1519
|
-
};
|
|
1520
|
-
/** One row of {@link CHECKPOINT_FEATURES}. */
|
|
1521
|
-
export interface CheckpointFeatureRow {
|
|
1522
|
-
readonly version: number;
|
|
1523
|
-
/** Where the feature came from — a design or ticket tag, documentation only. */
|
|
1524
|
-
readonly introduced: string;
|
|
1525
|
-
/** What a mint wrote when the feature was present (prose; the mint sites are the code). */
|
|
1526
|
-
readonly writes: string;
|
|
1527
|
-
}
|
|
1528
|
-
/** The feature words — the row keys of {@link CHECKPOINT_FEATURES}. */
|
|
1529
|
-
export type CheckpointFeature = keyof typeof CHECKPOINT_FEATURES;
|
|
1530
|
-
/** The BASELINE {@link Checkpoint} schema version — the `baseline` row. NOT the highest a resume accepts (that
|
|
1531
|
-
* is {@link MAX_SUPPORTED_CHECKPOINT_VERSION}); resume stays forward-compatible by `<=` against MAX, never `===`. */
|
|
1532
|
-
export declare const CURRENT_CHECKPOINT_VERSION: 1;
|
|
1533
|
-
/** The `resource` row's version. */
|
|
1534
|
-
export declare const RESOURCE_CHECKPOINT_VERSION: 2;
|
|
1535
|
-
/** The `binding` row's version. */
|
|
1536
|
-
export declare const BINDING_CHECKPOINT_VERSION: 3;
|
|
1537
|
-
/** The `token` row's version. v4 (the retired wall-clock total) is deliberately not reused. */
|
|
1538
|
-
export declare const TOKEN_CHECKPOINT_VERSION: 5;
|
|
1539
|
-
/** The `orgAdmission` row's version. */
|
|
1540
|
-
export declare const ORG_ADMISSION_CHECKPOINT_VERSION: 6;
|
|
1541
|
-
/** The `f012` row's version. */
|
|
1542
|
-
export declare const F012_CHECKPOINT_VERSION: 7;
|
|
1543
|
-
/** The `realApproval` row's version. */
|
|
1544
|
-
export declare const REAL_APPROVAL_CHECKPOINT_VERSION: 8;
|
|
1545
|
-
/** The `face` row's version. */
|
|
1546
|
-
export declare const FACE_CHECKPOINT_VERSION: 9;
|
|
1547
|
-
/** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table, and the stamp
|
|
1548
|
-
* of every live mint (the table is closed there); a higher one is rejected pre-CAS with {@link CheckpointError}
|
|
1549
|
-
* `unsupported_version` (the row stays `pending`, retryable on a newer worker). */
|
|
1550
|
-
export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 10;
|
|
1551
|
-
/**
|
|
1552
|
-
* Read a checkpoint's schema version, defaulting an absent field to **legacy `0`** (a 1.67-era checkpoint
|
|
1553
|
-
* written before the field existed — it carries no `workspaceHandle`, so resuming it the v1 way is safe).
|
|
1554
|
-
* Compare with `<= MAX_SUPPORTED_CHECKPOINT_VERSION`, never `=== CURRENT_CHECKPOINT_VERSION` (design/49 §3).
|
|
1555
|
-
*/
|
|
1556
|
-
export declare function checkpointVersionOf(cp: Pick<Checkpoint, "version">): number;
|
|
1557
1436
|
/**
|
|
1558
1437
|
* design/74 R3-B: cross-slice resource accounting carried by a `resource_limit` {@link Checkpoint}. The
|
|
1559
1438
|
* total budget is the human's allocation; `spent*` accumulate across the resume→re-suspend chain (debited
|
|
@@ -1775,6 +1654,12 @@ export interface CheckpointRow {
|
|
|
1775
1654
|
sessionId: string;
|
|
1776
1655
|
/** The session leaf the suspend happened at — the resume point (CAS write base, §5). */
|
|
1777
1656
|
leafId: string;
|
|
1657
|
+
/** The conversation rows the leg had admitted but not yet stored when it parked (a note an extension added while the turn
|
|
1658
|
+
* ran), in the order they were admitted — what the conversation owes after {@link leafId}. Written by the park's commit
|
|
1659
|
+
* alone, in the same step as the row; the resumed leg writes each once, at its transcript's first legal point (after the
|
|
1660
|
+
* parked batch's last result, before the continuation), never through the admission seat again. Absent ⇒ none were held;
|
|
1661
|
+
* present ⇒ the row carries the `held_rows` requirement word. */
|
|
1662
|
+
heldRows?: readonly AgentMessage[];
|
|
1778
1663
|
state: CheckpointState;
|
|
1779
1664
|
/** design/74 R3-B: cross-slice resource accounting. Present for a `resource_limit` gate (debited at the
|
|
1780
1665
|
* suspend's `put`; read on resume to size the next slice + aggregate the final stats). **design/80 D-E-core
|
|
@@ -1865,26 +1750,28 @@ export interface CheckpointRow {
|
|
|
1865
1750
|
*/
|
|
1866
1751
|
rev?: number;
|
|
1867
1752
|
/**
|
|
1868
|
-
* design S1d (source-tag persistence): the issuing
|
|
1869
|
-
*
|
|
1870
|
-
* raised it (the durable analog of {@link import("./tool-policy.js").AskRequest}.
|
|
1753
|
+
* design S1d (source-tag persistence): the issuing leg's session id, stamped at the APPROVAL and the
|
|
1754
|
+
* plan_review suspend mints so a supervisor inbox can attribute a paused/awaiting checkpoint to the worker that
|
|
1755
|
+
* raised it (the durable analog of {@link import("./tool-policy.js").AskRequest}.sourceSessionId — the durable
|
|
1871
1756
|
* suspend path does NOT invoke `onAsk`, so the synchronous source identity is captured here instead). It is
|
|
1872
|
-
* the SAME value the synchronous ask carries
|
|
1757
|
+
* the SAME value the synchronous ask carries, read from the same one mint. It names a conversation, never a
|
|
1758
|
+
* task: the parked leg's agent id is {@link CheckpointSummary.agentId}, derived from the row.
|
|
1873
1759
|
*
|
|
1874
1760
|
* **Security invariant (carried verbatim from the 1.113.0 ask-bubbling contract):** for a Runner-created
|
|
1875
1761
|
* DELEGATED subagent this is **worker-unforgeable** (a child never sets its own sessionId — the Runner mints
|
|
1876
1762
|
* it); a top-level caller MAY continue its own session id via {@link import("./types.js").TaskSpec.sessionId},
|
|
1877
1763
|
* so this is NOT a global "never forgeable" run id — aggregation only aggregates delegated workers, where it
|
|
1878
1764
|
* holds. **ECHO-ONLY triage metadata, NEVER a gate input:** no gate / CAS / winner / resume-validation path
|
|
1879
|
-
* reads it (a contract-test pins this).
|
|
1765
|
+
* reads it (a contract-test pins this). A row that carries it requires `source_session` (an older engine
|
|
1766
|
+
* refuses it). Absent ⇒ a non-ask gate, or a row an earlier engine parked (it named the member `sourceTaskId`).
|
|
1880
1767
|
*/
|
|
1881
|
-
|
|
1768
|
+
sourceSessionId?: string;
|
|
1882
1769
|
/**
|
|
1883
1770
|
* design S1d (source-tag persistence): the issuing task's authenticated end-user {@link
|
|
1884
1771
|
* import("./types.js").TaskSpec.principal} (design/62), stamped at the APPROVAL suspend mint — and, since
|
|
1885
1772
|
* #449 G2, at the `resource_limit` mint too — so an aggregating inbox can attribute a paused checkpoint
|
|
1886
1773
|
* per-user — the durable analog of {@link import("./tool-policy.js").AskRequest}.principal. Caller-set
|
|
1887
|
-
* (never a tool/worker arg), and like {@link
|
|
1774
|
+
* (never a tool/worker arg), and like {@link sourceSessionId} it is **NEVER a gate input**: no gate / CAS /
|
|
1888
1775
|
* winner path reads it. The RESUME ENTRY however does read it as the row's identity record (#449 G2):
|
|
1889
1776
|
* a resume config that omits `principal` inherits this value for the resumed leg (usage-ledger bucket,
|
|
1890
1777
|
* later mints' scope derivation, ask attribution — a dropped field must not silently move the leg onto
|
|
@@ -1981,6 +1868,28 @@ export declare function checkpointIndexFacts(cp: Checkpoint): CheckpointIndexFac
|
|
|
1981
1868
|
* cause and the inbox summary both read it here.
|
|
1982
1869
|
*/
|
|
1983
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
|
+
};
|
|
1984
1893
|
/**
|
|
1985
1894
|
* design/80 assistant-scheduler seam #1: a LIGHTWEIGHT projection of one PENDING
|
|
1986
1895
|
* checkpoint, returned in bulk by {@link CheckpointStore.listByScope} so a supervisor scheduler can list a
|
|
@@ -1991,6 +1900,11 @@ export declare function planReviewRequesterOf(pendingAction: PendingAction): str
|
|
|
1991
1900
|
export interface CheckpointSummary {
|
|
1992
1901
|
/** The resume capability token ({@link Checkpoint.token}). */
|
|
1993
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;
|
|
1994
1908
|
/** Non-secret stable identity ({@link Checkpoint.checkpointId}) — absent on legacy rows. */
|
|
1995
1909
|
checkpointId?: string;
|
|
1996
1910
|
/** The suspended task / session id ({@link Checkpoint.sessionId}). */
|
|
@@ -2013,10 +1927,15 @@ export interface CheckpointSummary {
|
|
|
2013
1927
|
spentMicroUsd?: number;
|
|
2014
1928
|
/** The awaiting-human SLA / abandonment deadline ({@link Checkpoint.deadline}, epoch ms) when present. */
|
|
2015
1929
|
deadline?: number;
|
|
2016
|
-
/** design S1d (source-tag): the issuing worker's session id ({@link Checkpoint.
|
|
1930
|
+
/** design S1d (source-tag): the issuing worker's session id ({@link Checkpoint.sourceSessionId}) — projected so
|
|
2017
1931
|
* a supervisor inbox attributes each pending checkpoint to its worker in ONE `listByScope` call (no N+1
|
|
2018
|
-
* `getCheckpoint`). ECHO-ONLY display/triage; absent on a non-ask gate
|
|
2019
|
-
|
|
1932
|
+
* `getCheckpoint`). ECHO-ONLY display/triage; absent on a non-ask gate and on a row an earlier engine parked. */
|
|
1933
|
+
sourceSessionId?: string;
|
|
1934
|
+
/** The parked leg's agent id when it is a delegated child (the parked twin of {@link import("./tool-policy.js").AskRequest}.agentId),
|
|
1935
|
+
* derived from the row by the live ask's predicate — nothing more is stored: its registry row ({@link CheckpointState.rowTaskId}) when
|
|
1936
|
+
* it ran as one, else its session id; absent on a host's row. The row does not record a task id the leg's spec declared, so a workflow
|
|
1937
|
+
* agent whose spec names a `taskId` summarizes as its session id while its live ask said the declared id. ECHO-ONLY display/triage. */
|
|
1938
|
+
agentId?: string;
|
|
2020
1939
|
/** design S1d (source-tag): the issuing task's end-user principal ({@link Checkpoint.principal}) for per-user
|
|
2021
1940
|
* inbox attribution. ECHO-ONLY display/triage; absent when the checkpoint carries no principal. */
|
|
2022
1941
|
principal?: string;
|
|
@@ -2028,9 +1947,9 @@ export interface CheckpointSummary {
|
|
|
2028
1947
|
* tool-less park (`resource_limit` / `plan_review` / `task_done` — none of which binds a tool call)
|
|
2029
1948
|
* gets the key **OMITTED**, never `null` and never a present-but-`undefined` property. The
|
|
2030
1949
|
* `PendingAction` arms for those kinds declare no tool/binding fields at all, so there is nothing to
|
|
2031
|
-
* project; `summarizeCheckpoint` spreads them conditionally for exactly this reason. A consumer
|
|
2032
|
-
*
|
|
2033
|
-
* 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
|
|
2034
1953
|
* `test/checkpoint-store.test.ts` ("tool-less park …"). */
|
|
2035
1954
|
toolCallId?: string;
|
|
2036
1955
|
/** The id of the tool call that asked for this plan pause ({@link PendingAction} `plan_review.requestedByCallId`) —
|
|
@@ -2069,7 +1988,7 @@ export interface CheckpointSummary {
|
|
|
2069
1988
|
* `toolInput` is the raw-data sibling for a consumer that wants the actual args.)
|
|
2070
1989
|
* - **same data as the full {@link Checkpoint}** — it is a projection of `pendingAction.args`, which the
|
|
2071
1990
|
* caller could already read via `get`; this adds NO new exposure, it only saves the round-trip.
|
|
2072
|
-
* - **ECHO-ONLY, like {@link
|
|
1991
|
+
* - **ECHO-ONLY, like {@link sourceSessionId}** — NO gate / CAS / resume / {@link winnerFromOutcome} path reads
|
|
2073
1992
|
* it (a contract test pins this); it is pure display/triage metadata, never a control input.
|
|
2074
1993
|
*/
|
|
2075
1994
|
toolInput?: string;
|
|
@@ -2168,7 +2087,7 @@ export interface CheckpointSummary {
|
|
|
2168
2087
|
* itself a TOTAL, bounded traversal (cycle-safe, per-type output forms, throwing getters to a
|
|
2169
2088
|
* placeholder, depth/node/char budgets with a truncation marker — never "full `JSON.stringify` then
|
|
2170
2089
|
* truncate", which does all the work and takes all the throws before the cap). ECHO-ONLY, like
|
|
2171
|
-
* {@link
|
|
2090
|
+
* {@link sourceSessionId}: a warning to a person, never a control input — resume/gate/CAS never read it.
|
|
2172
2091
|
*/
|
|
2173
2092
|
hasBidiControls?: true;
|
|
2174
2093
|
}
|
|
@@ -2177,535 +2096,25 @@ export interface CheckpointSummary {
|
|
|
2177
2096
|
* {@link CheckpointSummary}. Shared by every {@link CheckpointStore} impl so the projection is IDENTICAL
|
|
2178
2097
|
* across the in-memory, file, and durable backends (the anti-drift guard) — `severity` always derives from the
|
|
2179
2098
|
* gate's {@link RiskDescriptor} via the single {@link riskSeverity} helper, `spentMicroUsd` always reads
|
|
2180
|
-
* {@link ResourceLedger.spentMicroUsd}
|
|
2181
|
-
*
|
|
2182
|
-
*
|
|
2183
|
-
* shape (never its value); it is called synchronously and every listing calls it again. A store hands it its own seat.
|
|
2184
|
-
*/
|
|
2185
|
-
export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence: string) => void): CheckpointSummary;
|
|
2186
|
-
/**
|
|
2187
|
-
* WHICH arm of a multi-arm {@link CheckpointError} `code` fired (requested 2026-08-10: a deployment retry
|
|
2188
|
-
* policy needs to tell "a newer worker can redeem this row" from "this row is damaged/caller-declared and
|
|
2189
|
-
* no worker ever will" — blanket-retriable and gate-shape heuristics were both refuted downstream, so the
|
|
2190
|
-
* throw site carries the fact it always knew).
|
|
2191
|
-
*
|
|
2192
|
-
* A CLOSED SET with one home, registered in `docs/CLOSED-SETS.md`. It is carried in an OPTIONAL member, so
|
|
2193
|
-
* the compiler is silent when a throw site omits it, and a site that omits it hands the host a refusal it
|
|
2194
|
-
* cannot classify — the registry's mint-obligation leg is what makes the omission loud (every
|
|
2195
|
-
* `checkpoint.unsupported_version` construction site must spell one of these words AT the site).
|
|
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.
|
|
2196
2102
|
*
|
|
2197
|
-
*
|
|
2198
|
-
*
|
|
2199
|
-
*
|
|
2200
|
-
*
|
|
2201
|
-
*
|
|
2202
|
-
*
|
|
2203
|
-
* whose tool member is not whole — parked before 7.58.0 recorded the declaration, or damaged: an allow is refused, a deny
|
|
2204
|
-
* settles it; a worker of the release that parked it still reads it), `"ledger_event_unknown"` (a durable
|
|
2205
|
-
* LEDGER carries an event kind this binary does not know, so the replay is refused rather than served
|
|
2206
|
-
* incomplete — the one arm that is not row-scoped: NO row in that data directory is readable here, so
|
|
2207
|
-
* the host rolls the binary forward instead of routing one token elsewhere), `"seat_retired"` (the row
|
|
2208
|
-
* carries a seat this engine no longer reads — terminal for the row's bytes: the retired pre-queue single
|
|
2209
|
-
* steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
|
|
2210
|
-
* `inheritedGate`, which an engine at 7.38.x or earlier still reads once).
|
|
2211
|
-
* · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
|
|
2212
|
-
* `"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
|
|
2213
|
-
* current bytes — no worker version redeems a damaged row).
|
|
2214
|
-
*
|
|
2215
|
-
* THE ONE RULE for `checkpoint.invalid_outcome` (registered in `docs/CLOSED-SETS.md`, which also says what a host reads from it): `detail.reason` is a
|
|
2216
|
-
* ROW-INTEGRITY word and only that, `detail.field` ({@link CheckpointErrorField}) names the cell of the decision to act on, a refusal carries at most
|
|
2217
|
-
* one of them, and a refusal with neither is never a damaged row.
|
|
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.
|
|
2218
2109
|
*/
|
|
2219
|
-
export
|
|
2220
|
-
/** `state.writeFace` is present but not a well-formed section. No `_forged` twin: the section is
|
|
2221
|
-
* legal-and-absent at every version, so there is no version to judge a fabrication against — and a
|
|
2222
|
-
* fabricated "open" still needs the LIVE resolution to say open too. */
|
|
2223
|
-
| "write_face_damaged" | "skill_grants_damaged"
|
|
2224
|
-
/** `state.skillScopes` is present but not a list of skill names (the active skills whose hooks the resumed leg reopens). */
|
|
2225
|
-
| "skill_scopes_damaged" | "constraint_chain_missing"
|
|
2226
|
-
/** `state.handsRoot` / `state.handsHome` / `state.handsCwd` is present but not an absolute path (the row's hands' coordinates). */
|
|
2227
|
-
| "hands_coordinates_damaged"
|
|
2228
|
-
/** The row's reader-requirement list ({@link CheckpointRow.requires}) is missing on a v10 row, is not a list of words,
|
|
2229
|
-
* is present below v10, or does not equal the words the row's content carries (a segment dropped, or a word not
|
|
2230
|
-
* declared) — terminal for the row's bytes. */
|
|
2231
|
-
| "requirements_damaged"
|
|
2232
|
-
/** A pending tool approval whose row format is at or above the binding era carries no persisted `boundInputHash` — every mint at that
|
|
2233
|
-
* version writes one, so its absence is corruption or a caller-declared downgrade, and the decision-action input binding has nothing to
|
|
2234
|
-
* 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). */
|
|
2235
|
-
| "bound_input_hash_missing"
|
|
2236
|
-
/** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
|
|
2237
|
-
* no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
|
|
2238
|
-
* entry / a record member naming no absolute root. */
|
|
2239
|
-
| "installation_record_absent" | "installation_record_misaligned" | "installation_record_invalid"
|
|
2240
|
-
/** On `checkpoint.config_refused` with `detail.code` `config.tool_face_control` — the arm prepare's own refusal carries as its `detail.reason`:
|
|
2241
|
-
* 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
|
|
2242
|
-
* the one spelling a row records (`"not_a_list"`, `"not_a_string"`, `"unknown_name"`, `"unsupported_pattern"`; the re-supplied config's own four lists —
|
|
2243
|
-
* `allowTools`, `excludeTools`, `deferTools`, `alwaysLoadTools` — are refused as `"not_a_list"` / `"not_a_string"`); the record of the delegation tool that
|
|
2244
|
-
* 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
|
|
2245
|
-
* (`"renamed_mount"`); the process-wide table of declared names is occupied by a value that is not the engine's (`"registry_occupied"`). */
|
|
2246
|
-
| "not_a_list" | "not_a_string" | "unknown_name" | "unsupported_pattern" | "invalid_record" | "renamed_mount" | "registry_occupied"
|
|
2247
|
-
/** 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`)
|
|
2248
|
-
* — 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
|
|
2249
|
-
* 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`). */
|
|
2250
|
-
| "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;
|
|
2251
2111
|
/**
|
|
2252
|
-
*
|
|
2253
|
-
*
|
|
2254
|
-
*
|
|
2255
|
-
*
|
|
2256
|
-
* re-supplied config and the deployment's deps (`configValueDoors`, the rest): the retired deps seats and caller-policy members
|
|
2257
|
-
* (`config.deps_retired_key`), the peer presence, the restore selector, the microCompact knob, the prompt selectors, `resumeAt` on a resume
|
|
2258
|
-
* (`resume_at.conflicts_resume`, `resume_at.mode_without_target` — a resume carrying `resumeAt` is refused as a conflict before its mode is
|
|
2259
|
-
* 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,
|
|
2260
|
-
* 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`,
|
|
2261
|
-
* `config.locked_key`), an MCP server's content class, the skills-listing seats (`config.skill_listing_budget_invalid`), the limits and the
|
|
2262
|
-
* 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
|
|
2263
|
-
* would run on (`config.retention_policy`, `config.retention_capability`), and the checkpoint store seat itself (`config.invalid_checkpoint_store`: the
|
|
2264
|
-
* retired `null` spelling, a store that declares no execution outcome), and the skills seat and the hands band (`config.invalid_argument`;
|
|
2265
|
-
* a skill's `baseDir` by its own reader, `config.skill_base_dir_invalid`). A door not entered here (the leg's model, its rebuilt
|
|
2266
|
-
* 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").
|
|
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).
|
|
2267
2116
|
*/
|
|
2268
|
-
export declare
|
|
2269
|
-
export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODES)[number];
|
|
2270
|
-
export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
|
|
2271
|
-
/** 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
|
|
2272
|
-
* `docs/CLOSED-SETS.md`: a consumer holding a table over it is tsc-red on a new word until it places the word. */
|
|
2273
|
-
export type CheckpointErrorField = "boundCallId" | "boundInputHash" | "boundGrantDigest" | "answer" | "hostDecision" | "approver" | "feedback" | "outcome" | "updatedInput" | "decision" | "reason" | "taskConfig" | "deps" | "inheritedGate";
|
|
2274
|
-
/** A typed checkpoint-store error so callers branch on `code` (mirrors `SessionError`). */
|
|
2275
|
-
export declare class CheckpointError extends Error {
|
|
2276
|
-
readonly code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
|
|
2277
|
-
/** `runner.resume` was handed an {@link ResumeOutcome} whose `gate` arm does not match the
|
|
2278
|
-
* persisted {@link CheckpointGate} `kind` (council #3 — type confusion guard), or a gate v1
|
|
2279
|
-
* resume does not serve (`task_done`). */
|
|
2280
|
-
| "checkpoint.gate_mismatch"
|
|
2281
|
-
/** The resume's `TaskSpec.signal` was aborted at the entrance — handed in ALREADY-ABORTED, or aborted
|
|
2282
|
-
* while the wake screen / `resumePreflight` / pre-claim re-adjudication still ran: ONE code for a
|
|
2283
|
-
* cancellation there (the seats' own codes keep what the hook itself did). Refused BEFORE the CAS, so
|
|
2284
|
-
* the checkpoint stays `pending`; consuming the decision on a leg that aborts at once would lose it. */
|
|
2285
|
-
| "checkpoint.resume_aborted"
|
|
2286
|
-
/** `runner.resume` was handed an outcome whose payload is unsafe to apply — e.g. a deny `reason`
|
|
2287
|
-
* carrying a `</system-reminder>` tag that would escape the model-facing wrapper (round-2 #1). */
|
|
2288
|
-
| "checkpoint.invalid_outcome"
|
|
2289
|
-
/** The checkpoint's {@link Checkpoint.version} is newer than this worker supports
|
|
2290
|
-
* (`> MAX_SUPPORTED_CHECKPOINT_VERSION`), or it carries a remote `workspaceHandle` but no
|
|
2291
|
-
* `executionEnvFactory` is wired to rebuild the env — either way this worker cannot safely resume it.
|
|
2292
|
-
* Rejected pre-CAS so the checkpoint stays `pending` and a capable worker can still resume it
|
|
2293
|
-
* (design/49 §2/§3, code-ready council round-2). */
|
|
2294
|
-
| "checkpoint.unsupported_version"
|
|
2295
|
-
/** The resume's re-supplied config, or a mode the checkpoint row recorded, is one prepare would refuse
|
|
2296
|
-
* (a retired spec key, a malformed output style, a mode word outside the closed set, a retired shell-floor
|
|
2297
|
-
* word). Refused PRE-CAS, so the checkpoint stays `pending` and byte-identical. `message` is prepare's own
|
|
2298
|
-
* sentence; `detail.code` is prepare's own code ({@link CheckpointConfigRefusalCode}) and `detail.field`
|
|
2299
|
-
* says which input carries it: `"taskConfig"` (correct the config and resume the SAME token) or
|
|
2300
|
-
* `"inheritedGate"` (the recorded row — no config reaches it; expire the row). A fresh run of the same
|
|
2301
|
-
* bad config reports the same `detail.code` as its `TaskResult.errorCode`. */
|
|
2302
|
-
| "checkpoint.config_refused"
|
|
2303
|
-
/** `resume`/`resumeStream` was handed `internals.requestedCwd` for a checkpoint that
|
|
2304
|
-
* carries a remote `workspaceHandle`. The restored workspace's mountPath is authoritative for the
|
|
2305
|
-
* task root, so the cwd would be ignored at best — and verifying it would touch the env BEFORE the
|
|
2306
|
-
* VM restore (a lazy-connect adapter then connects a fresh empty sandbox, the design/49 disease).
|
|
2307
|
-
* Rejected pre-CAS so the checkpoint stays `pending`; re-resume without `requestedCwd`. */
|
|
2308
|
-
| "checkpoint.cwd_conflicts_restore"
|
|
2309
|
-
/** design/164: the checkpoint was written by a pre-164 worker AND its ledger carries the RETIRED
|
|
2310
|
-
* cross-slice wall-clock allocation (`resourceLedger.totalWalltimeSec`). The axis no longer exists,
|
|
2311
|
-
* so resuming would run the leg with the operator's time ceiling silently unenforced. Refused
|
|
2312
|
-
* PRE-CAS (the row stays `pending`, so a worker of the previous release can still finish it) rather
|
|
2313
|
-
* than migrated: there is no honest conversion from a wall-clock allocation to a token one. */
|
|
2314
|
-
| "checkpoint.walltime_axis_retired"
|
|
2315
|
-
/** design/80 D-1 (reopen-by-reason): a re-resume of an `env_failed`-reopened checkpoint supplied an
|
|
2316
|
-
* outcome that does NOT equal the persisted {@link ResolvedOutcome} winner. An `env_failed` reopen is
|
|
2317
|
-
* a SYSTEM RETRY of the already-approved action (the infra failed, not the decision) — it must replay
|
|
2318
|
-
* the exact winning binding, never a new vote. Rejected pre-CAS, fail-closed, so the checkpoint stays
|
|
2319
|
-
* `pending` for the correctly-replayed retry. (A `tool_unavailable` reopen — P-7 — is exempt: it lets
|
|
2320
|
-
* a human re-decide with the tool present, so a fresh decision is permitted there.) */
|
|
2321
|
-
| "checkpoint.reopen_revote"
|
|
2322
|
-
/** design/80 D-1 (atomicity fix): the resume validated its decision-action / reopen-by-reason guards
|
|
2323
|
-
* against a `get()` snapshot, but a concurrent {@link CheckpointStore.resolve}/{@link CheckpointStore.reopen}
|
|
2324
|
-
* cycle advanced the monotonic {@link Checkpoint.rev} in the get→resolve window, so the
|
|
2325
|
-
* {@link CheckpointStore.resolve} CAS's optimistic-concurrency check lost (the validation is stale). The
|
|
2326
|
-
* row is still `pending` — fail-closed; the caller must re-`get` and re-validate against the CURRENT state
|
|
2327
|
-
* (a fresh resume), never blindly retry. */
|
|
2328
|
-
| "checkpoint.reopened_concurrently"
|
|
2329
|
-
/** A post-CAS compensation {@link CheckpointStore.reopen} returned `false` — the consumed row could not
|
|
2330
|
-
* be flipped back to `pending` (missing, expired, or changed under a concurrent cycle), so no retryable
|
|
2331
|
-
* checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
|
|
2332
|
-
* caller's compensation path settles the token as terminally consumed. */
|
|
2333
|
-
| "checkpoint.reopen_failed"
|
|
2334
|
-
/** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
|
|
2335
|
-
* execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
|
|
2336
|
-
* in-tree form of this code. Never a retry condition. */
|
|
2337
|
-
| "checkpoint.execution_outcome_conflict"
|
|
2338
|
-
/** design/80 D-A: {@link CheckpointStore.setPendingSteer} was handed `text` containing a
|
|
2339
|
-
* `</system-reminder>` close tag — it would escape the model-facing `<system-reminder>` wrapper a
|
|
2340
|
-
* trusted steer rides on resume. Rejected fail-closed so a dirty steer NEVER enters {@link CheckpointState}
|
|
2341
|
-
* (§3 inv #2). Mirrors the trusted-steer reject at runtask.ts (`steering.invalid_content`). */
|
|
2342
|
-
| "steering.invalid_content"
|
|
2343
|
-
/** design/171 §6.3: the append would cross the parked-steer queue's entry-count or byte bound
|
|
2344
|
-
* ({@link MAX_PENDING_STEER_ENTRIES} / {@link PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES}). Fail-loud
|
|
2345
|
-
* rather than evicting: an already-accepted operator instruction is never dropped to make room —
|
|
2346
|
-
* the caller delivers or removes a parked steer first. Nothing is written on this path. */
|
|
2347
|
-
| "steering.queue_full"
|
|
2348
|
-
/** design/171 §6.3 (falsification review adoption): the append reused an `inputId` already parked on
|
|
2349
|
-
* this checkpoint, but with DIFFERENT content. Re-appending an IDENTICAL steer stays the idempotent
|
|
2350
|
-
* no-op a retry needs; a differing one is refused, because swallowing it would lose the second
|
|
2351
|
-
* operator's instruction — the exact silent loss the queue replaced. `detail.differs` names the facets
|
|
2352
|
-
* that differ: with `text` among them it is another instruction (retry it under a fresh id); without,
|
|
2353
|
-
* it is the parked one re-sent at another tier / trust / attribution (a fresh id would park it twice —
|
|
2354
|
-
* replay it with its original values). Nothing is written on this path. */
|
|
2355
|
-
| "steering.duplicate_input_id"
|
|
2356
|
-
/** design/373 §4.3 (D2): the deployment's `userPromptSubmit` hook refused a wake resume's
|
|
2357
|
-
* `message` at the entrance screen (block verdict, or a fail-closed timeout/crash — the
|
|
2358
|
-
* message discriminates). Pre-CAS: the checkpoint stays `pending` and byte-identical, so the
|
|
2359
|
-
* SAME token is redeemable once the screen clears — a refusal burns nothing. The live steer
|
|
2360
|
-
* verb refuses under the same code word (its own Error face); one vocabulary, two entrances. */
|
|
2361
|
-
| "steering.blocked_by_hook"
|
|
2362
|
-
/** design/144 §3 (governance-gate purity, fail-closed pre-CAS): a `wake` outcome was supplied for a
|
|
2363
|
-
* checkpoint that awaits a PENDING GATE DECISION (tool approval / dry-run review / plan review /
|
|
2364
|
-
* resource-limit continue). Wake is a pure un-park verb and must never circumvent an approval — resume
|
|
2365
|
-
* the checkpoint through its own decide entry instead (the error message names it). */
|
|
2366
|
-
| "wake.gate_pending"
|
|
2367
|
-
/** design/144 §3 (anti spin-wake): a `wake` outcome carried no `message` and the checkpoint has no
|
|
2368
|
-
* parked steer either — there is nothing to deliver, so the wake is rejected pre-CAS
|
|
2369
|
-
* (the checkpoint stays pending) instead of burning the token on an empty continuation. */
|
|
2370
|
-
| "wake.nothing_to_deliver"
|
|
2371
|
-
/** Parent effective-policy inheritance: the checkpoint records `state.inheritedGate.requiresParentConstraint`
|
|
2372
|
-
* (the suspended task ran under inherited OPAQUE parent-policy constraints — live closures that cannot
|
|
2373
|
-
* persist), but the resume supplied no `RunInternals.inheritedGate.parentConstraints` to re-instate them.
|
|
2374
|
-
* Resuming anyway would silently DROP the ancestors' gate (a widening), so this rejects pre-CAS — the
|
|
2375
|
-
* checkpoint stays `pending`; re-resume via `resumeStream(token, outcome, config, internals)` with the
|
|
2376
|
-
* parent chain re-supplied. */
|
|
2377
|
-
| "resume.parent_constraint_missing"
|
|
2378
|
-
/** Parent effective-policy inheritance (shape check): the resume DID re-supply
|
|
2379
|
-
* `internals.inheritedGate.parentConstraints`, but its length differs from the checkpoint's recorded
|
|
2380
|
-
* `parentConstraintCount` — or (F-012 L1) its projection CONTENT digests differently from the
|
|
2381
|
-
* recorded `constraintDigest` — or a screening entry names a `tool.check` guard beside a policy the
|
|
2382
|
-
* constraint mint did not make (no chain to raise it on) — a partial/mismatched re-supply would silently run
|
|
2383
|
-
* the child under a thinner (or different) ancestor chain than it suspended with. Rejected pre-CAS (the
|
|
2384
|
-
* checkpoint stays `pending`); re-resume with the full original chain. */
|
|
2385
|
-
| "resume.parent_constraint_mismatch"
|
|
2386
|
-
/** #449 G1 (codex r2, pre-CAS entrance): a deployment usage-governance window for this resume's
|
|
2387
|
-
* ledger key (the config's principal, else the row's recorded one, else the shared bucket) is
|
|
2388
|
-
* EXHAUSTED, and the row still OWES a delivery a re-mint cannot carry (an approval/review
|
|
2389
|
-
* decision, a wake, parked steers, a background-task obituary snapshot). Refused BEFORE the CAS,
|
|
2390
|
-
* so nothing is consumed and nothing is unpinned — the SAME token with the SAME decision is
|
|
2391
|
-
* redeemable once the window frees (`detail.retryAfterMs` carries the wait). A bare
|
|
2392
|
-
* `resource_limit` continue with nothing parked does NOT take this refusal: it proceeds and
|
|
2393
|
-
* re-suspends at turn 0 into a FRESH checkpoint carrying the new wait hint. */
|
|
2394
|
-
| "resume.usage_window_exhausted"
|
|
2395
|
-
/** #449 G2 (identity continuity): the resume config carries a NON-EMPTY `principal` that differs from
|
|
2396
|
-
* the {@link Checkpoint.principal} recorded at the suspend mint. `ResumeTaskConfig`'s contract is
|
|
2397
|
-
* "the same TaskSpec the run suspended with", and the principal keys real lanes on the resumed leg
|
|
2398
|
-
* (the usage-governance ledger bucket, later mints' scope derivation, session-rule reads, ask
|
|
2399
|
-
* attribution) — silently running the leg under a different identity is the bad-value direction this
|
|
2400
|
-
* refusal exists to close. Rejected PRE-CAS (the checkpoint stays `pending`); re-resume with the
|
|
2401
|
-
* original principal, or omit the field to inherit the recorded one. */
|
|
2402
|
-
| "resume.principal_mismatch"
|
|
2403
|
-
/** design/380 O1③ (placement identity continuity — the `resume.principal_mismatch` rung's twin
|
|
2404
|
-
* on the placement axis): the resume supplied trusted internals whose EXPLICIT
|
|
2405
|
-
* `placementRoot` differs from the {@link CheckpointState.placementRootSessionId} recorded at
|
|
2406
|
-
* the suspend mint. A target-bound env factory keys its placement lookup on that fixed point,
|
|
2407
|
-
* so silently resuming under a different one would re-place the leg — and every descendant
|
|
2408
|
-
* the child-internals chain hands it to — on another target than the parked workspace lives
|
|
2409
|
-
* on. A supplied `rootSessionId` deliberately does NOT take this refusal: it is
|
|
2410
|
-
* delegation identity, re-supplied by every revive leg, and legitimately differs from the
|
|
2411
|
-
* recorded root whenever the spawner carried an explicit placement — the recorded root simply
|
|
2412
|
-
* outranks it in prepare's restore fold. Rejected PRE-CAS (the checkpoint stays `pending`);
|
|
2413
|
-
* re-resume with the recorded root, or omit `internals.placementRoot` to inherit it. Either
|
|
2414
|
-
* side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
|
|
2415
|
-
* — the honest degradation arm. */
|
|
2416
|
-
| "resume.placement_mismatch"
|
|
2417
|
-
/** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
|
|
2418
|
-
* explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
|
|
2419
|
-
* answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
|
|
2420
|
-
* discriminated by the message: the default `retry_later` arm leaves the checkpoint `pending`
|
|
2421
|
-
* and the SAME token redeemable once the obstacle clears (`detail.retryAfterMs` carries the
|
|
2422
|
-
* deployment's wait hint when it gave one — the #449 G1 carrier); the explicit `terminal` arm
|
|
2423
|
-
* has ALREADY settled the row out of `pending` via the single-shot `expire` CAS (reaper
|
|
2424
|
-
* parity) before this throw — the token is NOT redeemable, by the deployment's own permanent
|
|
2425
|
-
* verdict (a dead binding must not be redialed forever). */
|
|
2426
|
-
| "resume.preflight_rejected"
|
|
2427
|
-
/** The resume carried a claim holder ({@link ResolveExpectation.holder}) and lost its CAS while the row is still the one it
|
|
2428
|
-
* validated — same scope, `pending`, the same generation — so the holder was not the deployment's current grant: nothing was
|
|
2429
|
-
* applied and the row is unchanged by this resume. The run is superseded; do not retry it (the current holder delivers).
|
|
2430
|
-
* Read off the CAS's own loss answer on `claimTerminal`; on the two-step route off its diagnostic read (a later instant —
|
|
2431
|
-
* under a race the row's later state answers instead, fail-closed either way). */
|
|
2432
|
-
| "resume.holder_superseded"
|
|
2433
|
-
/** F-012 L3: the resume carried an approver EDIT (`updatedInput`) and a FROZEN inherited ancestor
|
|
2434
|
-
* constraint (the persisted projection chain) — or the deployment's resume-edit policy — DENIES the
|
|
2435
|
-
* 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
|
|
2436
|
-
* the same token remains decidable (approve as shown, deny, or edit differently) — the rejection
|
|
2437
|
-
* consumed the decision's INPUT, never the ask itself. */
|
|
2438
|
-
| "resume.constraint_rejected"
|
|
2439
|
-
/** F-012 L3: the resume carried an approver EDIT but the inherited ancestor chain cannot be
|
|
2440
|
-
* re-adjudicated statically — an OPAQUE layer is present, a layer declares a live remainder beyond
|
|
2441
|
-
* its projection, or the checkpoint predates the projection chain. "Would have been allowed" is not
|
|
2442
|
-
* computable from a self-reported closure, so the edited resume is refused typed pre-CAS (the
|
|
2443
|
-
* checkpoint stays `pending`, still decidable); an UNEDITED approval is untouched. */
|
|
2444
|
-
| "resume.constraint_unprojectable";
|
|
2445
|
-
/** Structured discrimination a caller can branch on where the code alone is ambiguous. `field`
|
|
2446
|
-
* names WHICH part of the decision payload was rejected on a
|
|
2447
|
-
* `checkpoint.invalid_outcome` — `"boundCallId"` (the action you decided on has been replaced:
|
|
2448
|
-
* re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
|
|
2449
|
-
* 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
|
|
2450
|
-
* decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
|
|
2451
|
-
* `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
|
|
2452
|
-
* `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
|
|
2453
|
-
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2454
|
-
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2455
|
-
* 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,
|
|
2456
|
-
* 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
|
|
2457
|
-
* 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
|
|
2458
|
-
* 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
|
|
2459
|
-
* 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"`
|
|
2460
|
-
* (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
|
|
2461
|
-
* 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
|
|
2462
|
-
* sites always knew which arm fired; this carries that fact instead of dropping it (ruled
|
|
2463
|
-
* 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
|
|
2464
|
-
* discriminant. */
|
|
2465
|
-
readonly detail?: {
|
|
2466
|
-
field?: CheckpointErrorField;
|
|
2467
|
-
/** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
|
|
2468
|
-
* word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
|
|
2469
|
-
code?: CheckpointConfigRefusalCode;
|
|
2470
|
-
/** #449 G1 — on `resume.usage_window_exhausted`: how long until the binding window frees
|
|
2471
|
-
* (the same wait a suspended row carries as `gate.resumeAfterMs`). design/380 O2 — on a
|
|
2472
|
-
* retry-later `resume.preflight_rejected`: the deployment preflight's own wait hint, when it
|
|
2473
|
-
* gave one (same carrier, same semantics: retry the SAME token after the wait). Absent on
|
|
2474
|
-
* every other code. */
|
|
2475
|
-
retryAfterMs?: number;
|
|
2476
|
-
/** WHICH arm fired, where one `code` covers several — the word list and what each word means to a
|
|
2477
|
-
* host live at {@link CheckpointErrorReason}, its one home. Additive and optional like `field`
|
|
2478
|
-
* (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
|
|
2479
|
-
* is a gate rather than a type: see the closed set's own doc. */
|
|
2480
|
-
reason?: CheckpointErrorReason;
|
|
2481
|
-
/** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
|
|
2482
|
-
* (sorted, display only). Absent on every other arm. */
|
|
2483
|
-
requires?: readonly string[];
|
|
2484
|
-
/** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
|
|
2485
|
-
* {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
|
|
2486
|
-
* every other code. The live verb's refusal carries the same value. */
|
|
2487
|
-
differs?: readonly SteerReplayFacet[];
|
|
2488
|
-
/** On `resume.constraint_rejected` ⇔ the resume-edit policy accepts the person's edit only rewritten: `acceptableForm`
|
|
2489
|
-
* is that form, the outlet a host may offer; a decide carrying it as `updatedInput` runs exactly those bytes. */
|
|
2490
|
-
editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
|
|
2491
|
-
} | undefined;
|
|
2492
|
-
constructor(code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
|
|
2493
|
-
/** `runner.resume` was handed an {@link ResumeOutcome} whose `gate` arm does not match the
|
|
2494
|
-
* persisted {@link CheckpointGate} `kind` (council #3 — type confusion guard), or a gate v1
|
|
2495
|
-
* resume does not serve (`task_done`). */
|
|
2496
|
-
| "checkpoint.gate_mismatch"
|
|
2497
|
-
/** The resume's `TaskSpec.signal` was aborted at the entrance — handed in ALREADY-ABORTED, or aborted
|
|
2498
|
-
* while the wake screen / `resumePreflight` / pre-claim re-adjudication still ran: ONE code for a
|
|
2499
|
-
* cancellation there (the seats' own codes keep what the hook itself did). Refused BEFORE the CAS, so
|
|
2500
|
-
* the checkpoint stays `pending`; consuming the decision on a leg that aborts at once would lose it. */
|
|
2501
|
-
| "checkpoint.resume_aborted"
|
|
2502
|
-
/** `runner.resume` was handed an outcome whose payload is unsafe to apply — e.g. a deny `reason`
|
|
2503
|
-
* carrying a `</system-reminder>` tag that would escape the model-facing wrapper (round-2 #1). */
|
|
2504
|
-
| "checkpoint.invalid_outcome"
|
|
2505
|
-
/** The checkpoint's {@link Checkpoint.version} is newer than this worker supports
|
|
2506
|
-
* (`> MAX_SUPPORTED_CHECKPOINT_VERSION`), or it carries a remote `workspaceHandle` but no
|
|
2507
|
-
* `executionEnvFactory` is wired to rebuild the env — either way this worker cannot safely resume it.
|
|
2508
|
-
* Rejected pre-CAS so the checkpoint stays `pending` and a capable worker can still resume it
|
|
2509
|
-
* (design/49 §2/§3, code-ready council round-2). */
|
|
2510
|
-
| "checkpoint.unsupported_version"
|
|
2511
|
-
/** The resume's re-supplied config, or a mode the checkpoint row recorded, is one prepare would refuse
|
|
2512
|
-
* (a retired spec key, a malformed output style, a mode word outside the closed set, a retired shell-floor
|
|
2513
|
-
* word). Refused PRE-CAS, so the checkpoint stays `pending` and byte-identical. `message` is prepare's own
|
|
2514
|
-
* sentence; `detail.code` is prepare's own code ({@link CheckpointConfigRefusalCode}) and `detail.field`
|
|
2515
|
-
* says which input carries it: `"taskConfig"` (correct the config and resume the SAME token) or
|
|
2516
|
-
* `"inheritedGate"` (the recorded row — no config reaches it; expire the row). A fresh run of the same
|
|
2517
|
-
* bad config reports the same `detail.code` as its `TaskResult.errorCode`. */
|
|
2518
|
-
| "checkpoint.config_refused"
|
|
2519
|
-
/** `resume`/`resumeStream` was handed `internals.requestedCwd` for a checkpoint that
|
|
2520
|
-
* carries a remote `workspaceHandle`. The restored workspace's mountPath is authoritative for the
|
|
2521
|
-
* task root, so the cwd would be ignored at best — and verifying it would touch the env BEFORE the
|
|
2522
|
-
* VM restore (a lazy-connect adapter then connects a fresh empty sandbox, the design/49 disease).
|
|
2523
|
-
* Rejected pre-CAS so the checkpoint stays `pending`; re-resume without `requestedCwd`. */
|
|
2524
|
-
| "checkpoint.cwd_conflicts_restore"
|
|
2525
|
-
/** design/164: the checkpoint was written by a pre-164 worker AND its ledger carries the RETIRED
|
|
2526
|
-
* cross-slice wall-clock allocation (`resourceLedger.totalWalltimeSec`). The axis no longer exists,
|
|
2527
|
-
* so resuming would run the leg with the operator's time ceiling silently unenforced. Refused
|
|
2528
|
-
* PRE-CAS (the row stays `pending`, so a worker of the previous release can still finish it) rather
|
|
2529
|
-
* than migrated: there is no honest conversion from a wall-clock allocation to a token one. */
|
|
2530
|
-
| "checkpoint.walltime_axis_retired"
|
|
2531
|
-
/** design/80 D-1 (reopen-by-reason): a re-resume of an `env_failed`-reopened checkpoint supplied an
|
|
2532
|
-
* outcome that does NOT equal the persisted {@link ResolvedOutcome} winner. An `env_failed` reopen is
|
|
2533
|
-
* a SYSTEM RETRY of the already-approved action (the infra failed, not the decision) — it must replay
|
|
2534
|
-
* the exact winning binding, never a new vote. Rejected pre-CAS, fail-closed, so the checkpoint stays
|
|
2535
|
-
* `pending` for the correctly-replayed retry. (A `tool_unavailable` reopen — P-7 — is exempt: it lets
|
|
2536
|
-
* a human re-decide with the tool present, so a fresh decision is permitted there.) */
|
|
2537
|
-
| "checkpoint.reopen_revote"
|
|
2538
|
-
/** design/80 D-1 (atomicity fix): the resume validated its decision-action / reopen-by-reason guards
|
|
2539
|
-
* against a `get()` snapshot, but a concurrent {@link CheckpointStore.resolve}/{@link CheckpointStore.reopen}
|
|
2540
|
-
* cycle advanced the monotonic {@link Checkpoint.rev} in the get→resolve window, so the
|
|
2541
|
-
* {@link CheckpointStore.resolve} CAS's optimistic-concurrency check lost (the validation is stale). The
|
|
2542
|
-
* row is still `pending` — fail-closed; the caller must re-`get` and re-validate against the CURRENT state
|
|
2543
|
-
* (a fresh resume), never blindly retry. */
|
|
2544
|
-
| "checkpoint.reopened_concurrently"
|
|
2545
|
-
/** A post-CAS compensation {@link CheckpointStore.reopen} returned `false` — the consumed row could not
|
|
2546
|
-
* be flipped back to `pending` (missing, expired, or changed under a concurrent cycle), so no retryable
|
|
2547
|
-
* checkpoint exists. Surfaced instead of silently treating the failed reopen as committed, so the
|
|
2548
|
-
* caller's compensation path settles the token as terminally consumed. */
|
|
2549
|
-
| "checkpoint.reopen_failed"
|
|
2550
|
-
/** {@link CheckpointStore.recordExecutionOutcome} met a row that already carries a DIFFERENT
|
|
2551
|
-
* execution record — see `ExecutionOutcomeConflictError` (checkpoint-execution-record.ts), the
|
|
2552
|
-
* in-tree form of this code. Never a retry condition. */
|
|
2553
|
-
| "checkpoint.execution_outcome_conflict"
|
|
2554
|
-
/** design/80 D-A: {@link CheckpointStore.setPendingSteer} was handed `text` containing a
|
|
2555
|
-
* `</system-reminder>` close tag — it would escape the model-facing `<system-reminder>` wrapper a
|
|
2556
|
-
* trusted steer rides on resume. Rejected fail-closed so a dirty steer NEVER enters {@link CheckpointState}
|
|
2557
|
-
* (§3 inv #2). Mirrors the trusted-steer reject at runtask.ts (`steering.invalid_content`). */
|
|
2558
|
-
| "steering.invalid_content"
|
|
2559
|
-
/** design/171 §6.3: the append would cross the parked-steer queue's entry-count or byte bound
|
|
2560
|
-
* ({@link MAX_PENDING_STEER_ENTRIES} / {@link PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES}). Fail-loud
|
|
2561
|
-
* rather than evicting: an already-accepted operator instruction is never dropped to make room —
|
|
2562
|
-
* the caller delivers or removes a parked steer first. Nothing is written on this path. */
|
|
2563
|
-
| "steering.queue_full"
|
|
2564
|
-
/** design/171 §6.3 (falsification review adoption): the append reused an `inputId` already parked on
|
|
2565
|
-
* this checkpoint, but with DIFFERENT content. Re-appending an IDENTICAL steer stays the idempotent
|
|
2566
|
-
* no-op a retry needs; a differing one is refused, because swallowing it would lose the second
|
|
2567
|
-
* operator's instruction — the exact silent loss the queue replaced. `detail.differs` names the facets
|
|
2568
|
-
* that differ: with `text` among them it is another instruction (retry it under a fresh id); without,
|
|
2569
|
-
* it is the parked one re-sent at another tier / trust / attribution (a fresh id would park it twice —
|
|
2570
|
-
* replay it with its original values). Nothing is written on this path. */
|
|
2571
|
-
| "steering.duplicate_input_id"
|
|
2572
|
-
/** design/373 §4.3 (D2): the deployment's `userPromptSubmit` hook refused a wake resume's
|
|
2573
|
-
* `message` at the entrance screen (block verdict, or a fail-closed timeout/crash — the
|
|
2574
|
-
* message discriminates). Pre-CAS: the checkpoint stays `pending` and byte-identical, so the
|
|
2575
|
-
* SAME token is redeemable once the screen clears — a refusal burns nothing. The live steer
|
|
2576
|
-
* verb refuses under the same code word (its own Error face); one vocabulary, two entrances. */
|
|
2577
|
-
| "steering.blocked_by_hook"
|
|
2578
|
-
/** design/144 §3 (governance-gate purity, fail-closed pre-CAS): a `wake` outcome was supplied for a
|
|
2579
|
-
* checkpoint that awaits a PENDING GATE DECISION (tool approval / dry-run review / plan review /
|
|
2580
|
-
* resource-limit continue). Wake is a pure un-park verb and must never circumvent an approval — resume
|
|
2581
|
-
* the checkpoint through its own decide entry instead (the error message names it). */
|
|
2582
|
-
| "wake.gate_pending"
|
|
2583
|
-
/** design/144 §3 (anti spin-wake): a `wake` outcome carried no `message` and the checkpoint has no
|
|
2584
|
-
* parked steer either — there is nothing to deliver, so the wake is rejected pre-CAS
|
|
2585
|
-
* (the checkpoint stays pending) instead of burning the token on an empty continuation. */
|
|
2586
|
-
| "wake.nothing_to_deliver"
|
|
2587
|
-
/** Parent effective-policy inheritance: the checkpoint records `state.inheritedGate.requiresParentConstraint`
|
|
2588
|
-
* (the suspended task ran under inherited OPAQUE parent-policy constraints — live closures that cannot
|
|
2589
|
-
* persist), but the resume supplied no `RunInternals.inheritedGate.parentConstraints` to re-instate them.
|
|
2590
|
-
* Resuming anyway would silently DROP the ancestors' gate (a widening), so this rejects pre-CAS — the
|
|
2591
|
-
* checkpoint stays `pending`; re-resume via `resumeStream(token, outcome, config, internals)` with the
|
|
2592
|
-
* parent chain re-supplied. */
|
|
2593
|
-
| "resume.parent_constraint_missing"
|
|
2594
|
-
/** Parent effective-policy inheritance (shape check): the resume DID re-supply
|
|
2595
|
-
* `internals.inheritedGate.parentConstraints`, but its length differs from the checkpoint's recorded
|
|
2596
|
-
* `parentConstraintCount` — or (F-012 L1) its projection CONTENT digests differently from the
|
|
2597
|
-
* recorded `constraintDigest` — or a screening entry names a `tool.check` guard beside a policy the
|
|
2598
|
-
* constraint mint did not make (no chain to raise it on) — a partial/mismatched re-supply would silently run
|
|
2599
|
-
* the child under a thinner (or different) ancestor chain than it suspended with. Rejected pre-CAS (the
|
|
2600
|
-
* checkpoint stays `pending`); re-resume with the full original chain. */
|
|
2601
|
-
| "resume.parent_constraint_mismatch"
|
|
2602
|
-
/** #449 G1 (codex r2, pre-CAS entrance): a deployment usage-governance window for this resume's
|
|
2603
|
-
* ledger key (the config's principal, else the row's recorded one, else the shared bucket) is
|
|
2604
|
-
* EXHAUSTED, and the row still OWES a delivery a re-mint cannot carry (an approval/review
|
|
2605
|
-
* decision, a wake, parked steers, a background-task obituary snapshot). Refused BEFORE the CAS,
|
|
2606
|
-
* so nothing is consumed and nothing is unpinned — the SAME token with the SAME decision is
|
|
2607
|
-
* redeemable once the window frees (`detail.retryAfterMs` carries the wait). A bare
|
|
2608
|
-
* `resource_limit` continue with nothing parked does NOT take this refusal: it proceeds and
|
|
2609
|
-
* re-suspends at turn 0 into a FRESH checkpoint carrying the new wait hint. */
|
|
2610
|
-
| "resume.usage_window_exhausted"
|
|
2611
|
-
/** #449 G2 (identity continuity): the resume config carries a NON-EMPTY `principal` that differs from
|
|
2612
|
-
* the {@link Checkpoint.principal} recorded at the suspend mint. `ResumeTaskConfig`'s contract is
|
|
2613
|
-
* "the same TaskSpec the run suspended with", and the principal keys real lanes on the resumed leg
|
|
2614
|
-
* (the usage-governance ledger bucket, later mints' scope derivation, session-rule reads, ask
|
|
2615
|
-
* attribution) — silently running the leg under a different identity is the bad-value direction this
|
|
2616
|
-
* refusal exists to close. Rejected PRE-CAS (the checkpoint stays `pending`); re-resume with the
|
|
2617
|
-
* original principal, or omit the field to inherit the recorded one. */
|
|
2618
|
-
| "resume.principal_mismatch"
|
|
2619
|
-
/** design/380 O1③ (placement identity continuity — the `resume.principal_mismatch` rung's twin
|
|
2620
|
-
* on the placement axis): the resume supplied trusted internals whose EXPLICIT
|
|
2621
|
-
* `placementRoot` differs from the {@link CheckpointState.placementRootSessionId} recorded at
|
|
2622
|
-
* the suspend mint. A target-bound env factory keys its placement lookup on that fixed point,
|
|
2623
|
-
* so silently resuming under a different one would re-place the leg — and every descendant
|
|
2624
|
-
* the child-internals chain hands it to — on another target than the parked workspace lives
|
|
2625
|
-
* on. A supplied `rootSessionId` deliberately does NOT take this refusal: it is
|
|
2626
|
-
* delegation identity, re-supplied by every revive leg, and legitimately differs from the
|
|
2627
|
-
* recorded root whenever the spawner carried an explicit placement — the recorded root simply
|
|
2628
|
-
* outranks it in prepare's restore fold. Rejected PRE-CAS (the checkpoint stays `pending`);
|
|
2629
|
-
* re-resume with the recorded root, or omit `internals.placementRoot` to inherit it. Either
|
|
2630
|
-
* side absent (an older row / a claim-less resume) skips the check, and `""` reads as absence
|
|
2631
|
-
* — the honest degradation arm. */
|
|
2632
|
-
| "resume.placement_mismatch"
|
|
2633
|
-
/** design/380 O2: the deployment's `RunnerDeps.resumePreflight` refused this resume — an
|
|
2634
|
-
* explicit refusal verdict, a throw, a timeout past its bounded deadline, or an unreadable
|
|
2635
|
-
* answer (all fail-closed). The LAST rung before the CAS, so nothing was consumed. Two arms,
|
|
2636
|
-
* discriminated by the message: the default `retry_later` arm leaves the checkpoint `pending`
|
|
2637
|
-
* and the SAME token redeemable once the obstacle clears (`detail.retryAfterMs` carries the
|
|
2638
|
-
* deployment's wait hint when it gave one — the #449 G1 carrier); the explicit `terminal` arm
|
|
2639
|
-
* has ALREADY settled the row out of `pending` via the single-shot `expire` CAS (reaper
|
|
2640
|
-
* parity) before this throw — the token is NOT redeemable, by the deployment's own permanent
|
|
2641
|
-
* verdict (a dead binding must not be redialed forever). */
|
|
2642
|
-
| "resume.preflight_rejected"
|
|
2643
|
-
/** The resume carried a claim holder ({@link ResolveExpectation.holder}) and lost its CAS while the row is still the one it
|
|
2644
|
-
* validated — same scope, `pending`, the same generation — so the holder was not the deployment's current grant: nothing was
|
|
2645
|
-
* applied and the row is unchanged by this resume. The run is superseded; do not retry it (the current holder delivers).
|
|
2646
|
-
* Read off the CAS's own loss answer on `claimTerminal`; on the two-step route off its diagnostic read (a later instant —
|
|
2647
|
-
* under a race the row's later state answers instead, fail-closed either way). */
|
|
2648
|
-
| "resume.holder_superseded"
|
|
2649
|
-
/** F-012 L3: the resume carried an approver EDIT (`updatedInput`) and a FROZEN inherited ancestor
|
|
2650
|
-
* constraint (the persisted projection chain) — or the deployment's resume-edit policy — DENIES the
|
|
2651
|
-
* 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
|
|
2652
|
-
* the same token remains decidable (approve as shown, deny, or edit differently) — the rejection
|
|
2653
|
-
* consumed the decision's INPUT, never the ask itself. */
|
|
2654
|
-
| "resume.constraint_rejected"
|
|
2655
|
-
/** F-012 L3: the resume carried an approver EDIT but the inherited ancestor chain cannot be
|
|
2656
|
-
* re-adjudicated statically — an OPAQUE layer is present, a layer declares a live remainder beyond
|
|
2657
|
-
* its projection, or the checkpoint predates the projection chain. "Would have been allowed" is not
|
|
2658
|
-
* computable from a self-reported closure, so the edited resume is refused typed pre-CAS (the
|
|
2659
|
-
* checkpoint stays `pending`, still decidable); an UNEDITED approval is untouched. */
|
|
2660
|
-
| "resume.constraint_unprojectable", message: string,
|
|
2661
|
-
/** Structured discrimination a caller can branch on where the code alone is ambiguous. `field`
|
|
2662
|
-
* names WHICH part of the decision payload was rejected on a
|
|
2663
|
-
* `checkpoint.invalid_outcome` — `"boundCallId"` (the action you decided on has been replaced:
|
|
2664
|
-
* re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
|
|
2665
|
-
* 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
|
|
2666
|
-
* decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
|
|
2667
|
-
* `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
|
|
2668
|
-
* `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
|
|
2669
|
-
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2670
|
-
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2671
|
-
* 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,
|
|
2672
|
-
* 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
|
|
2673
|
-
* 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
|
|
2674
|
-
* 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
|
|
2675
|
-
* 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"`
|
|
2676
|
-
* (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
|
|
2677
|
-
* 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
|
|
2678
|
-
* sites always knew which arm fired; this carries that fact instead of dropping it (ruled
|
|
2679
|
-
* 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
|
|
2680
|
-
* discriminant. */
|
|
2681
|
-
detail?: {
|
|
2682
|
-
field?: CheckpointErrorField;
|
|
2683
|
-
/** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
|
|
2684
|
-
* word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
|
|
2685
|
-
code?: CheckpointConfigRefusalCode;
|
|
2686
|
-
/** #449 G1 — on `resume.usage_window_exhausted`: how long until the binding window frees
|
|
2687
|
-
* (the same wait a suspended row carries as `gate.resumeAfterMs`). design/380 O2 — on a
|
|
2688
|
-
* retry-later `resume.preflight_rejected`: the deployment preflight's own wait hint, when it
|
|
2689
|
-
* gave one (same carrier, same semantics: retry the SAME token after the wait). Absent on
|
|
2690
|
-
* every other code. */
|
|
2691
|
-
retryAfterMs?: number;
|
|
2692
|
-
/** WHICH arm fired, where one `code` covers several — the word list and what each word means to a
|
|
2693
|
-
* host live at {@link CheckpointErrorReason}, its one home. Additive and optional like `field`
|
|
2694
|
-
* (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
|
|
2695
|
-
* is a gate rather than a type: see the closed set's own doc. */
|
|
2696
|
-
reason?: CheckpointErrorReason;
|
|
2697
|
-
/** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
|
|
2698
|
-
* (sorted, display only). Absent on every other arm. */
|
|
2699
|
-
requires?: readonly string[];
|
|
2700
|
-
/** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
|
|
2701
|
-
* {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
|
|
2702
|
-
* every other code. The live verb's refusal carries the same value. */
|
|
2703
|
-
differs?: readonly SteerReplayFacet[];
|
|
2704
|
-
/** On `resume.constraint_rejected` ⇔ the resume-edit policy accepts the person's edit only rewritten: `acceptableForm`
|
|
2705
|
-
* is that form, the outlet a host may offer; a decide carrying it as `updatedInput` runs exactly those bytes. */
|
|
2706
|
-
editRewritten?: import("./rewrite-rejudge.js").EditRewritten;
|
|
2707
|
-
} | undefined);
|
|
2708
|
-
}
|
|
2117
|
+
export declare function summarizeStoredCheckpoint(cp: Checkpoint, memo: WeakMap<Checkpoint, CheckpointRowVerdict>, disclose?: (sentence: string) => void): CheckpointSummary;
|
|
2709
2118
|
/**
|
|
2710
2119
|
* The pluggable durable seam (design/45 §2.1). Symmetric with `ToolResultStore`/`MemoryStore`:
|
|
2711
2120
|
* create-once `put`, `get`, an **atomic CAS `resolve`** (the once-only foundation), and a `reap` for TTL
|
|
@@ -2759,7 +2168,8 @@ export type StoreDurability = "durable" | "process-local";
|
|
|
2759
2168
|
* backend (a `Date` comes back a `Date`, a `Map` a `Map`, `NaN` stays `NaN`); `"json"` states the
|
|
2760
2169
|
* backend serialises through JSON, so the row that comes back after a restart carries the JSON
|
|
2761
2170
|
* PROJECTION of what was filed (`Date` → string, `Map`/`Set` → `{}`, `NaN`/`Infinity` → `null`, `-0`
|
|
2762
|
-
* → `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).
|
|
2763
2173
|
*
|
|
2764
2174
|
* Why this has to be declared rather than inferred: the mint decides what a durable approval row may
|
|
2765
2175
|
* carry, and it decides it with `structuredClone` — which is WIDER than a JSON codec. A value can pass
|
|
@@ -2782,27 +2192,6 @@ export type StoreFidelity = "structured-clone" | "json";
|
|
|
2782
2192
|
export declare function resolveDeclaredFidelity(store: {
|
|
2783
2193
|
readonly fidelity?: StoreFidelity;
|
|
2784
2194
|
} | undefined, storeName: string): StoreFidelity;
|
|
2785
|
-
/**
|
|
2786
|
-
* Project an already-captured value onto what a backend of the given {@link StoreFidelity} can hold, so
|
|
2787
|
-
* everything minted from it — the row's args, the approval preview, the binding hash, the risk
|
|
2788
|
-
* descriptor — describes the value that comes BACK, not the one that went in.
|
|
2789
|
-
*
|
|
2790
|
-
* `"structured-clone"` is the identity: the caller's snapshot already is what such a backend stores.
|
|
2791
|
-
* `"json"` runs the backend's own codec (`JSON.stringify` → `JSON.parse`, `toJSON` hooks included, since
|
|
2792
|
-
* that is exactly what the backend will do to it). The input is expected to be an accessor-free snapshot
|
|
2793
|
-
* already, so no property is read a second time here.
|
|
2794
|
-
*
|
|
2795
|
-
* A value JSON cannot ENCODE AT ALL (a `BigInt`, a cycle) fails instead of degrading — those would throw
|
|
2796
|
-
* inside the backend's own write anyway, and failing here means the caller can say why while nothing has
|
|
2797
|
-
* been committed. The thrown value rides out on `cause` so the caller decides how to word the refusal.
|
|
2798
|
-
*/
|
|
2799
|
-
export declare function encodeAtFidelity(fidelity: StoreFidelity, value: unknown): {
|
|
2800
|
-
ok: true;
|
|
2801
|
-
value: unknown;
|
|
2802
|
-
} | {
|
|
2803
|
-
ok: false;
|
|
2804
|
-
cause: unknown;
|
|
2805
|
-
};
|
|
2806
2195
|
export interface CheckpointStore {
|
|
2807
2196
|
/**
|
|
2808
2197
|
* Managed-retention declaration (retention.ts), stated by the party that runs the sweep: `"managed"` says this store's
|
|
@@ -2973,8 +2362,8 @@ export interface CheckpointStore {
|
|
|
2973
2362
|
* **Load-bearing contract (design/51 §2/§4):** `expire` and {@link resolve} race the **same `pending`
|
|
2974
2363
|
* row**, so the store serializes them — exactly one wins. This is what makes {@link TaskStream.destroy}
|
|
2975
2364
|
* a correct *fence-then-reap*: `destroy` calls `expire` FIRST to fence any concurrent `resume` (which
|
|
2976
|
-
* goes through `resolve`); only the `
|
|
2977
|
-
* is **never both reaped and resumed**. `scope` is in the WHERE for multi-tenant isolation, like
|
|
2365
|
+
* goes through `resolve`); the paused env is destroyed only once the row is `expired` (this call won, or a loser
|
|
2366
|
+
* reads it so), so the same checkpoint is **never both reaped and resumed**. `scope` is in the WHERE for multi-tenant isolation, like
|
|
2978
2367
|
* `resolve`/`reap`.
|
|
2979
2368
|
*/
|
|
2980
2369
|
expire(token: CheckpointToken, scope: string): Promise<boolean>;
|
|
@@ -3168,11 +2557,9 @@ export declare const ACTOR_ASSERTION_FROZEN_FIELDS: readonly ["id", "hostAsserte
|
|
|
3168
2557
|
* Every consumer — the resume drain, the wake's nothing-to-deliver guard, a serving layer — goes through
|
|
3169
2558
|
* here, so no site can grow its own idea of what "the parked steer" is.
|
|
3170
2559
|
*
|
|
3171
|
-
* A row that still carries the RETIRED pre-queue single seat
|
|
3172
|
-
*
|
|
3173
|
-
*
|
|
3174
|
-
* with `reason: "seat_retired"` — terminal for the row's bytes; the host decides the parked instruction
|
|
3175
|
-
* 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.
|
|
3176
2563
|
*/
|
|
3177
2564
|
export declare function readPendingSteerQueue(state: Pick<CheckpointState, "pendingSteerQueue">): PendingSteerEntry[];
|
|
3178
2565
|
/**
|
|
@@ -3240,6 +2627,8 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
|
|
|
3240
2627
|
readonly holder: true;
|
|
3241
2628
|
};
|
|
3242
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;
|
|
3243
2632
|
private fault;
|
|
3244
2633
|
private readonly disclose;
|
|
3245
2634
|
private readonly holderIsCurrent;
|
|
@@ -3319,23 +2708,3 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
|
|
|
3319
2708
|
/** Test/inspection helper: number of stored checkpoints. */
|
|
3320
2709
|
get size(): number;
|
|
3321
2710
|
}
|
|
3322
|
-
/**
|
|
3323
|
-
* The ONE refusal of a retired mode seed, read PRE-CAS on every resume kind (resume-admission): a row whose `inheritedGate`
|
|
3324
|
-
* still carries a retired member is refused as the engine refuses every retired row seat (`readPendingSteerQueue`) —
|
|
3325
|
-
* `checkpoint.unsupported_version` with `reason: "seat_retired"` — terminal for the row's bytes on this engine, and
|
|
3326
|
-
* nothing consumed: the row stays byte-identical and `pending`. No engine reads the retired keys into a mode any more; an
|
|
3327
|
-
* engine at 7.38.x or earlier still does, so the row can be resumed there once (its next suspend writes `permissionMode`), or
|
|
3328
|
-
* expired (`CheckpointStore.expire`).
|
|
3329
|
-
*/
|
|
3330
|
-
export declare function refuseRetiredModeSeed(state: Pick<CheckpointState, "inheritedGate">): void;
|
|
3331
|
-
/**
|
|
3332
|
-
* The mode seed a row records (the 7.34.0 shape), read at prepare after {@link refuseRetiredModeSeed} has screened the row:
|
|
3333
|
-
* `permissionMode` must be a member of the closed set and `prePlanMode` a mode a plan can return to (else
|
|
3334
|
-
* `config.permission_mode_invalid`, the row cannot be resumed under a word this engine does not know); the shell floor is
|
|
3335
|
-
* `"always"` or absent. Nothing here migrates or guesses.
|
|
3336
|
-
*/
|
|
3337
|
-
export declare function recordedModeSeed(gate: Pick<NonNullable<CheckpointState["inheritedGate"]>, "permissionMode" | "prePlanMode" | "shellGate"> | undefined): {
|
|
3338
|
-
permissionMode?: PermissionMode;
|
|
3339
|
-
prePlanMode?: PermissionMode;
|
|
3340
|
-
shellGate?: ShellGateDoctrine;
|
|
3341
|
-
};
|