@sema-agent/core 7.54.0 → 7.55.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 +451 -0
- package/dist/agents/agent-transcript-tool.js +2 -1
- package/dist/agents/builtin-agents.d.ts +12 -14
- package/dist/agents/cc-peer-directory.d.ts +36 -0
- package/dist/agents/cc-peer-directory.js +138 -0
- package/dist/agents/cc-peer-wire.d.ts +105 -0
- package/dist/agents/cc-peer-wire.js +98 -0
- package/dist/agents/cc-uds-peer-channel.d.ts +40 -0
- package/dist/agents/cc-uds-peer-channel.js +457 -0
- package/dist/agents/cross-session-envelope.d.ts +4 -1
- package/dist/agents/cross-session-envelope.js +8 -1
- package/dist/agents/cross-session-judge.d.ts +2 -2
- package/dist/agents/list-agents-tool.js +2 -1
- package/dist/agents/observer.d.ts +4 -5
- package/dist/agents/observer.js +2 -1
- package/dist/agents/peer-admission.d.ts +6 -0
- package/dist/agents/peer-admission.js +4 -1
- package/dist/agents/peer-directory.d.ts +43 -9
- package/dist/agents/peer-directory.js +66 -23
- package/dist/agents/peer-notices.d.ts +1 -1
- package/dist/agents/peer-session-drain.d.ts +3 -1
- package/dist/agents/peer-session-drain.js +1 -0
- package/dist/agents/read-inbox-tool.js +2 -1
- package/dist/agents/retain-ledger.d.ts +1 -1
- package/dist/agents/roster-store.d.ts +1 -1
- package/dist/agents/send-message-tool.d.ts +10 -0
- package/dist/agents/send-message-tool.js +34 -5
- package/dist/agents/subagent.d.ts +34 -79
- package/dist/agents/subagent.js +45 -46
- package/dist/agents/tool-filter.d.ts +29 -46
- package/dist/agents/tool-filter.js +8 -31
- package/dist/agents/verify.d.ts +3 -3
- package/dist/brain/anthropic.js +14 -9
- package/dist/brain/errors.d.ts +15 -0
- package/dist/brain/errors.js +10 -0
- package/dist/brain/model-presets.d.ts +4 -4
- package/dist/brain/open-responses.js +15 -10
- package/dist/brain/openai.js +17 -12
- package/dist/brain/provider-dialect.d.ts +39 -3
- package/dist/brain/provider-dialect.js +28 -0
- package/dist/brain/reasoning.d.ts +1 -1
- package/dist/brain/request-params.d.ts +55 -5
- package/dist/brain/request-params.js +35 -3
- package/dist/brain/retry.d.ts +1 -1
- package/dist/brain/route-adjudicator.d.ts +15 -0
- package/dist/brain/route-adjudicator.js +15 -0
- package/dist/brain/stream-engine.js +6 -5
- package/dist/brain/stream-shared.d.ts +1 -1
- package/dist/core/advisor-verdict.d.ts +120 -0
- package/dist/core/advisor-verdict.js +92 -0
- package/dist/core/agent-definition.d.ts +7 -8
- package/dist/core/allow-entry.d.ts +49 -23
- package/dist/core/allow-entry.js +57 -32
- package/dist/core/allow-rule-shadow.d.ts +7 -0
- package/dist/core/approval-object.d.ts +2 -1
- package/dist/core/approval-object.js +6 -6
- package/dist/core/ask-origin.d.ts +63 -11
- package/dist/core/ask-origin.js +27 -5
- package/dist/core/ask-question.js +10 -4
- package/dist/core/auto-compaction.d.ts +11 -8
- package/dist/core/auto-compaction.js +4 -2
- package/dist/core/auto-mode-arming.d.ts +2 -2
- package/dist/core/auto-mode-defaults.d.ts +8 -8
- package/dist/core/auto-mode-prompt-assets.d.ts +3 -3
- package/dist/core/auto-mode-prompt.d.ts +1 -1
- package/dist/core/auto-mode.d.ts +17 -9
- package/dist/core/auto-mode.js +9 -6
- package/dist/core/background-agent-store.d.ts +3 -3
- package/dist/core/canonical-json.d.ts +1 -1
- package/dist/core/canonical-json.js +2 -2
- package/dist/core/checkpoint-requirements.d.ts +6 -3
- package/dist/core/checkpoint-requirements.js +4 -14
- package/dist/core/checkpoint-store.d.ts +80 -51
- package/dist/core/checkpoint-store.js +56 -74
- package/dist/core/child-clamp-seats.d.ts +6 -0
- package/dist/core/child-clamp-seats.js +3 -16
- package/dist/core/compliance.d.ts +2 -2
- package/dist/core/context-edit.d.ts +6 -7
- package/dist/core/cross-boundary-taint.d.ts +9 -3
- package/dist/core/cross-boundary-taint.js +5 -3
- package/dist/core/decision-receipt.js +2 -2
- package/dist/core/effective-path-target.d.ts +1 -1
- package/dist/core/engine-notice.d.ts +19 -5
- package/dist/core/exec-output-tail.d.ts +1 -1
- package/dist/core/file-history-retention.d.ts +1 -1
- package/dist/core/file-history-store.d.ts +59 -9
- package/dist/core/file-history-store.js +35 -17
- package/dist/core/gate-fold.js +3 -2
- package/dist/core/gate-lanes.js +12 -8
- package/dist/core/gate-outcome.d.ts +17 -4
- package/dist/core/gate-outcome.js +30 -0
- package/dist/core/governance-codes.d.ts +13 -3
- package/dist/core/governance-codes.js +10 -0
- package/dist/core/hands-band.d.ts +1 -1
- package/dist/core/hooks.d.ts +4 -4
- package/dist/core/host-target.d.ts +49 -0
- package/dist/core/host-target.js +59 -0
- package/dist/core/image-downsample.d.ts +1 -1
- package/dist/core/lsp-diagnostics.d.ts +4 -4
- package/dist/core/lsp.d.ts +3 -3
- package/dist/core/mailbox-store.d.ts +4 -0
- package/dist/core/mcp-connection-pool.d.ts +18 -2
- package/dist/core/mcp-connection-pool.js +53 -6
- package/dist/core/mcp-failure.d.ts +23 -4
- package/dist/core/mcp-failure.js +26 -11
- package/dist/core/mcp-listing-drift.d.ts +10 -0
- package/dist/core/mcp-listing-drift.js +6 -0
- package/dist/core/mcp-server-link.d.ts +173 -0
- package/dist/core/mcp-server-link.js +127 -0
- package/dist/core/mcp-server-spec.d.ts +4 -2
- package/dist/core/mcp-session-end.d.ts +26 -0
- package/dist/core/mcp-session-end.js +29 -0
- package/dist/core/mcp-startup-request.d.ts +17 -0
- package/dist/core/mcp-startup-request.js +17 -0
- package/dist/core/mcp.d.ts +13 -13
- package/dist/core/mcp.js +187 -162
- package/dist/core/media-byte-cap.d.ts +1 -1
- package/dist/core/memory-engine/engine.d.ts +9 -9
- package/dist/core/memory-engine/provenance-wording.d.ts +1 -1
- package/dist/core/memory-engine/tools.js +4 -1
- package/dist/core/mode-policy.d.ts +1 -1
- package/dist/core/namespaced-rule-name.d.ts +33 -7
- package/dist/core/namespaced-rule-name.js +39 -25
- package/dist/core/output-style.d.ts +1 -1
- package/dist/core/param-rule-reach.d.ts +15 -0
- package/dist/core/param-rule-reach.js +30 -0
- package/dist/core/parent-spec-seat.d.ts +8 -1
- package/dist/core/parent-spec-seat.js +4 -0
- package/dist/core/pause-registry.d.ts +16 -5
- package/dist/core/pause-registry.js +6 -2
- package/dist/core/peer-channel.d.ts +70 -0
- package/dist/core/peer-channel.js +1 -0
- package/dist/core/permission-rule-consent.d.ts +11 -5
- package/dist/core/permission-rule-consent.js +37 -30
- package/dist/core/permission-rule-model.d.ts +233 -64
- package/dist/core/permission-rule-model.js +384 -85
- package/dist/core/permission-rule-provider.d.ts +2 -1
- package/dist/core/permission-rule-store.d.ts +20 -25
- package/dist/core/permission-rule-store.js +1 -4
- package/dist/core/permission-rule-sync.d.ts +11 -2
- package/dist/core/permission-rule-sync.js +8 -1
- package/dist/core/permission-rules.d.ts +49 -11
- package/dist/core/permission-rules.js +123 -89
- package/dist/core/persisted-rule-arms.d.ts +4 -2
- package/dist/core/present-plan-tool.js +3 -1
- package/dist/core/protocol-naming.d.ts +2 -2
- package/dist/core/read-only-shell-table.d.ts +1 -1
- package/dist/core/read-only-shell.d.ts +1 -1
- package/dist/core/roles.d.ts +6 -2
- package/dist/core/roles.js +45 -44
- package/dist/core/rule-offer-read.d.ts +53 -0
- package/dist/core/rule-offer-read.js +146 -0
- package/dist/core/rule-owner.d.ts +46 -0
- package/dist/core/rule-owner.js +28 -0
- package/dist/core/runner/advisor-instructions.d.ts +70 -0
- package/dist/core/runner/advisor-instructions.js +61 -0
- package/dist/core/runner/advisor-tool.d.ts +33 -0
- package/dist/core/runner/advisor-tool.js +112 -0
- package/dist/core/runner/announce-once-ledger.d.ts +4 -26
- package/dist/core/runner/announce-once-ledger.js +14 -46
- package/dist/core/runner/approval-feedback.js +6 -3
- package/dist/core/runner/assemble-result.d.ts +1 -1
- package/dist/core/runner/caller-roster.d.ts +7 -0
- package/dist/core/runner/caller-roster.js +11 -0
- package/dist/core/runner/classifier-ladder.d.ts +27 -5
- package/dist/core/runner/classifier-ladder.js +12 -11
- package/dist/core/runner/compaction-restate.d.ts +10 -6
- package/dist/core/runner/compaction-restate.js +9 -3
- package/dist/core/runner/contracts.d.ts +13 -9
- package/dist/core/runner/conversation-segment.d.ts +28 -0
- package/dist/core/runner/conversation-segment.js +42 -0
- package/dist/core/runner/cross-boundary-lane.d.ts +6 -5
- package/dist/core/runner/cross-boundary-lane.js +26 -15
- package/dist/core/runner/decide-continuation.d.ts +7 -4
- package/dist/core/runner/decide-continuation.js +2 -2
- package/dist/core/runner/denial-limit-arms.d.ts +2 -2
- package/dist/core/runner/derived-route-fallback.d.ts +24 -24
- package/dist/core/runner/derived-route-fallback.js +9 -7
- package/dist/core/runner/gate-exit.d.ts +6 -0
- package/dist/core/runner/gate-exit.js +7 -2
- package/dist/core/runner/initial-run-state.js +1 -1
- package/dist/core/runner/permission-rule-lanes.d.ts +2 -2
- package/dist/core/runner/permission-rule-lanes.js +14 -7
- package/dist/core/runner/person-path-rows.js +1 -1
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -5
- package/dist/core/runner/prepare-acquire-reconcile.js +5 -3
- package/dist/core/runner/prepare-advisor.d.ts +63 -0
- package/dist/core/runner/prepare-advisor.js +77 -0
- package/dist/core/runner/prepare-caps-and-workflow.js +1 -1
- package/dist/core/runner/prepare-config-doors.d.ts +6 -4
- package/dist/core/runner/prepare-config-doors.js +18 -12
- package/dist/core/runner/prepare-delegation-surface.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.js +1 -1
- package/dist/core/runner/prepare-file-history.js +39 -39
- package/dist/core/runner/prepare-gate-stations.d.ts +1 -4
- package/dist/core/runner/prepare-gate-stations.js +2 -7
- package/dist/core/runner/prepare-inherited-gate.d.ts +5 -4
- package/dist/core/runner/prepare-inherited-gate.js +3 -3
- package/dist/core/runner/prepare-park-ask.js +7 -7
- package/dist/core/runner/prepare-policy-chain.d.ts +1 -1
- package/dist/core/runner/prepare-policy-chain.js +4 -10
- package/dist/core/runner/prepare-project-context.d.ts +5 -2
- package/dist/core/runner/prepare-project-context.js +6 -3
- package/dist/core/runner/prepare-prompt-inputs.js +1 -1
- package/dist/core/runner/prepare-protocol-tools.d.ts +2 -2
- package/dist/core/runner/prepare-protocol-tools.js +3 -2
- package/dist/core/runner/prepare-safety-scan.d.ts +9 -12
- package/dist/core/runner/prepare-safety-scan.js +8 -6
- package/dist/core/runner/prepare-task.js +15 -18
- package/dist/core/runner/prepare-tool-disclosure-mount.js +6 -4
- package/dist/core/runner/prepare-wiring-manifest.d.ts +6 -3
- package/dist/core/runner/prepare-wiring-manifest.js +2 -2
- package/dist/core/runner/resume-policy-outcome.js +1 -1
- package/dist/core/runner/retired-runner-deps.js +1 -1
- package/dist/core/runner/run-attachment-seats.js +0 -1
- package/dist/core/runner/run-compaction-machinery.d.ts +1 -1
- package/dist/core/runner/run-compaction-machinery.js +2 -12
- package/dist/core/runner/run-git-lane.d.ts +1 -0
- package/dist/core/runner/run-harness-handlers.js +2 -3
- package/dist/core/runner/run-leg.js +13 -0
- package/dist/core/runner/run-settle-and-teardown.js +1 -1
- package/dist/core/runner/run-telemetry-and-budget-seats.js +1 -1
- package/dist/core/runner/run-turn-boundary.d.ts +1 -0
- package/dist/core/runner/run-turn-boundary.js +14 -12
- package/dist/core/runner/session-rule-policy.d.ts +22 -21
- package/dist/core/runner/session-rule-policy.js +13 -28
- package/dist/core/runner/side-call-account.d.ts +32 -8
- package/dist/core/runner/side-call-account.js +23 -1
- package/dist/core/runner/strict-output-schema.d.ts +1 -1
- package/dist/core/runner/sub-agent-deny-lists.js +4 -3
- package/dist/core/runner/synthetic-tools.d.ts +10 -13
- package/dist/core/runner/synthetic-tools.js +4 -2
- package/dist/core/runner/tool-disclosure.js +2 -1
- package/dist/core/runner/tool-face-overlay.d.ts +2 -1
- package/dist/core/runner/tool-face-overlay.js +17 -1
- package/dist/core/runner/tool-progress-lane.d.ts +2 -2
- package/dist/core/runner/tool-turn-repair-seat.d.ts +3 -2
- package/dist/core/runner/turn-attachments.d.ts +60 -67
- package/dist/core/runner-deps.d.ts +37 -37
- package/dist/core/runtime-caps.d.ts +4 -4
- package/dist/core/safety-merge-corpus.js +17 -1
- package/dist/core/same-plain-value.d.ts +40 -0
- package/dist/core/same-plain-value.js +49 -0
- package/dist/core/scheduler.d.ts +1 -1
- package/dist/core/sensitive-path-policy.d.ts +1 -1
- package/dist/core/sensitive-path-policy.js +1 -1
- package/dist/core/session-policy-store.d.ts +77 -22
- package/dist/core/session-policy-store.js +56 -14
- package/dist/core/session-reconcile.d.ts +2 -2
- package/dist/core/session-store.d.ts +80 -30
- package/dist/core/session-store.js +118 -76
- package/dist/core/session.d.ts +24 -46
- package/dist/core/shared-memory/tools.js +3 -1
- package/dist/core/shared-memory/types.d.ts +1 -1
- package/dist/core/side-query.d.ts +10 -0
- package/dist/core/side-query.js +5 -0
- package/dist/core/store-contracts/checkpoint-store-contract.js +29 -2
- package/dist/core/store-contracts/file-history-store-contract.js +43 -3
- package/dist/core/store-contracts/session-policy-store-contract.d.ts +7 -0
- package/dist/core/store-contracts/session-policy-store-contract.js +130 -0
- package/dist/core/store-contracts/session-repo-contract.js +125 -0
- package/dist/core/store-contracts/session-store-contract.d.ts +4 -7
- package/dist/core/store-contracts/session-store-contract.js +259 -41
- package/dist/core/store-contracts/workflow-journal-store-contract.js +26 -1
- package/dist/core/surrogate-safe-slice.d.ts +3 -3
- package/dist/core/task-event.d.ts +10 -4
- package/dist/core/task-notification.d.ts +3 -3
- package/dist/core/task-registry-agent.d.ts +4 -4
- package/dist/core/task-registry-shared.d.ts +4 -4
- package/dist/core/task-registry-shared.js +1 -0
- package/dist/core/task-registry.d.ts +4 -4
- package/dist/core/task-registry.js +3 -1
- package/dist/core/task-result.d.ts +3 -3
- package/dist/core/task-spec.d.ts +52 -52
- package/dist/core/task-stream.d.ts +6 -6
- package/dist/core/task-tool-shape.d.ts +4 -4
- package/dist/core/tighten-task-spec.d.ts +1 -1
- package/dist/core/tool-catalog-entries.d.ts +19 -2
- package/dist/core/tool-catalog-entries.js +57 -42
- package/dist/core/tool-conformance.js +1 -0
- package/dist/core/tool-errors.d.ts +2 -2
- package/dist/core/tool-face-reader.js +5 -3
- package/dist/core/tool-face.d.ts +21 -2
- package/dist/core/tool-face.js +1 -1
- package/dist/core/tool-model-gate.d.ts +3 -3
- package/dist/core/tool-name-aliases.d.ts +29 -8
- package/dist/core/tool-name-aliases.js +27 -3
- package/dist/core/tool-name-readings.d.ts +5 -8
- package/dist/core/tool-name-readings.js +1 -2
- package/dist/core/tool-policy.d.ts +24 -5
- package/dist/core/tool-policy.js +34 -10
- package/dist/core/tool-registry.d.ts +14 -7
- package/dist/core/tool-registry.js +17 -7
- package/dist/core/tool-result-store.js +2 -1
- package/dist/core/tool-roster.d.ts +47 -18
- package/dist/core/tool-roster.js +53 -32
- package/dist/core/tool-spec-members.js +1 -1
- package/dist/core/tool-spec.d.ts +35 -21
- package/dist/core/tools.js +3 -2
- package/dist/core/trace.d.ts +4 -0
- package/dist/core/untrusted-egress.d.ts +1 -1
- package/dist/core/untrusted-text.d.ts +1 -1
- package/dist/core/warm-resume.d.ts +1 -1
- package/dist/core/wiring-manifest.d.ts +49 -0
- package/dist/core/wiring-manifest.js +13 -5
- package/dist/core/workflow-journal-store.d.ts +62 -0
- package/dist/core/workflow-journal-store.js +77 -1
- package/dist/core/workflow-run-store.d.ts +6 -0
- package/dist/core/workflow-run-store.js +2 -0
- package/dist/engine/compaction/compaction.d.ts +9 -9
- package/dist/engine/execution-env/node-execution-env.d.ts +19 -5
- package/dist/engine/execution-env/node-execution-env.js +43 -22
- package/dist/engine/harness/agent-harness.d.ts +14 -8
- package/dist/engine/harness/agent-harness.js +33 -26
- package/dist/engine/harness/types.d.ts +29 -7
- package/dist/engine/harness/types.js +12 -1
- package/dist/engine/llm/types.d.ts +9 -9
- package/dist/engine/llm/validation.d.ts +4 -1
- package/dist/engine/llm/validation.js +13 -1
- package/dist/engine/loop/agent-loop.d.ts +1 -1
- package/dist/engine/loop/agent-loop.js +10 -8
- package/dist/engine/loop/types.d.ts +15 -13
- package/dist/engine/lsp/node-lsp-manager.d.ts +2 -2
- package/dist/engine/session/memory-repo.d.ts +10 -11
- package/dist/engine/session/memory-repo.js +13 -8
- package/dist/engine/session/parent-chain-guard.d.ts +11 -0
- package/dist/engine/session/parent-chain-guard.js +10 -0
- package/dist/engine/session/repo-utils.d.ts +31 -3
- package/dist/engine/session/repo-utils.js +42 -5
- package/dist/engine/session/storage-base.js +3 -0
- package/dist/index.d.ts +27 -15
- package/dist/index.js +21 -11
- package/dist/internal/harness-types.d.ts +1 -1
- package/dist/internal/harness.d.ts +4 -3
- package/dist/internal/harness.js +3 -2
- package/dist/internal/llm.d.ts +1 -1
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/goal.js +2 -2
- package/dist/orchestration/run-workflow-tool.d.ts +2 -2
- package/dist/orchestration/run-workflow-tool.js +5 -3
- package/dist/orchestration/workflow-size-guideline.d.ts +4 -4
- package/dist/orchestration/workflow-types.d.ts +18 -0
- package/dist/orchestration/workflow-types.js +6 -0
- package/dist/orchestration/workflow.d.ts +2 -13
- package/dist/orchestration/workflow.js +21 -31
- package/dist/prompt-assembly/event-registry.js +1 -0
- package/dist/prompt-assembly/tool-catalog.d.ts +3 -0
- package/dist/prompt-assembly/tool-catalog.js +3 -0
- package/dist/prompts/default.d.ts +14 -14
- package/dist/scenarios/full-body.d.ts +4 -4
- package/dist/stores/file/adoption/adopt.d.ts +4 -3
- package/dist/stores/file/adoption/adopt.js +24 -31
- package/dist/stores/file/adoption/marker.d.ts +6 -13
- package/dist/stores/file/adoption/marker.js +6 -15
- package/dist/stores/file/checkpoint-store.d.ts +3 -0
- package/dist/stores/file/checkpoint-store.js +9 -3
- package/dist/stores/file/file-history-store.d.ts +20 -19
- package/dist/stores/file/file-history-store.js +152 -135
- package/dist/stores/file/fs-atomic.d.ts +15 -0
- package/dist/stores/file/fs-atomic.js +89 -14
- package/dist/stores/file/index.d.ts +1 -1
- package/dist/stores/file/mailbox-store.d.ts +3 -0
- package/dist/stores/file/mailbox-store.js +3 -1
- package/dist/stores/file/permission-rule-adopt.d.ts +1 -1
- package/dist/stores/file/permission-rule-adopt.js +15 -16
- package/dist/stores/file/permission-rule-store.d.ts +18 -2
- package/dist/stores/file/permission-rule-store.js +21 -14
- package/dist/stores/file/session-policy-store.d.ts +3 -3
- package/dist/stores/file/session-store.d.ts +26 -11
- package/dist/stores/file/session-store.js +77 -40
- package/dist/stores/file/workflow-journal-store.d.ts +10 -4
- package/dist/stores/file/workflow-journal-store.js +28 -13
- package/dist/tools/artifact/artifact-text.d.ts +1 -1
- package/dist/tools/artifact/artifact-tool.js +2 -1
- package/dist/tools/fs/bash-readonly-classifier.d.ts +3 -3
- package/dist/tools/fs/fs-bash.d.ts +2 -2
- package/dist/tools/fs/fs-bash.js +3 -1
- package/dist/tools/fs/fs-shared.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +1 -1
- package/dist/tools/fs/notebook.d.ts +2 -2
- package/dist/tools/fs/read-deny.d.ts +29 -7
- package/dist/tools/fs/read-deny.js +63 -22
- package/dist/tools/fs/removal-targets.d.ts +1 -1
- package/dist/tools/fs/safety.d.ts +9 -9
- package/dist/tools/fs/search.d.ts +6 -6
- package/dist/tools/fs/shell-read-check.js +6 -1
- package/dist/tools/fs/shell-read-judge.d.ts +4 -0
- package/dist/tools/fs/shell-read-judge.js +5 -2
- package/dist/tools/loop-tick.d.ts +2 -2
- package/dist/tools/scheduler-tools.js +5 -1
- package/dist/tools/task-list.d.ts +7 -7
- package/dist/tools/task-list.js +5 -1
- package/dist/tools/todo.js +2 -1
- package/dist/tools/web.d.ts +1 -1
- package/dist/tools/web.js +40 -37
- package/dist/tools/worktree.d.ts +3 -3
- package/dist/tools/worktree.js +3 -1
- package/package.json +1 -1
- package/test/export-surface.snapshot.json +5756 -5638
- package/wire-changes/core@7.54.1.json +37 -0
- package/wire-changes/core@7.55.0.json +3318 -0
- package/dist/core/store-contracts/session-store-incarnation-contract.d.ts +0 -39
- package/dist/core/store-contracts/session-store-incarnation-contract.js +0 -95
|
@@ -10,7 +10,7 @@ export interface BackgroundAgentUsage {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* One durable background-agent execution row. Field discipline (design/151 §3.1, HIGH-4): revival
|
|
13
|
-
* re-hydration data is LOOKUP KEYS ONLY (`agentType`/`model`/`name` — the
|
|
13
|
+
* re-hydration data is LOOKUP KEYS ONLY (`agentType`/`model`/`name` — the reference's
|
|
14
14
|
* `.meta.json` sidecar shape) — never a serialized spec and never closures; a tier-3 revival rebuilds
|
|
15
15
|
* the spec the same way a fresh named-teammate spawn would (roster/agent definition + the reviver's
|
|
16
16
|
* deployment assembly).
|
|
@@ -252,8 +252,8 @@ export declare function canAccessAgentRecord(record: Pick<BackgroundAgentRecord,
|
|
|
252
252
|
/** The stale-running reap flip's attribution, written to BOTH `summary` (legacy
|
|
253
253
|
* slot, kept for any out-of-repo reader) and `error` (the field {@link canAccessAgentRecord}-gated
|
|
254
254
|
* durable serving actually renders). One exported constant so the two store implementations (in-memory
|
|
255
|
-
* here, file twin) can never drift apart (RB-74/RB-111 family). Wording carries
|
|
256
|
-
* facts
|
|
255
|
+
* here, file twin) can never drift apart (RB-74/RB-111 family). Wording carries the reference's three
|
|
256
|
+
* facts: what happened (host process gone mid-run), the consequence (in-process state
|
|
257
257
|
* lost), and the action (check the worktree/output for partial work before assuming the task landed). */
|
|
258
258
|
export declare const STALE_RUNNING_REAP_ATTRIBUTION = "the host process was interrupted while this agent was running \u2014 its in-process state was lost. Check its worktree / output file for partial work before assuming the task landed (stale running row reaped).";
|
|
259
259
|
/**
|
|
@@ -50,7 +50,7 @@ import { type ReceiptFault } from "./mods/kernel/receive.js";
|
|
|
50
50
|
* non-JSON values move. That is safe by construction for the persisted ones: the hash is opaque and
|
|
51
51
|
* server-minted, a resume compares the persisted string and never re-serializes.
|
|
52
52
|
*/
|
|
53
|
-
export declare function canonicalize(value: unknown): string;
|
|
53
|
+
export declare function canonicalize(value: unknown, standsAt?: number): string;
|
|
54
54
|
/** What {@link canonicalize} returns when even its top level cannot be encoded — a reader that must never accept a
|
|
55
55
|
* constant (the checkpoint row digest) refuses on it. */
|
|
56
56
|
export declare const UNCANONICALIZABLE = "<uncanonicalizable>";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { types } from "node:util";
|
|
3
3
|
import { describeFault, receive } from "./mods/kernel/receive.js";
|
|
4
|
-
export function canonicalize(value) {
|
|
4
|
+
export function canonicalize(value, standsAt = 0) {
|
|
5
5
|
try {
|
|
6
|
-
return encode(value);
|
|
6
|
+
return encode(value, standsAt);
|
|
7
7
|
}
|
|
8
8
|
catch {
|
|
9
9
|
return UNCANONICALIZABLE;
|
|
@@ -317,6 +317,9 @@ export declare const PENDING_ACTION_REQUIREMENTS: {
|
|
|
317
317
|
readonly pathTarget: {
|
|
318
318
|
readonly digest: "decision-read";
|
|
319
319
|
};
|
|
320
|
+
readonly hostTarget: {
|
|
321
|
+
readonly digest: "decision-read";
|
|
322
|
+
};
|
|
320
323
|
readonly names: {
|
|
321
324
|
readonly word: "call_names";
|
|
322
325
|
};
|
|
@@ -820,6 +823,9 @@ export declare const CHECKPOINT_REQUIREMENTS: {
|
|
|
820
823
|
readonly pathTarget: {
|
|
821
824
|
readonly digest: "decision-read";
|
|
822
825
|
};
|
|
826
|
+
readonly hostTarget: {
|
|
827
|
+
readonly digest: "decision-read";
|
|
828
|
+
};
|
|
823
829
|
readonly names: {
|
|
824
830
|
readonly word: "call_names";
|
|
825
831
|
};
|
|
@@ -873,9 +879,6 @@ export interface UnencodableMember {
|
|
|
873
879
|
readonly path: string;
|
|
874
880
|
readonly kind: "cycle" | "depth" | "function" | "symbol" | "unreadable" | "codec";
|
|
875
881
|
}
|
|
876
|
-
/** Where a value holds something the row digest cannot encode, or `undefined` — the park mint asks this of the
|
|
877
|
-
* arguments before any side effect, so such a call is refused before anything is paused. */
|
|
878
|
-
export declare function unencodableIn(value: unknown, path: string): UnencodableMember | undefined;
|
|
879
882
|
/** The row digest: sha256 (hex) over the binding serializer's canonical form ({@link canonicalize}: type-tagged,
|
|
880
883
|
* sorted keys) of every member a decision reads but the digest itself, keyed by path, each read through
|
|
881
884
|
* {@link digestProjection}. Never a constant: a value it cannot encode throws {@link RowNotEncodable}. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { canonicalize, UNCANONICALIZABLE } from "./canonical-json.js";
|
|
2
|
+
import { canonicalize, MAX_DEPTH, UNCANONICALIZABLE } from "./canonical-json.js";
|
|
3
3
|
import { CHECKPOINT_FEATURES, checkpointVersionOf, encodeAtFidelity } from "./checkpoint-store.js";
|
|
4
4
|
export const REQUIREMENT_WORDS = Object.freeze([
|
|
5
5
|
"resource",
|
|
@@ -126,6 +126,7 @@ export const PENDING_ACTION_REQUIREMENTS = {
|
|
|
126
126
|
implementationRevision: DECISION_READ,
|
|
127
127
|
family: DECISION_READ,
|
|
128
128
|
pathTarget: DECISION_READ,
|
|
129
|
+
hostTarget: DECISION_READ,
|
|
129
130
|
names: { word: "call_names" },
|
|
130
131
|
targets: { word: "approval_targets" },
|
|
131
132
|
hasBidiControls: SHOWN,
|
|
@@ -212,7 +213,7 @@ class RowNotEncodable extends Error {
|
|
|
212
213
|
this.at = at;
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
|
-
const DIGEST_DEPTH_CAP =
|
|
216
|
+
const DIGEST_DEPTH_CAP = MAX_DEPTH + 1;
|
|
216
217
|
function digestProjection(value, path, depth, open) {
|
|
217
218
|
if (typeof value === "function")
|
|
218
219
|
throw new RowNotEncodable({ path, kind: "function" });
|
|
@@ -255,24 +256,13 @@ function digestProjection(value, path, depth, open) {
|
|
|
255
256
|
open.delete(value);
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
|
-
export function unencodableIn(value, path) {
|
|
259
|
-
try {
|
|
260
|
-
digestProjection(value, path, 1, new Set());
|
|
261
|
-
return undefined;
|
|
262
|
-
}
|
|
263
|
-
catch (e) {
|
|
264
|
-
if (e instanceof RowNotEncodable)
|
|
265
|
-
return e.at;
|
|
266
|
-
throw e;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
259
|
export function requirementsDigestOf(cp) {
|
|
270
260
|
const held = Object.create(null);
|
|
271
261
|
const open = new Set();
|
|
272
262
|
for (const m of membersOf(cp))
|
|
273
263
|
if (m.path !== "requirementsDigest")
|
|
274
264
|
held[m.path] = digestProjection(m.value, m.path, 1, open);
|
|
275
|
-
const canonical = canonicalize(held);
|
|
265
|
+
const canonical = canonicalize(held, -1);
|
|
276
266
|
if (canonical === UNCANONICALIZABLE)
|
|
277
267
|
throw new RowNotEncodable({ path: "(row)", kind: "unreadable" });
|
|
278
268
|
return createHash("sha256").update(canonical, "utf8").digest("hex");
|
|
@@ -266,12 +266,17 @@ export declare function normalizeProbeCause(value: unknown): ProbeCause | undefi
|
|
|
266
266
|
* - (1 reserved — least-severe / informational; not expected from these gates.)
|
|
267
267
|
* `egress` dominates the shell coarse-grade (an explicitly egress-marked shell tighten is still ≥3). A future
|
|
268
268
|
* arm may refine this — but only with a stated reason, and the ORDERING must stay monotone in risk.
|
|
269
|
+
* Total over what a stored row can hold, never a throw: a value that is not a plain record ({@link isPlainRecord}) has
|
|
270
|
+
* no tier (`undefined`); a mark that is neither absent nor a boolean contributes nothing, the valid `true` marks give
|
|
271
|
+
* their floor, and "nothing tripped" (tier 2) is not claimed past a damaged mark. A caller projecting a stored row
|
|
272
|
+
* discloses the damage ({@link summarizeCheckpoint}'s `disclose`).
|
|
269
273
|
*/
|
|
270
274
|
export declare function riskSeverity(axes: {
|
|
271
275
|
egress?: boolean;
|
|
272
276
|
irreversible?: boolean;
|
|
273
277
|
shell?: boolean;
|
|
274
278
|
}): 1 | 2 | 3 | 4 | 5;
|
|
279
|
+
export declare function riskSeverity(axes: unknown): 1 | 2 | 3 | 4 | 5 | undefined;
|
|
275
280
|
/** design S1e: the char cap for the {@link CheckpointSummary.toolInput} BOUNDED raw preview of a
|
|
276
281
|
* `tool_approval` pendingAction's `args` (`JSON.stringify`-ed). Caps the `listByScope` payload size; over-cap
|
|
277
282
|
* is truncated with a trailing `…`. Bounded raw (NOT neutralized) — redaction is the consumer's job (echo-only). */
|
|
@@ -882,6 +887,11 @@ export type PendingAction = {
|
|
|
882
887
|
*/
|
|
883
888
|
family?: import("./tool-face.js").ToolFamily;
|
|
884
889
|
pathTarget?: import("./tool-face.js").ToolRosterPathTarget;
|
|
890
|
+
/** The URL slot the parked call's host rules were read on (`ToolCallFace.hostTarget`), off the same roster row at the same
|
|
891
|
+
* mint: the pre-CAS recheck judges an edit on it, and the approval object binds it (a resume whose tool now names another
|
|
892
|
+
* slot is vetoed, `resume.target_moved`). Absent ⇒ the tool declared none, or a row minted before the member: a deny or an
|
|
893
|
+
* ask by host is then judged on the catalog's slot for the name, and no allow by host reaches the call. */
|
|
894
|
+
hostTarget?: import("./tool-face.js").ToolHostTarget;
|
|
885
895
|
/** The names the parked call answered to, copied from the face the gate judged it under (`ToolCallFace.names`: the
|
|
886
896
|
* model's spelling first, then the wire name and the other aliases that resolve to it; a row minted before the
|
|
887
897
|
* spelling led carries the wire name first) — the pre-CAS recheck judges an edit against rules written on any of
|
|
@@ -1080,12 +1090,12 @@ export interface CheckpointState {
|
|
|
1080
1090
|
*/
|
|
1081
1091
|
pendingSteerQueue?: PendingSteerEntry[];
|
|
1082
1092
|
/**
|
|
1083
|
-
* SR-7 (
|
|
1084
|
-
*
|
|
1093
|
+
* SR-7 (orphaned-background-task notice, resume leg
|
|
1094
|
+
* under the `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` gate — the cloud-worker restart
|
|
1085
1095
|
* leg, exactly sema's durable-resume shape): the background tasks (pending/running, this run's
|
|
1086
1096
|
* owner triple) still ALIVE at suspend. Background processes never survive a suspend (design/103
|
|
1087
1097
|
* §3.7 unconditional dispose + killed receipts), so on resume any snapshot entry NOT
|
|
1088
|
-
* alive in the resume leg's registry is an ORPHAN — aggregated into ONE
|
|
1098
|
+
* alive in the resume leg's registry is an ORPHAN — aggregated into ONE "The container
|
|
1089
1099
|
* was restarted…" reminder appended to the resume continuation (single message: header +
|
|
1090
1100
|
* `- description (task id)` list + re-create instruction; never a per-task barrage). A survivor
|
|
1091
1101
|
* (session-resident shell / in-window monitor) is excluded — still reachable via TaskOutput/
|
|
@@ -1883,6 +1893,43 @@ export interface CheckpointRow {
|
|
|
1883
1893
|
/** Epoch ms the store stamped {@link executionOutcome} at. Present iff `executionOutcome` is. */
|
|
1884
1894
|
executionAtMs?: number;
|
|
1885
1895
|
}
|
|
1896
|
+
/**
|
|
1897
|
+
* The immutable, indexable facts of one checkpoint row: what core minted on it and nothing later moves. A backend that
|
|
1898
|
+
* keeps columns beside the stored row writes them from {@link checkpointIndexFacts}, the one derivation. Not here: the
|
|
1899
|
+
* state the CAS faces move (`status`, `rev`, `reopenReason`, the execution record), values a deployment mints (an
|
|
1900
|
+
* abandonment backstop), display projections a deployment bounds or redacts, and the deadline FACET — a reading of the
|
|
1901
|
+
* pause registry, which a stored copy would freeze ({@link import("./pause-registry.js").CARD_FACET_OVERRIDES}).
|
|
1902
|
+
* Every member is present; `null` = the row carries none.
|
|
1903
|
+
*/
|
|
1904
|
+
export interface CheckpointIndexFacts {
|
|
1905
|
+
readonly token: CheckpointToken;
|
|
1906
|
+
readonly scope: string;
|
|
1907
|
+
readonly sessionId: string;
|
|
1908
|
+
/** {@link checkpointVersionOf}. */
|
|
1909
|
+
readonly version: number;
|
|
1910
|
+
readonly gateKind: CheckpointGate["kind"];
|
|
1911
|
+
/**
|
|
1912
|
+
* The approval gate's stored card word AS STORED: a member of `TOOL_APPROVAL_CARDS`, or a string outside it (kept, so
|
|
1913
|
+
* a later engine that knows the word reads the column right); `null` for a non-string, no card, or a gate that is not
|
|
1914
|
+
* an approval. Never a derived facet: a facet predicate over this column is generated from `CARD_FACET_OVERRIDES` (its
|
|
1915
|
+
* keys `IN (…)` take the key's facet, anything else the gate kind's). Read off the gate alone — independent of the
|
|
1916
|
+
* pending action's own members (offers, the absence word), so a backfill of one never presumes the other's.
|
|
1917
|
+
*/
|
|
1918
|
+
readonly approvalCard: string | null;
|
|
1919
|
+
/** The pending tool call's name, id and bound input hash (a `tool_approval` pending action only). */
|
|
1920
|
+
readonly toolName: string | null;
|
|
1921
|
+
readonly toolCallId: string | null;
|
|
1922
|
+
readonly boundInputHash: string | null;
|
|
1923
|
+
readonly deadline: number | null;
|
|
1924
|
+
readonly createdAt: number;
|
|
1925
|
+
/** The approval gate's descriptor, the row's own object (display only; serialize it, do not mutate it). */
|
|
1926
|
+
readonly riskDescriptor: RiskDescriptor | null;
|
|
1927
|
+
/** The park mint's directional-control bit, presence only: `true`, or `null` — not recorded, never "clean". */
|
|
1928
|
+
readonly hasBidiControls: true | null;
|
|
1929
|
+
}
|
|
1930
|
+
/** Derive a row's {@link CheckpointIndexFacts}. Pure: reads no clock, writes nothing; the approval card is read
|
|
1931
|
+
* through {@link parkedApprovalCardOf} (the one card reading), the tool fields only off a `tool_approval` action. */
|
|
1932
|
+
export declare function checkpointIndexFacts(cp: Checkpoint): CheckpointIndexFacts;
|
|
1886
1933
|
/**
|
|
1887
1934
|
* design/80 assistant-scheduler seam #1: a LIGHTWEIGHT projection of one PENDING
|
|
1888
1935
|
* checkpoint, returned in bulk by {@link CheckpointStore.listByScope} so a supervisor scheduler can list a
|
|
@@ -1905,7 +1952,9 @@ export interface CheckpointSummary {
|
|
|
1905
1952
|
* `irreversible_ask` approval escalations), derived via {@link riskSeverity} from the descriptor's axes —
|
|
1906
1953
|
* the SAME value as `gate.riskDescriptor.severity`, recomputed from the single source helper rather than
|
|
1907
1954
|
* re-stored. `undefined` for a gate with no descriptor (resource_limit / needs_review / plan_review / a
|
|
1908
|
-
* legacy human ask minted before D-E). The inbox sorts DESC by this.
|
|
1955
|
+
* legacy human ask minted before D-E). The inbox sorts DESC by this. Also `undefined` for a descriptor whose axes
|
|
1956
|
+
* prove no tier (not a plain record, or damaged marks and no valid `true` one) — damage, not a low risk: the
|
|
1957
|
+
* projection then calls its `disclose` once, so such a row does not sink below the graded rows unannounced. */
|
|
1909
1958
|
severity?: 1 | 2 | 3 | 4 | 5;
|
|
1910
1959
|
/** Cumulative spend debited to this suspend chain ({@link ResourceLedger.spentMicroUsd}) in micro-USD —
|
|
1911
1960
|
* present whenever the checkpoint carries a {@link Checkpoint.resourceLedger} (every resource_limit suspend,
|
|
@@ -2067,9 +2116,12 @@ export interface CheckpointSummary {
|
|
|
2067
2116
|
* {@link CheckpointSummary}. Shared by every {@link CheckpointStore} impl so the projection is IDENTICAL
|
|
2068
2117
|
* across the in-memory, file, and durable backends (the anti-drift guard) — `severity` always derives from the
|
|
2069
2118
|
* gate's {@link RiskDescriptor} via the single {@link riskSeverity} helper, `spentMicroUsd` always reads
|
|
2070
|
-
* {@link ResourceLedger.spentMicroUsd}. Pure; reads no clock/random.
|
|
2119
|
+
* {@link ResourceLedger.spentMicroUsd}. Pure; reads no clock/random. `disclose` receives one sentence for a damage the
|
|
2120
|
+
* projection reads past — descriptor axes that are not a plain record, or a mark that is not a boolean (the `severity`
|
|
2121
|
+
* is then the valid marks' floor, or omitted) — naming the row by checkpoint id and session (never its token) and the member by its
|
|
2122
|
+
* shape (never its value); it is called synchronously and every listing calls it again. A store hands it its own seat.
|
|
2071
2123
|
*/
|
|
2072
|
-
export declare function summarizeCheckpoint(cp: Checkpoint): CheckpointSummary;
|
|
2124
|
+
export declare function summarizeCheckpoint(cp: Checkpoint, disclose?: (sentence: string) => void): CheckpointSummary;
|
|
2073
2125
|
/**
|
|
2074
2126
|
* WHICH arm of a multi-arm {@link CheckpointError} `code` fired (requested 2026-08-10: a deployment retry
|
|
2075
2127
|
* policy needs to tell "a newer worker can redeem this row" from "this row is damaged/caller-declared and
|
|
@@ -2119,10 +2171,11 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
|
|
|
2119
2171
|
* 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
|
|
2120
2172
|
* (`"renamed_mount"`); the process-wide table of declared names is occupied by a value that is not the engine's (`"registry_occupied"`). */
|
|
2121
2173
|
| "not_a_list" | "not_a_string" | "unknown_name" | "unsupported_pattern" | "invalid_record" | "renamed_mount" | "registry_occupied"
|
|
2122
|
-
/** On `
|
|
2123
|
-
* a word the model catalog does not hold (`"unknown_model_ref"`),
|
|
2124
|
-
* (`"not_a_model_ref"`)
|
|
2125
|
-
|
|
2174
|
+
/** 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`)
|
|
2175
|
+
* — 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
|
|
2176
|
+
* 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
|
|
2177
|
+
* `modelRole` value (`"unknown_role_word"`). The sentence names the seat the refusal's `field` names (`roles.consolidate`, `tiers.pro`, `TaskSpec.model`). */
|
|
2178
|
+
| "unknown_model_ref" | "not_a_model_ref" | "unknown_role_word";
|
|
2126
2179
|
/**
|
|
2127
2180
|
* The codes a RESUME's pre-claim configuration screen carries as `detail.code` of a `checkpoint.config_refused` — the words prepare's
|
|
2128
2181
|
* doors throw, held unchanged so one refusal reads the same on a fresh run (`TaskResult.errorCode`) and on a resume: the mode, output-style,
|
|
@@ -2131,7 +2184,7 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
|
|
|
2131
2184
|
* re-supplied config and the deployment's deps (`configValueDoors`, the rest): the retired deps seats and caller-policy members
|
|
2132
2185
|
* (`config.deps_retired_key`), the peer presence, the restore selector, the microCompact knob, the prompt selectors, `resumeAt` on a resume
|
|
2133
2186
|
* (`resume_at.conflicts_resume`, `resume_at.mode_without_target` — a resume carrying `resumeAt` is refused as a conflict before its mode is
|
|
2134
|
-
* 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,
|
|
2187
|
+
* 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,
|
|
2135
2188
|
* 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`,
|
|
2136
2189
|
* `config.locked_key`), an MCP server's content class, the skills-listing seats (`config.skill_listing_budget_invalid`), the limits and the
|
|
2137
2190
|
* resource-suspend knobs, the attachment modes, the governance windows, the brain-call guardrail and the retention declaration over the stores the leg
|
|
@@ -2140,9 +2193,12 @@ export type CheckpointErrorReason = "version_newer" | "env_factory_missing" | "g
|
|
|
2140
2193
|
* a skill's `baseDir` by its own reader, `config.skill_base_dir_invalid`). A door not entered here (the leg's model, its rebuilt
|
|
2141
2194
|
* 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").
|
|
2142
2195
|
*/
|
|
2143
|
-
export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid"];
|
|
2196
|
+
export declare const CHECKPOINT_CONFIG_REFUSAL_CODES: readonly ["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid"];
|
|
2144
2197
|
export type CheckpointConfigRefusalCode = (typeof CHECKPOINT_CONFIG_REFUSAL_CODES)[number];
|
|
2145
2198
|
export declare const isCheckpointConfigRefusalCode: (word: unknown) => word is CheckpointConfigRefusalCode;
|
|
2199
|
+
/** 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
|
|
2200
|
+
* `docs/CLOSED-SETS.md`: a consumer holding a table over it is tsc-red on a new word until it places the word. */
|
|
2201
|
+
export type CheckpointErrorField = "boundCallId" | "boundInputHash" | "boundGrantDigest" | "answer" | "hostDecision" | "approver" | "feedback" | "taskConfig" | "deps" | "inheritedGate";
|
|
2146
2202
|
/** A typed checkpoint-store error so callers branch on `code` (mirrors `SessionError`). */
|
|
2147
2203
|
export declare class CheckpointError extends Error {
|
|
2148
2204
|
readonly code: "checkpoint.already_exists" | "checkpoint.already_resolved" | "checkpoint.not_found"
|
|
@@ -2318,14 +2374,15 @@ export declare class CheckpointError extends Error {
|
|
|
2318
2374
|
* `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
|
|
2319
2375
|
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2320
2376
|
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2321
|
-
* it)
|
|
2377
|
+
* 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,
|
|
2378
|
+
* or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
|
|
2322
2379
|
* (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
|
|
2323
2380
|
* 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
|
|
2324
2381
|
* sites always knew which arm fired; this carries that fact instead of dropping it (ruled
|
|
2325
2382
|
* 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
|
|
2326
2383
|
* discriminant. */
|
|
2327
2384
|
readonly detail?: {
|
|
2328
|
-
field?:
|
|
2385
|
+
field?: CheckpointErrorField;
|
|
2329
2386
|
/** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
|
|
2330
2387
|
* word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
|
|
2331
2388
|
code?: CheckpointConfigRefusalCode;
|
|
@@ -2521,14 +2578,15 @@ export declare class CheckpointError extends Error {
|
|
|
2521
2578
|
* `person`/`sla_timeout`/`policy`, pair the sweep's `sla_timeout` with an allow or put it on a row a sweep does not
|
|
2522
2579
|
* resolve, or try to supply the minted record), or — design/252 G-7 — `"approver"` (the attribution is not a
|
|
2523
2580
|
* well-formed identifier: re-decide with a plain, bounded, control-character-free string, or omit
|
|
2524
|
-
* it)
|
|
2581
|
+
* 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,
|
|
2582
|
+
* or rides a decide a machine made: re-decide with the words changed or dropped; the binding did not change). On a `checkpoint.config_refused` `field` names which INPUT carries the refusal — `"taskConfig"`
|
|
2525
2583
|
* (the re-supplied config: correct it and resume the same token), `"deps"` (the deployment's own seat — and the policies the
|
|
2526
2584
|
* 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
|
|
2527
2585
|
* sites always knew which arm fired; this carries that fact instead of dropping it (ruled
|
|
2528
2586
|
* 2026-08-03, cross-repo HITL discussion). Additive and optional — `code` remains the only REQUIRED
|
|
2529
2587
|
* discriminant. */
|
|
2530
2588
|
detail?: {
|
|
2531
|
-
field?:
|
|
2589
|
+
field?: CheckpointErrorField;
|
|
2532
2590
|
/** On `checkpoint.config_refused` — prepare's own code for the refusal ({@link CheckpointConfigRefusalCode}), the
|
|
2533
2591
|
* word a fresh run of the same bad config reports as its `errorCode`. Absent on every other code. */
|
|
2534
2592
|
code?: CheckpointConfigRefusalCode;
|
|
@@ -2649,41 +2707,6 @@ export declare function encodeAtFidelity(fidelity: StoreFidelity, value: unknown
|
|
|
2649
2707
|
ok: false;
|
|
2650
2708
|
cause: unknown;
|
|
2651
2709
|
};
|
|
2652
|
-
/**
|
|
2653
|
-
* CONSERVATIVE "these two are provably the same value" for deciding whether a {@link encodeAtFidelity}
|
|
2654
|
-
* projection moved anything, and whether a policy's rewrite names the very value about to be filed.
|
|
2655
|
-
*
|
|
2656
|
-
* Deliberately NOT the binding hash, which is the wrong instrument for this question in two directions:
|
|
2657
|
-
* it folds `-0` onto `0` (a real projection change the policy may care about, invisible to the hash), and
|
|
2658
|
-
* it is a digest, so a collision would read as sameness. `Object.is` at the leaves keeps the `-0`
|
|
2659
|
-
* distinction; comparing own-key SETS keeps the dropped `undefined`-valued key visible.
|
|
2660
|
-
*
|
|
2661
|
-
* Conservative on purpose — the answer it must never give wrongly is TRUE, because both callers read
|
|
2662
|
-
* TRUE as "nothing moved / the policy named this very value" and act by filing. So sameness has to be
|
|
2663
|
-
* PROVED, not merely un-disproved:
|
|
2664
|
-
* - the PROTOTYPES must match and be the plain-object or array one. `[object Object]` is not proof of
|
|
2665
|
-
* a plain object — a class instance and a null-prototype object both report it, and a tool executing
|
|
2666
|
-
* the arguments can observe inherited behaviour. (Neither input to the projection comparison can be
|
|
2667
|
-
* such a value: `structuredClone` and `JSON.parse` both produce plain data. A policy's rewrite can.)
|
|
2668
|
-
* - own keys are compared with `Reflect.ownKeys` and POSITIONALLY, so a SYMBOL key or a non-enumerable
|
|
2669
|
-
* property on one side is a difference rather than an invisible extra, and so is a different order
|
|
2670
|
-
* (which `Object.keys`, `JSON.stringify` and any tool iterating its arguments can see).
|
|
2671
|
-
* - properties are compared through their DESCRIPTORS — every flag, so a frozen object is not the
|
|
2672
|
-
* mutable value a JSON decode produces — and an accessor on either side answers FALSE without being
|
|
2673
|
-
* read: an approval decision must not be made by running deployment code, and what a getter returns
|
|
2674
|
-
* need not be the same twice.
|
|
2675
|
-
* - reference TOPOLOGY counts: two properties that share one object are not two properties holding
|
|
2676
|
-
* equal objects, and a JSON round trip is precisely what turns the first into the second.
|
|
2677
|
-
* - what it CANNOT prove on its own is that the value it inspected answers ordinary reads the way its
|
|
2678
|
-
* descriptors did — a Proxy reports the target's descriptors and can return anything from a `get`.
|
|
2679
|
-
* A caller comparing a value it did not construct must first establish that it is an inert data
|
|
2680
|
-
* graph (the capture clone does exactly that, and refuses a Proxy outright).
|
|
2681
|
-
* - any brand outside plain object/array that is not already reference-identical answers FALSE (a Date
|
|
2682
|
-
* is never the string a JSON codec leaves behind, a Map is never the `{}`), and so does any
|
|
2683
|
-
* inspection that throws.
|
|
2684
|
-
* An uncertain answer therefore costs a policy consultation or a park, never a silently filed value.
|
|
2685
|
-
*/
|
|
2686
|
-
export declare function samePlainValue(a: unknown, b: unknown): boolean;
|
|
2687
2710
|
export interface CheckpointStore {
|
|
2688
2711
|
/**
|
|
2689
2712
|
* Managed-retention declaration (ruled 2026-08-05, retention.ts): `"managed"` promises the
|
|
@@ -3119,6 +3142,12 @@ export declare class InMemoryCheckpointStore implements CheckpointStore {
|
|
|
3119
3142
|
};
|
|
3120
3143
|
private cps;
|
|
3121
3144
|
private fault;
|
|
3145
|
+
private readonly disclose;
|
|
3146
|
+
/** `disclose` is the listing projection's own seat ({@link summarizeCheckpoint}'s): this store has no path, so it
|
|
3147
|
+
* forwards the projection's sentence for a row read past a damage, called synchronously by {@link listByScope}. */
|
|
3148
|
+
constructor(opts?: {
|
|
3149
|
+
disclose?: (sentence: string) => void;
|
|
3150
|
+
});
|
|
3122
3151
|
put(token: CheckpointToken, cp: Checkpoint): Promise<void>;
|
|
3123
3152
|
get(token: CheckpointToken): Promise<Checkpoint | null>;
|
|
3124
3153
|
/** The loser's single-round-trip reading (claim law 1): what the row IS, in its own vocabulary —
|
|
@@ -50,17 +50,19 @@ export function normalizeProbeCause(value) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
export function riskSeverity(axes) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
return readRiskAxes(axes).tier;
|
|
54
|
+
}
|
|
55
|
+
function readRiskAxes(axes) {
|
|
56
|
+
const word = (v) => (v === undefined ? "absent" : v === null ? "null" : Array.isArray(v) ? "an array" : typeof v === "object" ? "an object" : `a ${typeof v}`);
|
|
57
|
+
if (!isPlainRecord(axes))
|
|
58
|
+
return { tier: undefined, problem: `${word(axes)}${typeof axes === "object" && axes !== null && !Array.isArray(axes) ? " that is not a plain record" : ""}` };
|
|
59
|
+
const damaged = [];
|
|
60
|
+
const mark = (name, v) => (v === undefined || typeof v === "boolean" ? v === true : (damaged.push(`\`${name}\` mark is ${word(v)}`), false));
|
|
61
|
+
const egress = mark("egress", axes.egress);
|
|
62
|
+
const irreversible = mark("irreversible", axes.irreversible);
|
|
63
|
+
const shell = mark("shell", axes.shell);
|
|
64
|
+
const proven = irreversible && egress ? 5 : irreversible ? 4 : egress || shell ? 3 : 2;
|
|
65
|
+
return damaged.length === 0 ? { tier: proven } : { tier: proven === 2 ? undefined : proven, problem: `a record whose ${damaged.join(" and ")}, not a boolean` };
|
|
64
66
|
}
|
|
65
67
|
const SUMMARY_CMD_MAX = 200;
|
|
66
68
|
const SUMMARY_VALUE_MAX = 120;
|
|
@@ -248,9 +250,34 @@ export function remainingTokens(ledger) {
|
|
|
248
250
|
return Math.max(0, total - (spent ?? 0));
|
|
249
251
|
}
|
|
250
252
|
export { REOPEN_REASONS } from "./resume-startup-cause.js";
|
|
251
|
-
export function
|
|
252
|
-
const
|
|
253
|
-
const
|
|
253
|
+
export function checkpointIndexFacts(cp) {
|
|
254
|
+
const gate = cp.gate;
|
|
255
|
+
const card = parkedApprovalCardOf(gate);
|
|
256
|
+
const tool = cp.pendingAction.kind === "tool_approval" ? cp.pendingAction : undefined;
|
|
257
|
+
return {
|
|
258
|
+
token: cp.token,
|
|
259
|
+
scope: cp.scope,
|
|
260
|
+
sessionId: cp.sessionId,
|
|
261
|
+
version: checkpointVersionOf(cp),
|
|
262
|
+
gateKind: gate.kind,
|
|
263
|
+
approvalCard: card.kind === "card" ? card.card : card.kind === "unknown_word" && typeof card.word === "string" ? card.word : null,
|
|
264
|
+
toolName: tool?.toolName ?? null,
|
|
265
|
+
toolCallId: tool?.toolCallId ?? null,
|
|
266
|
+
boundInputHash: tool?.boundInputHash ?? null,
|
|
267
|
+
deadline: cp.deadline ?? null,
|
|
268
|
+
createdAt: cp.createdAt,
|
|
269
|
+
riskDescriptor: card.kind !== "not_approval" && "riskDescriptor" in gate ? (gate.riskDescriptor ?? null) : null,
|
|
270
|
+
hasBidiControls: tool?.hasBidiControls === true ? true : null,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
export function summarizeCheckpoint(cp, disclose) {
|
|
274
|
+
const facts = checkpointIndexFacts(cp);
|
|
275
|
+
const descriptor = facts.riskDescriptor;
|
|
276
|
+
const axes = descriptor === null ? undefined : readRiskAxes(descriptor?.axes);
|
|
277
|
+
const severity = axes?.tier;
|
|
278
|
+
if (axes?.problem !== undefined) {
|
|
279
|
+
disclose?.(`checkpoint ${JSON.stringify(cp.checkpointId ?? null)} of session ${JSON.stringify(cp.sessionId)}: the risk descriptor's axes are ${axes.problem} — ${severity === undefined ? "the summary carries no severity" : `the summary's severity ${severity} is read from the valid marks`}`);
|
|
280
|
+
}
|
|
254
281
|
const cardReading = parkedApprovalCardOf(cp.gate);
|
|
255
282
|
const tool = cp.pendingAction.kind === "tool_approval" ? cp.pendingAction : undefined;
|
|
256
283
|
let toolInput;
|
|
@@ -266,21 +293,22 @@ export function summarizeCheckpoint(cp) {
|
|
|
266
293
|
}
|
|
267
294
|
}
|
|
268
295
|
const hasBidi = tool !== undefined &&
|
|
269
|
-
(
|
|
296
|
+
(facts.hasBidiControls === true ||
|
|
270
297
|
carriesBidiControls([toolInput, tool.preview], { maxNodes: BIDI_BACKFILL_MAX_NODES, maxChars: BIDI_BACKFILL_MAX_CHARS }));
|
|
271
298
|
return {
|
|
272
|
-
token:
|
|
299
|
+
token: facts.token,
|
|
273
300
|
...(cp.checkpointId !== undefined ? { checkpointId: cp.checkpointId } : {}),
|
|
274
|
-
sessionId:
|
|
275
|
-
scope:
|
|
276
|
-
gateKind:
|
|
301
|
+
sessionId: facts.sessionId,
|
|
302
|
+
scope: facts.scope,
|
|
303
|
+
gateKind: facts.gateKind,
|
|
277
304
|
...(severity !== undefined ? { severity } : {}),
|
|
278
305
|
...(cp.resourceLedger !== undefined ? { spentMicroUsd: cp.resourceLedger.spentMicroUsd } : {}),
|
|
279
|
-
...(
|
|
280
|
-
createdAt:
|
|
306
|
+
...(facts.deadline !== null ? { deadline: facts.deadline } : {}),
|
|
307
|
+
createdAt: facts.createdAt,
|
|
281
308
|
...(cp.sourceTaskId !== undefined ? { sourceTaskId: cp.sourceTaskId } : {}),
|
|
282
309
|
...(cp.principal !== undefined ? { principal: cp.principal } : {}),
|
|
283
|
-
...(
|
|
310
|
+
...(facts.toolCallId !== null ? { toolCallId: facts.toolCallId } : {}),
|
|
311
|
+
...(facts.toolName !== null ? { toolName: facts.toolName } : {}),
|
|
284
312
|
...(cardReading.kind === "card" ? { approvalCard: cardReading.card } : {}),
|
|
285
313
|
...(toolInput !== undefined ? { toolInput } : {}),
|
|
286
314
|
...(cp.state.workspaceHandle !== undefined
|
|
@@ -305,7 +333,7 @@ export function summarizeCheckpoint(cp) {
|
|
|
305
333
|
...(hasBidi ? { hasBidiControls: true } : {}),
|
|
306
334
|
};
|
|
307
335
|
}
|
|
308
|
-
export const CHECKPOINT_CONFIG_REFUSAL_CODES = Object.freeze(["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid"]);
|
|
336
|
+
export const CHECKPOINT_CONFIG_REFUSAL_CODES = Object.freeze(["config.spec_retired_key", "config.output_style_invalid", "config.permission_mode_invalid", "config.shell_gate_value_retired", "config.approval_reach_invalid", "config.user_invoked_skill_unknown", "config.skill_deny_unreadable", "config.user_attachment_invalid", "config.tool_face_control", "config.deps_retired_key", "config.peer_presence_invalid", "config.tool_model_gate_invalid", "config.microcompact_invalid", "config.prompt_selector_invalid", "resume_at.conflicts_resume", "resume_at.mode_without_target", "config.read_face_invalid", "config.write_face_invalid", "config.invalid_argument", "config.tool_face_invalid", "config.memory_delegation_evidence", "config.memory_provenance", "config.memory_capture_policy", "config.cross_boundary_posture", "config.advisor_tool_invalid", "config.advisor_model_invalid", "config.auto_consolidation", "config.unknown_role", "config.tool_materialize_invalid", "config.memory_persistence_invalid", "config.tool_materialize_unreachable", "config.locked_registry", "config.locked_key", "config.mcp_content_class", "config.skill_listing_budget_invalid", "config.limit_unknown_key", "config.limit_invalid", "config.attachment_invalid", "config.usage_window_invalid", "config.brain_call_guardrail_invalid", "config.retention_policy", "config.retention_capability", "config.invalid_checkpoint_store", "config.skill_base_dir_invalid"]);
|
|
309
337
|
export const isCheckpointConfigRefusalCode = (word) => CHECKPOINT_CONFIG_REFUSAL_CODES.some((w) => w === word);
|
|
310
338
|
export class CheckpointError extends Error {
|
|
311
339
|
code;
|
|
@@ -339,56 +367,6 @@ export function encodeAtFidelity(fidelity, value) {
|
|
|
339
367
|
return { ok: false, cause: err };
|
|
340
368
|
}
|
|
341
369
|
}
|
|
342
|
-
const MAX_SAME_VALUE_DEPTH = 256;
|
|
343
|
-
export function samePlainValue(a, b) {
|
|
344
|
-
return sameValueAt(a, b, 0, new Map(), new Map());
|
|
345
|
-
}
|
|
346
|
-
function sameValueAt(a, b, depth, aToB, bToA) {
|
|
347
|
-
if (Object.is(a, b))
|
|
348
|
-
return true;
|
|
349
|
-
if (depth >= MAX_SAME_VALUE_DEPTH)
|
|
350
|
-
return false;
|
|
351
|
-
if (a === null || b === null || typeof a !== "object" || typeof b !== "object")
|
|
352
|
-
return false;
|
|
353
|
-
try {
|
|
354
|
-
const pairedWithA = aToB.get(a);
|
|
355
|
-
const pairedWithB = bToA.get(b);
|
|
356
|
-
if (pairedWithA !== undefined || pairedWithB !== undefined)
|
|
357
|
-
return pairedWithA === b && pairedWithB === a;
|
|
358
|
-
aToB.set(a, b);
|
|
359
|
-
bToA.set(b, a);
|
|
360
|
-
const proto = Object.getPrototypeOf(a);
|
|
361
|
-
if (proto !== Object.getPrototypeOf(b))
|
|
362
|
-
return false;
|
|
363
|
-
if (proto !== Object.prototype && proto !== Array.prototype)
|
|
364
|
-
return false;
|
|
365
|
-
if (Object.isExtensible(a) !== Object.isExtensible(b))
|
|
366
|
-
return false;
|
|
367
|
-
const ka = Reflect.ownKeys(a);
|
|
368
|
-
const kb = Reflect.ownKeys(b);
|
|
369
|
-
if (ka.length !== kb.length)
|
|
370
|
-
return false;
|
|
371
|
-
for (let i = 0; i < ka.length; i++) {
|
|
372
|
-
const k = ka[i];
|
|
373
|
-
if (k !== kb[i])
|
|
374
|
-
return false;
|
|
375
|
-
const da = Object.getOwnPropertyDescriptor(a, k);
|
|
376
|
-
const db = Object.getOwnPropertyDescriptor(b, k);
|
|
377
|
-
if (da === undefined || db === undefined)
|
|
378
|
-
return false;
|
|
379
|
-
if (!("value" in da) || !("value" in db))
|
|
380
|
-
return false;
|
|
381
|
-
if (da.enumerable !== db.enumerable || da.writable !== db.writable || da.configurable !== db.configurable)
|
|
382
|
-
return false;
|
|
383
|
-
if (!sameValueAt(da.value, db.value, depth + 1, aToB, bToA))
|
|
384
|
-
return false;
|
|
385
|
-
}
|
|
386
|
-
return true;
|
|
387
|
-
}
|
|
388
|
-
catch {
|
|
389
|
-
return false;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
370
|
export function resolveCheckpointStore(spec, deps) {
|
|
393
371
|
if (Object.is(spec.checkpointStore, null))
|
|
394
372
|
throw retiredCheckpointStoreNull();
|
|
@@ -575,6 +553,10 @@ export class InMemoryCheckpointStore {
|
|
|
575
553
|
execution = { outcome: true };
|
|
576
554
|
cps = new Map();
|
|
577
555
|
fault = null;
|
|
556
|
+
disclose;
|
|
557
|
+
constructor(opts = {}) {
|
|
558
|
+
this.disclose = opts.disclose;
|
|
559
|
+
}
|
|
578
560
|
async put(token, cp) {
|
|
579
561
|
if (this.cps.has(token)) {
|
|
580
562
|
throw new CheckpointError("checkpoint.already_exists", `checkpoint token already exists`);
|
|
@@ -703,7 +685,7 @@ export class InMemoryCheckpointStore {
|
|
|
703
685
|
const out = [];
|
|
704
686
|
for (const cp of this.cps.values()) {
|
|
705
687
|
if (cp.scope === scope && cp.status === "pending")
|
|
706
|
-
out.push(summarizeCheckpoint(cp));
|
|
688
|
+
out.push(summarizeCheckpoint(cp, this.disclose));
|
|
707
689
|
}
|
|
708
690
|
return out;
|
|
709
691
|
}
|
|
@@ -131,6 +131,12 @@ export declare const CLAMP_SET: Readonly<{
|
|
|
131
131
|
readonly script: false;
|
|
132
132
|
readonly carrier: "specSeat";
|
|
133
133
|
}>;
|
|
134
|
+
projectMemory: Readonly<{
|
|
135
|
+
readonly law: "restricting";
|
|
136
|
+
readonly value: "disabled";
|
|
137
|
+
readonly script: false;
|
|
138
|
+
readonly carrier: "specSeat";
|
|
139
|
+
}>;
|
|
134
140
|
promptForm: Readonly<{
|
|
135
141
|
readonly law: "restricting";
|
|
136
142
|
readonly value: "minimal";
|
|
@@ -9,29 +9,15 @@ function complianceIdentity(cap) {
|
|
|
9
9
|
}
|
|
10
10
|
const MAX_SCRIPT_LIST_ENTRIES = 16;
|
|
11
11
|
const MAX_SCRIPT_ENTRY_CHARS = 256;
|
|
12
|
-
const MAX_SCRIPT_DENY_WILDCARDS_PER_SEGMENT = 1;
|
|
13
12
|
function assertScriptEntryLength(text, at, what, why) {
|
|
14
13
|
if (text.length > MAX_SCRIPT_ENTRY_CHARS)
|
|
15
14
|
throw new Error(`${at} is ${text.length} characters — a workflow script's ${what} is limited to ${MAX_SCRIPT_ENTRY_CHARS} (${why}).`);
|
|
16
15
|
}
|
|
17
|
-
function assertScriptDenyPatternBounded(pattern, at) {
|
|
18
|
-
assertScriptEntryLength(pattern, at, "deny pattern", "the matcher runs on every read of the child's run");
|
|
19
|
-
for (const segment of pattern.split("/")) {
|
|
20
|
-
const wildcards = segment.split("*").length - 1;
|
|
21
|
-
if (wildcards > MAX_SCRIPT_DENY_WILDCARDS_PER_SEGMENT) {
|
|
22
|
-
throw new Error(`${at} has a path segment with ${wildcards} \`*\` wildcards — a workflow script's deny pattern allows at most ` +
|
|
23
|
-
`${MAX_SCRIPT_DENY_WILDCARDS_PER_SEGMENT} per path segment (the same expressiveness the engine's built-in deny table ` +
|
|
24
|
-
`uses). Each \`*\` compiles to a greedy match, and more than one in a single segment makes the judgment cost grow ` +
|
|
25
|
-
`superlinearly with the path length, on every read the child performs. Write the intent as separate entries ` +
|
|
26
|
-
`(the set is a union, so more entries deny strictly more) or anchor it with literal segments.`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
16
|
function readDenyScriptEntry(el, at) {
|
|
31
17
|
if (typeof el === "string") {
|
|
32
18
|
if (el.length === 0)
|
|
33
19
|
throw new Error(`${at} must be a non-empty pattern string`);
|
|
34
|
-
|
|
20
|
+
assertScriptEntryLength(el, at, "deny pattern", "the matcher runs on every read of the child's run");
|
|
35
21
|
return el;
|
|
36
22
|
}
|
|
37
23
|
if (typeof el !== "object" || el === null || Array.isArray(el))
|
|
@@ -43,7 +29,7 @@ function readDenyScriptEntry(el, at) {
|
|
|
43
29
|
throw new Error(`${at}.pattern must be a non-empty string, e.g. ".ssh" or "secrets/*.json"`);
|
|
44
30
|
if (caseSensitive !== undefined && typeof caseSensitive !== "boolean")
|
|
45
31
|
throw new Error(`${at}.caseSensitive must be a boolean`);
|
|
46
|
-
|
|
32
|
+
assertScriptEntryLength(pattern, at, "deny pattern", "the matcher runs on every read of the child's run");
|
|
47
33
|
return caseSensitive === undefined ? { pattern } : { pattern, caseSensitive };
|
|
48
34
|
}
|
|
49
35
|
function writeProtectedScriptEntry(el, at) {
|
|
@@ -101,6 +87,7 @@ export const CLAMP_SET = Object.freeze({
|
|
|
101
87
|
oneShot: Object.freeze({ law: "restricting", value: true, script: true, carrier: "specSeat" }),
|
|
102
88
|
memoryPersistenceCapable: Object.freeze({ law: "restricting", value: false, script: true, carrier: "specSeat" }),
|
|
103
89
|
fileHistory: Object.freeze({ law: "restricting", value: "disabled", script: false, carrier: "specSeat" }),
|
|
90
|
+
projectMemory: Object.freeze({ law: "restricting", value: "disabled", script: false, carrier: "specSeat" }),
|
|
104
91
|
promptForm: Object.freeze({ law: "restricting", value: "minimal", script: false, carrier: "specSeat" }),
|
|
105
92
|
memory: Object.freeze({ law: "restricting", field: "enabled", value: false, script: false, carrier: "specSeat" }),
|
|
106
93
|
});
|