@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
|
@@ -265,19 +265,6 @@ export function laneWiresExecutionEnv(lane) {
|
|
|
265
265
|
return false;
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
export function isSingleMachineDefaultLane(remoteExec) {
|
|
269
|
-
return remoteExec?.provider === "host" && remoteExec.singleMachineDefault === true;
|
|
270
|
-
}
|
|
271
|
-
export function laneCapabilityHolds(cap, deployment) {
|
|
272
|
-
switch (cap) {
|
|
273
|
-
case "supported":
|
|
274
|
-
return true;
|
|
275
|
-
case "unsupported":
|
|
276
|
-
return false;
|
|
277
|
-
case "single-user-only":
|
|
278
|
-
return deployment.requirePrincipal !== true;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
268
|
export const PLANNED_LANE_DIVERGENCES = Object.freeze([]);
|
|
282
269
|
export const E2B_SANDBOX_HOME = "/home/user";
|
|
283
270
|
export function executionLaneHomeDir(deployment) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref] → [ref] —— 文件历史的**装配单点**与能力词 `fileHistoryCapture` 的闭集(叶模块:只 type-import store-backend 与 core 型)。
|
|
3
3
|
*
|
|
4
4
|
* ## 病史
|
|
5
|
-
*
|
|
5
|
+
* [ref](7.97.0):`boot/budget-tracing.ts` 只要后端有文件历史店就无条件交给 core(`RunnerDeps.fileHistoryStore`)。core 的首次
|
|
6
6
|
* 触碰捕获当时是**进程级**的:接了店就恒捕获,没有任何单会话 / 单 run 的杠杆。于是用户在客户端关掉「文件检查点」关掉的只是
|
|
7
|
-
* 提示,文件字节照旧进 `file_history_*`。
|
|
7
|
+
* 提示,文件字节照旧进 `file_history_*`。[ref] 给了部署旋钮 `FILE_HISTORY_CAPTURE`,而 core 那时只有一种写法表达「不捕获」——
|
|
8
8
|
* **不接店** ⇒ 旋钮关 = 摘店,代价是已存历史也一起读不了(restore / rewind / 2c sync 一并关)。
|
|
9
|
-
*
|
|
9
|
+
* [ref](7.104.0):core 7.31.0 收了两件 —— 部署的**捕获位** `RunnerDeps.fileHistoryCapture: "off"`(店照接,只停新捕获,
|
|
10
10
|
* 已存历史照常服务 `restoreFiles` / `rewindFilesTo`)与请求级关断词 `TaskSpec.fileHistory: "disabled"`。旋钮改落 core 的同名座:
|
|
11
11
|
* **名字说的是「捕获」,就只关捕获** —— 一条旋钮一个意思。
|
|
12
12
|
*
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
* core 的部署捕获位({@link coreFileHistoryCaptureSeat},`boot/runner-deps.ts`)与能力词(`http/routes/capabilities.ts`)——
|
|
20
20
|
* core 收到的与能力面说的不可能各说各话。捕获位 `"off"` ⟺ 店在 ∧ 旋钮关;**没有店的部署形不下发**该位:core 对
|
|
21
21
|
* 「off 但没店」拒 prepare(`config.invalid_file_history_capture`,「nothing to switch off」),而旋钮的意思「不捕获」在没店的
|
|
22
|
-
* 部署上本来就成立 —— 旋钮照样无条件生效,只是那一形无事可关(选这一臂而不是拒启的理由见 CHANGELOG 7.104.0
|
|
22
|
+
* 部署上本来就成立 —— 旋钮照样无条件生效,只是那一形无事可关(选这一臂而不是拒启的理由见 CHANGELOG 7.104.0 [ref] 条:
|
|
23
23
|
* 拒启会把「形合法、意思成立」的配置判成错,且会与 auto 后端的降级臂耦合)。
|
|
24
24
|
* ⚠️ 关掉 ≠ 删掉:翻旋钮**不**做任何批量删除;已捕获的历史照旧被 restore / rewind / sync 读用,按既有的会话删除 /
|
|
25
25
|
* 留存规则清理。要让已存历史也不可用,部署今天的出路只有逐会话 `DELETE /v1/sessions/:id` 与留存清扫(见 USAGE)。
|
|
26
26
|
*
|
|
27
27
|
* ## 能力词为什么是 `off` / `on-optional` 两词
|
|
28
|
-
* cli 要的是「`/config` 那个开关该不该出现」。三词闭集的设计(
|
|
29
|
-
* 结构上不可达(没有单 run 不捕获位)。
|
|
28
|
+
* cli 要的是「`/config` 那个开关该不该出现」。三词闭集的设计([ref])是 `off` / `on-always` / `on-optional`;[ref] 时第三词
|
|
29
|
+
* 结构上不可达(没有单 run 不捕获位)。[ref] 起请求词 `fileHistory: "disabled"` 受理 ⇒ 捕获中的部署恒可按 run 关掉 ⇒
|
|
30
30
|
* `on-optional` 成真,而 `on-always`(「捕获中且关不掉」)**结构上不可达** —— 预先声明一个到不了的词等于给客户端一个
|
|
31
31
|
* 永远等不到的分支,所以删词不留(7.97.0–7.103.x 的 worker 仍会发它,消费端读法在契约附录 B)。
|
|
32
32
|
*/
|
|
@@ -52,13 +52,13 @@ export interface FileHistoryAssembly {
|
|
|
52
52
|
/** 擦除脸:在场 ⟺ 后端在(与旋钮无关;是 {@link store} 的删除类动词视图)。 */
|
|
53
53
|
readonly erasure: FileHistoryErasureFace | undefined;
|
|
54
54
|
}
|
|
55
|
-
/** 装配:「这台部署有没有文件历史店」的唯一判定。旋钮不在这里 —— 它只关捕获,不摘店(
|
|
55
|
+
/** 装配:「这台部署有没有文件历史店」的唯一判定。旋钮不在这里 —— 它只关捕获,不摘店([ref])。 */
|
|
56
56
|
export declare function assembleFileHistory(backend: StoreBackend | undefined): FileHistoryAssembly;
|
|
57
57
|
/**
|
|
58
58
|
* 「捕不捕」的**唯一**判定(纯函数):能力词。`store` = 装配出来的店(在不在),`knob` = 部署旋钮 `FILE_HISTORY_CAPTURE`
|
|
59
59
|
* (`config.fileHistoryCapture`)。从**装配结果**派生,不照旋钮字面回声:后端本来就没有这只店的部署同样是 `off`。
|
|
60
60
|
*
|
|
61
|
-
* 与 `rewindFiles` 分叉(
|
|
61
|
+
* 与 `rewindFiles` 分叉([ref] 当时写下的分叉条件,自本版成真):本词答「这台部署捕不捕、能不能按 run 关掉」,
|
|
62
62
|
* `rewindFiles` 答「这台部署能不能还原」—— 旋钮关的部署本词 `off` 而 `rewindFiles` 仍为真。
|
|
63
63
|
*/
|
|
64
64
|
export declare function fileHistoryCaptureOf(store: object | undefined, knob: boolean): FileHistoryCapture;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* [ref]④ —— SQL file-history 店的 **typed 永久失败**披露座:散文一个铸点 + 机器面一只 sink。
|
|
3
3
|
*
|
|
4
4
|
* ## 病(基线 v7.79.0 逐行亲核 + 亲跑)
|
|
5
5
|
* `plugins/blob-backend.ts:55` 的 `BlobTooLargeError` 带 typed 判别码 `blob_too_large_for_sql`,头注
|
|
@@ -12,14 +12,19 @@
|
|
|
12
12
|
* 括号词当 metric label —— 而第一个括号词恒是引擎自己的闭集码。实测:「这个文件永远存不进这口店」
|
|
13
13
|
* 与「连接被重置」在 `rewind_snapshot_failed_total` 上**同形** `code="snapshot_failed"`。
|
|
14
14
|
* · **trackEdit(首触备份)腿**:本服务用引擎默认的 `onTrackFailure:"refuse"`(`boot/runner-deps.ts` 亲读),
|
|
15
|
-
* 那条路 **完全不走 onError** ——
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* 那条路 **完全不走 onError** —— 引擎把拒句念给模型。core 7.54.0 及以前那句在 300 字界里被店的 message
|
|
16
|
+
* 截断,模型连「Retry when the file-history store is healthy.」都听不到;core 7.55.0([ref] T2)起引擎的整句
|
|
17
|
+
* (码、引导语、后果)都到模型,引导语按店判的 `FileHistoryError.permanence` 二选一:`terminal` ⇒「这是永久故障,
|
|
18
|
+
* 店修好之前别重试」,否则「Retry when the file-history store is healthy.」。所以这枚码要**判成 `terminal`**,
|
|
19
|
+
* 模型才不会被叫去重试一件永远不会成的事;而**运维面一个计数都没有**:这条腿今天在遥测上完全不可见。
|
|
18
20
|
*
|
|
19
21
|
* ## 修法(源头留痕,不走文本通道)
|
|
20
|
-
* · **散文面**({@link
|
|
22
|
+
* · **散文面**({@link foldCaughtFailure} 的 `text`):把 caught error 的 typed `code` 写成一个括号词
|
|
21
23
|
* 前置到它自己的 message 前 —— **不 `instanceof` 单挑任何一个类**(身上有字符串 `code` 就折),该店
|
|
22
|
-
*
|
|
24
|
+
* 的折点全部改走这一只函数。人与模型因此看得到「这是哪一类失败」。
|
|
25
|
+
* · **判断面**(同一只函数的 `fault`,core 7.55.0 `FileHistoryError.permanence`):永久码表里的 typed 码 ⇒
|
|
26
|
+
* `{ permanence: "terminal" }`,其余 ⇒ `{}`(没判 —— 引擎照旧给重试引导语)。折点把它摊进店答的
|
|
27
|
+
* `FileHistoryError`;引擎的拒句引导语、rewind 披露、`terminal.detail` 都读这一格,**不读散文**。
|
|
23
28
|
* · **机器面**(同一只函数的副作用):码取自 typed 错**对象**、对闭集词表判定,**绝不从散文里抠**。
|
|
24
29
|
* 🔴 这一条是 codex R1-[high] 验真后的定形:文本通道**天然可伪造** —— 一个名叫
|
|
25
30
|
* `(blob_too_large_for_sql).txt` 的文件读不出来时,它的路径就在 `snapshot_failed` 的散文里,任何
|
|
@@ -29,21 +34,28 @@
|
|
|
29
34
|
* (`file_history_permanent_failure_total{code}`)、**每进程每码一条 warn**(第二条起零新增内容,而
|
|
30
35
|
* 20G 树的用户每 turn 撞一次)、装配前累计的次数在 install 时补进 metrics。
|
|
31
36
|
*/
|
|
32
|
-
import { FILE_HISTORY_ERROR_CODES } from "@sema-agent/core";
|
|
37
|
+
import { FILE_HISTORY_ERROR_CODES, type FileHistoryError } from "@sema-agent/core";
|
|
33
38
|
import type { Logger } from "./observability/logger.js";
|
|
34
39
|
import type { Metrics } from "./observability/metrics.js";
|
|
35
40
|
interface Sink {
|
|
36
41
|
logger?: Logger;
|
|
37
42
|
metrics?: Metrics;
|
|
38
43
|
}
|
|
44
|
+
/** 一次 caught error 的折法:`text` = 店侧散文(带 typed 码括号词),`fault` = 店对这次故障的判断(摊进 `FileHistoryError`)。 */
|
|
45
|
+
export interface CaughtFailure {
|
|
46
|
+
readonly text: string;
|
|
47
|
+
readonly fault: Pick<FileHistoryError, "permanence">;
|
|
48
|
+
}
|
|
39
49
|
/**
|
|
40
|
-
* 把一个 caught error
|
|
50
|
+
* 把一个 caught error 折成店侧的散文 + 判断,**并**在它是一枚 typed 永久失败时留痕。
|
|
41
51
|
*
|
|
42
|
-
*
|
|
52
|
+
* `text` = 散文形:带 typed `code` 的前缀一个括号词(`(blob_too_large_for_sql) blob of … exceeds …`),
|
|
43
53
|
* 不带的**逐字**是原 message(transient 失败的文案因此与本批之前一字不差)。
|
|
54
|
+
* `fault` = 判断形(core 7.55.0 `FileHistoryError.permanence`):永久码表里的码 ⇒ `{ permanence: "terminal" }`;其余 ⇒ `{}`(店不知道 ——
|
|
55
|
+
* 驱动 / 库的错码是不是会自己好,不归本店判)。
|
|
44
56
|
* 副作用 = 机器形:码取自错误对象,逐次计数 + 每进程每码一条 warn。观测绝不抛。
|
|
45
57
|
*/
|
|
46
|
-
export declare function
|
|
58
|
+
export declare function foldCaughtFailure(err: unknown): CaughtFailure;
|
|
47
59
|
/** 装配层把 logger/metrics 接上(main.ts,与 `installFailOpenRecorder` 同一处)。 */
|
|
48
60
|
export declare function installFileHistoryFailureRecorder(deps: Sink): void;
|
|
49
61
|
/** 本进程逐码累计(测试/诊断读面)。 */
|
|
@@ -52,7 +64,7 @@ export declare function fileHistoryPermanentFailureCounts(): ReadonlyMap<string,
|
|
|
52
64
|
export declare function resetFileHistoryFailureRecorderForTest(deps?: Sink): void;
|
|
53
65
|
/** rewind 粗码臂的码词 = core 的闭集(值与型同一源:`FILE_HISTORY_ERROR_CODES`)。 */
|
|
54
66
|
export type FileHistoryErrorCode = (typeof FILE_HISTORY_ERROR_CODES)[number];
|
|
55
|
-
/** rewind
|
|
67
|
+
/** rewind 臂一次失败的粗码:`FileHistoryStoreError` 上的那一格(在闭集里);否则 `unknown`。纯函数、不抛。 */
|
|
56
68
|
export declare function rewindFailureCode(err: unknown): FileHistoryErrorCode | "unknown";
|
|
57
69
|
export {};
|
|
58
70
|
//# sourceMappingURL=file-history-disclosure.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FILE_HISTORY_ERROR_CODES } from "@sema-agent/core";
|
|
1
|
+
import { FILE_HISTORY_ERROR_CODES, FileHistoryStoreError } from "@sema-agent/core";
|
|
2
2
|
const PERMANENT_STORE_FAILURE_CODES = {
|
|
3
3
|
blob_too_large_for_sql: {
|
|
4
4
|
note: "a blob is larger than this deployment's SQL snapshot-blob cap — the same file will fail every turn until the deployment changes",
|
|
@@ -29,14 +29,15 @@ function drainToMetrics() {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
export function
|
|
32
|
+
export function foldCaughtFailure(err) {
|
|
33
33
|
const message = err instanceof Error ? err.message : String(err);
|
|
34
34
|
const code = err?.code;
|
|
35
35
|
if (typeof code !== "string" || code === "")
|
|
36
|
-
return message;
|
|
37
|
-
|
|
36
|
+
return { text: message, fault: {} };
|
|
37
|
+
const permanent = isPermanentCode(code);
|
|
38
|
+
if (permanent)
|
|
38
39
|
recordPermanent(code, message);
|
|
39
|
-
return `(${code}) ${message}
|
|
40
|
+
return { text: `(${code}) ${message}`, fault: permanent ? { permanence: "terminal" } : {} };
|
|
40
41
|
}
|
|
41
42
|
function safely(record) {
|
|
42
43
|
try {
|
|
@@ -90,12 +91,6 @@ export function resetFileHistoryFailureRecorderForTest(deps = {}) {
|
|
|
90
91
|
const FILE_HISTORY_ERROR_CODE_SET = new Set(FILE_HISTORY_ERROR_CODES);
|
|
91
92
|
const isFileHistoryErrorCode = (w) => FILE_HISTORY_ERROR_CODE_SET.has(w);
|
|
92
93
|
export function rewindFailureCode(err) {
|
|
93
|
-
|
|
94
|
-
for (const m of text.matchAll(/\(([a-z_]+)[):]/g)) {
|
|
95
|
-
const word = m[1];
|
|
96
|
-
if (isFileHistoryErrorCode(word))
|
|
97
|
-
return word;
|
|
98
|
-
}
|
|
99
|
-
return "unknown";
|
|
94
|
+
return err instanceof FileHistoryStoreError && isFileHistoryErrorCode(err.code) ? err.code : "unknown";
|
|
100
95
|
}
|
|
101
96
|
//# sourceMappingURL=file-history-disclosure.js.map
|
|
@@ -72,10 +72,10 @@ export type DrainEntryAnswer = DrainReceipt | DrainDeadlineRefusal;
|
|
|
72
72
|
* · `draining` / `since` / `actionId` / `deadlineAt` —— **只由** {@link enter} 整组写入(排空事实 = 契约 `EngineDraining`);
|
|
73
73
|
* · `enter` —— 唯一入口(收尾链装;缺席 = 这个进程没有收尾链,如嵌入宿主 / 测试夹具);
|
|
74
74
|
* · `yieldInflight` —— 让出本副本在飞的可抢占腿(`createHttpServer` 装);
|
|
75
|
-
* · `endSubscriptions` —— 关掉本副本打开着的只读订阅流(发一帧 `draining` 终帧再关;`createHttpServer` 装,
|
|
75
|
+
* · `endSubscriptions` —— 关掉本副本打开着的只读订阅流(发一帧 `draining` 终帧再关;`createHttpServer` 装,[ref])。订阅流不是在飞的工作
|
|
76
76
|
* (不进 `inflight`),排空不等它;收尾链在排空进入那一拍与硬停起点各调一次(排空期间新开的订阅在硬停那一拍收);
|
|
77
77
|
* · 其余四只是既有的读口(在飞数 / 活性时钟 / 附着流),语义见 `http/server.ts`。`inflight` 只数**工作**(run 腿 / 计费提交 / HITL 应答 /
|
|
78
|
-
* admission 期的普通请求),只读订阅只进 `attachedStreams`(
|
|
78
|
+
* admission 期的普通请求),只读订阅只进 `attachedStreams`([ref])。
|
|
79
79
|
*/
|
|
80
80
|
export interface DrainState {
|
|
81
81
|
draining: boolean;
|
|
@@ -53,7 +53,7 @@ export interface FleetTaskRow {
|
|
|
53
53
|
* 🔴 与 `name` 分域:`name` 是**显示名**(源 `description ?? name`,模型自由文本);本键是**身份键**,
|
|
54
54
|
* 消费端按串相等把「@某个名字」绑到这一行(同类型两个子代在 `agentType` 上不可分,在本键上可分)。
|
|
55
55
|
* ADDITIVE / tolerate-absent:**缺席 = 一次匿名委派**(不是「不知道它叫什么」)—— 7.25.0 之前本键在本仓
|
|
56
|
-
* 没有任何源,恒缺席。**VERBATIM,不过 `redactSecrets`**(
|
|
56
|
+
* 没有任何源,恒缺席。**VERBATIM,不过 `redactSecrets`**([ref] B6①:本注此前写「与 `name` 同一道边界,emit 前
|
|
57
57
|
* redact」,而三处铸点从本键到货起就是原样投 —— 见本文件 spawn / tick / terminal 三臂的行注与
|
|
58
58
|
* `trace/core-keyset-guard.ts` 的 `spawnName` 记账):它是**身份键**,消费端按串相等绑行,脱敏会把两个合法队友名
|
|
59
59
|
* 改写成同一串;出生点校验过的字符集里也没有可脱敏的形。残余(已披露)= 有人把真凭据当队友名写进
|
|
@@ -194,6 +194,10 @@ export interface FleetWorkflowRow {
|
|
|
194
194
|
* 停驻的 workflow run 终态 = `status:"failed"` + `errorCode:"workflow.agent_parked"`:`status` 词表不加字(不另铸专用 status 词),
|
|
195
195
|
* 「停驻」与「真失败」靠这一位分开。run 行没有码 ⇒ 键缺席(不铸空串);缺席也可能是老服务端,消费方同形处置:退回只读 `status`。 */
|
|
196
196
|
errorCode?: string;
|
|
197
|
+
/** ADDITIVE / tolerate-absent(core 7.55.0 [ref]):run **还在跑**、且至少一条腿停在审批门上 ⇒ `true`;否则**缺席**(永不 `false`)。
|
|
198
|
+
* 引擎的一次派生 `runParkedOf(run)`(停驻行的唯一定义 `parkedAgentsOf`),本仓不自判、不另铸;`status` 三词不加字。排空后的停驻终态是
|
|
199
|
+
* `status:"failed"` + `errorCode:"workflow.agent_parked"`(上一位),本位在那里缺席 —— 一个状态一个词。消费方把两形都渲成「等审批」。缺席也可能是老服务端。 */
|
|
200
|
+
parked?: true;
|
|
197
201
|
doneCount?: number;
|
|
198
202
|
/** 计划总数(= `run.agents.length`,**含排队中**)—— 注意它**不是**"已启动数",见 {@link FleetWorkflowRow.startedCount}。 */
|
|
199
203
|
totalCount?: number;
|
|
@@ -238,7 +242,7 @@ export type FleetFrame = {
|
|
|
238
242
|
/**
|
|
239
243
|
* [ref] §2③:**陈述级退场** —— 行没了,但**没有**结算语义。
|
|
240
244
|
*
|
|
241
|
-
* 🔴 **本键缺席的那一族不是「终局已发过」**(
|
|
245
|
+
* 🔴 **本键缺席的那一族不是「终局已发过」**([ref] / 车HX codex r1 [medium];本注此前逐字写着
|
|
242
246
|
* 「无此键的 remove = 终态之后的常规清场……两者都先发过终态 `task` 帧」,**那句是假的** ——
|
|
243
247
|
* 车HW 逐条亲读本文件的七处 `removeTask` 铸点后改成真话,消费方面的成文版 =
|
|
244
248
|
* `docs/ASSISTANT-WIRE-CONTRACT.md` 附录 H)。缺席形其实是**两族**:
|
|
@@ -263,7 +267,7 @@ export type FleetFrame = {
|
|
|
263
267
|
* durable 行压根不存在 —— 三形共同点是**没有终局可投影**,而本副本的行必然陈旧。此时造一个终态
|
|
264
268
|
* 就是编:判死的属主始终是 durable 侧的 reaper。所以只陈述「这条行离场了」,不逼消费端结算。
|
|
265
269
|
* (cli 侧裁量 [ref]:渲「离场」**不清行** —— 行保留、中性离场形、active 扣除、折叠排后。)
|
|
266
|
-
* 🔴
|
|
270
|
+
* 🔴 [ref]:子代行的陈述级退场之前,对账腿先问过它的属主(bg registry 非终态 ∨ 有待决审批 ⇒ 留行);
|
|
267
271
|
* 本帧因此只在「静默满一周期 ∧ 属主不作保」时出现。而它**不封被退那一代**(见 {@link cycleSeq})——
|
|
268
272
|
* 之后同一代(或更大代)的帧到达 = 那一行其实还活着,行**复活**;更小的代照旧是前代迟到帧。
|
|
269
273
|
* ADDITIVE / tolerate-absent。
|
|
@@ -272,7 +276,7 @@ export type FleetFrame = {
|
|
|
272
276
|
/** [ref] §2 判死×判代合成规则:退场帧带**被退那一代**的 {@link FleetTaskRow.cycleSeq}。
|
|
273
277
|
* 消费端因此能把 `retire(gen=N)` 之后的 `frame(gen=N+1)` 读成**复活**(行重生,退休不粘住新代),
|
|
274
278
|
* 而**结算级** `retire(gen=N)`(本帧无 `removeReason`)之后的 `frame(gen=N)` 读成**前代迟到帧,忽略**。
|
|
275
|
-
* 🔴
|
|
279
|
+
* 🔴 [ref]:**陈述级**退场(`removeReason:"orphaned"`)之后的 `frame(gen=N)` = **复活**,不是迟到帧 ——
|
|
276
280
|
* 陈述级退场从不断言「这一代结束了」(它说的只是「本副本一个周期没听到这一行」),所以同代的下一帧
|
|
277
281
|
* 就是它还活着的证据(本仓 {@link FleetEventBus.removeTask} 对这一形不封代,消费端同读);更小的代照旧忽略。
|
|
278
282
|
* 缺席同 {@link FleetTaskRow.cycleSeq} ——「无此概念」,不是「第一代」。 */
|
|
@@ -362,7 +366,7 @@ export interface HookNonBlockingFailure {
|
|
|
362
366
|
* · `timeout` —— 条目超时被击杀(无退出码);
|
|
363
367
|
* · `spawn_failed` —— 起不来 / http 连不上 / LLM 载体失败(无退出码);
|
|
364
368
|
* · `bad_json` —— exit 0 但 stdout 看着是 JSON 却读不成决策对象(裁决静默丢失的那一形);
|
|
365
|
-
* · `matcher_over_budget` —— 这条 hook 所在组的 `matcher`(或条目自己的 `if` 条件)在这次事件的这个名字上求值没在预算内结束(灾难回溯;
|
|
369
|
+
* · `matcher_over_budget` —— 这条 hook 所在组的 `matcher`(或条目自己的 `if` 条件)在这次事件的这个名字上求值没在预算内结束(灾难回溯;[ref])。
|
|
366
370
|
* **不是 hook 脚本坏了,是它的选中条件不可求值**:server 按「选中」处理(守卫不被跳过,条目照跑),此帧说的是「这只 matcher 在这个名字上跑不完」。
|
|
367
371
|
* **一组一帧**(`if` 一条目一帧),`hookName` / `entryType` 指认组的第一个条目,`detail` 点名 matcher、名字、额度与组里的条目数;无 `exitCode` / `stderr`。
|
|
368
372
|
*/
|
|
@@ -498,7 +502,7 @@ export interface BgNotification {
|
|
|
498
502
|
seq?: number;
|
|
499
503
|
status: "completed" | "failed" | "killed";
|
|
500
504
|
summary?: string;
|
|
501
|
-
/**
|
|
505
|
+
/** [ref](core 7.51.0 [ref] / [ref]):the child's REPORT — the same string the completion frame the parent's model reads carries
|
|
502
506
|
* (core cuts it once at the frame's bound, redacting first), so a host that wakes an idle conversation reads it here instead of a
|
|
503
507
|
* second, differently-cut copy. UNTRUSTED child text ⇒ `redactSecrets` at this wire boundary, exactly like `summary` on this frame
|
|
504
508
|
* and `result` on the `task_notification` frame (one reading: the server redacts at its own boundary whatever upstream did).
|
|
@@ -555,7 +559,7 @@ export declare class FleetEventBus {
|
|
|
555
559
|
private readonly workflows;
|
|
556
560
|
/** [ref] / codex R1-F2:**代际墓碑** —— 已离场行的最后已知 `cycleSeq`(行本身已从 `tasks` 删掉,
|
|
557
561
|
* 代际状态却必须活得比行久一点,否则前代迟到帧会在空 Map 上把幽灵行重铸出来)。有界 LRU。
|
|
558
|
-
* 🔴
|
|
562
|
+
* 🔴 [ref]:碑上多记一位 `ended` = 「**这一代结束了**」是否被断言过。离场**恒**保住代际状态(`gen` 之前的帧
|
|
559
563
|
* 永远是前代迟到帧 —— 与行还在 Map 里时那道闸同一个判据);只有作「这一代结束了」断言的离场(结算级 / 投影级
|
|
560
564
|
* 常规清场)才把 `gen` **这一代本身**也封掉。陈述级退场(`removeReason:"orphaned"`)不作这个断言 ⇒ 同代帧 = 复活。 */
|
|
561
565
|
private readonly retiredGen;
|
|
@@ -577,7 +581,7 @@ export declare class FleetEventBus {
|
|
|
577
581
|
/** Drop a task row (terminal + swept) + fan out the removal. Idempotent (a no-op if already gone).
|
|
578
582
|
*
|
|
579
583
|
* `opts`([ref],两键均 ADDITIVE):`removeReason:"orphaned"` = **陈述级退场**(没有结算语义,见
|
|
580
|
-
* {@link FleetFrame} 的 `task_remove` 臂;
|
|
584
|
+
* {@link FleetFrame} 的 `task_remove` 臂;[ref] 起**不封被退那一代**,同代帧 = 复活);`cycleSeq` = 被退那一代的代际号。发布方的常规清场
|
|
581
585
|
* (`onTerminal`/`onChildTerminal`)不传 opts ⇒ 帧逐字节与本改动之前相同。 */
|
|
582
586
|
removeTask(id: string, opts?: {
|
|
583
587
|
removeReason?: "orphaned";
|
|
@@ -595,7 +599,7 @@ export declare class FleetEventBus {
|
|
|
595
599
|
/** [ref] 让位迁移料的读面:迁移「只补缺席位」需要看得见存活行现有什么(BCE 是权威车道,不覆盖)。 */
|
|
596
600
|
taskRow(id: string): Readonly<FleetTaskRow> | undefined;
|
|
597
601
|
/**
|
|
598
|
-
*
|
|
602
|
+
* [ref]:一条子代行在它两只**属主账**上的键。三个 id 域互不相同,换算只有本类做得了(两种行 id 都是本文件
|
|
599
603
|
* 铸的,两域之间唯一的 join —— 让位登记簿 —— 也住在这里),所以换算只写这一处:
|
|
600
604
|
* · 行 id —— BCE 车道 = registry handle 本身(`e.taskId`);run-leg 车道 = `${runId} ${子代 task_progress taskId}`
|
|
601
605
|
* (`fleetRunPublisher` 的 `childId`);
|
|
@@ -611,10 +615,14 @@ export declare class FleetEventBus {
|
|
|
611
615
|
handle?: string;
|
|
612
616
|
sessionIds: readonly string[];
|
|
613
617
|
};
|
|
614
|
-
/**
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
+
/**
|
|
619
|
+
* Publish a workflow row + fan out. **The row is the whole row and REPLACES the previous one** (by `id`). A workflow row has exactly one producer,
|
|
620
|
+
* {@link buildFleetWorkflowRow} — a projection of the durable run, recomputed whole on every write (the write observer, the terminal window, the
|
|
621
|
+
* reconciler) — so the row as published is the run's current statement. Merging it onto the previous row kept every optional key the run no longer
|
|
622
|
+
* states: core 7.55.0 [ref] `parked` is `true` or absent, and is absent again once the park is decided — under a merge it stayed `true` for the rest of
|
|
623
|
+
* the row's life (a run read "awaiting approval" after its approval was answered). Task rows keep their merge: their producers publish partial deltas.
|
|
624
|
+
*/
|
|
625
|
+
publishWorkflow(row: FleetWorkflowRow): void;
|
|
618
626
|
/** Drop a workflow row + fan out the removal. Idempotent. */
|
|
619
627
|
removeWorkflow(id: string): void;
|
|
620
628
|
/** [ref]-B 缺口②: fan out a background-child completion notification (EVENT — not stored, never in the
|
|
@@ -701,7 +709,7 @@ export type FleetRunPublisher = ReturnType<typeof fleetRunPublisher>;
|
|
|
701
709
|
* stats.toolCalls→toolUses(名对齐,消费端一个形状)。失败码 "cancelled" ⇒ stoppedBy:"user"(与
|
|
702
710
|
* markStopSource 的归因值同源);transcriptId 顶层 = run 的 sessionId([ref]§二拍)。缺源的键不铸。
|
|
703
711
|
*
|
|
704
|
-
* 🔴
|
|
712
|
+
* 🔴 [ref](core 7.6.0 D-8):入参从**结构性可缺席** `errorCode?: string` 改成 `terminal?: TerminalCause`。
|
|
705
713
|
* 留着旧形不会红 —— 那正是危险所在:`TaskResult` 上已经没有 `errorCode` 这个键了,可结构性可选参数照样
|
|
706
714
|
* 编译通过,于是 `stoppedBy:"user"` 会**静默地永远不再铸**(取消的 run 在舰队行上从此看不出是被人杀的)。
|
|
707
715
|
* 终局事实一律走因由,`failureCodeOf` 是本仓读「这次失败带的是哪个码」的唯一形。 */
|
package/dist/fleet/fleet-bus.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
|
-
import { DURABLE_AGENT_HANDLE_RE, deriveAgentDisplayStatus, isDelegatedAgentTerminal } from "@sema-agent/core";
|
|
2
|
+
import { DURABLE_AGENT_HANDLE_RE, deriveAgentDisplayStatus, isDelegatedAgentTerminal, runParkedOf } from "@sema-agent/core";
|
|
3
3
|
import { persistedPlaneOf } from "../terminal.js";
|
|
4
4
|
import { takeWorkspaceSnapshotFailure } from "./workspace-snapshot-residual.js";
|
|
5
5
|
import { recordFailOpen } from "../observability/fail-open.js";
|
|
@@ -21,6 +21,7 @@ export function buildFleetWorkflowRow(id, run) {
|
|
|
21
21
|
...(run.originatingSessionId ? { sessionId: run.originatingSessionId } : {}),
|
|
22
22
|
status: run.status,
|
|
23
23
|
...(run.errorCode ? { errorCode: run.errorCode } : {}),
|
|
24
|
+
...(runParkedOf({ status: run.status, agents }) ? { parked: true } : {}),
|
|
24
25
|
doneCount: done,
|
|
25
26
|
totalCount: agents.length,
|
|
26
27
|
failedCount: failed,
|
|
@@ -189,10 +190,9 @@ export class FleetEventBus {
|
|
|
189
190
|
sessionIds.push(k.slice(prefix.length));
|
|
190
191
|
return { sessionIds, ...(DURABLE_AGENT_HANDLE_RE.test(row.id) ? { handle: row.id } : {}) };
|
|
191
192
|
}
|
|
192
|
-
publishWorkflow(
|
|
193
|
-
|
|
194
|
-
this.
|
|
195
|
-
this.emit({ type: "workflow", row: merged, ts: this.now() });
|
|
193
|
+
publishWorkflow(row) {
|
|
194
|
+
this.workflows.set(row.id, row);
|
|
195
|
+
this.emit({ type: "workflow", row, ts: this.now() });
|
|
196
196
|
}
|
|
197
197
|
removeWorkflow(id) {
|
|
198
198
|
if (this.workflows.delete(id))
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
* 「**静默满一个对账周期**」(本腿订阅总线自记每行的最后帧时刻):还在出帧 = 活着的证据。
|
|
34
34
|
* durable 行**在场**的那三格没有这个歧义(`getRun` 命中 = 它就是一条 run 行),故照矩阵即时处置。
|
|
35
35
|
*
|
|
36
|
-
* ## 子代行(§1;🔴
|
|
36
|
+
* ## 子代行(§1;🔴 [ref] 起改为「活性由属主说了算」)
|
|
37
37
|
* 子代行**不读 durable run 店**(它不是 run 行)。它的活性属主有两只,都在本仓可读 —— 读它们**不是**越界重判,
|
|
38
|
-
* 是问属主(
|
|
38
|
+
* 是问属主([ref] 之前此处写「bg 子代的 durable 真源在 core 侧 registry,server 不越界重判」,于是判据里只剩
|
|
39
39
|
* 「静默」这一条,而 registry 的读半场 `RunnerDeps.backgroundAgentStore` 一直就在本仓):
|
|
40
40
|
* ① core bg registry(`BackgroundAgentStore` 行 `status` 非终态 = `running` / `parked`);
|
|
41
41
|
* ② 本副本审批面的待决卡(子代发起、没人答的 ask —— 子代卡在那儿,当然不出帧)。
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* 只做同款「durable 终局投影」([ref] 的 snapshot pull 腿 + reapers 的 workflow recover 腿已在场),
|
|
50
50
|
* **不加新判据**:活行恒不动,没有陈述级退场这一形。
|
|
51
51
|
*
|
|
52
|
-
* ## 🔴
|
|
52
|
+
* ## 🔴 [ref]:候补窗的升级**由事实驱动**,周期臂降为兜底
|
|
53
53
|
* 陈述级退场(`orphanExit`)恒不造终态、行进候补窗;把它升级成真终局此前**只**发生在下一个对账周期的
|
|
54
54
|
* ① 臂 ⇒ 成对终帧最晚 {@link FLEET_RECONCILE_INTERVAL_MS} + 预算抖动才到面板,而消费方
|
|
55
55
|
* (`@sema-agent/client-core` 的面板投影)对「行缺席」按 30s 结算 —— 两侧各自正确,合成的是「面板先结算
|
|
@@ -118,7 +118,7 @@ export interface FleetReconcileRunPort {
|
|
|
118
118
|
export interface FleetReconcileWorkflowPort {
|
|
119
119
|
get(id: string): Promise<WorkflowRun | null | undefined>;
|
|
120
120
|
}
|
|
121
|
-
/**
|
|
121
|
+
/** [ref]:core bg registry 账(`BackgroundAgentStore`)的只读窄口 —— 与 {@link FleetReconcileRunPort} 同一条
|
|
122
122
|
* 单写者纪律(接口上没有写方法)。生产 = `RunnerDeps.backgroundAgentStore` **同实例**(结构上就是它的 `get`
|
|
123
123
|
* 一面);`null` = 账上没有这一行。 */
|
|
124
124
|
export interface FleetReconcileAgentPort {
|
|
@@ -133,7 +133,7 @@ export interface FleetReconcilerDeps {
|
|
|
133
133
|
*/
|
|
134
134
|
isLiveOnThisReplica: (taskId: string) => boolean;
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* [ref] 测试缝:「run 行 CAS 赢了翻终局」的订阅口。**生产恒缺席** —— 缺席时本腿自己去
|
|
137
137
|
* `observability/run-terminal.ts` 的**唯一铸点**登记(那口是进程级的自由函数,与 `recordFailOpen`
|
|
138
138
|
* 同姿势:真正的铸点在没有任何句柄的深处)。给它一个注入形只是为了让用例能在一台假铸点上跑。
|
|
139
139
|
*
|
|
@@ -143,10 +143,10 @@ export interface FleetReconcilerDeps {
|
|
|
143
143
|
subscribeRunTerminal?: (fn: (rec: RunTerminalRecord) => void) => () => void;
|
|
144
144
|
runs?: FleetReconcileRunPort;
|
|
145
145
|
workflows?: FleetReconcileWorkflowPort | WorkflowRunStore;
|
|
146
|
-
/**
|
|
146
|
+
/** [ref]:子代活性的属主①(bg registry 账)。缺席 = 没有 bg 店的部署(纯内存 dev),这一问问不了。 */
|
|
147
147
|
agents?: FleetReconcileAgentPort;
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* [ref]:子代活性的属主②:这只子代此刻有没有**待决**审批卡。只问是非(与 {@link isLiveOnThisReplica} 同姿势,
|
|
150
150
|
* 不搬 Map)。入参是 ask 发起者域(子代自己的 core session id,= 卡上的 `originTaskId`),**不是**行 id ——
|
|
151
151
|
* 行 id → 该域的换算只在 `FleetEventBus.childOwnerKeys`。生产 = `ToolApprovalCoordinator.hasLivePendingFrom`。
|
|
152
152
|
*/
|
|
@@ -171,9 +171,9 @@ export interface FleetReconcileTally {
|
|
|
171
171
|
retired: number;
|
|
172
172
|
/** 陈述级退场的行数(顶层 + 孤儿子行)。 */
|
|
173
173
|
orphaned: number;
|
|
174
|
-
/** 父本周期刚离场、自己又判成孤儿而陈述级退场的子行数(
|
|
174
|
+
/** 父本周期刚离场、自己又判成孤儿而陈述级退场的子行数([ref] 前 = 随父无条件同扫的数)。 */
|
|
175
175
|
childrenSwept: number;
|
|
176
|
-
/**
|
|
176
|
+
/** [ref]:静默满一周期、无父可循(或 run 账不认识),但属主作保而**留行**的子行数。 */
|
|
177
177
|
childrenKeptAlive: number;
|
|
178
178
|
/** durable 终局 ⇒ 投影退休的 workflow 行数。 */
|
|
179
179
|
workflowsRetired: number;
|
|
@@ -8,7 +8,7 @@ export type SubagentTailFrame = Record<string, unknown> & {
|
|
|
8
8
|
};
|
|
9
9
|
/** core forward 事件 → wire 投影(sync 主流五分支同源;不认识的帧类型=null 不发——tail 面只承诺
|
|
10
10
|
* content 六类,新 core 帧类型先经这里显式收编再出 wire)。
|
|
11
|
-
* ⚠️ **本函数是无状态逐帧投影**:`reasoning_end`(
|
|
11
|
+
* ⚠️ **本函数是无状态逐帧投影**:`reasoning_end`([ref] 的推理权威段)不在这里 —— 它要按句柄攒段,
|
|
12
12
|
* 住在 {@link SubagentTailBus.onForwardFrame}(publish 侧是唯一知道句柄的地方)。 */
|
|
13
13
|
export declare function projectTailFrame(e: Record<string, unknown> & {
|
|
14
14
|
type?: string;
|
|
@@ -53,7 +53,7 @@ export declare class SubagentTailBus {
|
|
|
53
53
|
*/
|
|
54
54
|
private readonly modeByHandle;
|
|
55
55
|
/**
|
|
56
|
-
* 句柄 → 该句柄这条 tail 流上**在攒的推理段**(
|
|
56
|
+
* 句柄 → 该句柄这条 tail 流上**在攒的推理段**([ref])。
|
|
57
57
|
*
|
|
58
58
|
* 键必须是句柄,理由与 {@link modeByHandle} 同源再加一条硬的:两个并发子代的 `reasoning_delta` 在
|
|
59
59
|
* **同一个** forward sink 上交错到达,一只累积器会把两份思考拼成一段、再盖上其中一个的身份键。
|
|
@@ -67,10 +67,10 @@ export declare class SubagentTailBus {
|
|
|
67
67
|
* 否则晚开的 tail 永远读不到供给形)。同值重复写是 no-op(热路径只付一次 Map.get)。 */
|
|
68
68
|
noteHandleContentMode(bgAgentId: string, mode: TailContentMode): void;
|
|
69
69
|
/**
|
|
70
|
-
* 🔴 **三条 run 腿的 forward 回调唯一入口**(
|
|
70
|
+
* 🔴 **三条 run 腿的 forward 回调唯一入口**([ref] 收口)——登记供给形 → 段界收段 → 逐帧投影 → publish。
|
|
71
71
|
*
|
|
72
72
|
* 此前这四步以**同一段六行代码**抄在三条腿上(sync 流腿、verify-resume 腿、resume-stream 腿),
|
|
73
|
-
* 差别为零;
|
|
73
|
+
* 差别为零;[ref] 要给 tail 面补 `reasoning_end` 时,那就是第四、第五、第六份拷贝。收成一扇门之后
|
|
74
74
|
* 腿上只剩「句柄在不在」这一句判断,三腿不可能再分家(`test/subagent-tail-stream.test.ts` G18-G20)。
|
|
75
75
|
*
|
|
76
76
|
* 顺序即语义:权威段**先于**触发它的结构帧上 wire(消费端「整段替换已攒 delta」的替换点不与卡片交错),
|
package/dist/fleet-client.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fleet worker-side wiring(announce/heartbeat + usage 批报;契约 = registry-core 0.1.48+
|
|
3
3
|
* `/fleet`,center 端点 = web-admin `/api/fleet/*`)。设计要点:
|
|
4
|
-
* - **可选分层(D3),两条环各自有门(
|
|
4
|
+
* - **可选分层(D3),两条环各自有门([ref] ④)**:客户端在中心车道配齐时启动(`centerLaneConfigured` —— baseUrl + 声明了
|
|
5
5
|
* 凭证 + worker,与租约管理器、用量累加器**同一只**谓词);**用量环**只要这三件;**公告环**(announce / 心跳 / 注销)另要
|
|
6
6
|
* 配置席 `fleetAdvertiseAddress`(env `FLEET_ADVERTISE_ADDRESS`,`loadConfig` 解析一次;可达性是运维的话,不自猜:k8s pod IP /
|
|
7
7
|
* docker alias / 127.0.0.1:port 只有部署环境自己知道)。不配中心的部署零行为变化;配了中心而不公告的引擎只报用量、不注册(7.105.0 及以前它连用量都不报)。
|
|
8
8
|
* - **announce=注册=心跳同形状幂等 upsert**:boot 后(listen 之后)POST 一次 + 每 heartbeatMs 续。
|
|
9
|
-
* `ready` / `draining` 两字段由引擎信号铸点的同一次读铸(
|
|
9
|
+
* `ready` / `draining` 两字段由引擎信号铸点的同一次读铸([ref]:`ready` = `http/readiness.ts` `readinessOf` 的判,
|
|
10
10
|
* 与 `/health.ready`、`GET /readyz`、计费提交门同源;= roster 已落 ∧ ¬draining),`draining` = 排空事实在场(与嵌套
|
|
11
11
|
* `engineSignal.draining` 同一个字段,`fleet/engine-signal.ts` 规则 5)。修前 `ready = !isDraining()`,不含 roster ⇒ roster 未落时
|
|
12
12
|
* 心跳说「就绪」而计费提交在 503。
|
|
13
13
|
* - **`engineSignal`(7.123.0)**:引擎态整只(契约 `EngineSignal`),与扁平键同一次读数;契约包 10.x 的心跳形没有它的座位(10.x 中心
|
|
14
14
|
* 默认 strip 解析丢掉它、照收心跳);扁平布尔 `draining` settings-schema 12.0.0 删、本引擎 7.124.0+ 删发。
|
|
15
|
-
* - **`restart?`(
|
|
15
|
+
* - **`restart?`([ref])**:在场 ⇔ 本副本必须重启才能应用配置 —— 取自 `/health.restart` **同一只**取值口(装配层接
|
|
16
16
|
* `deployment.restartState`,web-admin 的 `restartState()`),同一个对象,形 = settings-schema `RestartSignal`;
|
|
17
17
|
* 缺席即键缺席(中心按行整体替换,不合并 —— 一条不带它的心跳就是「不再需要」)。
|
|
18
|
-
* - **`modelRefusals?`(
|
|
18
|
+
* - **`modelRefusals?`([ref])**:在场 ⇔ 本副本对最近一次被判的中心候选目录有可报的拒(逐条名 → 码 / 模型面组拒码)—— 取自
|
|
19
19
|
* `/health.modelRefusals` **同一只**取值口(装配层接 `deployment.modelRefusalsState`),同一个对象,形 = settings-schema
|
|
20
20
|
* `ModelRefusalsSignal`;缺席即键缺席(同 `restart`)。
|
|
21
21
|
* - **自报状态翻转即刻再 announce**(第一时间自摘流 / 自挂流 / 报重启 / 报拒因,比任何观测都快):draining 翻转由收尾链直调
|
|
@@ -72,20 +72,20 @@ export declare class FleetUsageAccumulator {
|
|
|
72
72
|
get size(): number;
|
|
73
73
|
}
|
|
74
74
|
export interface FleetClientOpts {
|
|
75
|
-
/**
|
|
75
|
+
/** [ref]:凭证是**来源**(每条公告 / 用量 / 注销请求各取一次值),不是启动期烧进 header 的字符串。 */
|
|
76
76
|
center: CenterEndpoint & {
|
|
77
77
|
worker: string;
|
|
78
78
|
};
|
|
79
79
|
instanceId: string;
|
|
80
80
|
/** Reachable base URL of THIS instance — the operator's explicit declaration (`FLEET_ADVERTISE_ADDRESS`).
|
|
81
|
-
*
|
|
81
|
+
* [ref] ④:**缺席 = 公告环不装**(不注册、不心跳、不注销;`announceNow` 是空操作),用量环照装。 */
|
|
82
82
|
advertiseAddress?: string | undefined;
|
|
83
83
|
version: string;
|
|
84
84
|
/** 编排器片 2 件 1:引擎信号的**一只铸点**(装配层接 `mintEngineSignal(deployment)` —— `/health` 与 `/readyz` 读的同一只、同一个 deps 组)。
|
|
85
85
|
* 每条公告现铸**一次**,嵌套 `engineSignal` 与扁平 `ready` / `draining` / `restart` / 代际与租约三键都取自这一次(不会撕裂成 `ready:true` +
|
|
86
|
-
* `draining:true`,也不会出现心跳与 `/health` 各算一份重启或租约)。修前是 `readiness` + `restart` 两只取值口(
|
|
86
|
+
* `draining:true`,也不会出现心跳与 `/health` 各算一份重启或租约)。修前是 `readiness` + `restart` 两只取值口([ref] / [ref]),合进这一只。 */
|
|
87
87
|
signal: () => EngineSignalFacts;
|
|
88
|
-
/**
|
|
88
|
+
/** [ref]:模型拒因信号(装配层接 `/health` 同一只取值口 `deployment.modelRefusalsState`)。每条公告现读一次;`undefined` ⇒ 公告不带
|
|
89
89
|
* `modelRefusals` 键。必填:与 `restart` 同 —— 心跳面没有「不知道有没有拒」这一形(老引擎不发这个键,中心按 `version` 判「不可知」)。 */
|
|
90
90
|
modelRefusals: () => ModelRefusalsSignal | undefined;
|
|
91
91
|
/** 编排器片 2:每一次**能力读数**交出去一次(装配层接服务租约客户端的 `noteCenterCapabilities`)。规则见 {@link capabilityReadingOf}:
|
|
@@ -104,7 +104,7 @@ export interface FleetClientOpts {
|
|
|
104
104
|
}
|
|
105
105
|
export interface FleetClient {
|
|
106
106
|
/** Immediate out-of-cycle announce — call when a self-reported input flips (draining: self-remove from routing FIRST;
|
|
107
|
-
* roster landed: become routable without waiting a heartbeat; restart signal changed:
|
|
107
|
+
* roster landed: become routable without waiting a heartbeat; restart signal changed: [ref]). */
|
|
108
108
|
announceNow: () => Promise<void>;
|
|
109
109
|
/**
|
|
110
110
|
* **路由面**停:停心跳、等在飞公告排空、best-effort DELETE 注销(各请求有界;从不抛)。之后的 `announceNow` 是空操作。
|
|
@@ -113,7 +113,7 @@ export interface FleetClient {
|
|
|
113
113
|
stopRouting: () => Promise<void>;
|
|
114
114
|
/**
|
|
115
115
|
* **记账面**停:停用量窗定时器、上报最后一个(可能不满的)用量窗(有界;从不抛;空窗不发)。与路由面无关(不公告的引擎也报用量)。
|
|
116
|
-
* 收尾链排在**排空等待之后**调(
|
|
116
|
+
* 收尾链排在**排空等待之后**调([ref] F12:宽限窗里跑完的腿记下的用量必须进这一窗)。
|
|
117
117
|
*/
|
|
118
118
|
flushFinalUsage: () => Promise<void>;
|
|
119
119
|
}
|
|
@@ -134,13 +134,13 @@ export type AnnounceReplyReading = Exclude<CapabilityReading, {
|
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
136
|
* Start the worker-side fleet loops. Caller has already gated on the center lane (startFleetClientFromConfig below).
|
|
137
|
-
* The announce loop runs iff `advertiseAddress` is present; the usage loop iff `usage` is present (
|
|
137
|
+
* The announce loop runs iff `advertiseAddress` is present; the usage loop iff `usage` is present ([ref] ④: the two
|
|
138
138
|
* loops no longer share one gate).
|
|
139
139
|
*/
|
|
140
140
|
export declare function startFleetClient(opts: FleetClientOpts): FleetClient;
|
|
141
141
|
/**
|
|
142
|
-
* Config gate (D3 可选分层;
|
|
143
|
-
* {@link centerLaneConfigured}(baseUrl + a DECLARED credential + worker —
|
|
142
|
+
* Config gate (D3 可选分层;[ref] ④ 两条环各自有门): start when the center lane is configured —
|
|
143
|
+
* {@link centerLaneConfigured}(baseUrl + a DECLARED credential + worker — [ref]: declared, not "currently readable": a token
|
|
144
144
|
* file that is unreadable right now still starts the client, every request re-reads it), the SAME predicate the lease
|
|
145
145
|
* manager and the usage accumulator use. The usage loop needs nothing more; the announce loop additionally needs the
|
|
146
146
|
* operator's explicit reachable address — the config seat `fleetAdvertiseAddress` (env `FLEET_ADVERTISE_ADDRESS`, parsed once by
|