@sema-agent/server 7.134.0 → 7.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +134 -0
- package/USAGE.md +98 -30
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +62 -150
- package/dist/approval-card.js +33 -51
- package/dist/approval-content-kind.d.ts +22 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +1 -1
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +28 -24
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +3 -2
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stores.js +2 -1
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +5 -10
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +10 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +26 -25
- package/dist/capability-facts.js +14 -16
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +23 -11
- package/dist/file-history-disclosure.js +7 -12
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +36 -18
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +39 -13
- package/dist/http/checkpoint-ctx.js +74 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +7 -7
- package/dist/http/resume-ctx-read.js +1 -1
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -5
- package/dist/http/routes/approvals-assistant.js +55 -15
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +22 -10
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +73 -44
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +30 -44
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +28 -21
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +16 -15
- package/dist/parked-decide.js +5 -4
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +44 -66
- package/dist/plugins/checkpoint-store-sql.js +55 -102
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +3 -4
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +66 -40
- package/dist/plugins/one-time-migrations.js +115 -34
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +8 -8
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +9 -2
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +19 -4
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +3 -3
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +52 -35
- package/dist/session-incarnation.js +23 -8
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +3 -1
- package/dist/task-a2a.js +34 -2
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +12 -8
- package/dist/task-mcp.js +19 -4
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +143 -197
- package/dist/tool-approval.js +13 -28
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +12 -7
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +41 -63
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +44 -30
- package/dist/trace/redact.js +191 -89
- package/dist/trace/self-minted-wire.d.ts +35 -14
- package/dist/trace/self-minted-wire.js +8 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +2 -1
- package/scripts/drain-check.mysql.sql +4 -2
- package/scripts/drain-check.pg.sql +4 -2
- package/skills/loop.md +1 -1
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
package/dist/leader/diffout.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface PullDiffOptions {
|
|
|
25
25
|
/** Fail-on-truncation cap (bytes). Default 5 MiB. */
|
|
26
26
|
maxBytes?: number;
|
|
27
27
|
signal?: AbortSignal;
|
|
28
|
-
/** Idle read timeout (E2B
|
|
28
|
+
/** Idle read timeout (E2B [ref] — never hang on an unreachable sandbox). Default 30s. */
|
|
29
29
|
readTimeoutMs?: number;
|
|
30
30
|
}
|
|
31
31
|
export type PullDiffResult = {
|
package/dist/leader/diffup.d.ts
CHANGED
|
@@ -28,11 +28,11 @@ export declare function buildUploadScript(p: {
|
|
|
28
28
|
/** The objective suffix that makes the upload the worker's last task step (no URL through the model). */
|
|
29
29
|
export declare function uploadStepSuffix(workDir: string): string;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* [ref] —— the INCREMENTAL upload loop's lifetime protocol (single writer; the wire only runs its two verbs).
|
|
32
32
|
*
|
|
33
33
|
* While a worker env lives, a background loop re-runs the staged upload script every {@link UPLOAD_LOOP_PERIOD_SEC}
|
|
34
34
|
* seconds, so the worker's fixed diff key tracks its latest COMMITTED progress and salvage survives an env hard-crash
|
|
35
|
-
* (#16 tail: run 019eca71's "4 commits vaporized"). The loop must NOT outlive the env: the pre-
|
|
35
|
+
* (#16 tail: run 019eca71's "4 commits vaporized"). The loop must NOT outlive the env: the pre-[ref] form
|
|
36
36
|
* (`nohup sh -c 'while true; …' &`) relied on "the pod dies, the loop dies", which holds only where the env IS a
|
|
37
37
|
* pod — on an env whose shell is the host's (`RemoteHostExecutionEnv`, core `NodeExecutionEnv`) teardown does not
|
|
38
38
|
* reap detached processes (by contract), and the loop became a ppid-1 orphan (254 of them on one box, 2026-10-01).
|
|
@@ -73,7 +73,7 @@ export declare function createLeaderEndpoint(runLeader: (body: LeaderRequestBody
|
|
|
73
73
|
requiredFields?: readonly string[];
|
|
74
74
|
/** [ref] 车4 件1:durable 登记表。缺席 ⇒ 显式的单副本内存降级臂(见文件头注)。 */
|
|
75
75
|
store?: LeaderRunStore;
|
|
76
|
-
/**
|
|
76
|
+
/** [ref] RH-3:「这个调用方读得到这一行 leader run 吗」—— 属主存取器的判官形(`http/owner-access.ts` 的 `createLeaderRunVisibility`,boot 装一次)。
|
|
77
77
|
* 必填:本模块不自判属主(修前手抄 `owner == null || owner === requester`,缺 [ref] C8 窄互认臂而注称 mirrors runOwnerOk),读面与幂等重放同读它。 */
|
|
78
78
|
ownerVisible: (principal: string | null | undefined, owner: string | null | undefined) => boolean;
|
|
79
79
|
}): LeaderEndpoint;
|
package/dist/leader/fanout.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export interface WorkerReport {
|
|
|
51
51
|
checkpointGate?: CheckpointGate;
|
|
52
52
|
/** [ref] Slice 6: the worker's terminal failure code (e.g. `limits.max_cost_exceeded` on an
|
|
53
53
|
* exhausted resume, `limits.max_turns_exceeded` — core 5.8.0 码名轴) — surfaced for /v1/leader observability.
|
|
54
|
-
*
|
|
54
|
+
* [ref]:源从 `TaskResult.errorCode` 换成因由 `failed` 臂的 `code`(本报告面的键名与形不变)。 */
|
|
55
55
|
errorCode?: string;
|
|
56
56
|
/** LEADER-REPAIRLOOP-INTEGRATION §10.6 (THE push chokepoint): the `runRepairLoop` terminal a single-agent
|
|
57
57
|
* worker resolved to, when the repair loop ran on this worker (LEADER_REPAIR_LOOP on). It MUST ride on the
|
package/dist/leader/leader.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import { type UnattendedLegSpec } from "../unattended-permission-mode.js";
|
|
|
24
24
|
* the cause is `failed` with no nested park), `signal.aborted`, or `maxSlices` (a belt; core's ledger
|
|
25
25
|
* fail-fast + per-task suspend-loop cap are the primary bounds). Returns the final result.
|
|
26
26
|
*
|
|
27
|
-
* 🔴
|
|
27
|
+
* 🔴 [ref](core 7.6.0 D-8):判据从「两个平面键合读」(`checkpointToken` 在场 ∧ `checkpointGate.kind`)
|
|
28
28
|
* 换成**一条因由**({@link pausedCauseOf}) —— 这条循环从一开始就刻意**不按 status 判**(顶注原话:
|
|
29
29
|
* 「the verify wrapper may surface a suspend as failed-with-token」),因为嵌套边界会把 park 报成 failed;
|
|
30
30
|
* 现在那件事是形状:两条路径同一个读法,而 token 与 gate 在同一个 `PausedCause` 上,不可能只有一半。
|
|
@@ -131,7 +131,7 @@ export interface LeaderDeps {
|
|
|
131
131
|
* reaction runs. (The suspended reaction itself — cancel the others, exempt the suspended worker, surface
|
|
132
132
|
* its token — is unconditional, not gated here.)
|
|
133
133
|
*
|
|
134
|
-
* 🔴
|
|
134
|
+
* 🔴 [ref] / clay [ref] ④(7.83.0):**merge-conflict 不再是一条 replan 臂**。worker 分支合不上 ⇒ 不起
|
|
135
135
|
* collapse 模型,`conflict` 段(分支 + 冲突文件)交给**用户**,见 {@link LeaderResult.conflict}。 */
|
|
136
136
|
replan?: {
|
|
137
137
|
/** Fan-out budget (USD, sum of worker costs). Exceeded → stop fan-out, collapse to single (C5). */
|
|
@@ -180,14 +180,14 @@ export interface LeaderResult {
|
|
|
180
180
|
/** Set when planning/provisioning failed before fan-out. */
|
|
181
181
|
error?: string;
|
|
182
182
|
/** Replan-lite ([ref] §6): which trigger won arbitration + what was done.
|
|
183
|
-
* 🔴
|
|
183
|
+
* 🔴 [ref] / [ref] ④(7.83.0):闭集删掉 `"merge-conflict"`(硬 breaking,零别名——消费方的 tsc 红即通知)。 */
|
|
184
184
|
replan?: {
|
|
185
185
|
trigger: "suspended" | "budget" | "verify-fail" | "worker-failed";
|
|
186
186
|
redispatched?: string[];
|
|
187
187
|
collapsed?: string;
|
|
188
188
|
};
|
|
189
189
|
/**
|
|
190
|
-
* 🔴
|
|
190
|
+
* 🔴 [ref] / clay [ref] ④(7.83.0)——**合不上 = 交给用户**(对齐 CC 形)。merge 的 `phase:"apply"` 冲突
|
|
191
191
|
* 不再起 collapse 模型:`ok=false` + 本段,用户拿 `workers[].branch` + `files` 自己 `git merge` / cherry-pick
|
|
192
192
|
* (worker 分支本就留在集成沙箱 / 远端)。run 状态走既有第三终局 `needs_human`(endpoint 的状态映射),不加
|
|
193
193
|
* 新状态词。**缺席何义** = 这一趟没有冲突,或对面是老 server。
|
package/dist/leader/merge.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* 1. pull each worker's patch OUT of its container (M2 `pullDiff` — no creds go in).
|
|
6
6
|
* 2. provision an EPHEMERAL no-net/no-creds integration sandbox (base pre-provisioned by the dep).
|
|
7
7
|
* 3. `git apply --3way` each patch in sequence (conflict ⇒ TERMINAL: capture `.rej` + the conflict PATH list and
|
|
8
|
-
* hand them to the USER as {@link MergeConflict} —
|
|
8
|
+
* hand them to the USER as {@link MergeConflict} — [ref] / clay [ref] ④; council#3's quarantine unchanged).
|
|
9
9
|
* 4. run the full test suite IN the sandbox (the gate; untrusted diff never touches the control plane — [26]§16).
|
|
10
10
|
* 5. green → the **Coordinator** (trusted control plane, holds creds — NOT the sandbox, council#1) takes the
|
|
11
11
|
* integrated patch and pushes with CAS `--force-with-lease=<ref>:<baseSha>` (push race → retry — council#2).
|
|
@@ -58,7 +58,7 @@ export interface IntegrationRepair {
|
|
|
58
58
|
}>;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* [ref] / clay [ref] ④ — **合不上 = 交给用户**(对齐 CC 形)。`git apply --3way` 冲突时的产出:冲突**路径**
|
|
62
62
|
* (不含内容)+ 哪几只 worker 的补丁已经进树,由 leader 铸成 `LeaderResult.conflict` 段交到用户手上。
|
|
63
63
|
* 本段刻意**只有路径与身份**,不把任何 worker 的 diff 交给模型。CC 对照(2.1.280 语料):`conflict resolution` 零命中,
|
|
64
64
|
* `collapse` 的 169 处命中里没有一处与「把并行 worker 收成一个」相关(UI 折叠 / context collapse 一类);teammates 各一个
|
|
@@ -202,7 +202,7 @@ export declare function mergeBranches(reports: WorkerReport[], baseSha: string,
|
|
|
202
202
|
* 所以一个真叫 `__PROBE_FAIL_grep` 的文件到达时是 `./__PROBE_FAIL_grep`,不与标记二义;把剥 `./` 挪到前面就静默破功。 */
|
|
203
203
|
export declare const PROBE_FAIL_PREFIX = "__PROBE_FAIL_";
|
|
204
204
|
/**
|
|
205
|
-
*
|
|
205
|
+
* [ref] / [ref] ④ — 把 `grep -rIl` + `find` 的输出变成**冲突路径清单**(给用户,不含内容)。
|
|
206
206
|
* 逐行:去掉 `./` 前缀、剥掉 `.rej` 后缀(`pkg/a.ts.rej` 与 `pkg/a.ts` 是同一处冲突的两种痕迹)、去重、
|
|
207
207
|
* 按 {@link CONFLICT_FILES_MAX} 封顶并**交回是否截断**(F5:静默封顶会让用户把 200 当成全部)。两条命令合成
|
|
208
208
|
* 一次 exec,所以 stdout 里两族路径混在一起 —— 本函数是它唯一的解释者。任一半探测失败 ⇒ 那一半打出
|
|
@@ -83,7 +83,7 @@ export interface RepairWireCfg {
|
|
|
83
83
|
verifierModelId: string;
|
|
84
84
|
};
|
|
85
85
|
/** Per-attempt observability callback. */
|
|
86
|
-
/**
|
|
86
|
+
/** [ref](core 7.6.0 D-8):键名随 core 从 `terminal` 改成 `repairTerminal` —— `terminal` 这个名字在
|
|
87
87
|
* `TaskResult` 上已经归**运行终局因由**所有,修复循环的判词与它同名会是两个不同东西共用一个名字
|
|
88
88
|
* (本仓 status/kind 同名词混淆病族)。 */
|
|
89
89
|
onAttempt?: (info: {
|
package/dist/leader/wire.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { LeaderRequestBody } from "./endpoint.js";
|
|
|
8
8
|
/** leader worker 的 durable 审批座(`LeaderWireConfig.durable` 函数席每次产出的一份)。 */
|
|
9
9
|
export interface LeaderDurableSeat {
|
|
10
10
|
readonly checkpointStore: CheckpointStoreFull;
|
|
11
|
-
/**
|
|
11
|
+
/** [ref]:写 worker 续跑上下文的封口(`ServiceDeps.checkpointCtxSealing` 同一只;规则属主 `http/checkpoint-ctx.ts` 末段「凭据位密封」)。
|
|
12
12
|
* worker 的续跑体只有入口词 + 子任务 objective、不带凭据位 ⇒ 实际不封任何值,但写 ctx 的每一笔都经同一只封口(没有不封的第二种写法)。 */
|
|
13
13
|
readonly ctxSealer: CheckpointCtxSealer | undefined;
|
|
14
14
|
readonly requireApproval: string[];
|
|
@@ -29,7 +29,7 @@ export interface LeaderWireConfig {
|
|
|
29
29
|
* (checkpoint + paused env) instead of failing — the trigger replan-lite C4 arbitrates on. Mirrors main.ts's
|
|
30
30
|
* per-task durable wiring; ctx is seeded at provision so the surfaced token is resumable on the single-agent path.
|
|
31
31
|
*
|
|
32
|
-
* 🔴 **函数席,不是快照**(
|
|
32
|
+
* 🔴 **函数席,不是快照**([ref] 波 2 ①;先例 = 下方 `deploymentPosture` 的 [ref] 函数席):审批名单
|
|
33
33
|
* (`governance.approvalRequire`)自本批起在进程内会被中心热换。boot 期取一次值会把这条腿钉在起服那一刻的名单上
|
|
34
34
|
* —— 起服时名单为空 ⇒ 整块缺席、之后加进来的工具在 leader worker 上**永远**不被门住(fail-OPEN)。
|
|
35
35
|
* `provisionWorker` 每只 worker 调一次(同一只 worker 的 toolPolicy / resource 停车 / ctx 保温读同一份);
|
|
@@ -60,8 +60,8 @@ export interface LeaderWireConfig {
|
|
|
60
60
|
* 修前(≤7.53)这五只 Runner 一席都没有:运维写的 READ_DENY_PATTERNS / MEMORY_DELEGATION_EVIDENCE 等对
|
|
61
61
|
* leader 编排的 planner / worker / repair / conflict 四类任务**静默不生效**(core 内建 deny 表仍在)。
|
|
62
62
|
*
|
|
63
|
-
* 🔴 **是 provider 不是快照**(
|
|
64
|
-
* **逐调用现构**的,而
|
|
63
|
+
* 🔴 **是 provider 不是快照**([ref] 追加,codex 对抗复审 r1 [high] 验真后修):本车道的 Runner 是
|
|
64
|
+
* **逐调用现构**的,而 [ref] 起 `config.readFace` 在进程内**会变**(center 下发的 read face 转成了
|
|
65
65
|
* `Runner.swapDeps` 热换席)。boot 期取一次值再五处复用,等于让 leader 车道永远停在起服那一刻的 READ
|
|
66
66
|
* 姿态:读面(`/v1/capabilities`、`/v1/diagnostics/wiring`)报新档、`restart.reasons` 也不再要求重启,
|
|
67
67
|
* 而**新建的 leader Runner 仍在旧档上跑** —— 组织把 `open` 收紧成 `roots` 之后这条腿还在 open,方向是
|
|
@@ -171,7 +171,7 @@ export interface LeaderWireConfig {
|
|
|
171
171
|
/** The env surface wire needs (both the E2B and k8s adapters implement core's RemoteExecutionEnv). */
|
|
172
172
|
type WireEnv = Pick<RemoteExecutionEnv, "exec" | "writeFile">;
|
|
173
173
|
/**
|
|
174
|
-
* [ref] —— leader 自铸沙盒的**回收闸**(集成沙盒 / repair-loop grader 各一只;判据本身
|
|
174
|
+
* [ref] —— leader 自铸沙盒的**回收闸**(集成沙盒 / repair-loop grader 各一只;判据本身 [ref] 起抽成下方
|
|
175
175
|
* {@link assertLeaderOwnedEnvReapable},worker 腿同判)。
|
|
176
176
|
*
|
|
177
177
|
* core 契约:`ExecutionEnv` 基面**没有** `destroy`;只有实现了 `RemoteExecutionEnv` 的适配器才有
|
|
@@ -281,7 +281,7 @@ export declare const LEADER_PUSH_LOCAL_TIMEOUT_MS = 30000;
|
|
|
281
281
|
* plan→provision→fan-out→merge 管线单测(那条管线需要真 brain + E2B/k8s env)。行为与抽出前逐字相同,
|
|
282
282
|
* 唯一新增是六条 execFileSync 各自的 `timeout`。
|
|
283
283
|
*
|
|
284
|
-
* 7.103.0(
|
|
284
|
+
* 7.103.0([ref] 残余):六条 git 子进程的 env 一律 = `gitSubprocessEnv({ isolateConfig: false })` + `LC_ALL=C`(修前:
|
|
285
285
|
* `{ ...process.env, LC_ALL: "C" }`,两条 `git config` 连 env 都不交 ⇒ 整份服务 env 进 git 与它拉起的 helper / hook)。
|
|
286
286
|
* **不隔离宿主 git 配置**(读后定):写凭据是控制面宿主的(「Coordinator's creds」,`durableRemote` 由受信调用方给出,
|
|
287
287
|
* 代码里从不带凭据),而宿主侧能供凭据的形 —— 全局配置里的 credential helper(自带存储)/ `url.<…>.insteadOf` 改写 /
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export declare function redactListEntry(entry: string): string;
|
|
6
6
|
/**
|
|
7
7
|
* **人读句里条目的唯一写法** —— 本仓把规则条目 / 工具名原串写进任何一句给人读的话(拒句、起服拒启行)一律调这一只:引擎的条目写者
|
|
8
|
-
* `renderListEntry`(core 7.46.0
|
|
8
|
+
* `renderListEntry`(core 7.46.0 [ref] 包根导出:JSON 串形带引号,看不见 / 印成空白的字符写成 `\uXXXX`,超长截断)—— 与引擎自己的通告句同一个渲染;
|
|
9
9
|
* 判定拿原串。
|
|
10
10
|
* 🔴 凭据先认、再渲染:渲染把看不见的字符写成 ASCII 转义,之后的脱敏器就认不出夹着零宽字符的凭据 ⇒ 原串上认出凭据时渲染它的脱敏值;
|
|
11
11
|
* 没有凭据的条目渲染**原串**(格式字符留给渲染器写成 `\uXXXX` —— 人要看得见它,不能先被脱敏器剥掉)。
|
package/dist/lsp-evict.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* doesn't retain one heavy language server (jdtls = a whole JVM) per (task × language) until process shutdown.
|
|
7
7
|
* `evict` is best-effort + idempotent + fire-and-forget so it NEVER blocks or breaks teardown; the server dies async
|
|
8
8
|
* while the dir is rm'd (rooted there, it just sees ENOENT). Only the ephemeral lane is wrapped by the caller — the
|
|
9
|
-
*
|
|
9
|
+
* caller-cwd (deployment-shape row `callerCwd`) persistent-project path keeps its warm server (stable root, reused across turns = CC-parity, no leak).
|
|
10
10
|
*
|
|
11
11
|
* Structural param types (no `ExecutionEnv`/`NodeLspManager` import): a non-evicting manager (e2b/k8s bridge) or an
|
|
12
12
|
* env without a string `cwd` / callable `destroy` is returned UNWRAPPED (probe-guarded), so this is a safe no-op
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 受理 = 字符串才收;互斥 = 同设即拒;投影 = 铸 spec 时不投(见下)。
|
|
10
10
|
* 同一条规则、两处执行者(契约包解析期 / 请求面受理期);判据 {@link mcpIdentityHeadersIssue} 与互斥拒句
|
|
11
11
|
* {@link describeMcpIdentityHeadersConflict} 对契约包的原判官**逐字**对齐 —— 不是靠这句注释,而是
|
|
12
|
-
* `test/task-mcp.test.ts` 的
|
|
12
|
+
* `test/task-mcp.test.ts` 的 [ref] 组把两边对拍(格子差分 + 拒句逐字相等),契约包改一个字那一组当场红。
|
|
13
13
|
*
|
|
14
14
|
* ## 后果按腿分(判据同一只,后果不同 —— 本仓成文的 `opts.leg` 姿势)
|
|
15
15
|
* · **fresh 提交腿**:判出问题 ⇒ 同步 400(同设 `request.body_shape`;值不是字符串 `request.field_invalid`)。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EngineNotice, EngineNoticeCode } from "@sema-agent/core";
|
|
2
|
-
/** 码常量型 = core 码册(
|
|
2
|
+
/** 码常量型 = core 码册([ref] 入册:受众 operator、铸者 `NOTICE_MINTER` = `"server"`;不上会话流,只落转发体的运维日志)。 */
|
|
3
3
|
export declare const MEMORY_LAYER_LOCKED_LEGACY: EngineNoticeCode;
|
|
4
4
|
/** 探测读数:锁住的层名(排序)+ 看不全的目录条数。挂载面不存在(新数据根)⇒ 两者皆空。 */
|
|
5
5
|
export interface LockedLegacyLayerProbe {
|
|
@@ -233,7 +233,7 @@ export interface SessionMemoryStatusFace {
|
|
|
233
233
|
*
|
|
234
234
|
* `captureRecordStore` = [ref]② 的 SQL 载体(main.ts 单实例,与 Runner/其余引擎同源 —— 全站同批注入律,
|
|
235
235
|
* 机器钉 capture-optout-lane ②):`captureOptedOut` / `optOutSource` 两键经它读,多副本部署上答的才是
|
|
236
|
-
* 跨副本的真记录。
|
|
236
|
+
* 跨副本的真记录。[ref] 起 local 车道在引擎接线时也供(core 文件三腿,同一只控制面,单机字节不变);缺席 ⇒ 记忆面暗。
|
|
237
237
|
*
|
|
238
238
|
* 面**不抛**(core 契约:sessionMemoryStatus never throws —— 每个事实源各自 catch 折缺席键);
|
|
239
239
|
* 不接 onIncident:这条只读路径上今天零 sink 站点,而且缺席键本身就是它的披露形。
|
package/dist/memory-posture.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { DEPLOYMENT_SHAPE_PREDICATES } from "./deployment-shape.js";
|
|
1
2
|
export function buildMemoryPosture(facts) {
|
|
2
3
|
const { config, engineWired, vectorMode, remoteLaneDark } = facts;
|
|
3
4
|
const embedder = config.memoryEmbedder;
|
|
5
|
+
const multiTenant = DEPLOYMENT_SHAPE_PREDICATES.multiTenant.holds(config);
|
|
4
6
|
const darkReason = engineWired
|
|
5
7
|
? null
|
|
6
8
|
: !config.memoryEngineEnabled
|
|
7
9
|
? "engine_off"
|
|
8
|
-
: config.memoryEngineBackend === "file" &&
|
|
10
|
+
: config.memoryEngineBackend === "file" && multiTenant
|
|
9
11
|
? "multi_tenant_file_backend"
|
|
10
12
|
: remoteLaneDark
|
|
11
13
|
? "remote_lane_split"
|
|
@@ -16,7 +18,7 @@ export function buildMemoryPosture(facts) {
|
|
|
16
18
|
backend: config.memoryEngineBackend,
|
|
17
19
|
vectorMode: vectorMode ?? null,
|
|
18
20
|
darkReason,
|
|
19
|
-
multiTenant
|
|
21
|
+
multiTenant,
|
|
20
22
|
embedder: embedder !== undefined ? { model: embedder.model, dimensions: embedder.dimensions } : null,
|
|
21
23
|
delegationEvidence: config.memoryDelegationEvidence ?? null,
|
|
22
24
|
provenance: config.memoryProvenance ?? null,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref]([ref] 片二)—— 一个任务的**项目层准备一步**:求键 → 把同一 checkout 的旧层折进当前层 → 交给同步腿跟踪。
|
|
3
3
|
* HTTP 腿(`boot/resolve-spec.ts`)与 run-local 腿共用这一只;键的规则只在 `memory-scope.ts` `memoryProjectLayerFor`(本模块不判让位、不铸键)。
|
|
4
4
|
*
|
|
5
5
|
* ## 折叠(`foldFrom`,由 `project-identity.ts` `projectLayerForTaskRoot` 给出,按序)
|
package/dist/memory-scope.d.ts
CHANGED
|
@@ -13,12 +13,12 @@ export declare const V2_SCOPE_PREFIXES: readonly string[];
|
|
|
13
13
|
* 校验点 fail-loud。
|
|
14
14
|
*/
|
|
15
15
|
export declare function isV2ScopeKey(key: string): boolean;
|
|
16
|
-
/** Resolve the memory scope for a request —— {@link memoryScopeFor} 的三形(按实现逐臂写;
|
|
16
|
+
/** Resolve the memory scope for a request —— {@link memoryScopeFor} 的三形(按实现逐臂写;[ref] 合并前主会话点名:
|
|
17
17
|
* 旧版这里写「多租户恒 `undefined` ⇒ 记忆暗」,与下面 DB 后端那一臂正好相反,test [ref] 就是被这句带偏的)。
|
|
18
18
|
*
|
|
19
19
|
* ① SINGLE-USER(`requirePrincipal !== true`):返回**全局层** `config.memoryScope`(缺省 "local";显式
|
|
20
20
|
* `MEMORY_SCOPE` 就是它),与调用方自报的 principal 标签无关(单用户 worker 的 `anon:*` / 临时 principal
|
|
21
|
-
* 是面上的标签,不是隔离身份 —— 按它们键控会把一个用户的记忆拆散到各个面)。🔴
|
|
21
|
+
* 是面上的标签,不是隔离身份 —— 按它们键控会把一个用户的记忆拆散到各个面)。🔴 [ref]([ref] ①)起它只是
|
|
22
22
|
* **读列表的第二层**,不是写家:写家是该任务的**项目层**,由 {@link memoryProjectKeyFor} 按任务根派生、经
|
|
23
23
|
* {@link memorySpecForRequest} 的 `projectKey` 位铸进 spec(读 = [项目, 本 scope],`writeScope` 显式 = 项目)。
|
|
24
24
|
* 本函数在授权期调(还不知道任务根),所以项目层不在这里。
|
|
@@ -26,7 +26,7 @@ export declare function isV2ScopeKey(key: string): boolean;
|
|
|
26
26
|
* principal 铸 v2 typed 键 —— 无 projectId ⇒ `user:<tenant>`(core `formatUserScope`),有形状合法的
|
|
27
27
|
* projectId ⇒ `proj:<tenant>/<projectId>`(core `formatProjScope`);principal 缺席(匿名 run)⇒ `undefined`
|
|
28
28
|
* (无记忆)。scope 列是租户分区,授权就是「验过的 principal 进、一个租户的 scope 出」这一绑定;身份永远不来自
|
|
29
|
-
* body(projectId 只挑盘)。本形**不**按项目根键控(同一租户跨项目共用 `user:` 层是另一件事,
|
|
29
|
+
* body(projectId 只挑盘)。本形**不**按项目根键控(同一租户跨项目共用 `user:` 层是另一件事,[ref],待设计与裁定)。
|
|
30
30
|
* ③ MULTI-TENANT + file 后端:`undefined` ⇒ 没有 `spec.memory` ⇒ 记忆**暗**,fail-closed —— file 引擎底座是一棵共享
|
|
31
31
|
* 目录树、没有租户隔离,在它上面给租户按 principal 发 scope 就是跨租户串盘面。 */
|
|
32
32
|
/** R5(批γ):memory scope 列宽(两方言 VARCHAR(190) 同宽)。principal 上限 190 **字符**在
|
|
@@ -38,26 +38,26 @@ export declare function isV2ScopeKey(key: string): boolean;
|
|
|
38
38
|
export { MEMORY_SCOPE_COLUMN_CHARS, assertMemoryScopeWidth } from "./plugins/memory-key-guards.js";
|
|
39
39
|
export declare function memoryScopeFor(config: ServiceConfig, principal?: string, projectId?: string): string | undefined;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* [ref] / [ref] ① —— 这一请求的**项目身份声明**(`TaskSpec.memory.projectKey`)的唯一属主。
|
|
42
42
|
*
|
|
43
43
|
* **一条规则,与车道无关**(主会话 09-23 裁 ②):项目根 = spec 解析出的**真任务根**(`boot/resolve-spec.ts`
|
|
44
|
-
* 的 `realTaskRootOf`,
|
|
44
|
+
* 的 `realTaskRootOf`,[ref] 属主;run-local 腿 = 它的 `workspaceDir`)。本进程读得到这个根 ⇒ 求项目身份并铸项目层键
|
|
45
45
|
* (in-process 车道的真任务根是 `process.cwd()`,读得到,所以照常铸 —— 它的语义就是「项目 = 任务根指向的地方」,不需要另一个词);
|
|
46
46
|
* 读不到(根在沙箱/设备盘上,或 host 车道会话没登记 cwd、spec 期还不知道根)⇒ 调用方传 `undefined` ⇒ `{ absent: "unreadable" }`,
|
|
47
47
|
* core 铸 operator 通知 `memory.project_scope_absent`,写照常落全局层 —— **响亮**,不是静默落 `local`。
|
|
48
48
|
*
|
|
49
|
-
* 🔴
|
|
49
|
+
* 🔴 [ref] 键形:项目层 = **全局层的属主 × 项目身份**,`userrepo:<属主段>/<档>.<摘要>`(文法 `project-layer-key.ts`,身份 `project-identity.ts`);
|
|
50
50
|
* 属主 = `projectLayerOwnerOf(scope)`。
|
|
51
51
|
*
|
|
52
52
|
* 🔴 **写家只落复制路径覆盖得到的层**(7.98.0 合并复审 F1,主会话裁「统一规则,不做特判」):写家 = 读列表里、本部署
|
|
53
53
|
* **每一条已配置的复制路径都覆盖到**的最具体的一层。项目层不在覆盖面里 ⇒ 本任务**不按项目键控**,写家落全局层 —— 否则开了
|
|
54
54
|
* `MEMORY_SYNC_*` 的部署会把新记忆写进一个同步腿从不碰的层(静默不同步)。覆盖面只经 {@link memoryReplicationCoverage} 求(调用点零
|
|
55
|
-
* `if (memorySync)`);
|
|
55
|
+
* `if (memorySync)`);[ref] 改的只是覆盖面的**来源**(一条复制路径复制它那一层与同属主的全部项目层),本规则一字不动。让位由启动通知
|
|
56
56
|
* `memory_project_scope_yields_to_sync` 说出来(`config.ts` 记忆域,读同一只覆盖面与 {@link replicatesProjectLayersOf})。
|
|
57
57
|
* 缺席声明(`{ absent }`)不受覆盖面影响:它本来就写全局层,通知说的是「为什么没有项目层」。
|
|
58
58
|
*
|
|
59
59
|
* 返回 `undefined` 只有三形,都不是「忘了」:
|
|
60
|
-
* · 多租户(`requirePrincipal`)—— 项目层键控在多租户上另立(
|
|
60
|
+
* · 多租户(`requirePrincipal`)—— 项目层键控在多租户上另立([ref] §3;principal 形 `user:`/`proj:` 不变);
|
|
61
61
|
* · 记忆面暗(`scope` 缺席)—— 没有 spec 可铸,也就不读盘;
|
|
62
62
|
* · 本任务的项目层不在复制覆盖面里(见上)—— 让位给全局层。
|
|
63
63
|
*/
|
|
@@ -66,7 +66,7 @@ export declare function memoryProjectKeyFor(config: Pick<ServiceConfig, "require
|
|
|
66
66
|
export declare function memoryProjectLayerFor(config: Pick<ServiceConfig, "requirePrincipal" | "memorySync">, scope: string | undefined, taskRoot: string | undefined): ProjectLayerOfTask | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* 本部署记忆的**复制覆盖面** —— 唯一属主(7.98.0 合并复审 F1)。「复制路径」= 把某一层记忆搬出本机的腿;今天只有一条:
|
|
69
|
-
* TOC 同步客户端腿(`MEMORY_SYNC_*`,`memory-sync-client.ts`)。🔴
|
|
69
|
+
* TOC 同步客户端腿(`MEMORY_SYNC_*`,`memory-sync-client.ts`)。🔴 [ref]:一条复制路径复制**它那一层**(`config.memorySync.scope`)
|
|
70
70
|
* **以及同一属主的全部项目层**(`userrepo:<属主>/…`,属主 = `projectLayerOwnerOf(那一层)`)—— 同步腿按同一判据选层
|
|
71
71
|
* (`memory-sync-client.ts` 读 {@link replicationCovers})。没有复制路径 ⇒ `unreplicated`(没有哪一层会被复制落下)。
|
|
72
72
|
*/
|
|
@@ -93,7 +93,7 @@ export declare function replicatesProjectLayersOf(coverage: MemoryReplicationCov
|
|
|
93
93
|
* Pure posture probe (memoryEngineBackendFor consumes it; main.ts logs it): `undefined` = no plane split
|
|
94
94
|
* (the lane's file plane IS this worker's fs — `in-process` / `host`), `dark` = split + fail-closed, `forced` =
|
|
95
95
|
* split + operator override.
|
|
96
|
-
*
|
|
96
|
+
* [ref]: the plane question reads the lane-caps table (`hostFilePlane`) — it used to be the hand-written synonym
|
|
97
97
|
* `lane === undefined || lane === "host"` (fold-ban gate D, R3); readings are unchanged lane by lane.
|
|
98
98
|
*/
|
|
99
99
|
export declare function memoryEngineRemoteLanePosture(config: ServiceConfig): {
|
|
@@ -139,7 +139,7 @@ engineWired: boolean): {
|
|
|
139
139
|
* core derives the B3 control plane beside it).
|
|
140
140
|
*/
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
142
|
+
* [ref](7.59.0 合并重扫 wf_5ac18676 #1)—— **引擎数据根的唯一推导点**。模型是用 fs 工具往这里写记忆的
|
|
143
143
|
* ([ref] 记忆边界不变式,boot/memory-boundary.ts),所以两件事必须读**同一只**值:①boot 起哪只记忆后端的根
|
|
144
144
|
* (boot/stores.ts 三腿)、②`RunnerDeps.memoryEngineDir` —— core 7.49.0 [ref] 起它也是守卫集的**唯一**豁免根(落在这个根**里面**的
|
|
145
145
|
* 目标按相对根判,根自己的祖先段不算目标的账;此前守卫集另收一份 `dataRoot`,那是第三个读者,已随 core 退役)。
|
|
@@ -165,7 +165,7 @@ export interface FileMemoryPlane {
|
|
|
165
165
|
readonly controlDir: string;
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
|
-
*
|
|
168
|
+
* [ref]([ref])—— **file 记忆引擎平面的单铸点**,兼这条腿的**接线门**。
|
|
169
169
|
*
|
|
170
170
|
* 为什么是一只函数而不是两处各自推导:平面坐标有**两个**消费者 —— ① {@link memoryEngineBackendFor}
|
|
171
171
|
* 钉给 `FileMemoryEngineBackend` 的 `memoryDir` + `controlDir`;② local 车道的 capture opt-out **记录店**
|
|
@@ -223,7 +223,7 @@ onIncident?: (err: Error & {
|
|
|
223
223
|
root: string;
|
|
224
224
|
} | undefined;
|
|
225
225
|
/**
|
|
226
|
-
* core 7.49.0
|
|
226
|
+
* core 7.49.0 [ref] —— **记忆店根搬动 ⇒ 拒启**(不降级)。店根的物理路径是控制面里的一条记录(`root-anchor.json`),每次打开都比对;
|
|
227
227
|
* 目录被搬走 / 换成指向别处的链接之后,File 后端的**构造器**就抛 `memory.target_outside_store`(`detail` 恰在这一形上带
|
|
228
228
|
* `{ path, controlDir, recorded, now }`)。本函数是本仓构造 File 后端的唯一一处(boot 与 run-local 两个入口都经它),构造在 boot 的 `try`
|
|
229
229
|
* 之外 ⇒ 拒启。不降级成「记忆暗」的理由:降级会让这台部署在运维不知道的情况下丢掉全部记忆(而店还在,只是搬了家);拒启把那一刻交给人。
|
|
@@ -242,14 +242,14 @@ export declare function memoryStoreRootMovedRefusal(e: unknown): (Error & {
|
|
|
242
242
|
* (memory feature off for this run). Pure (testable in isolation) — main.ts's resolveSpec composes it with the
|
|
243
243
|
* engine-backend presence guard.
|
|
244
244
|
*
|
|
245
|
-
* 🔴 **三轴正交**(
|
|
245
|
+
* 🔴 **三轴正交**([ref] 起;三者可任意并存,互不吞):`memoryWrite:false` = 本 run 只读平面(挂、读、
|
|
246
246
|
* harvest 不提交)· `memoryCapture:"off"` = 采集面关(挂、读、本会话内容永不进长期记忆)· `memory:"off"` =
|
|
247
247
|
* **整面关**(`enabled:false`,这一次连记忆面都不挂)。后两者从 `declarations` 进(键名与 wire 逐字同名)。
|
|
248
248
|
*/
|
|
249
249
|
export declare function memorySpecForRequest(scope: string | undefined,
|
|
250
|
-
/**
|
|
250
|
+
/** [ref] / [ref] ①:本请求的项目身份声明({@link memoryProjectKeyFor} 的产物)。**必填位**(不是可选参数):
|
|
251
251
|
* 每个铸点都得写出一个值 —— `undefined` 只合法地表示「本任务不按项目键控」(多租户 / 记忆暗 / 项目层不在复制覆盖面里)。
|
|
252
|
-
* · `{ scope: projectKey }`(
|
|
252
|
+
* · `{ scope: projectKey }`([ref] 起 `userrepo:…`)⇒ 读 = `[projectKey, scope, ...extras]`、`writeScope` **显式** = 项目层(core 缺省取末层
|
|
253
253
|
* = 全局层,不钉就是 M-03 本身;core 另有 `config.memory_write_scope_mismatch` 兜这一向);
|
|
254
254
|
* · `{ absent }` ⇒ 读 = `[scope, ...extras]`、`writeScope` 显式 = `scope`(全局层),core 铸 `memory.project_scope_absent`;
|
|
255
255
|
* · 两形都把声明原样落 `TaskSpec.memory.projectKey`(core 的生效面回显它)。 */
|
|
@@ -267,7 +267,7 @@ originPolicy?: {
|
|
|
267
267
|
*
|
|
268
268
|
* · `memoryCapture:"off"`([ref] §2.1,[ref])⇒ `TaskSpec.memory.capture:"off"`:**采集面**关 ——
|
|
269
269
|
* 记忆照常挂、照常读,但本会话的内容永远不进长期记忆(core 落一条单向会话记录,按部署姿态 + verdict 裁)。
|
|
270
|
-
* · `memory:"off"`(core [ref] r5 §5 W3,
|
|
270
|
+
* · `memory:"off"`(core [ref] r5 §5 W3,[ref])⇒ `TaskSpec.memory.enabled:false`:**整面**关 ——
|
|
271
271
|
* 这一次运行不挂记忆面。**保留事实不折缺席**(codex r2 #4):core 的终局观测面把「有 spec 但被关」读作
|
|
272
272
|
* `reason:"disabled"`、把「整键缺席」读作 `reason:"no-spec"`,审计上不是一件事;而 `normalizeMemorySpec`
|
|
273
273
|
* 在 scopes 为空时整体返回 `undefined`,所以**关的那一形也必须带正常 scopes**。
|
|
@@ -292,11 +292,11 @@ declarations?: {
|
|
|
292
292
|
} | undefined;
|
|
293
293
|
/**
|
|
294
294
|
* 「这一腿挂不挂记忆面」的**唯一属主**(合并复审 车HF F1,2026-09-18):与 core `prepareMemory` 的判据同源 ——
|
|
295
|
-
* `normalizeMemorySpec(spec)?.enabled === true`。
|
|
295
|
+
* `normalizeMemorySpec(spec)?.enabled === true`。[ref] 之后 `memory:"off"` 铸的是「键在场 + `enabled:false`」(保留事实),
|
|
296
296
|
* 任何按「键在不在场」判挂没挂的读者从那一天起都读错(改前本仓的记忆披露判别式正是那样,把无记忆面的披露一起吞掉;那只判别式已随引擎接管披露退役)。
|
|
297
297
|
* 消费方拿本函数的布尔,不拿 `spec.memory` 自己判。
|
|
298
298
|
*
|
|
299
|
-
* ⚠️ **本函数会抛,而「抛」本身就是一条判据**(
|
|
299
|
+
* ⚠️ **本函数会抛,而「抛」本身就是一条判据**([ref] 补注)。`normalizeMemorySpec` 对两形直接 throw
|
|
300
300
|
* (亲核安装态 core 7.22.0 `dist/core/memory.js` 的 `normalizeMemorySpec`):
|
|
301
301
|
* · 单数 `scope` 键在场 ⇒ `code:"config.memory_scope_spelling"`(core 已删的旧拼写;它的报错原话
|
|
302
302
|
* 是「Refusing to start with memory silently off」—— 静默关闭正是那次 HIGH 的伤害面);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* **店形拒**(store-form refusal)在本仓的唯一读法属主(纯叶:零 http / 零 boot 依赖)—— core 一只铸点(`layout.ts` `storeFormRefusal`)的**两码一族**:
|
|
3
|
-
* · `memory.target_outside_store`(core 7.31.1
|
|
3
|
+
* · `memory.target_outside_store`(core 7.31.1 [ref]):记忆 store 里的一个目录经软链通到了 store **外**(或 store 根在 backend 打开 / 引擎首次
|
|
4
4
|
* 挂载之后被改指)⇒ 引擎对落点在外的删 / 写 / 重放 / 自身写一律**不做**;
|
|
5
|
-
* · `memory.scope_home_not_directory`(core 7.44.0
|
|
5
|
+
* · `memory.scope_home_not_directory`(core 7.44.0 [ref]):一只 scope home(`<memoryDir>/<label>`)不是真目录 —— 被换成软链 / 普通文件 / 特殊文件
|
|
6
6
|
* (`detail.form` ∈ `symlink` | `file` | `other`,`lstat` 判、不跟链)。修前 core 对这一形抛不带码的 `ControlPlaneCorruptError`(与真控制面损坏同类同形),
|
|
7
7
|
* 平铺布局(条目直接住在 home 里)于是答 500,而同一换法在嵌套布局下一层答 409 —— 现在两布局同答这一码。
|
|
8
8
|
* 两码的形相同:普通 `Error` + `.code` + `.detail`(`{ path }`;home 那一码多 `form`),**句子以码领头、不含任何宿主路径**(core 7.44.0 起,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* ## 两条到达车道,两个读者(本模块各给一只,别处不许再写第二份判据)
|
|
13
13
|
* ① **抛出面**(抹除 / 出处 / 外源列表 / 清标 / bundle 导出导入 —— 凡触 store 树的 backend 面):`.code` 就是码
|
|
14
14
|
* ⇒ {@link storeFormRefusalOf}。HTTP 映射在 `http/memory-store-refusal-reply.ts`(409,operator 面一处字面量)与
|
|
15
|
-
* `http/memory-compliance-failure-reply.ts`(合规面两受众的那一只;会话所有者受众换固定句,
|
|
15
|
+
* `http/memory-compliance-failure-reply.ts`(合规面两受众的那一只;会话所有者受众换固定句,[ref])。
|
|
16
16
|
* ② **报告面**(harvest `incident`):core 契约写明 report 车道上码**只在文本里** —— `sidecar_corrupt` 的 detail 恰两种形
|
|
17
17
|
* `memory commit refused: <码>: …` / `memory control plane refused: <码>: …`(core `docs/wire-consumption/7.31.1.md` 的 harvest 行逐字;
|
|
18
18
|
* 7.44.0 安装树 `engine.js` 两处 incident 铸点同形,home 那一码经同一只 `writeFailureText` 到这里)⇒ {@link storeFormRefusalInIncident} 只认**这两个 lead 紧跟码**
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* ## 不是这一族的三形(core 同表「different surface」,本仓**不**自拼码,如实走各自既有臂)
|
|
27
27
|
* · journal 重放目标目录成链 ⇒ `ControlPlaneCorruptError`(无 `.code`,KL-1094-b)⇒ 路由 typed 500 `internal.memory_control_plane_corrupt`
|
|
28
28
|
* (core 7.44.0 起 scope home 非目录**不再**走这一类 —— 它有了自己的码,见上;`ControlPlaneCorruptError` 只剩真控制面损坏);
|
|
29
|
-
* · 引擎原地写撞硬链(nlink>1)⇒ 文本 `has N names (a hard link)`、无码(KL-1094-g /
|
|
29
|
+
* · 引擎原地写撞硬链(nlink>1)⇒ 文本 `has N names (a hard link)`、无码(KL-1094-g / [ref])⇒ 走该写点既有的失败车道(harvest
|
|
30
30
|
* warnings / 挂载失败),抛出面够不着;
|
|
31
31
|
* · 解析故障(`EACCES` / `ELOOP` / `ENOTDIR`)⇒ 以 errno 本身抛 ⇒ 路由未分类 500 + 运维 warn(`String(err)` 带 core 补救句)。
|
|
32
32
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 白名单 = 名字 → 读它的线路(闭集;**加一个名字 = 加一行并写明哪条线路读它、为什么是部署的事**)。
|
|
3
3
|
* `anthropic-beta`:Anthropic Messages 的 beta 开关(逗号分隔的 beta 名;core anthropic 腿会把自己的 beta 并进同一个头)。
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* [ref]:本表与 {@link CATALOG_ENTRY_HEADER_NAMES} / {@link CatalogEntryHeaderName} 从包根 `src/index.ts` 原对象导出(web-admin 目录编辑页构建期取白名单,
|
|
6
6
|
* 不手抄;`RETIRED_ENVS` 同族)—— 它是**本进程准入判据的活表**,所以三只(表 / 每行线路数组 / 名字数组)在这里一次冻结:导出面上的嵌入方改不了它。
|
|
7
7
|
*/
|
|
8
8
|
export declare const CATALOG_ENTRY_HEADER_LANES: Readonly<{
|
|
@@ -35,7 +35,7 @@ export type CatalogEntryHeadersVerdict = {
|
|
|
35
35
|
export declare function readCatalogEntryHeaders(raw: unknown, api: unknown): CatalogEntryHeadersVerdict;
|
|
36
36
|
/**
|
|
37
37
|
* **唯一铸点**(`toModel` 调):判过的袋 → `Model.headers` 的键。缺席 ⇒ 不铸键(一个 `undefined` 值的键也不铸:
|
|
38
|
-
* 缺席只有一种拼法)。判不过 ⇒ **抛**:到这里的条目已经过
|
|
38
|
+
* 缺席只有一种拼法)。判不过 ⇒ **抛**:到这里的条目已经过 [ref] 逐条判据(判不过的进 `modelRefusals`、到不了 `toModel`),
|
|
39
39
|
* 抛 = 两处判据分叉了,stage 整候选拒、响亮,不静默丢头。
|
|
40
40
|
*/
|
|
41
41
|
export declare function buildModelHeadersKey(entryName: string, raw: unknown, api: unknown): {
|
|
@@ -2,7 +2,7 @@ import { type ModelEntryRefusalCode, type ModelPlaneRefusalCode, type ModelRefus
|
|
|
2
2
|
import { type DroppedCatalogEntry } from "./web-admin-client/read-warnings.js";
|
|
3
3
|
import { type ModelTableLeg } from "./model-select.js";
|
|
4
4
|
/**
|
|
5
|
-
* 条目拒因码 → 本仓铸它的成因 —— **以码为键**(
|
|
5
|
+
* 条目拒因码 → 本仓铸它的成因 —— **以码为键**([ref]):码闭集的属主是 settings-schema(`MODEL_ENTRY_REFUSAL_CODES`,6.2.0 起;此前本仓
|
|
6
6
|
* 自持一份同名码表,撞名已消灭、零别名)。那边加一个条目码 ⇒ 本表缺键 ⇒ 本仓 tsc 红(只拿 `satisfies` 约束码值证明的是「子集」,
|
|
7
7
|
* 不是「相等」;以码为键才证相等)。成因闭集由本表派生,{@link refusalEventOf} 对它穷举 —— 加成因同样编译红。
|
|
8
8
|
* 码的拼法随 `config.*` 家族,按**规则**命名:出现在拒因句的方括号里、warn 字段里、`modelRefusals` 里。
|
|
@@ -13,9 +13,9 @@ export declare const ENTRY_REFUSAL_REASON_OF: {
|
|
|
13
13
|
};
|
|
14
14
|
/** 不可用的成因 —— **闭集**,由 {@link ENTRY_REFUSAL_REASON_OF} 派生。 */
|
|
15
15
|
export type ModelEntryRefusalReason = (typeof ENTRY_REFUSAL_REASON_OF)[ModelEntryRefusalCode];
|
|
16
|
-
/** 「这张表没有缺省模型」的机读码(
|
|
16
|
+
/** 「这张表没有缺省模型」的机读码([ref];boot 拒启与热路径模型面组拒同一个码;组拒码闭集属主 = settings-schema)。 */
|
|
17
17
|
export declare const DEFAULT_MODEL_MISSING_CODE = "config.default_model_missing";
|
|
18
|
-
/** 🔴
|
|
18
|
+
/** 🔴 [ref]「被拒的名字被档位 / 别名增广铸到了别的条目上(或被丢身份载体形不对、读不出名字,无从证明没有)」的机读码
|
|
19
19
|
* (不变量 `refused-names-not-minted`;热路径 / boot 首次 apply / dry-run 同一个码;组拒码闭集属主 = settings-schema)。 */
|
|
20
20
|
export declare const REFUSED_NAME_MINTED_CODE = "config.model_refused_name_minted";
|
|
21
21
|
/**
|
|
@@ -45,14 +45,14 @@ export interface CatalogEntryLike {
|
|
|
45
45
|
readonly name: string;
|
|
46
46
|
readonly id: string;
|
|
47
47
|
readonly provider: string;
|
|
48
|
-
/**
|
|
48
|
+
/** [ref]:线路词(`headers` 的线路判据读它;原值,不信这张型)。 */
|
|
49
49
|
readonly api?: unknown;
|
|
50
|
-
/**
|
|
50
|
+
/** [ref]:供应商附加头的承载形(`unknown`:判据在 `model-entry-headers.ts`,不信这张型)。 */
|
|
51
51
|
readonly headers?: unknown;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* **逐条判据**:`undefined` = 本部署能完整服务它。判序即语义:先形(不合形的条目谈不上走哪条腿),再腿。
|
|
55
|
-
* 形分两段、同一个码(`config.model_entry_invalid`):settings-schema 的 `ModelEntry`,再是
|
|
55
|
+
* 形分两段、同一个码(`config.model_entry_invalid`):settings-schema 的 `ModelEntry`,再是 [ref] 的 `headers`(白名单 + 线路 + 值形,
|
|
56
56
|
* 判据单属主 `model-entry-headers.ts`;settings-schema 6.3.0 的 `ModelEntry` 还没有这个键 —— 候裁加字段,届时词表不另抄)。
|
|
57
57
|
*
|
|
58
58
|
* 形判的属主是 settings-schema 的 `ModelEntry`(两条读腿用的就是它)—— 本仓不手抄任何一条字段规则;这里只是
|
|
@@ -63,23 +63,23 @@ export declare function judgeCatalogEntry(m: CatalogEntryLike, ctx: CatalogEntry
|
|
|
63
63
|
/** 一批已启用条目的判决:可用的(保序)、不可用的(按 catalog name)、被丢目录条目的载体行(形对的,保序),以及形不对的载体行(坐标)。 */
|
|
64
64
|
export interface CatalogEntriesVerdict<M extends CatalogEntryLike> {
|
|
65
65
|
readonly usable: readonly M[];
|
|
66
|
-
/** 键 = catalog name(**每一个**名,含秘密形 / 空串 / `__proto__`:引擎自己的判决保持完整 ——
|
|
66
|
+
/** 键 = catalog name(**每一个**名,含秘密形 / 空串 / `__proto__`:引擎自己的判决保持完整 —— [ref] 不变量与选择面的「让出」都读它;
|
|
67
67
|
* 名筛只在出口,见 {@link buildModelRefusalsSignal})。键以自有数据属性写入(`__proto__` 不走原型 setter)。 */
|
|
68
68
|
readonly refused: Readonly<Record<string, ModelEntryRefusal>>;
|
|
69
|
-
/**
|
|
69
|
+
/** [ref]:被丢目录条目**载体形不对**的行坐标(`models.3`;读不出下标时是 `(unknown coordinate)`;载体不是列表时是一个固定标记)。读腿铸的每一行
|
|
70
70
|
* 都合 `read-warnings.ts` {@link DroppedCatalogEntryRow} 的形,所以这一形只来自绕过读腿的输入被改过(盘上 LKG 被手改 / 手写 effective)。
|
|
71
71
|
* 非空 ⇒ 改过的行原本代表谁说不清,无从证明它的名字不被增广铸出 ⇒ 不变量 `refused-names-not-minted` 不成立 ⇒ 模型面组拒(fail-closed)。 */
|
|
72
72
|
readonly malformed: readonly string[];
|
|
73
|
-
/**
|
|
73
|
+
/** [ref]:载体里形对的行(保序)—— 模型面 stage 把它与 `models` 同 commit 进 `config.droppedCatalogEntries`(`GET /v1/models.droppedEntries`
|
|
74
74
|
* 的源):载体只在这里被判形、被读一次,墓碑与 wire 读的是同一批行。 */
|
|
75
75
|
readonly dropped: readonly DroppedCatalogEntry[];
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* 批量形(模型面 stage 与 dry-run 共用这一只 —— 报数与真 apply 永不撕裂)。
|
|
79
|
-
*
|
|
79
|
+
* [ref]:`dropped` = 读腿交出的被丢目录条目载体(`EffectiveConfig.models.droppedCatalogEntries`,每一条被丢的目录条目一行)。入参按 `unknown`
|
|
80
80
|
* 判形:载体可能来自盘上 LKG(本仓写的,但文件可被改)。载体要么缺席,要么是一列合 {@link DroppedCatalogEntryRow} 形的行;其余一律「载体形不对」
|
|
81
81
|
* 进 `malformed`(fail-closed)—— 读腿自己从不铸这种形。
|
|
82
|
-
* **墓碑判据(一条,
|
|
82
|
+
* **墓碑判据(一条,[ref] 原样)**:行的 `identity.name` 在 ∧ `identity.enabled !== false` ⇒ 铸一块墓碑(它与逐条判据判出的 `entry_invalid`
|
|
83
83
|
* 是同一件事 —— 条目不合 `ModelEntry` 形,只是在第一道边界就被丢了;拒因 provider 词空:告警身份不带它)。其余行不是墓碑:
|
|
84
84
|
* · 停用 ⇒ 不在目录(与 7.100.0 同义);
|
|
85
85
|
* · 没有名 —— 原文 `name` 不是字符串,或是字符串但不能原样出门(settings-schema `isDisclosableIdentity` 说不,身份里不带)⇒ **无名可留**,
|
|
@@ -88,7 +88,7 @@ export interface CatalogEntriesVerdict<M extends CatalogEntryLike> {
|
|
|
88
88
|
* 与一条可用 / 已判不可用条目同名时不覆盖(可用条目仍可用;同名撞车由不变量 `refused-names-not-minted` 响亮拒)。
|
|
89
89
|
*/
|
|
90
90
|
export declare function judgeCatalogEntries<M extends CatalogEntryLike>(enabled: readonly M[], ctx: CatalogEntryVerdictCtx, dropped?: unknown): CatalogEntriesVerdict<M>;
|
|
91
|
-
/**
|
|
91
|
+
/** [ref]:一次 apply 对「最新交到手的那份候选目录」的模型拒因判决(纯数据;`ApplyReport.modelRefusals`)。 */
|
|
92
92
|
export interface ModelRefusalVerdict {
|
|
93
93
|
/** 那份候选的逐条判决(键 = catalog name,**完整**,未过名筛 —— 名筛在出口 {@link buildModelRefusalsSignal})。 */
|
|
94
94
|
readonly entries: Readonly<Record<string, ModelEntryRefusal>>;
|
|
@@ -96,11 +96,11 @@ export interface ModelRefusalVerdict {
|
|
|
96
96
|
readonly plane?: ModelPlaneRefusalCode;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* [ref] —— 判决 → `/health.modelRefusals` 与 fleet 心跳 `modelRefusals` 的 wire 形(settings-schema `ModelRefusalsSignal`,纯投影):
|
|
100
100
|
* 名 → 码,**值只码**(拒因事实里的上游 id / provider 词 / 坏字段键 / 出路句都不上 wire —— `entry_invalid` 行是没人验过的行,id / provider
|
|
101
101
|
* 可能就是坏行原样;句子是给本机运维的散文,不是契约)。**名筛在这里、只在这里**:键过 settings-schema `isReportableRefusalName`(唯一判据,
|
|
102
102
|
* import 不复制;6.3.0 起 = 标识符白名单 ∧ 无密钥形 ∧ 无 URL userinfo)—— 秘密形 / 空串 / `__proto__` / 不是标识符的串这类出不了门的名不进键、
|
|
103
|
-
* 不计数;引擎内部的判决不受影响;本机日志 / 拒因句里的写名同样先问这一只(
|
|
103
|
+
* 不计数;引擎内部的判决不受影响;本机日志 / 拒因句里的写名同样先问这一只([ref],{@link disclosableRefusalName}:不可披露的名只写码)。
|
|
104
104
|
* 逐条空且无组拒 ⇒ `undefined`(键缺席:「没有」只有一种拼法)。
|
|
105
105
|
*/
|
|
106
106
|
export declare function buildModelRefusalsSignal(v: ModelRefusalVerdict | undefined): ModelRefusalsSignal | undefined;
|
|
@@ -114,7 +114,7 @@ export declare function refusedNameLogField(key: string, name: string): Record<s
|
|
|
114
114
|
export declare function refusedNamesLogFields(key: string, names: readonly string[]): Record<string, unknown>;
|
|
115
115
|
/** 成因 → 它那一条 warn 的事件名(**穷举**)。两个名字是票面点名的既有/新事件,运维的告警规则按名挂。 */
|
|
116
116
|
export declare function refusalEventOf(reason: ModelEntryRefusalReason): "web_admin_model_no_brain" | "web_admin_model_entry_invalid";
|
|
117
|
-
/** warn 字段(不含值):`field` = 第一处坏字段(告警规则最常按它分组),`fields` = 全部。
|
|
117
|
+
/** warn 字段(不含值):`field` = 第一处坏字段(告警规则最常按它分组),`fields` = 全部。[ref]:`model` 只在名可披露时写。 */
|
|
118
118
|
export declare function refusalWarnFields(name: string, r: ModelEntryRefusal): Record<string, unknown>;
|
|
119
119
|
/** 调用方写的模型 ref(`model` / `compactionModel` / `agents[i].model` / `@name`)回到人面前 —— 拒句与留声日志 —— 的字符上限。 */
|
|
120
120
|
export declare const MODEL_REF_ECHO_CHARS = 120;
|
|
@@ -136,7 +136,7 @@ export interface DefaultModelView {
|
|
|
136
136
|
readonly modelRefusals: Readonly<Record<string, ModelEntryRefusal>>;
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
|
-
* 🔴
|
|
139
|
+
* 🔴 [ref] —— **这张模型表有没有一只缺省模型**(`models.default`)。`undefined` = 有。
|
|
140
140
|
*
|
|
141
141
|
* 规则只有一句:**进程服务的那张表必须有 `default`**。env 腿(`MODEL_ID`)与目录腿(缺省解析)是它的两个来源,
|
|
142
142
|
* 任一在场即过;目录一旦生效就整张换掉 env 表,所以判的永远是「生效之后的那张表」—— 这正是它必须在目录应用
|
|
@@ -162,7 +162,7 @@ export interface RefusedNameView {
|
|
|
162
162
|
readonly modelRefusals: Readonly<Record<string, ModelEntryRefusal>>;
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
* 🔴
|
|
165
|
+
* 🔴 [ref] —— 不变量 `refused-names-not-minted` 的判据:**这张表回应的每一个名字(目录键 ∪ core `expandTiers` 增广出来的档位词 /
|
|
166
166
|
* CC 别名 / `best`)都不是一个被拒条目的名字**。返回撞上的那些(空 = 成立)。
|
|
167
167
|
*
|
|
168
168
|
* 为什么是「增广之后」:引擎在构造 / 换装时自己 `expandTiers(models, tiers)`,显式 `model:"sonnet"` 与角色绑定 `advisor→sonnet` 都在
|