@sema-agent/server 7.138.0 → 7.140.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 +457 -7
- package/README.md +7 -4
- package/README.zh-CN.md +6 -4
- package/USAGE.md +91 -41
- package/deploy/sema-up/README.md +1 -1
- package/deploy/sema-up/lib/lanes.json +3 -2
- package/dist/adoption/runner.js +1 -1
- package/dist/adoption/sql.js +1 -1
- package/dist/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +26 -26
- package/dist/bench/s1/arms.d.ts +1 -1
- package/dist/bench/s1/arms.js +1 -3
- package/dist/bench/s1/live-deps.js +3 -2
- package/dist/bench/s1/row.d.ts +5 -2
- package/dist/bench/s1/row.js +2 -22
- package/dist/bench/s1/run-firm.js +2 -2
- package/dist/boot/adoption.js +1 -1
- package/dist/boot/device-lane.d.ts +8 -3
- package/dist/boot/device-lane.js +7 -2
- package/dist/boot/execution-env.d.ts +4 -2
- package/dist/boot/execution-env.js +28 -34
- package/dist/boot/execution-lane.d.ts +9 -1
- package/dist/boot/execution-lane.js +6 -1
- package/dist/boot/governance-seams.d.ts +3 -2
- package/dist/boot/governance-seams.js +9 -11
- package/dist/boot/memory-boundary.d.ts +14 -51
- package/dist/boot/memory-boundary.js +10 -20
- package/dist/boot/memory-consolidation.d.ts +15 -11
- package/dist/boot/memory-consolidation.js +25 -14
- package/dist/boot/resolve-spec.d.ts +4 -6
- package/dist/boot/resolve-spec.js +10 -13
- package/dist/boot/retention-lane.d.ts +5 -5
- package/dist/boot/retention-lane.js +0 -6
- package/dist/boot/runner-deps.d.ts +6 -4
- package/dist/boot/runner-deps.js +3 -1
- package/dist/boot/session-faces.d.ts +0 -3
- package/dist/boot/session-faces.js +15 -8
- package/dist/boot/stage-02-web-admin-pull.js +2 -2
- package/dist/boot/stage-03-store-backend.d.ts +2 -6
- package/dist/boot/stage-03-store-backend.js +2 -3
- package/dist/boot/stage-04-stores.d.ts +2 -6
- package/dist/boot/stage-04-stores.js +5 -5
- package/dist/boot/stage-05-execution-env.d.ts +2 -6
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +2 -6
- package/dist/boot/stage-06-runners.js +2 -3
- package/dist/boot/stage-07-capability-layer.d.ts +2 -6
- package/dist/boot/stage-08-reapers.d.ts +2 -6
- package/dist/boot/stage-09-leader.d.ts +2 -6
- package/dist/boot/stage-09-leader.js +1 -2
- package/dist/boot/stage-10-http-server.d.ts +2 -6
- package/dist/boot/stage-10-http-server.js +7 -6
- package/dist/boot/stores.d.ts +3 -6
- package/dist/boot/stores.js +27 -40
- package/dist/boot/task-list-lane.d.ts +1 -1
- package/dist/boot/task-list-lane.js +1 -1
- package/dist/boot/web-admin.js +37 -11
- package/dist/capabilities/execution-lane.d.ts +2 -2
- package/dist/capabilities/mcp-probe.js +1 -1
- package/dist/capabilities/scenarios.d.ts +1 -1
- package/dist/capability-facts.d.ts +15 -7
- package/dist/capability-facts.js +8 -3
- package/dist/config-catalog.js +9 -8
- package/dist/config-invariants.d.ts +23 -3
- package/dist/config-invariants.js +42 -0
- package/dist/config-provider.d.ts +33 -37
- package/dist/config-provider.js +51 -30
- package/dist/config-types.d.ts +21 -7
- package/dist/config.d.ts +33 -0
- package/dist/config.js +46 -16
- package/dist/delegated-session-owner.d.ts +4 -3
- package/dist/delegated-session-owner.js +1 -1
- package/dist/deployment-shape.d.ts +10 -9
- package/dist/deployment-shape.js +4 -4
- package/dist/device-enrollment.d.ts +41 -2
- package/dist/device-enrollment.js +27 -12
- package/dist/device-store.d.ts +58 -85
- package/dist/device-store.js +19 -49
- package/dist/device-ws-hub.js +2 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -4
- package/dist/exec-cut.d.ts +60 -0
- package/dist/exec-cut.js +36 -0
- package/dist/execution-lane-caps.d.ts +115 -105
- package/dist/execution-lane-caps.js +76 -82
- package/dist/execution-placement.d.ts +259 -0
- package/dist/execution-placement.js +199 -0
- package/dist/field-conflict.d.ts +3 -2
- package/dist/field-conflict.js +1 -0
- package/dist/hosted-posture.d.ts +2 -2
- package/dist/http/admission.js +8 -19
- package/dist/http/checkpoint-ctx.d.ts +21 -12
- package/dist/http/checkpoint-ctx.js +4 -2
- package/dist/http/claimed-run.d.ts +1 -1
- package/dist/http/durable-run-leg.js +9 -5
- package/dist/http/execution-context.d.ts +218 -0
- package/dist/http/execution-context.js +330 -0
- package/dist/http/memory-compliance-failure-reply.d.ts +3 -1
- package/dist/http/memory-compliance-failure-reply.js +5 -0
- package/dist/http/memory-layer-reply.d.ts +30 -0
- package/dist/http/memory-layer-reply.js +24 -0
- package/dist/http/resume-legs.js +63 -36
- package/dist/http/retired-service-deps.d.ts +1 -1
- package/dist/http/retired-service-deps.js +1 -1
- package/dist/http/route-ctx.d.ts +14 -8
- package/dist/http/routes/adoption.js +1 -1
- package/dist/http/routes/background.d.ts +29 -1
- package/dist/http/routes/background.js +29 -2
- package/dist/http/routes/devices.d.ts +13 -19
- package/dist/http/routes/devices.js +21 -26
- package/dist/http/routes/memory-bundle.js +3 -0
- package/dist/http/routes/memory-compliance.js +8 -1
- package/dist/http/routes/memory-consolidation.js +12 -1
- package/dist/http/routes/memory-origin.js +14 -2
- package/dist/http/routes/memory-policy.js +5 -0
- package/dist/http/routes/session-sync.js +110 -15
- package/dist/http/routes/sessions.d.ts +6 -0
- package/dist/http/routes/sessions.js +143 -22
- package/dist/http/routes/side-query.d.ts +12 -4
- package/dist/http/routes/side-query.js +4 -5
- package/dist/http/routes/tasks.js +41 -33
- package/dist/http/server.d.ts +40 -44
- package/dist/http/server.js +13 -2
- package/dist/http/session-inherit-env.d.ts +3 -4
- package/dist/http/session-inherit-env.js +1 -1
- package/dist/http/wire-types.d.ts +8 -12
- package/dist/identity-source.d.ts +1 -1
- package/dist/identity-source.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lane-home-probe.d.ts +68 -42
- package/dist/lane-home-probe.js +53 -30
- package/dist/leader/wire.js +5 -4
- package/dist/memory-bundle-engine.d.ts +16 -9
- package/dist/memory-bundle-engine.js +29 -6
- package/dist/memory-operator-faces.d.ts +85 -30
- package/dist/memory-operator-faces.js +136 -30
- package/dist/memory-project-layer.d.ts +3 -21
- package/dist/memory-project-layer.js +11 -8
- package/dist/memory-scope-stores.d.ts +73 -0
- package/dist/memory-scope-stores.js +86 -0
- package/dist/memory-scope.d.ts +29 -5
- package/dist/memory-scope.js +16 -4
- package/dist/memory-sync-client.d.ts +70 -18
- package/dist/memory-sync-client.js +215 -117
- package/dist/memory-sync.d.ts +1 -1
- package/dist/memory-sync.js +3 -2
- package/dist/observability/cost-taxonomy.d.ts +2 -2
- package/dist/observability/fail-open.d.ts +12 -0
- package/dist/observability/fail-open.js +12 -0
- package/dist/observability/run-terminal.js +0 -1
- package/dist/orchestration/workflow-notify-journal.js +4 -4
- package/dist/org-memory-admission.d.ts +4 -3
- package/dist/org-memory-admission.js +6 -6
- package/dist/parked-decide.d.ts +34 -9
- package/dist/parked-decide.js +12 -19
- package/dist/parked-revive-surface.d.ts +12 -15
- package/dist/parked-revive-surface.js +3 -6
- package/dist/peer-seat.d.ts +13 -7
- package/dist/peer-seat.js +37 -3
- package/dist/plugins/adoption-log-sql.js +4 -4
- package/dist/plugins/approval-ask-store-file.d.ts +7 -0
- package/dist/plugins/approval-ask-store-file.js +11 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +6 -0
- package/dist/plugins/approval-ask-store-memory.js +12 -0
- package/dist/plugins/approval-ask-store-sql.d.ts +22 -5
- package/dist/plugins/approval-ask-store-sql.js +44 -26
- package/dist/plugins/approval-nonce-store.js +4 -4
- package/dist/plugins/blob-backend.d.ts +4 -4
- package/dist/plugins/blob-backend.js +7 -7
- package/dist/plugins/breaker-state-sql.js +2 -2
- package/dist/plugins/caching-session-store.d.ts +6 -2
- package/dist/plugins/caching-session-store.js +9 -3
- package/dist/plugins/checkpoint-index-columns.js +2 -2
- package/dist/plugins/checkpoint-store-sql.d.ts +6 -5
- package/dist/plugins/checkpoint-store-sql.js +21 -23
- package/dist/plugins/device-store-sql.d.ts +25 -51
- package/dist/plugins/device-store-sql.js +68 -122
- package/dist/plugins/ensure-index.d.ts +1 -2
- package/dist/plugins/execution-placement-sql.d.ts +151 -0
- package/dist/plugins/execution-placement-sql.js +223 -0
- package/dist/plugins/file-history-store-sql.d.ts +9 -8
- package/dist/plugins/file-history-store-sql.js +9 -9
- package/dist/plugins/file-run-store.d.ts +6 -1
- package/dist/plugins/file-run-store.js +4 -0
- package/dist/plugins/fork-routing-session-store.d.ts +6 -0
- package/dist/plugins/fork-routing-session-store.js +16 -0
- package/dist/plugins/image-bake-store-sql.js +9 -9
- package/dist/plugins/image-index-sql.js +11 -11
- package/dist/plugins/leader-run-store-sql.js +4 -4
- package/dist/plugins/local-session-store.d.ts +149 -50
- package/dist/plugins/local-session-store.js +382 -107
- package/dist/plugins/mailbox-store-sql.d.ts +2 -1
- package/dist/plugins/mailbox-store-sql.js +4 -4
- package/dist/plugins/memory-engine-tidb.js +5 -5
- package/dist/plugins/memory-key-guards.d.ts +4 -0
- package/dist/plugins/memory-key-guards.js +1 -0
- package/dist/plugins/memory-optout-grant-store-sql.js +1 -1
- package/dist/plugins/memory-run-store.d.ts +1 -1
- package/dist/plugins/memory-sync-store-tidb.js +3 -3
- package/dist/plugins/one-time-migrations.d.ts +117 -8
- package/dist/plugins/one-time-migrations.js +408 -38
- package/dist/plugins/org-delivery-quota-store.js +2 -2
- package/dist/plugins/outcome-ledger-sql.d.ts +2 -2
- package/dist/plugins/outcome-ledger-sql.js +2 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +17 -19
- package/dist/plugins/permission-rule-store-sql.js +29 -32
- package/dist/plugins/pg-pool.d.ts +7 -3
- package/dist/plugins/pg-session-storage.d.ts +31 -20
- package/dist/plugins/pg-session-storage.js +120 -52
- package/dist/plugins/remote-env-adb.d.ts +18 -19
- package/dist/plugins/remote-env-adb.js +91 -66
- package/dist/plugins/remote-env-device.d.ts +23 -31
- package/dist/plugins/remote-env-device.js +19 -17
- package/dist/plugins/remote-env-e2b.d.ts +27 -21
- package/dist/plugins/remote-env-e2b.js +91 -45
- package/dist/plugins/remote-env-file-error.d.ts +3 -1
- package/dist/plugins/remote-env-file-error.js +9 -3
- package/dist/plugins/remote-env-host.d.ts +31 -34
- package/dist/plugins/remote-env-host.js +91 -72
- package/dist/plugins/remote-env-k8s.d.ts +13 -29
- package/dist/plugins/remote-env-k8s.js +63 -55
- package/dist/plugins/remote-env-local-docker.d.ts +24 -12
- package/dist/plugins/remote-env-local-docker.js +49 -61
- package/dist/plugins/remote-env-ssh.d.ts +11 -19
- package/dist/plugins/remote-env-ssh.js +74 -57
- package/dist/plugins/remote-shell.d.ts +100 -3
- package/dist/plugins/remote-shell.js +166 -2
- package/dist/plugins/resume-anchor-store-sql.js +2 -2
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.js +2 -2
- package/dist/plugins/retention-store-sql.d.ts +10 -7
- package/dist/plugins/retention-store-sql.js +13 -7
- package/dist/plugins/run-store-sql.d.ts +13 -3
- package/dist/plugins/run-store-sql.js +20 -15
- package/dist/plugins/schema-consistency.d.ts +21 -11
- package/dist/plugins/schema-consistency.js +15 -9
- package/dist/plugins/schema-drift-sentence.d.ts +27 -0
- package/dist/plugins/schema-drift-sentence.js +38 -0
- package/dist/plugins/schema-ensure-legs.d.ts +2 -3
- package/dist/plugins/schema-ensure-legs.js +2 -2
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-capture-record-store-sql.js +1 -1
- package/dist/plugins/session-fork.d.ts +54 -0
- package/dist/plugins/session-fork.js +38 -1
- package/dist/plugins/session-row-sql.d.ts +22 -0
- package/dist/plugins/session-row-sql.js +81 -0
- package/dist/plugins/session-rules-column.d.ts +1 -1
- package/dist/plugins/session-rules-column.js +1 -1
- package/dist/plugins/session-store.d.ts +1 -1
- package/dist/plugins/session-workspace-cell.d.ts +1 -1
- package/dist/plugins/session-workspace-cell.js +1 -1
- package/dist/plugins/shared-memory-store-sql.js +2 -2
- package/dist/plugins/sql-driver.d.ts +10 -5
- package/dist/plugins/sql-driver.js +6 -6
- package/dist/plugins/sql-errors.js +1 -1
- package/dist/plugins/store-backend.d.ts +5 -7
- package/dist/plugins/store-backend.js +23 -11
- package/dist/plugins/store-contracts.d.ts +25 -5
- package/dist/plugins/task-list-store-sql.js +11 -11
- package/dist/plugins/tidb-pool.d.ts +12 -7
- package/dist/plugins/tidb-pool.js +13 -7
- package/dist/plugins/tidb-session-storage.js +4 -4
- package/dist/plugins/tidb-session-store.d.ts +57 -26
- package/dist/plugins/tidb-session-store.js +127 -59
- package/dist/plugins/tool-result-store-sql.d.ts +5 -4
- package/dist/plugins/tool-result-store-sql.js +21 -13
- package/dist/plugins/user-input-ledger-sql.js +2 -2
- package/dist/plugins/workflow-journal-store-sql.js +5 -5
- package/dist/plugins/workflow-run-store-sql.js +19 -19
- package/dist/plugins/write-behind-counter.d.ts +2 -3
- package/dist/plugins/write-behind-counter.js +5 -5
- package/dist/project-memory.d.ts +9 -15
- package/dist/project-memory.js +5 -4
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +6 -7
- package/dist/request-value-closure.js +1 -3
- package/dist/resource-suspend.d.ts +14 -12
- package/dist/resource-suspend.js +1 -1
- package/dist/resource-window.d.ts +4 -3
- package/dist/run-local.d.ts +6 -0
- package/dist/run-local.js +34 -35
- package/dist/runs.d.ts +10 -5
- package/dist/runs.js +52 -66
- package/dist/security.d.ts +38 -12
- package/dist/security.js +8 -2
- package/dist/server-secret-env.d.ts +9 -5
- package/dist/session-children-retire.d.ts +27 -9
- package/dist/session-children-retire.js +9 -5
- package/dist/session-incarnation.d.ts +20 -10
- package/dist/session-incarnation.js +5 -3
- package/dist/session-policy-wire.d.ts +1 -1
- package/dist/session-row.d.ts +114 -5
- package/dist/session-row.js +55 -5
- package/dist/session-titler.d.ts +2 -2
- package/dist/sql-engine-posture.d.ts +1 -1
- package/dist/sql-engine-posture.js +1 -1
- package/dist/{plugins → stores-sql}/background-agent-store-sql.d.ts +2 -2
- package/dist/{plugins → stores-sql}/background-agent-store-sql.js +8 -8
- package/dist/{plugins → stores-sql}/session-policy-store-sql.d.ts +7 -5
- package/dist/{plugins → stores-sql}/session-policy-store-sql.js +12 -12
- package/dist/{plugins → stores-sql}/usage-window-store-sql.d.ts +1 -1
- package/dist/{plugins → stores-sql}/usage-window-store-sql.js +3 -3
- package/dist/task-a2a.d.ts +1 -1
- package/dist/task-a2a.js +5 -6
- package/dist/task-cwd.d.ts +6 -1
- package/dist/task-mcp.d.ts +22 -9
- package/dist/task-mcp.js +17 -9
- package/dist/terminal.d.ts +27 -0
- package/dist/terminal.js +6 -0
- package/dist/tool-approval.d.ts +6 -0
- package/dist/tool-approval.js +8 -1
- package/dist/trace/project.d.ts +1 -0
- package/dist/trace/project.js +1 -0
- package/dist/trace/redact.d.ts +3 -1
- package/dist/trace/redact.js +80 -28
- package/dist/trace/self-minted-wire.d.ts +169 -2
- package/dist/trace/self-minted-wire.js +54 -1
- package/dist/url-refusal.d.ts +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +17 -3
- package/dist/web-admin-client/apply-effective.js +20 -10
- package/dist/web-admin-client/candidate-gate.d.ts +11 -7
- package/dist/web-admin-client/candidate-gate.js +1 -1
- package/dist/web-admin-client/http-client.d.ts +5 -4
- package/dist/web-admin-client/http-client.js +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +7 -17
- package/dist/web-admin-client/read-warnings.js +5 -9
- package/dist/web-admin-client/skills-mcp.js +3 -2
- package/dist/web-admin-client/types.d.ts +6 -0
- package/package.json +3 -3
- package/wire-changes/server@7.139.0.json +348 -0
- package/wire-changes/server@7.140.0.json +184 -0
- package/dist/http/device-placement.d.ts +0 -175
- package/dist/http/device-placement.js +0 -145
package/dist/boot/stores.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { FileBackgroundAgentStore, FileMailboxStore, FileRosterStore, InMemoryUsageWindowStore, mailboxCrossProcessMountVerdict } from "@sema-agent/core";
|
|
3
3
|
import { createCorruptReadFailOpenSeat } from "../observability/corrupt-read-seat.js";
|
|
4
|
-
import {
|
|
4
|
+
import { startMemorySyncRunner } from "../memory-sync-client.js";
|
|
5
5
|
import { memoryEmbedderFor } from "../plugins/memory-embedder.js";
|
|
6
6
|
import { ensurePgMemoryEmbedderMetaSchema, reconcileEmbedderFingerprint } from "../plugins/memory-embedder-fingerprint.js";
|
|
7
7
|
import { PgMemoryEngineBackend, ensurePgMemoryEngineSchema } from "../plugins/memory-engine-pg.js";
|
|
@@ -10,10 +10,10 @@ import { PgMemoryHistoryStore, PgMemorySyncStore, ensurePgMemoryHistorySchema, e
|
|
|
10
10
|
import { TiDBMemoryHistoryStore, TiDBMemorySyncStore, ensureTiDBMemoryHistorySchema, ensureTiDBMemorySyncSchema } from "../plugins/memory-sync-store-tidb.js";
|
|
11
11
|
import { MinioBlobBackend } from "../plugins/blob-backend.js";
|
|
12
12
|
import { ensureSnapshotBuckets } from "../plugins/snapshot-bucket-presence.js";
|
|
13
|
-
import { PgBackgroundAgentStore, TiDBBackgroundAgentStore, ensurePgBackgroundAgentSchema, ensureTiDBBackgroundAgentSchema } from "../
|
|
13
|
+
import { PgBackgroundAgentStore, TiDBBackgroundAgentStore, ensurePgBackgroundAgentSchema, ensureTiDBBackgroundAgentSchema } from "../stores-sql/background-agent-store-sql.js";
|
|
14
14
|
import { PgMailboxStore, TiDBMailboxStore, ensurePgMailboxSchema, ensureTiDBMailboxSchema } from "../plugins/mailbox-store-sql.js";
|
|
15
15
|
import { createDropOnlyRecipientLifecycle } from "../plugins/mailbox-recipient-lifecycle.js";
|
|
16
|
-
import { PgUsageWindowStore, TiDBUsageWindowStore, ensurePgUsageWindowSchema, ensureTiDBUsageWindowSchema } from "../
|
|
16
|
+
import { PgUsageWindowStore, TiDBUsageWindowStore, ensurePgUsageWindowSchema, ensureTiDBUsageWindowSchema } from "../stores-sql/usage-window-store-sql.js";
|
|
17
17
|
import { PgRosterStore, TiDBRosterStore, ensurePgRosterSchema, ensureTiDBRosterSchema } from "../plugins/roster-store-sql.js";
|
|
18
18
|
import { LocalTaskAttachmentStore } from "../plugins/local-task-attachment-store.js";
|
|
19
19
|
import { PgTaskAttachmentStore, TiDBTaskAttachmentStore, ensurePgTaskAttachmentSchema, ensureTiDBTaskAttachmentSchema } from "../plugins/task-attachment-store.js";
|
|
@@ -27,19 +27,19 @@ import { assertCloudSnapshotBlobPosture, openStoreBackendWithFallback } from "..
|
|
|
27
27
|
import { createMemoryEngineIncidentSink } from "../memory-incident-sink.js";
|
|
28
28
|
import { announceLockedLegacyMemoryLayers } from "../memory-layer-legacy-lock.js";
|
|
29
29
|
import { createEngineNoticeForwarder } from "./runner-deps.js";
|
|
30
|
-
import { buildMemoryRemoteLaneWarn, memoryEngineBackendFor, memoryEngineRemoteLanePosture, memoryEngineRootFor, memoryMountRootOf } from "../memory-scope.js";
|
|
30
|
+
import { buildMemoryRemoteLaneWarn, memoryEngineBackendFor, memoryEngineRemoteLanePosture, memoryEngineRootFor, memoryLayersNamedBy, memoryMountRootOf } from "../memory-scope.js";
|
|
31
|
+
import { createMemoryScopeStores } from "../memory-scope-stores.js";
|
|
31
32
|
import { assertToolResultProvenanceSchema } from "../plugins/tool-result-store-sql.js";
|
|
32
33
|
import { assertPermissionRuleApprovalSchema, assertPermissionRuleTicketSchema } from "../plugins/permission-rule-store-sql.js";
|
|
33
34
|
import { assertApprovalAskRuleMaterialSchema } from "../plugins/approval-ask-store-sql.js";
|
|
34
35
|
import { assertSchemaMatchesCode } from "../plugins/schema-consistency.js";
|
|
35
36
|
import { assertCheckpointColumnSchema } from "../plugins/checkpoint-store-sql.js";
|
|
36
37
|
import { assertFileHistorySchema } from "../plugins/file-history-store-sql.js";
|
|
37
|
-
import { buildMemoryBoundaryLaneFacts, buildMemoryWriteBoundaryAudit
|
|
38
|
+
import { buildMemoryBoundaryLaneFacts, buildMemoryWriteBoundaryAudit } from "./memory-boundary.js";
|
|
38
39
|
import { buildMemoryPosture } from "../memory-posture.js";
|
|
39
40
|
import { headReadOf } from "../session-incarnation.js";
|
|
40
41
|
import { establishSqlEnginePosture, sqlPoolsOf } from "../sql-engine-posture.js";
|
|
41
42
|
import { buildStorePosture } from "../store-posture.js";
|
|
42
|
-
import { buildDisplaySafeUrl } from "../trace/redact.js";
|
|
43
43
|
const DARK_REASON_PROSE = {
|
|
44
44
|
engine_off: () => "MEMORY_ENGINE=off",
|
|
45
45
|
multi_tenant_file_backend: () => "multi-tenant on the FILE backend (no tenant isolation; set MEMORY_ENGINE_BACKEND=pg|tidb to light up)",
|
|
@@ -51,7 +51,7 @@ export async function assertApprovalAskRuleMaterialOnBackend(backend) {
|
|
|
51
51
|
if (pgPool)
|
|
52
52
|
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
53
53
|
else if (mysqlPool)
|
|
54
|
-
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "
|
|
54
|
+
await assertApprovalAskRuleMaterialSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "mysql");
|
|
55
55
|
}
|
|
56
56
|
export async function openStores(ctx) {
|
|
57
57
|
const { config, logger, metrics, localRoot } = ctx;
|
|
@@ -75,25 +75,25 @@ export async function openStores(ctx) {
|
|
|
75
75
|
if (pgPool)
|
|
76
76
|
await assertToolResultProvenanceSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
77
77
|
else if (mysqlPool)
|
|
78
|
-
await assertToolResultProvenanceSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "
|
|
78
|
+
await assertToolResultProvenanceSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "mysql");
|
|
79
79
|
if (pgPool)
|
|
80
80
|
await assertCheckpointColumnSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
81
81
|
else if (mysqlPool)
|
|
82
|
-
await assertCheckpointColumnSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "
|
|
82
|
+
await assertCheckpointColumnSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "mysql");
|
|
83
83
|
if (config.permissionRulesEnabled) {
|
|
84
84
|
if (pgPool)
|
|
85
85
|
await assertPermissionRuleApprovalSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
86
86
|
else if (mysqlPool)
|
|
87
|
-
await assertPermissionRuleApprovalSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "
|
|
87
|
+
await assertPermissionRuleApprovalSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "mysql");
|
|
88
88
|
if (pgPool)
|
|
89
89
|
await assertPermissionRuleTicketSchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
90
90
|
else if (mysqlPool)
|
|
91
|
-
await assertPermissionRuleTicketSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "
|
|
91
|
+
await assertPermissionRuleTicketSchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "mysql");
|
|
92
92
|
}
|
|
93
93
|
if (pgPool)
|
|
94
94
|
await assertFileHistorySchema(async (sql) => ({ rows: (await pgPool.query(sql)).rows }), "pg");
|
|
95
95
|
else if (mysqlPool)
|
|
96
|
-
await assertFileHistorySchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "
|
|
96
|
+
await assertFileHistorySchema(async (sql) => ({ rows: (await mysqlPool.query(sql))[0] }), "mysql");
|
|
97
97
|
}
|
|
98
98
|
if (backend)
|
|
99
99
|
await runAndLogOneTimeMigrations(logger, backend);
|
|
@@ -116,6 +116,8 @@ export async function openStores(ctx) {
|
|
|
116
116
|
config.sessionBackend = "tidb";
|
|
117
117
|
let memoryEngine;
|
|
118
118
|
const engineDataRoot = memoryEngineRootFor(config, localRoot);
|
|
119
|
+
const memoryEngineIncident = createMemoryEngineIncidentSink({ logger, metrics });
|
|
120
|
+
const scopeStoresOver = (deployment) => createMemoryScopeStores({ backend: deployment, root: engineDataRoot, namedLayers: () => memoryLayersNamedBy(config), onIncident: memoryEngineIncident });
|
|
119
121
|
let memorySyncCursors;
|
|
120
122
|
let vectorMode;
|
|
121
123
|
if (config.memoryEngineBackend !== "file" && config.memoryEngineEnabled) {
|
|
@@ -166,7 +168,7 @@ export async function openStores(ctx) {
|
|
|
166
168
|
...(embedder !== undefined ? { embedder } : {}),
|
|
167
169
|
});
|
|
168
170
|
vectorMode = pgMem.vectorMode;
|
|
169
|
-
memoryEngine =
|
|
171
|
+
memoryEngine = scopeStoresOver(pgMem);
|
|
170
172
|
}
|
|
171
173
|
else {
|
|
172
174
|
const pool = backend?.mysqlPool();
|
|
@@ -178,7 +180,7 @@ export async function openStores(ctx) {
|
|
|
178
180
|
memorySyncCursors = new TiDBMemorySyncStore(pool);
|
|
179
181
|
const tidbMem = new TiDBMemoryEngineBackend(pool, { history: countedHistorySink(new TiDBMemoryHistoryStore(pool)) });
|
|
180
182
|
vectorMode = tidbMem.vectorMode;
|
|
181
|
-
memoryEngine =
|
|
183
|
+
memoryEngine = scopeStoresOver(tidbMem);
|
|
182
184
|
}
|
|
183
185
|
logger.info("memory_engine_enabled", {
|
|
184
186
|
enabled: true,
|
|
@@ -190,7 +192,8 @@ export async function openStores(ctx) {
|
|
|
190
192
|
});
|
|
191
193
|
}
|
|
192
194
|
else {
|
|
193
|
-
|
|
195
|
+
const fileEngine = memoryEngineBackendFor(config, undefined, memoryEngineIncident);
|
|
196
|
+
memoryEngine = fileEngine !== undefined ? scopeStoresOver(fileEngine.backend) : undefined;
|
|
194
197
|
if (memoryEngine)
|
|
195
198
|
announceLockedLegacyMemoryLayers(memoryMountRootOf(memoryEngine.backend, memoryEngine.root), createEngineNoticeForwarder(logger));
|
|
196
199
|
if (memoryEngine && process.env.LOCAL_DATA_ROOT && !config.memoryEngineDir) {
|
|
@@ -206,17 +209,11 @@ export async function openStores(ctx) {
|
|
|
206
209
|
const audit = buildMemoryWriteBoundaryAudit({
|
|
207
210
|
memoryRoot: memoryMountRoot,
|
|
208
211
|
...laneFacts,
|
|
209
|
-
declaredCapable:
|
|
212
|
+
declaredCapable: config.memoryPersistenceCapable,
|
|
210
213
|
engineBackend: config.memoryEngineBackend,
|
|
211
214
|
});
|
|
212
215
|
for (const w of audit.warnings)
|
|
213
216
|
logger.warn(w.tag, { detail: w.detail, lane: laneFacts.lane, root: memoryMountRoot ?? null });
|
|
214
|
-
if (config.memoryPersistenceCapable === undefined && effectiveMemoryPersistenceCapable(config) === true) {
|
|
215
|
-
logger.info?.("memory_persistence_capable_auto_declared", {
|
|
216
|
-
lane: laneFacts.lane,
|
|
217
|
-
detail: "REMOTE_EXEC=host: file tools run on this machine's filesystem, so the assembler declares memoryPersistenceCapable=true (the core-side remote-env withhold would otherwise silently drop the memory WRITE instruction on this lane). Override with MEMORY_PERSISTENCE_CAPABLE=true|false.",
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
217
|
}
|
|
221
218
|
let rosterStore;
|
|
222
219
|
{
|
|
@@ -237,7 +234,7 @@ export async function openStores(ctx) {
|
|
|
237
234
|
});
|
|
238
235
|
}
|
|
239
236
|
if (rosterStore)
|
|
240
|
-
logger.info("roster_store_enabled", { backend: pgPool ? "pg" : mysqlPool ? "
|
|
237
|
+
logger.info("roster_store_enabled", { backend: pgPool ? "pg" : mysqlPool ? "mysql" : "file" });
|
|
241
238
|
}
|
|
242
239
|
let backgroundAgentStore;
|
|
243
240
|
{
|
|
@@ -256,7 +253,7 @@ export async function openStores(ctx) {
|
|
|
256
253
|
backgroundAgentStore = new FileBackgroundAgentStore(config.localDataRoot ?? localRoot);
|
|
257
254
|
}
|
|
258
255
|
if (backgroundAgentStore)
|
|
259
|
-
logger.info("background_agent_store_enabled", { backend: pgPool ? "pg" : mysqlPool ? "
|
|
256
|
+
logger.info("background_agent_store_enabled", { backend: pgPool ? "pg" : mysqlPool ? "mysql" : "file" });
|
|
260
257
|
}
|
|
261
258
|
let taskAttachmentStore;
|
|
262
259
|
{
|
|
@@ -286,7 +283,7 @@ export async function openStores(ctx) {
|
|
|
286
283
|
taskAttachmentStore = new LocalTaskAttachmentStore(config.localDataRoot ?? localRoot);
|
|
287
284
|
}
|
|
288
285
|
if (taskAttachmentStore)
|
|
289
|
-
logger.info("task_attachment_store_enabled", { backend: pgPool ? "pg+minio" : mysqlPool ? "
|
|
286
|
+
logger.info("task_attachment_store_enabled", { backend: pgPool ? "pg+minio" : mysqlPool ? "mysql+minio" : "file", maxBytes: config.attachmentMaxBytes });
|
|
290
287
|
}
|
|
291
288
|
let mailboxStore;
|
|
292
289
|
let mailboxRecipientLifecycle;
|
|
@@ -314,7 +311,7 @@ export async function openStores(ctx) {
|
|
|
314
311
|
if (mailboxStore) {
|
|
315
312
|
const laneVerdict = mailboxCrossProcessMountVerdict(mailboxStore);
|
|
316
313
|
logger.info("mailbox_store_enabled", {
|
|
317
|
-
backend: pgPool ? "pg" : mysqlPool ? "
|
|
314
|
+
backend: pgPool ? "pg" : mysqlPool ? "mysql" : "file",
|
|
318
315
|
crossProcessSafe: mailboxStore.crossProcessSafe,
|
|
319
316
|
recipientTombstones: pgPool !== undefined || mysqlPool !== undefined,
|
|
320
317
|
peerLaneMountable: laneVerdict.ok,
|
|
@@ -340,9 +337,9 @@ export async function openStores(ctx) {
|
|
|
340
337
|
else {
|
|
341
338
|
usageWindowStore = new InMemoryUsageWindowStore();
|
|
342
339
|
}
|
|
343
|
-
logger.info("usage_window_store_enabled", { backend: pgPool ? "pg" : mysqlPool ? "
|
|
340
|
+
logger.info("usage_window_store_enabled", { backend: pgPool ? "pg" : mysqlPool ? "mysql" : backend?.fileUsageWindowStore !== undefined ? "file" : "memory", windows: config.usageWindows.length });
|
|
344
341
|
}
|
|
345
|
-
const
|
|
342
|
+
const memoryExportStores = config.memoryEngineBackend !== "file" ? memoryEngine : undefined;
|
|
346
343
|
const memoryLane = memoryEngineRemoteLanePosture(config);
|
|
347
344
|
const memoryPosture = buildMemoryPosture({
|
|
348
345
|
config,
|
|
@@ -364,17 +361,7 @@ export async function openStores(ctx) {
|
|
|
364
361
|
let memorySyncRunner;
|
|
365
362
|
if (config.memorySync) {
|
|
366
363
|
if (memoryEngine) {
|
|
367
|
-
memorySyncRunner =
|
|
368
|
-
backend: memoryEngine.backend,
|
|
369
|
-
scope: config.memorySync.scope,
|
|
370
|
-
memoryRoot: memoryEngine.root,
|
|
371
|
-
transport: createMemorySyncTransport({ url: config.memorySync.url, token: config.memorySync.token }),
|
|
372
|
-
log: logger,
|
|
373
|
-
...(config.memorySync.maxPushEntries !== undefined ? { maxPushEntries: config.memorySync.maxPushEntries } : {}),
|
|
374
|
-
...(config.memorySync.maxPullEntries !== undefined ? { maxPullEntries: config.memorySync.maxPullEntries } : {}),
|
|
375
|
-
});
|
|
376
|
-
logger.info("memory_sync_enabled", { url: buildDisplaySafeUrl(config.memorySync.url), scope: config.memorySync.scope, cursorPath: memorySyncRunner.cursorPathFor(config.memorySync.scope) });
|
|
377
|
-
memorySyncRunner.trigger("boot");
|
|
364
|
+
memorySyncRunner = startMemorySyncRunner({ sync: config.memorySync, stores: memoryEngine, log: logger });
|
|
378
365
|
}
|
|
379
366
|
else {
|
|
380
367
|
logger.warn("memory_sync_configured_but_memory_dark", { note: "MEMORY_SYNC_URL is set but the file memory engine is dark (multi-tenant / MEMORY_ENGINE=off / remote exec lane) — no sync rounds will run" });
|
|
@@ -444,7 +431,7 @@ export async function openStores(ctx) {
|
|
|
444
431
|
: undefined;
|
|
445
432
|
return {
|
|
446
433
|
backend, storePosture, memoryEngine, engineDataRoot, memorySyncCursors, rosterStore, backgroundAgentStore, mailboxRecipientLifecycle,
|
|
447
|
-
taskAttachmentStore, mailboxStore,
|
|
434
|
+
taskAttachmentStore, mailboxStore, memoryExportStores, memorySyncRunner, sessionStore, breakerState,
|
|
448
435
|
usageWindowStore, memoryPosture, taskListLane, sqlEngine,
|
|
449
436
|
};
|
|
450
437
|
}
|
|
@@ -38,7 +38,7 @@ import type { Logger } from "../observability/logger.js";
|
|
|
38
38
|
/** 同时活着的会话清单实例上限(LRU,逐最老)。与 perSessionCwd/perSessionShellEnv 同量级。 */
|
|
39
39
|
export declare const MAX_TASK_LIST_SESSIONS = 4096;
|
|
40
40
|
/** 车道实际落到哪个后端(启动日志 + 测试对表)。 */
|
|
41
|
-
export type TaskListLaneBackend = "
|
|
41
|
+
export type TaskListLaneBackend = "mysql" | "pg" | "memory";
|
|
42
42
|
export interface TaskListLane {
|
|
43
43
|
/** `sessionId ↦ 该会话的任务清单店`。同 sessionId 恒解析到同一份清单(SQL 形 = 同一批行;
|
|
44
44
|
* memory 形 = 同一只实例)。 */
|
|
@@ -16,7 +16,7 @@ export function createTaskListLane(opts = {}) {
|
|
|
16
16
|
purge = (sessionId) => deletePgTaskList(pgPool, taskListKeyFor(sessionId));
|
|
17
17
|
}
|
|
18
18
|
else if (mysqlPool) {
|
|
19
|
-
backend = "
|
|
19
|
+
backend = "mysql";
|
|
20
20
|
mint = (sessionId) => createTiDBTaskListStore(mysqlPool, taskListKeyFor(sessionId));
|
|
21
21
|
purge = (sessionId) => deleteTiDBTaskList(mysqlPool, taskListKeyFor(sessionId));
|
|
22
22
|
}
|
package/dist/boot/web-admin.js
CHANGED
|
@@ -17,7 +17,7 @@ import { answerStillCurrent, centerStateBin, credentialIdentityNow, judgeCenterC
|
|
|
17
17
|
import { createCenterConfigTier } from "../center-config-tier.js";
|
|
18
18
|
import { buildCenterCredentialHealthView, createCenterCredentialRenewer } from "../center-credential-renewer.js";
|
|
19
19
|
import { centerManagedConfigKeys } from "../web-admin-client/apply-effective.js";
|
|
20
|
-
import { createConfigProvider, raceBootFetch,
|
|
20
|
+
import { configSourceKind, createConfigProvider, raceBootFetch, BOOT_FETCH_DEFERRED } from "../config-provider.js";
|
|
21
21
|
import { ConfigDirUntrustedError } from "../config-dir-trust.js";
|
|
22
22
|
import { createKeyResolver } from "../key-resolver.js";
|
|
23
23
|
import { buildSealedKeyPublicFace, ensureCheckpointCtxSealing, ensureSealedKeyStore, reportExecutionPublicKey } from "../sealed-key.js";
|
|
@@ -31,6 +31,14 @@ import { SHA256_HEX_RE } from "../digest-form.js";
|
|
|
31
31
|
import { BOOT_REJUDGE_OF_REFUSED_GROUP, createConfigApplyLedger, modelPlaneCommitted, refusedGroups } from "../web-admin-client/apply-ledger.js";
|
|
32
32
|
import { announceReadDenyRows, buildDeploymentPostureSeats } from "./runner-deps.js";
|
|
33
33
|
import { echoCallerText } from "../caller-text-echo.js";
|
|
34
|
+
const MODELS_REJECTION_PHRASE = {
|
|
35
|
+
domain_invalid: "models 域判形失败",
|
|
36
|
+
empty: "读不出(空 / 纯空白:半写或截断)",
|
|
37
|
+
invalid_json: "读不出(不是合法的 JSON)",
|
|
38
|
+
not_object: "读不出(解析出来不是 JSON 对象:null / 数组 / 标量)",
|
|
39
|
+
io: "读不出(文件读失败:权限、路径是目录或 I/O 错误)",
|
|
40
|
+
retired_domain: "是带事实的退役域文档",
|
|
41
|
+
};
|
|
34
42
|
function lkgReadNote(scope) {
|
|
35
43
|
switch (scope) {
|
|
36
44
|
case "whole":
|
|
@@ -161,7 +169,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
161
169
|
catch (err) {
|
|
162
170
|
logger.warn("checkpoint_ctx_sealing_unavailable", { err: err instanceof Error ? err.message : String(err), dir: join(sealedKeyDir, "checkpoint-ctx-keys"), note: "suspended tasks' request credentials cannot be sealed on this host; with durable approvals on the boot refuses — make that directory (under the sealed-key custody directory: SEALED_KEY_DIR, default <data root>/sealed-key) creatable and chmod-able by the service, or repair / remove a key file there whose public and private halves do not belong together" });
|
|
163
171
|
}
|
|
164
|
-
const configProvider =
|
|
172
|
+
const configProvider = configSourceKind(config) !== undefined
|
|
165
173
|
? createConfigProvider({
|
|
166
174
|
...(config.configProvider ? { provider: config.configProvider } : {}),
|
|
167
175
|
...(cc ? { webAdmin: { baseUrl: cc.baseUrl, credential: cc.credential, worker: cc.worker, dryRun: cc.dryRun } } : {}),
|
|
@@ -202,6 +210,22 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
202
210
|
noteCandidateVerdict(ordinal, candidateRejectionOf(r, verdict, candidateSource().kind, Date.now()));
|
|
203
211
|
logger.warn("config_candidate_rejected", buildCandidateRejectedFields(r, verdict, leg, { lkgVersion: latestEffective?.version ?? "(env)", ...localDirField }));
|
|
204
212
|
};
|
|
213
|
+
const noteSourceAtApplied = () => {
|
|
214
|
+
const rejected = candidateRejection;
|
|
215
|
+
const appliedVersion = applyLedger.view().configAppliedVersion;
|
|
216
|
+
if (rejected === undefined || rejected.version === appliedVersion)
|
|
217
|
+
return;
|
|
218
|
+
const gen = generationOf(appliedVersion);
|
|
219
|
+
noteCandidateVerdict(gen, undefined);
|
|
220
|
+
if (!cc?.dryRun)
|
|
221
|
+
applyLedger.applied(gen, appliedVersion);
|
|
222
|
+
logger.info("config_source_back_to_applied", {
|
|
223
|
+
appliedVersion,
|
|
224
|
+
rejectedVersion: rejected.version,
|
|
225
|
+
domains: rejected.domains.join(","),
|
|
226
|
+
note: "the config source serves the applied generation again (unchanged-since-applied reply) — the rejected candidate is no longer its current one: candidateRejected cleared, target back to applied; the same breakage again is announced again",
|
|
227
|
+
});
|
|
228
|
+
};
|
|
205
229
|
const selfReportListeners = [];
|
|
206
230
|
const notifySelfReport = (changed) => {
|
|
207
231
|
for (const listener of selfReportListeners) {
|
|
@@ -540,18 +564,18 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
540
564
|
logger.warn("config_lkg_apply_failed", { err: String(applyErr), note: "persisted LKG failed to apply — env fallback serves; the cache rewrites on the next clean candidate" });
|
|
541
565
|
}
|
|
542
566
|
};
|
|
543
|
-
const warnLocalNoModels = (r,
|
|
544
|
-
const
|
|
567
|
+
const warnLocalNoModels = (r, verdict) => {
|
|
568
|
+
const modelsRejection = verdict.verdict === "rejected" ? verdict.errors.find((e) => e.domain === "models") : undefined;
|
|
545
569
|
const modelsDropped = (r.droppedEntries ?? []).filter((d) => d.domain === "models");
|
|
546
570
|
const totalModels = (r.effective.models?.models ?? []).length;
|
|
547
571
|
logger.warn("config_local_no_models", {
|
|
548
572
|
...localDirField,
|
|
549
|
-
...(
|
|
573
|
+
...(modelsRejection ? { reason: modelsRejection.reason, domainError: modelsRejection.error } : {}),
|
|
550
574
|
...(modelsDropped.length > 0 ? { droppedEntries: modelsDropped.map((d) => d.entry) } : {}),
|
|
551
|
-
hint:
|
|
552
|
-
?
|
|
553
|
-
: rejected
|
|
554
|
-
? "config.d 里别的域让整份本地候选被拒(
|
|
575
|
+
hint: modelsRejection
|
|
576
|
+
? `config.d/models.json 在场但${MODELS_REJECTION_PHRASE[modelsRejection.reason]},整份本地候选被拒(成因词见本行 reason,真因见本行 domainError)— 模型继续走 env 兜底`
|
|
577
|
+
: verdict.verdict === "rejected"
|
|
578
|
+
? "config.d 里别的域让整份本地候选被拒(坏域、成因词与真因见 config_candidate_rejected)— config.d/models.json 的模型不用,继续走 env 兜底"
|
|
555
579
|
: modelsDropped.length > 0 && totalModels === 0
|
|
556
580
|
? "config.d/models.json 的条目全部被逐条丢弃(逐条真因见 config_entry_dropped)— 模型继续走 env 兜底"
|
|
557
581
|
: totalModels > 0
|
|
@@ -600,7 +624,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
600
624
|
applyLedger.seenTarget(rejectedGen, r.effective.version);
|
|
601
625
|
announceCandidateRejected(r, bootVerdict, "boot", rejectedGen);
|
|
602
626
|
if (configProvider.kind === "local")
|
|
603
|
-
warnLocalNoModels(r,
|
|
627
|
+
warnLocalNoModels(r, bootVerdict);
|
|
604
628
|
}
|
|
605
629
|
else {
|
|
606
630
|
warnReadNotices(r, "boot");
|
|
@@ -645,7 +669,7 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
645
669
|
const cfgModels = (r.effective.models?.models ?? []).filter((m) => m.enabled !== false).length;
|
|
646
670
|
logger.info("config_loaded", { source: configProvider.kind, version: r.effective.version, worker: cc?.worker ?? "(global)", models: cfgModels, ...localDirField });
|
|
647
671
|
if (configProvider.kind === "local" && cfgModels === 0)
|
|
648
|
-
warnLocalNoModels(r,
|
|
672
|
+
warnLocalNoModels(r, bootVerdict);
|
|
649
673
|
}
|
|
650
674
|
}
|
|
651
675
|
if (configProvider.kind === "remote")
|
|
@@ -959,6 +983,8 @@ export async function createWebAdminRuntime(ctx) {
|
|
|
959
983
|
logger.warn("models_tiers_deferred_no_handoff", { version: planeDeferredNoHandoff.version, since: planeDeferredNoHandoff.since, note: "candidate still retained without a next-boot handoff — mount restart-surviving LKG storage + CONFIG_LKG_DURABLE=true, or restart manually after ensuring the candidate is re-pulled at boot" });
|
|
960
984
|
}
|
|
961
985
|
const r = arrival !== undefined ? arrival.result : await pullEffective(configProvider, ccEtag);
|
|
986
|
+
if (r === null)
|
|
987
|
+
noteSourceAtApplied();
|
|
962
988
|
if (r === null && planeDeferredNoHandoff) {
|
|
963
989
|
const skillsDebt = (planeDeferredNoHandoff.blocked ?? []).includes("skills");
|
|
964
990
|
const promoted = lkgSurvivesRestart || skillsDebt ? await persistLkgDurable(planeDeferredNoHandoff.candidate, planeDeferredNoHandoff.candidateEtag) : false;
|
|
@@ -5,8 +5,8 @@ export interface ExecutionLaneCapability {
|
|
|
5
5
|
/** 工具跑的那台机器就是本进程这台吗(= server 盘上的绝对路径对模型的工具有没有意义)。
|
|
6
6
|
* 属主 = 部署形表行 `toolsOnThisHost`,与 `skills[].baseDir` 的铸点同一行。 */
|
|
7
7
|
readonly toolsOnThisHost: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* 值 = {@link laneIsolated}(
|
|
8
|
+
/** 手在不在 OS 级隔离边界里(容器 / microVM / Kata pod)。**present-iff 本车道有手**(执行环境块 `io`);
|
|
9
|
+
* 值 = {@link laneIsolated}(执行环境块 `isolation`,与 boot `remote_exec_enabled.isolated` 同一只)。见头注第三键段。 */
|
|
10
10
|
readonly isolated?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -178,7 +178,7 @@ export function createMcpProbeWalk(input, principal, desk, now = Date.now) {
|
|
|
178
178
|
timeoutMs: MCP_PROBE_VERDICT_TIMEOUT_MS,
|
|
179
179
|
concurrency: MCP_PROBE_CONCURRENCY,
|
|
180
180
|
signal: controller.signal,
|
|
181
|
-
peerSeat: desk.seat
|
|
181
|
+
peerSeat: desk.seat,
|
|
182
182
|
});
|
|
183
183
|
if (lease !== undefined)
|
|
184
184
|
void dials.then(() => lease.release(), () => lease.release());
|
|
@@ -85,7 +85,7 @@ export interface ScenarioContext {
|
|
|
85
85
|
/**
|
|
86
86
|
* [ref] / [ref]:**委派树根的见证**(停驻挂点的属主来源)—— 根会话 id + 调用方判断那一刻读到的根行住客(`delegated-session-owner.ts` 的 `DelegationRootWitness`)。
|
|
87
87
|
* 由**每一个**接了停驻挂点的取用方显式交出(一条读法,没有回落):请求腿 = 本请求经鉴权解析的会话与受理时那一读(`boot/resolve-spec.ts`);`/decide` 赎回面 = 行上的
|
|
88
|
-
* `rootSessionId`
|
|
88
|
+
* `rootSessionId` 与赎回腿写口放行的那一位住客(`parked-revive-surface.ts`,交不交座都交)。它**只**喂停驻挂点,不挂任何会话级设施(那是 {@link sessionId} 的事,
|
|
89
89
|
* 判据是「这只 bundle 是不是在那只会话上取用的」,与属主来源是两个独立判据)。缺席 = 没有根可交(boot 期探针、run-local、行上没有根)⇒ 律给哨兵。
|
|
90
90
|
* 挂点在停驻那一刻再读一次根行:住客不是见证的那一位(删了、同 id 被重新登记)⇒ 停驻否决 —— 不按新住客晋升或认领。
|
|
91
91
|
*/
|
|
@@ -33,12 +33,13 @@ export declare const CAPABILITY_FACT_WHY: {
|
|
|
33
33
|
readonly subagent_output_face_absent: "the background sub-agent output face is not wired";
|
|
34
34
|
readonly task_handle_faces_absent: "the background task-handle output/stop faces are not wired";
|
|
35
35
|
readonly session_head_face_absent: "the session store has no by-id head read (sessionStorage.headOf — owner, occupant and leaf of a session row in one read)";
|
|
36
|
+
readonly execution_placement_seat_absent: "the session store has no execution placement seat (sessionStorage.executionPlacement — the occupant and the execution placement cell of a root session row in one read)";
|
|
36
37
|
readonly checkpoint_store_absent: "no durable checkpoint store is wired (DURABLE_APPROVAL)";
|
|
37
38
|
readonly session_audit_absent: "no session audit view is wired (needs a durable session store)";
|
|
38
39
|
readonly session_watch_absent: "the session watch registry is not wired";
|
|
39
40
|
readonly session_lister_absent: "no session enumerator is wired (session store or run store listSessions)";
|
|
40
41
|
readonly session_fork_face_absent: "the session store has no fork face";
|
|
41
|
-
readonly session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf /
|
|
42
|
+
readonly session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf / writeSessionRowCells)";
|
|
42
43
|
readonly session_purge_absent: "no session purge coordinator is wired";
|
|
43
44
|
readonly session_policy_store_absent: "no session policy store is wired";
|
|
44
45
|
readonly store_backend_absent: "no store backend is wired (DB_BACKEND=memory, multi-tenant bare boot, or half-configured SQL)";
|
|
@@ -128,6 +129,13 @@ type HeadReadingSessionStore = WithMethods<OwnerAwareSessionStore, "headOf">;
|
|
|
128
129
|
export declare function sessionOwnership(d: Pick<Deps, "sessionStorage">): Fact<"session_head_face_absent", {
|
|
129
130
|
sessionStorage: HeadReadingSessionStore;
|
|
130
131
|
}>;
|
|
132
|
+
/**
|
|
133
|
+
* 执行放置读面在场:会话店带执行席(`executionPlacement`:一次行读 = 住客 + 执行放置格;SQL 两孪生与 local 恒带,引擎缺省的内存会话店没有)。
|
|
134
|
+
* 见证 = 那只席 —— `GET /v1/sessions/:id/execution-placement` 读它,且只读它(属主门判这一读的住客)。
|
|
135
|
+
*/
|
|
136
|
+
export declare function executionPlacementRead(d: Pick<Deps, "sessionStorage">): Fact<"execution_placement_seat_absent", {
|
|
137
|
+
seat: NonNullable<OwnerAwareSessionStore["executionPlacement"]>;
|
|
138
|
+
}>;
|
|
131
139
|
export declare function mcpReconnect(d: Pick<Deps, "runStore" | "sessionStorage">): Fact<"run_store_absent" | "session_head_face_absent", {
|
|
132
140
|
runStore: Store<"runStore">;
|
|
133
141
|
sessionStorage: HeadReadingSessionStore;
|
|
@@ -148,11 +156,11 @@ export declare function sessionList(d: Pick<Deps, "sessionStorage" | "runStore">
|
|
|
148
156
|
export declare function sessionFork(d: Pick<Deps, "sessionStorage">): Fact<"session_fork_face_absent" | "session_head_face_absent", {
|
|
149
157
|
sessionStorage: WithMethods<OwnerAwareSessionStore, "headOf" | "fork">;
|
|
150
158
|
}>;
|
|
151
|
-
/** 会话行可写位(`PATCH /v1/sessions/:id`):会话店的头读(属主 + 化身一次读 ——
|
|
159
|
+
/** 会话行可写位(`PATCH /v1/sessions/:id`):会话店的头读(属主 + 化身一次读 —— 门判属主,那一读就是写原语的行期望)∧ 行格写原语(锁内判、提交后另读应答行)。
|
|
152
160
|
* 三只 durable 店(SQL 双生 / local)都带;内存 dev 店没有行写口 ⇒ 501。
|
|
153
|
-
* 本面**没有**独立能力位(契约附录 B.2c 登记):老 worker 对这一动词答 405,本事实为假的部署答 501
|
|
161
|
+
* 本面**没有**独立能力位(契约附录 B.2c 登记):老 worker 对这一动词答 405,本事实为假的部署答 501;条件写也没有 —— 列表行上有 `rowTag` 即支持。 */
|
|
154
162
|
export declare function sessionPatch(d: Pick<Deps, "sessionStorage">): Fact<"session_row_faces_absent", {
|
|
155
|
-
sessionStorage: WithMethods<OwnerAwareSessionStore, "headOf" | "
|
|
163
|
+
sessionStorage: WithMethods<OwnerAwareSessionStore, "headOf" | "writeSessionRowCells">;
|
|
156
164
|
}>;
|
|
157
165
|
export declare function sessionDelete(d: Pick<Deps, "purgeSession" | "sessionStorage">): Fact<"session_purge_absent" | "session_head_face_absent", {
|
|
158
166
|
purge: Store<"purgeSession">;
|
|
@@ -162,11 +170,11 @@ export declare function sessionPolicy(d: Pick<Deps, "sessionPolicyStore" | "sess
|
|
|
162
170
|
policyStore: Store<"sessionPolicyStore">;
|
|
163
171
|
sessionStorage: HeadReadingSessionStore;
|
|
164
172
|
}>;
|
|
165
|
-
type SyncSessionStore = WithMethods<OwnerAwareSessionStore, "exportEntries" | "exportEntriesStream" | "beginImportStaging" | "headOf" | "sessionSummaryOf" | "
|
|
173
|
+
type SyncSessionStore = WithMethods<OwnerAwareSessionStore, "exportEntries" | "exportEntriesStream" | "beginImportStaging" | "headOf" | "sessionSummaryOf" | "writeSessionRowCells">;
|
|
166
174
|
type SessionSyncWhy = "store_backend_absent" | "file_history_store_absent" | "session_export_absent" | "session_import_staging_absent" | "session_row_faces_absent" | "policy_purge_absent";
|
|
167
175
|
/** 会话对等同步的**对话半族**(manifest / entries / plan / import 两相):后端 ∧ 文件历史店 ∧ 导出两面 ∧ staged 导入面 ∧
|
|
168
|
-
* 会话行三口(门读头 `headOf` —— 属主 + 化身一次读,属主判门、化身给 identical 短路腿;manifest 带 `title` / `pinned
|
|
169
|
-
*
|
|
176
|
+
* 会话行三口(门读头 `headOf` —— 属主 + 化身一次读,属主判门、化身给 identical 短路腿;manifest 带 `title` / `pinned`;导入经行格写原语以 `replay` 写者
|
|
177
|
+
* 按导入落定的那一位住客重放它们)∧ policy 店能清(overwrite-dst 的 commit 要擦目的端旧 policy 行)。
|
|
170
178
|
* 文件历史的 blob 搬运是另一只事实。 */
|
|
171
179
|
export declare function sessionSync(d: Pick<Deps, "backend" | "sessionStorage" | "fileHistoryStore" | "sessionPolicyStore">): Fact<SessionSyncWhy, {
|
|
172
180
|
backend: Store<"backend">;
|
package/dist/capability-facts.js
CHANGED
|
@@ -13,12 +13,13 @@ export const CAPABILITY_FACT_WHY = {
|
|
|
13
13
|
subagent_output_face_absent: "the background sub-agent output face is not wired",
|
|
14
14
|
task_handle_faces_absent: "the background task-handle output/stop faces are not wired",
|
|
15
15
|
session_head_face_absent: "the session store has no by-id head read (sessionStorage.headOf — owner, occupant and leaf of a session row in one read)",
|
|
16
|
+
execution_placement_seat_absent: "the session store has no execution placement seat (sessionStorage.executionPlacement — the occupant and the execution placement cell of a root session row in one read)",
|
|
16
17
|
checkpoint_store_absent: "no durable checkpoint store is wired (DURABLE_APPROVAL)",
|
|
17
18
|
session_audit_absent: "no session audit view is wired (needs a durable session store)",
|
|
18
19
|
session_watch_absent: "the session watch registry is not wired",
|
|
19
20
|
session_lister_absent: "no session enumerator is wired (session store or run store listSessions)",
|
|
20
21
|
session_fork_face_absent: "the session store has no fork face",
|
|
21
|
-
session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf /
|
|
22
|
+
session_row_faces_absent: "the session store has no session-row faces (headOf / sessionSummaryOf / writeSessionRowCells)",
|
|
22
23
|
session_purge_absent: "no session purge coordinator is wired",
|
|
23
24
|
session_policy_store_absent: "no session policy store is wired",
|
|
24
25
|
store_backend_absent: "no store backend is wired (DB_BACKEND=memory, multi-tenant bare boot, or half-configured SQL)",
|
|
@@ -99,6 +100,10 @@ export function sessionOwnership(d) {
|
|
|
99
100
|
const s = d.sessionStorage;
|
|
100
101
|
return headReadOf(s) !== undefined ? yes({ sessionStorage: s }) : no("session_head_face_absent");
|
|
101
102
|
}
|
|
103
|
+
export function executionPlacementRead(d) {
|
|
104
|
+
const seat = d.sessionStorage?.executionPlacement;
|
|
105
|
+
return seat !== undefined ? yes({ seat }) : no("execution_placement_seat_absent");
|
|
106
|
+
}
|
|
102
107
|
export function mcpReconnect(d) {
|
|
103
108
|
const runs = durableRuns(d);
|
|
104
109
|
if (!runs.available)
|
|
@@ -133,7 +138,7 @@ export function sessionFork(d) {
|
|
|
133
138
|
}
|
|
134
139
|
export function sessionPatch(d) {
|
|
135
140
|
const s = d.sessionStorage;
|
|
136
|
-
if (headReadOf(s) === undefined || s?.
|
|
141
|
+
if (headReadOf(s) === undefined || s?.writeSessionRowCells === undefined)
|
|
137
142
|
return no("session_row_faces_absent");
|
|
138
143
|
return yes({ sessionStorage: s });
|
|
139
144
|
}
|
|
@@ -163,7 +168,7 @@ export function sessionSync(d) {
|
|
|
163
168
|
return no("session_export_absent");
|
|
164
169
|
if (s.beginImportStaging === undefined)
|
|
165
170
|
return no("session_import_staging_absent");
|
|
166
|
-
if (headReadOf(s) === undefined || s.sessionSummaryOf === undefined || s.
|
|
171
|
+
if (headReadOf(s) === undefined || s.sessionSummaryOf === undefined || s.writeSessionRowCells === undefined)
|
|
167
172
|
return no("session_row_faces_absent");
|
|
168
173
|
if (overwriteWipeIncapable(d.sessionPolicyStore))
|
|
169
174
|
return no("policy_purge_absent");
|
package/dist/config-catalog.js
CHANGED
|
@@ -109,7 +109,7 @@ export const CONFIG_CATALOG = [
|
|
|
109
109
|
r("CONFIG_LKG_PATH", "integrations", "path", "LKG 落盘路径(设了 ⇒ 派生一条读拒行 = 这条绝对路径:根锚定,只守这一个文件,经符号链接的目录时引擎沿链连目标一起守;大小写不敏感;用户仓里同尾的路径读得到;空串拒启)", { derivedDefaultNote: "缺席 ⇒ 配置根(SEMA_CONFIG_DIR,缺省 ~/.sema)下按 worker + 凭证身份分箱派生", configKey: "configLkgPath" }),
|
|
110
110
|
r("CONFIG_LOCAL_DIR", "integrations", "path", "本地配置源根(config.d/<domain>.json);兼作数据根回落链一环", { configKey: "configLocalDir", danger: DATA }),
|
|
111
111
|
r("CONFIG_LOCAL_OWNER_UID", "integrations", "number", "本地配置源读之前的目录信任判官多信的那一个属主 uid(本服务用户与 root 之外 —— userns-remap 的 bind-mount、运维用户持有的配置);只放宽属主判据,组 / 他人可写照拒;形错拒启", { configKey: "configLocalOwnerUid", danger: SEC, derivedDefaultNote: "缺席 = config.d 路径上的目录与文档只许属于本服务用户或 root" }),
|
|
112
|
-
r("CONFIG_PROVIDER", "integrations", "enum",
|
|
112
|
+
r("CONFIG_PROVIDER", "integrations", "enum", `配置源双模选择(闭集,逐字比较;认不出的词 ⇒ 拒启;remote 而 ${WEB_ADMIN_ENV.url} 缺席 ⇒ 拒启 —— remote 的配置只来自那只中心)`, { enumValues: CONFIG_PROVIDER_WORDS, derivedDefaultNote: `缺席:${WEB_ADMIN_ENV.url} 在场 ⇒ remote,否则纯 env(无管道)`, configKey: "configProvider" }),
|
|
113
113
|
r("CONFIG_REQUIRE_ROSTER", "integrations", "boolean", "远程 registry 非 dryRun 时布防 ready 门:roster 未落地 ⇒ 计费提交 503 + /health ready:false(严格 'true')", { staticDefault: "false" }),
|
|
114
114
|
r("CORS_ORIGIN", "auth", "csv", "CORS 白名单(单值 v1 兼容回显;多值按请求 Origin 匹配 + Vary;未设=无 CORS 面)", { danger: SEC, configKey: "corsOrigins" }),
|
|
115
115
|
r("COST_QUOTA_WINDOW_SEC", "limitsHttp", "number", "per-principal 成本配额窗长(秒);SQL 腿窗长进桶主键 ⇒ center 腿显式 deferred(重启生效)", { staticDefault: "86400", danger: BILL, configKey: "costQuotaWindowSec", center: cLimits("costQuotaWindowSec", { timing: "restart", restartReason: "cost-quota-window" }) }),
|
|
@@ -139,7 +139,7 @@ export const CONFIG_CATALOG = [
|
|
|
139
139
|
r("DOCKER_NETWORK", "orchestration", "enum", "local-docker 容器网络模式", { enumValues: ["none", "bridge", "host"], staticDefault: "bridge", danger: SEC }),
|
|
140
140
|
r("DOCKER_PATH", "orchestration", "path", "docker 二进制路径"),
|
|
141
141
|
r("DOCKER_PIDS_LIMIT", "orchestration", "number", "local-docker fork-bomb 背栓(--pids-limit;非法值回 adapter 默认 512+warn)", { danger: SEC, derivedDefaultNote: "缺席 ⇒ adapter 默认 512" }),
|
|
142
|
-
r("DOCKER_SANDBOX_ENV", "orchestration", "secret", "local-docker 车道每条 docker exec 以 -e 注入的本进程 env 点名表(NAME,NAME;点到的键从 worker env 原样取,值不进 spec/center/日志;与 LSP_ENV_ALLOW / E2B_SANDBOX_ENV 同一只解析器与「点名放行」谓词:形错 /
|
|
142
|
+
r("DOCKER_SANDBOX_ENV", "orchestration", "secret", "local-docker 车道每条 docker exec 以 -e 注入的本进程 env 点名表(NAME,NAME;点到的键从 worker env 原样取,值不进 spec/center/日志;与 LSP_ENV_ALLOW / E2B_SANDBOX_ENV 同一只解析器与「点名放行」谓词:形错 / 点名名单型旋钮 / 点名本服务自有凭据名(会把本服务的凭据装进模型读得到的沙箱;判官 = 引擎拒白名单的同一只)拒启且不回显值;本进程环境里没有的名按序号 warn、不转发;只在本车道被选中时求值;原文按凭据类对待:只回在场位、不进任何子进程)", { danger: SEC }),
|
|
143
143
|
r("DRAIN_GRACE_MS", "limitsHttp", "number", "SIGTERM 优雅排空窗(ms;期间新计费提交 503+Retry-After)。出厂默认是**服务器部署**的取值;壳自 spawn 的引擎会被壳注入更短的窗 ⇒ 排壳形关机预算时以本行的 effectiveValue(= 本进程实际生效值)为准,不照抄 staticDefault", { staticDefault: String(10 * 60 * 1000), configKey: "drainGraceMs", center: cLimits("drainGraceMs") }),
|
|
144
144
|
r("DRAIN_SECOND_SIGNAL_MIN_GAP_MS", "limitsHttp", "number", `排空期「第二发信号 = 硬停」的最小间隔(ms;锚 = 本次排空的第一发停止信号 —— SIGTERM / SIGHUP 升级进的排空,入口那一发就是它;排空口 / 租约被拒 / 附着租约自退进的排空,到达的第一发被吸收、不缩短期限。SIGTERM / SIGINT 与锚相隔不足 ⇒ 同一拍的重复投递,一行 drain_duplicate_signal_ignored 后忽略、排空继续;0 = 关,恒按第二发硬停;须为 [${DRAIN_SECOND_SIGNAL_MIN_GAP_BOUNDS.minMs}, ${DRAIN_SECOND_SIGNAL_MIN_GAP_BOUNDS.maxMs}] 内十进制整数(上界 = DRAIN_GRACE_MS 地板),小数 / 负数 / 越界拒启)`, { staticDefault: String(DRAIN_SECOND_SIGNAL_MIN_GAP_DEFAULT_MS), configKey: "drainSecondSignalMinGapMs" }),
|
|
145
145
|
r("DURABLE_APPROVAL", "approval", "boolean", "durable suspend/resume HITL(需 SQL 店;决定 checkpointStore 与 /v1/approvals 面的存在性)", { danger: SEC, derivedDefaultNote: "posture 三态(S-178):显式词恒赢,缺席 = 单用户(REQUIRE_PRINCIPAL≠true)且有耐久店 ⇒ on / 多租户或无耐久店 ⇒ off;生效来源见 GET /v1/diagnostics/wiring 的 serverGates.durableApproval.source", configKey: "durableApproval" }),
|
|
@@ -151,7 +151,7 @@ export const CONFIG_CATALOG = [
|
|
|
151
151
|
r("E2B_LIVENESS_MS", "orchestration", "number", LIVENESS_KNOB_SEMANTICS("e2b"), { derivedDefaultNote: LIVENESS_KNOB_DEFAULT_NOTE }),
|
|
152
152
|
r("E2B_MOUNT_PATH", "orchestration", "path", "e2b 工作区根(resume 用当前值,改前先 drain 挂起任务)"),
|
|
153
153
|
r("E2B_ORPHAN_RECLAIM", "orchestration", "boolean", "崩溃遗留沙盒回收腿(boot 一次+周期;判据保守,拿不准恒不杀)", { staticDefault: "true", danger: BILL }),
|
|
154
|
-
r("E2B_SANDBOX_ENV", "orchestration", "secret", "转发进 e2b 沙箱的本进程 env 点名表(NAME,NAME;点到的键从 worker env 原样取,值不进 spec/center/事件日志;与 LSP_ENV_ALLOW / DOCKER_SANDBOX_ENV 同一只解析器与「点名放行」谓词:形错 /
|
|
154
|
+
r("E2B_SANDBOX_ENV", "orchestration", "secret", "转发进 e2b 沙箱的本进程 env 点名表(NAME,NAME;点到的键从 worker env 原样取,值不进 spec/center/事件日志;与 LSP_ENV_ALLOW / DOCKER_SANDBOX_ENV 同一只解析器与「点名放行」谓词:形错 / 点名名单型旋钮 / 点名本服务自有凭据名(会把本服务的凭据装进模型读得到的沙箱;判官 = 引擎拒白名单的同一只)拒启且不回显值;本进程环境里没有的名按序号 warn、不转发;只在本车道被选中时求值;原文按凭据类对待:只回在场位、不进任何子进程)", { danger: SEC }),
|
|
155
155
|
r("E2B_SANDBOX_MAX_MS", "orchestration", "number", "e2b 沙箱最长存活(ms)", { staticDefault: "3600000", danger: BILL }),
|
|
156
156
|
r("E2B_TEMPLATE", "orchestration", "string", "e2b 模板名(缺省 adapter 基础模板)"),
|
|
157
157
|
r("E2B_TIMEOUT_MS", "orchestration", "number", "e2b 单命令总超时(ms)"),
|
|
@@ -208,10 +208,10 @@ export const CONFIG_CATALOG = [
|
|
|
208
208
|
r("K8S_LIVENESS_MS", "orchestration", "number", LIVENESS_KNOB_SEMANTICS("k8s"), { derivedDefaultNote: LIVENESS_KNOB_DEFAULT_NOTE }),
|
|
209
209
|
r("K8S_MEMORY", "orchestration", "string", "沙箱 pod 内存限额(2Gi 默认曾被真 OOM)"),
|
|
210
210
|
r("K8S_MOUNT_PATH", "orchestration", "path", "k8s 工作区挂载路径"),
|
|
211
|
-
r("K8S_NAMESPACE", "orchestration", "string", "沙箱 pod namespace"),
|
|
211
|
+
r("K8S_NAMESPACE", "orchestration", "string", "沙箱 pod 所在的 namespace(REMOTE_EXEC=k8s 必需件,与 K8S_SANDBOX_IMAGE 同级:缺席、空串或只有空白 ⇒ 起服拒,拒句点名本旋钮;服务不带内置缺省 —— 部署的声明是唯一来源,随包 chart 已显式设为 sandbox.namespace;只在 REMOTE_EXEC=k8s 被选中时求值)"),
|
|
212
212
|
r("K8S_RUNTIME_CLASS", "orchestration", "string", "沙箱 pod runtimeClass(Kata 等)"),
|
|
213
213
|
r("K8S_SANDBOX_BROKER_IMAGE", "orchestration", "string", "成员 git 凭据代理容器的镜像(k8s 沙箱 pod 的 containers[1],只挂在成员 run 的 pod 上;建议填本引擎自身镜像 —— 代理是本包里固定路径的一只程序,命令固定);不设 ⇒ 成员 git 凭据平面关(GET /v1/capabilities 的 credentialPlane.sandboxGit = broker_image_unset),任何 pod 都不挂代理,pod 形逐字节同不设时;只在 REMOTE_EXEC=k8s 被选中时求值"),
|
|
214
|
-
r("K8S_SANDBOX_ENV", "orchestration", "secret", `转发进 k8s 沙箱 pod 容器 env 的本进程 env 点名表(NAME,NAME;点到的键从 worker env 原样取,值只进该 pod 自己的 Secret —— pod spec 的容器 env 只带 secretKeyRef 引用、不带值,Secret 随 pod 由集群回收;不进工作区 / 快照 / center / 事件日志;沙箱命名空间的 Role 要 secrets ${SANDBOX_SECRET_SEAT_VERBS.env.join(" / ")},起服问不许即拒启;与 LSP_ENV_ALLOW / E2B_SANDBOX_ENV / DOCKER_SANDBOX_ENV 同一只解析器与「点名放行」谓词:形错 /
|
|
214
|
+
r("K8S_SANDBOX_ENV", "orchestration", "secret", `转发进 k8s 沙箱 pod 容器 env 的本进程 env 点名表(NAME,NAME;点到的键从 worker env 原样取,值只进该 pod 自己的 Secret —— pod spec 的容器 env 只带 secretKeyRef 引用、不带值,Secret 随 pod 由集群回收;不进工作区 / 快照 / center / 事件日志;沙箱命名空间的 Role 要 secrets ${SANDBOX_SECRET_SEAT_VERBS.env.join(" / ")},起服问不许即拒启;与 LSP_ENV_ALLOW / E2B_SANDBOX_ENV / DOCKER_SANDBOX_ENV 同一只解析器与「点名放行」谓词:形错 / 点名名单型旋钮 / 点名本服务自有凭据名(会把本服务的凭据装进模型读得到的沙箱;判官 = 引擎拒白名单的同一只)拒启且不回显值;本进程环境里没有的名按序号 warn、不转发;与包源派生 env 撞名时显式名单胜;只在本车道被选中时求值;原文按凭据类对待:只回在场位、不进任何子进程)`, { danger: SEC }),
|
|
215
215
|
r("K8S_SANDBOX_IMAGE", "orchestration", "string", "k8s 车道沙箱镜像(REMOTE_EXEC=k8s 必需件)"),
|
|
216
216
|
r("K8S_SANDBOX_IPV6", "orchestration", "enum", "k8s 沙箱 pod 的 IPv6:disabled = pod 级 sysctl 关 IPv6(net.ipv6.conf.all / default.disable_ipv6=1;两只都不在 k8s 的 safe sysctl 表里 ⇒ 每个节点 kubelet 要 --allowed-unsafe-sysctls 点名,否则 pod 起不来;沙箱 ns 不能 enforce PodSecurity baseline / restricted);enabled = 不动 pod(pod 保留平台给的 IPv6,只执行 IPv4 的出网策略管不到它,起服自检每次一行 sandbox_egress_policy_gap{kind: ipv6_enabled});词表外拒启", { enumValues: SANDBOX_IPV6_WORDS, staticDefault: SANDBOX_IPV6_DEFAULT, danger: SEC }),
|
|
217
217
|
r("K8S_TIMEOUT_MS", "orchestration", "number", "k8s 沙箱 pod 寿命(activeDeadlineSeconds,ms;整只 pod 的泄漏护栏,后台任务超时也被它钳;各条命令的超时见工具超时)"),
|
|
@@ -395,12 +395,13 @@ export const CONFIG_CATALOG = [
|
|
|
395
395
|
r("RATE_LIMIT_RPM", "limitsHttp", "number", "计费提交每分钟限流(0=关)", { staticDefault: "0", danger: BILL, configKey: "rateLimitPerMin", center: cLimits("rateLimitPerMin") }),
|
|
396
396
|
r("READ_DENY_BUILTIN_EXCLUDE", "orchestration", "csv", "按行名删内建 deny 条目(档位之后生效;绝不削任务显式 deny)", { danger: SEC, configKey: "readDenyBuiltinExclude" }),
|
|
397
397
|
r("READ_DENY_BUILTIN_TIERS", "orchestration", "csv", "内建 deny 表档位选择(闭集五档 credentials/shell-history/browser/wallet/agent-config;none=显式空姿态)", { danger: SEC, derivedDefaultNote: "缺席 ⇒ 出厂两档在岗 **credentials,agent-config**(core 7.34.0 R-2 起;7.22.0–7.33.x 曾为 OFF)。要全关显式写 none;要全五档显式写 credentials,shell-history,browser,wallet,agent-config;空值拒启(手滑与显式意图不许同形)", configKey: "readDenyBuiltinTiers" }),
|
|
398
|
+
r("READ_DENY_FLOOR_REQUIRED", "orchestration", "boolean", "要求读拒表的字节地板:true ⇒ 读拒表有行而执行环境不守地板(起服行 remote_exec_enabled.keepsReadFloor=false;此时另有起服 warn read_deny_floor_required_unkept)的 run 在准备期拒(config.read_deny_floor_unkept,一个命令都不起;同步提交 409)。出厂读拒档在岗 ⇒ 这类车道上带手的 run 一律拒起", { staticDefault: "false", danger: SEC, derivedDefaultNote: "缺席 ⇒ 不要求:run 照跑,每 run 一条 operator 通告 config.read_deny_floor_unkept(engine_notice 日志;递归读照读表里的文件,通告不是保护)", configKey: "readDenyFloorRequired" }),
|
|
398
399
|
r("READ_DENY_PATTERNS", "orchestration", "csv", "READ 面额外 deny pattern 表", { danger: SEC, configKey: "readDenyPatterns" }),
|
|
399
400
|
r("READ_FACE", "orchestration", "enum", "READ 容纳面档位(env 逐键恒赢 center —— 部署主权表达)", { enumValues: ["open", "roots"], danger: SEC, derivedDefaultNote: "缺席 ⇒ 按 posture 派生(S-167):单用户 turnkey(REQUIRE_PRINCIPAL 未设)铸 open;多租户不铸键、core 默认 roots。生效来源见 GET /v1/diagnostics/wiring 的 readFace.source 四词", configKey: "readFace" }),
|
|
400
401
|
r("REAP_INTERVAL_SEC", "limitsHttp", "number", "reaper 周期(秒)", { staticDefault: "60", configKey: "reapIntervalSec" }),
|
|
401
402
|
r("REAP_RUN_STALE_SEC", "limitsHttp", "number", "run 活性判陈旧阈(秒)", { staticDefault: "120", configKey: "runStaleSec", center: cLimits("runStaleSec") }),
|
|
402
403
|
r("REMOTE_EXEC", "orchestration", "enum", "执行车道选择(点名而配不齐/认不出 ⇒ 拒启,绝不静默降级到 host/stub)", { enumValues: REMOTE_EXEC_PROVIDER_WORDS, danger: SEC, derivedDefaultNote: "缺席:CONFIG_PROVIDER=local ⇒ host;其余 ⇒ 进程内 stub(手带整族不挂;残余名册看活体 wiring_manifest 里 mountedBy=hands 的条目数,不按工具名点。想让这一形拒启见 REQUIRE_EXECUTION_LANE)", configKey: "remoteExec", resolve: (c) => c.remoteExec?.provider ?? null }),
|
|
403
|
-
r("REMOTE_EXEC_HOME_DIR", "orchestration", "path", "执行环境的 home 目录(`~/` 形权限规则的基、引擎家锚拒读行的落点;core ExecutionEnv.homeDir 座)
|
|
404
|
+
r("REMOTE_EXEC_HOME_DIR", "orchestration", "path", "执行环境的 home 目录(`~/` 形权限规则的基、引擎家锚拒读行的落点;core ExecutionEnv.homeDir 座)。声明与车道出厂答案(host ⇒ 本进程家目录,e2b ⇒ /home/user)都是主张:读得出家目录的车道(k8s / local-docker / ssh / adb / e2b / host)在每只执行环境开起来时拿环境里命令看到的 $HOME 证它(同一只判官、同一句拒),不一致或问不出 ⇒ 那只环境不开;不声明且车道没有出厂答案时,建环境那一拍实测 $HOME 填引擎手里的座(`~/` 形规则的下单门仍只认 boot 期答案);device 读不了 ⇒ 声明即座、起服 warn execution_lane_home_unmeasured 披露未实测", { danger: SEC, derivedDefaultNote: "缺席:host/in-process ⇒ os.homedir();e2b ⇒ /home/user(两者都在环境开起来时与 $HOME 对证);k8s/local-docker/ssh/adb ⇒ 建环境时实测 $HOME(实测缺席 ⇒ 那只环境的座缺席:泄内容的递归读全 shell 面真人问、只读面拒,并响 warn execution_lane_home_undeclared);device ⇒ 无(设备协议没有家目录读数:起服 warn execution_lane_home_undeclared);`~/` 形规则的下单门恒只认声明(无声明即 422 响亮拒)", configKey: "remoteExecHomeDir", resolve: (c) => c.remoteExecHomeDir ?? null }),
|
|
404
405
|
r("REQUIRE_EXECUTION_LANE", "orchestration", "boolean", "开了之后:REMOTE_EXEC 未点名 ∧ CONFIG_PROVIDER≠local ⇒ **拒启**并点名该设什么。默认关 = 照旧启动,但执行环境是进程内 stub、**零手带工具**(手带整族不挂;活体读数:mountedBy=hands 条目 10 → 0),名册里其余工具照常执行,任务仍回 status=completed —— 凡需要手的请求,与「模型不肯用工具」在用户面同形。判据 = 活体 wiring_manifest 里 mountedBy=hands 的条目数,不按工具名点;名册总条数随 core 版本走,不写死。托管/云部署推荐开(docs/DEPLOY-PREREQS.md)", { staticDefault: "false", danger: SEC, configKey: "requireExecutionLane" }),
|
|
405
406
|
r("REQUIRE_PRINCIPAL", "auth", "boolean", "多租户开关(posture 判别位:true ⇒ CC 能力族默认收紧)", { staticDefault: "false", danger: SEC, configKey: "requirePrincipal" }),
|
|
406
407
|
r("RESOURCE_SUSPEND", "approval", "boolean", "durable 路径 opt-in core resourceSuspend(预算/preempt ⇒ 可恢复挂起)", { staticDefault: "false", configKey: "resourceSuspend" }),
|
|
@@ -409,8 +410,8 @@ export const CONFIG_CATALOG = [
|
|
|
409
410
|
r("RESOURCE_SUSPEND_TOTAL_TOKENS", "approval", "number", "跨片 token 总额(0=不设;与 MAX_TASK_TOKENS 的 per-slice 窗是两根轴)", { staticDefault: "0", danger: BILL, configKey: "resourceSuspendTotalTokens" }),
|
|
410
411
|
r("RESOURCE_SUSPEND_TTL_SEC", "approval", "number", "resource/preempt checkpoint 的弃置 GC TTL(秒;0 ⇒ core 默认 30d)", { staticDefault: "0", danger: DATA, configKey: "resourceSuspendTtlSec" }),
|
|
411
412
|
r("RETENTION_MAX_AGE_DAYS", "auth", "number", "托管留存期声明(core 启动期能力校验;真删除归 sweep lane)", { danger: DATA }),
|
|
412
|
-
r("RETENTION_MODE", "auth", "enum", "留存 sweep 灰度档(拼错拒启 —— audit-only 谎成 enforce
|
|
413
|
-
r("RETENTION_SWEEP_INTERVAL_SEC", "auth", "number", "留存 sweep 节律(秒;0=lane
|
|
413
|
+
r("RETENTION_MODE", "auth", "enum", "留存 sweep 灰度档(拼错拒启 —— audit-only 谎成 enforce 两个方向都致命;enforce 而 RETENTION_MAX_AGE_DAYS 缺、或 RETENTION_SWEEP_INTERVAL_SEC 缺 / 为 0 ⇒ 拒启)", { enumValues: ["audit-only", "enforce"], staticDefault: "audit-only", danger: DATA, resolve: (c) => c.retentionSweep.mode }),
|
|
414
|
+
r("RETENTION_SWEEP_INTERVAL_SEC", "auth", "number", "留存 sweep 节律(秒;0=lane 关;> 0 而 RETENTION_MAX_AGE_DAYS 缺 ⇒ 拒启)", { staticDefault: "0", danger: DATA }),
|
|
414
415
|
r("REWIND_SNAPSHOT_MAX_MB", "store", "number", "已退役(S-15 整树快照纪元退役):设了只 boot warn 一次,零行为", { envTiming: "inert" }),
|
|
415
416
|
r("ROSTER_RETENTION_MS", "orchestration", "number", "agent_roster 行 TTL(ms;SQL twins 扩展面)", { staticDefault: String(30 * 24 * 60 * 60 * 1000), danger: DATA, configKey: "rosterRetentionMs" }),
|
|
416
417
|
r("ROUTER_ENABLED", "orchestration", "boolean", "A 价值路由(per-task 编排自动决策;ship-dark)", { staticDefault: "false", configKey: "routerEnabled" }),
|