@sema-agent/core 7.47.0 → 7.49.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 +472 -0
- package/README.md +2 -2
- package/dist/agents/cascade.d.ts +2 -5
- package/dist/agents/child-failure.d.ts +20 -0
- package/dist/agents/child-failure.js +28 -0
- package/dist/agents/cross-session-ref.d.ts +11 -3
- package/dist/agents/cross-session-ref.js +6 -0
- package/dist/agents/cumulative-stats.d.ts +12 -15
- package/dist/agents/cumulative-stats.js +1 -1
- package/dist/agents/extra-tool-names.js +1 -1
- package/dist/agents/inherited-tool-pool.d.ts +17 -13
- package/dist/agents/inherited-tool-pool.js +4 -3
- package/dist/agents/peer-session-drain.d.ts +3 -2
- package/dist/agents/peer-session-drain.js +5 -4
- package/dist/agents/send-message-tool.js +2 -9
- package/dist/agents/subagent.d.ts +10 -29
- package/dist/agents/subagent.js +65 -53
- package/dist/agents/suspend-guard.d.ts +1 -1
- package/dist/agents/tool-filter.d.ts +76 -65
- package/dist/agents/tool-filter.js +122 -92
- package/dist/agents/verify.d.ts +4 -7
- package/dist/agents/verify.js +6 -7
- package/dist/bench/metrics.d.ts +1 -2
- package/dist/brain/anthropic.js +133 -79
- package/dist/brain/errors.d.ts +53 -6
- package/dist/brain/errors.js +22 -2
- package/dist/brain/input-too-long.d.ts +40 -19
- package/dist/brain/input-too-long.js +3 -16
- package/dist/brain/open-responses.js +19 -10
- package/dist/brain/openai.js +123 -32
- package/dist/brain/provider-dialect.d.ts +214 -0
- package/dist/brain/provider-dialect.js +186 -0
- package/dist/brain/request-params.d.ts +27 -8
- package/dist/brain/request-params.js +7 -12
- package/dist/brain/request-route.d.ts +84 -0
- package/dist/brain/request-route.js +41 -0
- package/dist/brain/retry.d.ts +8 -0
- package/dist/brain/retry.js +10 -4
- package/dist/brain/route-adjudicator.d.ts +7 -0
- package/dist/brain/route-adjudicator.js +5 -1
- package/dist/brain/status-sink.d.ts +20 -0
- package/dist/brain/status-sink.js +11 -0
- package/dist/brain/stream-engine.d.ts +52 -1
- package/dist/brain/stream-engine.js +81 -24
- package/dist/brain/stream-shared.d.ts +57 -11
- package/dist/brain/stream-shared.js +28 -2
- package/dist/core/a2a.d.ts +1 -0
- package/dist/core/agent-config-dir.js +3 -2
- package/dist/core/allow-entry.d.ts +21 -12
- package/dist/core/allow-entry.js +39 -32
- package/dist/core/arg-summary.d.ts +17 -24
- package/dist/core/arg-summary.js +169 -68
- package/dist/core/ask-origin.d.ts +42 -24
- package/dist/core/ask-origin.js +18 -13
- package/dist/core/auto-mode-prompt-assets.d.ts +2 -2
- package/dist/core/auto-mode-prompt-assets.js +1 -1
- package/dist/core/auto-mode-prompt.d.ts +11 -1
- package/dist/core/auto-mode-prompt.js +13 -10
- package/dist/core/auto-mode-rebuild.d.ts +7 -0
- package/dist/core/auto-mode-rebuild.js +4 -1
- package/dist/core/canonical-json.d.ts +3 -0
- package/dist/core/canonical-json.js +2 -1
- package/dist/core/checkpoint-requirements.d.ts +892 -0
- package/dist/core/checkpoint-requirements.js +333 -0
- package/dist/core/checkpoint-store.d.ts +95 -66
- package/dist/core/checkpoint-store.js +14 -26
- package/dist/core/child-clamp-seats.d.ts +228 -69
- package/dist/core/child-clamp-seats.js +211 -17
- package/dist/core/classifier-unavailable-arm.d.ts +5 -1
- package/dist/core/classifier-unavailable-arm.js +3 -3
- package/dist/core/compliance.d.ts +3 -0
- package/dist/core/compliance.js +9 -4
- package/dist/core/credential-vocabulary.d.ts +140 -0
- package/dist/core/credential-vocabulary.js +131 -0
- package/dist/core/decision-receipt.js +1 -1
- package/dist/core/effective-path-target.d.ts +73 -16
- package/dist/core/effective-path-target.js +63 -33
- package/dist/core/engine-notice.d.ts +32 -7
- package/dist/core/file-history-store.js +2 -2
- package/dist/core/fs-write-gate-policy.d.ts +4 -0
- package/dist/core/fs-write-gate-policy.js +22 -5
- package/dist/core/gate-bounded-await.d.ts +28 -13
- package/dist/core/gate-bounded-await.js +41 -4
- package/dist/core/gate-fold.d.ts +1 -1
- package/dist/core/gate-fold.js +24 -25
- package/dist/core/gate-lanes.js +16 -15
- package/dist/core/gate-outcome.d.ts +20 -5
- package/dist/core/gate-outcome.js +5 -0
- package/dist/core/governance-codes.d.ts +11 -4
- package/dist/core/governance-codes.js +14 -3
- package/dist/core/hooks.d.ts +4 -0
- package/dist/core/locked-config.d.ts +8 -0
- package/dist/core/locked-config.js +14 -2
- package/dist/core/lsp.js +3 -5
- package/dist/core/mailbox-store.d.ts +3 -4
- package/dist/core/mcp-connection-pool.d.ts +75 -0
- package/dist/core/mcp-connection-pool.js +128 -0
- package/dist/core/mcp-failure.d.ts +2 -1
- package/dist/core/mcp-failure.js +13 -2
- package/dist/core/mcp-server-spec.d.ts +1 -1
- package/dist/core/mcp.d.ts +4 -0
- package/dist/core/mcp.js +70 -43
- package/dist/core/memory-engine/content-origin.js +2 -14
- package/dist/core/memory-engine/engine.d.ts +32 -22
- package/dist/core/memory-engine/engine.js +103 -55
- package/dist/core/memory-engine/file-backend.d.ts +13 -30
- package/dist/core/memory-engine/file-backend.js +37 -252
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layout.d.ts +139 -9
- package/dist/core/memory-engine/layout.js +350 -7
- package/dist/core/memory-engine/scope-contract.d.ts +10 -0
- package/dist/core/memory-engine/scope-contract.js +8 -0
- package/dist/core/memory-engine/session-incarnation.d.ts +14 -4
- package/dist/core/memory-engine/session-incarnation.js +5 -2
- package/dist/core/memory-engine/types.d.ts +10 -1
- package/dist/core/memory.js +5 -17
- package/dist/core/model-seat.d.ts +4 -4
- package/dist/core/model-seat.js +1 -1
- package/dist/core/mounted-mcp.d.ts +57 -0
- package/dist/core/mounted-mcp.js +19 -0
- package/dist/core/namespaced-rule-name.d.ts +29 -0
- package/dist/core/namespaced-rule-name.js +52 -0
- package/dist/core/park-selfcheck.d.ts +1 -1
- package/dist/core/park-selfcheck.js +16 -6
- package/dist/core/path-guard-rows.d.ts +99 -0
- package/dist/core/path-guard-rows.js +45 -0
- package/dist/core/path-identity.d.ts +22 -16
- package/dist/core/path-identity.js +10 -10
- package/dist/core/path-rule-binding.d.ts +2 -1
- package/dist/core/path-rule-binding.js +3 -1
- package/dist/core/pause-registry.d.ts +16 -2
- package/dist/core/pause-registry.js +6 -0
- package/dist/core/permission-rule-consent.js +0 -7
- package/dist/core/permission-rule-model.d.ts +68 -24
- package/dist/core/permission-rule-model.js +105 -24
- package/dist/core/permission-rule-store.js +2 -2
- package/dist/core/permission-rules.d.ts +3 -30
- package/dist/core/permission-rules.js +4 -54
- package/dist/core/read-root-candidate.d.ts +1 -3
- package/dist/core/read-root-candidate.js +4 -15
- package/dist/core/real-approval.d.ts +4 -3
- package/dist/core/retired-keys.d.ts +13 -0
- package/dist/core/retired-keys.js +14 -0
- package/dist/core/roles.d.ts +2 -3
- package/dist/core/roles.js +15 -6
- package/dist/core/runner/assemble-result.d.ts +0 -7
- package/dist/core/runner/assemble-result.js +19 -31
- package/dist/core/runner/caller-roster.d.ts +78 -0
- package/dist/core/runner/caller-roster.js +219 -0
- package/dist/core/runner/checkpoint-scope.d.ts +16 -16
- package/dist/core/runner/checkpoint-scope.js +2 -2
- package/dist/core/runner/child-tree.js +2 -2
- package/dist/core/runner/contracts.d.ts +68 -35
- package/dist/core/runner/decide-continuation.d.ts +51 -3
- package/dist/core/runner/decide-continuation.js +76 -21
- package/dist/core/runner/denial-limit-arms.d.ts +17 -5
- package/dist/core/runner/denial-limit-arms.js +11 -9
- package/dist/core/runner/extra-body-dropped-seat.d.ts +8 -0
- package/dist/core/runner/extra-body-dropped-seat.js +22 -0
- package/dist/core/runner/finish-reason-seat.d.ts +9 -0
- package/dist/core/runner/finish-reason-seat.js +40 -0
- package/dist/core/runner/gate-exit.d.ts +44 -32
- package/dist/core/runner/gate-exit.js +112 -25
- package/dist/core/runner/inherited-ask-grants.js +6 -4
- package/dist/core/runner/mcp-redial.d.ts +3 -3
- package/dist/core/runner/mcp-redial.js +3 -4
- package/dist/core/runner/park-commit.d.ts +1 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +1 -2
- package/dist/core/runner/permission-rule-lanes.js +5 -4
- package/dist/core/runner/prepare-artifact.d.ts +4 -0
- package/dist/core/runner/prepare-artifact.js +2 -1
- package/dist/core/runner/prepare-ask-lane.d.ts +2 -0
- package/dist/core/runner/prepare-ask-lane.js +12 -6
- package/dist/core/runner/prepare-boundary-parks.d.ts +5 -8
- package/dist/core/runner/prepare-boundary-parks.js +4 -7
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +11 -15
- package/dist/core/runner/prepare-caps-and-workflow.js +19 -27
- package/dist/core/runner/prepare-config-doors.d.ts +9 -9
- package/dist/core/runner/prepare-config-doors.js +10 -5
- package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
- package/dist/core/runner/prepare-defer-classify.js +5 -3
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-delegation-surface.js +3 -3
- package/dist/core/runner/prepare-gate-stations.d.ts +4 -4
- package/dist/core/runner/prepare-gate-stations.js +9 -7
- package/dist/core/runner/prepare-hands-readface.d.ts +7 -7
- package/dist/core/runner/prepare-hands-readface.js +7 -7
- package/dist/core/runner/prepare-inherited-gate.d.ts +7 -6
- package/dist/core/runner/prepare-inherited-gate.js +14 -15
- package/dist/core/runner/prepare-listings.d.ts +7 -24
- package/dist/core/runner/prepare-listings.js +4 -5
- package/dist/core/runner/prepare-memory-engine-session.d.ts +2 -0
- package/dist/core/runner/prepare-memory-engine-session.js +4 -3
- package/dist/core/runner/prepare-memory.d.ts +6 -0
- package/dist/core/runner/prepare-memory.js +13 -13
- package/dist/core/runner/prepare-offload-wrappers.d.ts +5 -0
- package/dist/core/runner/prepare-offload-wrappers.js +3 -3
- package/dist/core/runner/prepare-park-ask.d.ts +7 -8
- package/dist/core/runner/prepare-park-ask.js +17 -10
- package/dist/core/runner/prepare-policy-chain.js +24 -44
- package/dist/core/runner/prepare-project-context.d.ts +1 -1
- package/dist/core/runner/prepare-project-context.js +3 -4
- package/dist/core/runner/prepare-protocol-tools.d.ts +9 -3
- package/dist/core/runner/prepare-protocol-tools.js +3 -4
- package/dist/core/runner/prepare-run-refs.d.ts +3 -0
- package/dist/core/runner/prepare-run-refs.js +2 -1
- package/dist/core/runner/prepare-safety-scan.d.ts +4 -8
- package/dist/core/runner/prepare-safety-scan.js +1 -2
- package/dist/core/runner/prepare-suspend-saga.d.ts +7 -1
- package/dist/core/runner/prepare-suspend-saga.js +28 -12
- package/dist/core/runner/prepare-task.d.ts +1 -1
- package/dist/core/runner/prepare-task.js +67 -56
- package/dist/core/runner/prepare-wiring-manifest.d.ts +11 -10
- package/dist/core/runner/prepare-wiring-manifest.js +5 -8
- package/dist/core/runner/resume-apply.js +7 -14
- package/dist/core/runner/resume-checkpoint-screen.js +11 -4
- package/dist/core/runner/resume-internals-and-config.js +2 -2
- package/dist/core/runner/resume-policy-outcome.js +5 -32
- package/dist/core/runner/resume-review-outcome.js +4 -1
- package/dist/core/runner/retired-runner-deps.d.ts +6 -0
- package/dist/core/runner/retired-runner-deps.js +10 -1
- package/dist/core/runner/run-brain-sinks.d.ts +4 -0
- package/dist/core/runner/run-brain-sinks.js +5 -2
- package/dist/core/runner/run-harness-handlers.js +27 -34
- package/dist/core/runner/run-leg.d.ts +0 -2
- package/dist/core/runner/run-leg.js +32 -33
- package/dist/core/runner/run-terminal-adoption.js +4 -3
- package/dist/core/runner/runtask.js +8 -8
- package/dist/core/runner/session-rule-policy.js +5 -5
- package/dist/core/runner/stream-settle-backstop.js +7 -4
- package/dist/core/runner/sub-agent-deny-lists.d.ts +51 -12
- package/dist/core/runner/sub-agent-deny-lists.js +111 -80
- package/dist/core/runner/terminal-account.d.ts +48 -0
- package/dist/core/runner/terminal-account.js +186 -0
- package/dist/core/runner/tool-end-body.d.ts +54 -17
- package/dist/core/runner/tool-end-body.js +27 -2
- package/dist/core/runner/tool-face-overlay.d.ts +3 -1
- package/dist/core/runner/tool-face-overlay.js +6 -4
- package/dist/core/runner/tool-occurrence.d.ts +106 -0
- package/dist/core/runner/tool-occurrence.js +123 -0
- package/dist/core/runner/tool-progress-lane.d.ts +16 -8
- package/dist/core/runner/tool-progress-lane.js +25 -34
- package/dist/core/runner/turn-attachments.d.ts +1 -1
- package/dist/core/runner/write-protection-station.d.ts +21 -9
- package/dist/core/runner/write-protection-station.js +20 -17
- package/dist/core/runner-deps.d.ts +12 -22
- package/dist/core/safety-axis-vocab.d.ts +1 -1
- package/dist/core/safety-merge-corpus.d.ts +1 -1
- package/dist/core/secret-env.d.ts +16 -5
- package/dist/core/secret-env.js +23 -63
- package/dist/core/sensitive-path-policy.d.ts +19 -18
- package/dist/core/sensitive-path-policy.js +73 -49
- package/dist/core/session-policy-store.d.ts +6 -3
- package/dist/core/session-policy-store.js +28 -10
- package/dist/core/session-reconcile.d.ts +3 -0
- package/dist/core/session-reconcile.js +5 -4
- package/dist/core/session-store.d.ts +5 -0
- package/dist/core/session-store.js +12 -0
- package/dist/core/session.d.ts +13 -0
- package/dist/core/shared-memory/normalize.d.ts +17 -4
- package/dist/core/shared-memory/normalize.js +7 -7
- package/dist/core/shell-lexer.js +5 -4
- package/dist/core/shell-wrapper-table.d.ts +2 -2
- package/dist/core/shell-wrapper-table.js +1 -1
- package/dist/core/skill-grant.js +1 -1
- package/dist/core/store-contracts/checkpoint-store-contract.js +13 -0
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +7 -14
- package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +27 -0
- package/dist/core/store-contracts/session-store-incarnation-contract.js +92 -0
- package/dist/core/stub-env.d.ts +2 -0
- package/dist/core/stub-env.js +1 -0
- package/dist/core/synthetic-read-verdict.js +2 -2
- package/dist/core/task-event.d.ts +59 -5
- package/dist/core/task-result.d.ts +1 -1
- package/dist/core/task-spec.d.ts +42 -9
- package/dist/core/terminal-cause.d.ts +94 -11
- package/dist/core/tighten-task-spec.d.ts +5 -4
- package/dist/core/tighten-task-spec.js +20 -25
- package/dist/core/tool-catalog-entries.d.ts +5 -7
- package/dist/core/tool-catalog-entries.js +14 -15
- package/dist/core/tool-face.d.ts +47 -0
- package/dist/core/tool-face.js +5 -0
- package/dist/core/tool-model-gate.d.ts +5 -5
- package/dist/core/tool-name-aliases.d.ts +35 -10
- package/dist/core/tool-name-aliases.js +15 -0
- package/dist/core/tool-name-list.d.ts +30 -0
- package/dist/core/tool-name-list.js +55 -0
- package/dist/core/tool-name-readings.d.ts +1 -9
- package/dist/core/tool-name-readings.js +1 -3
- package/dist/core/tool-policy.d.ts +195 -85
- package/dist/core/tool-policy.js +165 -381
- package/dist/core/tool-registry.d.ts +44 -1
- package/dist/core/tool-registry.js +26 -0
- package/dist/core/tool-roster.d.ts +19 -1
- package/dist/core/tool-roster.js +21 -2
- package/dist/core/tool-spec-members.d.ts +45 -0
- package/dist/core/tool-spec-members.js +169 -0
- package/dist/core/tool-spec.d.ts +46 -8
- package/dist/core/tools.d.ts +6 -2
- package/dist/core/tools.js +8 -4
- package/dist/core/untrusted-egress.js +29 -26
- package/dist/core/untrusted-text.d.ts +13 -10
- package/dist/core/untrusted-text.js +6 -44
- package/dist/core/workflow-journal-store.d.ts +4 -1
- package/dist/core/write-protect.d.ts +65 -29
- package/dist/core/write-protect.js +235 -177
- package/dist/engine/compaction/compaction.d.ts +2 -2
- package/dist/engine/execution-env/node-execution-env.d.ts +5 -23
- package/dist/engine/execution-env/node-execution-env.js +16 -38
- package/dist/engine/execution-env/symlink-chain.d.ts +23 -0
- package/dist/engine/execution-env/symlink-chain.js +32 -0
- package/dist/engine/harness/types.d.ts +7 -0
- package/dist/engine/llm/tool-turns.d.ts +3 -0
- package/dist/engine/llm/tool-turns.js +1 -0
- package/dist/engine/llm/types.d.ts +59 -23
- package/dist/engine/loop/agent-loop.js +16 -2
- package/dist/engine/session/memory-repo.js +11 -3
- package/dist/engine/session/repo-utils.d.ts +8 -0
- package/dist/engine/session/repo-utils.js +13 -0
- package/dist/index.d.ts +20 -23
- package/dist/index.js +17 -20
- package/dist/internal/harness.d.ts +1 -1
- package/dist/internal/harness.js +1 -1
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/governance-baseline-validity.js +1 -1
- package/dist/orchestration/run-spec.js +3 -3
- package/dist/orchestration/run-workflow-tool.d.ts +16 -35
- package/dist/orchestration/run-workflow-tool.js +38 -78
- package/dist/orchestration/workflow-governance.d.ts +21 -25
- package/dist/orchestration/workflow-governance.js +38 -78
- package/dist/orchestration/workflow-primitives.d.ts +7 -22
- package/dist/orchestration/workflow-primitives.js +5 -12
- package/dist/orchestration/workflow-types.d.ts +1 -1
- package/dist/orchestration/workflow.d.ts +61 -11
- package/dist/orchestration/workflow.js +191 -119
- package/dist/prompt-assembly/types.d.ts +1 -1
- package/dist/scenarios/full-body.d.ts +1 -1
- package/dist/shell/lex.d.ts +0 -21
- package/dist/shell/lex.js +278 -70
- package/dist/shell/shell-words.d.ts +35 -0
- package/dist/shell/shell-words.js +65 -0
- package/dist/stores/file/checkpoint-store.d.ts +5 -5
- package/dist/stores/file/checkpoint-store.js +5 -2
- package/dist/stores/file/index.d.ts +0 -8
- package/dist/stores/file/index.js +0 -12
- package/dist/stores/file/session-store.d.ts +3 -0
- package/dist/stores/file/session-store.js +44 -19
- package/dist/tools/artifact/artifact-tool.js +2 -0
- package/dist/tools/fs/bash-program-position.d.ts +17 -3
- package/dist/tools/fs/bash-program-position.js +25 -10
- package/dist/tools/fs/bash-readonly-classifier.d.ts +1 -1
- package/dist/tools/fs/bash-readonly-classifier.js +8 -7
- package/dist/tools/fs/containment-face.d.ts +4 -0
- package/dist/tools/fs/containment-face.js +3 -0
- package/dist/tools/fs/fs-shared.d.ts +10 -0
- package/dist/tools/fs/fs-shared.js +18 -0
- package/dist/tools/fs/fs-write.js +4 -2
- package/dist/tools/fs/index.d.ts +3 -2
- package/dist/tools/fs/index.js +2 -2
- package/dist/tools/fs/program-read-model.d.ts +99 -23
- package/dist/tools/fs/program-read-model.js +129 -55
- package/dist/tools/fs/program-read-model.rows.d.ts +0 -14
- package/dist/tools/fs/program-read-model.rows.js +18 -10
- package/dist/tools/fs/read-deny-home.d.ts +35 -30
- package/dist/tools/fs/read-deny-home.js +45 -38
- package/dist/tools/fs/read-deny.d.ts +35 -27
- package/dist/tools/fs/read-deny.js +126 -92
- package/dist/tools/fs/removal-targets.d.ts +56 -23
- package/dist/tools/fs/removal-targets.js +74 -87
- package/dist/tools/fs/safety.d.ts +29 -22
- package/dist/tools/fs/safety.js +17 -11
- package/dist/tools/fs/search.js +10 -8
- package/dist/tools/fs/shell-read-argv.d.ts +4 -7
- package/dist/tools/fs/shell-read-argv.js +6 -8
- package/dist/tools/fs/shell-read-bindings.d.ts +203 -46
- package/dist/tools/fs/shell-read-bindings.js +488 -144
- package/dist/tools/fs/shell-read-builtins.d.ts +35 -0
- package/dist/tools/fs/shell-read-builtins.js +43 -0
- package/dist/tools/fs/shell-read-check.d.ts +15 -1
- package/dist/tools/fs/shell-read-check.js +51 -42
- package/dist/tools/fs/shell-read-establish.js +9 -10
- package/dist/tools/fs/shell-read-functions.d.ts +22 -0
- package/dist/tools/fs/shell-read-functions.js +29 -0
- package/dist/tools/fs/shell-read-judge.d.ts +48 -18
- package/dist/tools/fs/shell-read-judge.js +33 -4
- package/dist/tools/fs/shell-read-plan.d.ts +13 -20
- package/dist/tools/fs/shell-read-plan.js +200 -194
- package/dist/tools/fs/shell-read-start.d.ts +80 -0
- package/dist/tools/fs/shell-read-start.js +99 -0
- package/dist/tools/fs/shell-read-word.d.ts +35 -6
- package/dist/tools/fs/shell-read-word.js +89 -9
- package/dist/tools/fs/shell-read-workdir.d.ts +156 -0
- package/dist/tools/fs/shell-read-workdir.js +281 -0
- package/dist/tools/fs/shell-read-write-targets.d.ts +5 -2
- package/dist/tools/fs/shell-read-write-targets.js +14 -5
- package/dist/tools/fs/shell-reentry-text.d.ts +26 -26
- package/dist/tools/fs/shell-reentry-text.js +31 -34
- package/dist/tools/task-list.d.ts +1 -2
- package/dist/tools/web.js +1 -1
- package/package.json +4 -1
- package/test/export-surface.snapshot.json +107 -143
- package/wire-changes/core@7.48.0.json +252 -0
- package/wire-changes/core@7.49.0.json +4765 -0
- package/dist/agents/teacher.d.ts +0 -159
- package/dist/agents/teacher.js +0 -577
- package/dist/agents/team.d.ts +0 -226
- package/dist/agents/team.js +0 -257
- package/dist/core/strategy-store.d.ts +0 -238
- package/dist/core/strategy-store.js +0 -253
- package/dist/orchestration/builtin-workflows.d.ts +0 -133
- package/dist/orchestration/builtin-workflows.js +0 -159
- package/dist/scenarios/env.d.ts +0 -40
- package/dist/scenarios/env.js +0 -39
- package/dist/scenarios/scenario-registry.d.ts +0 -110
- package/dist/scenarios/scenario-registry.js +0 -140
- package/dist/scenarios/teacher-quickstart.d.ts +0 -40
- package/dist/scenarios/teacher-quickstart.js +0 -12
- package/dist/stores/cc/lockfile.d.ts +0 -10
- package/dist/stores/cc/lockfile.js +0 -98
- package/dist/stores/cc/mailbox-store.d.ts +0 -20
- package/dist/stores/cc/mailbox-store.js +0 -255
- package/dist/stores/cc/roster-adapter.d.ts +0 -12
- package/dist/stores/cc/roster-adapter.js +0 -117
- package/dist/stores/cc/sidecar-transcript.d.ts +0 -97
- package/dist/stores/cc/sidecar-transcript.js +0 -264
- package/dist/stores/cc/task-list-store.d.ts +0 -2
- package/dist/stores/cc/task-list-store.js +0 -125
- package/dist/stores/file/strategy-store.d.ts +0 -97
- package/dist/stores/file/strategy-store.js +0 -341
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { GateOutcome,
|
|
1
|
+
import type { GateOutcome, HostDecisionFacts } from "./gate-outcome.js";
|
|
2
2
|
import { type ExecutionOutcomeRecordWord } from "./checkpoint-execution-record.js";
|
|
3
3
|
import type { CheckpointPause } from "./pause-registry.js";
|
|
4
4
|
import type { SystemInjectionPriority } from "./task-notification.js";
|
|
5
5
|
import { type SteerReplayFacet } from "./steer-replay.js";
|
|
6
|
-
import {
|
|
6
|
+
import type { QuestionAnswer } from "./ask-question.js";
|
|
7
7
|
import type { ReadEntry } from "../tools/fs/safety.js";
|
|
8
8
|
import type { RepairBundle } from "../agents/repair-loop.js";
|
|
9
9
|
import type { WorkspaceHandle } from "./remote-env.js";
|
|
@@ -450,11 +450,16 @@ export declare function realApprovalOrgFact(bit: RealApprovalGateBit | undefined
|
|
|
450
450
|
export type CheckpointGate =
|
|
451
451
|
/** F4: a human (or any external authority) must allow/deny a pending tool call. design/80 §D-E:
|
|
452
452
|
* carries an OPTIONAL display-only {@link RiskDescriptor} (severity/axes/summary) for the supervisor
|
|
453
|
-
* inbox to triage by — INERT (core never reads it to gate/budget).
|
|
453
|
+
* inbox to triage by — INERT (core never reads it to gate/budget).
|
|
454
|
+
* Both approval arms carry `approvalCard`: which card the pending call renders under (the call's face's card,
|
|
455
|
+
* copied at the park). It is also the row's question mark — `"question"` is the reserved question tool, whose
|
|
456
|
+
* deadline voids it instead of denying it (`facetOf`). Absent on a row parked before the member (read as no
|
|
457
|
+
* card, never as a question) and on a call that carried no face. */
|
|
454
458
|
{
|
|
455
459
|
kind: "human";
|
|
456
460
|
reason: string;
|
|
457
461
|
toolName: string;
|
|
462
|
+
approvalCard?: import("./tool-face.js").ToolApprovalCard;
|
|
458
463
|
riskDescriptor?: RiskDescriptor;
|
|
459
464
|
}
|
|
460
465
|
/** design/77 §4 (Gate 4) + design/80 D-2: a PRE-ACTION human approval before a SAFETY-tightened tool runs —
|
|
@@ -471,6 +476,7 @@ export type CheckpointGate =
|
|
|
471
476
|
kind: "irreversible_ask";
|
|
472
477
|
reason: string;
|
|
473
478
|
toolName: string;
|
|
479
|
+
approvalCard?: import("./tool-face.js").ToolApprovalCard;
|
|
474
480
|
safetyAxis?: SafetyAxis;
|
|
475
481
|
realApproval?: RealApprovalGateBit;
|
|
476
482
|
riskDescriptor?: RiskDescriptor;
|
|
@@ -624,10 +630,7 @@ export type ResumeOutcome = {
|
|
|
624
630
|
* `env_failed` replay must reproduce exactly, and who reported a settlement is not part of that
|
|
625
631
|
* authorization; a replay states its own facts.
|
|
626
632
|
*/
|
|
627
|
-
hostDecision:
|
|
628
|
-
decidedBy: HostDecider;
|
|
629
|
-
approver?: string;
|
|
630
|
-
};
|
|
633
|
+
hostDecision: HostDecisionFacts;
|
|
631
634
|
/**
|
|
632
635
|
* CORE-MINTED, on the persisted twin only: the settlement record this decide produced. Present on
|
|
633
636
|
* the row's `resolvedOutcome` after the resolve, and on the `tool_end` frame of the resolved call.
|
|
@@ -658,8 +661,8 @@ export type ResumeOutcome = {
|
|
|
658
661
|
* proposed PLAN. `decision:"approve"` → proceed with the plan as-is; `decision:"edit"` → proceed with the
|
|
659
662
|
* human's `editedPlan` (a TYPED sibling of the plan — NEVER a raw tool `updatedInput`; a plan is not a tool
|
|
660
663
|
* arg, so this binds NO action and never enters the `policy_ask` boundCallId/boundInputHash machinery);
|
|
661
|
-
* `decision:"reject"` → the
|
|
662
|
-
*
|
|
664
|
+
* `decision:"reject"` → the plan is discarded; a PERSON's refusal stops the model to wait for the user (a `reason` is their direction, fenced; with none the wait stands), a deployment POLICY's is attributed and the model re-plans.
|
|
665
|
+
* Kept DISJOINT from `policy_ask` (approval) AND `dry_run_review` (post-prediction review) so the
|
|
663
666
|
* resume-side discriminant never confuses the three (the `plan_review`/`plan_review` gateMatch arm). It
|
|
664
667
|
* binds no TOOL CALL, but since RB-64 it does record a winner: `winnerFromOutcome` returns the decision
|
|
665
668
|
* (plus `editedPlan` as `updatedInput` and the reviewer `reason`) under the synthetic `gate:plan_review`
|
|
@@ -671,6 +674,11 @@ export type ResumeOutcome = {
|
|
|
671
674
|
decision: "approve" | "edit" | "reject";
|
|
672
675
|
editedPlan?: string;
|
|
673
676
|
reason?: string;
|
|
677
|
+
/** Who ended this wait — the tool-approval arm's member, same shape, closed set, validation and refusals; REQUIRED.
|
|
678
|
+
* `reject` is the refusal direction; `"sla_timeout"` is refused here (a plan pause expires, a sweep never resolves it). */
|
|
679
|
+
hostDecision: HostDecisionFacts;
|
|
680
|
+
/** CORE-MINTED on the persisted twin only (origin `"plan_review"`; a plan pause has no `tool_end`, so the row is its only face); a supplied one is refused pre-CAS. */
|
|
681
|
+
gateOutcome?: import("./gate-outcome.js").GateOutcome;
|
|
674
682
|
}
|
|
675
683
|
/** design/144 §3 (message-wake): wake a PARKED (non-gate) checkpoint and drive it to continue — a pure
|
|
676
684
|
* un-park verb, **NOT a gate decision**: it never allows/denies/approves anything. Governance-gate
|
|
@@ -1231,7 +1239,7 @@ export interface CheckpointState {
|
|
|
1231
1239
|
* [c209-C] Q5 — the listing frames' announced NAME-SETS at suspend (agent types / skills the model
|
|
1232
1240
|
* has actually been shown this run, committed on first-frame delivery or intact boundary survival).
|
|
1233
1241
|
* A resume leg seeds its producers from these names and DIFFS the current roster/skill set against
|
|
1234
|
-
* them, so cross-leg drift (
|
|
1242
|
+
* them, so cross-leg drift (web-admin roster change between suspend and resume) is announced as
|
|
1235
1243
|
* a delta frame at the first boundary instead of silently swallowed — the exact event the listing
|
|
1236
1244
|
* eviction from the cached prefix exists to serve. Names only, never contents (a description change
|
|
1237
1245
|
* on a surviving name is deliberately not re-announced — name-keyed diff, agent_listing parity).
|
|
@@ -1331,6 +1339,22 @@ export interface CheckpointState {
|
|
|
1331
1339
|
* {@link placementRootSessionId} above and owned by the same version-lattice ticket).
|
|
1332
1340
|
*/
|
|
1333
1341
|
externalContentTarget?: true;
|
|
1342
|
+
/** The scope this LEG's rows land in (its prepare's one `checkpointScopeOf` reading), stamped at every mint: a resume
|
|
1343
|
+
* that hands no live seat restores it, so the resume config cannot move the leg's next row. Not {@link Checkpoint.scope}
|
|
1344
|
+
* (where THIS row is filed — a resource slice's own declared scope). Absent ⇒ minted before the member: derived as before. */
|
|
1345
|
+
legScope?: string;
|
|
1346
|
+
/** The tool-selector layers this LEG was spawned under (`RunInternals.toolCeiling`), stamped at every mint: a resume that hands
|
|
1347
|
+
* no live ceiling restores it, so a resumed child can never use a tool its spawning run could not. Absent ⇒ the leg had no
|
|
1348
|
+
* ceiling (a root run) or the row was minted before the member. A reader that lacks the word would run the leg unbounded. */
|
|
1349
|
+
toolCeiling?: ReadonlyArray<{
|
|
1350
|
+
readonly allow?: readonly string[];
|
|
1351
|
+
readonly deny: readonly string[];
|
|
1352
|
+
}>;
|
|
1353
|
+
/** The evidence that the run that spawned this LEG judged its own tool lists (`RunInternals.toolListsJudged`: the digest of exactly
|
|
1354
|
+
* those lists), stamped at every mint while it holds: a resume that hands no internals and the same lists keeps the judgment, one
|
|
1355
|
+
* that hands different lists is judged again. Absent ⇒ the leg judged its own lists (or the row was minted before the member). A
|
|
1356
|
+
* reader that lacks the word would judge again a list judged against a wider universe, and refuse a leg that was valid. */
|
|
1357
|
+
toolListsJudged?: string;
|
|
1334
1358
|
}
|
|
1335
1359
|
/**
|
|
1336
1360
|
* {@link CheckpointState} with **every** field made required-PRESENT, while each value keeps its original
|
|
@@ -1346,20 +1370,16 @@ export type SerializedCheckpointState = {
|
|
|
1346
1370
|
[K in keyof Required<CheckpointState>]: CheckpointState[K];
|
|
1347
1371
|
};
|
|
1348
1372
|
/**
|
|
1349
|
-
* The checkpoint FEATURE TABLE — one row per feature that ever raised the row format
|
|
1350
|
-
*
|
|
1351
|
-
*
|
|
1352
|
-
*
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
* one row here plus an explicit answer at each mint site (the presence record's keys are mandatory).
|
|
1373
|
+
* The checkpoint FEATURE TABLE — one row per feature that ever raised the row format: its schema version, and
|
|
1374
|
+
* what a mint owed when the feature was present (`writes`, prose). The per-feature constants below ARE the rows'
|
|
1375
|
+
* versions. The table is CLOSED at `requirements` (v10): every live mint stamps 10 and lists the row's
|
|
1376
|
+
* reader-requirement words beside it (`Checkpoint.requires`, checkpoint-requirements.ts) — a later segment adds a
|
|
1377
|
+
* word there, never a row here. Each feature key below (but `baseline` / `requirements`) is itself one of those
|
|
1378
|
+
* words, and whether a v10 row carries the feature is read off the row's content by the requirement tables.
|
|
1356
1379
|
*
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1360
|
-
* version-recorded at v8 and marker-recorded (`readFace.realApproval`) from v9 on. The same law binds the
|
|
1361
|
-
* NEXT feature: once a row can be stamped above v9, "v9+ ⇒ read-face section present" no longer follows
|
|
1362
|
-
* from the stamp, and the face needs a mark of its own (or the row a per-feature presence record).
|
|
1380
|
+
* A v≤9 row was stamped the HIGHEST feature it carried, so the number records only the top feature; the resume
|
|
1381
|
+
* rules that read a v≤9 row by number are exact to the version at which their feature was the top
|
|
1382
|
+
* (`realApproval` is version-recorded at v8 and marker-recorded — `readFace.realApproval` — at v9).
|
|
1363
1383
|
*
|
|
1364
1384
|
* v4 is a GAP, deliberately: the retired cross-slice wall-clock allocation. This worker still reads v4
|
|
1365
1385
|
* rows; a ledger carrying the retired axis is refused by FIELD (`walltime_axis_retired`) at any version.
|
|
@@ -1370,7 +1390,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1370
1390
|
readonly baseline: {
|
|
1371
1391
|
readonly version: 1;
|
|
1372
1392
|
readonly introduced: "design/49";
|
|
1373
|
-
readonly recordedOn: (_cp: Checkpoint) => boolean;
|
|
1374
1393
|
readonly writes: "the row itself";
|
|
1375
1394
|
};
|
|
1376
1395
|
/** A `resource_limit` suspend: `resourceLedger` plus a `resource_limit` gate/pendingAction an older worker
|
|
@@ -1378,7 +1397,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1378
1397
|
readonly resource: {
|
|
1379
1398
|
readonly version: 2;
|
|
1380
1399
|
readonly introduced: "design/74";
|
|
1381
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1382
1400
|
readonly writes: "resourceLedger; gate/pendingAction kind resource_limit";
|
|
1383
1401
|
};
|
|
1384
1402
|
/** A HUMAN-DECISION park (tool approval or plan_review) of the binding era: the decision-action binding
|
|
@@ -1389,7 +1407,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1389
1407
|
readonly binding: {
|
|
1390
1408
|
readonly version: 3;
|
|
1391
1409
|
readonly introduced: "design/80";
|
|
1392
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1393
1410
|
readonly writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only";
|
|
1394
1411
|
};
|
|
1395
1412
|
/** A ledger carrying a cross-slice TOKEN allocation: the window clamp and the exhausted-resume fail-fast
|
|
@@ -1397,7 +1414,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1397
1414
|
readonly token: {
|
|
1398
1415
|
readonly version: 5;
|
|
1399
1416
|
readonly introduced: "design/164";
|
|
1400
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1401
1417
|
readonly writes: "resourceLedger.totalTokens";
|
|
1402
1418
|
};
|
|
1403
1419
|
/** Org-memory admission freeze state (the adjudicated-empty record included): the session/delegation
|
|
@@ -1405,7 +1421,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1405
1421
|
readonly orgAdmission: {
|
|
1406
1422
|
readonly version: 6;
|
|
1407
1423
|
readonly introduced: "org-admission";
|
|
1408
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1409
1424
|
readonly writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned";
|
|
1410
1425
|
};
|
|
1411
1426
|
/** The F-012 durable enforcement fields: the frozen ancestor projection chain + its digest (one write, the
|
|
@@ -1413,7 +1428,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1413
1428
|
readonly f012: {
|
|
1414
1429
|
readonly version: 7;
|
|
1415
1430
|
readonly introduced: "F-012";
|
|
1416
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1417
1431
|
readonly writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance";
|
|
1418
1432
|
};
|
|
1419
1433
|
/** A gate carrying {@link RealApprovalGateBit}: the no-org-wiring refusal and the org_unavailable resume
|
|
@@ -1422,7 +1436,6 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1422
1436
|
readonly realApproval: {
|
|
1423
1437
|
readonly version: 8;
|
|
1424
1438
|
readonly introduced: "#130/#120";
|
|
1425
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1426
1439
|
readonly writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it";
|
|
1427
1440
|
};
|
|
1428
1441
|
/** The READ-face section ({@link CheckpointState.readFace}): resolved face + normalized deny-set additions,
|
|
@@ -1431,18 +1444,22 @@ export declare const CHECKPOINT_FEATURES: {
|
|
|
1431
1444
|
readonly face: {
|
|
1432
1445
|
readonly version: 9;
|
|
1433
1446
|
readonly introduced: "design/199";
|
|
1434
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1435
1447
|
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)";
|
|
1436
1448
|
};
|
|
1449
|
+
/** The last row: the reader-requirement words ({@link CheckpointRow.requires}). Every live mint stamps it, so a
|
|
1450
|
+
* worker of v7.24.2–7.48.x (ceiling 9) refuses every row minted from here on, `version_newer`, pre-CAS. */
|
|
1451
|
+
readonly requirements: {
|
|
1452
|
+
readonly version: 10;
|
|
1453
|
+
readonly introduced: "#1320";
|
|
1454
|
+
readonly writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)";
|
|
1455
|
+
};
|
|
1437
1456
|
};
|
|
1438
1457
|
/** One row of {@link CHECKPOINT_FEATURES}. */
|
|
1439
1458
|
export interface CheckpointFeatureRow {
|
|
1440
1459
|
readonly version: number;
|
|
1441
1460
|
/** Where the feature came from — a design or ticket tag, documentation only. */
|
|
1442
1461
|
readonly introduced: string;
|
|
1443
|
-
/**
|
|
1444
|
-
readonly recordedOn: (cp: Checkpoint) => boolean;
|
|
1445
|
-
/** WRITE face: what a mint must write when the feature is present (prose; the mint sites are the code). */
|
|
1462
|
+
/** What a mint wrote when the feature was present (prose; the mint sites are the code). */
|
|
1446
1463
|
readonly writes: string;
|
|
1447
1464
|
}
|
|
1448
1465
|
/** The feature words — the row keys of {@link CHECKPOINT_FEATURES}. */
|
|
@@ -1464,17 +1481,10 @@ export declare const F012_CHECKPOINT_VERSION: 7;
|
|
|
1464
1481
|
export declare const REAL_APPROVAL_CHECKPOINT_VERSION: 8;
|
|
1465
1482
|
/** The `face` row's version. */
|
|
1466
1483
|
export declare const FACE_CHECKPOINT_VERSION: 9;
|
|
1467
|
-
/** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table
|
|
1468
|
-
* is rejected pre-CAS with {@link CheckpointError}
|
|
1469
|
-
*
|
|
1470
|
-
|
|
1471
|
-
export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 9;
|
|
1472
|
-
/** What a mint site answers for: every row but the baseline, every key MANDATORY — a new row is a compile
|
|
1473
|
-
* error at each mint site until that site says whether its rows carry the feature. */
|
|
1474
|
-
export type CheckpointFeaturePresence = Record<Exclude<CheckpointFeature, "baseline">, boolean>;
|
|
1475
|
-
/** The schema version a mint stamps: the highest version among the features PRESENT on the row, the baseline
|
|
1476
|
-
* when none is. One rule for every mint site — the precedence between features is the version numbers. */
|
|
1477
|
-
export declare function checkpointVersionFor(presence: CheckpointFeaturePresence): number;
|
|
1484
|
+
/** The highest {@link Checkpoint.version} `runner.resume` will act on — the top row of the table, and the stamp
|
|
1485
|
+
* of every live mint (the table is closed there); a higher one is rejected pre-CAS with {@link CheckpointError}
|
|
1486
|
+
* `unsupported_version` (the row stays `pending`, retryable on a newer worker). */
|
|
1487
|
+
export declare const MAX_SUPPORTED_CHECKPOINT_VERSION: 10;
|
|
1478
1488
|
/**
|
|
1479
1489
|
* Read a checkpoint's schema version, defaulting an absent field to **legacy `0`** (a 1.67-era checkpoint
|
|
1480
1490
|
* written before the field existed — it carries no `workspaceHandle`, so resuming it the v1 way is safe).
|
|
@@ -1567,7 +1577,7 @@ export interface ResolvedOutcome {
|
|
|
1567
1577
|
/** The operator's NOTE, if the decision carried one — the approval lane's deny `reason` and the review
|
|
1568
1578
|
* lanes' reject `reason` alike. Recorded for the same reason `updatedInput` and `answer` are: the note
|
|
1569
1579
|
* is the substance of the decision, not a decoration on it. It is the text the resume continuation
|
|
1570
|
-
* fences into the model-facing reminder that
|
|
1580
|
+
* fences into the model-facing reminder that carries the refusal, so a replay keeping the verdict and
|
|
1571
1581
|
* swapping the note delivers a different instruction under the same word. Omitted when absent.
|
|
1572
1582
|
*
|
|
1573
1583
|
* ADDITIVE and OPTIONAL by contract: rows persisted before this field existed carry no `reason` key,
|
|
@@ -1683,14 +1693,19 @@ export interface CheckpointRow {
|
|
|
1683
1693
|
* since its introduction; absent ⇒ legacy row (read compatibly, no backfill). */
|
|
1684
1694
|
checkpointId?: string;
|
|
1685
1695
|
/**
|
|
1686
|
-
* Schema version of this checkpoint (design/49 v1.5)
|
|
1687
|
-
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1690
|
-
* pre-CAS so an old worker can't silently ignore fields a newer format relies on (forward-compatible by `<=`).
|
|
1691
|
-
* Read via {@link checkpointVersionOf}.
|
|
1696
|
+
* Schema version of this checkpoint (design/49 v1.5), FROZEN at the `requirements` row's 10: every live mint
|
|
1697
|
+
* stamps 10 beside {@link requires}, and a segment added later adds a word there, never a number here. A v≤9 row
|
|
1698
|
+
* (stamped the highest feature it carried) is read by the feature table's numbers; absent ⇒ legacy `0`. Resume
|
|
1699
|
+
* rejects `> MAX_SUPPORTED_CHECKPOINT_VERSION` pre-CAS. Read via {@link checkpointVersionOf}.
|
|
1692
1700
|
*/
|
|
1693
1701
|
version?: number;
|
|
1702
|
+
/** The reader-requirement words of a v10 row: what a resuming worker must know to resume it right, derived from
|
|
1703
|
+
* the row's own content at the mint (`checkpointRequirementsFor`, checkpoint-requirements.ts) — present on every
|
|
1704
|
+
* v10 row (possibly empty), absent below. Typed as plain strings: a newer release's word is a word this one lacks. */
|
|
1705
|
+
requires?: readonly string[];
|
|
1706
|
+
/** The row digest of a v10 row: sha256 over the canonical JSON of every member a decision reads (`requirementsDigestOf`,
|
|
1707
|
+
* checkpoint-requirements.ts) — a lost member, element or changed value is refused `requirements_damaged`. */
|
|
1708
|
+
requirementsDigest?: string;
|
|
1694
1709
|
/** Multi-tenant isolation key (forced through `resolve`/`reap` WHERE, §2.1 service [4]). */
|
|
1695
1710
|
scope: string;
|
|
1696
1711
|
/** The session to resume (via the SessionStore). */
|
|
@@ -1912,13 +1927,14 @@ export interface CheckpointSummary {
|
|
|
1912
1927
|
/** The pending tool's name ({@link PendingAction} `tool_approval.toolName`) when this is an approval suspend.
|
|
1913
1928
|
* OMITTED (not `null`) for a non-`tool_approval` pendingAction — see {@link toolCallId}'s absence-shape note. */
|
|
1914
1929
|
toolName?: string;
|
|
1915
|
-
/**
|
|
1916
|
-
*
|
|
1917
|
-
*
|
|
1918
|
-
*
|
|
1919
|
-
*
|
|
1920
|
-
*
|
|
1921
|
-
|
|
1930
|
+
/** Which approval card the pending call renders under — the gate's {@link CheckpointGate} `approvalCard` echoed when
|
|
1931
|
+
* it is a member of the closed set `TOOL_APPROVAL_CARDS` (a stored word outside the set is no card). The one typed
|
|
1932
|
+
* discriminant a shell routes on: `"question"` is a question TO the user (the reserved AskUserQuestion tool, whose
|
|
1933
|
+
* typed questions ride the drilled-in Checkpoint's `pendingAction.args`, kept off this lightweight projection), not a
|
|
1934
|
+
* side-effecting tool; the other words pick the card family. Present on an approval suspend (`human` /
|
|
1935
|
+
* `irreversible_ask`) that carries one; OMITTED for a row parked before the member and for every non-approval park —
|
|
1936
|
+
* see {@link toolCallId}'s absence-shape note. */
|
|
1937
|
+
approvalCard?: import("./tool-face.js").ToolApprovalCard;
|
|
1922
1938
|
/** design S1e: when the checkpoint was created ({@link Checkpoint.createdAt}, epoch ms) —
|
|
1923
1939
|
* projected so a supervisor inbox can sort/age pending entries (oldest-first triage) in ONE `listByScope`
|
|
1924
1940
|
* call, no N+1 `getCheckpoint`. ECHO-ONLY display/triage; always present (a Checkpoint always has a
|
|
@@ -2055,8 +2071,9 @@ export declare function summarizeCheckpoint(cp: Checkpoint): CheckpointSummary;
|
|
|
2055
2071
|
* cannot classify — the registry's mint-obligation leg is what makes the omission loud (every
|
|
2056
2072
|
* `checkpoint.unsupported_version` construction site must spell one of these words AT the site).
|
|
2057
2073
|
*
|
|
2058
|
-
* · `unsupported_version` arms: `"version_newer"` (the row's format is newer than this worker's
|
|
2059
|
-
*
|
|
2074
|
+
* · `unsupported_version` arms: `"version_newer"` (the row's format is newer than this worker's, or it lists a
|
|
2075
|
+
* reader-requirement word this worker lacks — `detail.requires` names those words — retryable on a newer
|
|
2076
|
+
* worker), `"env_factory_missing"` (retryable on a factory-wired worker),
|
|
2060
2077
|
* `"governed_unwired"` (retryable on an org-wired worker), `"origin_missing"` (a pending approval row
|
|
2061
2078
|
* minted before the ask's origin was persisted on the park — terminal for the row's bytes; the host
|
|
2062
2079
|
* decides the orphaned card itself, no worker version redeems it), `"ledger_event_unknown"` (a durable
|
|
@@ -2067,7 +2084,7 @@ export declare function summarizeCheckpoint(cp: Checkpoint): CheckpointSummary;
|
|
|
2067
2084
|
* steer seat, which no worker version reads and the host decides itself, or a retired mode-seed member of
|
|
2068
2085
|
* `inheritedGate`, which an engine at 7.38.x or earlier still reads once).
|
|
2069
2086
|
* · `invalid_outcome` pre-CAS row-integrity arms: `"real_approval_damaged"`, `"real_approval_forged"`,
|
|
2070
|
-
* `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"` (all terminal for the row's
|
|
2087
|
+
* `"read_face_damaged"`, `"read_face_forged"`, `"write_face_damaged"`, `"skill_grants_damaged"`, `"constraint_chain_missing"`, `"hands_coordinates_damaged"`, `"requirements_damaged"` (all terminal for the row's
|
|
2071
2088
|
* current bytes — no worker version redeems a damaged row).
|
|
2072
2089
|
*/
|
|
2073
2090
|
export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "governed_unwired" | "origin_missing" | "ledger_event_unknown" | "seat_retired" | "real_approval_damaged" | "real_approval_forged" | "read_face_damaged" | "read_face_forged"
|
|
@@ -2077,6 +2094,10 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
|
|
|
2077
2094
|
| "write_face_damaged" | "skill_grants_damaged" | "constraint_chain_missing"
|
|
2078
2095
|
/** `state.handsRoot` / `state.handsHome` / `state.handsCwd` is present but not an absolute path (the row's hands' coordinates). */
|
|
2079
2096
|
| "hands_coordinates_damaged"
|
|
2097
|
+
/** The row's reader-requirement list ({@link CheckpointRow.requires}) is missing on a v10 row, is not a list of words,
|
|
2098
|
+
* is present below v10, or does not equal the words the row's content carries (a segment dropped, or a word not
|
|
2099
|
+
* declared) — terminal for the row's bytes. */
|
|
2100
|
+
| "requirements_damaged"
|
|
2080
2101
|
/** On `resume.parent_constraint_mismatch`: a re-supplied chain entry whose path rules depend on the leg that installed it has
|
|
2081
2102
|
* no installation record (a chain written before the record existed) / a record that does not cover the chain entry for
|
|
2082
2103
|
* entry / a record member naming no absolute root. */
|
|
@@ -2263,8 +2284,9 @@ export declare class CheckpointError extends Error {
|
|
|
2263
2284
|
* re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
|
|
2264
2285
|
* 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
|
|
2265
2286
|
* decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
|
|
2266
|
-
* `"hostDecision"` (
|
|
2267
|
-
* pair the sweep's `sla_timeout` with an allow
|
|
2287
|
+
* `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
|
|
2288
|
+
* `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
|
|
2289
|
+
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2268
2290
|
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2269
2291
|
* it). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
|
|
2270
2292
|
* (the re-supplied config: correct it and resume the same token) or `"inheritedGate"` (the mode the row
|
|
@@ -2288,6 +2310,9 @@ export declare class CheckpointError extends Error {
|
|
|
2288
2310
|
* (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
|
|
2289
2311
|
* is a gate rather than a type: see the closed set's own doc. */
|
|
2290
2312
|
reason?: CheckpointErrorReason;
|
|
2313
|
+
/** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
|
|
2314
|
+
* (sorted, display only). Absent on every other arm. */
|
|
2315
|
+
requires?: readonly string[];
|
|
2291
2316
|
/** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
|
|
2292
2317
|
* {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
|
|
2293
2318
|
* every other code. The live verb's refusal carries the same value. */
|
|
@@ -2461,8 +2486,9 @@ export declare class CheckpointError extends Error {
|
|
|
2461
2486
|
* re-fetch the pending list), `"boundInputHash"` (the input you reviewed has changed under the same
|
|
2462
2487
|
* 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
|
|
2463
2488
|
* decision that cannot carry one: re-decide with a well-formed answer — ruled 2026-08-04), or
|
|
2464
|
-
* `"hostDecision"` (
|
|
2465
|
-
* pair the sweep's `sla_timeout` with an allow
|
|
2489
|
+
* `"hostDecision"` (a tool approval's or a plan pause's decision facts are missing, name a decider outside
|
|
2490
|
+
* `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
|
|
2491
|
+
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2466
2492
|
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2467
2493
|
* it). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
|
|
2468
2494
|
* (the re-supplied config: correct it and resume the same token) or `"inheritedGate"` (the mode the row
|
|
@@ -2486,6 +2512,9 @@ export declare class CheckpointError extends Error {
|
|
|
2486
2512
|
* (`code` remains the only REQUIRED discriminant), which is exactly why the obligation to SPELL it
|
|
2487
2513
|
* is a gate rather than a type: see the closed set's own doc. */
|
|
2488
2514
|
reason?: CheckpointErrorReason;
|
|
2515
|
+
/** On a `version_newer` refusal of a v10 row: the reader-requirement words the row lists that this worker lacks
|
|
2516
|
+
* (sorted, display only). Absent on every other arm. */
|
|
2517
|
+
requires?: readonly string[];
|
|
2489
2518
|
/** On `steering.duplicate_input_id` — the facets the repeat differs from the parked steer in (closed
|
|
2490
2519
|
* {@link SteerReplayFacet}, in that set's order; always present on that code, never empty). Absent on
|
|
2491
2520
|
* every other code. The live verb's refusal carries the same value. */
|
|
@@ -9,9 +9,8 @@ import { checkpointExecutionRecorded, executionRecordDisposition, ExecutionOutco
|
|
|
9
9
|
import { renderUntrustedCommandText, stripFormatCharacters } from "./permission-rule-model.js";
|
|
10
10
|
import { redactSecrets } from "./untrusted-egress.js";
|
|
11
11
|
import { steerReplayRefusal } from "./steer-replay.js";
|
|
12
|
-
import {
|
|
12
|
+
import { isToolApprovalCard } from "./tool-face.js";
|
|
13
13
|
import { isPermissionMode } from "./ask-origin.js";
|
|
14
|
-
import { wireOf } from "./tool-name-readings.js";
|
|
15
14
|
export function mintCheckpointToken() {
|
|
16
15
|
return randomBytes(16).toString("hex");
|
|
17
16
|
}
|
|
@@ -191,19 +190,15 @@ export function realApprovalOrgFact(bit) {
|
|
|
191
190
|
return bit.origin === "org_rule" ? "rule" : bit.origin === "org_unavailable" ? "unavailable" : undefined;
|
|
192
191
|
}
|
|
193
192
|
export const CHECKPOINT_FEATURES = {
|
|
194
|
-
baseline: { version: 1, introduced: "design/49",
|
|
195
|
-
resource: { version: 2, introduced: "design/74",
|
|
196
|
-
binding: { version: 3, introduced: "design/80",
|
|
197
|
-
token: { version: 5, introduced: "design/164",
|
|
198
|
-
orgAdmission: {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
f012: { version: 7, introduced: "F-012", recordedOn: (cp) => cp.state.inheritedGate?.constraintChain !== undefined || cp.state.delegationProvenance !== undefined, writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
|
|
205
|
-
realApproval: { version: 8, introduced: "#130/#120", recordedOn: (cp) => cp.gate.kind === "irreversible_ask" && cp.gate.realApproval !== undefined, writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it" },
|
|
206
|
-
face: { version: 9, introduced: "design/199", recordedOn: (cp) => cp.state.readFace !== undefined, 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)" },
|
|
193
|
+
baseline: { version: 1, introduced: "design/49", writes: "the row itself" },
|
|
194
|
+
resource: { version: 2, introduced: "design/74", writes: "resourceLedger; gate/pendingAction kind resource_limit" },
|
|
195
|
+
binding: { version: 3, introduced: "design/80", writes: "pendingAction.boundCallId + boundInputHash on a tool_approval; a plan_review carries the stamp only" },
|
|
196
|
+
token: { version: 5, introduced: "design/164", writes: "resourceLedger.totalTokens" },
|
|
197
|
+
orgAdmission: { version: 6, introduced: "org-admission", writes: "inheritedGate.admittedOrgScopes / ownAdmittedOrgScopes / ownAdmittedOrgWriteScope / orgAdmissionGoverned" },
|
|
198
|
+
f012: { version: 7, introduced: "F-012", writes: "inheritedGate.constraintChain + constraintDigest together; delegationProvenance" },
|
|
199
|
+
realApproval: { version: 8, introduced: "#130/#120", writes: "gate.realApproval (a well-formed bit) + pendingAction.requiresRealApproval; from v9: readFace.realApproval = true beside it" },
|
|
200
|
+
face: { version: 9, introduced: "design/199", writes: "state.readFace { face, denyEntries? } for a non-default posture; realApproval: true only at the mint whose gate carries the bit (a hands-less re-park never carries the seed's marker forward)" },
|
|
201
|
+
requirements: { version: 10, introduced: "#1320", writes: "requires (the row's words) + requirementsDigest (the row digest), both derived from its content (checkpoint-requirements.ts)" },
|
|
207
202
|
};
|
|
208
203
|
export const CURRENT_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.baseline.version;
|
|
209
204
|
export const RESOURCE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.resource.version;
|
|
@@ -213,16 +208,7 @@ export const ORG_ADMISSION_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.orgAdmission
|
|
|
213
208
|
export const F012_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.f012.version;
|
|
214
209
|
export const REAL_APPROVAL_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.realApproval.version;
|
|
215
210
|
export const FACE_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.face.version;
|
|
216
|
-
export const MAX_SUPPORTED_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.
|
|
217
|
-
export function checkpointVersionFor(presence) {
|
|
218
|
-
let version = CHECKPOINT_FEATURES.baseline.version;
|
|
219
|
-
for (const feature of Object.keys(CHECKPOINT_FEATURES)) {
|
|
220
|
-
const row = CHECKPOINT_FEATURES[feature];
|
|
221
|
-
if (presence[feature] === true && row.version > version)
|
|
222
|
-
version = row.version;
|
|
223
|
-
}
|
|
224
|
-
return version;
|
|
225
|
-
}
|
|
211
|
+
export const MAX_SUPPORTED_CHECKPOINT_VERSION = CHECKPOINT_FEATURES.requirements.version;
|
|
226
212
|
export function checkpointVersionOf(cp) {
|
|
227
213
|
return cp.version ?? 0;
|
|
228
214
|
}
|
|
@@ -264,6 +250,7 @@ export function remainingTokens(ledger) {
|
|
|
264
250
|
export function summarizeCheckpoint(cp) {
|
|
265
251
|
const riskDescriptor = cp.gate.kind === "human" || cp.gate.kind === "irreversible_ask" ? cp.gate.riskDescriptor : undefined;
|
|
266
252
|
const severity = riskDescriptor !== undefined ? riskSeverity(riskDescriptor.axes) : undefined;
|
|
253
|
+
const gateCard = cp.gate.kind === "human" || cp.gate.kind === "irreversible_ask" ? cp.gate.approvalCard : undefined;
|
|
267
254
|
const tool = cp.pendingAction.kind === "tool_approval" ? cp.pendingAction : undefined;
|
|
268
255
|
let toolInput;
|
|
269
256
|
if (tool !== undefined) {
|
|
@@ -293,7 +280,7 @@ export function summarizeCheckpoint(cp) {
|
|
|
293
280
|
...(cp.sourceTaskId !== undefined ? { sourceTaskId: cp.sourceTaskId } : {}),
|
|
294
281
|
...(cp.principal !== undefined ? { principal: cp.principal } : {}),
|
|
295
282
|
...(tool !== undefined ? { toolCallId: tool.toolCallId, toolName: tool.toolName } : {}),
|
|
296
|
-
...(
|
|
283
|
+
...(isToolApprovalCard(gateCard) ? { approvalCard: gateCard } : {}),
|
|
297
284
|
...(toolInput !== undefined ? { toolInput } : {}),
|
|
298
285
|
...(cp.state.workspaceHandle !== undefined
|
|
299
286
|
? { restoreMode: cp.state.workspaceHandle.restoreMode === "park_only" ? "park_only" : "snapshot" }
|
|
@@ -441,6 +428,7 @@ export function winnerFromOutcome(outcome) {
|
|
|
441
428
|
decision: outcome.decision,
|
|
442
429
|
...(editedPlan !== undefined ? { updatedInput: editedPlan } : {}),
|
|
443
430
|
...(outcome.reason !== undefined ? { reason: outcome.reason } : {}),
|
|
431
|
+
...(outcome.gate === "plan_review" && outcome.gateOutcome !== undefined ? { gateOutcome: outcome.gateOutcome } : {}),
|
|
444
432
|
};
|
|
445
433
|
}
|
|
446
434
|
if (outcome.gate !== "policy_ask")
|