@sema-agent/server 7.133.0 → 7.135.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 +221 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/USAGE.md +222 -36
- package/deploy/sema-up/README.md +16 -0
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +15 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +129 -0
- package/deploy/sema-up/chart/templates/sealed-key.yaml +24 -0
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +14 -0
- package/deploy/sema-up/chart/templates/server.yaml +14 -0
- package/deploy/sema-up/chart/values-full-single.yaml +5 -1
- package/deploy/sema-up/chart/values.yaml +34 -0
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +25 -25
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +66 -154
- package/dist/approval-card.js +33 -52
- package/dist/approval-content-kind.d.ts +26 -6
- package/dist/approval-content-kind.js +23 -3
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +91 -0
- package/dist/approval-gate-currency.js +120 -0
- 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 +14 -8
- package/dist/approval.js +35 -16
- package/dist/auth-bridge.d.ts +1 -1
- 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/coordinators.d.ts +7 -2
- package/dist/boot/coordinators.js +8 -5
- 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 +2 -0
- package/dist/boot/leader.js +2 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/read-deny-anchor-audit.js +2 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +28 -24
- package/dist/boot/runner-deps.d.ts +29 -16
- package/dist/boot/runner-deps.js +12 -2
- 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-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.d.ts +4 -3
- package/dist/boot/stage-06-runners.js +15 -4
- package/dist/boot/stage-07-capability-layer.d.ts +2 -1
- package/dist/boot/stage-08-reapers.d.ts +2 -1
- package/dist/boot/stage-09-leader.d.ts +2 -1
- package/dist/boot/stage-09-leader.js +2 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -1
- package/dist/boot/stage-10-http-server.js +2 -1
- package/dist/boot/stores.d.ts +8 -0
- package/dist/boot/stores.js +10 -13
- package/dist/boot/web-admin.d.ts +21 -15
- package/dist/boot/web-admin.js +16 -12
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- package/dist/budget.js +5 -1
- package/dist/caller-text-echo.d.ts +2 -0
- package/dist/caller-text-echo.js +2 -1
- package/dist/canonical-json.d.ts +2 -41
- package/dist/canonical-json.js +2 -13
- 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 +2 -2
- package/dist/capabilities/composite-members.js +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 +10 -7
- package/dist/capabilities/mcp-probe.js +2 -2
- 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 +27 -24
- package/dist/capability-facts.js +18 -20
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- package/dist/checkpoint-ctx-seal-m28.d.ts +42 -0
- package/dist/checkpoint-ctx-seal-m28.js +19 -0
- 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-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- 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/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/field-conflict.d.ts +2 -1
- package/dist/field-conflict.js +1 -0
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +50 -9
- package/dist/file-history-disclosure.js +8 -13
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +26 -14
- package/dist/fleet/fleet-bus.js +6 -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 +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +38 -20
- 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 +28 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +5 -2
- package/dist/http/checkpoint-ctx.d.ts +183 -2
- package/dist/http/checkpoint-ctx.js +197 -2
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/dispatch.js +3 -3
- package/dist/http/durable-run-leg.js +7 -5
- package/dist/http/idempotency.d.ts +4 -4
- package/dist/http/idempotency.js +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 +39 -13
- package/dist/http/principal-gate.js +30 -6
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/refusal-body.d.ts +12 -0
- package/dist/http/refusal-body.js +11 -0
- package/dist/http/request-guards.d.ts +4 -13
- package/dist/http/request-guards.js +4 -17
- package/dist/http/resume-ctx-read.d.ts +53 -6
- package/dist/http/resume-ctx-read.js +26 -3
- package/dist/http/resume-legs.d.ts +5 -4
- package/dist/http/resume-legs.js +47 -29
- package/dist/http/route-ctx.d.ts +29 -38
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +5 -5
- package/dist/http/routes/approvals-assistant.js +91 -17
- 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 +6 -6
- package/dist/http/routes/diagnostics.js +1 -1
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +5 -4
- 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/memory-origin.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/rules.js +4 -4
- package/dist/http/routes/runs.js +44 -11
- package/dist/http/routes/session-sync.d.ts +3 -2
- package/dist/http/routes/session-sync.js +109 -62
- package/dist/http/routes/sessions-list.d.ts +1 -1
- package/dist/http/routes/sessions-list.js +4 -5
- package/dist/http/routes/sessions.js +34 -48
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/tasks.js +21 -16
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/trace-usage.js +7 -9
- 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 +39 -33
- package/dist/http/server.js +5 -2
- 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.d.ts +4 -3
- package/dist/http/submit-ctx.js +19 -3
- 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 +35 -24
- package/dist/index.d.ts +2 -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 +9 -5
- package/dist/leader/wire.js +8 -7
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/main.js +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-origin-fence.js +2 -2
- 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-compat.d.ts +1 -1
- 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-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/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 +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/prompt-manifest.d.ts +19 -8
- package/dist/observability/prompt-manifest.js +9 -8
- 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/observability/tool-trace.js +8 -9
- 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/orchestration/workflow-park-decision.d.ts +1 -1
- package/dist/orchestration/workflow-park-decision.js +1 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +20 -20
- package/dist/parked-decide.js +8 -5
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +3 -25
- package/dist/permission-rule-vocab.js +0 -13
- 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 +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/approval-payload-fingerprint.d.ts +14 -6
- package/dist/plugins/approval-payload-fingerprint.js +1 -1
- 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/caching-session-store.d.ts +24 -33
- package/dist/plugins/caching-session-store.js +8 -19
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +66 -67
- package/dist/plugins/checkpoint-store-sql.js +100 -103
- 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 +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- 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 +23 -12
- package/dist/plugins/local-checkpoint-store.js +29 -4
- package/dist/plugins/local-session-store.d.ts +44 -45
- package/dist/plugins/local-session-store.js +42 -52
- package/dist/plugins/local-session-window.d.ts +12 -6
- package/dist/plugins/local-session-window.js +1 -17
- 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 +76 -39
- package/dist/plugins/one-time-migrations.js +127 -34
- 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 +16 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +74 -31
- 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 +9 -21
- package/dist/plugins/pg-session-storage.js +51 -42
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +22 -14
- package/dist/plugins/remote-env-device.js +28 -16
- 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 +8 -8
- 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/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.d.ts +11 -0
- package/dist/plugins/session-ownership.js +11 -0
- package/dist/plugins/session-placement.d.ts +12 -14
- package/dist/plugins/session-placement.js +2 -15
- 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/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -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/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 +9 -2
- package/dist/plugins/tidb-session-store.d.ts +17 -27
- package/dist/plugins/tidb-session-store.js +52 -42
- 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 +19 -4
- 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-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-tool-axes.d.ts +12 -0
- package/dist/request-tool-axes.js +20 -0
- 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/run-local.js +1 -0
- package/dist/runs.d.ts +15 -12
- package/dist/runs.js +19 -4
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +34 -2
- package/dist/sealed-key.js +55 -1
- package/dist/security.d.ts +31 -32
- 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 +19 -12
- package/dist/session-error-wire.js +4 -1
- package/dist/session-incarnation.d.ts +52 -35
- package/dist/session-incarnation.js +23 -8
- 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-sync-kernel.d.ts +38 -11
- package/dist/session-sync-kernel.js +10 -0
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -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 +3 -1
- package/dist/task-a2a.js +38 -5
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +14 -10
- package/dist/task-mcp.js +39 -12
- package/dist/task-settings.d.ts +34 -18
- package/dist/task-settings.js +34 -4
- 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 +273 -228
- package/dist/tool-approval.js +125 -47
- package/dist/tool-rule-names.d.ts +7 -1
- package/dist/trace/core-keyset-guard.d.ts +15 -9
- 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 +40 -1
- package/dist/trace/exit-seat.js +46 -14
- package/dist/trace/ledger-events.d.ts +6 -4
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +65 -46
- package/dist/trace/project.js +49 -5
- package/dist/trace/redact.d.ts +44 -27
- package/dist/trace/redact.js +343 -73
- package/dist/trace/self-minted-wire.d.ts +39 -14
- package/dist/trace/self-minted-wire.js +9 -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 +9 -3
- package/dist/trace/wire-projection-faces.js +7 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- 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 +29 -4
- package/dist/web-admin-client/skills-mcp.js +31 -4
- package/dist/web-admin-client/types.d.ts +17 -10
- package/dist/workspace-space.d.ts +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +35 -2
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/skills/loop.md +1 -1
- package/dist/mcp-tool-faces.d.ts +0 -69
- package/dist/mcp-tool-faces.js +0 -104
- package/dist/orchestration/workflow-journal-entry.js +0 -27
package/dist/http/server.d.ts
CHANGED
|
@@ -95,14 +95,14 @@ export interface ServiceCoreDeps {
|
|
|
95
95
|
* `boot/resolve-spec.ts` 的 `declaresInteractivePosture`)。缺席/false ⇒ 无人腿,不声明 posture ——
|
|
96
96
|
* bg(`POST /v1/runs`)、A2A、resume、cron/wake 一律走这一侧,行为字节不变。
|
|
97
97
|
* ⚠️ 它是**腿身份**不是能力表态:绝不从请求体读,只由路由装配点按 URL 定(客户端说了不算)。 */
|
|
98
|
-
/** `opts.onNotice` (
|
|
98
|
+
/** `opts.onNotice` ([ref], core 7.9.1):装配期铸下的、**这条会话**的用户面通告(今天只有一族:请求腿
|
|
99
99
|
* MCP 注入被丢弃)。装配跑在通告腿开口**之前**(`prepareSpec` → 路由注册 `registerEngineNoticeLeg`),
|
|
100
100
|
* 所以它不能在铸点直接 `route()` ——收下来交给调用腿,由腿在开口那一拍连同 `pending` 一起投。
|
|
101
101
|
* 缺席(桩)⇒ 只走结构化日志终点,行为逐字不变。
|
|
102
102
|
* ⚠️ 7.69.0(R-1)起 **resume 家族也递这一位** —— 四条 resume 腿收敛到 `resolveResumeSpec` 一只 resolver,
|
|
103
103
|
* 通告口接一次、四腿同得(见 http/server.ts 的 `resolveResumeSpec` 顶注);此处旧注写作「resume 家族缺席」
|
|
104
104
|
* 已过期,按新行为改。
|
|
105
|
-
* `opts.unattendedLeg`(
|
|
105
|
+
* `opts.unattendedLeg`([ref] 候裁 18,codex r3 F1;[ref] ① 改形):续跑家族在 ctx 带无人值守标(`CheckpointCtx.unattendedLeg`)时递 `true` ——
|
|
106
106
|
* 装配器在**全部折叠之后**经首跑同一只合并口 `withUnattendedLeg` 重挂那条腿(`default` + 按类作答的 onAsk)。只由续跑腿
|
|
107
107
|
* 按服务端写的 ctx 位递,绝不从请求体读。 */
|
|
108
108
|
resolveSpec: (body: TaskRequestBody, req: IncomingMessage | undefined, auth?: RequestAuth, opts?: {
|
|
@@ -115,8 +115,8 @@ export interface ServiceCoreDeps {
|
|
|
115
115
|
* [ref] 场景 hands lane 选路:按 `resolveSpec` 刚产出的 TaskSpec 取本任务的执行 Runner。
|
|
116
116
|
* 装配点(`boot/stage-10-http-server.ts`)传的是 `createHandsRunnerSelector` —— 选路规则只有那一份实现,
|
|
117
117
|
* 本层不解释场景,只取用。
|
|
118
|
-
* 🔴 **必填**(
|
|
119
|
-
* (带全量手的主 Runner)。而同一轴上「车道**字段**缺席」早已是拒(
|
|
118
|
+
* 🔴 **必填**([ref],7.105.0):修前这一席可选,缺席 ⇒ 静默落 {@link ServiceDeps.runner} —— 最宽的那只
|
|
119
|
+
* (带全量手的主 Runner)。而同一轴上「车道**字段**缺席」早已是拒([ref],`handsLaneOf` 抛
|
|
120
120
|
* `HandsLaneUnstampedError`),席缺席回落最宽 = 同一件事两条律。现在缺席是**编译错**;绕过类型
|
|
121
121
|
* (JS 嵌入方 / `as` 硬转)造的 deps 在 {@link createHttpServer} 入口**拒启**。单 Runner 的嵌入方显式传
|
|
122
122
|
* `runnerFor: () => runner` —— 那是一句表态,不是一个回落。
|
|
@@ -146,13 +146,19 @@ export interface ServiceStoreDeps {
|
|
|
146
146
|
/** Per-session approval exemption store — enables decide body `remember:"session"` + the
|
|
147
147
|
* exemptions list/revoke surfaces on /v1/approvals. The ask-gate probe is wired separately (main.ts). */
|
|
148
148
|
approvalExemptionStore?: ApprovalExemptionStore;
|
|
149
|
-
/**
|
|
149
|
+
/** [ref]:直连门审批证明的**一次性消费记录**(`plan_review` 的 nonce)。每条 store 车道都供,所以在任何
|
|
150
150
|
* `DB_BACKEND` 上都在场;缺席只出现在装配缝(桩 deps)—— 那时直连门的 plan_review **拒**(501,见
|
|
151
151
|
* `routes/approvals-assistant.ts` 的消费点),绝不静默受理一份结构上可重放的证明。BFF 门不读这只店。 */
|
|
152
152
|
approvalNonceStore?: ApprovalNonceStore;
|
|
153
153
|
/** Durable-checkpoint store ([ref], core 1.67): durable F4 suspend/resume. When present, the resume
|
|
154
154
|
* endpoint + suspended-run surfacing are active. Set only when DURABLE_APPROVAL + a TiDB pool. */
|
|
155
155
|
checkpointStore?: CheckpointStoreFull;
|
|
156
|
+
/** [ref]:停驻行凭据的**封签器**(`sealed-key.ts` `ensureCheckpointCtxSealing`,这一域自己的保管店 `<数据根>/sealed-key/checkpoint-ctx-keys/`;规则属主 = `checkpoint-ctx.ts` 末段
|
|
157
|
+
* 「凭据位密封」)。提交体里请求面凭据位上的值在 `checkpoint_ctx` 里只以封签存在:写 ctx 的每一笔经它封、续跑上下文读口经它开。
|
|
158
|
+
* 🔴 **与 `checkpointStore` 同在**:店在而它缺席 ⇒ `createHttpServer` 拒启(句子 = `CHECKPOINT_CTX_SEALING_REQUIRED`)—— 凭据只以封签落盘,
|
|
159
|
+
* 封不了就不落,没有「明文照写」的第二种装配。嵌入方:`checkpointCtxSealing: await ensureCheckpointCtxSealing(sealedKeyDir)`
|
|
160
|
+
* (保管目录要跨重启持久、多副本各副本是同一份钥匙,否则封它的那把钥匙不在 ⇒ 409 `conflict.checkpoint_ctx_unsealable` `reason:"key_not_held"`)。 */
|
|
161
|
+
checkpointCtxSealing?: import("./checkpoint-ctx.js").CheckpointCtxSealing;
|
|
156
162
|
/** E6 durable SessionPolicyStore (operator-tightened per-session tool rules). Enables PUT/GET /v1/sessions/:id/policy
|
|
157
163
|
* when present; core reads the rules at prepare-time (subtract-only) via RunnerDeps.sessionPolicyStore (wired separately). */
|
|
158
164
|
sessionPolicyStore?: ServiceSessionPolicyStore;
|
|
@@ -166,7 +172,7 @@ export interface ServiceStoreDeps {
|
|
|
166
172
|
/** [ref] per-edited-file rewind history store. Present ⇒ the rewind capabilities are advertised; core uses it
|
|
167
173
|
* via RunnerDeps.fileHistoryStore (first-touch tracking + per-turn boundaries + tracked-set restore, ANY
|
|
168
174
|
* env). Also the 2c history-transfer store (exportHistory/importHistory + blob negotiation faces).
|
|
169
|
-
* 🔴
|
|
175
|
+
* 🔴 [ref]:这是装配单点 `assembleFileHistory` 的**店**(后端在即在,与 `FILE_HISTORY_CAPTURE` 无关 —— 旋钮只关捕获,
|
|
170
176
|
* 落在 core 的 `RunnerDeps.fileHistoryCapture` 上)。rewind 族四位与 2c sync 路由族跟它走;能力词 `fileHistoryCapture`
|
|
171
177
|
* = `fileHistoryCaptureOf(本键, config.fileHistoryCapture)`(与 core 捕获位同一只判定)。
|
|
172
178
|
* 擦除(E21 / 孤儿 blob GC)不读本键,读 boot 侧的擦除脸。 */
|
|
@@ -203,7 +209,7 @@ export interface ServiceStoreDeps {
|
|
|
203
209
|
* (subscribeWorkflow) and works whenever self-orchestration is on, store or not. Runs are owner-gated by
|
|
204
210
|
* `scope` (= the creating principal). Also drives `capabilities.workflowsList` (= "can durably LIST runs"). */
|
|
205
211
|
workflowRunStore?: WorkflowRunStore;
|
|
206
|
-
/**
|
|
212
|
+
/** [ref] 车CM:workflow 出身 park 的**有界 join** 索引 —— 与 `workflowRunStore` **成对**才构成第三条
|
|
207
213
|
* 车道(索引只回答「去哪条 run 找」,行本体与赎回键仍以 run 的 blob 为准)。与 RunnerDeps 侧同实例
|
|
208
214
|
* (boot/workflow-orchestration.ts);任一缺席 = 那条车道不存在(workflow 出身的 park 落 legacy 腿,
|
|
209
215
|
* 与本批之前逐字同形)。契约与单写者纪律的属主 = orchestration/workflow-agent-session-index.ts。 */
|
|
@@ -230,8 +236,8 @@ export interface ServiceStoreDeps {
|
|
|
230
236
|
/** SendUserFile 账本(多租户治理面):scope↔object 映射的读面 GET /v1/sendfile-links。present ⇔ 签发面
|
|
231
237
|
* 已配 AND 有 store backend(main.ts 建;写点在两条 send lane 的 withLedgerRecording)。 */
|
|
232
238
|
sendFileLedger?: import("../plugins/send-file-ledger.js").SendFileLedger;
|
|
233
|
-
/**
|
|
234
|
-
* 在场 ⇔ 有 store backend(生产恒与 `runStore` 同源于 backend)。消费点:steer 的 live 腿 / interrupt{text} / 同步子代的 steer(
|
|
239
|
+
/** [ref] 用户输入受理账本(「200 applied」受理的影子;单写者 = `src/user-input-ledger.ts` 的活对象,boot 装配在 stage-07 并跑一次收敛)。
|
|
240
|
+
* 在场 ⇔ 有 store backend(生产恒与 `runStore` 同源于 backend)。消费点:steer 的 live 腿 / interrupt{text} / 同步子代的 steer([ref])受理前写 `accepted`(写不进 ⇒ 503
|
|
235
241
|
* `steering.ledger_unavailable`)、三条 run 腿开通告口那一拍铸 `crashed` 通告并在收场时 settle、`GET /v1/sessions/:id` 的
|
|
236
242
|
* `userInputUndrained` 读面。缺席只出现在不接 backend 的 stub-harness 上(那时没有这一面,行为与修前逐字相同)。 */
|
|
237
243
|
userInputLedger?: import("../user-input-ledger.js").UserInputLedger;
|
|
@@ -305,8 +311,8 @@ export interface ServiceCoordinatorDeps {
|
|
|
305
311
|
* 对它做**有界**等待(3s cap,routes/fleet.ts),SIGKILL 后壳重连不再与 recover 赛跑。缺席或已
|
|
306
312
|
* resolve=立即组装(memory 后端、无 notify gate 的部署);main.ts 铸(recover 收官即落,失败也落)。 */
|
|
307
313
|
fleetRecoveryDone?: Promise<void>;
|
|
308
|
-
/** [ref] session-watch registry(SSE 订阅共享探针面)。present ⇔ sessionStorage
|
|
309
|
-
* (
|
|
314
|
+
/** [ref] session-watch registry(SSE 订阅共享探针面)。present ⇔ sessionStorage 有按 id 的头读 `headOf`(属主 + 叶子一次读)
|
|
315
|
+
* (装配期建);absent ⇒ /v1/sessions/:id/events 501(capabilities.sessionEvents 同谓词,永不漂)。 */
|
|
310
316
|
sessionWatch?: import("../session-watch.js").SessionWatchRegistry;
|
|
311
317
|
/** asyncRewake wake 管道 holder(main.ts 建壳,server 启动装 deliver=session→本副本活流 steer)。 */
|
|
312
318
|
hookWakeBus?: {
|
|
@@ -347,7 +353,7 @@ export interface ServiceSeamDeps {
|
|
|
347
353
|
*/
|
|
348
354
|
deviceStore?: import("../device-store.js").DeviceStore;
|
|
349
355
|
/**
|
|
350
|
-
*
|
|
356
|
+
* [ref](车C 余件):device lane 的**准入链**(`createDeviceEnrollment`)—— 管理面三个写动词
|
|
351
357
|
* (签发 / 注册 / 吊销)与首绑写协议(`commitPlacement`)的**唯一**判据属主。
|
|
352
358
|
*
|
|
353
359
|
* 🔴 为什么路由拿的是它而不是 {@link deviceStore}:enrollment 那一层持着两件路由造不出来的东西 ——
|
|
@@ -360,7 +366,7 @@ export interface ServiceSeamDeps {
|
|
|
360
366
|
*/
|
|
361
367
|
deviceEnrollment?: import("../device-enrollment.js").DeviceEnrollment;
|
|
362
368
|
/**
|
|
363
|
-
*
|
|
369
|
+
* [ref] × 7.106.0 合并复审 X1:host 车道会话登记簿的 `inheritEnv` **写口**(`boot/execution-env.ts` 的 `setSessionInheritEnv`)。
|
|
364
370
|
* 唯一调用者 = `http/session-inherit-env.ts` 的 `commitSessionInheritEnv`(四个 run 认领点在认领之后调;判据与残余见那只文件)。
|
|
365
371
|
* 缺席 = 本部署不是 host 车道(没有工厂读这一格)⇒ 提交点 no-op。装配 = `boot/stage-10-http-server.ts`(host 车道才给)。
|
|
366
372
|
*/
|
|
@@ -375,7 +381,7 @@ export interface ServiceSeamDeps {
|
|
|
375
381
|
* run-ledger/checkpoint/tool-result rows, owner-guarded, in one call. Returns `{ deleted }` (idempotent) — or
|
|
376
382
|
* `{ active }` when the runs-ledger TX re-asserted a still-live run (a concurrent createRun raced the route's
|
|
377
383
|
* pre-check), which the route maps to 409. Enables DELETE /v1/sessions/:id. Wired by main.ts (all the stores). */
|
|
378
|
-
/** E21 删除协调器。三种结局:删了 / 有活跑(`{active}`,409 `conflict.session_active_run`)/
|
|
384
|
+
/** E21 删除协调器。三种结局:删了 / 有活跑(`{active}`,409 `conflict.session_active_run`)/ [ref]:以本会话为根的后台子代没停干净
|
|
379
385
|
* (`{childrenAlive}` = 仍活着的子代句柄,409 `conflict.session_children_alive` 的 `remaining[]`;会话记录不动)。 */
|
|
380
386
|
purgeSession?: (sessionId: string, owner: string | null) => Promise<{
|
|
381
387
|
deleted: boolean;
|
|
@@ -485,7 +491,7 @@ export interface ServiceSeamDeps {
|
|
|
485
491
|
status: (sessionId: string) => Promise<SessionMemoryStatus>;
|
|
486
492
|
};
|
|
487
493
|
/**
|
|
488
|
-
*
|
|
494
|
+
* [ref](core 7.22.0 [ref] W1)—— 本**部署**的自动整理武装事实,`GET /v1/sessions/:id/memory-status`
|
|
489
495
|
* 的 `autoConsolidationArmed` 格。
|
|
490
496
|
*
|
|
491
497
|
* 🔴 **唯一读法**:值必须由 core 的 `autoRunOnRecommendationEffective(RunnerDeps)` 组
|
|
@@ -499,7 +505,7 @@ export interface ServiceSeamDeps {
|
|
|
499
505
|
*/
|
|
500
506
|
memoryAutoConsolidationArmed: boolean;
|
|
501
507
|
/**
|
|
502
|
-
*
|
|
508
|
+
* [ref] / [ref] + 车PI 修复轮 ④ —— 记忆整理阀门的**生效判决**(boot 第 4 段 `createConsolidationValve`:显式词,或出厂缺省按
|
|
503
509
|
* 装配结果派生)。配置目录那一行(`GET /v1/config/catalog` 的 `MEMORY_CONSOLIDATION_DRIVER` `effectiveValue`)读它 —— 那一列的契约是
|
|
504
510
|
* 「本进程实际生效值」,而这根旋钮的生效值只有装配期才知道。🔴 **必填**:装配漏接 ⇒ tsc 红;测试桩在 `test/helpers/boot.ts` 显式给。
|
|
505
511
|
*/
|
|
@@ -538,7 +544,7 @@ export interface ServiceSeamDeps {
|
|
|
538
544
|
* 启用 `POST /v1/admin/memory/consolidation/run` 与 `GET /v1/admin/memory/consolidation`(两口 operator-only)。
|
|
539
545
|
* main.ts 把它接到 `createMemoryConsolidationFaces` 的产物上。
|
|
540
546
|
* 🔴 缺席的**唯一**成因是「阀门没开」(显式 `MEMORY_CONSOLIDATION_DRIVER=off`,或未设而出厂缺省派生成关 ——
|
|
541
|
-
*
|
|
547
|
+
* [ref] / [ref]:整理座落主模型 / 结构上跑不起来;判决属主 `boot/memory-consolidation.ts` `resolveConsolidationValve`):
|
|
542
548
|
* 阀门开着却结构上跑不了的三种形(引擎没接线 / 后端没有控制面归属 / `MEMORY_PROVENANCE=off`)在
|
|
543
549
|
* **启动期**就被拒了(`boot/memory-consolidation.ts`),那些机器根本起不来。⇒ 缺席形是 **404 族**
|
|
544
550
|
* (整域不挂),刻意**不是** 501:501 说「换部署形态」,这里的动作是「把旋钮打开」。全文见
|
|
@@ -599,7 +605,7 @@ export interface ServiceSeamDeps {
|
|
|
599
605
|
};
|
|
600
606
|
};
|
|
601
607
|
}) => void;
|
|
602
|
-
/**
|
|
608
|
+
/** [ref](core 7.32.0):parked 赎回面工厂(按行解析驱动哪只 Agent 工具 + 同出一张列表的继承座;属主 `parked-revive-surface.ts`)。
|
|
603
609
|
* 缺席 = 这台部署没有 park 底座(checkpointStore / backgroundAgentStore 任一缺席),bg 赎回臂不接线。 */
|
|
604
610
|
parkedReviveSurface?: import("../parked-revive-surface.js").ParkedReviveSurfaceFactory;
|
|
605
611
|
/** 可选第三件:revive args 的 `subagent_type` roster 成员集([ref] Q1 成员性规则)。当前生产装配
|
|
@@ -681,12 +687,12 @@ export interface ServiceDeploymentDeps {
|
|
|
681
687
|
* main.ts passes the effective store label (`durable(pg)` / `durable(mysql)` / `durable(local)` / "memory",
|
|
682
688
|
* same derivation as the boot `listening` log). Absent → fall back to the raw config enum. */
|
|
683
689
|
sessionStoreLabel?: string;
|
|
684
|
-
/** S5 →
|
|
690
|
+
/** S5 → [ref] ①:持久化姿态的**唯一**装配值(`store-posture.ts`,`boot/stores.ts` 铸):`/health` 的 `storeDegraded` / `durable:false`
|
|
685
691
|
* (present-iff `degradedReason` 在场)与 caps `store` 同读它,gauge `store_backend_degraded` 在装配点读同一只。
|
|
686
692
|
* 缺席 = 这个进程不是由 composition root 装起来的(测试夹具形)⇒ `/health` 不带降级位、caps `store` 取诚实下限
|
|
687
693
|
* (`declared` = 配置词,`backend:"memory"` —— 本面不知道任何装出来的后端)。 */
|
|
688
694
|
storePosture?: import("../store-posture.js").StorePosture;
|
|
689
|
-
/**
|
|
695
|
+
/** [ref] ②:caps `centerWiring` 的读面(`capabilities/center-wiring.ts` `createCenterWiringReader`;入参 = 请求的已验 principal)。
|
|
690
696
|
* 缺席 = 没接中心(或测试夹具)⇒ 键整个缺席。 */
|
|
691
697
|
centerWiring?: (principal: string | undefined) => import("../capabilities/center-wiring.js").CenterWiring;
|
|
692
698
|
/**
|
|
@@ -701,7 +707,7 @@ export interface ServiceDeploymentDeps {
|
|
|
701
707
|
* • [ref]:`attachedStreams` 同样 ASSIGNED BY createServer —— 本副本当前打开着的 SSE 流条数
|
|
702
708
|
* (= 引擎附着租约集的大小)。消费方是 `boot/engine-lease.ts` 的自退判据;与 `inflight` 同族,
|
|
703
709
|
* 同一个共享盒子,不另开第二条 main↔server 的通道。
|
|
704
|
-
* •
|
|
710
|
+
* • [ref]:`inflight` 只数**工作** —— 只读订阅流(路由表 `subscription` 列的八条 GET SSE 读面)不进 admission 计数,只进
|
|
705
711
|
* `attachedStreams`;`endSubscriptions`(同样 ASSIGNED BY createServer)发 `draining` 终帧后关掉它们,收尾链在排空进入那一拍与
|
|
706
712
|
* 硬停起点各调一次。
|
|
707
713
|
*/
|
|
@@ -718,7 +724,7 @@ export interface ServiceDeploymentDeps {
|
|
|
718
724
|
* changes (skills/mcp/a2a/scenarios/… baked at boot — the `RestartSlice` closed set) that DIFFER from this process's boot config.
|
|
719
725
|
* Surfaced at GET /health as `restartRequired` + `restart{reasons,version,since}` so the orchestrator can
|
|
720
726
|
* auto rolling-restart the worker. Change-detected (not presence) — absent when nothing baked-at-boot
|
|
721
|
-
* changed, so polling it never causes a restart loop.
|
|
727
|
+
* changed, so polling it never causes a restart loop. [ref]:the fleet heartbeat reads THIS getter too
|
|
722
728
|
* (`boot/stage-10-http-server.ts` → `restart: () => deployment.restartState?.()`), so `/health.restart` and the
|
|
723
729
|
* announcement's `restart` are the same object — one mint point, two exits. */
|
|
724
730
|
restartState?: () => RestartSignal | undefined;
|
|
@@ -727,18 +733,18 @@ export interface ServiceDeploymentDeps {
|
|
|
727
733
|
* (按组的 appliedVersion / deferredKeys+铸因 / lastRejected 消毒形)。缺席 = 这个进程没有配置管道
|
|
728
734
|
* (纯 env 部署 / 测试夹具)⇒ 两个面的形状逐字不变(additive)。 */
|
|
729
735
|
configApplyState?: () => import("../web-admin-client/apply-ledger.js").ConfigApplyLedgerView | undefined;
|
|
730
|
-
/**
|
|
736
|
+
/** [ref]:中心凭证健康位(`/health.centerCredential`)—— 凭证来源的健康态 + 续签器状态(`center-credential-renewer.ts`
|
|
731
737
|
* `buildCenterCredentialHealthView` 铸形,只有闭集词 / 时刻 / 计数,不带路径与令牌)。缺席 / 返回 undefined = 健康或没有中心
|
|
732
738
|
* ⇒ `/health` 形状逐字不变(additive)。 */
|
|
733
739
|
centerCredentialState?: () => import("../center-credential-renewer.js").CenterCredentialHealthView | undefined;
|
|
734
|
-
/**
|
|
740
|
+
/** [ref]:`/health.centerIdentityNotice` —— 中心凭证换人后的**最近一条**两态通告(`center-config-tier.ts` 铸:`{ code, message, at }`,码闭集两词、句冻结)。取值口交出的
|
|
735
741
|
* 就是 wire 形,`/health` 不另投影;无鉴权面,只有码 / 冻结句 / 时刻。缺席 / 返回 undefined = 从未换过人或没有中心 ⇒ `/health` 形状逐字不变(additive)。 */
|
|
736
742
|
centerIdentityNoticeState?: () => import("../center-config-tier.js").CenterIdentityNotice | undefined;
|
|
737
|
-
/**
|
|
743
|
+
/** [ref]:模型拒因信号(`/health.modelRefusals`,settings-schema 6.2.0 `ModelRefusalsSignal` 形:名 → 码 + 组拒码)。fleet 心跳读**这同一只**
|
|
738
744
|
* (`boot/stage-10-http-server.ts` → `modelRefusals: () => deployment.modelRefusalsState?.()`)—— 一处铸、两出口。缺席 / 返回 undefined =
|
|
739
745
|
* 没有可报的拒或没有配置管道 ⇒ `/health` 形状逐字不变(additive)。 */
|
|
740
746
|
modelRefusalsState?: () => import("@sema-agent/settings-schema").ModelRefusalsSignal | undefined;
|
|
741
|
-
/**
|
|
747
|
+
/** [ref]:`GET /v1/models.candidateRejected` 的取值口 —— 最近一次配置候选被判官整拒的结论(`boot/stage-10-http-server.ts` →
|
|
742
748
|
* `candidateRejectionState: () => webAdmin.candidateRejectionState()`;座 = web-admin 的 `candidateRejection`,`config_candidate_rejected` 日志行的去重键读同一份)。
|
|
743
749
|
* present-iff 当前生效配置是因候选被拒而回落的那一份;缺席 / 返回 undefined = 没有被拒的候选或没有配置管道 ⇒ `GET /v1/models` 不出该键(additive)。 */
|
|
744
750
|
candidateRejectionState?: () => import("../web-admin-client/candidate-gate.js").CandidateRejection | undefined;
|
|
@@ -785,10 +791,10 @@ export interface ServiceDeploymentDeps {
|
|
|
785
791
|
* `GET /v1/capabilities` 的 `memoryEngine` 位(窄投影)。缺席 = 这个进程不是由 composition root 装
|
|
786
792
|
* 起来的(测试夹具形)⇒ 诊断面报 null、能力位取诚实下限 false。 */
|
|
787
793
|
memoryPosture?: import("../memory-posture.js").MemoryPosture;
|
|
788
|
-
/**
|
|
794
|
+
/** [ref]:SQL **引擎读口**(`sql-engine-posture.ts` 的单一推导点 —— boot 期借一条池连接触发驱动的连接初始化,交回本池的驱动:
|
|
789
795
|
* `dialect`(SQL 文本轴,恒在)+ 活的 `facts`(`SET` 之后**回读复核**过的真值;池重连后驱动会重新初始化并刷新,快照会说谎)。
|
|
790
796
|
* 读者:`GET /v1/diagnostics/wiring` 的 `sqlEngine` 段(operator-only,全量含版本与两堵墙)与 `GET /v1/capabilities` 的 `store.sql` 位(窄投影;
|
|
791
|
-
* 7.106.0 前是顶层 `sql`,
|
|
797
|
+
* 7.106.0 前是顶层 `sql`,[ref] ①)读 `facts`;提交受理口的 413 把整只读口交给唯一判官 `sql-driver.ts` `sqlWallsOf`(墙的方言只从这里来(与事实同出一只驱动),不另从店后端读);其中包墙是连接级事实 ——
|
|
792
798
|
* 这里的包墙是最近一次初始化的那条连接的读数,受理口那一腿是同一只规则的提前一跑,终判在将要执行写入的那条连接上(`sql-driver.ts` `connectJudged`;SQL 快照 blob 的店判与 `PUT /sync/blobs` 的 413 来自它)。
|
|
793
799
|
* 两种缺席、两个值:**席缺席** = 本部署没有 SQL 后端(env-only worker、local 文件后端);**`facts` 是 `null`** = 有 SQL 后端、但事实此刻没建立
|
|
794
800
|
* (池上最近一次连接初始化被拒,驱动当场作废了事实)。两者在两个读面上都报缺席(诚实缺席,不铸空壳);墙按方言读后者(MySQL 协议 ⇒ 最保守的假定墙)。
|
|
@@ -797,14 +803,14 @@ export interface ServiceDeploymentDeps {
|
|
|
797
803
|
* 本服务自己的装配(`boot/stores.ts` → `stage-10`)按同一个谓词(`sqlPoolsOf`)建立它,恒给。值形也在起服时判(同一只判官 `sqlEngineSeatIssue` 的另一臂):
|
|
798
804
|
* `{ dialect: "tidb" | "pg", facts }`,`facts` 是 `null` 或带 `maxRowBytes` / `maxPacketBytes` / `wallSources` 的引擎事实;只改了键名的 `() => facts` 之类 ⇒ 起服拒。 */
|
|
799
805
|
sqlEngine?: import("../plugins/sql-driver.js").SqlEngineReading;
|
|
800
|
-
/**
|
|
806
|
+
/** [ref]:**写保护名表**的姿态(`write-protection.ts` 的 boot 期单一推导点 —— 与递给每只 Runner 的
|
|
801
807
|
* `writeProtectedPaths` 座同一份 config 决定)。两个读面共用:`GET /v1/diagnostics/wiring` 的
|
|
802
808
|
* `writeProtection` 段(operator-only,**逐行**表 + 来源 + 被丢的缺省行名)与 `GET /v1/capabilities`
|
|
803
809
|
* 的 `writeProtection` 位(窄投影 `{armed, rows, replaced}`,**不含行内容**)。
|
|
804
810
|
* boot 期算一次的**存活对象**(纯 config 派生,运行期不变;core 座没有热改腿)。
|
|
805
811
|
* 缺席 = 这个进程不是由 composition root 装起来的(测试夹具形)⇒ 诊断面报 null、能力位报 null。 */
|
|
806
812
|
writeProtection?: import("../write-protection.js").WriteProtectionPosture;
|
|
807
|
-
/**
|
|
813
|
+
/** [ref]:**部署侧 WebSearch 后端**(`WEB_SEARCH_PROVIDER`)—— `GET /v1/capabilities` 的 `webSearch` 位的
|
|
808
814
|
* 唯一席位。值**逐字**取自 boot 期真正拿去造后端的那份 `webSearchConfigFromEnv()` 产物
|
|
809
815
|
* (`boot/stage-07-capability-layer.ts`),所以「能力位说 brave、装配里装的是 tavily」结构上不可能。
|
|
810
816
|
* 缺席 = 本部署没有搜索后端(未设 / 拼错 / 装配没喂席位)⇒ 窄投影报 `{backend:"none"}`;
|
|
@@ -812,7 +818,7 @@ export interface ServiceDeploymentDeps {
|
|
|
812
818
|
* ⚠️ 席位只承载**部署默认**:单用户车道上每请求的 `settings.webSearch` 压过它,但那条腿**不经过本席**
|
|
813
819
|
* (它在场景装配里每请求现算),所以本位不会随调用方漂。 */
|
|
814
820
|
webSearchProvider?: import("../plugins/web-search.js").WebSearchProvider;
|
|
815
|
-
/**
|
|
821
|
+
/** [ref]:本进程模型钥匙保管店的**公钥面** —— `GET /v1/capabilities` 的 `sealedKey` 段唯一席位。值**逐字**取自
|
|
816
822
|
* web-admin 运行时(`boot/web-admin.ts` 的 `sealedKeyPublic`,boot 期建的那一只店),路由里不再建店、不读全局。
|
|
817
823
|
* 类型只有最新那把公钥(`sealed-key.ts` `SealedKeyPublicFace`):私钥、保管路径、持有的旧 id 列表从这一层结构上够不着。
|
|
818
824
|
* 缺席 = 本进程没有保管店(boot 建店失败,或不是由 composition root 装起来的测试夹具形)⇒ caps 的 `sealedKey` 键缺席。 */
|
|
@@ -870,7 +876,7 @@ export declare function flattenServiceDeps(deps: ServiceDeps): FlatServiceDeps;
|
|
|
870
876
|
/**
|
|
871
877
|
* Managed-Agents-style HTTP/SSE service surface.
|
|
872
878
|
* GET /health
|
|
873
|
-
* GET /readyz → readiness probe: 200 {ready:true} / 503 {ready:false, reasons} (
|
|
879
|
+
* GET /readyz → readiness probe: 200 {ready:true} / 503 {ready:false, reasons} ([ref]; same predicate
|
|
874
880
|
* as /health.ready, the billable-submit 503s and the fleet heartbeat — http/readiness.ts)
|
|
875
881
|
* POST /v1/tasks → run to completion, TaskResult JSON (synchronous)
|
|
876
882
|
* POST /v1/tasks/stream → SSE of TaskEvent, live tokens (synchronous, same instance)
|
|
@@ -896,7 +902,7 @@ export declare function createHttpServer(rawDeps: ServiceDeps): http.Server & {
|
|
|
896
902
|
/** SSE: replay durable events after Last-Event-ID, then tail until the run is terminal (or stale). */
|
|
897
903
|
/**
|
|
898
904
|
* The differences a concrete log (task_run | image_bake) feeds the ONE resumable SSE reader (P2.8). Everything
|
|
899
|
-
* the reader does — Last-Event-ID/`?from=` resume (every row with seq > from; no eviction answer,
|
|
905
|
+
* the reader does — Last-Event-ID/`?from=` resume (every row with seq > from; no eviction answer, [ref] ①), the per-poll concurrent
|
|
900
906
|
* status+events read, the terminal re-fetch (the terminal event lands in the gap before the status flips), the
|
|
901
907
|
* stale fallback, the 15-min cap, the 15s idle heartbeat — is provider-agnostic and lives in `streamSseLog`.
|
|
902
908
|
* 🔴 The task_run provider MUST keep the existing wire bytes EXACTLY (center's relay + 730+ tests depend on it).
|
package/dist/http/server.js
CHANGED
|
@@ -21,6 +21,7 @@ import { sendError, sendHttpError, sendSessionError, logRequestError } from "./s
|
|
|
21
21
|
import { createRequestGuards } from "./request-guards.js";
|
|
22
22
|
import { sqlEngineSeatIssue } from "../sql-engine-posture.js";
|
|
23
23
|
import { parkDecisionStoreRefusal } from "../orchestration/workflow-park-decision.js";
|
|
24
|
+
import { CHECKPOINT_CTX_SEALING_REQUIRED } from "./checkpoint-ctx.js";
|
|
24
25
|
import { retiredServiceDepsRefusal } from "./retired-service-deps.js";
|
|
25
26
|
import { createAdmission, MAX_SKILL_CONTENT_CHARS, MAX_SYSTEM_PROMPT_CHARS, MAX_OUTPUT_SCHEMA_CHARS, validateUserSkills } from "./admission.js";
|
|
26
27
|
import { createResumeLegs } from "./resume-legs.js";
|
|
@@ -85,6 +86,8 @@ export function createHttpServer(rawDeps) {
|
|
|
85
86
|
if (refusal !== undefined)
|
|
86
87
|
throw new Error(`createHttpServer: ${refusal}`);
|
|
87
88
|
}
|
|
89
|
+
if (deps.checkpointStore !== undefined && deps.checkpointCtxSealing === undefined)
|
|
90
|
+
throw new Error(`createHttpServer: ${CHECKPOINT_CTX_SEALING_REQUIRED}`);
|
|
88
91
|
const idemCache = new IdempotencyCache();
|
|
89
92
|
const inflightRuns = new Map();
|
|
90
93
|
const preemptableRuns = new DrainYieldingPreemptBook(() => deps.drainState?.draining === true);
|
|
@@ -140,9 +143,9 @@ export function createHttpServer(rawDeps) {
|
|
|
140
143
|
}
|
|
141
144
|
};
|
|
142
145
|
}
|
|
143
|
-
const { quotaExceeded, ownerCostQuotaDenied, ownerFleetLeaseDenied, ownerLeaseDenied, ownerQuotaDenied, leaseDenied, usageWindowDenialFor, usageWindowDenied, rateLimited, safeDecode,
|
|
146
|
+
const { quotaExceeded, ownerCostQuotaDenied, ownerFleetLeaseDenied, ownerLeaseDenied, ownerQuotaDenied, leaseDenied, usageWindowDenialFor, usageWindowDenied, rateLimited, safeDecode, runOwnerOk, sessionOwnerOk, runSessionAcceptOk, readJson, readRawBody } = createRequestGuards({ deps });
|
|
144
147
|
const { prepareSpec } = createAdmission({ deps, readJson, runnerFor });
|
|
145
|
-
const { routeCtxBase, resumeCheckpoint, driveResumeIntoRunLog, driveResumeLeg, mayDiscloseRowError, resumePreempted, startFreshHostTurn, resumeWake } = createResumeLegs({ deps, runnerFor, idemCache, inflightRuns, preemptableRuns, steerableRuns, wakeParkMints, counters, readJson, readRawBody, rateLimited, quotaExceeded, ownerQuotaDenied, leaseDenied, ownerLeaseDenied, usageWindowDenied, safeDecode,
|
|
148
|
+
const { routeCtxBase, resumeCheckpoint, driveResumeIntoRunLog, driveResumeLeg, mayDiscloseRowError, resumePreempted, startFreshHostTurn, resumeWake } = createResumeLegs({ deps, runnerFor, idemCache, inflightRuns, preemptableRuns, steerableRuns, wakeParkMints, counters, readJson, readRawBody, rateLimited, quotaExceeded, ownerQuotaDenied, leaseDenied, ownerLeaseDenied, usageWindowDenied, safeDecode, runOwnerOk, sessionOwnerOk, runSessionAcceptOk, prepareSpec, finalizeTaskResult, ownerCostQuotaDenied, ownerFleetLeaseDenied, usageWindowDenialFor });
|
|
146
149
|
const { denyExpiredApprovals, redeemParkedAsk } = createApprovalSweeps({ deps, resumeCheckpoint, mayDiscloseRowError });
|
|
147
150
|
const { handle } = createDispatch({ deps, noteActivity, routeCtxBase, counters });
|
|
148
151
|
const server = http.createServer((req, res) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] × 7.106.0 合并复审 X1(gpt-6 腿 A F1 [high],验证腿 B verified)—— 请求键 `inheritEnv` 的**会话绑定唯一提交点**。
|
|
3
3
|
*
|
|
4
4
|
* ── 分界(与 `device-placement.ts` 的首绑写协议同一句判据)──────────────────────────────────────────────────
|
|
5
5
|
* 凡需要「这条会话此刻归我这条 run」才成立的事,排在 run 认领之后;其余全排在建任何东西之前。`inheritEnv` 的三道判
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* 赢或 wake 新行建成之后)。无 run 店的部署没有认领这回事:调用点落在认领段**之后**的同一位置,等价于「起跑前、一切拒之后」。
|
|
15
15
|
* 写的值 = 受理时那条请求体的键(续跑腿 = 盘上那条体的键);缺席 = 清掉(缺省清洗;理由在 `setSessionInheritEnv` 顶注)。
|
|
16
16
|
*
|
|
17
|
-
* ── 残余(如实,
|
|
17
|
+
* ── 残余(如实,[ref])──────────────────────────────────────────────────────────────────────────────────────
|
|
18
18
|
* 登记簿仍按**会话**键控、host 工厂在 run 起跑那一刻现读(core `ExecutionEnvFactoryContext` 只带 sessionId / taskId,没有 per-run 座)。
|
|
19
19
|
* 有 run 店的部署上认领本身串行化同会话的 run(`task_active` 唯一键),「写 → 读」落在同一条认领窗里;没有 run 店的部署上同会话
|
|
20
20
|
* 并发受理的两条 run 仍是「最后写者赢」。续跑腿在 markResuming 赢之后写,core 的 pre-CAS 守卫(D-1 绑定 / 过期 token)之后才拒的续跑
|
|
21
|
-
* 已写下**那条 park 任务自己**盘上的值(不是别的请求的),下一条受理的 run 照写覆盖。根治 = core 的 per-run 座(
|
|
21
|
+
* 已写下**那条 park 任务自己**盘上的值(不是别的请求的),下一条受理的 run 照写覆盖。根治 = core 的 per-run 座([ref])。
|
|
22
22
|
* 射程只在单用户 host 部署(`"all"` 的射程门)⇒ 写者恒是同一主人。
|
|
23
23
|
*/
|
|
24
24
|
import type { TaskInheritEnv } from "../request-value-closure.js";
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* ## 为什么注册完还要回看一眼状态
|
|
34
34
|
*
|
|
35
35
|
* 光「订阅未来事件」不够:`'close'` **只发一次**,而四条腿的接线全都排在若干次 await 之后
|
|
36
|
-
* (trace 是 `getRun`,runs 是 subagent probe;sse-log 自
|
|
36
|
+
* (trace 是 `getRun`,runs 是 subagent probe;sse-log 自 [ref] ① 起写头前已无 await,此前是 `retainedFrom`)。客户端
|
|
37
37
|
* 在那段慢查询里断开 ⇒ 两个 close 都在监听器注册**之前**烧完(实测:后装的监听器不会被补发)⇒
|
|
38
38
|
* 清理整条不发生,泵对着死连接轮询到 15 分钟帽。这不是假想:`sse-log.ts` 的 preamble 注里记着的
|
|
39
39
|
* 同一个坑,当时只把 preamble 挪到了接线之后,而接线本身前面还有别的 await。
|
package/dist/http/sse-log.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface SseLogProvider<E extends {
|
|
|
33
33
|
* 一批**非账本**帧(今天唯一的用户 = 审批未决卡的全量对账基准)。
|
|
34
34
|
*
|
|
35
35
|
* 为什么是这里的内部 hook,而不是调用方在 `streamSseLog` **之前**自己写:写头是本 helper 的事,调用方
|
|
36
|
-
* 先调 `sseHeaders` 会被这里重复写头。(
|
|
36
|
+
* 先调 `sseHeaders` 会被这里重复写头。([ref] ① 之前本 helper 在写头之前还有一道 416 判定,那是这条
|
|
37
37
|
* 理由的另一半 —— 判定随「账本不存在局部头部裁剪」一起删了,见 {@link streamSseLog} 头注。)
|
|
38
38
|
*
|
|
39
39
|
* 返回帧**不带 `id:`** —— 它不是账本行,不参与 `Last-Event-ID` 游标(壳的规则:preamble 给的是
|
|
@@ -82,7 +82,7 @@ export declare function collectSsePreamble(preamble: (signal: AbortSignal) => Pr
|
|
|
82
82
|
/** The shared resumable SSE pump (P2.8) — provider supplies the log-specific differences; the liveness/
|
|
83
83
|
* heartbeat/terminal-re-fetch/15-min-cap logic is identical for task_run + image_bake.
|
|
84
84
|
*
|
|
85
|
-
* 🔴
|
|
85
|
+
* 🔴 [ref] ①:**没有「续读点已被淘汰」这一答**。两条日志都**没有局部头部裁剪腿** —— `task_event` 唯一的删除者
|
|
86
86
|
* 是整棵会话树连删(会话删除 / 托管留存,`task_run` 行同批消失 ⇒ 调用方开流前 404),`image_bake_event` 库里一条
|
|
87
87
|
* 删除语句都没有。此前这里按 `retainedFrom > from + 1` 答 416 `limit.retention_evicted`:真淘汰永远走不到它,
|
|
88
88
|
* 唯一走得到的形是「写失败耗掉了号」留下的**头部缺行**(ledger-sink 账本留洞)—— 那一形里什么都没被淘汰,416
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { RunStore } from "../plugins/store-backend.js";
|
|
2
2
|
import type { Logger } from "../observability/logger.js";
|
|
3
3
|
import type { Metrics } from "../observability/metrics.js";
|
|
4
|
-
import { buildCheckpointCtx } from "./checkpoint-ctx.js";
|
|
4
|
+
import { buildCheckpointCtx, type CheckpointCtxSealer, type SealedCheckpointCtx } from "./checkpoint-ctx.js";
|
|
5
5
|
import { type RefusalBody } from "./refusal-body.js";
|
|
6
6
|
/** 写不进的那一种可答复的结局(各腿把它交回自己的出口:同步 / durable 腿直接回,活流腿编码成终帧)。 */
|
|
7
7
|
export interface SubmitCtxRefusal {
|
|
8
|
-
readonly status: 413;
|
|
8
|
+
readonly status: 413 | 409;
|
|
9
9
|
readonly body: RefusalBody;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
@@ -14,10 +14,11 @@ export interface SubmitCtxRefusal {
|
|
|
14
14
|
* 返回 `undefined` = 写进了,腿照常起跑。
|
|
15
15
|
*/
|
|
16
16
|
export declare function persistSubmitCtx(store: {
|
|
17
|
-
putCtx(sessionId: string, ctx:
|
|
17
|
+
putCtx(sessionId: string, ctx: SealedCheckpointCtx): Promise<void>;
|
|
18
18
|
}, deps: {
|
|
19
19
|
readonly logger?: Logger | undefined;
|
|
20
20
|
readonly metrics?: Metrics | undefined;
|
|
21
|
+
readonly checkpointCtxSealing?: CheckpointCtxSealer | undefined;
|
|
21
22
|
}, claim: {
|
|
22
23
|
readonly runStore: RunStore;
|
|
23
24
|
readonly taskId: string;
|
package/dist/http/submit-ctx.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { StoreRowTooLargeError } from "../plugins/sql-errors.js";
|
|
2
2
|
import { releaseClaimedRun } from "./claimed-run.js";
|
|
3
|
-
import { buildCheckpointCtx } from "./checkpoint-ctx.js";
|
|
3
|
+
import { buildCheckpointCtx, CheckpointCtxUnsealableError } from "./checkpoint-ctx.js";
|
|
4
4
|
import { refusalBody } from "./refusal-body.js";
|
|
5
5
|
import { limitFactsUnmeasured } from "../limit-refusal.js";
|
|
6
|
+
function unsealableRefusal(e) {
|
|
7
|
+
return {
|
|
8
|
+
status: 409,
|
|
9
|
+
body: refusalBody({
|
|
10
|
+
errorCode: "conflict.checkpoint_ctx_unsealable",
|
|
11
|
+
message: "this deployment cannot store this task's credentials (MCP / A2A headers or env values, settings.env, settings.webSearch.apiKey, http hook headers, or command hook plugin options) for resuming it: they are kept only sealed, and this server has no sealed-key store — nothing was run; ask whoever operates this deployment to give the service a writable sealed-key directory (<data root>/sealed-key/), or submit the task without those credentials",
|
|
12
|
+
facts: { field: e.field, reason: e.reason },
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
6
16
|
function rowTooLargeRefusal(tooLarge) {
|
|
7
17
|
switch (tooLarge.wall) {
|
|
8
18
|
case "row":
|
|
@@ -19,18 +29,24 @@ function rowTooLargeRefusal(tooLarge) {
|
|
|
19
29
|
}
|
|
20
30
|
export async function persistSubmitCtx(store, deps, claim, sessionId, fields) {
|
|
21
31
|
try {
|
|
22
|
-
await store.putCtx(sessionId, buildCheckpointCtx(fields));
|
|
32
|
+
await store.putCtx(sessionId, buildCheckpointCtx(fields, deps.checkpointCtxSealing, sessionId));
|
|
23
33
|
return undefined;
|
|
24
34
|
}
|
|
25
35
|
catch (err) {
|
|
26
36
|
const tooLarge = err instanceof StoreRowTooLargeError ? err : undefined;
|
|
37
|
+
const unsealable = err instanceof CheckpointCtxUnsealableError ? err : undefined;
|
|
38
|
+
const known = tooLarge ?? unsealable;
|
|
27
39
|
if (claim !== undefined) {
|
|
28
|
-
const why =
|
|
40
|
+
const why = known !== undefined ? known.message : `the run's resume inputs could not be stored: ${err instanceof Error ? err.message : String(err)}`;
|
|
29
41
|
await releaseClaimedRun(claim.runStore, claim.taskId, why, (releaseErr, step) => {
|
|
30
42
|
deps.logger?.warn("submit_ctx_run_release_failed", { taskId: claim.taskId, sessionId, step, err: releaseErr instanceof Error ? releaseErr.message : String(releaseErr) });
|
|
31
43
|
deps.metrics?.inc("submit_ctx_run_release_failed_total", { step });
|
|
32
44
|
});
|
|
33
45
|
}
|
|
46
|
+
if (unsealable !== undefined) {
|
|
47
|
+
deps.logger?.warn("submit_ctx_unsealable", { sessionId, taskId: claim?.taskId, field: unsealable.field, reason: unsealable.reason });
|
|
48
|
+
return unsealableRefusal(unsealable);
|
|
49
|
+
}
|
|
34
50
|
if (tooLarge === undefined)
|
|
35
51
|
throw err;
|
|
36
52
|
deps.logger?.warn("submit_ctx_row_too_large", { sessionId, taskId: claim?.taskId, wall: tooLarge.wall, db: tooLarge.dbMessage });
|
|
@@ -19,6 +19,6 @@ export declare function clampVerifyRounds(v: unknown): number;
|
|
|
19
19
|
/** `undefined` when `body.verify` is not `true` (the caller didn't opt into the gate); otherwise the clamped
|
|
20
20
|
* rounds + (if `maxCostUsd` is a positive number) the same USD→micro-USD cost ceiling the cascade lane uses.
|
|
21
21
|
* Same expression that lived inline at all four verify/resume call sites in http/server.ts (fresh-submit,
|
|
22
|
-
* resumeCheckpoint, resumePreempted, drivePlanReview — named resumePlanReview before
|
|
22
|
+
* resumeCheckpoint, resumePreempted, drivePlanReview — named resumePlanReview before [ref]) — collected here VERBATIM ([ref] R9). */
|
|
23
23
|
export declare function verifyRoundsFromBody(body: Pick<TaskRequestBody, "verify" | "verifyRounds" | "maxCostUsd">): VerifyRoundsSpec | undefined;
|
|
24
24
|
//# sourceMappingURL=verify-rounds.d.ts.map
|