@sema-agent/server 7.150.0 → 7.152.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 +451 -0
- package/README.md +15 -3
- package/README.zh-CN.md +10 -2
- package/USAGE.md +144 -87
- package/deploy/sema-up/README.md +11 -4
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +5 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +15 -16
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -3
- package/deploy/sema-up/chart/templates/server.yaml +5 -3
- package/deploy/sema-up/chart/values-full-single.yaml +3 -1
- package/deploy/sema-up/chart/values.yaml +8 -1
- package/deploy/sema-up/cluster-up.sh +7 -6
- package/deploy/sema-up/kube-up.sh +6 -6
- package/deploy/sema-up/lib/flagshape.sh +36 -8
- package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
- package/deploy/sema-up/lib/helm-values-kube.py +2 -0
- package/deploy/sema-up/machines.example.yaml +3 -1
- package/deploy/sema-up/sema-up.sh +22 -16
- package/dist/adoption/import.js +3 -3
- package/dist/approval-ask-audit-store.d.ts +1 -1
- package/dist/approval-ask-machine.d.ts +4 -10
- package/dist/approval-ask-retention.d.ts +1 -1
- package/dist/approval-card.d.ts +12 -14
- package/dist/approval-gate-currency.d.ts +9 -9
- package/dist/approval-gate-currency.js +3 -4
- package/dist/approval-hmac.d.ts +17 -1
- package/dist/approval-hmac.js +7 -1
- package/dist/approval-queue-kind.d.ts +1 -1
- package/dist/approval.d.ts +2 -2
- package/dist/approval.js +2 -2
- package/dist/auth-bridge.d.ts +20 -0
- package/dist/auth-bridge.js +9 -0
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.d.ts +4 -2
- package/dist/bind-host.d.ts +3 -6
- package/dist/bind-host.js +4 -7
- package/dist/boot/budget-tracing.js +1 -1
- package/dist/boot/coordinators.d.ts +1 -1
- package/dist/boot/coordinators.js +9 -10
- package/dist/boot/device-lane.js +2 -0
- package/dist/boot/engine-lease.d.ts +5 -0
- package/dist/boot/engine-lease.js +1 -0
- package/dist/boot/execution-env.d.ts +9 -14
- package/dist/boot/execution-env.js +85 -22
- package/dist/boot/execution-lane.js +32 -5
- package/dist/boot/late-binds.d.ts +8 -4
- package/dist/boot/late-binds.js +7 -1
- package/dist/boot/leader.d.ts +31 -30
- package/dist/boot/leader.js +38 -28
- package/dist/boot/leg-path-adjudication.d.ts +40 -0
- package/dist/boot/leg-path-adjudication.js +18 -0
- package/dist/boot/memory-consolidation.d.ts +3 -2
- package/dist/boot/memory-consolidation.js +6 -6
- package/dist/boot/parked-revive-gate.js +3 -15
- package/dist/boot/reapers.d.ts +6 -1
- package/dist/boot/reapers.js +13 -2
- package/dist/boot/resolve-spec.d.ts +3 -3
- package/dist/boot/resolve-spec.js +43 -48
- package/dist/boot/runner-deps.d.ts +46 -35
- package/dist/boot/runner-deps.js +94 -91
- package/dist/boot/session-age-out.d.ts +36 -0
- package/dist/boot/session-age-out.js +101 -0
- package/dist/boot/session-faces.d.ts +5 -14
- package/dist/boot/session-faces.js +9 -5
- package/dist/boot/shutdown.d.ts +6 -0
- package/dist/boot/shutdown.js +10 -4
- package/dist/boot/stage-01-config.js +2 -0
- package/dist/boot/stage-02-web-admin-pull.js +4 -5
- package/dist/boot/stage-05-execution-env.d.ts +5 -3
- package/dist/boot/stage-05-execution-env.js +3 -2
- package/dist/boot/stage-06-runners.d.ts +9 -4
- package/dist/boot/stage-06-runners.js +24 -9
- package/dist/boot/stage-07-capability-layer.d.ts +8 -4
- package/dist/boot/stage-07-capability-layer.js +3 -2
- package/dist/boot/stage-08-reapers.d.ts +8 -4
- package/dist/boot/stage-08-reapers.js +4 -2
- package/dist/boot/stage-09-leader.d.ts +12 -5
- package/dist/boot/stage-09-leader.js +14 -5
- package/dist/boot/stage-10-http-server.d.ts +19 -5
- package/dist/boot/stage-10-http-server.js +14 -21
- package/dist/boot/stores.js +7 -4
- package/dist/boot/web-admin.js +5 -8
- package/dist/boot/workflow-orchestration.d.ts +7 -2
- package/dist/boot/workflow-orchestration.js +24 -7
- package/dist/bounded-rotation.d.ts +29 -0
- package/dist/bounded-rotation.js +24 -0
- package/dist/capabilities/approvals-push.d.ts +3 -3
- package/dist/capabilities/scenarios.d.ts +28 -13
- package/dist/capabilities/scenarios.js +2 -2
- package/dist/capability-facts.d.ts +43 -32
- package/dist/capability-facts.js +45 -51
- package/dist/card-rule-offers.d.ts +32 -0
- package/dist/card-rule-offers.js +130 -0
- package/dist/center-credential.d.ts +25 -6
- package/dist/center-credential.js +25 -5
- package/dist/config-catalog.d.ts +26 -7
- package/dist/config-catalog.js +26 -22
- package/dist/config-dir-trust.js +4 -2
- package/dist/config-invariants.d.ts +20 -8
- package/dist/config-invariants.js +55 -12
- package/dist/config-lkg.d.ts +5 -19
- package/dist/config-lkg.js +8 -62
- package/dist/config-provider.d.ts +1 -1
- package/dist/config-root-migration.d.ts +2 -2
- package/dist/config-types.d.ts +38 -42
- package/dist/config.d.ts +58 -7
- package/dist/config.js +90 -40
- package/dist/control-socket.d.ts +51 -0
- package/dist/control-socket.js +115 -0
- package/dist/deployment-governance.d.ts +2 -1
- package/dist/deployment-shape.d.ts +9 -1
- package/dist/deployment-shape.js +2 -1
- package/dist/device-protocol.d.ts +5 -4
- package/dist/device-protocol.js +1 -1
- package/dist/device-ws-hub.d.ts +7 -0
- package/dist/device-ws-hub.js +10 -3
- package/dist/device-ws-protocol.d.ts +63 -10
- package/dist/device-ws-protocol.js +56 -25
- package/dist/elicitation.js +2 -2
- package/dist/engine-identity.d.ts +19 -7
- package/dist/engine-identity.js +10 -2
- package/dist/entry-mode-clamp-notice.d.ts +2 -1
- package/dist/entry-problems.d.ts +40 -3
- package/dist/entry-problems.js +3 -1
- package/dist/execution-env-refusal.d.ts +29 -0
- package/dist/execution-env-refusal.js +8 -0
- package/dist/execution-lane-caps.d.ts +3 -1
- package/dist/field-conflict.d.ts +1 -1
- package/dist/file-history-capture.d.ts +11 -4
- package/dist/file-history-capture.js +9 -6
- package/dist/file-history-disclosure.d.ts +7 -5
- package/dist/file-history-disclosure.js +7 -5
- package/dist/fleet/drain-entry.d.ts +4 -0
- package/dist/fleet/engine-signal.d.ts +12 -29
- package/dist/fleet/engine-signal.js +1 -7
- package/dist/fleet-client.js +2 -5
- package/dist/gate-settlement.d.ts +1 -8
- package/dist/gate-settlement.js +0 -4
- package/dist/history-anchor.js +1 -1
- package/dist/hitl-delivery.d.ts +2 -3
- package/dist/hitl-delivery.js +0 -2
- package/dist/hooks/hook-llm.js +4 -2
- package/dist/hooks/hook-runner.d.ts +3 -2
- package/dist/hooks/hook-runner.js +18 -3
- package/dist/host-decision.d.ts +11 -11
- package/dist/host-lsp-manager.d.ts +2 -2
- package/dist/http/active-run-conflict.d.ts +35 -2
- package/dist/http/active-run-conflict.js +48 -19
- package/dist/http/admission.js +17 -2
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +10 -7
- package/dist/http/checkpoint-ctx.d.ts +4 -0
- package/dist/http/checkpoint-ctx.js +2 -0
- package/dist/http/dispatch.d.ts +8 -3
- package/dist/http/dispatch.js +59 -32
- package/dist/http/durable-run-leg.js +16 -17
- package/dist/http/health-reader.d.ts +16 -9
- package/dist/http/health-reader.js +2 -1
- package/dist/http/health-self-report.d.ts +9 -1
- package/dist/http/health-self-report.js +3 -1
- package/dist/http/owner-access.d.ts +33 -14
- package/dist/http/owner-access.js +40 -10
- package/dist/http/principal-gate.d.ts +49 -21
- package/dist/http/principal-gate.js +61 -11
- package/dist/http/request-channel.d.ts +23 -0
- package/dist/http/request-channel.js +9 -0
- package/dist/http/request-guards.js +17 -2
- package/dist/http/resume-ctx-read.js +42 -3
- package/dist/http/resume-legs.d.ts +4 -3
- package/dist/http/resume-legs.js +367 -117
- package/dist/http/route-ctx.d.ts +91 -15
- package/dist/http/route-ctx.js +17 -0
- package/dist/http/route-table.d.ts +5 -1
- package/dist/http/route-table.js +4 -0
- package/dist/http/routes/admin-config-refresh.js +3 -3
- package/dist/http/routes/admin-drain.d.ts +3 -0
- package/dist/http/routes/admin-drain.js +7 -7
- package/dist/http/routes/admin-memory-optout.d.ts +1 -1
- package/dist/http/routes/admin-memory-optout.js +3 -3
- package/dist/http/routes/adoption.js +3 -5
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +2 -1
- package/dist/http/routes/approvals-assistant.js +99 -51
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/capabilities.d.ts +4 -0
- package/dist/http/routes/capabilities.js +38 -10
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.js +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/diagnostics.js +19 -7
- package/dist/http/routes/fleet.js +10 -8
- package/dist/http/routes/images.js +10 -10
- package/dist/http/routes/memory-bundle.js +3 -3
- package/dist/http/routes/memory-compliance.js +3 -3
- package/dist/http/routes/memory-consolidation.js +2 -2
- package/dist/http/routes/memory-origin.js +3 -3
- package/dist/http/routes/memory-policy.js +2 -2
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/projects.d.ts +3 -2
- package/dist/http/routes/projects.js +4 -5
- package/dist/http/routes/retention-ops.js +3 -3
- package/dist/http/routes/rules.js +5 -5
- package/dist/http/routes/run-permission-mode.d.ts +2 -1
- package/dist/http/routes/run-permission-mode.js +2 -2
- package/dist/http/routes/runs.d.ts +4 -9
- package/dist/http/routes/runs.js +171 -65
- package/dist/http/routes/session-sync.d.ts +22 -9
- package/dist/http/routes/session-sync.js +204 -107
- package/dist/http/routes/sessions-list.js +13 -7
- package/dist/http/routes/sessions.js +30 -15
- package/dist/http/routes/tasks.js +46 -41
- package/dist/http/routes/trace-usage.js +2 -2
- package/dist/http/routes/workflows.js +1 -1
- package/dist/http/server.d.ts +30 -30
- package/dist/http/server.js +16 -4
- package/dist/http/submit-ctx.d.ts +1 -1
- package/dist/http/submit-ctx.js +7 -4
- package/dist/http/wire-types.d.ts +14 -4
- package/dist/human-facing-args.d.ts +33 -0
- package/dist/human-facing-args.js +33 -0
- package/dist/identity-source.d.ts +20 -3
- package/dist/identity-source.js +14 -0
- package/dist/index.d.ts +5 -1
- package/dist/k8s-api-credentials.d.ts +29 -0
- package/dist/k8s-api-credentials.js +25 -0
- package/dist/lane-home-probe.d.ts +3 -7
- package/dist/lane-home-probe.js +2 -2
- package/dist/leader/diffup.d.ts +19 -0
- package/dist/leader/diffup.js +7 -0
- package/dist/leader/leader.d.ts +116 -11
- package/dist/leader/leader.js +69 -5
- package/dist/leader/repair-wire.js +2 -2
- package/dist/leader/run-entry.d.ts +2 -1
- package/dist/leader/run-entry.js +1 -1
- package/dist/leader/wire.d.ts +42 -132
- package/dist/leader/wire.js +81 -67
- package/dist/leg-facts.d.ts +13 -5
- package/dist/leg-facts.js +2 -1
- package/dist/memory-scope.d.ts +23 -11
- package/dist/memory-scope.js +18 -6
- package/dist/memory-sync-client.d.ts +30 -2
- package/dist/memory-sync-client.js +16 -9
- package/dist/model-entry-headers.d.ts +9 -10
- package/dist/model-entry-headers.js +0 -4
- package/dist/model-entry-refusal.d.ts +7 -4
- package/dist/model-entry-refusal.js +11 -5
- package/dist/model-plane-face.d.ts +1 -1
- package/dist/model-plane-face.js +3 -1
- package/dist/model-route-endpoint.d.ts +13 -7
- package/dist/model-route-endpoint.js +14 -11
- package/dist/model-select.d.ts +22 -0
- package/dist/model-select.js +9 -0
- package/dist/model-unreachable-notice.d.ts +11 -0
- package/dist/model-unreachable-notice.js +4 -4
- package/dist/object-store-buckets.d.ts +640 -6
- package/dist/object-store-buckets.js +166 -0
- package/dist/observability/err-text.d.ts +7 -0
- package/dist/observability/err-text.js +5 -0
- package/dist/observability/fail-open.d.ts +25 -17
- package/dist/observability/fail-open.js +25 -17
- package/dist/observability/logger.js +3 -1
- package/dist/observability/metrics.js +1 -0
- package/dist/operator-roster.d.ts +68 -0
- package/dist/operator-roster.js +32 -0
- package/dist/orchestration/workflow-notify-journal.d.ts +18 -1
- package/dist/orchestration/workflow-notify-journal.js +12 -1
- package/dist/orchestration/workflow-park-decision.d.ts +70 -18
- package/dist/orchestration/workflow-park-decision.js +49 -10
- package/dist/orchestration/workflow-park-holder.d.ts +65 -0
- package/dist/orchestration/workflow-park-holder.js +98 -0
- package/dist/orchestration/workflow-record-fence.d.ts +36 -0
- package/dist/orchestration/workflow-record-fence.js +42 -0
- package/dist/outbound-dispatcher.d.ts +71 -8
- package/dist/outbound-dispatcher.js +48 -7
- package/dist/owner-faces.d.ts +2 -2
- package/dist/parked-decide.d.ts +106 -55
- package/dist/parked-decide.js +153 -117
- package/dist/peer-directory.d.ts +2 -2
- package/dist/peer-inbound-face.d.ts +2 -6
- package/dist/peer-inbound-face.js +0 -3
- package/dist/permission-mode-admission.d.ts +74 -5
- package/dist/permission-mode-admission.js +56 -3
- package/dist/plugins/adoption-log-sql.d.ts +3 -1
- package/dist/plugins/adoption-log-sql.js +7 -1
- package/dist/plugins/approval-ask-store-file.d.ts +14 -2
- package/dist/plugins/approval-ask-store-file.js +11 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +10 -1
- package/dist/plugins/approval-ask-store-memory.js +35 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +69 -4
- package/dist/plugins/approval-ask-store-sql.js +45 -5
- package/dist/plugins/approval-exemption-store.js +3 -0
- package/dist/plugins/approval-nonce-store.js +2 -0
- package/dist/plugins/blob-backend.d.ts +83 -7
- package/dist/plugins/blob-backend.js +57 -6
- package/dist/plugins/breaker-state-sql.js +2 -0
- package/dist/plugins/caching-session-store.d.ts +9 -15
- package/dist/plugins/caching-session-store.js +6 -0
- package/dist/plugins/checkpoint-index-columns.d.ts +20 -16
- package/dist/plugins/checkpoint-index-columns.js +3 -6
- package/dist/plugins/checkpoint-store-face.d.ts +119 -61
- package/dist/plugins/checkpoint-store-face.js +134 -55
- package/dist/plugins/device-store-sql.js +6 -0
- package/dist/plugins/error-origin.d.ts +18 -0
- package/dist/plugins/error-origin.js +10 -0
- package/dist/plugins/execution-placement-sql.js +6 -6
- package/dist/plugins/image-bake-store-sql.js +6 -0
- package/dist/plugins/image-index-sql.js +4 -0
- package/dist/plugins/landed-attendants.d.ts +212 -0
- package/dist/plugins/landed-attendants.js +161 -0
- package/dist/plugins/leader-run-store-sql.js +4 -0
- package/dist/plugins/local-checkpoint-store.d.ts +13 -3
- package/dist/plugins/local-checkpoint-store.js +38 -49
- package/dist/plugins/local-session-live-reference.d.ts +40 -0
- package/dist/plugins/local-session-live-reference.js +39 -0
- package/dist/plugins/local-session-store.d.ts +71 -33
- package/dist/plugins/local-session-store.js +129 -27
- package/dist/plugins/memory-engine-pg.js +4 -0
- package/dist/plugins/memory-engine-sql-apply.js +5 -2
- package/dist/plugins/memory-engine-tidb.js +4 -0
- package/dist/plugins/memory-optout-grant-store-sql.js +4 -0
- package/dist/plugins/memory-sync-store-pg.js +5 -0
- package/dist/plugins/memory-sync-store-tidb.js +5 -0
- package/dist/plugins/one-time-migrations.d.ts +104 -80
- package/dist/plugins/one-time-migrations.js +226 -132
- package/dist/plugins/org-delivery-quota-store.js +4 -1
- package/dist/plugins/outcome-ledger-sql.js +2 -0
- package/dist/plugins/permission-rule-store-sql.js +11 -4
- package/dist/plugins/pg-cost-quota.js +4 -0
- package/dist/plugins/pg-pool.js +35 -10
- package/dist/plugins/pg-rate-limiter.js +2 -0
- package/dist/plugins/posix-shell-fs.d.ts +6 -1
- package/dist/plugins/posix-shell-fs.js +4 -1
- package/dist/plugins/remote-env-adb.d.ts +19 -15
- package/dist/plugins/remote-env-adb.js +41 -15
- package/dist/plugins/remote-env-connect-seat.d.ts +105 -0
- package/dist/plugins/remote-env-connect-seat.js +72 -0
- package/dist/plugins/remote-env-device.d.ts +22 -5
- package/dist/plugins/remote-env-device.js +106 -8
- package/dist/plugins/remote-env-e2b.d.ts +15 -6
- package/dist/plugins/remote-env-e2b.js +42 -32
- package/dist/plugins/remote-env-file-error.js +6 -2
- package/dist/plugins/remote-env-host.d.ts +46 -10
- package/dist/plugins/remote-env-host.js +124 -52
- package/dist/plugins/remote-env-k8s.d.ts +109 -41
- package/dist/plugins/remote-env-k8s.js +160 -54
- package/dist/plugins/remote-env-local-docker.d.ts +13 -8
- package/dist/plugins/remote-env-local-docker.js +34 -41
- package/dist/plugins/remote-env-ssh.d.ts +18 -12
- package/dist/plugins/remote-env-ssh.js +60 -59
- package/dist/plugins/remote-shell.d.ts +98 -1
- package/dist/plugins/remote-shell.js +218 -0
- package/dist/plugins/replica-registration.d.ts +1 -1
- package/dist/plugins/replica-registration.js +1 -1
- package/dist/plugins/resume-anchor-store-sql.d.ts +11 -2
- package/dist/plugins/resume-anchor-store-sql.js +12 -5
- package/dist/plugins/retention-lane-store-sql.js +4 -0
- package/dist/plugins/retention-sql.d.ts +20 -2
- package/dist/plugins/retention-sql.js +11 -0
- package/dist/plugins/run-store-sql.d.ts +21 -2
- package/dist/plugins/run-store-sql.js +31 -7
- package/dist/plugins/s3-presign.d.ts +23 -0
- package/dist/plugins/s3-presign.js +37 -3
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +1 -1
- package/dist/plugins/scenario-prefix-switch-m42.js +2 -2
- package/dist/plugins/scheduler-support.d.ts +2 -2
- package/dist/plugins/scheduler-support.js +0 -3
- package/dist/plugins/schema-consistency.d.ts +4 -2
- package/dist/plugins/schema-consistency.js +19 -2
- package/dist/plugins/schema-indexes.js +2 -0
- package/dist/plugins/send-file-ledger.d.ts +2 -2
- package/dist/plugins/send-file-ledger.js +5 -2
- package/dist/plugins/send-user-file.d.ts +3 -4
- package/dist/plugins/send-user-file.js +56 -52
- package/dist/plugins/serving-requirement.d.ts +26 -7
- package/dist/plugins/serving-requirement.js +11 -4
- package/dist/plugins/session-birth.d.ts +6 -2
- package/dist/plugins/session-blob-claim-token.d.ts +15 -0
- package/dist/plugins/session-blob-claim-token.js +20 -0
- package/dist/plugins/session-blob-namespace.d.ts +46 -0
- package/dist/plugins/session-blob-namespace.js +116 -0
- package/dist/plugins/session-capture-record-store-sql.js +2 -0
- package/dist/plugins/session-ext-table.d.ts +14 -1
- package/dist/plugins/session-ext-table.js +5 -1
- package/dist/plugins/session-row-sql.d.ts +49 -2
- package/dist/plugins/session-row-sql.js +56 -13
- package/dist/plugins/session-store-sql.d.ts +34 -18
- package/dist/plugins/session-store-sql.js +98 -17
- package/dist/plugins/shared-memory-store-sql.d.ts +1 -0
- package/dist/plugins/shared-memory-store-sql.js +6 -2
- package/dist/plugins/snapshot-bucket-presence.d.ts +25 -2
- package/dist/plugins/snapshot-bucket-presence.js +8 -2
- package/dist/plugins/sql-driver.d.ts +2 -1
- package/dist/plugins/sql-driver.js +18 -3
- package/dist/plugins/sql-errors.d.ts +11 -6
- package/dist/plugins/sql-errors.js +5 -6
- package/dist/plugins/sql-json-column.d.ts +1 -1
- package/dist/plugins/stop-then-start-sentence.d.ts +10 -4
- package/dist/plugins/stop-then-start-sentence.js +14 -10
- package/dist/plugins/stop-then-start.d.ts +109 -0
- package/dist/plugins/stop-then-start.js +104 -0
- package/dist/plugins/store-backend.d.ts +84 -15
- package/dist/plugins/store-backend.js +236 -72
- package/dist/plugins/store-boundary.d.ts +57 -0
- package/dist/plugins/store-boundary.js +139 -0
- package/dist/plugins/store-contracts.d.ts +17 -0
- package/dist/plugins/store-fault-sentence-m53.d.ts +7 -0
- package/dist/plugins/store-fault-sentence-m53.js +25 -0
- package/dist/plugins/store-fault.d.ts +26 -7
- package/dist/plugins/store-fault.js +18 -2
- package/dist/plugins/task-attachment-store.d.ts +2 -1
- package/dist/plugins/task-attachment-store.js +14 -1
- package/dist/plugins/task-list-store-sql.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.js +10 -8
- package/dist/plugins/tidb-cost-quota.js +4 -0
- package/dist/plugins/tidb-pool.js +21 -25
- package/dist/plugins/tidb-rate-limiter.js +4 -0
- package/dist/plugins/user-input-ledger-sql.js +4 -0
- package/dist/plugins/workflow-run-store-sql.d.ts +28 -10
- package/dist/plugins/workflow-run-store-sql.js +64 -4
- package/dist/plugins/workspace-custody.d.ts +4 -3
- package/dist/plugins/workspace-fill.d.ts +4 -7
- package/dist/plugins/workspace-fill.js +2 -1
- package/dist/plugins/write-behind-counter.js +5 -0
- package/dist/project-context.d.ts +0 -2
- package/dist/project-context.js +4 -8
- package/dist/project-registry.d.ts +46 -0
- package/dist/project-registry.js +44 -0
- package/dist/question.d.ts +2 -1
- package/dist/question.js +5 -13
- package/dist/request-form.d.ts +6 -1
- package/dist/request-form.js +4 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +4 -0
- package/dist/request-value-closure.js +10 -0
- package/dist/rule-issue-reading.d.ts +1 -1
- package/dist/rules-consent.d.ts +1 -1
- package/dist/run-acceptance.d.ts +3 -2
- package/dist/run-acceptance.js +4 -6
- package/dist/run-local.js +9 -9
- package/dist/runs.d.ts +54 -16
- package/dist/runs.js +67 -13
- package/dist/runtime-governance.d.ts +5 -4
- package/dist/security.d.ts +30 -32
- package/dist/security.js +41 -7
- package/dist/sema-config-dir.d.ts +2 -1
- package/dist/server-secret-env.d.ts +12 -10
- package/dist/server-secret-env.js +24 -15
- package/dist/session-bindings.d.ts +82 -0
- package/dist/session-bindings.js +18 -0
- package/dist/session-children-retire.d.ts +2 -2
- package/dist/session-children-retire.js +2 -6
- package/dist/session-deletion.d.ts +16 -1
- package/dist/session-error-wire.d.ts +3 -3
- package/dist/session-error-wire.js +3 -3
- package/dist/session-incarnation.d.ts +10 -0
- package/dist/session-incarnation.js +10 -1
- package/dist/session-kind.d.ts +57 -0
- package/dist/session-kind.js +22 -0
- package/dist/session-row.d.ts +21 -1
- package/dist/session-row.js +7 -1
- package/dist/session-sync-kernel.d.ts +24 -14
- package/dist/session-sync-kernel.js +3 -6
- package/dist/session-sync.d.ts +25 -103
- package/dist/session-sync.js +14 -76
- package/dist/session-titler.d.ts +10 -3
- package/dist/session-titler.js +19 -6
- package/dist/ssh-host-key.d.ts +5 -0
- package/dist/ssh-host-key.js +3 -0
- package/dist/stores-sql/blob-index-sql.d.ts +30 -9
- package/dist/stores-sql/blob-index-sql.js +40 -21
- package/dist/stores-sql/checkpoint-store-sql.d.ts +54 -27
- package/dist/stores-sql/checkpoint-store-sql.js +70 -146
- package/dist/stores-sql/file-history-store-sql.d.ts +113 -15
- package/dist/stores-sql/file-history-store-sql.js +205 -95
- package/dist/stores-sql/pg-session-storage.d.ts +34 -7
- package/dist/stores-sql/pg-session-storage.js +37 -13
- package/dist/stores-sql/retention-store-sql.d.ts +1 -9
- package/dist/stores-sql/retention-store-sql.js +5 -19
- package/dist/stores-sql/session-policy-store-sql.d.ts +30 -7
- package/dist/stores-sql/session-policy-store-sql.js +61 -44
- package/dist/stores-sql/session-write-hooks.d.ts +11 -0
- package/dist/stores-sql/tidb-session-store.d.ts +58 -7
- package/dist/stores-sql/tidb-session-store.js +37 -13
- package/dist/submission-exit.d.ts +3 -2
- package/dist/submission-exit.js +9 -1
- package/dist/task-cwd.d.ts +2 -2
- package/dist/task-settings.d.ts +7 -5
- package/dist/task-settings.js +3 -3
- package/dist/terminal.d.ts +33 -2
- package/dist/terminal.js +139 -9
- package/dist/tool-approval.d.ts +465 -507
- package/dist/tool-approval.js +606 -1222
- package/dist/trace/core-keyset-guard.d.ts +1 -1
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/project.d.ts +2 -3
- package/dist/trace/redact.js +3 -2
- package/dist/trace/self-minted-wire.d.ts +571 -178
- package/dist/trace/self-minted-wire.js +189 -56
- package/dist/web-admin-client/apply-effective.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.js +1 -1
- package/dist/web-admin-client/types.d.ts +1 -1
- package/dist/workspace-space.d.ts +10 -4
- package/dist/workspace-space.js +4 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +79 -28
- package/package.json +7 -3
- package/scripts/embed-minimal.mjs +3 -3
- package/wire-changes/server@7.151.0.json +762 -0
- package/wire-changes/server@7.152.0.json +900 -0
- package/dist/config-d-migration.d.ts +0 -37
- package/dist/config-d-migration.js +0 -60
- package/dist/http/session-inherit-env.d.ts +0 -36
- package/dist/http/session-inherit-env.js +0 -6
|
@@ -4,9 +4,8 @@ import { recordFailOpen } from "../observability/fail-open.js";
|
|
|
4
4
|
import { decodeCheckpointScope } from "../security.js";
|
|
5
5
|
import { createApprovalBaselinePolicy, createDeploymentGovernanceInputs, } from "../deployment-governance.js";
|
|
6
6
|
import { applyRuntimeGovernance } from "../runtime-governance.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { executionLaneHomeDir } from "../execution-lane-caps.js";
|
|
7
|
+
import { sandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
|
|
8
|
+
import { createLegPathAdjudication } from "./leg-path-adjudication.js";
|
|
10
9
|
import { createSessionExemptionRead } from "../approval.js";
|
|
11
10
|
import { seatText } from "../trace/exit-seat.js";
|
|
12
11
|
function hostGateCwd(config, localRoot) {
|
|
@@ -17,18 +16,7 @@ export function createParkedReviveInheritedGate(deps) {
|
|
|
17
16
|
const slots = deps.slots ?? sandboxPathEnvSlots;
|
|
18
17
|
return async (row, identity) => {
|
|
19
18
|
const metadata = await chainMetadataOf(deps, row, identity);
|
|
20
|
-
const
|
|
21
|
-
const homeBase = laneHome !== undefined ? { taskHome: laneHome } : {};
|
|
22
|
-
const pathAdjudication = DEPLOYMENT_SHAPE_PREDICATES.sandboxPathAdjudication.holds(config)
|
|
23
|
-
? {
|
|
24
|
-
env: new DeferredSandboxPathEnv({
|
|
25
|
-
sessionId: row.sessionId,
|
|
26
|
-
slots,
|
|
27
|
-
logger: { warn: (event, fields) => logger.warn(event, { ...(fields ?? {}), lane: config.remoteExec.provider, leg: "parked_revive" }) },
|
|
28
|
-
}),
|
|
29
|
-
...homeBase,
|
|
30
|
-
}
|
|
31
|
-
: { env: createHostAdjudicationEnv(config, localRoot), ...homeBase };
|
|
19
|
+
const pathAdjudication = createLegPathAdjudication(config, { sessionId: row.sessionId, leg: "parked_revive", hostArm: () => ({ env: createHostAdjudicationEnv(config, localRoot) }) }, { slots, logger });
|
|
32
20
|
const rootSessionId = row.rootSessionId;
|
|
33
21
|
const baseline = createApprovalBaselinePolicy(config, {
|
|
34
22
|
kind: "durable",
|
package/dist/boot/reapers.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import type { ToolApprovalCoordinator } from "../tool-approval.js";
|
|
|
28
28
|
import type { ParkCommitWatch } from "../plugins/park-commit-watch.js";
|
|
29
29
|
import { type SandboxReaper } from "../plugins/sandbox-reaper.js";
|
|
30
30
|
import { type AuditRotationPort } from "../approval-ask-retention.js";
|
|
31
|
+
import type { HolderPullTally } from "../orchestration/workflow-park-holder.js";
|
|
31
32
|
/** [ref] / [ref]§五(sema-comms `audits/failopen-governance-176.md` §7 "Z 类 1 条"):default consecutive-failure
|
|
32
33
|
* count before a reaper leg's swallowed error gets a `warn` line. The ~15 `.catch(() => undefined)` sites
|
|
33
34
|
* below are correct in DIRECTION (a hiccuping periodic sweep must never crash the whole tick loop — one bad
|
|
@@ -103,6 +104,8 @@ export interface ReapersCtx {
|
|
|
103
104
|
* `TOOL_APPROVAL_ENABLED=false` 的部署恒 undefined ⇒ 收敛器照常收敛,只是不发通知帧(壳侧靠
|
|
104
105
|
* 重连 preamble 对账,见 approval-card.ts 的 `ApprovalRevokeFrame` 顶注)。 */
|
|
105
106
|
toolApproval: ToolApprovalCoordinator | undefined;
|
|
107
|
+
/** workflow 停驻卡持有进程的拉取腿(`orchestration/workflow-park-holder.ts`;第 8 段按决定店 / 执行器视图在场装配)。缺席 = 没有 workflow 停驻车道 ⇒ 本腿零调用。 */
|
|
108
|
+
workflowParkHolderPull?: () => Promise<HolderPullTally>;
|
|
106
109
|
/** [ref]:规则店的**保留期口**。`PERMISSION_RULES_ENABLED=false` 或后端没实装 ⇒ undefined
|
|
107
110
|
* ⇒ 本腿根本不注册(零扫描),与它的同族旋钮腿同姿势。
|
|
108
111
|
*
|
|
@@ -122,6 +125,8 @@ export interface ReapersCtx {
|
|
|
122
125
|
approvalAskAudit: AuditRotationPort | undefined;
|
|
123
126
|
/** 晚绑(server 造出来才有)——见文件头「位置即契约」①。 */
|
|
124
127
|
getRunDenySweep: () => ((now: number) => Promise<void>) | undefined;
|
|
128
|
+
/** 会话老化腿(晚绑:它要的删除协调器在第 9 段铸,`late-binds.ts` 的 `sessionAgeOut`)。缺席 = 这台部署记不了会话种类 / 还没绑 ⇒ 本腿零调用。 */
|
|
129
|
+
getSessionAgeOut?: () => (() => Promise<unknown>) | undefined;
|
|
125
130
|
/** 本车道的沙箱回收座(`plugins/sandbox-reaper.ts`;第 5 段与 run 工厂同一份车道配置铸):k8s 车道 = 沙箱 Pod reaper(`plugins/k8s-pod-reaper.ts`),local-docker 车道 = 无主容器 reaper
|
|
126
131
|
* (`plugins/local-docker-reaper.ts`)。缺席 = 别的车道 ⇒ 本腿零调用。一次部署一条执行车道 ⇒ 一只座、一个节拍。 */
|
|
127
132
|
sandboxReaper?: SandboxReaper;
|
|
@@ -189,7 +194,7 @@ interface ReapSessionsInputs {
|
|
|
189
194
|
* 抛的后果是安全的:core 两条臂的 release 都在 try 内、且计数在 release **之后**递增 ⇒ 抛 = 不计数
|
|
190
195
|
* + 下一 tick 重新枚举重试(失败经济学与 core 的成文一致:泄漏给下一轮,而不是谎报已清)。
|
|
191
196
|
*
|
|
192
|
-
*
|
|
197
|
+
* 抽成具名工厂而不是就地闭包的理由与当年 leader 通告席那只判据函数逐字同一条:判据在**值**上
|
|
193
198
|
* (哪只店被调),源码文本门看不出对错,只有行为测得出来。
|
|
194
199
|
*/
|
|
195
200
|
export declare function createPlacementAwareReapSessions(deps: ReapSessionsInputs): ReapSessionsFacade;
|
package/dist/boot/reapers.js
CHANGED
|
@@ -86,7 +86,7 @@ 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, sandboxReaper, } = 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, getSessionAgeOut, userInputLedger, approvalAskAudit, sandboxReaper, workflowParkHolderPull, } = ctx;
|
|
90
90
|
const leg = (p) => {
|
|
91
91
|
if (p !== undefined)
|
|
92
92
|
trackMaintenanceLeg(p);
|
|
@@ -119,6 +119,7 @@ export function startReapers(ctx) {
|
|
|
119
119
|
const approvalNonceReapExpiredGuard = createThrottledReaperCatch("approval_nonce_reap_expired", logger);
|
|
120
120
|
const runsFailSuspendedExpiredCheckpointGuard = createThrottledReaperCatch("runs_fail_suspended_expired_checkpoint", logger);
|
|
121
121
|
const runDenySweepGuard = createThrottledReaperCatch("run_deny_sweep", logger);
|
|
122
|
+
const sessionAgeOutGuard = createThrottledReaperCatch("session_age_out", logger);
|
|
122
123
|
const runsReapSuspendedGuard = createThrottledReaperCatch("runs_reap_suspended", logger);
|
|
123
124
|
const checkpointReapCtxGuard = createThrottledReaperCatch("checkpoint_reap_ctx", logger);
|
|
124
125
|
const storeSweepGuards = {
|
|
@@ -158,11 +159,13 @@ export function startReapers(ctx) {
|
|
|
158
159
|
const approvalReconcileGuard = createThrottledReaperCatch("approval_reconcile", logger);
|
|
159
160
|
const approvalSuspendedPollGuard = createThrottledReaperCatch("approval_suspended_poll", logger);
|
|
160
161
|
let approvalSuspendedPollInFlight = false;
|
|
162
|
+
const workflowParkHolderPullGuard = createThrottledReaperCatch("workflow_park_holder_pull", logger);
|
|
163
|
+
let workflowParkHolderPullInFlight = false;
|
|
161
164
|
const permissionRuleReapGuard = createThrottledReaperCatch("permission_rule_reap_expired", logger);
|
|
162
165
|
let permissionRuleReapInFlight = false;
|
|
163
166
|
let approvalReconcileInFlight = false;
|
|
164
167
|
const approvalReconciler = (() => {
|
|
165
|
-
if (!
|
|
168
|
+
if (!backend)
|
|
166
169
|
return undefined;
|
|
167
170
|
return createApprovalReconciler({
|
|
168
171
|
askStore: backend.approvalAsk(),
|
|
@@ -265,6 +268,8 @@ export function startReapers(ctx) {
|
|
|
265
268
|
leg(getRunDenySweep()?.(Date.now())
|
|
266
269
|
.then(() => runDenySweepGuard.onSuccess(), runDenySweepGuard.onError));
|
|
267
270
|
}
|
|
271
|
+
leg(getSessionAgeOut?.()?.()
|
|
272
|
+
.then(() => sessionAgeOutGuard.onSuccess(), sessionAgeOutGuard.onError));
|
|
268
273
|
leg(approvalNonceStore
|
|
269
274
|
?.reapExpired()
|
|
270
275
|
.then(reapCount("approval_nonces_reaped_total", {}))
|
|
@@ -360,6 +365,12 @@ export function startReapers(ctx) {
|
|
|
360
365
|
.then(() => approvalSuspendedPollGuard.onSuccess(), approvalSuspendedPollGuard.onError)
|
|
361
366
|
.finally(() => (approvalSuspendedPollInFlight = false)));
|
|
362
367
|
}
|
|
368
|
+
if (workflowParkHolderPull && !workflowParkHolderPullInFlight) {
|
|
369
|
+
workflowParkHolderPullInFlight = true;
|
|
370
|
+
leg(workflowParkHolderPull()
|
|
371
|
+
.then(() => workflowParkHolderPullGuard.onSuccess(), workflowParkHolderPullGuard.onError)
|
|
372
|
+
.finally(() => (workflowParkHolderPullInFlight = false)));
|
|
373
|
+
}
|
|
363
374
|
if (!permissionRuleReapInFlight) {
|
|
364
375
|
permissionRuleReapInFlight = true;
|
|
365
376
|
leg(permissionRuleStores
|
|
@@ -33,9 +33,9 @@ export interface ResolveSpecCtx {
|
|
|
33
33
|
/** 活引用(registry 热应用换引用)—— 见文件头「位置即契约」。 */
|
|
34
34
|
getKeyResolver: () => ReturnType<typeof createKeyResolver>;
|
|
35
35
|
taskAttachmentStore: TaskAttachmentStore | undefined;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
/** 会话登记簿的工作目录那一格(**只读**:这条腿没带工作目录时它是会话上已登记的那一枚)。会话绑定(cwd / shellEnv / inheritEnv)本装配器只判、只算
|
|
37
|
+
* (`LegFacts.sessionBindings`),写在路由层 run 认领之后的唯一提交点(`session-bindings.ts` 的 `commitLegBindings`)—— 律见那只文件头注。 */
|
|
38
|
+
perSessionCwd: ReadonlyMap<string, string>;
|
|
39
39
|
/** 两张 per-session 登记簿的**租户围栏**(codex R1-F1):每次提交对拍本会话的主人,换主即清。
|
|
40
40
|
* 论证(为什么 device lane 把这条从「不需要」变成「必需」)逐字见 `createSessionScopedRegistries` 头注。 */
|
|
41
41
|
fenceSessionOwner: (sid: string, owner: string | null, incarnation?: string) => void;
|
|
@@ -18,6 +18,7 @@ import { headerStr } from "../http/principal-gate.js";
|
|
|
18
18
|
import { routeListFilter } from "../http/owner-access.js";
|
|
19
19
|
import { projectRegistry } from "../capability-facts.js";
|
|
20
20
|
import { projectContextOf } from "../project-context.js";
|
|
21
|
+
import { memorySeedOf, memorySeedScopesOf } from "../project-registry.js";
|
|
21
22
|
import { explicitOperatorOk } from "../http/server.js";
|
|
22
23
|
import { isAtMentionable, matchCatalogModel, pickUserModel, refusedCatalogEntry, terminalCatalogName } from "../model-select.js";
|
|
23
24
|
import { echoModelRef, modelNotAllowedMessage, modelUnavailableMessage, refusedNameLogField } from "../model-entry-refusal.js";
|
|
@@ -59,10 +60,12 @@ import { inertToolListEntryOf } from "../rule-entry-list.js";
|
|
|
59
60
|
import { assertAttachmentIdsShape, assertImageProfileLane, assertInheritEnvServed, assertToolListsReadable, assertWriteFaceAdmitted, bodyImageProfileOf, scenarioRequestedBy } from "../request-form.js";
|
|
60
61
|
import { TENANCY_WALL_CLOCK_BASE_SEC, enableForkFromBody, normalizeRetainSubagentSessions, selfOrchestrationFromBody } from "../task-workflow.js";
|
|
61
62
|
import { redactSecrets } from "../trace/redact.js";
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
63
|
+
import { sandboxPathEnvSlots } from "./deferred-sandbox-path-env.js";
|
|
64
|
+
import { createLegPathAdjudication } from "./leg-path-adjudication.js";
|
|
65
|
+
import { executionLaneOf, laneIsolated, laneWiresExecutionEnv } from "../execution-lane-caps.js";
|
|
64
66
|
import { executionConfigRootOf } from "../execution-config-root.js";
|
|
65
67
|
import { withUnattendedLeg } from "../unattended-permission-mode.js";
|
|
68
|
+
import { bindingsOf } from "../session-bindings.js";
|
|
66
69
|
import { fieldConflictFacts } from "../field-conflict.js";
|
|
67
70
|
function identityAxesOf(auth) {
|
|
68
71
|
const subject = auth?.subject === undefined ? undefined : recoveredSubject(auth.subject);
|
|
@@ -74,7 +77,7 @@ function unrooted(spec) {
|
|
|
74
77
|
return resolved;
|
|
75
78
|
}
|
|
76
79
|
export function createResolveSpec(ctx) {
|
|
77
|
-
const { config, logger, metrics, localRoot, scenarios, principalCaps, centerRuntimeCapsResolver, getKeyResolver, taskAttachmentStore, perSessionCwd,
|
|
80
|
+
const { config, logger, metrics, localRoot, scenarios, principalCaps, centerRuntimeCapsResolver, getKeyResolver, taskAttachmentStore, perSessionCwd, fenceSessionOwner, hookLlm, hookAgent, belowTaskChainPatterns, fleetBus, hookWakeBus, historyAnchors, ownerAware, taskLimitCaps, taskTimeoutSec, selectEnvTool, sendUserFileToolSpec, memoryEngine, memorySyncRunner, durableEnabled, approvalExemptionStore, checkpointStore, imageIndex, perTaskImage, sessionEnvSelection, questionSeat, approverSeat, lockedKeys, loadedSkills, peerDesk, } = ctx;
|
|
78
81
|
const deploymentSkillSources = new Map(loadedSkills.map((k) => [k.spec.name, k.source]));
|
|
79
82
|
const scenarioGate = createScenarioGate({ config, scenarios, principalCaps, logger }, "enforce");
|
|
80
83
|
const sessionHeadOf = headReadOf(ownerAware);
|
|
@@ -85,10 +88,10 @@ export function createResolveSpec(ctx) {
|
|
|
85
88
|
approvalSeat: durableEnabled ? "durable" : "absent",
|
|
86
89
|
singleUserAutoAcceptBaseline: singleUserAutoAcceptBaselineApplies(config),
|
|
87
90
|
});
|
|
88
|
-
const realTaskRootOf = (
|
|
91
|
+
const realTaskRootOf = (legSessionCwd) => {
|
|
89
92
|
if (DEPLOYMENT_SHAPE_PREDICATES.sandboxPathAdjudication.holds(config))
|
|
90
93
|
return undefined;
|
|
91
|
-
const sessionCwd = effectiveHostWorkspace(
|
|
94
|
+
const sessionCwd = effectiveHostWorkspace(legSessionCwd, {});
|
|
92
95
|
return sessionCwd ?? (laneWiresExecutionEnv(config.remoteExec.provider) ? undefined : process.cwd());
|
|
93
96
|
};
|
|
94
97
|
const memoryProjectLayers = createMemoryProjectLayers({ stores: memoryEngine, syncRunner: memorySyncRunner, log: logger });
|
|
@@ -114,13 +117,18 @@ export function createResolveSpec(ctx) {
|
|
|
114
117
|
assertRequestMcpEntries(body.mcpServers);
|
|
115
118
|
const submittedProjectId = auth?.resolvedProjectId ?? (typeof body.projectId === "string" && body.projectId ? body.projectId.toLowerCase() : undefined);
|
|
116
119
|
const legProjectId = await legProjectIdOf(submittedProjectId, sessionWorkspace, root);
|
|
120
|
+
const registryFact = projectRegistry({ config });
|
|
121
|
+
const registry = registryFact.available ? registryFact.registry : undefined;
|
|
122
|
+
const projectViewer = opts?.leg === "fresh" && req !== undefined ? routeListFilter(req, { config }, "project-get") : undefined;
|
|
123
|
+
const memorySeed = opts?.leg === "fresh" ? memorySeedOf(registry, submittedProjectId, projectViewer) : opts?.memorySeed;
|
|
124
|
+
if (opts?.leg !== "fresh" && memorySeed === undefined && submittedProjectId !== undefined)
|
|
125
|
+
logger.warn("resume_memory_seed_unjudged", { sessionId: root, projectId: submittedProjectId, note: "this continuation's stored rebuild input carries no memory-seed judgment (it was parked before this server version judged one), so the project registry's default read layers are not applied to it; submit the work again as a new task to have them" });
|
|
117
126
|
let projectContext;
|
|
118
127
|
if (opts?.leg === "fresh") {
|
|
119
|
-
const registry = projectRegistry({ config });
|
|
120
128
|
const decision = projectContextOf({
|
|
121
129
|
projectId: legProjectId,
|
|
122
|
-
registry
|
|
123
|
-
viewer:
|
|
130
|
+
registry,
|
|
131
|
+
viewer: projectViewer,
|
|
124
132
|
pathsHonored: DEPLOYMENT_SHAPE_PREDICATES.callerOwnsWorkerDisk.holds(config),
|
|
125
133
|
requestCwd: typeof body.cwd === "string" && body.cwd.length > 0,
|
|
126
134
|
projectMemoryOff: body.projectMemory === "disabled",
|
|
@@ -229,12 +237,12 @@ export function createResolveSpec(ctx) {
|
|
|
229
237
|
const gated = await gateScenarioAndAppend(body, auth, root, opts, settingsEnv);
|
|
230
238
|
const effMode = effectivePermissionMode(body, gated.parsedSettings.settings);
|
|
231
239
|
assertWriteFaceAdmitted(effMode, config);
|
|
232
|
-
const lane =
|
|
233
|
-
const anchors = await resolveHistoryAnchors(body, req, auth, root,
|
|
234
|
-
const projectKey = memoryEngine ? await memoryProjectLayers.prepare(config, auth?.memoryScope, realTaskRootOf(
|
|
240
|
+
const lane = judgeSettingsCwdEnvAndModel(body, auth, root, gated, opts, legCwd);
|
|
241
|
+
const anchors = await resolveHistoryAnchors(body, req, auth, root, memorySeedScopesOf(registry, memorySeed), legProjectId);
|
|
242
|
+
const projectKey = memoryEngine ? await memoryProjectLayers.prepare(config, auth?.memoryScope, realTaskRootOf(lane.sessionCwd)) : undefined;
|
|
235
243
|
const runSkills = buildRunSkills({ scenario: gated.cap.skills, request: body.skills, disable: body.disableSkills === true, deploymentSources: deploymentSkillSources }, logger);
|
|
236
244
|
const spec = assembleSpecLiteral(body, auth, root, req, opts, { ...gated, ...lane, ...anchors, projectKey, a2aPeers, storedToolAxes, runSkills, projectBrief: projectContext?.brief }, effMode);
|
|
237
|
-
const folded = await foldGovernanceAndSettings(body, auth, root, spec, gated, projectContext?.brief);
|
|
245
|
+
const folded = await foldGovernanceAndSettings(body, auth, root, spec, gated, projectContext?.brief, lane.sessionCwd);
|
|
238
246
|
const retiredNotice = opts.onNotice !== undefined ? buildNeverAutoRetiredNotice(gated.parsedSettings.settings?.tightenOnly?.neverAuto, root) : undefined;
|
|
239
247
|
if (retiredNotice !== undefined)
|
|
240
248
|
opts.onNotice?.(retiredNotice);
|
|
@@ -243,13 +251,12 @@ export function createResolveSpec(ctx) {
|
|
|
243
251
|
scratchpadDir: folded.scratchpadDir,
|
|
244
252
|
hostSemanticsLane: folded.hostSemanticsLane,
|
|
245
253
|
});
|
|
246
|
-
|
|
247
|
-
return { spec: final, facts: { hands: gated.hands, skills: runSkills.roster, sessionWitness: gated.sessionWitness, ...(registeredCwd !== undefined ? { registeredCwd } : {}), ...(projectContext !== undefined ? { projectContext } : {}) } };
|
|
254
|
+
return { spec: final, facts: { hands: gated.hands, skills: runSkills.roster, sessionWitness: gated.sessionWitness, sessionBindings: lane.sessionBindings, ...(projectContext !== undefined ? { projectContext } : {}), ...(memorySeed !== undefined ? { memorySeed } : {}) } };
|
|
248
255
|
};
|
|
249
256
|
const gateScenarioAndAppend = async (body, auth, root, opts, settingsEnv) => {
|
|
250
257
|
const { parts: subjectParts, person } = identityAxesOf(auth);
|
|
251
258
|
const requestedScenario = scenarioRequestedBy(subjectParts?.scenario, body.scenario);
|
|
252
|
-
const scenarioName = await scenarioGate(person, requestedScenario);
|
|
259
|
+
const { scenario: scenarioName } = await scenarioGate(person, requestedScenario);
|
|
253
260
|
const rootFace = sessionHeadOf === undefined ? undefined : sessionFaceOfHead(root, await sessionHeadOf(root));
|
|
254
261
|
const sessionWitness = { sessionId: root, owner: rootFace?.owner ?? null, incarnation: rootFace?.incarnation ?? null };
|
|
255
262
|
const cap = selectScenario(scenarios, scenarioName)(body, person, { sessionId: sessionWitness.sessionId, delegationRoot: sessionWitness });
|
|
@@ -302,22 +309,24 @@ export function createResolveSpec(ctx) {
|
|
|
302
309
|
}
|
|
303
310
|
return { scenarioName, cap, hands: cap.hands, acceptedAppend, objective, parsedSettings, attachmentNotice, sessionWitness };
|
|
304
311
|
};
|
|
305
|
-
const
|
|
312
|
+
const judgeSettingsCwdEnvAndModel = (body, auth, root, gated, opts, cwd) => {
|
|
306
313
|
const { objective, parsedSettings } = gated;
|
|
307
314
|
const cwdWriteGate = DEPLOYMENT_SHAPE_PREDICATES.callerCwd.holds(config);
|
|
308
315
|
const execLane = config.remoteExec.provider;
|
|
309
316
|
fenceSessionOwner(root, auth?.subject ?? null, opts.execution.occupant?.incarnation);
|
|
317
|
+
let boundCwd;
|
|
310
318
|
if (typeof cwd === "string" && cwd.length > 0) {
|
|
311
319
|
if (cwdWriteGate && isAbsoluteHostPath(cwd))
|
|
312
|
-
|
|
320
|
+
boundCwd = cwd;
|
|
313
321
|
else if (DEPLOYMENT_SHAPE_PREDICATES.noHandsSingleUser.holds(config) && isAbsoluteHostPath(cwd) && satisfiedByProcessCwd(cwd, realpathSync))
|
|
314
322
|
logger.debug("task_cwd_inherited", { lane: execLane, sessionId: root });
|
|
315
323
|
else
|
|
316
324
|
logger.warn("task_cwd_ignored", { honored: cwdWriteGate, lane: execLane, sessionId: root });
|
|
317
325
|
}
|
|
326
|
+
let boundShellEnv;
|
|
318
327
|
if (parsedSettings.settings?.shellEnv) {
|
|
319
328
|
if (cwdWriteGate)
|
|
320
|
-
|
|
329
|
+
boundShellEnv = parsedSettings.settings.shellEnv;
|
|
321
330
|
else if (DEPLOYMENT_SHAPE_PREDICATES.noHandsSingleUser.holds(config)) {
|
|
322
331
|
const requested = parsedSettings.settings.shellEnv;
|
|
323
332
|
const mismatched = shellEnvMismatchCount(requested, process.env);
|
|
@@ -329,6 +338,8 @@ export function createResolveSpec(ctx) {
|
|
|
329
338
|
else
|
|
330
339
|
logger.warn("task_shell_env_ignored", { honored: false, lane: execLane, sessionId: root });
|
|
331
340
|
}
|
|
341
|
+
const sessionCwd = boundCwd ?? perSessionCwd.get(root);
|
|
342
|
+
const sessionBindings = bindingsOf(sessionCwd, boundShellEnv, body.inheritEnv);
|
|
332
343
|
const taskHooks = (() => {
|
|
333
344
|
const hc = parsedSettings.settings?.hooks;
|
|
334
345
|
if (!hc)
|
|
@@ -340,7 +351,7 @@ export function createResolveSpec(ctx) {
|
|
|
340
351
|
return createSettingsHooksRegistrations(hc, {
|
|
341
352
|
logger,
|
|
342
353
|
sessionId: root,
|
|
343
|
-
cwd:
|
|
354
|
+
cwd: sessionCwd ?? process.cwd(),
|
|
344
355
|
hookEnvAllow: config.hookEnvAllow,
|
|
345
356
|
...(parsedSettings.settings?.shellEnv ? { shellEnv: parsedSettings.settings.shellEnv } : {}),
|
|
346
357
|
httpHookAllowlistLayers: parsedSettings.settings?.httpHookAllowlist !== undefined ? [parsedSettings.settings.httpHookAllowlist] : [],
|
|
@@ -390,9 +401,9 @@ export function createResolveSpec(ctx) {
|
|
|
390
401
|
metrics.inc("task_model_unknown_fallback_total");
|
|
391
402
|
logger.warn("task_model_unknown_fallback", { requested: echoModelRef(picked.unknownExplicit), fallback: picked.model, sessionId: root });
|
|
392
403
|
}
|
|
393
|
-
return { taskHooks, additionalDirectories, additionalReadDirectories, wireCatalog, picked };
|
|
404
|
+
return { taskHooks, additionalDirectories, additionalReadDirectories, wireCatalog, picked, sessionBindings, sessionCwd };
|
|
394
405
|
};
|
|
395
|
-
const resolveHistoryAnchors = async (body, req, auth, root,
|
|
406
|
+
const resolveHistoryAnchors = async (body, req, auth, root, s4DefaultScopes, legProjectId) => {
|
|
396
407
|
const anchorReader = req === undefined ? undefined : anchorReaderOf(req, { config, logger }, claimCallerOf(identityAxesOf(auth).subject, config));
|
|
397
408
|
let resumeAtEntryId;
|
|
398
409
|
if (typeof body.resumeAt === "string" && body.resumeAt.length > 0) {
|
|
@@ -406,7 +417,6 @@ export function createResolveSpec(ctx) {
|
|
|
406
417
|
throw new HttpError(501, "rewind-files-to is not available on this worker (no session-store backend for the anchor map)");
|
|
407
418
|
rewindFilesToEntryId = await resolveHistoryAnchor("rewindFilesTo", anchorsResolvable, anchorReader, root, body.rewindFilesTo, auth?.subject ?? null, "rewindFilesTo");
|
|
408
419
|
}
|
|
409
|
-
const s4DefaultScopes = submittedProjectId ? config.projects[submittedProjectId]?.defaultScopes : undefined;
|
|
410
420
|
return { resumeAtEntryId, rewindFilesToEntryId, s4DefaultScopes, legProjectId };
|
|
411
421
|
};
|
|
412
422
|
const declaresInteractivePosture = (body, req, opts) => {
|
|
@@ -433,7 +443,7 @@ export function createResolveSpec(ctx) {
|
|
|
433
443
|
...(body.outputStyle !== undefined ? { outputStyle: body.outputStyle } : {}),
|
|
434
444
|
...(body.projectMemory !== undefined ? { projectMemory: body.projectMemory } : {}),
|
|
435
445
|
...(legProjectId !== undefined ? { projectId: legProjectId } : {}),
|
|
436
|
-
|
|
446
|
+
...taskSpecIdentityOf(subjectParts),
|
|
437
447
|
images: body.images,
|
|
438
448
|
...(body.userAttachments !== undefined ? { userAttachments: body.userAttachments } : {}),
|
|
439
449
|
...(body.clientContext ? { clientContext: { timeZone: body.clientContext.timeZone, userEmail: body.clientContext.userEmail } } : {}),
|
|
@@ -471,7 +481,7 @@ export function createResolveSpec(ctx) {
|
|
|
471
481
|
...(declaresInteractivePosture(body, req, opts) ? { interactionPosture: "interactive" } : {}),
|
|
472
482
|
...(body.approvalReach !== undefined ? { approvalReach: body.approvalReach } : {}),
|
|
473
483
|
...(typeof body.oneShot === "boolean" ? { oneShot: body.oneShot } : {}),
|
|
474
|
-
resilience: normalizeResilience(body.resilience, explicitOperatorOk(person, config)),
|
|
484
|
+
resilience: normalizeResilience(body.resilience, explicitOperatorOk(person, config, "operate")),
|
|
475
485
|
finalVerification: cap.finalVerification === true || body.finalVerification === true ? true : undefined,
|
|
476
486
|
attachments: normalizeAttachments(body.attachments),
|
|
477
487
|
...(taskHooks.length > 0 ? { mods: [...taskHooks] } : {}),
|
|
@@ -584,32 +594,17 @@ export function createResolveSpec(ctx) {
|
|
|
584
594
|
};
|
|
585
595
|
return spec;
|
|
586
596
|
};
|
|
587
|
-
const foldGovernanceAndSettings = async (body, auth, root, spec, gated, projectBrief) => {
|
|
597
|
+
const foldGovernanceAndSettings = async (body, auth, root, spec, gated, projectBrief, legSessionCwd) => {
|
|
588
598
|
const { acceptedAppend, parsedSettings } = gated;
|
|
589
599
|
const hostSemanticsLane = !DEPLOYMENT_SHAPE_PREDICATES.sandboxPathAdjudication.holds(config);
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const pathAdjudication = hostSemanticsLane
|
|
595
|
-
? (() => {
|
|
596
|
-
const realRoot = realTaskRootOf(root);
|
|
600
|
+
const pathAdjudication = createLegPathAdjudication(config, {
|
|
601
|
+
sessionId: root,
|
|
602
|
+
hostArm: () => {
|
|
603
|
+
const realRoot = realTaskRootOf(legSessionCwd);
|
|
597
604
|
const gateCwd = realRoot ?? join(config.localDataRoot ?? localRoot, "fs-write-gate-unrooted");
|
|
598
|
-
return {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
...(realRoot !== undefined ? { taskRoot: realRoot } : {}),
|
|
602
|
-
...laneHomeBase(),
|
|
603
|
-
};
|
|
604
|
-
})()
|
|
605
|
-
: {
|
|
606
|
-
env: new DeferredSandboxPathEnv({
|
|
607
|
-
sessionId: root,
|
|
608
|
-
slots: sandboxPathEnvSlots,
|
|
609
|
-
logger: { warn: (event, fields) => logger.warn(event, { ...(fields ?? {}), lane: config.remoteExec.provider }) },
|
|
610
|
-
}),
|
|
611
|
-
...laneHomeBase(),
|
|
612
|
-
};
|
|
605
|
+
return { env: new NodeExecutionEnv({ cwd: gateCwd }), cwd: gateCwd, ...(realRoot !== undefined ? { taskRoot: realRoot } : {}) };
|
|
606
|
+
},
|
|
607
|
+
}, { slots: sandboxPathEnvSlots, logger });
|
|
613
608
|
const governedBase = applyRuntimeGovernance(spec, createDeploymentGovernanceInputs(config, pathAdjudication));
|
|
614
609
|
let governed = governedBase;
|
|
615
610
|
let effectiveSettings = parsedSettings.settings;
|
|
@@ -668,7 +663,7 @@ export function createResolveSpec(ctx) {
|
|
|
668
663
|
const resolved = await resolveSandboxImageRef({
|
|
669
664
|
profile: taskImageProfile,
|
|
670
665
|
...(capsNeeded && capsNeeded.length > 0 ? { capabilitiesNeeded: capsNeeded } : {}),
|
|
671
|
-
viewer: { operator: explicitOperatorOk(person, config), tenantId: person ?? null },
|
|
666
|
+
viewer: { operator: explicitOperatorOk(person, config, "operate"), tenantId: person ?? null },
|
|
672
667
|
index: imageIndex,
|
|
673
668
|
});
|
|
674
669
|
if (!resolved.ok)
|
|
@@ -206,6 +206,13 @@ export interface RunnerDepsCtx {
|
|
|
206
206
|
sharedMemoryStores: RunnerDeps["sharedMemoryStores"];
|
|
207
207
|
toolResultStore: ToolResultStoreFull | undefined;
|
|
208
208
|
sessionPolicyStore: ReturnType<StoreBackend["sessionPolicy"]> | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* [ref] §K —— per-principal 运行期准入的**收紧面**(`boot/runtime-caps.ts` 一处合成;缺席 = 这条部署腿没有 per-principal 收紧,
|
|
211
|
+
* 部署级缺省照管)。进{@link createSharedRunnerDeps 共享基座}:引擎按腿以 `spec.principal` 解它(每条腿各解一次),委派子代的主体由引擎的
|
|
212
|
+
* 父 spec 座继承 —— 子腿是同一个主体,跑它的那只 Runner 不挂 = 中心对这个主体的拒位(bypass / fork / 自编排 / auto / 强制门 / 观察者 /
|
|
213
|
+
* 记忆 opt-out)与中心硬故障时的 fail-closed 降级项一位都到不了子腿(安全轴 fail-open)。它不是会话设施(不同于 selfOrchestration /
|
|
214
|
+
* scheduler / memory 那几席),所以没有「子腿刻意不给」的理由。
|
|
215
|
+
*/
|
|
209
216
|
runtimeCapsResolver: RunnerDeps["runtimeCapsResolver"];
|
|
210
217
|
/** [ref] per-edited-file rewind history (core `RunnerDeps.fileHistoryStore`; replaces the retired E19
|
|
211
218
|
* whole-tree snapshot seat — core 94632197 renamed the seat, not a coexistence). WIRING IS THE OPT-IN.
|
|
@@ -238,7 +245,7 @@ export interface RunnerDepsCtx {
|
|
|
238
245
|
lspManager: RunnerDeps["lspManager"];
|
|
239
246
|
fleetBus: FleetEventBus;
|
|
240
247
|
/** 部署座的 mods 注册(起服第 5 段装配口 `assembleDeploymentMods` 铸:自铸 + 运维声明的包,起服自证过)—— 主 / handless / hookAgent / sub 经本共享基座、
|
|
241
|
-
* leader 车道的路由 / worker /
|
|
248
|
+
* leader 车道的路由 / worker / 修复腿经部署平面层(同一铸点),每一只 Runner 同一份。 */
|
|
242
249
|
deploymentMods: NonNullable<RunnerDeps["mods"]>;
|
|
243
250
|
workflowRunStore: WorkflowRunStore | undefined;
|
|
244
251
|
workflowJournalStore: ServiceWorkflowJournalStore | undefined;
|
|
@@ -246,9 +253,22 @@ export interface RunnerDepsCtx {
|
|
|
246
253
|
workflowNotifyGate: WorkflowNotifyGate | undefined;
|
|
247
254
|
deliverWorkflowCompletion: (p: WorkflowCompletionPayload) => Promise<void>;
|
|
248
255
|
}
|
|
249
|
-
/**
|
|
250
|
-
*
|
|
251
|
-
|
|
256
|
+
/**
|
|
257
|
+
* **部署平面层**:一台部署对**每一条腿说同一句话**的键 —— 收紧面(治理三座 / 按主体准入 / MCP 撤销台账 / 部署姿态座席族 / 豁免根)+ 计量面
|
|
258
|
+
* (tracer / 治理窗两键)+ 服务表(brain / 模型目录 / 定价 / 提示词目录)+ 部署座 / 手带 + 两条披露出口(通告 / 错误)。
|
|
259
|
+
* 律:本进程每一只跑带主体 spec 的 Runner —— 主 / 无手 / hook 代理 / 子代 / run-local,**以及 leader 车道的每一只** —— 展开**同一层**
|
|
260
|
+
* ({@link createDeploymentPlaneDeps},唯一铸点);新的部署键进这一层即到达全部 Runner,没有哪条车道逐席搬运。
|
|
261
|
+
* 不在这一层的是**会话设施**({@link SessionFacilityDeps}):各车道按自己的生命周期自选(leader 的沙盒、停驻店与会话店归 leader)。
|
|
262
|
+
*/
|
|
263
|
+
export type DeploymentPlaneDeps = Pick<RunnerDeps, "brain" | "models" | "roles" | "tiers" | "pricing" | "tracer" | "promptSource" | keyof DeploymentPostureSeats | "mods" | "hands" | "usageWindows" | "usageWindowStore" | "compliancePostureResolver" | "lockedConfig" | "retentionPolicy" | "onNotice" | "onError" | "runtimeCapsResolver" | "mcpRevocations" | "memoryEngineDir">;
|
|
264
|
+
/**
|
|
265
|
+
* **会话设施层**:停驻店、卸载店、后台子代店 / 信箱 / 名册、文件历史、会话规则、记忆三席、LSP、对端座、执行环境工厂 —— 按会话 / 车道的
|
|
266
|
+
* 生命周期选,不是部署对每条腿说的话。起服的主 / 子 Runner 与 run-local 经共享基座取全套;leader 车道不取(它的沙盒、停驻店、会话店按 worker
|
|
267
|
+
* 自己的生命周期给,`leader/wire.ts`)。
|
|
268
|
+
*/
|
|
269
|
+
export type SessionFacilityDeps = Pick<RunnerDeps, "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "toolResultStore" | "checkpointStore" | "fileHistoryStore" | "fileHistoryCapture" | "sessionPolicyStore" | "memoryScopeAdmission" | "deploymentMemoryScopes" | "sharedMemoryStores" | "peerSeat">;
|
|
270
|
+
/** 共享基座 = 部署平面层 + 会话设施层(起服主 / 子 Runner 与 run-local 的两只 Runner 展开它)。 */
|
|
271
|
+
export type SharedRunnerDeps = DeploymentPlaneDeps & SessionFacilityDeps;
|
|
252
272
|
/**
|
|
253
273
|
* [ref] A10 留档发现②(review 2026-07-29,[ref]§三族A 同源修补的延续):main runner 的
|
|
254
274
|
* `RunnerDeps` 字面量(下方 `createRunnerDeps`)与 `main.ts` 里 subRunner 的 `new Runner({...})`
|
|
@@ -274,8 +294,17 @@ export type SharedRunnerDeps = Pick<RunnerDeps, "brain" | "readFace" | "readDeny
|
|
|
274
294
|
* [ref]§三族A 已用「直引 `runnerDeps.X`」修过(main.ts 两处引用同一个 `runnerDeps` 实例的同一
|
|
275
295
|
* 属性,比再抽一层共享基座更强的同源保证),不重复收纳进这里。
|
|
276
296
|
*/
|
|
277
|
-
/**
|
|
278
|
-
|
|
297
|
+
/** 部署平面层的输入(窄面)。`onError` = 本进程的错误汇(起服 = `createRunnerDeps` 铸的那一只,run-local = 它自己的那一只):必填键(值可缺席),
|
|
298
|
+
* 每个平面层调用点都得回答「这条腿的引擎错误交给谁」—— 它是按主体准入 resolver 抛 / 治理窗最终扣账失败的唯一出口,与 resolver、窗席同生共死。 */
|
|
299
|
+
export type DeploymentPlaneCtx = Pick<RunnerDepsCtx, "config" | "brain" | "pricing" | "tracer" | "promptSource" | "deploymentMods" | "usageWindowStore" | "logger" | "governanceSeams" | "mcpRevocations" | "metrics" | "engineDataRoot" | "runtimeCapsResolver"> & {
|
|
300
|
+
readonly onError: RunnerDeps["onError"];
|
|
301
|
+
};
|
|
302
|
+
/** 平面层里**车道给**的一格:提交署名(`hands.commitCoAuthor`;起服 / run-local 各按品牌算一次,leader 车道不署名 ⇒ `undefined`)。 */
|
|
303
|
+
export interface DeploymentPlaneLane {
|
|
304
|
+
readonly commitCoAuthor: RunnerDepsCtx["commitCoAuthor"];
|
|
305
|
+
}
|
|
306
|
+
/** 共享基座的输入 = 平面层的输入 + 会话设施的输入。 */
|
|
307
|
+
export type SharedRunnerDepsCtx = DeploymentPlaneCtx & Pick<RunnerDepsCtx, "executionEnvFactory" | "lspManager" | "backgroundAgentStore" | "mailboxStore" | "rosterStore" | "toolResultStore" | "checkpointStore" | "fileHistoryStore" | "sessionPolicyStore" | "commitCoAuthor" | "orgMemoryAdmission" | "sharedMemoryStores" | "peerDesk">;
|
|
279
308
|
/** 转发席只需要 `inc` —— 刻意窄到这一个动词,免得把整只 Metrics 拖进这条纯转发腿。 */
|
|
280
309
|
export interface EngineNoticeMetricsSeat {
|
|
281
310
|
inc: (name: string, labels?: Record<string, string>) => void;
|
|
@@ -292,39 +321,14 @@ export declare function createEngineNoticeForwarder(logger: {
|
|
|
292
321
|
export declare function installDefaultEngineNoticeSeat(logger: {
|
|
293
322
|
warn: (msg: string, fields?: Record<string, unknown>) => void;
|
|
294
323
|
}, metrics?: EngineNoticeMetricsSeat): void;
|
|
295
|
-
/**
|
|
296
|
-
* `onNotice` **席**的装配判据本身 —— 「`warn` 真在场才铸席」这一条从此是**一个可直接调用的函数**,
|
|
297
|
-
* 不是散在装配点、只能靠扫源码文本去猜的一行三元(codex 交叉复审 R1-[medium],验真后修)。
|
|
298
|
-
*
|
|
299
|
-
* 病(实测):把 leader 的门写成 `cfg.logger ? ((m, x) => cfg.logger?.warn?.(m, x)) : undefined` 时,
|
|
300
|
-
* 「装配点切片里出现过 `warn` 这个词」这类**源码文本**判据一律照绿 —— 而只装了 `info` 的部署会拿到一个
|
|
301
|
-
* truthy 闭包、照样铸席,通告随后被可选链**静默吞掉**,比不铸席更坏(不铸时 core 至少还打它自己的
|
|
302
|
-
* `console.warn`,响亮权留在原处)。任何「在这段文本里找关键字」的门都挡不住这一族变异,因为病灶在
|
|
303
|
-
* **值**(闭包 truthy)而不在字面。⇒ 把判据搬进函数,让它可以被**行为**测:info-only ⇒ 空席;带 warn ⇒
|
|
304
|
-
* 具名转发体。
|
|
305
|
-
*
|
|
306
|
-
* 命名(CLAUDE.md 工厂律):返回的袋子里装的是**活闭包**(有行为)⇒ `create*`,不是 `build*`。
|
|
307
|
-
* 返回**展开形**(`{}` 或 `{ onNotice }`)而不是 `onNotice: undefined`。理由是**键卫生**,不是 core 行为
|
|
308
|
-
* (R3 复扫更正:core 5.28 的 `deliverEngineNotice` 只判 `typeof onNotice === "function"`,显式 `undefined`
|
|
309
|
-
* 与键缺席在 core 那侧行为逐字相同、响亮权都留在 core——旧句「显式 undefined 也算 host 接管」与真码相反):
|
|
310
|
-
* 展开形让 `new Runner({...seat})` 的键集只随真装配变化,EXPECTED_SHARED_KEYS 类的键集绊线才数得准。
|
|
311
|
-
*/
|
|
312
|
-
export declare function createEngineNoticeSeat(logger: {
|
|
313
|
-
warn?: (msg: string, fields?: Record<string, unknown>) => void;
|
|
314
|
-
} | undefined, router?: EngineNoticeRouter): {
|
|
315
|
-
onNotice?: NonNullable<RunnerDeps["onNotice"]>;
|
|
316
|
-
};
|
|
317
324
|
/**
|
|
318
325
|
* [ref](黑板 [ref],[ref] 登记)—— **部署姿态座席族**:运维在配置面写下的姿态(READ 面四席 + 记忆三席 +
|
|
319
326
|
* 委派入口 caps)。core 明写「每个 run 读**准备它的那只 Runner** 的 deps」⇒ 一台部署里跑任务的**每一只**
|
|
320
|
-
* Runner
|
|
321
|
-
*
|
|
322
|
-
* 五处 `...deploymentPostureSeat`)。
|
|
327
|
+
* Runner 都必须带同一份:本进程每一只 Runner 经部署平面层({@link createDeploymentPlaneDeps})展开它 —— 主 runner / subRunner /
|
|
328
|
+
* run-local 经共享基座,leader 车道的四只经 `LeaderWireConfig.plane`。
|
|
323
329
|
*
|
|
324
330
|
* 🔴 本函数是这一族**唯一**的取值点。两处各读一遍 config 就是 [ref]§三族A「主挂了、副漏挂」的病族形——
|
|
325
|
-
* [ref] 正是 leader
|
|
326
|
-
* `test/memory-delegation-evidence-lane.test.ts` ⑤ 组的机器门如实登记,现已翻成正向门)。leader 不许自己
|
|
327
|
-
* 再读 config 铸一份,只吃本函数经 cfg 递过去的产物(`test/leader-deployment-posture-seats.test.ts` ③ 钉)。
|
|
331
|
+
* [ref] 正是 leader 那条腿漏了**全族**。平面层每次铸都现调本函数(中心热换 READ 面之后新构造的 Runner 读新档,[ref])。
|
|
328
332
|
*
|
|
329
333
|
* 纯数据(键值全是 config 透传,无闭包)⇒ `build*`(CLAUDE.md 工厂律)。键**恒在场**、缺席 = `undefined`
|
|
330
334
|
* ([ref] S4 house style;core 消费点全按 `!== undefined` / `??` 判 —— dist
|
|
@@ -352,7 +356,7 @@ export declare function crossBoundaryPostureOf(requirePrincipal: boolean): Cross
|
|
|
352
356
|
/**
|
|
353
357
|
* 手带(`RunnerDeps.hands`)的**唯一**铸点(纯数据 ⇒ `build*`)。两格两个来源:署名由腿给(两条腿判据不同,见 {@link RunnerDepsCtx.commitCoAuthor};
|
|
354
358
|
* leader 车道今天不署名,显式交 `undefined`),前台命令超时转后台读部署旋钮 `AUTO_BACKGROUND_ON_TIMEOUT` —— 旋钮的读点只有这里。
|
|
355
|
-
*
|
|
359
|
+
* 部署平面层调这一只(署名一格由车道给,{@link DeploymentPlaneLane}):
|
|
356
360
|
* 有手的每一只 Runner 都拿到它,`/health.autoBackgroundOnTimeout` 说「生效」时没有哪只 Runner 例外。
|
|
357
361
|
*/
|
|
358
362
|
export declare function buildHandsBand(config: Pick<ServiceConfig, "autoBackgroundOnTimeout">, commitCoAuthor: RunnerDepsCtx["commitCoAuthor"]): NonNullable<RunnerDeps["hands"]>;
|
|
@@ -364,6 +368,13 @@ export declare function buildDeploymentPostureSeats(config: DeploymentPostureCon
|
|
|
364
368
|
* 喂的是 `config.readDenyPatterns`(运维 ∪ 中心 read-face 的行),不是座席族并入 LKG 派生行之后的那一份 —— 派生行是根锚。绝不抛(纯诊断面)。
|
|
365
369
|
*/
|
|
366
370
|
export declare function announceReadDenyRows(config: Pick<ServiceConfig, "readDenyPatterns">, logger: Pick<Logger, "warn">): void;
|
|
371
|
+
/**
|
|
372
|
+
* **部署平面层的唯一铸点**({@link DeploymentPlaneDeps})。纯函数、无副作用(读拒行的进场告知留在共享基座 —— leader 每构造一只 Runner 调本函数一次,
|
|
373
|
+
* 告知不随它重复)。每次调用现读 `config`:部署姿态座席族与模型目录会被中心热换,逐调用现构的 Runner(leader 车道)读到的是构造那一刻的代,
|
|
374
|
+
* 与主车道经 swap 门换代同代([ref]);起服的主 / 子 Runner 各展开一次,同一份 ctx ⇒ 同值同引用。
|
|
375
|
+
* 署名一格车道给({@link DeploymentPlaneLane});其余每一格对每一条腿同一句话。
|
|
376
|
+
*/
|
|
377
|
+
export declare function createDeploymentPlaneDeps(ctx: DeploymentPlaneCtx, lane: DeploymentPlaneLane): DeploymentPlaneDeps;
|
|
367
378
|
export declare function createSharedRunnerDeps(ctx: SharedRunnerDepsCtx): SharedRunnerDeps;
|
|
368
379
|
/**
|
|
369
380
|
* 这台部署**声明本机属主的规则桶**吗(core `RunnerDeps.localOwnerRules`:不带主体的 run 经规则店的 `forLocalOwner()` 读持久规则,而不是读零规则)。
|