@sema-agent/core 7.66.1 → 7.67.1
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 +3518 -0
- package/LICENSE +2 -1
- package/dist/agents/agent-definition.js +2 -1
- package/dist/agents/agent-transcript-tool.d.ts +1 -1
- package/dist/agents/agent-transcript-tool.js +4 -3
- package/dist/agents/builtin-agents.d.ts +10 -7
- package/dist/agents/builtin-agents.js +1 -0
- package/dist/agents/cascade.d.ts +24 -11
- package/dist/agents/cascade.js +21 -9
- package/dist/agents/child-failure.d.ts +30 -0
- package/dist/agents/child-failure.js +25 -1
- package/dist/agents/composition-placement.d.ts +6 -2
- package/dist/agents/composition-placement.js +7 -3
- package/dist/agents/cross-session-envelope.d.ts +10 -1
- package/dist/agents/cross-session-envelope.js +6 -2
- package/dist/agents/cross-session-judge.d.ts +7 -1
- package/dist/agents/cross-session-judge.js +1 -0
- package/dist/agents/cumulative-stats.d.ts +36 -2
- package/dist/agents/cumulative-stats.js +44 -9
- package/dist/agents/delegation-registry-seat.js +2 -3
- package/dist/agents/inherited-tool-pool.d.ts +9 -4
- package/dist/agents/inherited-tool-pool.js +7 -1
- package/dist/agents/leg-label.d.ts +28 -0
- package/dist/agents/leg-label.js +9 -0
- package/dist/agents/list-agents-tool.d.ts +1 -1
- package/dist/agents/list-agents-tool.js +4 -4
- package/dist/agents/org-delivery-gate.d.ts +129 -23
- package/dist/agents/org-delivery-gate.js +41 -20
- package/dist/agents/peer-held-queue.d.ts +15 -10
- package/dist/agents/peer-held-queue.js +47 -19
- package/dist/agents/peer-notice-route.js +2 -2
- package/dist/agents/peer-notices.d.ts +13 -2
- package/dist/agents/peer-notices.js +12 -2
- package/dist/agents/peer-session-drain.d.ts +65 -15
- package/dist/agents/peer-session-drain.js +198 -41
- package/dist/agents/read-inbox-tool.d.ts +3 -2
- package/dist/agents/read-inbox-tool.js +7 -5
- package/dist/agents/repair-loop.js +20 -16
- package/dist/agents/retain-ledger.d.ts +1 -1
- package/dist/agents/retain-ledger.js +2 -4
- package/dist/agents/root-session-lane.d.ts +27 -0
- package/dist/agents/root-session-lane.js +57 -0
- package/dist/agents/roster-store.js +1 -2
- package/dist/agents/send-message-tool.js +6 -4
- package/dist/agents/subagent.d.ts +20 -4
- package/dist/agents/subagent.js +218 -183
- package/dist/agents/tool-filter.d.ts +3 -10
- package/dist/agents/tool-filter.js +0 -13
- package/dist/agents/verifier-independence.d.ts +31 -0
- package/dist/agents/verifier-independence.js +23 -0
- package/dist/agents/verify.d.ts +23 -11
- package/dist/agents/verify.js +28 -12
- package/dist/agents/yield-adoption.d.ts +24 -0
- package/dist/agents/yield-adoption.js +84 -0
- package/dist/bench/metrics.d.ts +2 -2
- package/dist/brain/anthropic.d.ts +4 -2
- package/dist/brain/anthropic.js +49 -35
- package/dist/brain/brain-faces.d.ts +11 -0
- package/dist/brain/brain-faces.js +6 -0
- package/dist/brain/cache-retention.d.ts +2 -0
- package/dist/brain/cache-retention.js +9 -0
- package/dist/brain/circuit-breaker.js +51 -26
- package/dist/brain/errors.d.ts +15 -1
- package/dist/brain/errors.js +8 -0
- package/dist/brain/failover.d.ts +6 -0
- package/dist/brain/failover.js +52 -37
- package/dist/brain/media-degrade.d.ts +5 -0
- package/dist/brain/media-degrade.js +4 -0
- package/dist/brain/model-capability.d.ts +2 -1
- package/dist/brain/model-lane.d.ts +169 -0
- package/dist/brain/model-lane.js +505 -0
- package/dist/brain/open-responses.js +19 -22
- package/dist/brain/openai.js +23 -22
- package/dist/brain/provider-message.d.ts +9 -0
- package/dist/brain/provider-message.js +18 -0
- package/dist/brain/reasoning-request.d.ts +9 -7
- package/dist/brain/reasoning-request.js +9 -10
- package/dist/brain/reasoning.d.ts +47 -13
- package/dist/brain/reasoning.js +20 -10
- package/dist/brain/route-adjudicator.d.ts +8 -2
- package/dist/brain/route-adjudicator.js +35 -1
- package/dist/brain/route-conformance.js +17 -0
- package/dist/brain/routing.d.ts +2 -0
- package/dist/brain/routing.js +19 -8
- package/dist/brain/status-sink.d.ts +5 -4
- package/dist/brain/status-sink.js +2 -2
- package/dist/brain/stream-engine.js +8 -2
- package/dist/brain/stream-shared.d.ts +12 -0
- package/dist/brain/stream-shared.js +18 -0
- package/dist/brain/timeout.d.ts +28 -0
- package/dist/brain/timeout.js +13 -4
- package/dist/brain/tool-schema-projection.d.ts +2 -0
- package/dist/brain/tool-schema-projection.js +108 -0
- package/dist/brain/usage-reading.d.ts +49 -0
- package/dist/brain/usage-reading.js +44 -0
- package/dist/brain/usage-reasoning.d.ts +38 -0
- package/dist/brain/usage-reasoning.js +9 -0
- package/dist/config/catalog.d.ts +3 -0
- package/dist/config/catalog.js +18 -9
- package/dist/core/a2a.d.ts +22 -4
- package/dist/core/a2a.js +191 -50
- package/dist/core/agent-definition.d.ts +3 -1
- package/dist/core/agent-state.d.ts +29 -16
- package/dist/core/agent-state.js +36 -9
- package/dist/core/allow-entry.d.ts +12 -3
- package/dist/core/allow-entry.js +10 -3
- package/dist/core/approval-display.d.ts +18 -0
- package/dist/core/approval-display.js +26 -0
- package/dist/core/approval-object.js +2 -2
- package/dist/core/approval-route.d.ts +16 -0
- package/dist/core/approval-route.js +5 -0
- package/dist/core/approval-words.d.ts +43 -0
- package/dist/core/approval-words.js +37 -0
- package/dist/core/ask-origin.d.ts +37 -10
- package/dist/core/ask-origin.js +19 -7
- package/dist/core/ask-question.d.ts +36 -8
- package/dist/core/ask-question.js +24 -9
- package/dist/core/ask-unresolvable-notice.d.ts +3 -2
- package/dist/core/ask-unresolvable-notice.js +3 -2
- package/dist/core/attachment-source.d.ts +50 -0
- package/dist/core/attachment-source.js +46 -0
- package/dist/core/auto-compaction.d.ts +151 -40
- package/dist/core/auto-compaction.js +115 -50
- package/dist/core/auto-mode.d.ts +5 -0
- package/dist/core/auto-mode.js +11 -4
- package/dist/core/background-agent-store.d.ts +151 -23
- package/dist/core/background-agent-store.js +201 -61
- package/dist/core/background-shell.d.ts +4 -1
- package/dist/core/background-shell.js +1 -0
- package/dist/core/cache-break-detector.d.ts +49 -25
- package/dist/core/cache-break-detector.js +99 -44
- package/dist/core/caller-text.d.ts +28 -0
- package/dist/core/caller-text.js +12 -0
- package/dist/core/canonical-json.d.ts +5 -0
- package/dist/core/canonical-json.js +7 -0
- package/dist/core/checkpoint-features.d.ts +80 -9
- package/dist/core/checkpoint-features.js +1 -1
- package/dist/core/checkpoint-generation.d.ts +8 -1
- package/dist/core/checkpoint-generation.js +3 -0
- package/dist/core/checkpoint-queries.d.ts +47 -14
- package/dist/core/checkpoint-queries.js +63 -30
- package/dist/core/checkpoint-requirements.d.ts +36 -3
- package/dist/core/checkpoint-requirements.js +11 -1
- package/dist/core/checkpoint-row-verdict.d.ts +0 -2
- package/dist/core/checkpoint-row-verdict.js +5 -8
- package/dist/core/checkpoint-store.d.ts +166 -41
- package/dist/core/checkpoint-store.js +96 -15
- package/dist/core/child-clamp-seats.d.ts +10 -2
- package/dist/core/child-clamp-seats.js +2 -2
- package/dist/core/classifier-unavailable-arm.d.ts +11 -9
- package/dist/core/classifier-unavailable-arm.js +4 -2
- package/dist/core/command-sandbox-dispatch.d.ts +13 -0
- package/dist/core/command-sandbox-dispatch.js +8 -0
- package/dist/core/command-sandbox.d.ts +231 -0
- package/dist/core/command-sandbox.js +344 -0
- package/dist/core/completion-id.d.ts +21 -0
- package/dist/core/completion-id.js +14 -0
- package/dist/core/config-refusal-codes.d.ts +22 -0
- package/dist/core/config-refusal-codes.js +196 -0
- package/dist/core/context-edit.d.ts +26 -0
- package/dist/core/context-edit.js +4 -2
- package/dist/core/context-guard.d.ts +80 -7
- package/dist/core/context-guard.js +126 -25
- package/dist/core/context-settings.d.ts +32 -0
- package/dist/core/context-settings.js +41 -3
- package/dist/core/contract-faces.d.ts +22 -0
- package/dist/core/contract-faces.js +1 -0
- package/dist/core/credential-echo.d.ts +2 -2
- package/dist/core/credential-echo.js +2 -2
- package/dist/core/cross-boundary-taint.d.ts +10 -8
- package/dist/core/decision-receipt.d.ts +3 -2
- package/dist/core/decision-receipt.js +1 -1
- package/dist/core/definition-entry-grammar.d.ts +42 -0
- package/dist/core/definition-entry-grammar.js +15 -0
- package/dist/core/engine-attestation.d.ts +19 -4
- package/dist/core/engine-attestation.js +4 -0
- package/dist/core/engine-capabilities.d.ts +8 -1
- package/dist/core/engine-capabilities.js +1 -1
- package/dist/core/engine-contracts/open-face-contract.d.ts +39 -0
- package/dist/core/engine-contracts/open-face-contract.js +57 -0
- package/dist/core/engine-notice.d.ts +164 -33
- package/dist/core/exclusive-temp.d.ts +25 -0
- package/dist/core/exclusive-temp.js +19 -0
- package/dist/core/existing-target.d.ts +112 -0
- package/dist/core/existing-target.js +88 -0
- package/dist/core/file-history-store.d.ts +14 -6
- package/dist/core/gate-lanes.js +8 -3
- package/dist/core/gate-outcome.d.ts +2 -1
- package/dist/core/git-worktree-env.d.ts +92 -1
- package/dist/core/git-worktree-env.js +87 -6
- package/dist/core/governance-codes.d.ts +49 -8
- package/dist/core/governance-codes.js +59 -8
- package/dist/core/hands-band.d.ts +10 -6
- package/dist/core/hooks.d.ts +60 -6
- package/dist/core/hooks.js +10 -2
- package/dist/core/host-floor.d.ts +24 -8
- package/dist/core/host-floor.js +45 -16
- package/dist/core/human-input-projection.d.ts +7 -0
- package/dist/core/human-input-projection.js +11 -3
- package/dist/core/image-admission.d.ts +16 -4
- package/dist/core/image-admission.js +29 -17
- package/dist/core/input-author.d.ts +43 -1
- package/dist/core/input-author.js +19 -0
- package/dist/core/isolation-scope.d.ts +41 -0
- package/dist/core/isolation-scope.js +10 -0
- package/dist/core/json-schema-seats.d.ts +11 -0
- package/dist/core/json-schema-seats.js +5 -0
- package/dist/core/leg-identity.d.ts +53 -5
- package/dist/core/leg-identity.js +32 -1
- package/dist/core/locked-config.d.ts +33 -38
- package/dist/core/locked-config.js +21 -3
- package/dist/core/lsp.js +2 -1
- package/dist/core/mailbox-store.d.ts +111 -18
- package/dist/core/mailbox-store.js +101 -13
- package/dist/core/mcp-call-meta.js +1 -1
- package/dist/core/mcp-connection-pool.d.ts +8 -2
- package/dist/core/mcp-connection-pool.js +3 -1
- package/dist/core/mcp-failure.d.ts +6 -1
- package/dist/core/mcp-failure.js +10 -0
- package/dist/core/mcp-host-read.d.ts +293 -0
- package/dist/core/mcp-host-read.js +428 -0
- package/dist/core/mcp-server-link.d.ts +28 -6
- package/dist/core/mcp-server-link.js +35 -7
- package/dist/core/mcp-server-spec.d.ts +22 -29
- package/dist/core/mcp-server-spec.js +7 -14
- package/dist/core/mcp-server-unavailable-notice.d.ts +32 -0
- package/dist/core/mcp-server-unavailable-notice.js +15 -0
- package/dist/core/mcp-session-end.d.ts +5 -2
- package/dist/core/mcp-session-end.js +7 -2
- package/dist/core/mcp-tool-meta.d.ts +6 -0
- package/dist/core/mcp-tool-meta.js +1 -0
- package/dist/core/mcp.d.ts +54 -19
- package/dist/core/mcp.js +194 -241
- package/dist/core/memory-engine/committed-shadow-read.d.ts +16 -0
- package/dist/core/memory-engine/committed-shadow-read.js +21 -0
- package/dist/core/memory-engine/consolidation-driver.js +2 -1
- package/dist/core/memory-engine/consolidation.d.ts +3 -3
- package/dist/core/memory-engine/control-objects.d.ts +4 -3
- package/dist/core/memory-engine/control-objects.js +6 -4
- package/dist/core/memory-engine/delegation-settlement.d.ts +127 -25
- package/dist/core/memory-engine/delegation-settlement.js +145 -18
- package/dist/core/memory-engine/distiller.d.ts +2 -1
- package/dist/core/memory-engine/distiller.js +10 -5
- package/dist/core/memory-engine/dual-root.js +2 -2
- package/dist/core/memory-engine/engine.d.ts +127 -33
- package/dist/core/memory-engine/engine.js +774 -323
- package/dist/core/memory-engine/entry-scan.d.ts +3 -0
- package/dist/core/memory-engine/entry-scan.js +8 -0
- package/dist/core/memory-engine/export-bundle.d.ts +4 -0
- package/dist/core/memory-engine/export-bundle.js +2 -0
- package/dist/core/memory-engine/file-backend.d.ts +62 -17
- package/dist/core/memory-engine/file-backend.js +155 -99
- package/dist/core/memory-engine/index.d.ts +1 -1
- package/dist/core/memory-engine/index.js +1 -1
- package/dist/core/memory-engine/layer-observations.d.ts +7 -1
- package/dist/core/memory-engine/layer-observations.js +6 -0
- package/dist/core/memory-engine/layout.d.ts +88 -26
- package/dist/core/memory-engine/layout.js +105 -29
- package/dist/core/memory-engine/memory-deployment.js +4 -4
- package/dist/core/memory-engine/mount-failed-notice.d.ts +24 -0
- package/dist/core/memory-engine/mount-failed-notice.js +22 -0
- package/dist/core/memory-engine/origin-clearance.d.ts +15 -1
- package/dist/core/memory-engine/origin-clearance.js +30 -10
- package/dist/core/memory-engine/scan.js +1 -1
- package/dist/core/memory-engine/scope-contract.js +4 -3
- package/dist/core/memory-engine/session-write-home.js +13 -1
- package/dist/core/memory-engine/sync-client.d.ts +1 -1
- package/dist/core/memory-engine/sync-client.js +3 -1
- package/dist/core/memory-engine/tools.d.ts +5 -4
- package/dist/core/memory-engine/tools.js +1 -1
- package/dist/core/memory-engine/types.d.ts +18 -1
- package/dist/core/memory-engine/types.js +1 -0
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/memory.js +2 -6
- package/dist/core/mode-policy.d.ts +8 -1
- package/dist/core/mode-policy.js +6 -2
- package/dist/core/model-fallbacks.d.ts +105 -0
- package/dist/core/model-fallbacks.js +79 -0
- package/dist/core/model-receipt.d.ts +15 -3
- package/dist/core/model-receipt.js +22 -1
- package/dist/core/model-seat.d.ts +1 -1
- package/dist/core/mods/classic-events.d.ts +5 -1
- package/dist/core/mods/dollar.d.ts +47 -2
- package/dist/core/mods/dollar.js +28 -5
- package/dist/core/mods/kernel/budget.d.ts +6 -0
- package/dist/core/mods/kernel/budget.js +6 -0
- package/dist/core/mods/kernel/dispatch.d.ts +23 -2
- package/dist/core/mods/kernel/dispatch.js +104 -15
- package/dist/core/mods/kernel/events.d.ts +18 -1
- package/dist/core/mods/kernel/events.js +7 -6
- package/dist/core/mods/kernel/index.d.ts +2 -2
- package/dist/core/mods/kernel/index.js +1 -1
- package/dist/core/mods/kernel/receive.d.ts +2 -1
- package/dist/core/mods/lifecycle-stations.d.ts +13 -4
- package/dist/core/mods/lifecycle-stations.js +8 -3
- package/dist/core/mods/message-display.d.ts +81 -0
- package/dist/core/mods/message-display.js +369 -0
- package/dist/core/mods/prompt-submit.d.ts +1 -1
- package/dist/core/mods/prompt-submit.js +5 -2
- package/dist/core/mods/session-append.d.ts +2 -2
- package/dist/core/mods/session-append.js +2 -1
- package/dist/core/mods/session-compact.js +2 -2
- package/dist/core/mods/stations.d.ts +48 -18
- package/dist/core/mods/stations.js +100 -19
- package/dist/core/mods/stop-answers.d.ts +23 -0
- package/dist/core/mods/stop-answers.js +20 -0
- package/dist/core/mounted-mcp.d.ts +48 -8
- package/dist/core/mounted-mcp.js +82 -16
- package/dist/core/namespaced-rule-name.js +2 -1
- package/dist/core/own-property-receipt.js +3 -5
- package/dist/core/parent-spec-seat.d.ts +20 -1
- package/dist/core/parent-spec-seat.js +13 -3
- package/dist/core/park-selfcheck.js +1 -0
- package/dist/core/path-identity.js +2 -1
- package/dist/core/peer-seat.d.ts +21 -7
- package/dist/core/peer-seat.js +25 -16
- package/dist/core/permission-rule-consent.js +15 -5
- package/dist/core/permission-rule-model.d.ts +4 -2
- package/dist/core/permission-rule-model.js +43 -23
- package/dist/core/permission-rule-store.d.ts +31 -16
- package/dist/core/permission-rule-store.js +27 -18
- package/dist/core/present-plan-tool.d.ts +6 -1
- package/dist/core/present-plan-tool.js +11 -3
- package/dist/core/pricing.d.ts +8 -6
- package/dist/core/pricing.js +1 -1
- package/dist/core/principal-name.d.ts +13 -0
- package/dist/core/principal-name.js +9 -2
- package/dist/core/process-identity.d.ts +140 -0
- package/dist/core/process-identity.js +215 -0
- package/dist/core/protocol-http-auth.d.ts +28 -6
- package/dist/core/protocol-http-auth.js +22 -5
- package/dist/core/protocol-naming.d.ts +7 -0
- package/dist/core/protocol-naming.js +12 -2
- package/dist/core/protocol-revocation.d.ts +72 -0
- package/dist/core/protocol-revocation.js +98 -0
- package/dist/core/protocol-table.d.ts +4 -4
- package/dist/core/protocol-table.js +3 -2
- package/dist/core/push-queue.d.ts +35 -2
- package/dist/core/push-queue.js +60 -4
- package/dist/core/read-only-shell.d.ts +19 -0
- package/dist/core/read-only-shell.js +38 -11
- package/dist/core/real-approval.d.ts +26 -0
- package/dist/core/real-approval.js +15 -0
- package/dist/core/redaction-marks.d.ts +6 -2
- package/dist/core/redaction-marks.js +3 -0
- package/dist/core/reminder-mint.d.ts +6 -0
- package/dist/core/reminder-mint.js +9 -8
- package/dist/core/remote-env.d.ts +31 -15
- package/dist/core/remote-env.js +29 -0
- package/dist/core/request-copy-projection.d.ts +51 -0
- package/dist/core/request-copy-projection.js +410 -0
- package/dist/core/resume-config-judge.d.ts +69 -0
- package/dist/core/resume-config-judge.js +78 -0
- package/dist/core/resume-startup-cause.d.ts +14 -4
- package/dist/core/resume-startup-cause.js +12 -2
- package/dist/core/retention-policy.js +2 -1
- package/dist/core/retention.d.ts +119 -24
- package/dist/core/retention.js +60 -16
- package/dist/core/retired-keys.d.ts +0 -10
- package/dist/core/retired-keys.js +2 -3
- package/dist/core/roles.d.ts +24 -25
- package/dist/core/roles.js +148 -21
- package/dist/core/row-shape.d.ts +149 -0
- package/dist/core/row-shape.js +184 -0
- package/dist/core/runner/advertised-writable-dirs.js +10 -9
- package/dist/core/runner/advisor-instructions.d.ts +11 -27
- package/dist/core/runner/advisor-instructions.js +18 -20
- package/dist/core/runner/advisor-tool.js +1 -0
- package/dist/core/runner/announce-once-ledger.js +4 -1
- package/dist/core/runner/approval-feedback.d.ts +17 -8
- package/dist/core/runner/approval-feedback.js +18 -13
- package/dist/core/runner/approver-defect-announcer.d.ts +17 -0
- package/dist/core/runner/approver-defect-announcer.js +22 -0
- package/dist/core/runner/assemble-result.d.ts +29 -14
- package/dist/core/runner/assemble-result.js +16 -25
- package/dist/core/runner/cache-hit-account.d.ts +77 -0
- package/dist/core/runner/cache-hit-account.js +46 -0
- package/dist/core/runner/call-hook-stations.d.ts +3 -2
- package/dist/core/runner/call-hook-stations.js +5 -4
- package/dist/core/runner/changed-files-scan.d.ts +43 -0
- package/dist/core/runner/changed-files-scan.js +34 -0
- package/dist/core/runner/checkpoint-scope.d.ts +33 -9
- package/dist/core/runner/checkpoint-scope.js +27 -1
- package/dist/core/runner/classifier-ladder.d.ts +2 -2
- package/dist/core/runner/classifier-ladder.js +18 -9
- package/dist/core/runner/clock-and-limits.d.ts +15 -4
- package/dist/core/runner/clock-and-limits.js +19 -1
- package/dist/core/runner/compact-session.js +84 -14
- package/dist/core/runner/compaction-call-options.d.ts +2 -29
- package/dist/core/runner/compaction-call-options.js +2 -9
- package/dist/core/runner/compaction-restate.d.ts +18 -2
- package/dist/core/runner/compaction-restate.js +36 -2
- package/dist/core/runner/construction-doors.js +8 -0
- package/dist/core/runner/context-room.d.ts +55 -0
- package/dist/core/runner/context-room.js +71 -0
- package/dist/core/runner/contracts.d.ts +313 -205
- package/dist/core/runner/conversation-segment.d.ts +49 -14
- package/dist/core/runner/conversation-segment.js +92 -19
- package/dist/core/runner/cross-boundary-lane.d.ts +4 -0
- package/dist/core/runner/cross-boundary-lane.js +9 -6
- package/dist/core/runner/decide-continuation.js +1 -1
- package/dist/core/runner/deferred-ask.d.ts +62 -0
- package/dist/core/runner/deferred-ask.js +44 -0
- package/dist/core/runner/delegation-owner.d.ts +19 -0
- package/dist/core/runner/delegation-owner.js +27 -1
- package/dist/core/runner/denial-limit-arms.d.ts +10 -6
- package/dist/core/runner/denial-limit-arms.js +13 -7
- package/dist/core/runner/env-capability-census.d.ts +1 -1
- package/dist/core/runner/file-history-request.js +2 -1
- package/dist/core/runner/file-history-restore.d.ts +16 -2
- package/dist/core/runner/file-history-restore.js +9 -1
- package/dist/core/runner/gate-exit.d.ts +18 -5
- package/dist/core/runner/gate-exit.js +26 -15
- package/dist/core/runner/git-status-frame.d.ts +26 -8
- package/dist/core/runner/git-status-frame.js +14 -9
- package/dist/core/runner/halt-attribution.d.ts +29 -12
- package/dist/core/runner/halt-attribution.js +38 -11
- package/dist/core/runner/image.js +3 -2
- package/dist/core/runner/initial-run-state.d.ts +1 -1
- package/dist/core/runner/initial-run-state.js +4 -4
- package/dist/core/runner/language-frame.d.ts +66 -0
- package/dist/core/runner/language-frame.js +76 -0
- package/dist/core/runner/leg-frame.d.ts +81 -0
- package/dist/core/runner/leg-frame.js +68 -0
- package/dist/core/runner/main-call-account.d.ts +34 -0
- package/dist/core/runner/main-call-account.js +50 -0
- package/dist/core/runner/mcp-redial.d.ts +9 -7
- package/dist/core/runner/mcp-redial.js +20 -21
- package/dist/core/runner/memory-consolidation-driver.d.ts +2 -0
- package/dist/core/runner/memory-consolidation-driver.js +5 -3
- package/dist/core/runner/messages-omitted-seat.d.ts +2 -0
- package/dist/core/runner/messages-omitted-seat.js +21 -0
- package/dist/core/runner/model-fallback-seat.d.ts +23 -0
- package/dist/core/runner/model-fallback-seat.js +64 -0
- package/dist/core/runner/model-lane-seat.d.ts +12 -0
- package/dist/core/runner/model-lane-seat.js +35 -0
- package/dist/core/runner/nested-memory-content.d.ts +33 -0
- package/dist/core/runner/nested-memory-content.js +171 -0
- package/dist/core/runner/nested-memory-lane.d.ts +181 -0
- package/dist/core/runner/nested-memory-lane.js +673 -0
- package/dist/core/runner/park-commit.d.ts +7 -0
- package/dist/core/runner/park-commit.js +3 -0
- package/dist/core/runner/prepare-advisor.d.ts +7 -9
- package/dist/core/runner/prepare-advisor.js +11 -5
- package/dist/core/runner/prepare-artifact.d.ts +1 -1
- package/dist/core/runner/prepare-artifact.js +8 -3
- package/dist/core/runner/prepare-ask-lane.d.ts +21 -3
- package/dist/core/runner/prepare-ask-lane.js +32 -28
- package/dist/core/runner/prepare-boundary-parks.d.ts +2 -2
- package/dist/core/runner/prepare-boundary-parks.js +21 -17
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +10 -2
- package/dist/core/runner/prepare-caps-and-workflow.js +24 -18
- package/dist/core/runner/prepare-config-doors.d.ts +51 -5
- package/dist/core/runner/prepare-config-doors.js +73 -73
- package/dist/core/runner/prepare-context-lane.d.ts +68 -3
- package/dist/core/runner/prepare-context-lane.js +137 -27
- package/dist/core/runner/prepare-defer-classify.d.ts +0 -4
- package/dist/core/runner/prepare-defer-classify.js +9 -13
- package/dist/core/runner/prepare-delegation-surface.d.ts +8 -8
- package/dist/core/runner/prepare-delegation-surface.js +72 -64
- package/dist/core/runner/prepare-execution-env.js +1 -9
- package/dist/core/runner/prepare-file-history.d.ts +3 -2
- package/dist/core/runner/prepare-file-history.js +11 -4
- package/dist/core/runner/prepare-gate-stations.d.ts +21 -11
- package/dist/core/runner/prepare-gate-stations.js +13 -13
- package/dist/core/runner/prepare-hands-readface.d.ts +23 -6
- package/dist/core/runner/prepare-hands-readface.js +18 -12
- package/dist/core/runner/prepare-inherited-gate.d.ts +12 -5
- package/dist/core/runner/prepare-inherited-gate.js +14 -10
- package/dist/core/runner/prepare-lsp.js +2 -1
- package/dist/core/runner/prepare-memory-engine-session.js +30 -10
- package/dist/core/runner/prepare-memory.d.ts +4 -0
- package/dist/core/runner/prepare-memory.js +38 -16
- package/dist/core/runner/prepare-offload-wrappers.d.ts +3 -16
- package/dist/core/runner/prepare-offload-wrappers.js +6 -5
- package/dist/core/runner/prepare-park-ask.d.ts +11 -3
- package/dist/core/runner/prepare-park-ask.js +23 -19
- package/dist/core/runner/prepare-policy-chain.d.ts +17 -3
- package/dist/core/runner/prepare-policy-chain.js +144 -120
- package/dist/core/runner/prepare-project-context.d.ts +15 -53
- package/dist/core/runner/prepare-project-context.js +20 -83
- package/dist/core/runner/prepare-prompt-assembly.d.ts +7 -1
- package/dist/core/runner/prepare-prompt-assembly.js +9 -7
- package/dist/core/runner/prepare-prompt-inputs.d.ts +9 -3
- package/dist/core/runner/prepare-prompt-inputs.js +5 -3
- package/dist/core/runner/prepare-protocol-tools.d.ts +9 -4
- package/dist/core/runner/prepare-protocol-tools.js +46 -27
- package/dist/core/runner/prepare-question-face.d.ts +6 -5
- package/dist/core/runner/prepare-question-face.js +7 -6
- package/dist/core/runner/prepare-suspend-saga.d.ts +3 -0
- package/dist/core/runner/prepare-suspend-saga.js +1 -1
- package/dist/core/runner/prepare-task.d.ts +3 -3
- package/dist/core/runner/prepare-task.js +113 -61
- package/dist/core/runner/prepare-tool-disclosure-mount.js +6 -5
- package/dist/core/runner/prepare-turn-wiring.d.ts +33 -7
- package/dist/core/runner/prepare-turn-wiring.js +53 -17
- package/dist/core/runner/prepare-wiring-manifest.d.ts +42 -5
- package/dist/core/runner/prepare-wiring-manifest.js +81 -42
- package/dist/core/runner/prepare-workspace-restore.js +3 -2
- package/dist/core/runner/read-root-grant.js +2 -1
- package/dist/core/runner/reply-pricing.d.ts +31 -18
- package/dist/core/runner/reply-pricing.js +10 -15
- package/dist/core/runner/resume-admission.js +10 -15
- package/dist/core/runner/resume-apply.js +20 -9
- package/dist/core/runner/resume-checkpoint-screen.js +2 -4
- package/dist/core/runner/resume-internals-and-config.d.ts +12 -9
- package/dist/core/runner/resume-internals-and-config.js +37 -9
- package/dist/core/runner/resume-preflight.js +3 -3
- package/dist/core/runner/retired-runner-deps.js +3 -0
- package/dist/core/runner/rewind-files.js +6 -6
- package/dist/core/runner/run-attachment-seats.d.ts +1 -3
- package/dist/core/runner/run-attachment-seats.js +1 -6
- package/dist/core/runner/run-brain-sinks.d.ts +4 -7
- package/dist/core/runner/run-brain-sinks.js +7 -10
- package/dist/core/runner/run-clock-and-content.d.ts +8 -5
- package/dist/core/runner/run-clock-and-content.js +18 -3
- package/dist/core/runner/run-compaction-machinery.d.ts +8 -4
- package/dist/core/runner/run-compaction-machinery.js +4 -19
- package/dist/core/runner/run-git-lane.d.ts +8 -3
- package/dist/core/runner/run-git-lane.js +5 -3
- package/dist/core/runner/run-harness-handlers.d.ts +4 -1
- package/dist/core/runner/run-harness-handlers.js +70 -45
- package/dist/core/runner/run-identity-wiring.d.ts +6 -0
- package/dist/core/runner/run-identity-wiring.js +17 -8
- package/dist/core/runner/run-leg.d.ts +5 -2
- package/dist/core/runner/run-leg.js +156 -71
- package/dist/core/runner/run-notification-lane.d.ts +1 -1
- package/dist/core/runner/run-notification-lane.js +22 -10
- package/dist/core/runner/run-recovery-lanes.js +8 -6
- package/dist/core/runner/run-settle-and-teardown.d.ts +4 -0
- package/dist/core/runner/run-settle-and-teardown.js +77 -26
- package/dist/core/runner/run-stop-and-final-verify.js +46 -12
- package/dist/core/runner/run-telemetry-and-budget-seats.js +19 -28
- package/dist/core/runner/run-terminal-adoption.d.ts +2 -2
- package/dist/core/runner/run-terminal-adoption.js +14 -9
- package/dist/core/runner/run-tool-mount-facts.js +5 -9
- package/dist/core/runner/run-turn-boundary.d.ts +3 -2
- package/dist/core/runner/run-turn-boundary.js +112 -106
- package/dist/core/runner/runtask.d.ts +28 -8
- package/dist/core/runner/runtask.js +132 -41
- package/dist/core/runner/session-file-state-replay.d.ts +5 -3
- package/dist/core/runner/session-file-state-replay.js +10 -3
- package/dist/core/runner/session-rule-policy.d.ts +3 -3
- package/dist/core/runner/session-verb-doors.d.ts +18 -3
- package/dist/core/runner/session-verb-doors.js +38 -6
- package/dist/core/runner/shell-env-withheld.d.ts +8 -5
- package/dist/core/runner/shell-env-withheld.js +4 -4
- package/dist/core/runner/side-call-account.d.ts +12 -8
- package/dist/core/runner/side-call-account.js +24 -15
- package/dist/core/runner/stream-halt-verbs.js +1 -0
- package/dist/core/runner/stream-mode-verb.js +2 -1
- package/dist/core/runner/stream-settle-backstop.js +4 -1
- package/dist/core/runner/stream-steer-verb.js +35 -19
- package/dist/core/runner/sub-agent-deny-lists.d.ts +47 -11
- package/dist/core/runner/sub-agent-deny-lists.js +140 -39
- package/dist/core/runner/teardown-bounded.d.ts +6 -0
- package/dist/core/runner/teardown-bounded.js +12 -7
- package/dist/core/runner/terminal-account.d.ts +2 -0
- package/dist/core/runner/terminal-account.js +6 -1
- package/dist/core/runner/tool-disclosure.js +2 -1
- package/dist/core/runner/tool-end-body.js +3 -1
- package/dist/core/runner/tool-face-overlay.d.ts +1 -1
- package/dist/core/runner/tool-face-overlay.js +1 -1
- package/dist/core/runner/tool-occurrence.d.ts +34 -9
- package/dist/core/runner/tool-occurrence.js +32 -21
- package/dist/core/runner/tool-progress-lane.d.ts +20 -5
- package/dist/core/runner/tool-progress-lane.js +27 -5
- package/dist/core/runner/tool-result-media-seat.d.ts +15 -4
- package/dist/core/runner/tool-result-media-seat.js +17 -1
- package/dist/core/runner/tool-table-view.js +1 -1
- package/dist/core/runner/turn-attachments.d.ts +44 -71
- package/dist/core/runner/turn-attachments.js +52 -104
- package/dist/core/runner/usage-accounting.d.ts +3 -2
- package/dist/core/runner/usage-accounting.js +3 -2
- package/dist/core/runner/void-verifier-pause.js +1 -1
- package/dist/core/runner-deps.d.ts +42 -158
- package/dist/core/runtime-caps.d.ts +16 -4
- package/dist/core/secret-env.d.ts +20 -3
- package/dist/core/secret-env.js +46 -23
- package/dist/core/sensitive-path-policy.d.ts +8 -0
- package/dist/core/sensitive-path-policy.js +10 -2
- package/dist/core/session-checkout.d.ts +32 -27
- package/dist/core/session-checkout.js +109 -61
- package/dist/core/session-log-transfer.js +2 -1
- package/dist/core/session-policy-store.d.ts +24 -11
- package/dist/core/session-policy-store.js +11 -2
- package/dist/core/session-store.d.ts +16 -2
- package/dist/core/session-store.js +43 -17
- package/dist/core/session.d.ts +31 -3
- package/dist/core/session.js +33 -2
- package/dist/core/shell-run-candidates.d.ts +20 -8
- package/dist/core/shell-run-candidates.js +44 -21
- package/dist/core/side-query.d.ts +17 -5
- package/dist/core/side-query.js +17 -14
- package/dist/core/skill-grant.js +2 -3
- package/dist/core/skills-directory.js +3 -66
- package/dist/core/snapshot-frame-seat.d.ts +8 -0
- package/dist/core/snapshot-frame-seat.js +24 -0
- package/dist/core/steer-replay.d.ts +19 -3
- package/dist/core/steer-replay.js +8 -1
- package/dist/core/store-contracts/background-agent-store-contract.d.ts +17 -2
- package/dist/core/store-contracts/background-agent-store-contract.js +131 -2
- package/dist/core/store-contracts/checkpoint-store-contract.js +63 -1
- package/dist/core/store-contracts/mailbox-store-contract.d.ts +15 -2
- package/dist/core/store-contracts/mailbox-store-contract.js +213 -3
- package/dist/core/store-contracts/permission-rule-write-contract.js +24 -0
- package/dist/core/store-contracts/session-deletion-cascade-contract.d.ts +15 -0
- package/dist/core/store-contracts/session-deletion-cascade-contract.js +288 -0
- package/dist/core/store-contracts/session-policy-store-contract.js +57 -36
- package/dist/core/store-contracts/session-repo-contract.js +130 -5
- package/dist/core/store-contracts/session-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/session-store-contract.js +17 -0
- package/dist/core/store-contracts/task-list-store-contract.d.ts +32 -0
- package/dist/core/store-contracts/task-list-store-contract.js +240 -0
- package/dist/core/store-contracts/tool-result-store-contract.d.ts +1 -1
- package/dist/core/store-contracts/tool-result-store-contract.js +41 -0
- package/dist/core/stub-env.d.ts +2 -2
- package/dist/core/stub-env.js +1 -0
- package/dist/core/synthetic-read-verdict.d.ts +38 -28
- package/dist/core/synthetic-read-verdict.js +19 -28
- package/dist/core/task-event.d.ts +171 -19
- package/dist/core/task-intake.d.ts +26 -0
- package/dist/core/task-intake.js +31 -0
- package/dist/core/task-limits.d.ts +8 -6
- package/dist/core/task-notification.d.ts +88 -8
- package/dist/core/task-notification.js +45 -5
- package/dist/core/task-registry-agent.d.ts +24 -7
- package/dist/core/task-registry-agent.js +51 -28
- package/dist/core/task-registry-monitor.js +16 -14
- package/dist/core/task-registry-shared.d.ts +177 -35
- package/dist/core/task-registry-shared.js +44 -17
- package/dist/core/task-registry-workflow.js +8 -5
- package/dist/core/task-registry-yield.d.ts +32 -0
- package/dist/core/task-registry-yield.js +85 -0
- package/dist/core/task-registry.d.ts +88 -10
- package/dist/core/task-registry.js +124 -33
- package/dist/core/task-result.d.ts +126 -31
- package/dist/core/task-spec-members.d.ts +140 -1
- package/dist/core/task-spec-members.js +23 -8
- package/dist/core/task-spec.d.ts +181 -51
- package/dist/core/task-spec.js +1 -1
- package/dist/core/task-stream.d.ts +12 -2
- package/dist/core/terminal-cause.d.ts +12 -4
- package/dist/core/thrown-value.d.ts +49 -7
- package/dist/core/thrown-value.js +38 -2
- package/dist/core/tool-catalog-entries.js +13 -3
- package/dist/core/tool-data-door.d.ts +7 -0
- package/dist/core/tool-data-door.js +13 -0
- package/dist/core/tool-face-lists.d.ts +25 -0
- package/dist/core/tool-face-lists.js +38 -0
- package/dist/core/tool-face-reader.d.ts +0 -10
- package/dist/core/tool-face-reader.js +5 -3
- package/dist/core/tool-list-grammar.d.ts +103 -0
- package/dist/core/tool-list-grammar.js +130 -0
- package/dist/core/tool-mount-facts.d.ts +47 -0
- package/dist/core/tool-mount-facts.js +50 -0
- package/dist/core/tool-mount-plan.d.ts +196 -0
- package/dist/core/tool-mount-plan.js +404 -0
- package/dist/core/tool-mount-static.d.ts +12 -0
- package/dist/core/tool-mount-static.js +174 -0
- package/dist/core/tool-name-aliases.d.ts +60 -2
- package/dist/core/tool-name-aliases.js +22 -2
- package/dist/core/tool-name-list.d.ts +3 -0
- package/dist/core/tool-name-readings.d.ts +4 -0
- package/dist/core/tool-name-readings.js +1 -0
- package/dist/core/tool-policy.d.ts +246 -51
- package/dist/core/tool-policy.js +165 -71
- package/dist/core/tool-registry.d.ts +4 -11
- package/dist/core/tool-registry.js +0 -3
- package/dist/core/tool-result-bytes.d.ts +94 -0
- package/dist/core/tool-result-bytes.js +34 -0
- package/dist/core/tool-result-store.d.ts +97 -13
- package/dist/core/tool-result-store.js +52 -4
- package/dist/core/tool-roster.d.ts +71 -10
- package/dist/core/tool-roster.js +71 -21
- package/dist/core/tool-search-setting.d.ts +7 -9
- package/dist/core/tool-search-setting.js +23 -7
- package/dist/core/tool-spec.d.ts +32 -2
- package/dist/core/tools.js +6 -20
- package/dist/core/trace.d.ts +63 -11
- package/dist/core/trace.js +19 -0
- package/dist/core/types.d.ts +8 -6
- package/dist/core/types.js +3 -1
- package/dist/core/unmatched-tool-names.d.ts +37 -0
- package/dist/core/unmatched-tool-names.js +18 -0
- package/dist/core/untrusted-egress.d.ts +16 -5
- package/dist/core/untrusted-egress.js +202 -32
- package/dist/core/untrusted-text.d.ts +29 -8
- package/dist/core/untrusted-text.js +6 -3
- package/dist/core/user-attachment.d.ts +129 -35
- package/dist/core/user-attachment.js +124 -57
- package/dist/core/user-row-origin.d.ts +63 -0
- package/dist/core/user-row-origin.js +61 -0
- package/dist/core/wiring-manifest.d.ts +161 -39
- package/dist/core/wiring-manifest.js +42 -6
- package/dist/core/workflow-run-store-contract.d.ts +11 -1
- package/dist/core/workflow-run-store-contract.js +60 -7
- package/dist/core/workflow-run-store.d.ts +61 -12
- package/dist/core/workflow-run-store.js +100 -15
- package/dist/core/workspace-snapshot.d.ts +10 -14
- package/dist/core/workspace-snapshot.js +3 -22
- package/dist/core/write-protect.d.ts +3 -5
- package/dist/core/write-protect.js +2 -4
- package/dist/engine/compaction/compaction.d.ts +3 -0
- package/dist/engine/compaction/compaction.js +4 -3
- package/dist/engine/execution-env/node-execution-env.d.ts +15 -4
- package/dist/engine/execution-env/node-execution-env.js +80 -27
- package/dist/engine/harness/agent-harness.d.ts +143 -27
- package/dist/engine/harness/agent-harness.js +162 -74
- package/dist/engine/harness/types.d.ts +84 -13
- package/dist/engine/harness/types.js +21 -1
- package/dist/engine/llm/tool-turns.d.ts +4 -0
- package/dist/engine/llm/tool-turns.js +7 -2
- package/dist/engine/llm/types.d.ts +111 -24
- package/dist/engine/llm/types.js +69 -5
- package/dist/engine/llm/validation.js +2 -1
- package/dist/engine/loop/agent-loop.d.ts +39 -6
- package/dist/engine/loop/agent-loop.js +172 -82
- package/dist/engine/loop/types.d.ts +43 -4
- package/dist/engine/lsp/node-lsp-manager.d.ts +5 -3
- package/dist/engine/lsp/node-lsp-manager.js +14 -10
- package/dist/engine/session/import-validate.js +9 -0
- package/dist/engine/session/memory-repo.d.ts +8 -1
- package/dist/engine/session/memory-repo.js +20 -12
- package/dist/engine/session/repo-utils.d.ts +10 -0
- package/dist/engine/session/repo-utils.js +11 -5
- package/dist/engine/session/row-cells.d.ts +32 -0
- package/dist/engine/session/row-cells.js +25 -0
- package/dist/index.d.ts +64 -34
- package/dist/index.js +45 -21
- package/dist/internal/harness.d.ts +8 -6
- package/dist/internal/harness.js +6 -4
- package/dist/internal/llm.d.ts +2 -2
- package/dist/internal/llm.js +1 -1
- package/dist/orchestration/governance-baseline-validity.d.ts +7 -0
- package/dist/orchestration/governance-baseline-validity.js +33 -9
- package/dist/orchestration/run-workflow-tool.d.ts +2 -0
- package/dist/orchestration/run-workflow-tool.js +25 -12
- package/dist/orchestration/workflow-governance.d.ts +19 -4
- package/dist/orchestration/workflow-governance.js +30 -9
- package/dist/orchestration/workflow-primitives.d.ts +4 -1
- package/dist/orchestration/workflow-primitives.js +2 -2
- package/dist/orchestration/workflow-script-runner.d.ts +1 -1
- package/dist/orchestration/workflow-size-guideline.d.ts +1 -1
- package/dist/orchestration/workflow-types.d.ts +21 -12
- package/dist/orchestration/workflow-types.js +15 -4
- package/dist/orchestration/workflow.d.ts +37 -7
- package/dist/orchestration/workflow.js +81 -35
- package/dist/prompt-assembly/artifact-store.js +6 -9
- package/dist/prompt-assembly/assemble.d.ts +4 -10
- package/dist/prompt-assembly/assemble.js +1 -3
- package/dist/prompt-assembly/catalog/constitution.d.ts +0 -20
- package/dist/prompt-assembly/catalog/constitution.js +2 -0
- package/dist/prompt-assembly/catalog/core-behavior.js +5 -3
- package/dist/prompt-assembly/catalog/engine.d.ts +108 -0
- package/dist/prompt-assembly/catalog/engine.js +19 -0
- package/dist/prompt-assembly/catalog/environment.d.ts +276 -0
- package/dist/prompt-assembly/catalog/environment.js +61 -0
- package/dist/prompt-assembly/catalog/index.d.ts +9 -2
- package/dist/prompt-assembly/catalog/index.js +73 -2
- package/dist/prompt-assembly/catalog/locales/index.d.ts +16 -0
- package/dist/prompt-assembly/catalog/locales/index.js +22 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/constitution.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/constitution.js +124 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.d.ts +6 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/core-behavior.js +120 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/cowork.d.ts +8 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/cowork.js +442 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/engine.js +15 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/environment.js +50 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/modes.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/modes.js +163 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/role.d.ts +7 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/role.js +148 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/team.d.ts +6 -0
- package/dist/prompt-assembly/catalog/locales/zh-Hans/team.js +246 -0
- package/dist/prompt-assembly/catalog/role.js +3 -6
- package/dist/prompt-assembly/catalog/schema.d.ts +23 -1
- package/dist/prompt-assembly/catalog/schema.js +2 -0
- package/dist/prompt-assembly/composer.d.ts +6 -11
- package/dist/prompt-assembly/composer.js +7 -7
- package/dist/prompt-assembly/engine-text.d.ts +9 -0
- package/dist/prompt-assembly/engine-text.js +33 -0
- package/dist/prompt-assembly/event-registry.js +3 -3
- package/dist/prompt-assembly/explain.d.ts +1 -0
- package/dist/prompt-assembly/explain.js +1 -1
- package/dist/prompt-assembly/locale-review.d.ts +13 -0
- package/dist/prompt-assembly/locale-review.js +19 -0
- package/dist/prompt-assembly/overlay.d.ts +7 -3
- package/dist/prompt-assembly/overlay.js +27 -5
- package/dist/prompt-assembly/renderers.d.ts +4 -4
- package/dist/prompt-assembly/renderers.js +26 -17
- package/dist/prompt-assembly/role-base.d.ts +1 -1
- package/dist/prompt-assembly/select.d.ts +26 -5
- package/dist/prompt-assembly/select.js +25 -2
- package/dist/prompt-assembly/slots.d.ts +19 -0
- package/dist/prompt-assembly/slots.js +16 -0
- package/dist/prompt-assembly/sugar.d.ts +4 -7
- package/dist/prompt-assembly/sugar.js +1 -2
- package/dist/prompt-assembly/tool-catalog.d.ts +5 -1
- package/dist/prompt-assembly/tool-catalog.js +5 -1
- package/dist/prompt-assembly/turn-snapshot.d.ts +38 -10
- package/dist/prompt-assembly/turn-snapshot.js +43 -13
- package/dist/prompt-assembly/types.d.ts +3 -0
- package/dist/prompts/cowork.d.ts +6 -25
- package/dist/prompts/cowork.js +10 -12
- package/dist/prompts/default.d.ts +10 -32
- package/dist/prompts/default.js +37 -63
- package/dist/shell/lex.d.ts +39 -13
- package/dist/shell/lex.js +70 -30
- package/dist/stores/file/background-agent-store.d.ts +5 -0
- package/dist/stores/file/background-agent-store.js +35 -61
- package/dist/stores/file/checkpoint-store.d.ts +5 -3
- package/dist/stores/file/checkpoint-store.js +8 -10
- package/dist/stores/file/fs-atomic.d.ts +27 -70
- package/dist/stores/file/fs-atomic.js +52 -148
- package/dist/stores/file/index.d.ts +12 -0
- package/dist/stores/file/index.js +27 -2
- package/dist/stores/file/mailbox-store.d.ts +10 -1
- package/dist/stores/file/mailbox-store.js +40 -12
- package/dist/stores/file/permission-rule-adopt.js +5 -2
- package/dist/stores/file/permission-rule-store.d.ts +81 -20
- package/dist/stores/file/permission-rule-store.js +126 -33
- package/dist/stores/file/session-policy-store.d.ts +2 -2
- package/dist/stores/file/session-store.d.ts +21 -2
- package/dist/stores/file/session-store.js +27 -14
- package/dist/stores/file/task-list-store.js +23 -25
- package/dist/stores/file/tool-result-store.d.ts +45 -7
- package/dist/stores/file/tool-result-store.js +99 -36
- package/dist/stores/file/workflow-run-store.d.ts +1 -0
- package/dist/stores/file/workflow-run-store.js +14 -11
- package/dist/tools/artifact/artifact-tool.js +2 -0
- package/dist/tools/artifact/local-stub.js +6 -6
- package/dist/tools/fs/bash-program-position.d.ts +1 -2
- package/dist/tools/fs/bash-readonly-classifier.d.ts +35 -0
- package/dist/tools/fs/bash-readonly-classifier.js +50 -12
- package/dist/tools/fs/env-error-detail.d.ts +1 -0
- package/dist/tools/fs/env-error-detail.js +7 -0
- package/dist/tools/fs/fs-bash.d.ts +24 -6
- package/dist/tools/fs/fs-bash.js +73 -25
- package/dist/tools/fs/fs-pdf.js +6 -4
- package/dist/tools/fs/fs-read.d.ts +76 -31
- package/dist/tools/fs/fs-read.js +159 -79
- package/dist/tools/fs/fs-search-tools.d.ts +1 -1
- package/dist/tools/fs/fs-search-tools.js +3 -1
- package/dist/tools/fs/fs-shared.d.ts +59 -63
- package/dist/tools/fs/fs-shared.js +31 -18
- package/dist/tools/fs/fs-write.d.ts +13 -0
- package/dist/tools/fs/fs-write.js +69 -13
- package/dist/tools/fs/index.d.ts +19 -1
- package/dist/tools/fs/index.js +10 -2
- package/dist/tools/fs/pdf.js +10 -9
- package/dist/tools/fs/read-deny.js +4 -10
- package/dist/tools/fs/read-floor.d.ts +5 -4
- package/dist/tools/fs/removal-targets.d.ts +11 -5
- package/dist/tools/fs/removal-targets.js +62 -32
- package/dist/tools/fs/safety.d.ts +26 -19
- package/dist/tools/fs/safety.js +13 -8
- package/dist/tools/fs/search.d.ts +1 -1
- package/dist/tools/fs/shell-read-argv.js +1 -0
- package/dist/tools/fs/shell-read-bindings.d.ts +128 -26
- package/dist/tools/fs/shell-read-bindings.js +667 -139
- package/dist/tools/fs/shell-read-check.js +1 -1
- package/dist/tools/fs/shell-read-judge.d.ts +4 -1
- package/dist/tools/fs/shell-read-judge.js +5 -1
- package/dist/tools/fs/shell-read-plan.d.ts +4 -0
- package/dist/tools/fs/shell-read-plan.js +21 -19
- package/dist/tools/fs/shell-read-sourced.d.ts +4 -3
- package/dist/tools/fs/shell-read-sourced.js +18 -1
- package/dist/tools/fs/shell-read-start.d.ts +6 -6
- package/dist/tools/fs/shell-read-start.js +1 -6
- package/dist/tools/fs/shell-read-word.d.ts +4 -2
- package/dist/tools/fs/shell-read-word.js +7 -6
- package/dist/tools/fs/shell-read-workdir.d.ts +1 -1
- package/dist/tools/fs/shell-reentry-text.d.ts +24 -9
- package/dist/tools/fs/shell-reentry-text.js +50 -20
- package/dist/tools/monitor.d.ts +4 -0
- package/dist/tools/monitor.js +14 -4
- package/dist/tools/scheduler-tools.d.ts +5 -2
- package/dist/tools/scheduler-tools.js +8 -6
- package/dist/tools/task-list.d.ts +49 -20
- package/dist/tools/task-list.js +115 -35
- package/dist/tools/web.d.ts +13 -3
- package/dist/tools/web.js +17 -6
- package/dist/tools/worktree.d.ts +3 -2
- package/dist/tools/worktree.js +24 -25
- package/package.json +10 -3
- package/test/export-surface.snapshot.json +340 -32
- package/wire-changes/core-stores-sql@7.67.0.json +39 -0
- package/wire-changes/core-stores-sql@7.67.1.json +39 -0
- package/wire-changes/core@7.67.0.json +12578 -0
- package/wire-changes/core@7.67.1.json +406 -0
- package/wire-changes/mods-kernel@7.67.0.json +167 -0
- package/wire-changes/mods-kernel@7.67.1.json +39 -0
- package/wire-changes/primitives@7.67.0.json +325 -0
- package/wire-changes/primitives@7.67.1.json +39 -0
- package/wire-changes/wiki-gate@7.67.0.json +1636 -0
- package/wire-changes/wiki-gate@7.67.1.json +39 -0
- package/dist/brain/degrading.d.ts +0 -93
- package/dist/brain/degrading.js +0 -189
- package/dist/core/tool-conformance.d.ts +0 -20
- package/dist/core/tool-conformance.js +0 -37
|
@@ -1,28 +1,63 @@
|
|
|
1
1
|
import type { SessionTreeEntry } from "../../internal/harness-types.js";
|
|
2
|
-
import type { DateAnchorRead } from "./contracts.js";
|
|
2
|
+
import type { DateAnchorRead, PrefixHeadDigests, Prepared } from "./contracts.js";
|
|
3
|
+
/** The conversation's epoch ANCHOR (engine-owned; never model-visible): what the head of the session's requests was
|
|
4
|
+
* frozen to for the current segment — the date the system prefix renders, and the head's own digests. */
|
|
5
|
+
export declare const DATE_ANCHOR_CUSTOM_TYPE = "engine:date-anchor";
|
|
3
6
|
/** The id of the active branch's latest compaction entry — the segment a fact is recorded for — or `null` before any. */
|
|
4
7
|
export declare function conversationSegmentOf(branch: ReadonlyArray<SessionTreeEntry>): string | null;
|
|
5
|
-
/**
|
|
6
|
-
|
|
8
|
+
/** A seat that tells the model something once per segment: the frame its leg's first request still owes, and the segment that
|
|
9
|
+
* was judged in (`undefined` = the branch could not be read, and nothing is recorded). */
|
|
10
|
+
export interface ToldSeat<V> {
|
|
11
|
+
owed?: {
|
|
12
|
+
readonly body: string;
|
|
13
|
+
readonly value: V;
|
|
14
|
+
};
|
|
15
|
+
segment: string | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The compaction arm every told seat shares. The text the compaction summarized away is appended as one engine-minted message
|
|
19
|
+
* right after it lands (the posture's rule, halt included: no engine message enters the transcript ahead of a person's next
|
|
20
|
+
* words), unless the leg's own pending frame IS that text (`carried`): it rides the next message into the new segment. Then the
|
|
21
|
+
* record moves to the new segment and is written at once — an end-of-task compaction lands after the leg's own snapshot write.
|
|
22
|
+
* A failed append is reported and records nothing (the next leg tells it again); an unreadable branch records nothing. Never throws.
|
|
23
|
+
*/
|
|
24
|
+
export declare function restateToldSeat<V>(prepared: Pick<Prepared, "reminderMark" | "session" | "admitRows" | "batchHaltRef" | "postureFrameRef" | "announcedListingsRef" | "frameReceipts" | "announcedSnapshotRecovered">, seat: ToldSeat<V>, told: {
|
|
25
|
+
body: string;
|
|
26
|
+
value: V;
|
|
27
|
+
what: string;
|
|
28
|
+
carried: boolean;
|
|
29
|
+
record: (value: V, segment: string | null) => void;
|
|
30
|
+
}): Promise<void>;
|
|
7
31
|
/**
|
|
8
|
-
* Read the session's
|
|
9
|
-
*
|
|
10
|
-
* prefix predates a compaction that landed in between therefore reads as absent — the
|
|
11
|
-
* compaction re-anchor the
|
|
32
|
+
* Read the session's epoch anchor off the active branch: the nearest anchor entry NEWER than the nearest compaction
|
|
33
|
+
* that carries each half (the date pair, the head), honored only when it was written for that same segment. An
|
|
34
|
+
* anchor written by a leg whose prefix predates a compaction that landed in between therefore reads as absent — the
|
|
35
|
+
* one rule that makes a compaction re-anchor the epoch. An unreadable branch returns undefined (the leg renders
|
|
36
|
+
* today, compares nothing, writes nothing).
|
|
12
37
|
*/
|
|
13
38
|
export declare function readDateAnchor(session: {
|
|
14
39
|
getBranch(): Promise<ReadonlyArray<SessionTreeEntry>>;
|
|
15
40
|
}): Promise<DateAnchorRead | undefined>;
|
|
41
|
+
/** The head's per-block digests the anchor keeps — one short unsalted sha256 per prompt block, keyed by block id (a
|
|
42
|
+
* repeated id takes its position as a suffix, so two blocks never share a key). */
|
|
43
|
+
export declare function prefixHeadBlocksOf(blocks: ReadonlyArray<{
|
|
44
|
+
id: string;
|
|
45
|
+
text: string;
|
|
46
|
+
}>): Readonly<Record<string, string>>;
|
|
47
|
+
/** The head segments that differ between the anchored head and this leg's (block ids, then `tools`), sorted; empty ⇒ same
|
|
48
|
+
* head. A block counts as moved when its digest differs or its position does (the record keeps the blocks' order). */
|
|
49
|
+
export declare function headSegmentsChanged(anchored: PrefixHeadDigests, now: PrefixHeadDigests): string[];
|
|
16
50
|
/**
|
|
17
|
-
* The anchor write a leg owes when it settles, or undefined
|
|
18
|
-
*
|
|
19
|
-
*
|
|
51
|
+
* The anchor write a leg owes when it settles, or undefined. Owed when the leg rendered a date and prepare found no
|
|
52
|
+
* anchored date for the segment or the model has since been told a newer one, or when the leg's head is not the one
|
|
53
|
+
* the anchor recorded (the leg opened an epoch: its own head becomes the anchor); never after an unreadable branch. The
|
|
54
|
+
* entry carries both halves — a half this leg did not produce is carried over from the anchor it read. Best-effort — a
|
|
55
|
+
* lost write costs one re-rendered prefix, one repeated reminder, or one un-attributed leg start next leg, never a wrong
|
|
56
|
+
* date.
|
|
20
57
|
*/
|
|
21
58
|
export declare function owedDateAnchor(session: {
|
|
22
59
|
appendCustomEntry(customType: string, data?: unknown): Promise<string>;
|
|
23
|
-
},
|
|
60
|
+
}, read: DateAnchorRead | undefined, date: {
|
|
24
61
|
legDate: string;
|
|
25
|
-
anchor: DateAnchorRead | undefined;
|
|
26
|
-
} | undefined, state: {
|
|
27
62
|
announcedDate: string;
|
|
28
|
-
} | undefined): (() => Promise<void>) | undefined;
|
|
63
|
+
} | undefined, head: PrefixHeadDigests | undefined): (() => Promise<void>) | undefined;
|
|
@@ -1,20 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mintSystemReminder } from "../reminder-mint.js";
|
|
3
|
+
import { appendAdmittedRow } from "../row-admission.js";
|
|
4
|
+
import { thrownText } from "../thrown-value.js";
|
|
5
|
+
import { flushOwedAnnouncedSnapshot } from "./announce-once-ledger.js";
|
|
7
6
|
export const DATE_ANCHOR_CUSTOM_TYPE = "engine:date-anchor";
|
|
8
7
|
const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
9
|
-
|
|
8
|
+
const DIGEST = /^[0-9a-z:]{1,80}$/;
|
|
9
|
+
const MAX_HEAD_BLOCKS = 64;
|
|
10
|
+
function normalizeHead(v) {
|
|
10
11
|
if (typeof v !== "object" || v === null)
|
|
11
12
|
return undefined;
|
|
12
|
-
const {
|
|
13
|
-
if (typeof
|
|
13
|
+
const { blocks, tools } = v;
|
|
14
|
+
if (typeof tools !== "string" || !DIGEST.test(tools) || typeof blocks !== "object" || blocks === null || Array.isArray(blocks))
|
|
14
15
|
return undefined;
|
|
16
|
+
const entries = Object.entries(blocks);
|
|
17
|
+
if (entries.length > MAX_HEAD_BLOCKS || !entries.every(([id, d]) => id.length <= 200 && typeof d === "string" && DIGEST.test(d)))
|
|
18
|
+
return undefined;
|
|
19
|
+
return { blocks: Object.fromEntries(entries), tools };
|
|
20
|
+
}
|
|
21
|
+
function normalizeAnchor(v) {
|
|
22
|
+
if (typeof v !== "object" || v === null)
|
|
23
|
+
return undefined;
|
|
24
|
+
const { prefixDate, announcedDate, segment, head } = v;
|
|
15
25
|
if (segment !== null && (typeof segment !== "string" || segment.length > 200))
|
|
16
26
|
return undefined;
|
|
17
|
-
|
|
27
|
+
const date = typeof prefixDate === "string" && ISO_DATE.test(prefixDate) && typeof announcedDate === "string" && ISO_DATE.test(announcedDate) ? { prefixDate, announcedDate } : undefined;
|
|
28
|
+
const headRead = normalizeHead(head);
|
|
29
|
+
if (date === undefined && headRead === undefined)
|
|
30
|
+
return undefined;
|
|
31
|
+
return { ...(date !== undefined ? { date } : {}), ...(headRead !== undefined ? { head: headRead } : {}), segment };
|
|
32
|
+
}
|
|
33
|
+
export function conversationSegmentOf(branch) {
|
|
34
|
+
for (let i = branch.length - 1; i >= 0; i--)
|
|
35
|
+
if (branch[i].type === "compaction")
|
|
36
|
+
return branch[i].id;
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
export async function restateToldSeat(prepared, seat, told) {
|
|
40
|
+
if (prepared.batchHaltRef.current !== undefined)
|
|
41
|
+
return;
|
|
42
|
+
if (!told.carried) {
|
|
43
|
+
try {
|
|
44
|
+
await appendAdmittedRow(prepared.admitRows, prepared.session, { role: "user", content: [{ type: "text", text: mintSystemReminder(told.body, prepared.reminderMark) }], timestamp: Date.now(), engineMinted: true });
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
try {
|
|
48
|
+
prepared.postureFrameRef.report?.(new Error(`${told.what} could not be restated after compaction (the next leg tells the model again): ${thrownText(err)}`));
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
}
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
seat.segment = await prepared.session.getBranch().then(conversationSegmentOf, () => undefined);
|
|
56
|
+
if (told.carried || seat.segment === undefined)
|
|
57
|
+
return;
|
|
58
|
+
told.record(told.value, seat.segment);
|
|
59
|
+
prepared.frameReceipts.listingSnapshotOwed = true;
|
|
60
|
+
await flushOwedAnnouncedSnapshot(prepared);
|
|
18
61
|
}
|
|
19
62
|
export async function readDateAnchor(session) {
|
|
20
63
|
let branch;
|
|
@@ -24,19 +67,49 @@ export async function readDateAnchor(session) {
|
|
|
24
67
|
catch {
|
|
25
68
|
return undefined;
|
|
26
69
|
}
|
|
27
|
-
let
|
|
28
|
-
|
|
70
|
+
let date;
|
|
71
|
+
let head;
|
|
72
|
+
for (let i = branch.length - 1; i >= 0 && branch[i].type !== "compaction" && (date === undefined || head === undefined); i--) {
|
|
29
73
|
const e = branch[i];
|
|
30
|
-
if (
|
|
31
|
-
|
|
74
|
+
if (e.type !== "custom" || e.customType !== DATE_ANCHOR_CUSTOM_TYPE)
|
|
75
|
+
continue;
|
|
76
|
+
const entry = normalizeAnchor(e.data);
|
|
77
|
+
if (entry === undefined)
|
|
78
|
+
continue;
|
|
79
|
+
if (date === undefined && entry.date !== undefined)
|
|
80
|
+
date = entry;
|
|
81
|
+
if (head === undefined && entry.head !== undefined)
|
|
82
|
+
head = entry;
|
|
32
83
|
}
|
|
33
84
|
const segment = conversationSegmentOf(branch);
|
|
34
|
-
return {
|
|
85
|
+
return {
|
|
86
|
+
current: date !== undefined && date.segment === segment ? date.date : undefined,
|
|
87
|
+
segment,
|
|
88
|
+
...(head !== undefined && head.segment === segment ? { head: head.head } : {}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export function prefixHeadBlocksOf(blocks) {
|
|
92
|
+
const out = {};
|
|
93
|
+
for (const b of blocks) {
|
|
94
|
+
const key = out[b.id] === undefined ? b.id : `${b.id}#${Object.keys(out).length}`;
|
|
95
|
+
out[key] = createHash("sha256").update(b.text, "utf8").digest("hex").slice(0, 16);
|
|
96
|
+
}
|
|
97
|
+
return out;
|
|
35
98
|
}
|
|
36
|
-
export function
|
|
37
|
-
const
|
|
38
|
-
|
|
99
|
+
export function headSegmentsChanged(anchored, now) {
|
|
100
|
+
const before = Object.keys(anchored.blocks);
|
|
101
|
+
const after = Object.keys(now.blocks);
|
|
102
|
+
const moved = [...new Set([...before, ...after])].filter((id) => anchored.blocks[id] !== now.blocks[id] || before.indexOf(id) !== after.indexOf(id)).sort();
|
|
103
|
+
return anchored.tools === now.tools ? moved : [...moved, "tools"];
|
|
104
|
+
}
|
|
105
|
+
export function owedDateAnchor(session, read, date, head) {
|
|
106
|
+
if (read === undefined)
|
|
107
|
+
return undefined;
|
|
108
|
+
const dateOwed = date !== undefined && read.current?.announcedDate !== date.announcedDate;
|
|
109
|
+
const headOwed = head !== undefined && (read.head === undefined || headSegmentsChanged(read.head, head).length > 0);
|
|
110
|
+
if (!dateOwed && !headOwed)
|
|
39
111
|
return undefined;
|
|
40
|
-
const
|
|
112
|
+
const pair = date !== undefined ? { prefixDate: date.legDate, announcedDate: date.announcedDate } : read.current;
|
|
113
|
+
const data = { ...(pair !== undefined ? pair : {}), segment: read.segment, ...(head !== undefined ? { head } : read.head !== undefined ? { head: read.head } : {}) };
|
|
41
114
|
return () => session.appendCustomEntry(DATE_ANCHOR_CUSTOM_TYPE, data).then(() => undefined, () => undefined);
|
|
42
115
|
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
import type { AgentTool } from "../../internal/harness.js";
|
|
24
24
|
import type { ExecutionEnv, SessionTreeEntry } from "../../internal/harness-types.js";
|
|
25
25
|
import { type CrossBoundaryCheck, type CrossBoundaryPosture, type CrossBoundaryTreeToken, type OwedDeliveries } from "../cross-boundary-taint.js";
|
|
26
|
+
import type { NoticeRoute } from "../leg-identity.js";
|
|
26
27
|
import { type ToolRoster } from "../tool-roster.js";
|
|
27
28
|
import type { RunnerDeps } from "../types.js";
|
|
28
29
|
/** A new tree with no bit set, and the token that names it — the one mint of a token. */
|
|
@@ -84,6 +85,9 @@ export interface CrossBoundaryLaneInput {
|
|
|
84
85
|
sessionId: string;
|
|
85
86
|
runId: string;
|
|
86
87
|
hostTaskId: string;
|
|
88
|
+
/** Where this leg's user-face notices go (`noticeAddressOf`, minted once per leg): the leg's frames are filed under the session
|
|
89
|
+
* it names — the leg's own on a top-level leg, the delegation tree's root on a delegated one. */
|
|
90
|
+
noticeRoute: NoticeRoute;
|
|
87
91
|
deps: Pick<RunnerDeps, "onError" | "onNotice" | "tracer">;
|
|
88
92
|
}
|
|
89
93
|
/** The leg's lane: the tree ref joined with what this leg knows, the session's record read and (when the state grew) written. */
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { targetIsExternal } from "../remote-env.js";
|
|
2
2
|
import { BOUNDARY_LEGS, CROSS_BOUNDARY_RECORD_TYPE, CROSS_BOUNDARY_TAINT_BITS, STRICTEST_CROSS_BOUNDARY_TREE, crossBoundaryObligation, crossBoundaryPostureUndeclaredNotice, crossBoundaryRecordUnwrittenNotice, crossBoundaryRecordData, crossBoundaryTreeCovers, crossBoundaryTreeGoverned, joinCrossBoundaryTree, readCrossBoundaryRecord, } from "../cross-boundary-taint.js";
|
|
3
3
|
import { deliverEngineNotice } from "../engine-notice.js";
|
|
4
|
-
import {
|
|
4
|
+
import { personAnswered } from "../real-approval.js";
|
|
5
5
|
import { thrownText } from "../thrown-value.js";
|
|
6
6
|
import { rosterEntryNamed, survivorsByName } from "../tool-roster.js";
|
|
7
7
|
import { emitTrace } from "../trace.js";
|
|
8
|
+
const CROSS_BOUNDARY_CLASSES = Object.freeze(["cross_boundary"]);
|
|
8
9
|
const TREE_STATE = new WeakMap();
|
|
9
10
|
export function mintCrossBoundaryTree() {
|
|
10
11
|
const token = Object.freeze(Object.create(null));
|
|
@@ -56,7 +57,7 @@ function legsOfCall(view, legEnv, token, call, report) {
|
|
|
56
57
|
return { legs: legs, env: env ?? legEnv };
|
|
57
58
|
}
|
|
58
59
|
export async function prepareCrossBoundaryLane(input) {
|
|
59
|
-
const { posture, externalContentTargetActive, env, session, resumeLeg, sessionId, runId, hostTaskId, deps } = input;
|
|
60
|
+
const { posture, externalContentTargetActive, env, session, resumeLeg, sessionId, runId, hostTaskId, noticeRoute, deps } = input;
|
|
60
61
|
const report = (message) => {
|
|
61
62
|
try {
|
|
62
63
|
deps.onError?.(new Error(message), { phase: "config", sessionId });
|
|
@@ -155,7 +156,9 @@ export async function prepareCrossBoundaryLane(input) {
|
|
|
155
156
|
return addedBy(records(ONE_OUTSIDE_READ));
|
|
156
157
|
}
|
|
157
158
|
};
|
|
158
|
-
const
|
|
159
|
+
const filedUnder = noticeRoute.destination ?? noticeRoute.address;
|
|
160
|
+
const filedOccupant = noticeRoute.destination?.occupant;
|
|
161
|
+
const trace = (phase, call) => emitTrace(deps.tracer, () => ({ kind: "permission.cross_boundary_taint", version: 1, taskId: hostTaskId, runId, root: { sessionId: filedUnder.sessionId, ...(filedOccupant !== undefined ? { occupant: filedOccupant } : {}) }, phase, taint: bitsOf(ref.current), governed: ref.current.governed === true, ...(call !== undefined ? { toolName: call.toolName, ...(call.toolCallId !== undefined ? { toolCallId: call.toolCallId } : {}) } : {}), ts: Date.now() }));
|
|
159
162
|
if (tree.targetExecutionArmed === true) {
|
|
160
163
|
trace(resumeLeg ? "resume" : "prepare");
|
|
161
164
|
if (posture === undefined && tree.governed !== true)
|
|
@@ -185,13 +188,13 @@ export async function prepareCrossBoundaryLane(input) {
|
|
|
185
188
|
const quiet = () => undefined;
|
|
186
189
|
check = {
|
|
187
190
|
obligation: (call) => obligationOf(call, report),
|
|
188
|
-
async exit(call,
|
|
191
|
+
async exit(call, answered) {
|
|
189
192
|
for (;;) {
|
|
190
193
|
const now = obligationOf(call, quiet);
|
|
191
|
-
if (now.mandate &&
|
|
194
|
+
if (now.mandate && !personAnswered(answered, CROSS_BOUNDARY_CLASSES)) {
|
|
192
195
|
return {
|
|
193
196
|
kind: "unconfirmed",
|
|
194
|
-
message: `tool "${call.toolName}" needs a person's confirmation: this run executes on a target device${ref.current.offTargetReadObserved === true ? " and has since let content from beyond it in, so a call that reaches beyond the device or back into it" : ", so a call that writes beyond the device"} is put to a person — this call was
|
|
197
|
+
message: `tool "${call.toolName}" needs a person's confirmation: this run executes on a target device${ref.current.offTargetReadObserved === true ? " and has since let content from beyond it in, so a call that reaches beyond the device or back into it" : ", so a call that writes beyond the device"} is put to a person — the approval this call had was not given to a question that asked for that, so it was not executed; send the call again to have it asked`,
|
|
195
198
|
};
|
|
196
199
|
}
|
|
197
200
|
const adds = addedBy(now.record);
|
|
@@ -8,7 +8,7 @@ import { facetOf, isGateKind, isQuestionGate } from "../pause-registry.js";
|
|
|
8
8
|
import { humanRefusalSentence, policyCannotAnswer, screenApproverAttribution, screenDecidedVia } from "../tool-policy.js";
|
|
9
9
|
import { mintGateOutcome } from "./gate-exit.js";
|
|
10
10
|
import { delimitUntrusted, REVIEWER_NOTE_MAX_BODY } from "../untrusted-text.js";
|
|
11
|
-
import { writtenFeedback } from "
|
|
11
|
+
import { writtenFeedback } from "../approval-words.js";
|
|
12
12
|
import { engineCardOf } from "../tool-roster.js";
|
|
13
13
|
export function resumeDecisionWasNegative(resume) {
|
|
14
14
|
const o = resume.outcome;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type PermissionResult, type ResolvedAsk } from "../tool-policy.js";
|
|
2
|
+
/** A deferred question: the identity its card carried and the digest of the bytes the deferring answer was bound to. */
|
|
3
|
+
export interface DeferredAsk {
|
|
4
|
+
readonly checkpointId: string;
|
|
5
|
+
readonly inputDigest: string;
|
|
6
|
+
}
|
|
7
|
+
/** The deferral a resolution records, read off the resolver's engine record for the call — none when the answer is not
|
|
8
|
+
* `"unavailable"`, or when the record binds no bytes (arguments outside the bindable domain bind no row either). */
|
|
9
|
+
export declare function deferredAskOf(resolved: ResolvedAsk, call: {
|
|
10
|
+
toolCallId: string;
|
|
11
|
+
toolName: string;
|
|
12
|
+
}, checkpointId: string): DeferredAsk | undefined;
|
|
13
|
+
/** The approval row's identity: the deferred question's when the row binds the bytes its card showed, else the row's own mint. */
|
|
14
|
+
export declare function parkedAskIdentity(deferred: DeferredAsk | undefined, rowDigest: string): string;
|
|
15
|
+
type Ask = Extract<PermissionResult, {
|
|
16
|
+
action: "ask";
|
|
17
|
+
}>;
|
|
18
|
+
/** One station's mark on a call: the question it routed to the park and the digest of the bytes it was bound to (`undefined`
|
|
19
|
+
* for bytes outside the bindable domain: they bind nothing, so no later bytes are those). */
|
|
20
|
+
export interface StationMark {
|
|
21
|
+
readonly question: Ask;
|
|
22
|
+
readonly inputDigest: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** The marker channel: per call, per inherited station (its chain entry), the station's mark. A call is marked while one stands. */
|
|
25
|
+
export type MarkerChannel = Map<string, Map<object, StationMark>>;
|
|
26
|
+
/** The marker channel as a reader that only asks "is this call marked?" reads it. */
|
|
27
|
+
export interface MarkedCalls {
|
|
28
|
+
has(toolCallId: string): boolean;
|
|
29
|
+
}
|
|
30
|
+
type Call = {
|
|
31
|
+
readonly toolName: string;
|
|
32
|
+
readonly toolCallId: string;
|
|
33
|
+
readonly args: unknown;
|
|
34
|
+
readonly face?: object | undefined;
|
|
35
|
+
};
|
|
36
|
+
/** A station's mark over the bytes it judged: the args as the station received them, under its ask's own rewrite when it carries
|
|
37
|
+
* one (`boundArgs` overrides: the same-instance arbitration station is handed the bytes after that rewrite already cascaded). */
|
|
38
|
+
export declare function stationMarkOf(question: Ask, call: Call, boundArgs?: unknown): StationMark;
|
|
39
|
+
/** Records a station's mark on a call: this look's question replaces the station's earlier one (another station's stays). */
|
|
40
|
+
export declare function markCall(channel: MarkerChannel, station: object, toolCallId: string, mark: StationMark): void;
|
|
41
|
+
/** The station's own approver answered over the bytes in front of it: its mark is lifted; with none standing, the call is unmarked. */
|
|
42
|
+
export declare function liftMark(channel: MarkerChannel, station: object, toolCallId: string): void;
|
|
43
|
+
/** Whether a station's mark is bound to the bytes `args` (the same digest; unbindable bytes are bound to nothing). */
|
|
44
|
+
export declare function markBinds(mark: StationMark, call: {
|
|
45
|
+
toolName: string;
|
|
46
|
+
}, args: unknown): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* One look of an inherited station at a call (`look`, handed `call`). When the station marked the call on an EARLIER look: a deny
|
|
49
|
+
* stands; a look whose own approver answered over these bytes stands (it lifted the mark, or moved it to them); a verdict that
|
|
50
|
+
* rewrites these bytes stands too — every reader of a later look refuses a rewrite it is handed there (a rewrite is judged once,
|
|
51
|
+
* never chased), and hiding it behind the question would park bytes the station wanted changed; any other verdict hands back the
|
|
52
|
+
* deferred question ({@link standingOf}).
|
|
53
|
+
*/
|
|
54
|
+
export declare function stationLook(channel: MarkerChannel, station: object, call: Call, look: () => Promise<PermissionResult>): Promise<PermissionResult>;
|
|
55
|
+
/** The question a station deferred on an earlier look at the call, as it stands over a later look: without its rewrite (a later
|
|
56
|
+
* look never re-points the call). Undefined when the station marked nothing on the call. */
|
|
57
|
+
export declare function standingOf(channel: MarkerChannel, station: object, call: {
|
|
58
|
+
readonly toolCallId: string;
|
|
59
|
+
}): Ask | undefined;
|
|
60
|
+
/** The clause a refusal or a card adds when the bytes in front of it are not the ones the deferred question was bound to. */
|
|
61
|
+
export declare function movedClause(toolName: string): string;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { mintCheckpointId } from "../checkpoint-store.js";
|
|
2
|
+
import { exactBoundInputHashOf } from "../canonical-json.js";
|
|
3
|
+
import { argsAsTheToolReads } from "../effective-path-target.js";
|
|
4
|
+
import { readRejudge } from "../rewrite-rejudge.js";
|
|
5
|
+
import { attestationOf } from "../tool-policy.js";
|
|
6
|
+
export function deferredAskOf(resolved, call, checkpointId) {
|
|
7
|
+
if (resolved.approverUnavailable !== true)
|
|
8
|
+
return undefined;
|
|
9
|
+
const inputDigest = attestationOf(resolved, call)?.inputDigest;
|
|
10
|
+
return inputDigest !== undefined ? { checkpointId, inputDigest } : undefined;
|
|
11
|
+
}
|
|
12
|
+
export function parkedAskIdentity(deferred, rowDigest) {
|
|
13
|
+
return deferred !== undefined && deferred.inputDigest === rowDigest ? deferred.checkpointId : mintCheckpointId();
|
|
14
|
+
}
|
|
15
|
+
export function stationMarkOf(question, call, boundArgs = question.updatedInput !== undefined ? argsAsTheToolReads(call, question.updatedInput) : call.args) {
|
|
16
|
+
return { question, inputDigest: exactBoundInputHashOf(call.toolName, boundArgs) };
|
|
17
|
+
}
|
|
18
|
+
export function markCall(channel, station, toolCallId, mark) {
|
|
19
|
+
channel.set(toolCallId, (channel.get(toolCallId) ?? new Map()).set(station, mark));
|
|
20
|
+
}
|
|
21
|
+
export function liftMark(channel, station, toolCallId) {
|
|
22
|
+
const marks = channel.get(toolCallId);
|
|
23
|
+
if (marks?.delete(station) === true && marks.size === 0)
|
|
24
|
+
channel.delete(toolCallId);
|
|
25
|
+
}
|
|
26
|
+
export function markBinds(mark, call, args) {
|
|
27
|
+
return mark.inputDigest !== undefined && mark.inputDigest === exactBoundInputHashOf(call.toolName, args);
|
|
28
|
+
}
|
|
29
|
+
export async function stationLook(channel, station, call, look) {
|
|
30
|
+
const prior = channel.get(call.toolCallId)?.get(station);
|
|
31
|
+
const verdict = await look();
|
|
32
|
+
const standing = channel.get(call.toolCallId)?.get(station) === prior ? standingOf(channel, station, call) : undefined;
|
|
33
|
+
return standing === undefined || verdict.action === "deny" || readRejudge(call, call.args, verdict).kind === "rewritten" ? verdict : standing;
|
|
34
|
+
}
|
|
35
|
+
export function standingOf(channel, station, call) {
|
|
36
|
+
const mark = channel.get(call.toolCallId)?.get(station);
|
|
37
|
+
if (mark === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
const { updatedInput: _bound, ...question } = mark.question;
|
|
40
|
+
return question;
|
|
41
|
+
}
|
|
42
|
+
export function movedClause(toolName) {
|
|
43
|
+
return `the ancestor's question about this call to "${toolName}" was deferred over the arguments as they read before a later policy layer rewrote them; the arguments that would run were never shown to that approver`;
|
|
44
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { SessionStore } from "../session.js";
|
|
2
|
+
import type { RunnerDeps } from "../types.js";
|
|
3
|
+
import type { RunInternals } from "./contracts.js";
|
|
2
4
|
/**
|
|
3
5
|
* The delegation tree's owner as one run binds it: `bound` with the owner (`null` = the tree root's row is anonymous), or `unbound`
|
|
4
6
|
* when the row this run acquired no longer stands under its id (deleted, or deleted and created again for another occupant) the first
|
|
@@ -34,6 +36,23 @@ export declare const DELEGATION_OWNER_UNBOUND = "delegation.owner_unbound";
|
|
|
34
36
|
export declare function delegationOwnerUnbound(reason: string): Error & {
|
|
35
37
|
code: typeof DELEGATION_OWNER_UNBOUND;
|
|
36
38
|
};
|
|
39
|
+
/**
|
|
40
|
+
* THE read of the tree root's address a run's internals carry, taken once where the run's internals are first composed so that prepare,
|
|
41
|
+
* the notification lane and every child the run spawns read the same answer: the root's id (`rootSessionId`, and the explicit placement
|
|
42
|
+
* declaration `placementRoot` that outranks it) and the occupant that root held when the tree was born (`rootSessionIncarnation`).
|
|
43
|
+
*
|
|
44
|
+
* A root id is a session id: a non-empty string. Absent, `undefined` and `null` name no root (the member is left out of the copy, the
|
|
45
|
+
* run is its own root). Anything else — `""`, a number, an object, an array — is a bad root and the run is REFUSED
|
|
46
|
+
* (`config.placement_root_invalid`, the member named and its shape said, never its value): the root decides where the leg is placed and
|
|
47
|
+
* whose session a notice is filed under, so a malformed one is never read as "no root" and defaulted around — one reading, everywhere.
|
|
48
|
+
* The occupant goes through the engine's one occupant decoding ({@link readIncarnationCell}): a non-empty string is the token;
|
|
49
|
+
* anything else names no occupant — the member is dropped from the copy handed back, so the root reads as an unknown occupant
|
|
50
|
+
* everywhere — and `onError` is told once (`phase: "config"`, `config.invalid_argument`) with the value's shape, never the value.
|
|
51
|
+
* Absent, `undefined` and `null` are an unknown occupant already, said nothing. The root's box scope (`rootSessionScope`) is read the
|
|
52
|
+
* same way: a non-empty string is the scope; anything else is no recorded scope, dropped and told once. Every member is read once
|
|
53
|
+
* into the copy, so a getter cannot answer one value here and another to the spread that follows; the caller's own bag is never written.
|
|
54
|
+
*/
|
|
55
|
+
export declare function readRootOccupant(internals: RunInternals | undefined, onError: RunnerDeps["onError"], sessionId: string | undefined): RunInternals | undefined;
|
|
37
56
|
/** The owner a seat binds, or `null` where no seat rides (a tool driven with no run around it has no tree root to read). */
|
|
38
57
|
export declare function delegationOwnerOf(seat: DelegationOwnerSeat | undefined): Promise<DelegationOwnerReading>;
|
|
39
58
|
/** A revived child's tree owner: the owner its own row records, read by id through the store it lives in (`null` where the store has
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sameOccupant } from "../../engine/session/repo-utils.js";
|
|
1
|
+
import { notANameShape, readIncarnationCell, sameOccupant } from "../../engine/session/repo-utils.js";
|
|
2
2
|
function ownerCellReading(sessionId, head) {
|
|
3
3
|
const owner = head.owner;
|
|
4
4
|
if (owner === null || typeof owner === "string")
|
|
@@ -46,6 +46,32 @@ async function settled(read) {
|
|
|
46
46
|
return { bound: false, reason: "the row that names it could not be read", fault: err };
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
export function readRootOccupant(internals, onError, sessionId) {
|
|
50
|
+
if (internals === undefined)
|
|
51
|
+
return undefined;
|
|
52
|
+
const { rootSessionId: rawRootId, placementRoot: rawPlacementRoot, rootSessionIncarnation: raw, rootSessionScope: rawScope, ...rest } = internals;
|
|
53
|
+
const rootSessionId = rootIdMember("rootSessionId", rawRootId);
|
|
54
|
+
const placementRoot = rootIdMember("placementRoot", rawPlacementRoot);
|
|
55
|
+
const disclose = (member, detail) => {
|
|
56
|
+
try {
|
|
57
|
+
onError?.(Object.assign(new Error(`RunInternals.${member}: ${detail}`), { code: "config.invalid_argument" }), { phase: "config", sessionId: sessionId ?? "(pre-session)", classification: "root-occupant" });
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const token = readIncarnationCell(raw, (detail) => disclose("rootSessionIncarnation", detail));
|
|
63
|
+
const scope = typeof rawScope === "string" && rawScope !== "" ? rawScope : undefined;
|
|
64
|
+
if (scope === undefined && rawScope !== undefined && rawScope !== null)
|
|
65
|
+
disclose("rootSessionScope", `holds ${notANameShape(rawScope)} — read as no recorded box scope`);
|
|
66
|
+
return { ...rest, ...(rootSessionId !== undefined ? { rootSessionId } : {}), ...(placementRoot !== undefined ? { placementRoot } : {}), ...(token !== undefined ? { rootSessionIncarnation: token } : {}), ...(scope !== undefined ? { rootSessionScope: scope } : {}) };
|
|
67
|
+
}
|
|
68
|
+
function rootIdMember(member, raw) {
|
|
69
|
+
if (raw === undefined || raw === null)
|
|
70
|
+
return undefined;
|
|
71
|
+
if (typeof raw === "string" && raw !== "")
|
|
72
|
+
return raw;
|
|
73
|
+
throw Object.assign(new Error(`internals.${member} carries ${notANameShape(raw)} — a placement root is a session id (a non-empty string), and a malformed fixed point cannot key a placement lookup; fix the spawning lane instead of defaulting around it.`), { code: "config.placement_root_invalid" });
|
|
74
|
+
}
|
|
49
75
|
export function delegationOwnerOf(seat) {
|
|
50
76
|
return seat === undefined ? Promise.resolve({ bound: true, owner: null }) : settled(() => seat.read());
|
|
51
77
|
}
|
|
@@ -103,6 +103,10 @@ export interface AskRequestCarry {
|
|
|
103
103
|
* station read them off the ancestor's ask. */
|
|
104
104
|
askReasons?: readonly AskReason[];
|
|
105
105
|
}
|
|
106
|
+
/** The class pair the gate's own mint station carries — the word and the set, together or neither. A pure reading of the
|
|
107
|
+
* gate's snapshot: the station's card-target read gate asks it for the set the request will carry, without computing the
|
|
108
|
+
* rest of the carry (whose fallback member arms the denial-limit window). */
|
|
109
|
+
export declare function gateAskClassPair(decision: InheritedAsk): Pick<AskRequestCarry, "askClass" | "classes">;
|
|
106
110
|
/** The GATE's own mint station: every member is read off the surviving decision, which is the gate's
|
|
107
111
|
* OWN snapshot (its stamp point spreads the policy's object and stamps the word and the class onto the copy),
|
|
108
112
|
* so the origin and the class are the engine-derived ones and the fallback member is the one the gate's
|
|
@@ -180,8 +184,6 @@ export type InheritedClassifierJudgment<A extends InheritedAsk> =
|
|
|
180
184
|
* vouches for no name and the seat stays empty (absence = unknown); a block AT the bound reaches no seat at
|
|
181
185
|
* all, since it becomes an ask and the disposition then names that resolution.
|
|
182
186
|
*/
|
|
183
|
-
/** The provenance sentence an inherited card carries when the ancestor's ask brought no words of its own — the one spelling the request mint and the frame join share. */
|
|
184
|
-
export declare const inheritedAskFallbackMessage: (toolName: string) => string;
|
|
185
187
|
export declare function judgeInheritedClassifier<A extends InheritedAsk>(opts: {
|
|
186
188
|
autoMode: InheritedAutoMode | undefined;
|
|
187
189
|
/** The leg's live permission mode (the gate's seat): under `dontAsk` / `bypassPermissions` / `plan` the decider is not
|
|
@@ -207,19 +209,21 @@ export declare function floatedInheritedAsk<A extends InheritedAsk>(judged: Pick
|
|
|
207
209
|
toolName: string;
|
|
208
210
|
}): A;
|
|
209
211
|
/** The fallback an inherited station hands its frozen approver, minted ONCE for both ways a bound is reached (a counted ruling
|
|
210
|
-
* refusal; a no-ruling card
|
|
212
|
+
* refusal; a no-ruling card refused with nobody judging it, {@link settleNoRulingAsk}) — its own object, word and class set. */
|
|
211
213
|
type ResolveJudgment<A extends InheritedAsk> = Extract<InheritedClassifierJudgment<A>, {
|
|
212
214
|
kind: "resolve";
|
|
213
215
|
}>;
|
|
214
216
|
export declare function inheritedFallbackJudgment<A extends InheritedAsk>(ask: A, fallback: UnarmedDenialLimitFallback, latestBlockedAction: string, facts: AskClassFacts, askReasons: readonly AskReason[] | undefined): ResolveJudgment<A>;
|
|
215
|
-
/** One resolution of an inherited ask at its frozen approver (the three arms): a no-ruling card
|
|
216
|
-
* ({@link settleNoRulingAsk}); at the bound the call is resolved again there as the fallback. Returns the judgment it answered
|
|
217
|
-
|
|
217
|
+
/** One resolution of an inherited ask at its frozen approver (the three arms): a no-ruling card refused with nobody judging it counts
|
|
218
|
+
* ({@link settleNoRulingAsk}); at the bound the call is resolved again there as the fallback. Returns the judgment it answered and the
|
|
219
|
+
* identity it was presented under ({@link import("../tool-policy.js").AskRequest.checkpointId}, one per presentation). */
|
|
220
|
+
export declare function resolveInheritedAsk<A extends InheritedAsk>(judged: ResolveJudgment<A>, resolveWith: (j: ResolveJudgment<A>, checkpointId: string) => Promise<ResolvedAsk>, tracker: AutoModeDenialTracker | undefined, call: {
|
|
218
221
|
toolCallId: string;
|
|
219
222
|
toolName: string;
|
|
220
223
|
}, facts: AskClassFacts): Promise<{
|
|
221
224
|
resolved: ResolvedAsk;
|
|
222
225
|
judged: ResolveJudgment<A>;
|
|
226
|
+
presentedAs: string;
|
|
223
227
|
}>;
|
|
224
228
|
/** The resolver's answer as the settlement reads it: its action, the settlement its engine record names for the call, the routing marker. */
|
|
225
229
|
export type FallbackResolution = {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { markTightenMessage } from "../safety-axis-vocab.js";
|
|
2
|
+
import { inheritedAskFallbackMessage } from "../allow-entry.js";
|
|
2
3
|
import { classifierParseFailureDenyMessage, createAutoModeDenialTracker, denialLimitFallbackMessage, denialLimitSentence, isAutoModeFallbackCause, rungDidNotRule, unarmedWindow } from "../auto-mode.js";
|
|
3
4
|
import { sanitizeAutoModeArmingRecipe, tightenDenialLimit } from "../auto-mode-arming.js";
|
|
4
5
|
import { classifierNoRulingArm, settleNoRulingAsk } from "../classifier-unavailable-arm.js";
|
|
5
6
|
import { attest, attestationOf } from "../tool-policy.js";
|
|
7
|
+
import { withRestatedSentence } from "../engine-attestation.js";
|
|
8
|
+
import { mintCheckpointId } from "../checkpoint-store.js";
|
|
6
9
|
import { SETTLEMENT_NOBODY_JUDGED } from "../gate-outcome.js";
|
|
7
10
|
import { legNoticeTaskId } from "../mods/stations.js";
|
|
8
11
|
import { deliverEngineNotice } from "../types.js";
|
|
@@ -67,10 +70,13 @@ function fallbackCarry(fallback, liveApprover, tracker) {
|
|
|
67
70
|
return {};
|
|
68
71
|
return { denialLimitFallback: liveApprover && tracker !== undefined ? tracker.armTimedWindow(fallback) : unarmedWindow(fallback) };
|
|
69
72
|
}
|
|
73
|
+
export function gateAskClassPair(decision) {
|
|
74
|
+
return decision.askClass !== undefined && decision.classes !== undefined ? { askClass: decision.askClass, classes: decision.classes } : {};
|
|
75
|
+
}
|
|
70
76
|
export function gateAskCarry(decision, liveApprover, tracker) {
|
|
71
77
|
return {
|
|
72
78
|
...(decision.origin !== undefined ? { origin: decision.origin } : {}),
|
|
73
|
-
...(decision
|
|
79
|
+
...gateAskClassPair(decision),
|
|
74
80
|
...fallbackCarry(decision.denialLimitFallback, liveApprover, tracker),
|
|
75
81
|
...noRulingCarry(decision.classifierNoRuling),
|
|
76
82
|
...askReasonsOf(decision),
|
|
@@ -85,14 +91,13 @@ export function inheritedAskCarry(judged, liveApprover, tracker) {
|
|
|
85
91
|
...(judged.askReasons !== undefined && judged.askReasons.length > 0 ? { askReasons: judged.askReasons } : {}),
|
|
86
92
|
};
|
|
87
93
|
}
|
|
88
|
-
export const inheritedAskFallbackMessage = (toolName) => `approval required for "${toolName}" (inherited parent policy)`;
|
|
89
94
|
export async function judgeInheritedClassifier(opts) {
|
|
90
95
|
const { autoMode, req } = opts;
|
|
91
96
|
const facts = opts.facts ?? { ...INHERITED_STATION_FACTS, call: req }, m = facts.mandateMarks;
|
|
92
97
|
const frames = [...(m.egress === true ? [markTightenMessage(req.toolName, "egress")] : []), ...(m.irreversibility === "always" ? [markTightenMessage(req.toolName, "irreversible")] : [])];
|
|
93
98
|
const askReasons = opts.ask.askReasons ?? chainAskReasonsOf(opts.ask, req);
|
|
94
99
|
const reasoned = askReasons !== undefined ? { askReasons } : {};
|
|
95
|
-
const ask = (frames.length > 0 ? { ...opts.ask, message: [opts.ask.message ?? inheritedAskFallbackMessage(req.toolName), ...frames].join(" — ") } : opts.ask);
|
|
100
|
+
const ask = (frames.length > 0 ? withRestatedSentence({ ...opts.ask, message: [opts.ask.message ?? inheritedAskFallbackMessage(req.toolName), ...frames].join(" — ") }, opts.ask, req) : opts.ask);
|
|
96
101
|
const origin = askOriginOf(ask, facts);
|
|
97
102
|
const classification = classifyAsk(ask, facts);
|
|
98
103
|
const classifierStandsDown = () => {
|
|
@@ -140,12 +145,13 @@ export function inheritedFallbackJudgment(ask, fallback, latestBlockedAction, fa
|
|
|
140
145
|
return { kind: "resolve", ask: minted, fallback, mintedHere: true, origin: askOriginOf(minted, facts), classification: classifyAsk(minted, facts), ...(askReasons !== undefined ? { askReasons } : {}) };
|
|
141
146
|
}
|
|
142
147
|
export async function resolveInheritedAsk(judged, resolveWith, tracker, call, facts) {
|
|
143
|
-
const
|
|
148
|
+
const first = mintCheckpointId();
|
|
149
|
+
const resolved = await resolveWith(judged, first);
|
|
144
150
|
const refallback = settleNoRulingAsk({ ask: judged.ask, mintedHere: judged.noRulingHere === true, resolved: fallbackResolutionOf(resolved, call), tracker });
|
|
145
151
|
if (refallback === undefined)
|
|
146
|
-
return { resolved, judged };
|
|
147
|
-
const again = inheritedFallbackJudgment(judged.ask, refallback, call.toolName, facts, judged.askReasons);
|
|
148
|
-
return { resolved: await resolveWith(again), judged: again };
|
|
152
|
+
return { resolved, judged, presentedAs: first };
|
|
153
|
+
const again = inheritedFallbackJudgment(judged.ask, refallback, call.toolName, facts, judged.askReasons), presentedAs = mintCheckpointId();
|
|
154
|
+
return { resolved: await resolveWith(again, presentedAs), judged: again, presentedAs };
|
|
149
155
|
}
|
|
150
156
|
export const fallbackResolutionOf = (r, call) => ({ action: r.action, settlement: attestationOf(r, call)?.settlement, ...(r.approverUnavailable === true ? { approverUnavailable: true } : {}) });
|
|
151
157
|
export function headlessDenyAtFold(r) {
|
|
@@ -11,7 +11,7 @@ export interface MalformedCapabilityDeclaration {
|
|
|
11
11
|
/**
|
|
12
12
|
* Every capability this env does not DECLARE as a boolean: each key of the block that is absent, not a boolean, or
|
|
13
13
|
* cannot be received — or the block itself, when it is present but not an object or cannot be received — and each
|
|
14
|
-
* member the block carries outside the
|
|
14
|
+
* member the block carries outside the nine keys (a misspelled key leaves the key it meant undeclared).
|
|
15
15
|
*
|
|
16
16
|
* The block is judged on its one receipt (`capabilityReceiptOf`), the frozen copy every reader reads. `undefined` is
|
|
17
17
|
* where absence lands — an absent key and an explicit `undefined` are the same word to every reader — and both are
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describeRejectedValue } from "../tool-search-setting.js";
|
|
1
2
|
export function resolveFileHistoryRequest(spec, deps) {
|
|
2
3
|
const { onTrackFailure, wiredSeat, captureOff } = resolveDeploymentFileHistory(deps);
|
|
3
4
|
const runDeclaredOff = resolveRunFileHistoryWord(spec.fileHistory);
|
|
@@ -26,7 +27,7 @@ export function resolveFileHistoryRequest(spec, deps) {
|
|
|
26
27
|
export function resolveDeploymentFileHistory(deps) {
|
|
27
28
|
const onTrackFailure = deps.onTrackFailure === undefined ? "refuse" : deps.onTrackFailure;
|
|
28
29
|
if (onTrackFailure !== "refuse" && onTrackFailure !== "proceed-unprotected") {
|
|
29
|
-
const e = new Error(`RunnerDeps.onTrackFailure must be "refuse" or "proceed-unprotected"; got ${
|
|
30
|
+
const e = new Error(`RunnerDeps.onTrackFailure must be "refuse" or "proceed-unprotected"; got ${describeRejectedValue(deps.onTrackFailure)} — refusing prepare rather than silently defaulting a first-touch-failure policy.`);
|
|
30
31
|
e.code = "config.invalid_on_track_failure";
|
|
31
32
|
throw e;
|
|
32
33
|
}
|