@sema-agent/server 7.147.0 → 7.149.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 +1468 -24
- package/README.md +35 -7
- package/README.zh-CN.md +18 -8
- package/USAGE.md +444 -193
- package/deploy/sema-up/README.md +16 -5
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +20 -4
- package/deploy/sema-up/chart/values.yaml +3 -2
- package/deploy/sema-up/cluster-up.sh +74 -176
- package/deploy/sema-up/kube-up.sh +29 -49
- package/deploy/sema-up/lib/chart-run.sh +23 -0
- package/deploy/sema-up/lib/dataroot.sh +3 -3
- package/deploy/sema-up/lib/health.sh +62 -13
- package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
- package/deploy/sema-up/lib/helm-values-kube.py +35 -0
- package/deploy/sema-up/lib/regcred.py +8 -0
- package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
- package/deploy/sema-up/lib/remote/image-import.sh +6 -0
- package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
- package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
- package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
- package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
- package/deploy/sema-up/lib/render-stack.py +17 -0
- package/deploy/sema-up/lib/shell-text.sh +87 -0
- package/deploy/sema-up/lib/usage-flags.txt +10 -0
- package/deploy/sema-up/lib/usage-head.txt +1 -0
- package/deploy/sema-up/lib/usage-tail.txt +13 -0
- package/deploy/sema-up/preflight.sh +10 -8
- package/deploy/sema-up/sema-up.sh +14 -39
- package/deploy/sema-up/smoke.sh +7 -6
- package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
- package/deploy/sema-up/stack/compose.yaml +13 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +21 -0
- package/dist/adoption/plan.d.ts +24 -0
- package/dist/adoption/plan.js +53 -1
- package/dist/adoption/runner.d.ts +10 -1
- package/dist/adoption/runner.js +36 -16
- package/dist/approval-card.d.ts +36 -38
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-leg-origin.d.ts +33 -0
- package/dist/approval-leg-origin.js +4 -0
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +13 -11
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +15 -7
- package/dist/auth-bridge.d.ts +9 -15
- package/dist/auth-bridge.js +4 -11
- package/dist/auth-keys.d.ts +10 -1
- package/dist/auth-keys.js +8 -0
- package/dist/auto-mode-face.d.ts +10 -7
- package/dist/auto-mode-face.js +7 -4
- package/dist/background-agent-name.d.ts +19 -1
- package/dist/background-agent-name.js +12 -2
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.js +9 -6
- package/dist/bench/s1/arms.js +6 -5
- package/dist/bench/s1/live-deps.js +5 -2
- package/dist/bench/s1/run-firm.js +6 -5
- package/dist/bind-host.d.ts +25 -0
- package/dist/bind-host.js +25 -0
- package/dist/boot/adoption.d.ts +3 -0
- package/dist/boot/adoption.js +1 -0
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/execution-env.d.ts +17 -7
- package/dist/boot/execution-env.js +47 -42
- package/dist/boot/execution-lane.d.ts +6 -4
- package/dist/boot/execution-lane.js +3 -1
- package/dist/boot/exit-boundary.d.ts +2 -2
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +17 -15
- package/dist/boot/memory-consolidation.d.ts +37 -29
- package/dist/boot/memory-consolidation.js +11 -5
- package/dist/boot/org-delivery.d.ts +3 -2
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.js +2 -2
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +19 -16
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +60 -70
- package/dist/boot/retention-lane.d.ts +4 -4
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +14 -5
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +16 -7
- package/dist/boot/session-faces.js +114 -94
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -0
- package/dist/boot/stage-01-config.js +13 -4
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -0
- package/dist/boot/stage-02-web-admin-pull.js +16 -3
- package/dist/boot/stage-03-store-backend.d.ts +4 -0
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -0
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +8 -3
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +12 -13
- package/dist/boot/stage-06-runners.js +23 -15
- package/dist/boot/stage-07-capability-layer.d.ts +13 -9
- package/dist/boot/stage-07-capability-layer.js +5 -3
- package/dist/boot/stage-08-reapers.d.ts +13 -9
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +14 -16
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +14 -16
- package/dist/boot/stage-10-http-server.js +7 -4
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +6 -0
- package/dist/boot/stores.js +41 -27
- package/dist/boot/task-list-lane.d.ts +4 -4
- package/dist/boot/web-admin.d.ts +4 -2
- package/dist/boot/web-admin.js +55 -35
- package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
- package/dist/boot-reclaim.d.ts +3 -1
- package/dist/boot-reclaim.js +1 -1
- package/dist/brain.d.ts +7 -18
- package/dist/brain.js +5 -17
- package/dist/budget.js +6 -6
- package/dist/capabilities/center-plugins.d.ts +7 -1
- package/dist/capabilities/center-plugins.js +32 -10
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +2 -2
- package/dist/capabilities/composite-members.js +2 -2
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +6 -15
- package/dist/capabilities/scenarios.js +11 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +39 -11
- package/dist/capability-facts.js +35 -7
- package/dist/card-settle-stored-scope.d.ts +56 -0
- package/dist/card-settle-stored-scope.js +27 -0
- package/dist/card-void.d.ts +8 -13
- package/dist/card-void.js +2 -7
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +7 -3
- package/dist/config-catalog.d.ts +28 -1
- package/dist/config-catalog.js +95 -85
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +43 -3
- package/dist/config-invariants.js +69 -5
- package/dist/config-lkg.d.ts +23 -1
- package/dist/config-lkg.js +17 -3
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -110
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +62 -21
- package/dist/config.d.ts +14 -21
- package/dist/config.js +141 -64
- package/dist/context-window-notice.d.ts +31 -0
- package/dist/context-window-notice.js +28 -0
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +46 -11
- package/dist/deployment-shape.js +8 -0
- package/dist/egress-redirect.d.ts +25 -7
- package/dist/egress-redirect.js +20 -2
- package/dist/elicitation.d.ts +6 -5
- package/dist/elicitation.js +23 -22
- package/dist/engine-identity.d.ts +28 -0
- package/dist/engine-identity.js +10 -0
- package/dist/entry-problems.d.ts +5 -7
- package/dist/entry-problems.js +1 -1
- package/dist/env-facts.js +2 -1
- package/dist/env-name-allowlist-knobs.d.ts +6 -5
- package/dist/env-name-allowlist-knobs.js +5 -0
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-lane-caps.d.ts +25 -23
- package/dist/execution-lane-caps.js +18 -26
- package/dist/execution-placement.d.ts +58 -18
- package/dist/execution-placement.js +41 -2
- package/dist/field-conflict.d.ts +7 -11
- package/dist/field-conflict.js +3 -3
- package/dist/file-history-capture.d.ts +3 -3
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/fleet-bus.d.ts +21 -3
- package/dist/fleet/fleet-bus.js +35 -25
- package/dist/fleet/fleet-reconciler.js +2 -2
- package/dist/fleet/serving-lease.js +3 -3
- package/dist/fleet-client.js +3 -3
- package/dist/fleet-lease.d.ts +0 -1
- package/dist/fleet-lease.js +4 -5
- package/dist/history-anchor.d.ts +23 -3
- package/dist/history-anchor.js +24 -4
- package/dist/hitl-delivery.d.ts +90 -0
- package/dist/hitl-delivery.js +98 -0
- package/dist/hooks/classic-stations.d.ts +8 -11
- package/dist/hooks/classic-stations.js +0 -7
- package/dist/hooks/command-spawn.d.ts +7 -2
- package/dist/hooks/command-spawn.js +13 -6
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +72 -57
- package/dist/hooks/hook-runner.js +271 -193
- package/dist/host-lsp-manager.d.ts +22 -8
- package/dist/host-lsp-manager.js +4 -1
- package/dist/http/active-run-conflict.d.ts +2 -43
- package/dist/http/active-run-conflict.js +3 -7
- package/dist/http/admission.d.ts +4 -18
- package/dist/http/admission.js +76 -79
- package/dist/http/approval-sweeps.d.ts +3 -3
- package/dist/http/approval-sweeps.js +56 -31
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claimed-run.d.ts +16 -8
- package/dist/http/claimed-run.js +8 -0
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +78 -30
- package/dist/http/durable-run-leg.d.ts +11 -4
- package/dist/http/durable-run-leg.js +45 -21
- package/dist/http/execution-context.d.ts +122 -47
- package/dist/http/execution-context.js +135 -43
- package/dist/http/health-reader.d.ts +36 -0
- package/dist/http/health-reader.js +21 -0
- package/dist/http/health-self-report.d.ts +9 -9
- package/dist/http/health-self-report.js +4 -4
- package/dist/http/idempotency.d.ts +9 -5
- package/dist/http/idempotency.js +4 -4
- package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
- package/dist/http/memory-compliance-failure-reply.js +4 -2
- package/dist/http/memory-face-fault-reply.d.ts +67 -0
- package/dist/http/memory-face-fault-reply.js +71 -0
- package/dist/http/memory-store-refusal-reply.d.ts +1 -1
- package/dist/http/memory-store-refusal-reply.js +3 -0
- package/dist/http/owner-access.d.ts +392 -67
- package/dist/http/owner-access.js +370 -35
- package/dist/http/principal-gate.d.ts +39 -89
- package/dist/http/principal-gate.js +26 -68
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +9 -13
- package/dist/http/request-guards.js +34 -68
- package/dist/http/resume-composition.d.ts +37 -0
- package/dist/http/resume-composition.js +18 -0
- package/dist/http/resume-ctx-read.d.ts +46 -12
- package/dist/http/resume-ctx-read.js +31 -6
- package/dist/http/resume-legs.d.ts +54 -19
- package/dist/http/resume-legs.js +408 -196
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/route-ctx.d.ts +31 -32
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +60 -37
- package/dist/http/routes/admin-config-refresh.js +2 -2
- package/dist/http/routes/admin-drain.js +2 -2
- package/dist/http/routes/admin-memory-optout.js +4 -3
- package/dist/http/routes/adoption.d.ts +3 -0
- package/dist/http/routes/adoption.js +17 -10
- package/dist/http/routes/agents-roster.js +13 -7
- package/dist/http/routes/approvals-assistant.js +73 -67
- package/dist/http/routes/attachments.js +2 -2
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +9 -17
- package/dist/http/routes/capabilities.js +16 -19
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +4 -4
- package/dist/http/routes/diagnostics.d.ts +29 -3
- package/dist/http/routes/diagnostics.js +49 -18
- package/dist/http/routes/engine.js +2 -2
- package/dist/http/routes/fleet.js +5 -3
- package/dist/http/routes/images.js +10 -6
- package/dist/http/routes/leader.d.ts +7 -2
- package/dist/http/routes/leader.js +12 -3
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +7 -15
- package/dist/http/routes/memory-bundle.js +4 -7
- package/dist/http/routes/memory-compliance.js +4 -4
- package/dist/http/routes/memory-consolidation.js +6 -9
- package/dist/http/routes/memory-origin.d.ts +2 -0
- package/dist/http/routes/memory-origin.js +7 -8
- package/dist/http/routes/memory-policy.js +17 -12
- package/dist/http/routes/notify-wake.js +10 -19
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +4 -2
- package/dist/http/routes/principal-inbox.js +5 -4
- package/dist/http/routes/projects.d.ts +1 -1
- package/dist/http/routes/projects.js +3 -2
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +20 -5
- package/dist/http/routes/run-memory-capture.d.ts +2 -2
- package/dist/http/routes/run-memory-capture.js +6 -12
- package/dist/http/routes/run-permission-mode.d.ts +2 -2
- package/dist/http/routes/run-permission-mode.js +10 -17
- package/dist/http/routes/runs.js +155 -237
- package/dist/http/routes/session-memory-sync.d.ts +2 -2
- package/dist/http/routes/session-memory-sync.js +7 -13
- package/dist/http/routes/session-sync.d.ts +28 -7
- package/dist/http/routes/session-sync.js +63 -50
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.js +87 -124
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +237 -187
- package/dist/http/routes/trace-usage.d.ts +0 -12
- package/dist/http/routes/trace-usage.js +40 -46
- package/dist/http/routes/workflows.d.ts +39 -4
- package/dist/http/routes/workflows.js +42 -14
- package/dist/http/run-concurrency-cap.d.ts +20 -12
- package/dist/http/run-concurrency-cap.js +39 -26
- package/dist/http/run-read-face.d.ts +3 -5
- package/dist/http/run-read-face.js +8 -13
- package/dist/http/send.d.ts +12 -3
- package/dist/http/send.js +42 -6
- package/dist/http/server.d.ts +43 -45
- package/dist/http/server.js +61 -11
- package/dist/http/sse-log.d.ts +17 -10
- package/dist/http/sse-log.js +7 -7
- package/dist/http/stored-body-replay.d.ts +12 -0
- package/dist/http/stored-body-replay.js +2 -2
- package/dist/http/submit-ctx.d.ts +17 -8
- package/dist/http/submit-ctx.js +8 -5
- package/dist/http/submit-replay.d.ts +19 -6
- package/dist/http/submit-replay.js +18 -6
- package/dist/http/sync-submit-body.d.ts +3 -4
- package/dist/http/sync-submit-body.js +4 -5
- package/dist/http/wire-types.d.ts +4 -3
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2 -0
- package/dist/key-resolver.d.ts +32 -0
- package/dist/key-resolver.js +23 -9
- package/dist/leader/diffup.js +2 -1
- package/dist/leader/endpoint.d.ts +26 -5
- package/dist/leader/endpoint.js +154 -14
- package/dist/leader/fanout.d.ts +3 -0
- package/dist/leader/fanout.js +78 -63
- package/dist/leader/leader.d.ts +16 -0
- package/dist/leader/leader.js +43 -3
- package/dist/leader/merge.d.ts +9 -1
- package/dist/leader/merge.js +16 -1
- package/dist/leader/repair-wire.js +1 -1
- package/dist/leader/wire.d.ts +36 -3
- package/dist/leader/wire.js +59 -18
- package/dist/leg-facts.d.ts +7 -2
- package/dist/leg-facts.js +1 -0
- package/dist/local-store-declaration.d.ts +54 -0
- package/dist/local-store-declaration.js +59 -0
- package/dist/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/mcp-assertion-header.js +1 -1
- package/dist/memory-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-project-layer.js +1 -1
- package/dist/memory-scope.d.ts +33 -6
- package/dist/memory-scope.js +68 -19
- package/dist/memory-store-refusal.d.ts +5 -2
- package/dist/memory-sync-client.d.ts +3 -2
- package/dist/memory-sync-client.js +8 -5
- package/dist/model-compat.d.ts +17 -8
- package/dist/model-compat.js +6 -2
- package/dist/model-context-window.d.ts +57 -0
- package/dist/model-context-window.js +21 -0
- package/dist/model-entry-headers.d.ts +46 -4
- package/dist/model-entry-headers.js +2 -2
- package/dist/model-entry-refusal.d.ts +40 -20
- package/dist/model-entry-refusal.js +57 -30
- package/dist/model-plane-face.d.ts +19 -11
- package/dist/model-plane-face.js +9 -1
- package/dist/model-plane-probe.d.ts +2 -0
- package/dist/model-plane-probe.js +17 -0
- package/dist/model-provider.d.ts +3 -3
- package/dist/model-reach-scope.d.ts +2 -1
- package/dist/model-route-endpoint.d.ts +9 -5
- package/dist/model-route-endpoint.js +29 -7
- package/dist/model-select.d.ts +16 -0
- package/dist/model-select.js +4 -0
- package/dist/mountinfo.d.ts +37 -0
- package/dist/mountinfo.js +47 -0
- package/dist/namespaced-rule-name.d.ts +23 -14
- package/dist/namespaced-rule-name.js +8 -11
- package/dist/net-address.d.ts +1 -1
- package/dist/observability/corrupt-read-seat.d.ts +4 -4
- package/dist/observability/corrupt-read-seat.js +5 -3
- package/dist/observability/fail-open.d.ts +72 -40
- package/dist/observability/fail-open.js +74 -40
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.js +4 -5
- package/dist/observability/otel-exporter.js +2 -1
- package/dist/observability/principal-context.d.ts +14 -7
- package/dist/observability/principal-context.js +8 -3
- package/dist/observability/run-terminal.d.ts +7 -1
- package/dist/observability/run-terminal.js +6 -2
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/secret-env-scrub.js +1 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
- package/dist/orchestration/hardened-vm-runner.js +11 -5
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
- package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
- package/dist/orchestration/hardened-vm-worker.js +2 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.js +3 -2
- package/dist/org-delivery-gate.d.ts +36 -10
- package/dist/org-delivery-gate.js +12 -8
- package/dist/outbound-dispatcher.d.ts +1 -1
- package/dist/outbound-dispatcher.js +6 -12
- package/dist/owner-brands.d.ts +81 -0
- package/dist/owner-brands.js +42 -0
- package/dist/owner-faces.d.ts +532 -0
- package/dist/owner-faces.js +126 -0
- package/dist/park-row-commit.d.ts +67 -0
- package/dist/park-row-commit.js +76 -0
- package/dist/parked-decide.d.ts +76 -12
- package/dist/parked-decide.js +152 -11
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +7 -9
- package/dist/peer-directory.js +3 -2
- package/dist/permission-rule-vocab.d.ts +53 -8
- package/dist/permission-rule-vocab.js +30 -2
- package/dist/plugins/adoption-log-sql.d.ts +3 -25
- package/dist/plugins/adoption-log-sql.js +23 -21
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
- package/dist/plugins/approval-ask-store-file.d.ts +18 -7
- package/dist/plugins/approval-ask-store-file.js +37 -14
- package/dist/plugins/approval-ask-store-memory.d.ts +12 -4
- package/dist/plugins/approval-ask-store-memory.js +24 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +40 -21
- package/dist/plugins/approval-ask-store-sql.js +44 -15
- package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
- package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
- package/dist/plugins/approval-exemption-skill-m46.d.ts +14 -0
- package/dist/plugins/approval-exemption-skill-m46.js +21 -0
- package/dist/plugins/approval-exemption-store.d.ts +32 -2
- package/dist/plugins/approval-exemption-store.js +42 -19
- package/dist/plugins/approval-nonce-store.d.ts +39 -12
- package/dist/plugins/approval-nonce-store.js +72 -23
- package/dist/plugins/blob-backend.d.ts +2 -0
- package/dist/plugins/blob-backend.js +9 -6
- package/dist/plugins/caching-session-store.d.ts +13 -1
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +32 -5
- package/dist/plugins/checkpoint-index-columns.js +36 -1
- package/dist/plugins/checkpoint-store-face.d.ts +83 -10
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.js +1 -0
- package/dist/plugins/ensure-index.d.ts +13 -1
- package/dist/plugins/ensure-index.js +154 -21
- package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -18
- package/dist/plugins/ensure-schema-lock-policy.js +76 -9
- package/dist/plugins/file-run-store.d.ts +85 -32
- package/dist/plugins/file-run-store.js +177 -94
- package/dist/plugins/host-platform.d.ts +24 -3
- package/dist/plugins/host-platform.js +15 -1
- package/dist/plugins/image-bake-store-sql.js +2 -0
- package/dist/plugins/imported-layer-root-retirement.d.ts +2 -2
- package/dist/plugins/k8s-pod-reaper.d.ts +1 -3
- package/dist/plugins/k8s-pod-reaper.js +0 -1
- package/dist/plugins/leader-run-store-sql.d.ts +22 -0
- package/dist/plugins/leader-run-store-sql.js +34 -4
- package/dist/plugins/local-checkpoint-store.d.ts +62 -23
- package/dist/plugins/local-checkpoint-store.js +197 -77
- package/dist/plugins/local-data-dir-modes-m39.js +2 -1
- package/dist/plugins/local-data-root-admission.d.ts +52 -0
- package/dist/plugins/local-data-root-admission.js +100 -0
- package/dist/plugins/local-docker-capacity.d.ts +93 -0
- package/dist/plugins/local-docker-capacity.js +194 -0
- package/dist/plugins/local-docker-reaper.d.ts +92 -0
- package/dist/plugins/local-docker-reaper.js +102 -0
- package/dist/plugins/local-engine-high-water.d.ts +29 -6
- package/dist/plugins/local-engine-high-water.js +27 -19
- package/dist/plugins/local-session-store.d.ts +458 -140
- package/dist/plugins/local-session-store.js +906 -292
- package/dist/plugins/local-session-window.d.ts +3 -2
- package/dist/plugins/local-session-window.js +3 -2
- package/dist/plugins/local-sidecar-quarantine.js +3 -2
- package/dist/plugins/local-task-attachment-store.d.ts +18 -1
- package/dist/plugins/local-task-attachment-store.js +22 -1
- package/dist/plugins/memory-embedder.js +9 -7
- package/dist/plugins/memory-engine-pg.d.ts +3 -2
- package/dist/plugins/memory-engine-pg.js +14 -5
- package/dist/plugins/memory-engine-sql-apply.d.ts +8 -4
- package/dist/plugins/memory-engine-sql-apply.js +6 -8
- package/dist/plugins/memory-engine-tidb.d.ts +4 -2
- package/dist/plugins/memory-engine-tidb.js +11 -2
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
- package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
- package/dist/plugins/memory-run-store.d.ts +53 -36
- package/dist/plugins/memory-run-store.js +116 -88
- package/dist/plugins/one-time-migration-marker.d.ts +26 -0
- package/dist/plugins/one-time-migration-marker.js +13 -0
- package/dist/plugins/one-time-migrations.d.ts +214 -47
- package/dist/plugins/one-time-migrations.js +481 -135
- package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
- package/dist/plugins/org-delivery-quota-store.js +31 -15
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- package/dist/plugins/permission-rule-store-sql.d.ts +5 -64
- package/dist/plugins/permission-rule-store-sql.js +11 -95
- package/dist/plugins/pg-pool.d.ts +2 -32
- package/dist/plugins/pg-pool.js +24 -17
- package/dist/plugins/remote-env-device.d.ts +3 -2
- package/dist/plugins/remote-env-e2b.d.ts +8 -32
- package/dist/plugins/remote-env-e2b.js +44 -32
- package/dist/plugins/remote-env-host.d.ts +51 -17
- package/dist/plugins/remote-env-host.js +111 -42
- package/dist/plugins/remote-env-k8s.d.ts +40 -45
- package/dist/plugins/remote-env-k8s.js +111 -60
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +352 -72
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/retention-deployment.d.ts +49 -17
- package/dist/plugins/retention-deployment.js +39 -8
- package/dist/plugins/run-preview-m45.d.ts +11 -0
- package/dist/plugins/run-preview-m45.js +19 -0
- package/dist/plugins/run-store-sql.d.ts +82 -75
- package/dist/plugins/run-store-sql.js +164 -125
- package/dist/plugins/s3-answer.d.ts +2 -1
- package/dist/plugins/sandbox-reaper.d.ts +26 -0
- package/dist/plugins/sandbox-reaper.js +2 -0
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +56 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +56 -0
- package/dist/plugins/scheduler-support.d.ts +16 -1
- package/dist/plugins/scheduler-support.js +22 -2
- package/dist/plugins/schema-consistency.d.ts +131 -14
- package/dist/plugins/schema-consistency.js +388 -18
- package/dist/plugins/schema-drift-sentence.d.ts +10 -6
- package/dist/plugins/schema-drift-sentence.js +15 -7
- package/dist/plugins/schema-ensure-legs.d.ts +9 -0
- package/dist/plugins/schema-ensure-legs.js +1 -1
- package/dist/plugins/schema-indexes.js +3 -0
- package/dist/plugins/schema-live-columns.d.ts +14 -5
- package/dist/plugins/schema-live-columns.js +10 -10
- package/dist/plugins/send-user-file.js +2 -1
- package/dist/plugins/session-birth.d.ts +37 -0
- package/dist/plugins/session-birth.js +38 -0
- package/dist/plugins/session-epoch-anchor.d.ts +40 -12
- package/dist/plugins/session-epoch-anchor.js +33 -11
- package/dist/plugins/session-ext-table.d.ts +27 -3
- package/dist/plugins/session-ext-table.js +19 -6
- package/dist/plugins/session-fork.d.ts +15 -1
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +27 -20
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +12 -0
- package/dist/plugins/session-row-sql.js +3 -3
- package/dist/plugins/session-run-rollup.d.ts +29 -0
- package/dist/plugins/session-run-rollup.js +40 -0
- package/dist/plugins/session-store-sql.d.ts +38 -12
- package/dist/plugins/session-store-sql.js +130 -30
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/shared-memory-store-sql.d.ts +0 -69
- package/dist/plugins/shared-memory-store-sql.js +2 -1
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +42 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +9 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/sql-driver.d.ts +1 -1
- package/dist/plugins/sql-driver.js +2 -1
- package/dist/plugins/sql-errors.d.ts +32 -5
- package/dist/plugins/sql-errors.js +55 -7
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/stop-then-start-sentence.d.ts +16 -0
- package/dist/plugins/stop-then-start-sentence.js +7 -0
- package/dist/plugins/store-backend.d.ts +99 -16
- package/dist/plugins/store-backend.js +230 -65
- package/dist/plugins/store-contracts.d.ts +123 -33
- package/dist/plugins/store-contracts.js +38 -1
- package/dist/plugins/store-fault.d.ts +28 -2
- package/dist/plugins/store-fault.js +20 -2
- package/dist/plugins/task-attachment-store.d.ts +15 -3
- package/dist/plugins/task-attachment-store.js +22 -9
- package/dist/plugins/tidb-pool.d.ts +11 -6
- package/dist/plugins/tidb-pool.js +39 -18
- package/dist/plugins/web-search.js +5 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
- package/dist/plugins/workflow-run-store-sql.js +11 -5
- package/dist/plugins/workspace-custody.d.ts +44 -0
- package/dist/plugins/workspace-custody.js +47 -0
- package/dist/principal-jwt.d.ts +4 -4
- package/dist/principal-jwt.js +20 -5
- package/dist/principal-shape.d.ts +41 -0
- package/dist/principal-shape.js +19 -0
- package/dist/project-identity.d.ts +8 -7
- package/dist/project-identity.js +40 -17
- package/dist/project-layer-key.d.ts +13 -2
- package/dist/project-layer-key.js +9 -1
- package/dist/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-deny-floor-notice.d.ts +36 -0
- package/dist/read-deny-floor-notice.js +40 -0
- package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
- package/dist/request-declaration-disposition.js +39 -0
- package/dist/request-declaration-refusal.d.ts +35 -12
- package/dist/request-declaration-refusal.js +21 -9
- package/dist/request-form.d.ts +58 -0
- package/dist/request-form.js +72 -0
- package/dist/request-image-urls.d.ts +8 -2
- package/dist/request-image-urls.js +2 -1
- package/dist/request-images.d.ts +20 -0
- package/dist/request-images.js +59 -0
- package/dist/request-key-closure.d.ts +6 -7
- package/dist/request-key-closure.js +15 -2
- package/dist/resource-suspend.d.ts +7 -16
- package/dist/resource-suspend.js +1 -1
- package/dist/retired-name-host-notice.d.ts +21 -0
- package/dist/retired-name-host-notice.js +12 -0
- package/dist/rule-entry-list.d.ts +2 -2
- package/dist/rule-entry-list.js +3 -4
- package/dist/rule-issue-reading.d.ts +58 -0
- package/dist/rule-issue-reading.js +14 -0
- package/dist/rules-consent.d.ts +5 -3
- package/dist/rules-consent.js +1 -0
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-cancel-card.d.ts +28 -0
- package/dist/run-cancel-card.js +19 -0
- package/dist/run-cancel-context.d.ts +10 -0
- package/dist/run-cancel-context.js +1 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +117 -90
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +56 -21
- package/dist/runs.js +73 -43
- package/dist/runtime-caps-resolver.d.ts +21 -6
- package/dist/runtime-caps-resolver.js +17 -4
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -5
- package/dist/sealed-key-layout.js +5 -0
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +115 -27
- package/dist/security.d.ts +128 -158
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +25 -0
- package/dist/server-secret-env.d.ts +55 -25
- package/dist/server-secret-env.js +75 -22
- package/dist/session-agent.d.ts +3 -2
- package/dist/session-children-retire.d.ts +13 -8
- package/dist/session-children-retire.js +9 -7
- package/dist/session-deletion.d.ts +88 -0
- package/dist/session-deletion.js +8 -0
- package/dist/session-erase.d.ts +145 -0
- package/dist/session-erase.js +115 -0
- package/dist/session-error-wire.d.ts +5 -5
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +52 -5
- package/dist/session-incarnation.js +19 -2
- package/dist/session-policy-wire.d.ts +6 -3
- package/dist/session-policy-wire.js +11 -1
- package/dist/session-resident-background.d.ts +0 -71
- package/dist/session-resident-background.js +4 -3
- package/dist/session-row.d.ts +2 -1
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +3 -3
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-admission.d.ts +33 -0
- package/dist/store-admission.js +49 -0
- package/dist/store-posture.d.ts +141 -20
- package/dist/store-posture.js +205 -3
- package/dist/stored-request-hooks-m20.js +2 -2
- package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
- package/dist/stores-sql/background-agent-store-sql.js +73 -20
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +78 -49
- package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
- package/dist/stores-sql/file-history-store-sql.js +3 -5
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/stores-sql/pg-session-storage.d.ts +7 -5
- package/dist/stores-sql/pg-session-storage.js +54 -46
- package/dist/stores-sql/retention-store-sql.d.ts +87 -19
- package/dist/stores-sql/retention-store-sql.js +92 -27
- package/dist/stores-sql/session-policy-store-sql.d.ts +32 -10
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +12 -6
- package/dist/stores-sql/tidb-session-storage.d.ts +4 -4
- package/dist/stores-sql/tidb-session-storage.js +13 -8
- package/dist/stores-sql/tidb-session-store.d.ts +36 -17
- package/dist/stores-sql/tidb-session-store.js +69 -39
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +4 -6
- package/dist/stores-sql/windowed-session-storage.d.ts +5 -0
- package/dist/stores-sql/windowed-session-storage.js +9 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +3 -8
- package/dist/task-a2a.js +28 -30
- package/dist/task-cwd.d.ts +43 -7
- package/dist/task-cwd.js +11 -0
- package/dist/task-mcp.d.ts +3 -3
- package/dist/task-mcp.js +4 -4
- package/dist/task-settings.d.ts +14 -10
- package/dist/task-settings.js +19 -7
- package/dist/terminal.d.ts +27 -43
- package/dist/terminal.js +49 -14
- package/dist/tool-approval.d.ts +173 -163
- package/dist/tool-approval.js +247 -232
- package/dist/trace/core-keyset-guard.d.ts +13 -6
- package/dist/trace/core-vocab-wire.d.ts +95 -0
- package/dist/trace/core-vocab-wire.js +15 -0
- package/dist/trace/engine-notice-wire.d.ts +24 -21
- package/dist/trace/engine-notice-wire.js +7 -3
- package/dist/trace/exit-seat.d.ts +30 -4
- package/dist/trace/exit-seat.js +40 -36
- package/dist/trace/extension-call-face.d.ts +3 -2
- package/dist/trace/extension-call-face.js +3 -1
- package/dist/trace/ledger-events.d.ts +4 -7
- package/dist/trace/ledger-sink.d.ts +4 -31
- package/dist/trace/ledger-sink.js +0 -11
- package/dist/trace/model-segment.d.ts +5 -5
- package/dist/trace/model-segment.js +5 -5
- package/dist/trace/project.d.ts +59 -44
- package/dist/trace/project.js +60 -26
- package/dist/trace/redact.d.ts +135 -27
- package/dist/trace/redact.js +884 -260
- package/dist/trace/self-minted-wire.d.ts +567 -20
- package/dist/trace/self-minted-wire.js +205 -24
- package/dist/trace/wire-projection-faces.d.ts +5 -6
- package/dist/trace/wire-projection-faces.js +2 -2
- package/dist/upstream-body.d.ts +23 -0
- package/dist/upstream-body.js +16 -0
- package/dist/url-refusal.d.ts +3 -3
- package/dist/url-refusal.js +11 -4
- package/dist/user-authored-text.d.ts +1 -1
- package/dist/user-input-ledger.d.ts +7 -8
- package/dist/user-input-ledger.js +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +6 -3
- package/dist/web-admin-client/apply-effective.js +33 -23
- package/dist/web-admin-client/apply-ledger.d.ts +16 -7
- package/dist/web-admin-client/apply-ledger.js +5 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/center-request.js +15 -15
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -1
- package/dist/web-admin-client/entry-metadata.d.ts +8 -0
- package/dist/web-admin-client/entry-metadata.js +13 -0
- package/dist/web-admin-client/http-client.d.ts +1 -1
- package/dist/web-admin-client/http-client.js +23 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/mcp-revocation.js +2 -1
- package/dist/web-admin-client/read-warnings.d.ts +1 -0
- package/dist/web-admin-client/read-warnings.js +1 -0
- package/dist/web-admin-client/restart-signal.js +8 -4
- package/dist/web-admin-client/skills-mcp.d.ts +2 -2
- package/dist/web-admin-client/types.d.ts +1 -2
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/docs/error-text-lexicon.json +317 -0
- package/package.json +8 -3
- package/scripts/drain-check-local.mjs +118 -147
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/scripts/embed-minimal.mjs +183 -0
- package/wire-changes/server@7.148.0.json +1517 -0
- package/wire-changes/server@7.149.0.json +372 -0
- package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
- package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
- package/dist/http/memory-layer-reply.d.ts +0 -30
- package/dist/http/memory-layer-reply.js +0 -24
- package/dist/lsp/e2b-bridge.d.ts +0 -57
- package/dist/lsp/e2b-bridge.js +0 -139
- package/dist/lsp/e2b-manager.d.ts +0 -93
- package/dist/lsp/e2b-manager.js +0 -178
- package/dist/lsp/lsp-frames.d.ts +0 -14
- package/dist/lsp/lsp-frames.js +0 -25
- package/dist/lsp/manager.d.ts +0 -129
- package/dist/lsp/manager.js +0 -127
- package/dist/lsp/types.d.ts +0 -12
- package/dist/lsp/types.js +0 -2
- package/dist/lsp/ws-transport.d.ts +0 -40
- package/dist/lsp/ws-transport.js +0 -210
- package/dist/plain-string-record.js +0 -70
|
@@ -55,6 +55,8 @@ export type ConsolidationSeatBilling = {
|
|
|
55
55
|
readonly kind: "unresolvable";
|
|
56
56
|
readonly fault: string;
|
|
57
57
|
};
|
|
58
|
+
/** 整理席解座的输入 = core 解析器的输入(凭据席除外 —— 由本函数按冻结的钥匙表铸)+ 部署的两张 per-model 钥匙表(与 `models` 同一代,同一刻读)。 */
|
|
59
|
+
export type ConsolidationSeatDeps = Omit<MemoryConsolidationDriverDeps, "getApiKeyAndHeaders"> & Pick<ServiceConfig, "modelApiKeyEnv" | "modelApiKeys">;
|
|
58
60
|
/** 座解析的产物:core 的 options 原样 + 给投影用的两位自证。 */
|
|
59
61
|
export interface ConsolidationDriverSeat {
|
|
60
62
|
/** `runMemoryConsolidationDriver` 第三参的**模型席那一半**,core 的 `resolveMemoryConsolidationDriver` 原样产出(写判官另由操作面的座给)。 */
|
|
@@ -81,7 +83,7 @@ export interface ConsolidationDriverSeat {
|
|
|
81
83
|
* 体内的注 —— 那里才是它真正生效的地方,写在这里会随实现漂。
|
|
82
84
|
* (探针只构造闭包、不发任何请求、无副作用。)
|
|
83
85
|
*/
|
|
84
|
-
export declare function resolveConsolidationDriverSeat(
|
|
86
|
+
export declare function resolveConsolidationDriverSeat(input: ConsolidationSeatDeps): ConsolidationDriverSeat;
|
|
85
87
|
/**
|
|
86
88
|
* [ref] 波 0([ref] §3)—— 整理驱动席的 **restart 读数**。过渡件:**波 1 转热后删**(那时每轮 run 起手
|
|
87
89
|
* 现取当前代的席,不再有 boot 烤死的席,这只表也就没有要比的东西了)。
|
|
@@ -117,6 +119,8 @@ export interface ConsolidationSeatWatch {
|
|
|
117
119
|
}
|
|
118
120
|
/** 解席的输入面 = boot 期真席用的同三件(活引用:refresh 就地换代,`read()` 每次现取)。 */
|
|
119
121
|
export type ConsolidationSeatPlane = Pick<MemoryConsolidationDriverDeps, "models" | "tiers" | "roles">;
|
|
122
|
+
/** 重启读数的输入面 = 解席三件 + 座随之冻结的两张钥匙表(座位指纹带凭据身份)。 */
|
|
123
|
+
export type ConsolidationSeatWeldPlane = ConsolidationSeatPlane & Pick<ServiceConfig, "modelApiKeyEnv" | "modelApiKeys">;
|
|
120
124
|
/**
|
|
121
125
|
* **每 scope 单飞**(codex 交叉复审 [high],验真后修)—— 同一 scope 上在飞的那一轮被后来者**并入**,
|
|
122
126
|
* 而不是各起一轮。`create*`:返回带状态的活对象。
|
|
@@ -258,7 +262,7 @@ export declare function resolveConsolidationValve(input: {
|
|
|
258
262
|
export declare function createConsolidationValveWatch(input: {
|
|
259
263
|
driver: MemoryConsolidationDriverConfig;
|
|
260
264
|
unwirable: Parameters<typeof resolveConsolidationValve>[0]["unwirable"];
|
|
261
|
-
plane: () =>
|
|
265
|
+
plane: () => ConsolidationSeatWeldPlane;
|
|
262
266
|
}): ConsolidationSeatWatch | undefined;
|
|
263
267
|
/**
|
|
264
268
|
* 阀门的**装配点**(车PI 修复轮 ⑦(a)(e):boot 第 4 段调它,测试调同一只 —— 不在测试里手抄接线)。`create*`:产出带行为的 watch。
|
|
@@ -279,7 +283,7 @@ export declare function createConsolidationValve(input: ConsolidationValveInput
|
|
|
279
283
|
};
|
|
280
284
|
/** 阀门判决的两件输入(装配点与纯判共用一只形 —— 两个入口递的是同一组事实)。 */
|
|
281
285
|
export interface ConsolidationValveInput {
|
|
282
|
-
readonly config: Pick<ServiceConfig, "memoryConsolidationDriver" | "memoryEngineBackend" | "memoryProvenance" | "compliancePosture" | "models" | "tiers" | "roles">;
|
|
286
|
+
readonly config: Pick<ServiceConfig, "memoryConsolidationDriver" | "memoryEngineBackend" | "memoryProvenance" | "compliancePosture" | "models" | "tiers" | "roles" | "modelApiKeyEnv" | "modelApiKeys">;
|
|
283
287
|
/** 只读两件:在不在(记忆引擎接没接线)、整理状态随不随后端走(引擎的 `memoryGovernanceDurability` 答)。 */
|
|
284
288
|
readonly memoryEngine: {
|
|
285
289
|
readonly backend: MemoryBackend;
|
|
@@ -403,35 +407,37 @@ export declare function assertAutoConsolidationWirable(input: {
|
|
|
403
407
|
* 「这条路径能不能写」在引擎里只有**一只**判官(合成写判官:技能拒行 / 收窄折叠 / 调用方与继承策略 / 人的持久规则车道 / 组织车道,一条走法一个优先序)。
|
|
404
408
|
* 引擎的自动整理腿(有腿:名册上的 `Write` 脸、引擎盖的豁免根、人的持久规则读者)与本腿(运维手动阀门:没有腿)用的是**同一个构造器** ——
|
|
405
409
|
* 同样的行给同样的答案,本仓不手搭第二只({@link createOperatorValveWriteJudge} 恰一处调用它,见 `test/memory-consolidation-write-judge.test.ts` ⑥)。
|
|
410
|
+
* 判官**按次铸**:每一次真跑(单飞里起跑的那一次,并入的等待者不另铸)现铸一只,所以人读的是发起这一轮的那位。
|
|
406
411
|
*
|
|
407
|
-
* ##
|
|
412
|
+
* ## 本仓供的部署事实(其余键一律缺席,缺席的语义见引擎:那一层不存在)
|
|
408
413
|
*
|
|
409
414
|
* · `ruleStoreProvider` = 部署唯一的那只合成规则店(`RunnerDeps.permissionRuleStore` 的同一个变量,装配第 4 段铸一次)。规则店没装配 ⇒ 缺席 ⇒ 没有规则层。
|
|
415
|
+
* · 人(`principal` / `localOwnerDeclared`)= **发起这一轮的调用方**:带主体 ⇒ 读那个主体的桶;不带主体 ⇒ 读本机属主的桶,当且仅当部署声明了它
|
|
416
|
+
* (`localOwnerDeclared` = Runner 下发的 `localOwnerRules` 同一只判据 `localOwnerRulesDeclared` 的答案;多租形不声明 ⇒ 匿名地板,而多租形的阀门口本来就要主体)。
|
|
417
|
+
* 整理 run 按 scope 单飞、可续跑:并入正在跑的那一轮的调用方用起跑者的判官(它们拿到的是同一份收执);续跑一条 pending run 的那一次,发起者就是这一次的调用方。
|
|
410
418
|
* · `anchors.home` = `executionLaneHomeDir(config)` —— `~/` 行的基,与引擎执行环境的 `homeDir` 座、下单 422 门、规则基 `taskHome` 是**同一只函数**
|
|
411
419
|
* (车道没有自己的 home 时诚实缺席;缺席 ⇒ 引擎读到人持有的 `~/` 收紧行时无处锚定 = 按异议处置,拒闭)。**刻意不另调 `os.homedir()`**:
|
|
412
|
-
* 那会在非 host 车道上造出第二个读法 ——
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* ## 刻意缺席的键(披露,不是遗漏)—— 三层没喂,所以这条腿仍是**响亮的放行座**(P-DEBT,见 {@link createOperatorValveWriteJudge})
|
|
416
|
-
*
|
|
417
|
-
* · `principal` / `localOwnerDeclared`(人的持久规则层):阀门是 operator 面的一次调用,本仓没有一个能回答「这个库属于谁」的来源 ——
|
|
418
|
-
* 单用户 + file 后端(阀门结构上能起的唯一形,见 {@link assertConsolidationDriverWirable})里记忆是部署级全局层 / 任务根散列的项目层,principal 标签从不分盘,
|
|
419
|
-
* 本仓也从不声明 `localOwnerRules`;整理 run 又是按 scope 单飞、可续跑的持久作业,「谁的规则」对并入 / 续跑的调用方没有定义。
|
|
420
|
-
* · `callerPolicy`(部署的调用方策略层):`APPROVAL_REQUIRE` / `APPROVAL_DENY` / `AUTONOMY` / 敏感路径守卫集是**每任务现合成**的(`deployment-governance.ts`,
|
|
421
|
-
* 读热可改的活配置,「禁 memoize」),没有部署级单例;boot 期铸一份喂进来就是冻结一份会过期的策略(收紧不生效 = 静默放行)。喂它需要一份设计:取哪几层、
|
|
422
|
-
* 活配置怎么读、审批席取什么形;其中敏感路径层还要引擎的豁免根(`RunnerDeps.memoryEngineDir` 盖在每个请求上),而宿主构造器的输入没有这一位 —— 要向 core 请托,
|
|
423
|
-
* 不在本层造第二条豁免根的读法。
|
|
424
|
-
* · `anchors.root`:阀门按 scope 跑,手里没有项目根 —— 项目层 scope 键是任务根的单向散列(`project-identity.ts` 的 `repo:<sha256[:24]>`),反推不出根;
|
|
425
|
-
* 全局层根本没有根。⇒ 人持有的相对 deny / ask 行无处锚定 = 异议,拒闭(引擎契约:判官不猜一行原本指向哪里)。
|
|
420
|
+
* 那会在非 host 车道上造出第二个读法 —— 阀门答「可解析」而腿内答「读不出」。
|
|
421
|
+
*
|
|
422
|
+
* ## 刻意缺席的键(披露,不是遗漏)—— 这两样没喂,所以这条腿仍记一笔债(P-DEBT,见 {@link createOperatorValveWriteJudge})
|
|
426
423
|
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
424
|
+
* · `callerPolicy`(部署的调用方策略层):腿上它是任务的整条部署治理链(审批名单 + 敏感路径守卫与誊本门 + 命令策略,经 `createDeploymentGovernanceInputs` /
|
|
425
|
+
* `createApprovalBaselinePolicy` / `applyRuntimeGovernance` 同一组构造口铸)。只喂其中一层(例如只喂审批名单)= 这条腿上半条治理链 —— 构造口的每个消费者都要挂
|
|
426
|
+
* 部署旋钮矩阵的一条腿、背齐全部旋钮(`test/operator-knob-client-posture-matrix.test.ts` 的消费腿对账),半条链背不齐。整条链喂进来又卡在敏感路径守卫:
|
|
427
|
+
* 腿上的守卫靠引擎盖在每个请求上的豁免根(`RunnerDeps.memoryEngineDir`)放过记忆库自己的写,宿主构造器的输入没有这一位 —— 不带豁免根喂进去会把库里的写当守卫目标拒掉
|
|
428
|
+
* (与腿不同答);在本层另造一条豁免根的读法是第二个写者。⇒ 等引擎的宿主输入收这一位,再整条喂、挂矩阵腿。
|
|
429
|
+
* · `anchors.root`:阀门按 scope 跑,手里没有项目根 —— 项目层 scope 键是任务根的单向散列(`project-identity.ts` 的 `repo:<sha256[:24]>`),反推不出根;
|
|
430
|
+
* 全局层根本没有根。⇒ 人持有的相对 deny / ask 行无处锚定 = 异议,拒闭(引擎契约:判官不猜一行原本指向哪里)。这一格没有来源,永久缺席。
|
|
429
431
|
*
|
|
430
432
|
* 自动整理腿不受影响:它走引擎腿自己的判官,人的持久规则与部署策略照判。
|
|
431
433
|
*/
|
|
432
434
|
export declare function createOperatorValveJudgeInput(facts: {
|
|
433
435
|
/** 部署唯一的合成规则店(装配第 4 段铸一次,`RunnerDeps.permissionRuleStore` 与本座读同一只)。缺席 = 规则店没装配。 */
|
|
434
436
|
readonly ruleStoreProvider: PermissionRuleStoreProvider | undefined;
|
|
437
|
+
/** 部署是否声明本机属主的规则桶(`boot/runner-deps.ts` 的 `localOwnerRulesDeclared` —— Runner 下发 `localOwnerRules` 的同一只判据)。 */
|
|
438
|
+
readonly localOwnerDeclared: boolean;
|
|
439
|
+
/** 发起这一轮的调用方(阀门口的已验主体;不带主体 = `undefined`)。 */
|
|
440
|
+
readonly initiator: string | undefined;
|
|
435
441
|
/** 只读 `executionLaneHomeDir` 读的两位(`ServiceConfig` 结构满足)。 */
|
|
436
442
|
readonly config: LaneHomeDeployment;
|
|
437
443
|
}): ConsolidationWriteJudgeInput;
|
|
@@ -439,10 +445,10 @@ export declare function createOperatorValveJudgeInput(facts: {
|
|
|
439
445
|
* 运维阀门腿的写判官座:引擎的判官构造器喂 {@link createOperatorValveJudgeInput},**外加一个响亮的债计数**(P-DEBT)。
|
|
440
446
|
*
|
|
441
447
|
* 构造器只有引擎那一只,本函数不判任何东西:`judge(target)` 的答案原样返回。它只在每次被问时记一次
|
|
442
|
-
* `server.memory-consolidation.operator-valve-layers-unfed`(计数 + 探针行 + 一次性告警)——
|
|
443
|
-
* ({@link createOperatorValveJudgeInput} 头注)
|
|
444
|
-
* (
|
|
445
|
-
*
|
|
448
|
+
* `server.memory-consolidation.operator-valve-layers-unfed`(计数 + 探针行 + 一次性告警)—— 人已喂;没喂的是部署的调用方策略层
|
|
449
|
+
* (整条治理链等引擎的宿主输入收豁免根)与项目根(没有来源)({@link createOperatorValveJudgeInput} 头注)。放行的最坏后果:运维手动整理时,
|
|
450
|
+
* 部署的写策略(例如 `APPROVAL_DENY=Write`、点名记忆库路径的敏感路径守卫)拦不住这一轮折叠;人的 deny 行拦得住,人持有的相对行照旧拒闭。
|
|
451
|
+
* 自动整理腿不受影响,走引擎腿自己的判官。收口 = 引擎的宿主输入收豁免根、整条部署治理链喂上并挂矩阵腿那一版,本 tag 删(项目根改写成永久缺席的披露)。
|
|
446
452
|
*/
|
|
447
453
|
export declare function createOperatorValveWriteJudge(facts: Parameters<typeof createOperatorValveJudgeInput>[0]): ConsolidationWriteJudge;
|
|
448
454
|
/** 两个 admin 口消费的窄能力面(`ServiceDeps.memoryConsolidation` 的实参来源)。 */
|
|
@@ -454,8 +460,9 @@ export interface MemoryConsolidationFaces {
|
|
|
454
460
|
/** 配置表的 scope(`MEMORY_CONSOLIDATION_SCOPES`)。恰好一条时是两个口的**唯一**缺省。 */
|
|
455
461
|
readonly scopes: readonly string[];
|
|
456
462
|
/** 跑(或**续跑**)一轮。core 的 run 行是持久的:同一 scope 上有 pending run 时本调用 CONTINUE 它
|
|
457
|
-
* (同一 plan 缓存、同一 force requestId、零新 mint)—— 所以这一口对**重试安全**。
|
|
458
|
-
|
|
463
|
+
* (同一 plan 缓存、同一 force requestId、零新 mint)—— 所以这一口对**重试安全**。
|
|
464
|
+
* `initiator` = 发起这一次的调用方(已验主体;不带主体 = `undefined`):写判官按它读人的规则桶;并入正在跑的那一轮的调用方用起跑者的判官。 */
|
|
465
|
+
run(scope: string, initiator: string | undefined): Promise<ConsolidationRunReceipt>;
|
|
459
466
|
/** 该 scope 最近一次 driver run 的账(`undefined` = 从没跑过 —— 诚实缺席,不编一个空壳)。core 7.63.0([ref])起经引擎的治理店座读、异步。 */
|
|
460
467
|
lastRun(scope: string): Promise<ConsolidationDriverRunRow | undefined>;
|
|
461
468
|
}
|
|
@@ -496,9 +503,10 @@ export declare function createMemoryConsolidationFaces(stores: MemoryScopeStores
|
|
|
496
503
|
/** 停因自由文本的**运维日志**座(缺席 = 没人听,不影响任何行为)。载荷由 {@link buildStopDetailAudit}
|
|
497
504
|
* 铸,调用点在单飞回调**之内** ⇒ 一轮真 run 一行,并入的等待者不各落一行。 */
|
|
498
505
|
onStopDetail?: (audit: ReturnType<typeof buildStopDetailAudit>) => void;
|
|
499
|
-
/** core 7.50.0:整理跑的**写判官座**(必填 —— 缺席不是「没有规则」,core 也拒)
|
|
500
|
-
* 早问库目录一次、应用时问每个产物文件,答 `no_objection`
|
|
501
|
-
|
|
506
|
+
/** core 7.50.0:整理跑的**写判官座**(必填 —— 缺席不是「没有规则」,core 也拒),按发起者铸:每一次真跑(单飞里起跑的那一次)调一次,
|
|
507
|
+
* 拿到的判官原样递给驱动动词 —— 早问库目录一次、应用时问每个产物文件,答 `no_objection` 以外一律拒写。操作面不判任何东西。
|
|
508
|
+
* 装配层给哪一只见 {@link createOperatorValveWriteJudge}。 */
|
|
509
|
+
writeJudgeFor: (initiator: string | undefined) => ConsolidationWriteJudge;
|
|
502
510
|
/** 引擎通告的**运维行**座(与 Runner 的 `onNotice` 同一只转发器)。缺席 ⇒ 通告只在回执上。判官拒的两种时机都经它走一次:
|
|
503
511
|
* 应用时拒 = 引擎在驱动里铸的 `memory.consolidation_incomplete`;早问拒 = 驱动抛出的拒绝经引擎导出的投递口(`deliverWriteRefusal`)转成的
|
|
504
512
|
* `memory.consolidation_refused`(本仓不读通告名、不自铸通告形)。 */
|
|
@@ -7,7 +7,11 @@ import { captureRecordStoreOf } from "../memory-operator-faces.js";
|
|
|
7
7
|
import { memoryStoreForRequest } from "../memory-scope-stores.js";
|
|
8
8
|
import { createConsolidationWriteJudge, deliverWriteRefusal, expandTiers, MemoryEngine, memoryGovernanceDurability, modelOriginOf, resolveComplianceDenies, resolveMemoryConsolidationDriver, runMemoryConsolidationDriver, } from "@sema-agent/core";
|
|
9
9
|
import { seatText } from "../trace/exit-seat.js";
|
|
10
|
-
|
|
10
|
+
import { createKeyResolver, credentialIdentityFingerprint, credentialIdentityOf } from "../key-resolver.js";
|
|
11
|
+
export function resolveConsolidationDriverSeat(input) {
|
|
12
|
+
const { modelApiKeyEnv, modelApiKeys, ...seatDeps } = input;
|
|
13
|
+
const frozenKeys = createKeyResolver({ ...modelApiKeyEnv }, process.env, { ...modelApiKeys });
|
|
14
|
+
const deps = { ...seatDeps, ...(frozenKeys !== undefined ? { getApiKeyAndHeaders: frozenKeys } : {}) };
|
|
11
15
|
let options;
|
|
12
16
|
try {
|
|
13
17
|
options = resolveMemoryConsolidationDriver(deps);
|
|
@@ -57,7 +61,7 @@ function consolidationSeatFingerprint(plane) {
|
|
|
57
61
|
if ("unresolvable" in seat)
|
|
58
62
|
return seat;
|
|
59
63
|
const { cost: _cost, ...route } = seat.entry;
|
|
60
|
-
return route;
|
|
64
|
+
return { ...route, credential: credentialIdentityFingerprint(credentialIdentityOf(plane, seat.entry.name)) };
|
|
61
65
|
}
|
|
62
66
|
function seatLabel(deps) {
|
|
63
67
|
if (deps.memoryConsolidationDriver?.chat !== undefined)
|
|
@@ -195,7 +199,7 @@ export function createConsolidationValve(input) {
|
|
|
195
199
|
if (valve.notice !== undefined)
|
|
196
200
|
logger.warn(valve.notice.tag, { detail: valve.notice.detail });
|
|
197
201
|
assertConsolidationDriverWirable({ ...wiring, enabled: valve.enabled });
|
|
198
|
-
const plane = () => ({ models: config.models, tiers: config.tiers, roles: config.roles });
|
|
202
|
+
const plane = () => ({ models: config.models, tiers: config.tiers, roles: config.roles, modelApiKeyEnv: config.modelApiKeyEnv, modelApiKeys: config.modelApiKeys });
|
|
199
203
|
return { valve, watch: createConsolidationValveWatch({ driver: config.memoryConsolidationDriver, unwirable, plane }) };
|
|
200
204
|
}
|
|
201
205
|
export function judgeConsolidationValve(input) {
|
|
@@ -322,6 +326,8 @@ export function createOperatorValveJudgeInput(facts) {
|
|
|
322
326
|
const home = executionLaneHomeDir(facts.config);
|
|
323
327
|
return {
|
|
324
328
|
...(facts.ruleStoreProvider !== undefined ? { ruleStoreProvider: facts.ruleStoreProvider } : {}),
|
|
329
|
+
...(facts.initiator !== undefined && facts.initiator !== "" ? { principal: facts.initiator } : {}),
|
|
330
|
+
...(facts.localOwnerDeclared ? { localOwnerDeclared: true } : {}),
|
|
325
331
|
anchors: home !== undefined ? { home } : {},
|
|
326
332
|
};
|
|
327
333
|
}
|
|
@@ -356,10 +362,10 @@ export function createMemoryConsolidationFaces(stores, input) {
|
|
|
356
362
|
seat: input.seat.seat,
|
|
357
363
|
model: input.seat.model,
|
|
358
364
|
scopes: input.scopes,
|
|
359
|
-
run: (scope) => flight(scope, async () => {
|
|
365
|
+
run: (scope, initiator) => flight(scope, async () => {
|
|
360
366
|
const receipt = await runMemoryConsolidationDriver(engineOf(scope), scope, {
|
|
361
367
|
...input.seat.options,
|
|
362
|
-
writeJudge: input.
|
|
368
|
+
writeJudge: input.writeJudgeFor(initiator),
|
|
363
369
|
compliance: { ...(input.postureOf !== undefined ? { postureOf: input.postureOf } : {}), scopeContract: memoryScopeContractOf([scope]) },
|
|
364
370
|
...(input.onNotice !== undefined ? { onNotice: input.onNotice } : {}),
|
|
365
371
|
}).catch((err) => {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* 消费方取自**同一个** `RunnerDeps` 对象(`principalInboxConsumerOf(runnerDeps)`),不从 config 再读一遍(core 契约原句:
|
|
10
10
|
* 「over the same RunnerDeps the deployment runs its legs with」)。
|
|
11
11
|
*/
|
|
12
|
-
import { type MailboxStore, type
|
|
12
|
+
import { type MailboxStore, type RunnerDeps } from "@sema-agent/core";
|
|
13
|
+
import { type ServerOrgDeliveryGate } from "../org-delivery-gate.js";
|
|
13
14
|
import type { OrgMemoryDirectory } from "../org-memory-admission.js";
|
|
14
15
|
import type { StoreBackend } from "../plugins/store-backend.js";
|
|
15
16
|
import type { Logger } from "../observability/logger.js";
|
|
@@ -24,5 +25,5 @@ export interface OrgDeliveryMountInput {
|
|
|
24
25
|
readonly logger: Pick<Logger, "info">;
|
|
25
26
|
}
|
|
26
27
|
/** 门在座 ⇒ 门;部署没声明消费方 ⇒ `undefined`;声明了而前提缺 ⇒ 抛(拒启)。 */
|
|
27
|
-
export declare function mountOrgDeliveryGate(input: OrgDeliveryMountInput):
|
|
28
|
+
export declare function mountOrgDeliveryGate(input: OrgDeliveryMountInput): ServerOrgDeliveryGate | undefined;
|
|
28
29
|
//# sourceMappingURL=org-delivery.d.ts.map
|
package/dist/boot/org-memory.js
CHANGED
|
@@ -28,7 +28,7 @@ export function createOrgMemoryAdmissionWiring(opts) {
|
|
|
28
28
|
const directory = centerLeg !== undefined
|
|
29
29
|
? (() => {
|
|
30
30
|
const directoryNow = createIdentityBins(centerLeg.credential, (credential) => createOrgMemoryDirectory({
|
|
31
|
-
fetchSection: (principal) => fetchPrincipalOrgMemory({ baseUrl: centerLeg.baseUrl, credential }, principal,
|
|
31
|
+
fetchSection: (principal) => fetchPrincipalOrgMemory({ baseUrl: centerLeg.baseUrl, credential }, principal, undefined, centerLeg.worker),
|
|
32
32
|
grantTtlMs: config.memoryOrgGrantTtlMs,
|
|
33
33
|
unavailableBackoffMs: config.memoryOrgUnavailableBackoffMs,
|
|
34
34
|
logger,
|
|
@@ -7,7 +7,7 @@ import { applyRuntimeGovernance } from "../runtime-governance.js";
|
|
|
7
7
|
import { DeferredSandboxPathEnv, sandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
|
|
8
8
|
import { DEPLOYMENT_SHAPE_PREDICATES } from "../deployment-shape.js";
|
|
9
9
|
import { executionLaneHomeDir } from "../execution-lane-caps.js";
|
|
10
|
-
import {
|
|
10
|
+
import { createSessionExemptionRead } from "../approval.js";
|
|
11
11
|
import { seatText } from "../trace/exit-seat.js";
|
|
12
12
|
function hostGateCwd(config, localRoot) {
|
|
13
13
|
return join(config.localDataRoot ?? localRoot, "parked-revive-unrooted");
|
|
@@ -33,7 +33,7 @@ export function createParkedReviveInheritedGate(deps) {
|
|
|
33
33
|
const baseline = createApprovalBaselinePolicy(config, {
|
|
34
34
|
kind: "durable",
|
|
35
35
|
question,
|
|
36
|
-
...(approvalExemptionStore !== undefined && rootSessionId ? { exemption:
|
|
36
|
+
...(approvalExemptionStore !== undefined && rootSessionId ? { exemption: createSessionExemptionRead(approvalExemptionStore, rootSessionId, logger, "deployment_list", "parked_revive") } : {}),
|
|
37
37
|
});
|
|
38
38
|
const governed = applyRuntimeGovernance({ objective: "", toolPolicy: baseline }, createDeploymentGovernanceInputs(config, pathAdjudication));
|
|
39
39
|
return {
|
package/dist/boot/reapers.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import type { ApprovalNonceStore, CheckpointStoreFull, CostQuotaStore, ImageBake
|
|
|
26
26
|
import { type StoreSweep, type StoreSweepLeg } from "../plugins/store-sweep.js";
|
|
27
27
|
import type { ToolApprovalCoordinator } from "../tool-approval.js";
|
|
28
28
|
import type { ParkCommitWatch } from "../plugins/park-commit-watch.js";
|
|
29
|
-
import { type
|
|
29
|
+
import { type SandboxReaper } from "../plugins/sandbox-reaper.js";
|
|
30
30
|
import { type AuditRotationPort } from "../approval-ask-retention.js";
|
|
31
31
|
/** [ref] / [ref]§五(sema-comms `audits/failopen-governance-176.md` §7 "Z 类 1 条"):default consecutive-failure
|
|
32
32
|
* count before a reaper leg's swallowed error gets a `warn` line. The ~15 `.catch(() => undefined)` sites
|
|
@@ -122,8 +122,9 @@ export interface ReapersCtx {
|
|
|
122
122
|
approvalAskAudit: AuditRotationPort | undefined;
|
|
123
123
|
/** 晚绑(server 造出来才有)——见文件头「位置即契约」①。 */
|
|
124
124
|
getRunDenySweep: () => ((now: number) => Promise<void>) | undefined;
|
|
125
|
-
/**
|
|
126
|
-
|
|
125
|
+
/** 本车道的沙箱回收座(`plugins/sandbox-reaper.ts`;第 5 段与 run 工厂同一份车道配置铸):k8s 车道 = 沙箱 Pod reaper(`plugins/k8s-pod-reaper.ts`),local-docker 车道 = 无主容器 reaper
|
|
126
|
+
* (`plugins/local-docker-reaper.ts`)。缺席 = 别的车道 ⇒ 本腿零调用。一次部署一条执行车道 ⇒ 一只座、一个节拍。 */
|
|
127
|
+
sandboxReaper?: SandboxReaper;
|
|
127
128
|
}
|
|
128
129
|
/** core 5.48 `reapDurableAgents` 的 `deps.sessions` 面(结构形,只列本仓要填的三格)。 */
|
|
129
130
|
export interface ReapSessionsFacade {
|
package/dist/boot/reapers.js
CHANGED
|
@@ -5,7 +5,7 @@ import { STORE_SWEEP_LEGS, StoreSweepError } from "../plugins/store-sweep.js";
|
|
|
5
5
|
import { isAdoptionQuiescing, trackMaintenanceLeg } from "../adoption/quiesce.js";
|
|
6
6
|
import { createApprovalReconciler } from "../approval-reconciler.js";
|
|
7
7
|
import { createE2bOrphanSandboxProvider, reclaimOrphanE2bSandboxes, E2B_ORPHAN_GRACE_MS } from "../plugins/e2b-orphan-reclaim.js";
|
|
8
|
-
import {
|
|
8
|
+
import { SANDBOX_REAP_PERIOD_MS } from "../plugins/sandbox-reaper.js";
|
|
9
9
|
import { APPROVAL_ASK_RETENTION_PASS_MS, runApprovalAskRetentionPass } from "../approval-ask-retention.js";
|
|
10
10
|
import { seatText } from "../trace/exit-seat.js";
|
|
11
11
|
export const REAPER_FAILURE_WARN_THRESHOLD = 5;
|
|
@@ -86,24 +86,27 @@ export function createPlacementAwareReapSessions(deps) {
|
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
export function startReapers(ctx) {
|
|
89
|
-
const { config, logger, metrics, localRoot, backend, subRunner, runStore, checkpointStore, parkCommits, rateLimiter, costQuota, storeSweep, fileHistoryErasure, taskAttachmentStore, imageBakes, worktreeReap, workflowNotifyGate, workflowRecoverOpts, sqlWorkflowRunStore, workflowNotifyJournal, backgroundAgentStore, mailboxStore, toolApproval, permissionRuleStores, approvalNonceStore, getRunDenySweep, userInputLedger, approvalAskAudit,
|
|
89
|
+
const { config, logger, metrics, localRoot, backend, subRunner, runStore, checkpointStore, parkCommits, rateLimiter, costQuota, storeSweep, fileHistoryErasure, taskAttachmentStore, imageBakes, worktreeReap, workflowNotifyGate, workflowRecoverOpts, sqlWorkflowRunStore, workflowNotifyJournal, backgroundAgentStore, mailboxStore, toolApproval, permissionRuleStores, approvalNonceStore, getRunDenySweep, userInputLedger, approvalAskAudit, sandboxReaper, } = ctx;
|
|
90
90
|
const leg = (p) => {
|
|
91
91
|
if (p !== undefined)
|
|
92
92
|
trackMaintenanceLeg(p);
|
|
93
93
|
};
|
|
94
|
+
const reapLogged = (metric, labels) => (n) => {
|
|
95
|
+
if (typeof n === "number" && n > 0)
|
|
96
|
+
logger.info("reaper_swept", { metric, ...labels, count: n });
|
|
97
|
+
};
|
|
94
98
|
const reapCount = (metric, labels) => (n) => {
|
|
95
|
-
if (typeof n === "number" && n > 0)
|
|
99
|
+
if (typeof n === "number" && n > 0)
|
|
96
100
|
metrics.inc(metric, labels, n);
|
|
97
|
-
|
|
98
|
-
}
|
|
101
|
+
reapLogged(metric, labels)(n);
|
|
99
102
|
};
|
|
100
103
|
const e2bOrphanProvider = config.remoteExec.provider === "e2b" && config.remoteExec.orphanReclaim !== false
|
|
101
104
|
? createE2bOrphanSandboxProvider({ apiKey: config.remoteExec.apiKey })
|
|
102
105
|
: undefined;
|
|
103
106
|
let e2bOrphanLastRunMs = Date.now() - E2B_ORPHAN_GRACE_MS;
|
|
104
107
|
let e2bOrphanInFlight = false;
|
|
105
|
-
let
|
|
106
|
-
let
|
|
108
|
+
let sandboxReapLastRunMs = Date.now() - SANDBOX_REAP_PERIOD_MS;
|
|
109
|
+
let sandboxReapInFlight = false;
|
|
107
110
|
let wfRunReapInFlight = false;
|
|
108
111
|
let attachmentSweepInFlight = false;
|
|
109
112
|
let bgAgentReapInFlight = false;
|
|
@@ -111,7 +114,7 @@ export function startReapers(ctx) {
|
|
|
111
114
|
const probeClockSkewGuard = createThrottledReaperCatch("probe_clock_skew", logger);
|
|
112
115
|
const runsReapStaleGuard = createThrottledReaperCatch("runs_reap_stale", logger);
|
|
113
116
|
const e2bOrphanGuard = createThrottledReaperCatch("e2b_orphan_reclaim", logger);
|
|
114
|
-
const
|
|
117
|
+
const sandboxReapGuard = createThrottledReaperCatch("sandbox_reap", logger);
|
|
115
118
|
const checkpointsReapExpiredGuard = createThrottledReaperCatch("checkpoints_reap_expired", logger);
|
|
116
119
|
const approvalNonceReapExpiredGuard = createThrottledReaperCatch("approval_nonce_reap_expired", logger);
|
|
117
120
|
const runsFailSuspendedExpiredCheckpointGuard = createThrottledReaperCatch("runs_fail_suspended_expired_checkpoint", logger);
|
|
@@ -246,8 +249,8 @@ export function startReapers(ctx) {
|
|
|
246
249
|
quiesceLogged = false;
|
|
247
250
|
leg(probeClockSkew().then(() => probeClockSkewGuard.onSuccess(), probeClockSkewGuard.onError));
|
|
248
251
|
leg(runStore
|
|
249
|
-
?.reapStale(
|
|
250
|
-
.then(
|
|
252
|
+
?.reapStale()
|
|
253
|
+
.then(reapLogged("runs_reaped_total", { kind: "stale" }))
|
|
251
254
|
.then(() => runsReapStaleGuard.onSuccess(), runsReapStaleGuard.onError)
|
|
252
255
|
.then(() => userInputLedger?.converge().then(reapCount("user_input_converged_total", {}))));
|
|
253
256
|
if (checkpointStore) {
|
|
@@ -396,14 +399,14 @@ export function startReapers(ctx) {
|
|
|
396
399
|
e2bOrphanInFlight = false;
|
|
397
400
|
}));
|
|
398
401
|
}
|
|
399
|
-
if (
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
leg(
|
|
402
|
+
if (sandboxReaper && Date.now() - sandboxReapLastRunMs >= SANDBOX_REAP_PERIOD_MS && !sandboxReapInFlight) {
|
|
403
|
+
sandboxReapInFlight = true;
|
|
404
|
+
sandboxReapLastRunMs = Date.now();
|
|
405
|
+
leg(sandboxReaper
|
|
403
406
|
.reapOnce(runStore)
|
|
404
|
-
.then(() =>
|
|
407
|
+
.then(() => sandboxReapGuard.onSuccess(), sandboxReapGuard.onError)
|
|
405
408
|
.finally(() => {
|
|
406
|
-
|
|
409
|
+
sandboxReapInFlight = false;
|
|
407
410
|
}));
|
|
408
411
|
}
|
|
409
412
|
}, config.reapIntervalSec * 1000);
|
|
@@ -16,6 +16,7 @@ import type { StoreBackend } from "../plugins/store-backend.js";
|
|
|
16
16
|
import { type TaskAttachmentStore } from "../plugins/task-attachment-store.js";
|
|
17
17
|
import type { createPrincipalEntitlementsClient } from "../runtime-caps-resolver.js";
|
|
18
18
|
import { type OwnerAwareSessionStore } from "../security.js";
|
|
19
|
+
import { type HistoryAnchorReaders } from "../history-anchor.js";
|
|
19
20
|
import type { MemoryScopeStores } from "../memory-scope-stores.js";
|
|
20
21
|
import type { MemorySyncRunner } from "../memory-sync-client.js";
|
|
21
22
|
import type { PeerDesk } from "../peer-seat.js";
|
|
@@ -38,16 +39,17 @@ export interface ResolveSpecCtx {
|
|
|
38
39
|
setSessionShellEnv: (sid: string, env: Record<string, string>) => void;
|
|
39
40
|
/** 两张 per-session 登记簿的**租户围栏**(codex R1-F1):每次提交对拍本会话的主人,换主即清。
|
|
40
41
|
* 论证(为什么 device lane 把这条从「不需要」变成「必需」)逐字见 `createSessionScopedRegistries` 头注。 */
|
|
41
|
-
fenceSessionOwner: (sid: string, owner: string | null) => void;
|
|
42
|
+
fenceSessionOwner: (sid: string, owner: string | null, incarnation?: string) => void;
|
|
42
43
|
hookLlm: ReturnType<typeof createHookLlm>["hookLlm"];
|
|
43
44
|
hookAgent: HookLlmCall;
|
|
44
|
-
/** 部署座在任务座之下挂了链成员的站点式样(第 5 段装配口从引擎准入记录读出,`boot/deployment-mods.ts` 的 `belowTaskChainPatternsOf`)—— 原样交 hooks 注册上下文(
|
|
45
|
+
/** 部署座在任务座之下挂了链成员的站点式样(第 5 段装配口从引擎准入记录读出,`boot/deployment-mods.ts` 的 `belowTaskChainPatternsOf`)—— 原样交 hooks 注册上下文(请求钩子两条车道在这些站上只许收紧)。 */
|
|
45
46
|
belowTaskChainPatterns: readonly string[];
|
|
46
47
|
fleetBus: FleetEventBus;
|
|
47
48
|
hookWakeBus: {
|
|
48
49
|
deliver?: (sessionId: string, text: string) => Promise<boolean>;
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
/** 历史锚手柄的两只读店(锚店 + run 店;run 店只为未知手柄的 404 选成因半句,`history-anchor.ts`)。缺席 = 本部署没有锚店(提交面 501)。 */
|
|
52
|
+
historyAnchors: HistoryAnchorReaders | undefined;
|
|
51
53
|
ownerAware: OwnerAwareSessionStore;
|
|
52
54
|
taskLimitCaps: {
|
|
53
55
|
timeoutSec: number | undefined;
|