@sema-agent/server 7.134.0 → 7.136.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/MIGRATION.md +197 -1
- package/USAGE.md +147 -42
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/values.yaml +1 -1
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +122 -154
- package/dist/approval-card.js +50 -51
- package/dist/approval-content-kind.d.ts +23 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +35 -6
- package/dist/auth-bridge.js +20 -3
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/budget-tracing.d.ts +1 -2
- package/dist/boot/budget-tracing.js +2 -2
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +36 -29
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +7 -4
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-04-stores.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.d.ts +1 -1
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +1 -1
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stage-07-capability-layer.d.ts +1 -1
- package/dist/boot/stage-08-reapers.d.ts +1 -1
- package/dist/boot/stage-09-leader.d.ts +1 -1
- package/dist/boot/stage-10-http-server.d.ts +1 -1
- package/dist/boot/stores.js +4 -4
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +15 -27
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/brain.js +12 -3
- package/dist/budget.d.ts +7 -7
- package/dist/budget.js +4 -0
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +11 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +29 -32
- package/dist/capability-facts.js +17 -21
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +22 -8
- package/dist/center-credential.js +18 -3
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-catalog.js +12 -10
- package/dist/config-d-migration.js +1 -1
- package/dist/config-invariants.d.ts +5 -5
- package/dist/config-invariants.js +11 -2
- package/dist/config-lkg.d.ts +1 -39
- package/dist/config-lkg.js +1 -83
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +95 -87
- package/dist/config.d.ts +26 -24
- package/dist/config.js +38 -18
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/elicitation.d.ts +8 -7
- package/dist/elicitation.js +9 -8
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +25 -11
- package/dist/file-history-disclosure.js +25 -14
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +45 -14
- package/dist/fleet-client.js +24 -4
- package/dist/fleet-lease.d.ts +23 -19
- package/dist/fleet-lease.js +31 -23
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-llm.js +14 -8
- package/dist/hooks/hook-runner.d.ts +58 -31
- package/dist/hooks/hook-runner.js +37 -19
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +62 -17
- package/dist/http/checkpoint-ctx.js +78 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +9 -9
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +9 -23
- package/dist/http/resume-ctx-read.js +2 -3
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -7
- package/dist/http/routes/approvals-assistant.js +101 -26
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +23 -11
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +97 -46
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +43 -53
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +33 -24
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-gap.d.ts +49 -4
- package/dist/model-route-gap.js +34 -1
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/object-store-buckets.d.ts +13 -0
- package/dist/object-store-buckets.js +3 -0
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +17 -13
- package/dist/observability/fail-open.js +17 -13
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/metrics.js +1 -1
- package/dist/observability/principal-context.d.ts +4 -1
- package/dist/observability/principal-context.js +6 -1
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -18
- package/dist/parked-decide.js +31 -11
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +5 -4
- package/dist/peer-directory.js +6 -6
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -15
- package/dist/plugins/approval-ask-store-sql.js +21 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/blob-backend.js +2 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +130 -0
- package/dist/plugins/checkpoint-index-columns.js +90 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +71 -69
- package/dist/plugins/checkpoint-store-sql.js +109 -127
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +15 -7
- package/dist/plugins/file-history-store-sql.js +55 -36
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +7 -7
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +73 -54
- package/dist/plugins/one-time-migrations.js +131 -134
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +26 -13
- package/dist/plugins/remote-env-k8s.js +24 -7
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/s3-answer.d.ts +15 -0
- package/dist/plugins/s3-answer.js +5 -0
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +39 -4
- package/dist/plugins/snapshot-bucket-presence.js +35 -7
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +40 -1
- package/dist/plugins/sql-errors.js +49 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/store-fault.d.ts +4 -0
- package/dist/plugins/store-fault.js +8 -0
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +10 -3
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +20 -5
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-declaration-refusal.d.ts +94 -0
- package/dist/request-declaration-refusal.js +78 -0
- package/dist/request-image-urls.d.ts +6 -0
- package/dist/request-image-urls.js +27 -0
- package/dist/request-key-closure.d.ts +6 -1
- package/dist/request-key-closure.js +5 -2
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-caps-resolver.js +1 -1
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +17 -12
- package/dist/sandbox-pkg-source.js +14 -9
- package/dist/sealed-key.d.ts +22 -3
- package/dist/sealed-key.js +47 -4
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +65 -37
- package/dist/session-incarnation.js +30 -12
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-row.d.ts +3 -17
- package/dist/session-row.js +4 -0
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +61 -6
- package/dist/session-sync.js +55 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +52 -79
- package/dist/task-a2a.js +224 -62
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +13 -17
- package/dist/task-mcp.js +29 -49
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +166 -207
- package/dist/tool-approval.js +61 -61
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +13 -8
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +69 -67
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +61 -31
- package/dist/trace/redact.js +394 -153
- package/dist/trace/self-minted-wire.d.ts +302 -14
- package/dist/trace/self-minted-wire.js +87 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential-refusal.d.ts +52 -0
- package/dist/url-credential-refusal.js +14 -0
- package/dist/url-refusal.d.ts +16 -3
- package/dist/url-refusal.js +15 -2
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +32 -3
- package/dist/workspace-space.js +26 -0
- package/dist/write-protection.d.ts +2 -2
- package/package.json +5 -3
- package/scripts/drain-check-local.mjs +4 -2
- package/scripts/drain-check.mysql.sql +6 -2
- package/scripts/drain-check.pg.sql +6 -2
- package/skills/loop.md +1 -1
- package/skills/schedule.md +1 -1
- package/wire-changes/server@7.104.0.json +134 -0
- package/wire-changes/server@7.105.0.json +53 -0
- package/wire-changes/server@7.106.0.json +475 -0
- package/wire-changes/server@7.107.0.json +64 -0
- package/wire-changes/server@7.108.0.json +153 -0
- package/wire-changes/server@7.109.0.json +46 -0
- package/wire-changes/server@7.110.0.json +90 -0
- package/wire-changes/server@7.111.0.json +86 -0
- package/wire-changes/server@7.112.0.json +60 -0
- package/wire-changes/server@7.113.0.json +26 -0
- package/wire-changes/server@7.114.0.json +26 -0
- package/wire-changes/server@7.115.0.json +97 -0
- package/wire-changes/server@7.116.0.json +218 -0
- package/wire-changes/server@7.116.1.json +26 -0
- package/wire-changes/server@7.117.0.json +65 -0
- package/wire-changes/server@7.118.0.json +129 -0
- package/wire-changes/server@7.119.0.json +65 -0
- package/wire-changes/server@7.120.0.json +89 -0
- package/wire-changes/server@7.121.0.json +219 -0
- package/wire-changes/server@7.122.0.json +54 -0
- package/wire-changes/server@7.123.0.json +26 -0
- package/wire-changes/server@7.124.0.json +336 -0
- package/wire-changes/server@7.124.1.json +26 -0
- package/wire-changes/server@7.125.0.json +111 -0
- package/wire-changes/server@7.126.0.json +285 -0
- package/wire-changes/server@7.127.0.json +77 -0
- package/wire-changes/server@7.127.1.json +26 -0
- package/wire-changes/server@7.127.2.json +53 -0
- package/wire-changes/server@7.128.0.json +26 -0
- package/wire-changes/server@7.129.0.json +106 -0
- package/wire-changes/server@7.129.1.json +26 -0
- package/wire-changes/server@7.130.0.json +26 -0
- package/wire-changes/server@7.131.0.json +118 -0
- package/wire-changes/server@7.132.0.json +226 -0
- package/wire-changes/server@7.133.0.json +1155 -0
- package/wire-changes/server@7.134.0.json +107 -0
- package/wire-changes/server@7.135.0.json +174 -0
- package/wire-changes/server@7.136.0.json +448 -0
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
|
@@ -14,7 +14,7 @@ export type ExecutionLane = "in-process" | RemoteExecProvider;
|
|
|
14
14
|
* 所以坐标漂了(重命名/搬家/改语义)门会红,注释不会烂在这里。
|
|
15
15
|
*/
|
|
16
16
|
export interface ExecutionLaneCaps {
|
|
17
|
-
/** 调用方送来的 `cwd`
|
|
17
|
+
/** 调用方送来的 `cwd` 是否被尊重。读者:部署形表行 `callerCwd`([ref] 起本位即判据;改前对账 `task-cwd.ts` 的 `cwdHonored || deviceCwdHonored`)。 */
|
|
18
18
|
readonly callerCwd: LaneCapability;
|
|
19
19
|
/** core 的后台 shell 面(`run_in_background`/`BashOutput`/`KillShell`)。判别式:各 adapter 的
|
|
20
20
|
* `backgroundCapabilities.supported`(`plugins/remote-env-{host,e2b,k8s}.ts`);host 腿的闸在
|
|
@@ -26,48 +26,49 @@ export interface ExecutionLaneCaps {
|
|
|
26
26
|
/** LSP。判别式:`boot/execution-env.ts` 的 `lspManager` 两臂(沙箱桥 e2b/k8s;host 本地 NodeLspManager)。 */
|
|
27
27
|
readonly lsp: LaneCapability;
|
|
28
28
|
/** SendUserFile 的**沙箱直传腿**(host/in-process 的本机 fs 源是另一条腿,不是本位)。
|
|
29
|
-
*
|
|
29
|
+
* 读者:部署形表行 `sandboxSendUserFile`([ref] 起本位即判据;判定依据在 `capabilities/sandbox-file-send.ts` 头注)。 */
|
|
30
30
|
readonly sandboxSendUserFile: LaneCapability;
|
|
31
31
|
/**
|
|
32
32
|
* OS 级隔离边界(手跑在容器 / microVM / Kata pod 里,而不是一台真机上)。
|
|
33
|
-
* 🔴
|
|
33
|
+
* 🔴 [ref] 起**本位即判别式**:全仓读它的唯一布尔口是 {@link laneIsolated}(boot `remote_exec_enabled.isolated` 与
|
|
34
34
|
* `remote_exec_real_system` 那一行、`config.d/remote-exec.json` 抢占披露的「隔离降级」判、wire `executionLane.isolated`
|
|
35
35
|
* + 诊断面同位、那一行 note 列的沙箱出路 —— 改前 boot 另手写一份 `e2b || k8s || local-docker`,与本表两处各算)。
|
|
36
36
|
* 本位的**独立作者** = 各 adapter 对 core 的 `capabilities.isolation` 声明:对账测试拿 core 自己的严格读器 `isIsolated`
|
|
37
37
|
* 问每条车道的**真 adapter 实例**,与本表、与 boot 行三方对拍。
|
|
38
38
|
* 型上**没有** `single-user-only` 这一档(隔离是车道的结构事实,不随租户面变)⇒ {@link laneIsolated} 的布尔化是穷举、无兜底。
|
|
39
39
|
* ⚠️ 口径 = **OS 级边界**(容器即算:共享宿主内核的 `local-docker`、runc 上的 k8s pod 都答 supported),**不是**「独立内核」强度。
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
* VM 级强度(独立内核:只认 e2b 与 k8s 的 kata / gvisor 运行时,runc / local-docker fail-closed 判否)是**另一个问题、另一个词**:
|
|
41
|
+
* 部署形表行 `vmIsolatedHands`(A 值路由读它,路由上下文键 `vmIsolatedExecEnv`;[ref] 拆开同词异义)—— 不是本位的第二份。
|
|
42
42
|
*/
|
|
43
43
|
readonly isolation: Exclude<LaneCapability, "single-user-only">;
|
|
44
|
-
/** 可挂起(k8s 以配了 `s3Snapshot` 为前提 —— 「结构上能不能」的口径)
|
|
44
|
+
/** 可挂起(k8s 以配了 `s3Snapshot` 为前提 —— 「结构上能不能」的口径)。读者:部署形表行 `suspendableHands`(本位 ∧ k8s 快照店;
|
|
45
|
+
* [ref] 起 boot `remote_exec_enabled.suspendable` 只读那一行,不再手写车道词)。独立作者 = 各适配器的 `capabilities.suspendable`。 */
|
|
45
46
|
readonly suspendable: LaneCapability;
|
|
46
|
-
/** `/tmp/scratchpad/<sessionId>`
|
|
47
|
+
/** `/tmp/scratchpad/<sessionId>` 远端约定。读者:部署形表行 `remoteScratchpad`([ref] 起本位即判据;改前对账 `isRemoteScratchpadLane` 的 Set)。 */
|
|
47
48
|
readonly remoteScratchpad: LaneCapability;
|
|
48
49
|
/** 写门走 [ref] 的 `DeferredSandboxPathEnv` 代理裁决(而不是直接拿 worker 本机 fs 裁)。
|
|
49
|
-
*
|
|
50
|
+
* 判别式:部署形表行 `sandboxPathAdjudication`(读 `hostFilePlane` 的反面;对账钉逼本位与它同值)。 */
|
|
50
51
|
readonly sandboxPathAdjudication: LaneCapability;
|
|
51
52
|
/** git-worktree 隔离。判别式:`boot/execution-env.ts` 的 host 臂 vs `worktree_isolation_unsupported_lane` warn。 */
|
|
52
53
|
readonly worktreeIsolation: LaneCapability;
|
|
53
54
|
/** 记忆持久面的**自动**表态(部署可用 `MEMORY_PERSISTENCE_CAPABLE` 显式覆盖,那是旋钮不是车道位)。
|
|
54
55
|
* 判别式:`boot/memory-boundary.ts` 的 `effectiveMemoryPersistenceCapable`。 */
|
|
55
56
|
readonly memoryPersistenceCapable: LaneCapability;
|
|
56
|
-
/** 文件平面是否就在 worker 本机(= `hostSemanticsLane`)。🔴
|
|
57
|
+
/** 文件平面是否就在 worker 本机(= `hostSemanticsLane`)。🔴 [ref] 起**消费点读本位**,不再各写判别式
|
|
57
58
|
* (改前 `resolve-spec` / `stores` / `memory-scope` / `deferred-sandbox-path-env` 各写一份
|
|
58
59
|
* `lane === undefined || lane === "host"` 的同义形,分叉过就是记忆边界判错盘)。读本位的真装配点:
|
|
59
|
-
*
|
|
60
|
+
* 部署形表行 `sandboxPathAdjudication`(resolve-spec 写门 / parked 赎回腿 /
|
|
60
61
|
* 执行环境装配三处的唯一属主)、`memory-scope.ts` 的 `memoryEngineRemoteLanePosture`、
|
|
61
62
|
* `boot/memory-boundary.ts` 的 `buildMemoryBoundaryLaneFacts`(stores)。(「本会话没有持久记忆」的披露归引擎判、引擎渲染 ——
|
|
62
63
|
* 目录条目 `core/memory.no-persistent-store`,本仓只交 spec 上的事实,不再读本位做判别。)⚠️ `in-process` 在本位上是 YES(hooks/进程内读确实在本机盘上),
|
|
63
64
|
* 但它**没有手** —— 问「手在不在本机盘上」要读 {@link handsOnWorkerFilePlane},不是只读本位。 */
|
|
64
65
|
readonly hostFilePlane: LaneCapability;
|
|
65
66
|
/** core 的 `isRemoteExecutionEnv` 对本车道的判决(鸭子类型,**含 host**)= core 拿没拿到执行环境 = 手带挂没挂。
|
|
66
|
-
* 5.26.0 起它决定 `# Memory` 写指令撤不撤。🔴
|
|
67
|
+
* 5.26.0 起它决定 `# Memory` 写指令撤不撤。🔴 [ref] 起消费点读本位(改前各写 `config.remoteExec !== undefined`);
|
|
67
68
|
* 对账测试拿 core 自己的 `isRemoteExecutionEnv` 问**真 adapter 实例**来核本位的值。 */
|
|
68
69
|
readonly coreRemoteExecutionEnv: LaneCapability;
|
|
69
70
|
/**
|
|
70
|
-
*
|
|
71
|
+
* [ref] / core 7.20.0([ref]):这条车道的适配器**声明**了 `capabilities.canonicalPathAuthoritative`
|
|
71
72
|
* 没有 —— 即「我的 `canonicalPath` 是路径落点的权威,整链答不出来是解析器出了事,不是一个我看不见的
|
|
72
73
|
* 命名空间」。声明 ⇒ 读边界的执行期复核在解析器沉默时**拒**;缺席 ⇒ 今天每个适配器的读法(词法判决
|
|
73
74
|
* 成立、命令照跑)—— **缺席不是「声明为 false」**,所以这一位的 `unsupported` 读作「本车道没表态」。
|
|
@@ -79,7 +80,7 @@ export interface ExecutionLaneCaps {
|
|
|
79
80
|
*/
|
|
80
81
|
readonly canonicalPathAuthority: LaneCapability;
|
|
81
82
|
/**
|
|
82
|
-
* 车PI 修复轮 ②(
|
|
83
|
+
* 车PI 修复轮 ②([ref] / clay C-R91A ②,主会话裁「按表不按词」;裁定语义 = **租户不共宿主**)—— 这条车道**分不分租户**。
|
|
83
84
|
* · `supported` = 每个租户的命令落在各自的目标上(每任务一只沙箱:e2b / k8s / local-docker;发起者自己的设备:device,
|
|
84
85
|
* 归属由 deviceId↔principal 绑定验过),或根本没有手(in-process:没有可共享的执行目标);
|
|
85
86
|
* · `single-user-only` = 所有任务落在**同一个共享目标**上(worker 宿主:host;一台常驻 SSH 对端:ssh;一台 ADB 设备:adb)
|
|
@@ -88,7 +89,7 @@ export interface ExecutionLaneCaps {
|
|
|
88
89
|
* 🔴 **7.114.0 起本位的值不在本仓写**:七条可声明车道读 settings-schema 词表正本的表行(`executionLaneRow(lane).tenantSeparation`;
|
|
89
90
|
* 中心写闸的 `requirePrincipal ∧ single-user-only` 交叉判与本仓 `multi-tenant-shared-lane` 拒启读的是同一个值,不会分叉);
|
|
90
91
|
* 只有 `in-process` 一格是本仓自己的事实(它不在表里)。
|
|
91
|
-
* 唯一消费点是 `config-invariants.ts` 的 `multi-tenant-shared-lane`(
|
|
92
|
+
* 唯一消费点是 `config-invariants.ts` 的 `multi-tenant-shared-lane`(经部署形表行 `laneSeparatesTenants` 落成布尔)。本位值与本仓**运行期事实**
|
|
92
93
|
* 不矛盾的对账 = `test/execution-lanes-schema-conformance.test.ts`(隔离位 / 共享文件平面 ⇒ 租户档的蕴含 + 唯一一条「不隔离却分租户」
|
|
93
94
|
* 的车道 = device 点名);ssh / adb 「两租户同一目标」的行为预言机 = `test/multi-tenant-shared-lane.test.ts`
|
|
94
95
|
* (两个租户的任务铸出的 env 报同一个 `workspaceHandle().sandboxId`)。
|
|
@@ -101,7 +102,7 @@ export interface ExecutionLaneCaps {
|
|
|
101
102
|
* device 行的表态来自 v2 §4.1/§4.3:
|
|
102
103
|
* · `callerCwd: supported` —— 员工在自己设备的项目目录里干活是这条车道的**存在理由**;host 闸防的
|
|
103
104
|
* 「跨租户宿主路径穿越」在此结构性不存在(路径落在发起者自己的设备上,归属已由 deviceId↔principal
|
|
104
|
-
* 绑定验证)
|
|
105
|
+
* 绑定验证),故不要求单用户。(车A-4 前判别式答 false、登记过 {@link PLANNED_LANE_DIVERGENCES},已销行;[ref] 起部署形表行 `callerCwd` 直接读本位。)
|
|
105
106
|
* · `sandboxPathAdjudication: supported` —— 自动判真且**这是深思后的正确默认**:写门经 [ref] 代理把四读
|
|
106
107
|
* 原语转发到设备取真文件系统事实,云盘永不参与设备写目标的裁决。
|
|
107
108
|
* · `remoteScratchpad: supported` —— executor 平台闭集 = darwin|linux,`/tmp/scratchpad/<sessionId>`
|
|
@@ -124,7 +125,7 @@ export declare const ALL_EXECUTION_LANES: readonly ExecutionLane[];
|
|
|
124
125
|
export declare function isExecutionLane(word: string): word is ExecutionLane;
|
|
125
126
|
/**
|
|
126
127
|
* `REMOTE_EXEC` **真能写下去的**那几个词 = settings-schema 词表正本的 `EXECUTION_LANE_WORDS`(冻结副本,次序逐字同)。
|
|
127
|
-
* 读者:配置目录 `REMOTE_EXEC` 行的 `enumValues`(**就用它本人**,身份相等有钉 ——
|
|
128
|
+
* 读者:配置目录 `REMOTE_EXEC` 行的 `enumValues`(**就用它本人**,身份相等有钉 —— [ref] 修过「目录手抄一份词表」的病)、
|
|
128
129
|
* [ref] 拒启句的 `valid:` 列表、`REQUIRE_EXECUTION_LANE` 拒启句的出路、`multi-tenant-shared-lane` 拒启句的出路车道。
|
|
129
130
|
* 7.114.0 起全仓唯一的车道词来源是正本;本常量只是它在本仓的那一个读口。
|
|
130
131
|
*/
|
|
@@ -139,10 +140,10 @@ export declare function executionLaneRow(lane: RemoteExecProvider): ExecutionLan
|
|
|
139
140
|
*/
|
|
140
141
|
export declare function laneRequiredEnv(lane: RemoteExecProvider): readonly string[];
|
|
141
142
|
/**
|
|
142
|
-
*
|
|
143
|
+
* [ref] 件③ / [ref] —— **「`REQUIRE_EXECUTION_LANE=true` ∧ 没有任何车道被点名 ⇒ 拒启」的判据与拒因句的唯一属主**(`modelProviderRefusal` /
|
|
143
144
|
* `modelRouteEndpointRefusal` 同形:属主在叶模块,执法点各自调它,登记在 `config-invariants.ts`)。
|
|
144
145
|
*
|
|
145
|
-
* 🔴 病(
|
|
146
|
+
* 🔴 病([ref],test d327-g6-engine-7112 OBS-4 / OBS-5;2026-10-03 亲核):修前**两份句子**。运行期真拒启的是 `config.ts` 手写 throw
|
|
146
147
|
* (点名 `REQUIRE_EXECUTION_LANE` / `REMOTE_EXEC` + 修法,用户在 stderr 读到的就是它);注册表条目另写了一句短的
|
|
147
148
|
* 「the deployment asked to refuse this state」,而它只在 `web-admin-client/stage-limits.ts` 的全表校验里被调 —— 候选视图只装
|
|
148
149
|
* `BATCH1_LIMIT_KEYS` 的限额键,带不上这两键 ⇒ 对本条恒 `next === live`,**那一句没有任何读者**(test 六个拒启格 stderr 里零命中)。
|
|
@@ -151,15 +152,15 @@ export declare function laneRequiredEnv(lane: RemoteExecProvider): readonly stri
|
|
|
151
152
|
* 判据读**装配结果**(`executionLaneOf` = 全仓唯一的缺席归一读口,缺席 ⇒ `in-process`),不重判 env:`remoteExec` 缺席**就是**
|
|
152
153
|
* 「`REMOTE_EXEC` 未设/空串 ∧ `CONFIG_PROVIDER ≠ local`」这条三元链尾臂的落点;点了名却配不齐 / 认不出归 [ref] 那条既有拒启(两句话各说各的问题)。
|
|
153
154
|
*
|
|
154
|
-
* 句子的量词纪律(
|
|
155
|
-
* 照常执行(test R1n:`Now` 真执行成功)—— 不写「零工具」;名册**总条数**随 core 版本走,不写进句子(
|
|
155
|
+
* 句子的量词纪律([ref] ②):stub 车道上**手带族**(`wiring_manifest.tools.entries[].mountedBy === "hands"`)整族不挂,名册里其余工具
|
|
156
|
+
* 照常执行(test R1n:`Now` 真执行成功)—— 不写「零工具」;名册**总条数**随 core 版本走,不写进句子([ref] ③)。
|
|
156
157
|
*/
|
|
157
158
|
export declare function executionLaneRequiredRefusal(deployment: {
|
|
158
159
|
readonly requireExecutionLane: boolean;
|
|
159
160
|
readonly remoteExec?: ServiceConfigFlat["remoteExec"];
|
|
160
161
|
}): string | undefined;
|
|
161
162
|
/**
|
|
162
|
-
* `config.remoteExec?.provider` → 车道词。**全仓唯一**的缺席归一读口(
|
|
163
|
+
* `config.remoteExec?.provider` → 车道词。**全仓唯一**的缺席归一读口([ref] 门 D:`?? "in-process"` 只许住在这里,
|
|
163
164
|
* `?? "host"` 与 `lane === undefined || lane === "host"` 同义折零容忍)。
|
|
164
165
|
*
|
|
165
166
|
* · `undefined`(REMOTE_EXEC 未设)⇒ `"in-process"`,那是真车道不是缺席;
|
|
@@ -175,7 +176,7 @@ export declare function executionLaneRequiredRefusal(deployment: {
|
|
|
175
176
|
export declare function executionLaneOf(provider: RemoteExecProvider | undefined): ExecutionLane;
|
|
176
177
|
export declare function executionLaneOf(provider: string | undefined): ExecutionLane | undefined;
|
|
177
178
|
/**
|
|
178
|
-
*
|
|
179
|
+
* [ref] —— 「这条车道的**手**就在本 worker 的盘上吗」。**两位合取,都读表**(不手抄):
|
|
179
180
|
* · `coreRemoteExecutionEnv` —— core 拿到了执行环境 = 手带真挂上(`in-process` 答 NO:core 落 `StubExecutionEnv`);
|
|
180
181
|
* · `hostFilePlane` —— 那套手的文件平面就是本 worker 的盘(沙箱 / 远端 / 设备车道答 NO)。
|
|
181
182
|
* 今天只有 `host` 两位同 YES。
|
|
@@ -184,10 +185,10 @@ export declare function executionLaneOf(provider: string | undefined): Execution
|
|
|
184
185
|
* **没有手**。clay 裁 [ref] ③ 的字面写「判据读 `hostFilePlane`」,意图是同一句的「无手不挂」—— 照字面
|
|
185
186
|
* 实现会让无手部署**继续**挂 SendUserFile,与意图相反;本函数按意图实现(收车档 che-MA 写明)。
|
|
186
187
|
*
|
|
187
|
-
*
|
|
188
|
-
* ① `
|
|
189
|
-
* ② `
|
|
190
|
-
* ③ `approval.ts` 的 `buildNoResponderBootWarns` —— 写门的 ask
|
|
188
|
+
* 读者问的都是这一句,**同一只函数**,不许各写一份 `=== "host"`:
|
|
189
|
+
* ① 部署形表行 `toolsOnThisHost`(`deployment-shape.ts`)—— wire `executionLane.toolsOnThisHost` + 出厂自扫技能与中心 plugin 技能的 `baseDir`;
|
|
190
|
+
* ② 部署形表行 `callerOwnsWorkerDisk`(本列 ∧ 单主)—— SendUserFile 本机腿([ref] ③「无手不挂」)、调用方宿主路径(附加目录 / 项目上下文)、指令文件探针;
|
|
191
|
+
* ③ `approval.ts` 的 `buildNoResponderBootWarns` —— 写门的 ask 只在「有手写本机盘」时才会发生(它手里已有车道词,直接读本列)。
|
|
191
192
|
*/
|
|
192
193
|
export declare function handsOnWorkerFilePlane(lane: ExecutionLane): boolean;
|
|
193
194
|
/**
|
|
@@ -215,7 +216,7 @@ export declare function laneMeasuresHome(lane: ExecutionLane): boolean;
|
|
|
215
216
|
/** 车道行声明的读面缺省(`READ_FACE` 缺席时,这条车道自己的那一份)。 */
|
|
216
217
|
export type LaneReadFaceDefault = "open" | "roots";
|
|
217
218
|
/**
|
|
218
|
-
*
|
|
219
|
+
* [ref](clay 裁 [ref])—— **车道行显式声明读面缺省 `readFaceDefault`**:`READ_FACE` 没人表态时,这条车道自己的执行体该不该读面放开。
|
|
219
220
|
* · `open` —— 隔离型车道(`e2b` / `k8s` / `local-docker`:每任务一只沙箱,OS 级隔离边界,`tenantSeparationBasis === "isolation"`):沙箱内部就是模型的整个世界,
|
|
220
221
|
* 读面缺省放开(`auto` 连续干活不再每碰一个根外路径就出卡;写面 / deny 表 / 审批模式不受影响)。
|
|
221
222
|
* · `roots` —— 其余车道(`host` / `in-process` / `ssh` / `adb` / `device`):车道本身不给读面任何放开的理由 —— 手落在一台真机 / 共享目标 / 员工设备上。
|
|
@@ -230,7 +231,7 @@ export declare function laneReadFaceDefault(lane: ExecutionLane): LaneReadFaceDe
|
|
|
230
231
|
/** 声明 `open` 的那一句**挂载告诫**(运维面指路句与车道文档同读这一句):把宿主目录 / 共享卷挂进隔离沙箱的部署,在 `open` 面上宿主文件对模型零问可读。 */
|
|
231
232
|
export declare const LANE_OPEN_READ_FACE_CAUTION = "a deployment that mounts host paths or shared volumes into the sandbox (hostPath, bind mount) exposes those host files to reads on an open face \u2014 pin READ_FACE=roots or add read-deny rows (READ_DENY_PATTERNS) for them";
|
|
232
233
|
/**
|
|
233
|
-
*
|
|
234
|
+
* [ref] —— 「这条车道的手在不在 OS 级隔离边界里」。**全仓唯一**的布尔判别式(读表 `isolation` 位,见该位头注的读者清单)。
|
|
234
235
|
* 穷举 switch、无 default 臂:`isolation` 的型只有两档,加档 = 编译红。
|
|
235
236
|
*
|
|
236
237
|
* ⚠️ 本函数对 `in-process` 也答(表上那一行是 unsupported ⇒ false)—— 那一格是「表」的完整性,不是 wire 的说法:
|
|
@@ -245,19 +246,6 @@ export declare function laneIsolated(lane: ExecutionLane): boolean;
|
|
|
245
246
|
* 穷举 switch、无 default 臂:该位的型三档(supported / unsupported / single-user-only)都要表态,加档 = 编译红。
|
|
246
247
|
*/
|
|
247
248
|
export declare function laneWiresExecutionEnv(lane: ExecutionLane): boolean;
|
|
248
|
-
/**
|
|
249
|
-
* S-281 —— 这条车道是不是**单机形缺省**落点(`REMOTE_EXEC` 未设 / 空串 ∧ `CONFIG_PROVIDER=local`,没人点名)。
|
|
250
|
-
* 判据 = 装配出的车道值自己带的记号 `singleMachineDefault`(唯一写者 = `config.ts` 三元链的隐式 host 尾臂;显式 `REMOTE_EXEC=host`
|
|
251
|
-
* 与 `config.d/remote-exec.json` 覆写都铸不带它的新值)。**唯一读口**,读者两处:`config.ts` 车道落点一行的 `source`
|
|
252
|
-
* (`exec_lane_selected`,文件覆写之前播)与 `boot/execution-env.ts` 的 `remote_exec_real_system.note`(覆写之后打)——
|
|
253
|
-
* 同一个记号、两个时刻,不另按 env 原文重判。
|
|
254
|
-
*/
|
|
255
|
-
export declare function isSingleMachineDefaultLane(remoteExec: ServiceConfigFlat["remoteExec"]): boolean;
|
|
256
|
-
/** 把一位能力在**具体部署**上落成布尔:租户面是唯一入参(旋钮由消费点自己再合取)。
|
|
257
|
-
* 穷举 switch,无 default 臂 —— {@link LaneCapability} 加词而此处不加臂 = 编译红。 */
|
|
258
|
-
export declare function laneCapabilityHolds(cap: LaneCapability, deployment: {
|
|
259
|
-
requirePrincipal?: boolean;
|
|
260
|
-
}): boolean;
|
|
261
249
|
/** 一条**已登记**的分叉:表写的是目标态,今天的判别式还答别的。 */
|
|
262
250
|
export interface PlannedLaneDivergence {
|
|
263
251
|
readonly lane: ExecutionLane;
|
|
@@ -272,7 +260,7 @@ export interface PlannedLaneDivergence {
|
|
|
272
260
|
* 分叉登记簿 —— **闭集**。对账测试双向咬:表外分叉 = 漂移(红),表内分叉被补齐而不销行 = 陈账(红)。
|
|
273
261
|
*
|
|
274
262
|
* 🟢 **空表 = 今天的真实状态**(车A-4,2026-08-28 销行)。唯一那条(device 的 `callerCwd`)已按登记的
|
|
275
|
-
*
|
|
263
|
+
* 条件补齐:当年的 `deviceCwdHonored`([ref] 起并入部署形表行 `callerCwd`,读本表那一位)+ 写侧闸(`boot/resolve-spec.ts` 的同一处单写者)+ 读侧
|
|
276
264
|
* 消费(`plugins/remote-env-device.ts` 的 `effectiveDeviceCwd`)**同批**落地,于是能力表写的 `supported`
|
|
277
265
|
* 与判别式给的答案一致,分叉自然消失 —— 对账测试的双向咬(表外分叉 = 红 / 表内陈账 = 红)因此对本表
|
|
278
266
|
* 只剩「保持空」这一条要求。
|
|
@@ -301,7 +289,7 @@ export interface LaneHomeDeployment {
|
|
|
301
289
|
/**
|
|
302
290
|
* 「**这条部署的执行环境**以哪个 home 运行」—— `~/…` 形权限规则(`Edit(~/.ssh/**)`)唯一的基。
|
|
303
291
|
*
|
|
304
|
-
* ## 病(接入审计 M13 / DEBTS
|
|
292
|
+
* ## 病(接入审计 M13 / DEBTS [ref]④)
|
|
305
293
|
* core 的 `ExecutionEnv.homeDir` 是**由 adapter 声明**的座(`engine/harness/types.d.ts`,可选):
|
|
306
294
|
* 缺席 ⇒ core 的 `resolvePathPattern` 回 `{missingBase:"home"}` ⇒ 该规则对这条腿判 `unreadable`
|
|
307
295
|
* (fail-closed 的 ask)。四只远端 adapter(e2b/k8s/host/ssh)一个都没声明,而 server 侧的 422 前置门
|
|
@@ -265,19 +265,6 @@ export function laneWiresExecutionEnv(lane) {
|
|
|
265
265
|
return false;
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
export function isSingleMachineDefaultLane(remoteExec) {
|
|
269
|
-
return remoteExec?.provider === "host" && remoteExec.singleMachineDefault === true;
|
|
270
|
-
}
|
|
271
|
-
export function laneCapabilityHolds(cap, deployment) {
|
|
272
|
-
switch (cap) {
|
|
273
|
-
case "supported":
|
|
274
|
-
return true;
|
|
275
|
-
case "unsupported":
|
|
276
|
-
return false;
|
|
277
|
-
case "single-user-only":
|
|
278
|
-
return deployment.requirePrincipal !== true;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
268
|
export const PLANNED_LANE_DIVERGENCES = Object.freeze([]);
|
|
282
269
|
export const E2B_SANDBOX_HOME = "/home/user";
|
|
283
270
|
export function executionLaneHomeDir(deployment) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] → [ref] —— 文件历史的**装配单点**与能力词 `fileHistoryCapture` 的闭集(叶模块:只 type-import store-backend 与 core 型)。
|
|
3
3
|
*
|
|
4
4
|
* ## 病史
|
|
5
|
-
*
|
|
5
|
+
* [ref](7.97.0):`boot/budget-tracing.ts` 只要后端有文件历史店就无条件交给 core(`RunnerDeps.fileHistoryStore`)。core 的首次
|
|
6
6
|
* 触碰捕获当时是**进程级**的:接了店就恒捕获,没有任何单会话 / 单 run 的杠杆。于是用户在客户端关掉「文件检查点」关掉的只是
|
|
7
|
-
* 提示,文件字节照旧进 `file_history_*`。
|
|
7
|
+
* 提示,文件字节照旧进 `file_history_*`。[ref] 给了部署旋钮 `FILE_HISTORY_CAPTURE`,而 core 那时只有一种写法表达「不捕获」——
|
|
8
8
|
* **不接店** ⇒ 旋钮关 = 摘店,代价是已存历史也一起读不了(restore / rewind / 2c sync 一并关)。
|
|
9
|
-
*
|
|
9
|
+
* [ref](7.104.0):core 7.31.0 收了两件 —— 部署的**捕获位** `RunnerDeps.fileHistoryCapture: "off"`(店照接,只停新捕获,
|
|
10
10
|
* 已存历史照常服务 `restoreFiles` / `rewindFilesTo`)与请求级关断词 `TaskSpec.fileHistory: "disabled"`。旋钮改落 core 的同名座:
|
|
11
11
|
* **名字说的是「捕获」,就只关捕获** —— 一条旋钮一个意思。
|
|
12
12
|
*
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
* core 的部署捕获位({@link coreFileHistoryCaptureSeat},`boot/runner-deps.ts`)与能力词(`http/routes/capabilities.ts`)——
|
|
20
20
|
* core 收到的与能力面说的不可能各说各话。捕获位 `"off"` ⟺ 店在 ∧ 旋钮关;**没有店的部署形不下发**该位:core 对
|
|
21
21
|
* 「off 但没店」拒 prepare(`config.invalid_file_history_capture`,「nothing to switch off」),而旋钮的意思「不捕获」在没店的
|
|
22
|
-
* 部署上本来就成立 —— 旋钮照样无条件生效,只是那一形无事可关(选这一臂而不是拒启的理由见 CHANGELOG 7.104.0
|
|
22
|
+
* 部署上本来就成立 —— 旋钮照样无条件生效,只是那一形无事可关(选这一臂而不是拒启的理由见 CHANGELOG 7.104.0 [ref] 条:
|
|
23
23
|
* 拒启会把「形合法、意思成立」的配置判成错,且会与 auto 后端的降级臂耦合)。
|
|
24
24
|
* ⚠️ 关掉 ≠ 删掉:翻旋钮**不**做任何批量删除;已捕获的历史照旧被 restore / rewind / sync 读用,按既有的会话删除 /
|
|
25
25
|
* 留存规则清理。要让已存历史也不可用,部署今天的出路只有逐会话 `DELETE /v1/sessions/:id` 与留存清扫(见 USAGE)。
|
|
26
26
|
*
|
|
27
27
|
* ## 能力词为什么是 `off` / `on-optional` 两词
|
|
28
|
-
* cli 要的是「`/config` 那个开关该不该出现」。三词闭集的设计(
|
|
29
|
-
* 结构上不可达(没有单 run 不捕获位)。
|
|
28
|
+
* cli 要的是「`/config` 那个开关该不该出现」。三词闭集的设计([ref])是 `off` / `on-always` / `on-optional`;[ref] 时第三词
|
|
29
|
+
* 结构上不可达(没有单 run 不捕获位)。[ref] 起请求词 `fileHistory: "disabled"` 受理 ⇒ 捕获中的部署恒可按 run 关掉 ⇒
|
|
30
30
|
* `on-optional` 成真,而 `on-always`(「捕获中且关不掉」)**结构上不可达** —— 预先声明一个到不了的词等于给客户端一个
|
|
31
31
|
* 永远等不到的分支,所以删词不留(7.97.0–7.103.x 的 worker 仍会发它,消费端读法在契约附录 B)。
|
|
32
32
|
*/
|
|
@@ -52,13 +52,13 @@ export interface FileHistoryAssembly {
|
|
|
52
52
|
/** 擦除脸:在场 ⟺ 后端在(与旋钮无关;是 {@link store} 的删除类动词视图)。 */
|
|
53
53
|
readonly erasure: FileHistoryErasureFace | undefined;
|
|
54
54
|
}
|
|
55
|
-
/** 装配:「这台部署有没有文件历史店」的唯一判定。旋钮不在这里 —— 它只关捕获,不摘店(
|
|
55
|
+
/** 装配:「这台部署有没有文件历史店」的唯一判定。旋钮不在这里 —— 它只关捕获,不摘店([ref])。 */
|
|
56
56
|
export declare function assembleFileHistory(backend: StoreBackend | undefined): FileHistoryAssembly;
|
|
57
57
|
/**
|
|
58
58
|
* 「捕不捕」的**唯一**判定(纯函数):能力词。`store` = 装配出来的店(在不在),`knob` = 部署旋钮 `FILE_HISTORY_CAPTURE`
|
|
59
59
|
* (`config.fileHistoryCapture`)。从**装配结果**派生,不照旋钮字面回声:后端本来就没有这只店的部署同样是 `off`。
|
|
60
60
|
*
|
|
61
|
-
* 与 `rewindFiles` 分叉(
|
|
61
|
+
* 与 `rewindFiles` 分叉([ref] 当时写下的分叉条件,自本版成真):本词答「这台部署捕不捕、能不能按 run 关掉」,
|
|
62
62
|
* `rewindFiles` 答「这台部署能不能还原」—— 旋钮关的部署本词 `off` 而 `rewindFiles` 仍为真。
|
|
63
63
|
*/
|
|
64
64
|
export declare function fileHistoryCaptureOf(store: object | undefined, knob: boolean): FileHistoryCapture;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref]④ —— SQL file-history 店的 **typed 永久失败**披露座:散文一个铸点 + 机器面一只 sink。
|
|
3
3
|
*
|
|
4
4
|
* ## 病(基线 v7.79.0 逐行亲核 + 亲跑)
|
|
5
5
|
* `plugins/blob-backend.ts:55` 的 `BlobTooLargeError` 带 typed 判别码 `blob_too_large_for_sql`,头注
|
|
@@ -12,14 +12,21 @@
|
|
|
12
12
|
* 括号词当 metric label —— 而第一个括号词恒是引擎自己的闭集码。实测:「这个文件永远存不进这口店」
|
|
13
13
|
* 与「连接被重置」在 `rewind_snapshot_failed_total` 上**同形** `code="snapshot_failed"`。
|
|
14
14
|
* · **trackEdit(首触备份)腿**:本服务用引擎默认的 `onTrackFailure:"refuse"`(`boot/runner-deps.ts` 亲读),
|
|
15
|
-
* 那条路 **完全不走 onError** ——
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* 那条路 **完全不走 onError** —— 引擎把拒句念给模型。core 7.54.0 及以前那句在 300 字界里被店的 message
|
|
16
|
+
* 截断,模型连「Retry when the file-history store is healthy.」都听不到;core 7.55.0([ref] T2)起引擎的整句
|
|
17
|
+
* (码、引导语、后果)都到模型,引导语按店判的 `FileHistoryError.permanence` 二选一:`terminal` ⇒「这是永久故障,
|
|
18
|
+
* 店修好之前别重试」,否则「Retry when the file-history store is healthy.」。所以这枚码要**判成 `terminal`**,
|
|
19
|
+
* 模型才不会被叫去重试一件永远不会成的事;而**运维面一个计数都没有**:这条腿今天在遥测上完全不可见。
|
|
18
20
|
*
|
|
19
21
|
* ## 修法(源头留痕,不走文本通道)
|
|
20
|
-
* · **散文面**({@link
|
|
22
|
+
* · **散文面**({@link foldCaughtFailure} 的 `text`):把 caught error 的 typed `code` 写成一个括号词
|
|
21
23
|
* 前置到它自己的 message 前 —— **不 `instanceof` 单挑任何一个类**(身上有字符串 `code` 就折),该店
|
|
22
|
-
*
|
|
24
|
+
* 的折点全部改走这一只函数。人与模型因此看得到「这是哪一类失败」。
|
|
25
|
+
* · **判断面**(同一只函数的 `fault`,core 7.55.0 `FileHistoryError.permanence`):永久码表里的 typed 码 ⇒
|
|
26
|
+
* `{ permanence: "terminal" }`;**连接类故障**(到库的连接坏了 / 库此刻不接 —— 判官是整仓唯一一只
|
|
27
|
+
* `plugins/store-fault.ts` 的 `storeFaultClassOf`,识别表在 `plugins/sql-errors.ts`,本文件不再抄第二份)⇒
|
|
28
|
+
* `{ permanence: "transient" }`;其余 ⇒ `{}`(没判 —— 引擎照旧给重试引导语)。`terminal` 只对永久码。
|
|
29
|
+
* 折点把它摊进店答的 `FileHistoryError`;引擎的拒句引导语、rewind 披露、`terminal.detail` 都读这一格,**不读散文**。
|
|
23
30
|
* · **机器面**(同一只函数的副作用):码取自 typed 错**对象**、对闭集词表判定,**绝不从散文里抠**。
|
|
24
31
|
* 🔴 这一条是 codex R1-[high] 验真后的定形:文本通道**天然可伪造** —— 一个名叫
|
|
25
32
|
* `(blob_too_large_for_sql).txt` 的文件读不出来时,它的路径就在 `snapshot_failed` 的散文里,任何
|
|
@@ -29,21 +36,28 @@
|
|
|
29
36
|
* (`file_history_permanent_failure_total{code}`)、**每进程每码一条 warn**(第二条起零新增内容,而
|
|
30
37
|
* 20G 树的用户每 turn 撞一次)、装配前累计的次数在 install 时补进 metrics。
|
|
31
38
|
*/
|
|
32
|
-
import { FILE_HISTORY_ERROR_CODES } from "@sema-agent/core";
|
|
39
|
+
import { FILE_HISTORY_ERROR_CODES, type FileHistoryError } from "@sema-agent/core";
|
|
33
40
|
import type { Logger } from "./observability/logger.js";
|
|
34
41
|
import type { Metrics } from "./observability/metrics.js";
|
|
35
42
|
interface Sink {
|
|
36
43
|
logger?: Logger;
|
|
37
44
|
metrics?: Metrics;
|
|
38
45
|
}
|
|
46
|
+
/** 一次 caught error 的折法:`text` = 店侧散文(带 typed 码括号词),`fault` = 店对这次故障的判断(摊进 `FileHistoryError`)。 */
|
|
47
|
+
export interface CaughtFailure {
|
|
48
|
+
readonly text: string;
|
|
49
|
+
readonly fault: Pick<FileHistoryError, "permanence">;
|
|
50
|
+
}
|
|
39
51
|
/**
|
|
40
|
-
* 把一个 caught error
|
|
52
|
+
* 把一个 caught error 折成店侧的散文 + 判断,**并**在它是一枚 typed 永久失败时留痕。
|
|
41
53
|
*
|
|
42
|
-
*
|
|
54
|
+
* `text` = 散文形:带 typed `code` 的前缀一个括号词(`(blob_too_large_for_sql) blob of … exceeds …`),
|
|
43
55
|
* 不带的**逐字**是原 message(transient 失败的文案因此与本批之前一字不差)。
|
|
56
|
+
* `fault` = 判断形(core 7.55.0 `FileHistoryError.permanence`):永久码表里的码 ⇒ `{ permanence: "terminal" }`;连接类故障 ⇒ `{ permanence: "transient" }`
|
|
57
|
+
* (什么都不改稍后再试可能成);其余 ⇒ `{}`(店不知道 —— 认不出的驱动 / 库错是不是会自己好,不归本店判)。永久码先于连接类判(一只错不会两个都是)。
|
|
44
58
|
* 副作用 = 机器形:码取自错误对象,逐次计数 + 每进程每码一条 warn。观测绝不抛。
|
|
45
59
|
*/
|
|
46
|
-
export declare function
|
|
60
|
+
export declare function foldCaughtFailure(err: unknown): CaughtFailure;
|
|
47
61
|
/** 装配层把 logger/metrics 接上(main.ts,与 `installFailOpenRecorder` 同一处)。 */
|
|
48
62
|
export declare function installFileHistoryFailureRecorder(deps: Sink): void;
|
|
49
63
|
/** 本进程逐码累计(测试/诊断读面)。 */
|
|
@@ -52,7 +66,7 @@ export declare function fileHistoryPermanentFailureCounts(): ReadonlyMap<string,
|
|
|
52
66
|
export declare function resetFileHistoryFailureRecorderForTest(deps?: Sink): void;
|
|
53
67
|
/** rewind 粗码臂的码词 = core 的闭集(值与型同一源:`FILE_HISTORY_ERROR_CODES`)。 */
|
|
54
68
|
export type FileHistoryErrorCode = (typeof FILE_HISTORY_ERROR_CODES)[number];
|
|
55
|
-
/** rewind
|
|
69
|
+
/** rewind 臂一次失败的粗码:`FileHistoryStoreError` 上的那一格(在闭集里);否则 `unknown`。纯函数、不抛。 */
|
|
56
70
|
export declare function rewindFailureCode(err: unknown): FileHistoryErrorCode | "unknown";
|
|
57
71
|
export {};
|
|
58
72
|
//# sourceMappingURL=file-history-disclosure.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FILE_HISTORY_ERROR_CODES } from "@sema-agent/core";
|
|
1
|
+
import { FILE_HISTORY_ERROR_CODES, FileHistoryStoreError } from "@sema-agent/core";
|
|
2
|
+
import { storeFaultClassOf } from "./plugins/store-fault.js";
|
|
2
3
|
const PERMANENT_STORE_FAILURE_CODES = {
|
|
3
4
|
blob_too_large_for_sql: {
|
|
4
5
|
note: "a blob is larger than this deployment's SQL snapshot-blob cap — the same file will fail every turn until the deployment changes",
|
|
@@ -29,14 +30,30 @@ function drainToMetrics() {
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
export function
|
|
33
|
+
export function foldCaughtFailure(err) {
|
|
33
34
|
const message = err instanceof Error ? err.message : String(err);
|
|
34
35
|
const code = err?.code;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
recordPermanent(
|
|
39
|
-
return
|
|
36
|
+
const typedCode = typeof code === "string" && code !== "" ? code : undefined;
|
|
37
|
+
const permanentCode = typedCode !== undefined && isPermanentCode(typedCode) ? typedCode : undefined;
|
|
38
|
+
if (permanentCode !== undefined)
|
|
39
|
+
recordPermanent(permanentCode, message);
|
|
40
|
+
return {
|
|
41
|
+
text: typedCode !== undefined ? `(${typedCode}) ${message}` : message,
|
|
42
|
+
fault: permanentCode !== undefined ? { permanence: "terminal" } : faultOfClass(storeFaultClassOf(err)),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function faultOfClass(cls) {
|
|
46
|
+
switch (cls) {
|
|
47
|
+
case "connection":
|
|
48
|
+
return { permanence: "transient" };
|
|
49
|
+
case "corrupt":
|
|
50
|
+
case "unclassified":
|
|
51
|
+
return {};
|
|
52
|
+
default: {
|
|
53
|
+
const unhandled = cls;
|
|
54
|
+
throw new Error(`store fault class without a file-history judgment: ${String(unhandled)}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
40
57
|
}
|
|
41
58
|
function safely(record) {
|
|
42
59
|
try {
|
|
@@ -90,12 +107,6 @@ export function resetFileHistoryFailureRecorderForTest(deps = {}) {
|
|
|
90
107
|
const FILE_HISTORY_ERROR_CODE_SET = new Set(FILE_HISTORY_ERROR_CODES);
|
|
91
108
|
const isFileHistoryErrorCode = (w) => FILE_HISTORY_ERROR_CODE_SET.has(w);
|
|
92
109
|
export function rewindFailureCode(err) {
|
|
93
|
-
|
|
94
|
-
for (const m of text.matchAll(/\(([a-z_]+)[):]/g)) {
|
|
95
|
-
const word = m[1];
|
|
96
|
-
if (isFileHistoryErrorCode(word))
|
|
97
|
-
return word;
|
|
98
|
-
}
|
|
99
|
-
return "unknown";
|
|
110
|
+
return err instanceof FileHistoryStoreError && isFileHistoryErrorCode(err.code) ? err.code : "unknown";
|
|
100
111
|
}
|
|
101
112
|
//# sourceMappingURL=file-history-disclosure.js.map
|
|
@@ -72,10 +72,10 @@ export type DrainEntryAnswer = DrainReceipt | DrainDeadlineRefusal;
|
|
|
72
72
|
* · `draining` / `since` / `actionId` / `deadlineAt` —— **只由** {@link enter} 整组写入(排空事实 = 契约 `EngineDraining`);
|
|
73
73
|
* · `enter` —— 唯一入口(收尾链装;缺席 = 这个进程没有收尾链,如嵌入宿主 / 测试夹具);
|
|
74
74
|
* · `yieldInflight` —— 让出本副本在飞的可抢占腿(`createHttpServer` 装);
|
|
75
|
-
* · `endSubscriptions` —— 关掉本副本打开着的只读订阅流(发一帧 `draining` 终帧再关;`createHttpServer` 装,
|
|
75
|
+
* · `endSubscriptions` —— 关掉本副本打开着的只读订阅流(发一帧 `draining` 终帧再关;`createHttpServer` 装,[ref])。订阅流不是在飞的工作
|
|
76
76
|
* (不进 `inflight`),排空不等它;收尾链在排空进入那一拍与硬停起点各调一次(排空期间新开的订阅在硬停那一拍收);
|
|
77
77
|
* · 其余四只是既有的读口(在飞数 / 活性时钟 / 附着流),语义见 `http/server.ts`。`inflight` 只数**工作**(run 腿 / 计费提交 / HITL 应答 /
|
|
78
|
-
* admission 期的普通请求),只读订阅只进 `attachedStreams`(
|
|
78
|
+
* admission 期的普通请求),只读订阅只进 `attachedStreams`([ref])。
|
|
79
79
|
*/
|
|
80
80
|
export interface DrainState {
|
|
81
81
|
draining: boolean;
|
|
@@ -53,7 +53,7 @@ export interface FleetTaskRow {
|
|
|
53
53
|
* 🔴 与 `name` 分域:`name` 是**显示名**(源 `description ?? name`,模型自由文本);本键是**身份键**,
|
|
54
54
|
* 消费端按串相等把「@某个名字」绑到这一行(同类型两个子代在 `agentType` 上不可分,在本键上可分)。
|
|
55
55
|
* ADDITIVE / tolerate-absent:**缺席 = 一次匿名委派**(不是「不知道它叫什么」)—— 7.25.0 之前本键在本仓
|
|
56
|
-
* 没有任何源,恒缺席。**VERBATIM,不过 `redactSecrets`**(
|
|
56
|
+
* 没有任何源,恒缺席。**VERBATIM,不过 `redactSecrets`**([ref] B6①:本注此前写「与 `name` 同一道边界,emit 前
|
|
57
57
|
* redact」,而三处铸点从本键到货起就是原样投 —— 见本文件 spawn / tick / terminal 三臂的行注与
|
|
58
58
|
* `trace/core-keyset-guard.ts` 的 `spawnName` 记账):它是**身份键**,消费端按串相等绑行,脱敏会把两个合法队友名
|
|
59
59
|
* 改写成同一串;出生点校验过的字符集里也没有可脱敏的形。残余(已披露)= 有人把真凭据当队友名写进
|
|
@@ -194,6 +194,10 @@ export interface FleetWorkflowRow {
|
|
|
194
194
|
* 停驻的 workflow run 终态 = `status:"failed"` + `errorCode:"workflow.agent_parked"`:`status` 词表不加字(不另铸专用 status 词),
|
|
195
195
|
* 「停驻」与「真失败」靠这一位分开。run 行没有码 ⇒ 键缺席(不铸空串);缺席也可能是老服务端,消费方同形处置:退回只读 `status`。 */
|
|
196
196
|
errorCode?: string;
|
|
197
|
+
/** ADDITIVE / tolerate-absent(core 7.55.0 [ref]):run **还在跑**、且至少一条腿停在审批门上 ⇒ `true`;否则**缺席**(永不 `false`)。
|
|
198
|
+
* 引擎的一次派生 `runParkedOf(run)`(停驻行的唯一定义 `parkedAgentsOf`),本仓不自判、不另铸;`status` 三词不加字。排空后的停驻终态是
|
|
199
|
+
* `status:"failed"` + `errorCode:"workflow.agent_parked"`(上一位),本位在那里缺席 —— 一个状态一个词。消费方把两形都渲成「等审批」。缺席也可能是老服务端。 */
|
|
200
|
+
parked?: true;
|
|
197
201
|
doneCount?: number;
|
|
198
202
|
/** 计划总数(= `run.agents.length`,**含排队中**)—— 注意它**不是**"已启动数",见 {@link FleetWorkflowRow.startedCount}。 */
|
|
199
203
|
totalCount?: number;
|
|
@@ -238,7 +242,7 @@ export type FleetFrame = {
|
|
|
238
242
|
/**
|
|
239
243
|
* [ref] §2③:**陈述级退场** —— 行没了,但**没有**结算语义。
|
|
240
244
|
*
|
|
241
|
-
* 🔴 **本键缺席的那一族不是「终局已发过」**(
|
|
245
|
+
* 🔴 **本键缺席的那一族不是「终局已发过」**([ref] / 车HX codex r1 [medium];本注此前逐字写着
|
|
242
246
|
* 「无此键的 remove = 终态之后的常规清场……两者都先发过终态 `task` 帧」,**那句是假的** ——
|
|
243
247
|
* 车HW 逐条亲读本文件的七处 `removeTask` 铸点后改成真话,消费方面的成文版 =
|
|
244
248
|
* `docs/ASSISTANT-WIRE-CONTRACT.md` 附录 H)。缺席形其实是**两族**:
|
|
@@ -263,7 +267,7 @@ export type FleetFrame = {
|
|
|
263
267
|
* durable 行压根不存在 —— 三形共同点是**没有终局可投影**,而本副本的行必然陈旧。此时造一个终态
|
|
264
268
|
* 就是编:判死的属主始终是 durable 侧的 reaper。所以只陈述「这条行离场了」,不逼消费端结算。
|
|
265
269
|
* (cli 侧裁量 [ref]:渲「离场」**不清行** —— 行保留、中性离场形、active 扣除、折叠排后。)
|
|
266
|
-
* 🔴
|
|
270
|
+
* 🔴 [ref]:子代行的陈述级退场之前,对账腿先问过它的属主(bg registry 非终态 ∨ 有待决审批 ⇒ 留行);
|
|
267
271
|
* 本帧因此只在「静默满一周期 ∧ 属主不作保」时出现。而它**不封被退那一代**(见 {@link cycleSeq})——
|
|
268
272
|
* 之后同一代(或更大代)的帧到达 = 那一行其实还活着,行**复活**;更小的代照旧是前代迟到帧。
|
|
269
273
|
* ADDITIVE / tolerate-absent。
|
|
@@ -272,7 +276,7 @@ export type FleetFrame = {
|
|
|
272
276
|
/** [ref] §2 判死×判代合成规则:退场帧带**被退那一代**的 {@link FleetTaskRow.cycleSeq}。
|
|
273
277
|
* 消费端因此能把 `retire(gen=N)` 之后的 `frame(gen=N+1)` 读成**复活**(行重生,退休不粘住新代),
|
|
274
278
|
* 而**结算级** `retire(gen=N)`(本帧无 `removeReason`)之后的 `frame(gen=N)` 读成**前代迟到帧,忽略**。
|
|
275
|
-
* 🔴
|
|
279
|
+
* 🔴 [ref]:**陈述级**退场(`removeReason:"orphaned"`)之后的 `frame(gen=N)` = **复活**,不是迟到帧 ——
|
|
276
280
|
* 陈述级退场从不断言「这一代结束了」(它说的只是「本副本一个周期没听到这一行」),所以同代的下一帧
|
|
277
281
|
* 就是它还活着的证据(本仓 {@link FleetEventBus.removeTask} 对这一形不封代,消费端同读);更小的代照旧忽略。
|
|
278
282
|
* 缺席同 {@link FleetTaskRow.cycleSeq} ——「无此概念」,不是「第一代」。 */
|
|
@@ -362,7 +366,7 @@ export interface HookNonBlockingFailure {
|
|
|
362
366
|
* · `timeout` —— 条目超时被击杀(无退出码);
|
|
363
367
|
* · `spawn_failed` —— 起不来 / http 连不上 / LLM 载体失败(无退出码);
|
|
364
368
|
* · `bad_json` —— exit 0 但 stdout 看着是 JSON 却读不成决策对象(裁决静默丢失的那一形);
|
|
365
|
-
* · `matcher_over_budget` —— 这条 hook 所在组的 `matcher`(或条目自己的 `if` 条件)在这次事件的这个名字上求值没在预算内结束(灾难回溯;
|
|
369
|
+
* · `matcher_over_budget` —— 这条 hook 所在组的 `matcher`(或条目自己的 `if` 条件)在这次事件的这个名字上求值没在预算内结束(灾难回溯;[ref])。
|
|
366
370
|
* **不是 hook 脚本坏了,是它的选中条件不可求值**:server 按「选中」处理(守卫不被跳过,条目照跑),此帧说的是「这只 matcher 在这个名字上跑不完」。
|
|
367
371
|
* **一组一帧**(`if` 一条目一帧),`hookName` / `entryType` 指认组的第一个条目,`detail` 点名 matcher、名字、额度与组里的条目数;无 `exitCode` / `stderr`。
|
|
368
372
|
*/
|
|
@@ -498,7 +502,7 @@ export interface BgNotification {
|
|
|
498
502
|
seq?: number;
|
|
499
503
|
status: "completed" | "failed" | "killed";
|
|
500
504
|
summary?: string;
|
|
501
|
-
/**
|
|
505
|
+
/** [ref](core 7.51.0 [ref] / [ref]):the child's REPORT — the same string the completion frame the parent's model reads carries
|
|
502
506
|
* (core cuts it once at the frame's bound, redacting first), so a host that wakes an idle conversation reads it here instead of a
|
|
503
507
|
* second, differently-cut copy. UNTRUSTED child text ⇒ `redactSecrets` at this wire boundary, exactly like `summary` on this frame
|
|
504
508
|
* and `result` on the `task_notification` frame (one reading: the server redacts at its own boundary whatever upstream did).
|
|
@@ -555,7 +559,7 @@ export declare class FleetEventBus {
|
|
|
555
559
|
private readonly workflows;
|
|
556
560
|
/** [ref] / codex R1-F2:**代际墓碑** —— 已离场行的最后已知 `cycleSeq`(行本身已从 `tasks` 删掉,
|
|
557
561
|
* 代际状态却必须活得比行久一点,否则前代迟到帧会在空 Map 上把幽灵行重铸出来)。有界 LRU。
|
|
558
|
-
* 🔴
|
|
562
|
+
* 🔴 [ref]:碑上多记一位 `ended` = 「**这一代结束了**」是否被断言过。离场**恒**保住代际状态(`gen` 之前的帧
|
|
559
563
|
* 永远是前代迟到帧 —— 与行还在 Map 里时那道闸同一个判据);只有作「这一代结束了」断言的离场(结算级 / 投影级
|
|
560
564
|
* 常规清场)才把 `gen` **这一代本身**也封掉。陈述级退场(`removeReason:"orphaned"`)不作这个断言 ⇒ 同代帧 = 复活。 */
|
|
561
565
|
private readonly retiredGen;
|
|
@@ -577,7 +581,7 @@ export declare class FleetEventBus {
|
|
|
577
581
|
/** Drop a task row (terminal + swept) + fan out the removal. Idempotent (a no-op if already gone).
|
|
578
582
|
*
|
|
579
583
|
* `opts`([ref],两键均 ADDITIVE):`removeReason:"orphaned"` = **陈述级退场**(没有结算语义,见
|
|
580
|
-
* {@link FleetFrame} 的 `task_remove` 臂;
|
|
584
|
+
* {@link FleetFrame} 的 `task_remove` 臂;[ref] 起**不封被退那一代**,同代帧 = 复活);`cycleSeq` = 被退那一代的代际号。发布方的常规清场
|
|
581
585
|
* (`onTerminal`/`onChildTerminal`)不传 opts ⇒ 帧逐字节与本改动之前相同。 */
|
|
582
586
|
removeTask(id: string, opts?: {
|
|
583
587
|
removeReason?: "orphaned";
|
|
@@ -595,7 +599,7 @@ export declare class FleetEventBus {
|
|
|
595
599
|
/** [ref] 让位迁移料的读面:迁移「只补缺席位」需要看得见存活行现有什么(BCE 是权威车道,不覆盖)。 */
|
|
596
600
|
taskRow(id: string): Readonly<FleetTaskRow> | undefined;
|
|
597
601
|
/**
|
|
598
|
-
*
|
|
602
|
+
* [ref]:一条子代行在它两只**属主账**上的键。三个 id 域互不相同,换算只有本类做得了(两种行 id 都是本文件
|
|
599
603
|
* 铸的,两域之间唯一的 join —— 让位登记簿 —— 也住在这里),所以换算只写这一处:
|
|
600
604
|
* · 行 id —— BCE 车道 = registry handle 本身(`e.taskId`);run-leg 车道 = `${runId} ${子代 task_progress taskId}`
|
|
601
605
|
* (`fleetRunPublisher` 的 `childId`);
|
|
@@ -611,10 +615,14 @@ export declare class FleetEventBus {
|
|
|
611
615
|
handle?: string;
|
|
612
616
|
sessionIds: readonly string[];
|
|
613
617
|
};
|
|
614
|
-
/**
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
+
/**
|
|
619
|
+
* Publish a workflow row + fan out. **The row is the whole row and REPLACES the previous one** (by `id`). A workflow row has exactly one producer,
|
|
620
|
+
* {@link buildFleetWorkflowRow} — a projection of the durable run, recomputed whole on every write (the write observer, the terminal window, the
|
|
621
|
+
* reconciler) — so the row as published is the run's current statement. Merging it onto the previous row kept every optional key the run no longer
|
|
622
|
+
* states: core 7.55.0 [ref] `parked` is `true` or absent, and is absent again once the park is decided — under a merge it stayed `true` for the rest of
|
|
623
|
+
* the row's life (a run read "awaiting approval" after its approval was answered). Task rows keep their merge: their producers publish partial deltas.
|
|
624
|
+
*/
|
|
625
|
+
publishWorkflow(row: FleetWorkflowRow): void;
|
|
618
626
|
/** Drop a workflow row + fan out the removal. Idempotent. */
|
|
619
627
|
removeWorkflow(id: string): void;
|
|
620
628
|
/** [ref]-B 缺口②: fan out a background-child completion notification (EVENT — not stored, never in the
|
|
@@ -701,7 +709,7 @@ export type FleetRunPublisher = ReturnType<typeof fleetRunPublisher>;
|
|
|
701
709
|
* stats.toolCalls→toolUses(名对齐,消费端一个形状)。失败码 "cancelled" ⇒ stoppedBy:"user"(与
|
|
702
710
|
* markStopSource 的归因值同源);transcriptId 顶层 = run 的 sessionId([ref]§二拍)。缺源的键不铸。
|
|
703
711
|
*
|
|
704
|
-
* 🔴
|
|
712
|
+
* 🔴 [ref](core 7.6.0 D-8):入参从**结构性可缺席** `errorCode?: string` 改成 `terminal?: TerminalCause`。
|
|
705
713
|
* 留着旧形不会红 —— 那正是危险所在:`TaskResult` 上已经没有 `errorCode` 这个键了,可结构性可选参数照样
|
|
706
714
|
* 编译通过,于是 `stoppedBy:"user"` 会**静默地永远不再铸**(取消的 run 在舰队行上从此看不出是被人杀的)。
|
|
707
715
|
* 终局事实一律走因由,`failureCodeOf` 是本仓读「这次失败带的是哪个码」的唯一形。 */
|
package/dist/fleet/fleet-bus.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
|
-
import { DURABLE_AGENT_HANDLE_RE, deriveAgentDisplayStatus, isDelegatedAgentTerminal } from "@sema-agent/core";
|
|
2
|
+
import { DURABLE_AGENT_HANDLE_RE, deriveAgentDisplayStatus, isDelegatedAgentTerminal, runParkedOf } from "@sema-agent/core";
|
|
3
3
|
import { persistedPlaneOf } from "../terminal.js";
|
|
4
4
|
import { takeWorkspaceSnapshotFailure } from "./workspace-snapshot-residual.js";
|
|
5
5
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
@@ -21,6 +21,7 @@ export function buildFleetWorkflowRow(id, run) {
|
|
|
21
21
|
...(run.originatingSessionId ? { sessionId: run.originatingSessionId } : {}),
|
|
22
22
|
status: run.status,
|
|
23
23
|
...(run.errorCode ? { errorCode: run.errorCode } : {}),
|
|
24
|
+
...(runParkedOf({ status: run.status, agents }) ? { parked: true } : {}),
|
|
24
25
|
doneCount: done,
|
|
25
26
|
totalCount: agents.length,
|
|
26
27
|
failedCount: failed,
|
|
@@ -189,10 +190,9 @@ export class FleetEventBus {
|
|
|
189
190
|
sessionIds.push(k.slice(prefix.length));
|
|
190
191
|
return { sessionIds, ...(DURABLE_AGENT_HANDLE_RE.test(row.id) ? { handle: row.id } : {}) };
|
|
191
192
|
}
|
|
192
|
-
publishWorkflow(
|
|
193
|
-
|
|
194
|
-
this.
|
|
195
|
-
this.emit({ type: "workflow", row: merged, ts: this.now() });
|
|
193
|
+
publishWorkflow(row) {
|
|
194
|
+
this.workflows.set(row.id, row);
|
|
195
|
+
this.emit({ type: "workflow", row, ts: this.now() });
|
|
196
196
|
}
|
|
197
197
|
removeWorkflow(id) {
|
|
198
198
|
if (this.workflows.delete(id))
|