@sema-agent/server 7.149.0 → 7.151.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 +307 -9
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/USAGE.md +92 -40
- package/deploy/sema-up/README.md +7 -1
- package/deploy/sema-up/chart/Chart.yaml +1 -1
- package/deploy/sema-up/chart/templates/NOTES.txt +5 -0
- package/deploy/sema-up/chart/templates/_helpers.tpl +15 -16
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -3
- package/deploy/sema-up/chart/templates/server.yaml +5 -3
- package/deploy/sema-up/chart/values-full-single.yaml +3 -1
- package/deploy/sema-up/chart/values.yaml +8 -1
- package/deploy/sema-up/cluster-up.sh +1 -0
- package/deploy/sema-up/kube-up.sh +1 -1
- package/deploy/sema-up/lib/flagshape.sh +1 -1
- package/deploy/sema-up/lib/helm-values-cluster.py +2 -0
- package/deploy/sema-up/lib/helm-values-kube.py +2 -0
- package/dist/adoption/import.js +3 -3
- package/dist/approval-ask-machine.d.ts +1 -1
- package/dist/approval-card.d.ts +3 -3
- package/dist/approval-gate-currency.d.ts +2 -2
- package/dist/audit.d.ts +1 -1
- package/dist/audit.js +2 -2
- package/dist/auth-bridge.d.ts +20 -0
- package/dist/auth-bridge.js +9 -0
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +4 -2
- package/dist/bind-host.d.ts +2 -3
- package/dist/bind-host.js +2 -4
- package/dist/boot/budget-tracing.js +1 -1
- package/dist/boot/deferred-sandbox-path-env.d.ts +5 -3
- package/dist/boot/deferred-sandbox-path-env.js +1 -2
- package/dist/boot/engine-lease.d.ts +5 -0
- package/dist/boot/engine-lease.js +1 -0
- package/dist/boot/execution-env.d.ts +8 -14
- package/dist/boot/execution-env.js +54 -17
- package/dist/boot/execution-lane.js +32 -5
- package/dist/boot/late-binds.d.ts +8 -4
- package/dist/boot/late-binds.js +7 -1
- package/dist/boot/memory-consolidation.d.ts +3 -2
- package/dist/boot/memory-consolidation.js +6 -6
- package/dist/boot/parked-revive-gate.d.ts +5 -5
- package/dist/boot/parked-revive-gate.js +2 -3
- package/dist/boot/reapers.d.ts +5 -0
- package/dist/boot/reapers.js +12 -1
- package/dist/boot/resolve-spec.d.ts +7 -8
- package/dist/boot/resolve-spec.js +80 -35
- package/dist/boot/retention-lane.d.ts +1 -1
- package/dist/boot/runner-deps.d.ts +9 -2
- package/dist/boot/runner-deps.js +3 -3
- package/dist/boot/session-age-out.d.ts +36 -0
- package/dist/boot/session-age-out.js +101 -0
- package/dist/boot/session-faces.d.ts +5 -14
- package/dist/boot/session-faces.js +28 -24
- package/dist/boot/stage-01-config.js +2 -0
- package/dist/boot/stage-03-store-backend.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +5 -3
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +7 -4
- package/dist/boot/stage-06-runners.js +16 -8
- package/dist/boot/stage-07-capability-layer.d.ts +7 -4
- package/dist/boot/stage-07-capability-layer.js +3 -2
- package/dist/boot/stage-08-reapers.d.ts +7 -4
- package/dist/boot/stage-08-reapers.js +4 -2
- package/dist/boot/stage-09-leader.d.ts +11 -5
- package/dist/boot/stage-09-leader.js +12 -3
- package/dist/boot/stage-10-http-server.d.ts +44 -6
- package/dist/boot/stage-10-http-server.js +12 -10
- package/dist/boot/web-admin.d.ts +1 -1
- package/dist/boot/web-admin.js +3 -1
- package/dist/boot/workflow-orchestration.d.ts +7 -2
- package/dist/boot/workflow-orchestration.js +24 -7
- package/dist/bounded-rotation.d.ts +29 -0
- package/dist/bounded-rotation.js +24 -0
- package/dist/capability-facts.d.ts +84 -66
- package/dist/capability-facts.js +58 -41
- package/dist/center-credential.d.ts +25 -6
- package/dist/center-credential.js +25 -5
- package/dist/config-catalog.d.ts +26 -7
- package/dist/config-catalog.js +15 -12
- package/dist/config-invariants.d.ts +2 -1
- package/dist/config-invariants.js +4 -4
- package/dist/config-types.d.ts +22 -15
- package/dist/config.d.ts +51 -2
- package/dist/config.js +35 -24
- package/dist/deployment-governance.d.ts +7 -28
- package/dist/deployment-governance.js +1 -14
- package/dist/deployment-shape.d.ts +9 -1
- package/dist/deployment-shape.js +2 -1
- package/dist/device-protocol.d.ts +5 -4
- package/dist/device-protocol.js +1 -1
- package/dist/device-ws-hub.d.ts +1 -0
- package/dist/device-ws-hub.js +66 -29
- package/dist/device-ws-protocol.d.ts +79 -12
- package/dist/device-ws-protocol.js +64 -26
- package/dist/engine-identity.d.ts +23 -5
- package/dist/engine-identity.js +13 -0
- package/dist/entry-mode-clamp-notice.d.ts +2 -1
- package/dist/execution-env-refusal.d.ts +23 -0
- package/dist/execution-env-refusal.js +5 -0
- package/dist/execution-lane-caps.d.ts +3 -1
- package/dist/field-conflict.d.ts +3 -3
- package/dist/file-history-capture.d.ts +11 -4
- package/dist/file-history-capture.js +9 -6
- package/dist/file-history-disclosure.d.ts +7 -5
- package/dist/file-history-disclosure.js +7 -5
- package/dist/fleet/drain-entry.d.ts +4 -0
- package/dist/fleet/engine-signal.d.ts +14 -1
- package/dist/fleet/engine-signal.js +5 -1
- package/dist/fleet/fleet-reconciler.d.ts +1 -1
- package/dist/fleet/serving-lease.d.ts +18 -3
- package/dist/fleet/serving-lease.js +81 -35
- package/dist/fleet-client.d.ts +13 -11
- package/dist/fleet-client.js +53 -33
- package/dist/history-anchor.js +1 -1
- package/dist/hitl-delivery.d.ts +1 -3
- package/dist/hitl-delivery.js +1 -1
- package/dist/hooks/hook-runner.js +2 -2
- package/dist/host-lsp-manager.d.ts +2 -2
- package/dist/http/active-run-conflict.d.ts +3 -7
- package/dist/http/active-run-conflict.js +2 -2
- package/dist/http/admission.js +19 -4
- package/dist/http/approval-sweeps.js +7 -6
- package/dist/http/caller-trust.d.ts +2 -2
- package/dist/http/caller-trust.js +3 -3
- package/dist/http/checkpoint-ctx.d.ts +20 -63
- package/dist/http/checkpoint-ctx.js +2 -24
- package/dist/http/claim-heartbeat.d.ts +4 -4
- package/dist/http/claim-heartbeat.js +3 -3
- package/dist/http/dispatch.d.ts +2 -1
- package/dist/http/dispatch.js +36 -29
- package/dist/http/durable-run-leg.js +17 -17
- package/dist/http/health-self-report.d.ts +9 -1
- package/dist/http/health-self-report.js +2 -0
- package/dist/http/owner-access.d.ts +264 -20
- package/dist/http/owner-access.js +215 -5
- package/dist/http/readiness.d.ts +4 -2
- package/dist/http/resume-ctx-read.js +38 -1
- package/dist/http/resume-legs.d.ts +2 -1
- package/dist/http/resume-legs.js +273 -89
- package/dist/http/route-ctx.d.ts +41 -19
- package/dist/http/route-table.d.ts +1 -1
- package/dist/http/routes/a2a-serve.js +15 -14
- package/dist/http/routes/admin-memory-optout.d.ts +1 -1
- package/dist/http/routes/agents-roster.js +2 -3
- package/dist/http/routes/approvals-assistant.d.ts +3 -2
- package/dist/http/routes/approvals-assistant.js +12 -12
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/capabilities.js +10 -6
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/fleet.js +10 -8
- package/dist/http/routes/mcp-reconnect.js +2 -2
- package/dist/http/routes/memory-origin.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -3
- package/dist/http/routes/projects.d.ts +4 -2
- package/dist/http/routes/projects.js +7 -6
- package/dist/http/routes/retention-ops.d.ts +1 -1
- package/dist/http/routes/run-permission-mode.d.ts +1 -1
- package/dist/http/routes/run-permission-mode.js +2 -2
- package/dist/http/routes/runs.d.ts +1 -1
- package/dist/http/routes/runs.js +125 -66
- package/dist/http/routes/session-memory-sync.js +4 -5
- package/dist/http/routes/session-sync.d.ts +4 -3
- package/dist/http/routes/session-sync.js +174 -83
- package/dist/http/routes/sessions-list.js +13 -7
- package/dist/http/routes/sessions.d.ts +1 -1
- package/dist/http/routes/sessions.js +26 -48
- package/dist/http/routes/tasks.js +38 -23
- package/dist/http/routes/trace-usage.js +14 -14
- package/dist/http/routes/workflows.d.ts +1 -0
- package/dist/http/routes/workflows.js +20 -38
- package/dist/http/server.d.ts +28 -30
- package/dist/http/server.js +7 -3
- package/dist/http/stored-body-replay.d.ts +3 -24
- package/dist/http/stored-body-replay.js +2 -12
- package/dist/http/submit-ctx.d.ts +1 -2
- package/dist/http/submit-ctx.js +8 -6
- package/dist/http/submit-replay.d.ts +15 -2
- package/dist/http/submit-replay.js +10 -4
- package/dist/http/wire-types.d.ts +19 -6
- package/dist/identity-source.d.ts +20 -3
- package/dist/identity-source.js +14 -0
- package/dist/index.d.ts +4 -0
- package/dist/lane-home-probe.d.ts +3 -7
- package/dist/lane-home-probe.js +0 -1
- package/dist/leader/endpoint.js +9 -8
- package/dist/leader/leader.d.ts +2 -1
- package/dist/leg-facts.d.ts +19 -5
- package/dist/leg-facts.js +3 -1
- package/dist/mcp-authorization-face.d.ts +18 -14
- package/dist/mcp-authorization-face.js +3 -2
- package/dist/memory-scope.d.ts +5 -4
- package/dist/memory-scope.js +4 -4
- package/dist/memory-store-refusal.d.ts +1 -1
- package/dist/memory-sync-client.d.ts +30 -2
- package/dist/memory-sync-client.js +16 -9
- package/dist/observability/corrupt-read-seat.d.ts +1 -1
- package/dist/observability/err-text.d.ts +7 -0
- package/dist/observability/err-text.js +5 -0
- package/dist/observability/fail-open.d.ts +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/logger.d.ts +7 -0
- package/dist/observability/logger.js +3 -1
- package/dist/observability/metrics.js +1 -0
- package/dist/observability/run-terminal.d.ts +1 -1
- package/dist/orchestration/workflow-notify-journal.d.ts +18 -1
- package/dist/orchestration/workflow-notify-journal.js +12 -1
- package/dist/orchestration/workflow-park-decision.d.ts +70 -18
- package/dist/orchestration/workflow-park-decision.js +49 -10
- package/dist/orchestration/workflow-park-holder.d.ts +65 -0
- package/dist/orchestration/workflow-park-holder.js +98 -0
- package/dist/orchestration/workflow-record-fence.d.ts +36 -0
- package/dist/orchestration/workflow-record-fence.js +42 -0
- package/dist/owner-faces.d.ts +28 -4
- package/dist/owner-faces.js +2 -0
- package/dist/parked-decide.d.ts +104 -53
- package/dist/parked-decide.js +153 -117
- package/dist/peer-directory.d.ts +2 -2
- package/dist/peer-inbound-face.d.ts +2 -6
- package/dist/peer-inbound-face.js +0 -3
- package/dist/peer-seat.d.ts +1 -1
- package/dist/peer-seat.js +52 -59
- package/dist/permission-mode-admission.d.ts +41 -5
- package/dist/permission-mode-admission.js +29 -3
- package/dist/plugins/adoption-log-sql.d.ts +3 -1
- package/dist/plugins/adoption-log-sql.js +7 -1
- package/dist/plugins/approval-ask-store-file.d.ts +10 -2
- package/dist/plugins/approval-ask-store-file.js +8 -0
- package/dist/plugins/approval-ask-store-memory.d.ts +6 -1
- package/dist/plugins/approval-ask-store-memory.js +28 -9
- package/dist/plugins/approval-ask-store-sql.d.ts +43 -2
- package/dist/plugins/approval-ask-store-sql.js +34 -5
- package/dist/plugins/approval-exemption-store.js +3 -0
- package/dist/plugins/approval-nonce-store.js +2 -0
- package/dist/plugins/breaker-state-sql.js +2 -0
- package/dist/plugins/caching-session-store.d.ts +9 -15
- package/dist/plugins/caching-session-store.js +6 -0
- package/dist/plugins/device-store-sql.js +6 -0
- package/dist/plugins/error-origin.d.ts +18 -0
- package/dist/plugins/error-origin.js +10 -0
- package/dist/plugins/exec-path-law.d.ts +34 -0
- package/dist/plugins/exec-path-law.js +13 -0
- package/dist/plugins/execution-placement-sql.js +6 -6
- package/dist/plugins/file-run-store.js +1 -1
- package/dist/plugins/image-bake-store-sql.js +6 -0
- package/dist/plugins/image-index-sql.js +4 -0
- package/dist/plugins/landed-attendants.d.ts +212 -0
- package/dist/plugins/landed-attendants.js +161 -0
- package/dist/plugins/leader-run-store-sql.js +4 -0
- package/dist/plugins/local-checkpoint-store.d.ts +4 -1
- package/dist/plugins/local-checkpoint-store.js +3 -0
- package/dist/plugins/local-session-live-reference.d.ts +40 -0
- package/dist/plugins/local-session-live-reference.js +39 -0
- package/dist/plugins/local-session-store.d.ts +71 -33
- package/dist/plugins/local-session-store.js +129 -27
- package/dist/plugins/memory-engine-pg.js +4 -0
- package/dist/plugins/memory-engine-sql-apply.js +5 -2
- package/dist/plugins/memory-engine-tidb.js +4 -0
- package/dist/plugins/memory-optout-grant-store-sql.js +4 -0
- package/dist/plugins/memory-run-store.js +1 -1
- package/dist/plugins/memory-sync-store-pg.js +5 -0
- package/dist/plugins/memory-sync-store-tidb.js +5 -0
- package/dist/plugins/one-time-migrations.d.ts +80 -61
- package/dist/plugins/one-time-migrations.js +241 -104
- package/dist/plugins/org-delivery-quota-store.js +4 -1
- package/dist/plugins/outcome-ledger-sql.js +2 -0
- package/dist/plugins/permission-rule-store-sql.js +11 -4
- package/dist/plugins/pg-cost-quota.js +4 -0
- package/dist/plugins/pg-pool.js +28 -1
- package/dist/plugins/pg-rate-limiter.js +2 -0
- package/dist/plugins/posix-shell-fs.d.ts +6 -1
- package/dist/plugins/posix-shell-fs.js +8 -3
- package/dist/plugins/remote-env-adb.d.ts +19 -15
- package/dist/plugins/remote-env-adb.js +44 -17
- package/dist/plugins/remote-env-connect-seat.d.ts +105 -0
- package/dist/plugins/remote-env-connect-seat.js +72 -0
- package/dist/plugins/remote-env-device.d.ts +22 -5
- package/dist/plugins/remote-env-device.js +114 -14
- package/dist/plugins/remote-env-e2b.d.ts +18 -7
- package/dist/plugins/remote-env-e2b.js +53 -40
- package/dist/plugins/remote-env-file-error.js +6 -2
- package/dist/plugins/remote-env-host.d.ts +18 -1
- package/dist/plugins/remote-env-host.js +48 -47
- package/dist/plugins/remote-env-k8s.d.ts +41 -39
- package/dist/plugins/remote-env-k8s.js +56 -32
- package/dist/plugins/remote-env-local-docker.d.ts +13 -8
- package/dist/plugins/remote-env-local-docker.js +37 -43
- package/dist/plugins/remote-env-ssh.d.ts +18 -12
- package/dist/plugins/remote-env-ssh.js +64 -62
- package/dist/plugins/remote-shell.d.ts +101 -2
- package/dist/plugins/remote-shell.js +221 -3
- package/dist/plugins/replica-registration.d.ts +35 -0
- package/dist/plugins/replica-registration.js +48 -0
- package/dist/plugins/resume-anchor-store-sql.d.ts +11 -2
- package/dist/plugins/resume-anchor-store-sql.js +12 -5
- package/dist/plugins/retention-lane-store-sql.d.ts +1 -1
- package/dist/plugins/retention-lane-store-sql.js +4 -0
- package/dist/plugins/retention-sql.d.ts +20 -2
- package/dist/plugins/retention-sql.js +11 -0
- package/dist/plugins/run-store-sql.d.ts +22 -3
- package/dist/plugins/run-store-sql.js +33 -9
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +6 -12
- package/dist/plugins/scenario-prefix-switch-m42.js +7 -5
- package/dist/plugins/schema-consistency.d.ts +9 -5
- package/dist/plugins/schema-consistency.js +48 -18
- package/dist/plugins/schema-drift-sentence.js +1 -1
- package/dist/plugins/send-file-ledger.js +3 -0
- package/dist/plugins/serving-requirement.d.ts +68 -0
- package/dist/plugins/serving-requirement.js +60 -0
- package/dist/plugins/session-birth.d.ts +6 -2
- package/dist/plugins/session-capture-record-store-sql.js +2 -0
- package/dist/plugins/session-ext-table.d.ts +14 -1
- package/dist/plugins/session-ext-table.js +5 -1
- package/dist/plugins/session-row-sql.d.ts +49 -2
- package/dist/plugins/session-row-sql.js +56 -13
- package/dist/plugins/session-store-sql.d.ts +34 -18
- package/dist/plugins/session-store-sql.js +98 -17
- package/dist/plugins/shared-memory-store-sql.d.ts +1 -0
- package/dist/plugins/shared-memory-store-sql.js +6 -2
- package/dist/plugins/sql-driver.d.ts +2 -1
- package/dist/plugins/sql-driver.js +18 -3
- package/dist/plugins/sql-errors.d.ts +11 -6
- package/dist/plugins/sql-errors.js +5 -6
- package/dist/plugins/stop-then-start-sentence.d.ts +48 -3
- package/dist/plugins/stop-then-start-sentence.js +48 -0
- package/dist/plugins/stop-then-start.d.ts +109 -0
- package/dist/plugins/stop-then-start.js +104 -0
- package/dist/plugins/store-backend.d.ts +40 -13
- package/dist/plugins/store-backend.js +169 -27
- package/dist/plugins/store-boundary.d.ts +57 -0
- package/dist/plugins/store-boundary.js +139 -0
- package/dist/plugins/store-contracts.d.ts +29 -2
- package/dist/plugins/store-contracts.js +3 -0
- package/dist/plugins/store-fault-sentence-m53.d.ts +7 -0
- package/dist/plugins/store-fault-sentence-m53.js +25 -0
- package/dist/plugins/store-fault.d.ts +26 -7
- package/dist/plugins/store-fault.js +18 -2
- package/dist/plugins/task-attachment-store.js +9 -0
- package/dist/plugins/task-list-store-sql.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.js +10 -8
- package/dist/plugins/tidb-cost-quota.js +4 -0
- package/dist/plugins/tidb-pool.js +6 -1
- package/dist/plugins/tidb-rate-limiter.js +4 -0
- package/dist/plugins/user-input-ledger-sql.js +4 -0
- package/dist/plugins/workflow-run-store-sql.d.ts +28 -10
- package/dist/plugins/workflow-run-store-sql.js +64 -4
- package/dist/plugins/workspace-fill.d.ts +4 -7
- package/dist/plugins/workspace-fill.js +2 -1
- package/dist/plugins/write-behind-counter.js +5 -0
- package/dist/process-instance.d.ts +3 -0
- package/dist/process-instance.js +7 -0
- package/dist/project-context.d.ts +64 -0
- package/dist/project-context.js +66 -0
- package/dist/project-registry.d.ts +46 -0
- package/dist/project-registry.js +44 -0
- package/dist/question.d.ts +9 -21
- package/dist/question.js +28 -19
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +4 -0
- package/dist/request-value-closure.js +10 -0
- package/dist/run-acceptance.d.ts +3 -2
- package/dist/run-acceptance.js +4 -6
- package/dist/run-cancel-card.d.ts +1 -1
- package/dist/run-cancel-card.js +2 -1
- package/dist/run-local.js +1 -0
- package/dist/runs.d.ts +37 -8
- package/dist/runs.js +53 -12
- package/dist/runtime-governance.d.ts +5 -4
- package/dist/security.d.ts +31 -33
- package/dist/security.js +41 -7
- package/dist/server-secret-env.d.ts +12 -10
- package/dist/server-secret-env.js +24 -15
- package/dist/session-agent.d.ts +1 -10
- package/dist/session-agent.js +0 -6
- package/dist/session-bindings.d.ts +82 -0
- package/dist/session-bindings.js +18 -0
- package/dist/session-children-retire.d.ts +2 -2
- package/dist/session-children-retire.js +2 -6
- package/dist/session-deletion.d.ts +16 -1
- package/dist/session-error-wire.d.ts +3 -3
- package/dist/session-error-wire.js +3 -3
- package/dist/session-incarnation.d.ts +28 -4
- package/dist/session-incarnation.js +14 -2
- package/dist/session-kind.d.ts +57 -0
- package/dist/session-kind.js +22 -0
- package/dist/session-notify-door.d.ts +4 -4
- package/dist/session-notify-door.js +5 -6
- package/dist/session-row.d.ts +21 -1
- package/dist/session-row.js +7 -1
- package/dist/session-rules-seat.d.ts +4 -3
- package/dist/session-rules-seat.js +3 -11
- package/dist/session-sync-kernel.d.ts +24 -14
- package/dist/session-sync-kernel.js +3 -6
- package/dist/session-sync.d.ts +4 -98
- package/dist/session-sync.js +4 -74
- package/dist/session-titler.d.ts +10 -3
- package/dist/session-titler.js +19 -6
- package/dist/ssh-host-key.d.ts +5 -0
- package/dist/ssh-host-key.js +3 -0
- package/dist/stores-sql/checkpoint-store-sql.d.ts +21 -2
- package/dist/stores-sql/checkpoint-store-sql.js +106 -18
- package/dist/stores-sql/file-history-store-sql.d.ts +52 -2
- package/dist/stores-sql/file-history-store-sql.js +108 -70
- package/dist/stores-sql/pg-session-storage.d.ts +34 -7
- package/dist/stores-sql/pg-session-storage.js +37 -13
- package/dist/stores-sql/retention-store-sql.d.ts +2 -10
- package/dist/stores-sql/retention-store-sql.js +2 -10
- package/dist/stores-sql/session-policy-store-sql.d.ts +30 -7
- package/dist/stores-sql/session-policy-store-sql.js +61 -44
- package/dist/stores-sql/session-write-hooks.d.ts +11 -0
- package/dist/stores-sql/tidb-session-store.d.ts +58 -7
- package/dist/stores-sql/tidb-session-store.js +37 -13
- package/dist/submission-exit.d.ts +3 -2
- package/dist/submission-exit.js +9 -1
- package/dist/task-cwd.d.ts +6 -5
- package/dist/task-settings.d.ts +19 -5
- package/dist/task-settings.js +13 -7
- package/dist/terminal.d.ts +33 -2
- package/dist/terminal.js +139 -9
- package/dist/tool-approval.d.ts +147 -12
- package/dist/tool-approval.js +206 -109
- package/dist/trace/engine-notice-wire.d.ts +14 -0
- package/dist/trace/engine-notice-wire.js +18 -1
- package/dist/trace/project.d.ts +4 -3
- package/dist/trace/project.js +3 -2
- package/dist/trace/projection-table.d.ts +33 -2
- package/dist/trace/self-minted-wire.d.ts +422 -26
- package/dist/trace/self-minted-wire.js +149 -23
- package/dist/trace/tool-card.d.ts +3 -0
- package/dist/trace/tool-card.js +24 -0
- package/dist/trace/tool-output-media.d.ts +2 -1
- package/dist/unattended-permission-mode.d.ts +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/skills-mcp.d.ts +1 -1
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +120 -41
- package/package.json +3 -3
- package/wire-changes/server@7.150.0.json +335 -0
- package/wire-changes/server@7.151.0.json +762 -0
- package/dist/http/session-inherit-env.d.ts +0 -36
- package/dist/http/session-inherit-env.js +0 -6
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
* 读不了家目录的车道(device:设备协议没有读数)不持座 —— 声明就是座,起服披露「来自声明、未实测」(`execution-lane-caps.ts` `buildLaneHomeBootNote`)。
|
|
24
24
|
* 规则基与 422 门在下单那一刻就要家目录,而那一刻执行环境还没开 —— 它们只读主张(`executionLaneHomeDir`);环境开起来时主张被证,证不了的环境不开。
|
|
25
25
|
*/
|
|
26
|
+
import type { ExecutionEnvRefusalCode } from "./execution-env-refusal.js";
|
|
26
27
|
/** 探针答案的行首标记:登录脚本 / profile 往 stdout 打的横幅不会被读成家目录 —— 只认带这个标记的那一行(恰一条,见 `markedHome`)。 */
|
|
27
28
|
export declare const LANE_HOME_PROBE_MARKER = "sema-lane-home=";
|
|
28
29
|
/**
|
|
@@ -72,14 +73,9 @@ export type LanePathFlavor = "posix" | "win32";
|
|
|
72
73
|
*/
|
|
73
74
|
export declare function judgeLaneHome(lane: string, claim: LaneHomeClaim, probe: LaneHomeProbe, paths?: LanePathFlavor): LaneHomeVerdict;
|
|
74
75
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* · `env.home_unconfirmed` —— 家目录主张证不了({@link judgeLaneHome} 的三形拒句:读不出 / 不是绝对路径 / 与实测不一致)。三形一个码:出路都在部署
|
|
78
|
-
* (声明、环境里的 `HOME`,或会话 `settings.env` 里的 `HOME`),消费端不按形分岔;是哪一形、怎么改,句子里说。
|
|
76
|
+
* 家目录拒的带码错误:句 = 判官的拒句原文,码 = `env.home_unconfirmed`(本仓 `env.*` 族的一员,闭集属主 `execution-env-refusal.ts`)。读数在铸环境时就到手的车道(host)
|
|
77
|
+
* 构造时抛它,工厂原样抛出;读数要环境起来才有的车道在建连时以同一码答(建连座的拒因表 `home_unconfirmed`)。
|
|
79
78
|
*/
|
|
80
|
-
export declare const EXECUTION_ENV_REFUSAL_CODES: readonly ["env.home_unconfirmed"];
|
|
81
|
-
export type ExecutionEnvRefusalCode = (typeof EXECUTION_ENV_REFUSAL_CODES)[number];
|
|
82
|
-
/** 家目录拒的带码错误:句 = 判官的拒句原文,码 = `env.home_unconfirmed`。读数在铸环境时就到手的车道(host)构造时抛它,工厂原样抛出。 */
|
|
83
79
|
export declare function laneHomeRefusal(verdict: NonNullable<LaneHomeVerdict>): Error & {
|
|
84
80
|
readonly code: Extract<ExecutionEnvRefusalCode, "env.home_unconfirmed">;
|
|
85
81
|
};
|
package/dist/lane-home-probe.js
CHANGED
|
@@ -61,7 +61,6 @@ export function judgeLaneHome(lane, claim, probe, paths = "posix") {
|
|
|
61
61
|
answered: true,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
export const EXECUTION_ENV_REFUSAL_CODES = ["env.home_unconfirmed"];
|
|
65
64
|
export function laneHomeRefusal(verdict) {
|
|
66
65
|
return Object.assign(new Error(verdict.refusal), { code: "env.home_unconfirmed" });
|
|
67
66
|
}
|
package/dist/leader/endpoint.js
CHANGED
|
@@ -6,6 +6,7 @@ import { idemKeyOf } from "../http/idempotency.js";
|
|
|
6
6
|
import { refusalBody } from "../http/refusal-body.js";
|
|
7
7
|
import { LIVENESS_HEARTBEAT_MS } from "../config-invariants.js";
|
|
8
8
|
import { seatText } from "../trace/exit-seat.js";
|
|
9
|
+
import { readVisibleLeaderRow } from "../http/owner-access.js";
|
|
9
10
|
function statusForLeaderResult(result) {
|
|
10
11
|
if (result.conflict)
|
|
11
12
|
return "needs_human";
|
|
@@ -62,7 +63,7 @@ export function createLeaderEndpoint(runLeader, opts) {
|
|
|
62
63
|
? setInterval(() => {
|
|
63
64
|
if (ac.signal.aborted)
|
|
64
65
|
return;
|
|
65
|
-
void
|
|
66
|
+
void readDrivenRow(id).then((row) => {
|
|
66
67
|
if (row === undefined || row.status !== "running")
|
|
67
68
|
abortLocal(id, "stall_verdict");
|
|
68
69
|
else if (row.cancelRequested)
|
|
@@ -139,13 +140,13 @@ export function createLeaderEndpoint(runLeader, opts) {
|
|
|
139
140
|
}
|
|
140
141
|
})();
|
|
141
142
|
}
|
|
142
|
-
function
|
|
143
|
+
function readDrivenRow(id) {
|
|
143
144
|
return opts.store.getRun(id);
|
|
144
145
|
}
|
|
145
146
|
const opErr = (e) => seatText("operator-log-error", e instanceof Error ? e.message : String(e));
|
|
146
147
|
async function cancelFlagAfterSettle(id) {
|
|
147
148
|
try {
|
|
148
|
-
return (await
|
|
149
|
+
return (await readDrivenRow(id))?.cancelRequested === true;
|
|
149
150
|
}
|
|
150
151
|
catch (e) {
|
|
151
152
|
opts.logger?.error?.("leader_cancel_flag_reread_failed", { id, err: opErr(e), effect: "if a cancel landed on this run just before its terminal write, its worker parks are expired only when the cancel is re-sent" });
|
|
@@ -305,8 +306,8 @@ export function createLeaderEndpoint(runLeader, opts) {
|
|
|
305
306
|
if (m) {
|
|
306
307
|
const id = m[1];
|
|
307
308
|
if (opts.store) {
|
|
308
|
-
const run = await
|
|
309
|
-
if (!run
|
|
309
|
+
const run = await readVisibleLeaderRow(opts.store, id, ownerOk);
|
|
310
|
+
if (!run)
|
|
310
311
|
return NOT_FOUND;
|
|
311
312
|
return getBody(run);
|
|
312
313
|
}
|
|
@@ -327,15 +328,15 @@ export function createLeaderEndpoint(runLeader, opts) {
|
|
|
327
328
|
}
|
|
328
329
|
async function cancel(id, ownerOk) {
|
|
329
330
|
if (opts.store) {
|
|
330
|
-
const row = await
|
|
331
|
-
if (!row
|
|
331
|
+
const row = await readVisibleLeaderRow(opts.store, id, ownerOk);
|
|
332
|
+
if (!row)
|
|
332
333
|
return NOT_FOUND;
|
|
333
334
|
if (row.status === "running") {
|
|
334
335
|
if (await opts.store.requestCancel(id)) {
|
|
335
336
|
abortLocal(id, "cancel_verb");
|
|
336
337
|
return { status: 202, body: { leaderRunId: id, status: "cancelling", cancelRequested: true } };
|
|
337
338
|
}
|
|
338
|
-
const now = await
|
|
339
|
+
const now = await readVisibleLeaderRow(opts.store, id, ownerOk);
|
|
339
340
|
if (!now)
|
|
340
341
|
return NOT_FOUND;
|
|
341
342
|
return answerTerminal(id, now);
|
package/dist/leader/leader.d.ts
CHANGED
|
@@ -70,7 +70,8 @@ export interface ProvisionedWorker {
|
|
|
70
70
|
* (`runtime-governance.ts` `entryPermissionMode`)得出的入口词(`run-entry.ts` `leaderRunEntry`);地板缺席 ⇒ `{}`。leader 请求不带调用方的模式词,所以入口词就是地板本身(与 run-local 同)。
|
|
71
71
|
* 本 run 铸的每一条 spec 经 {@link withLeaderLeg} 从这一份取词;worker 的续跑体由它展开(`{ ...entry, objective }`)⇒ 首跑、续跑、修复腿同一个词。
|
|
72
72
|
* 入口词是 `plan` 的 run 进不了这条车道(`run-entry.ts` `leaderEntryRefusal`:worker 会话没有计划审阅通道)—— 受理口与出生处同判,到不了 worker。
|
|
73
|
-
* 热改 `AUTONOMY` 只影响之后起的 leader run:在飞的 run
|
|
73
|
+
* 热改 `AUTONOMY` 只影响之后起的 leader run:在飞的 run(含它后来 provision 的 worker,与经 HTTP 续跑腿赎回的停驻 worker —— 续跑口对带无人值守标的行照写下的体重放,
|
|
74
|
+
* `http/resume-legs.ts` `replayCtxOf`)保持它出生时盖下的这一份。
|
|
74
75
|
*/
|
|
75
76
|
export interface LeaderRunEntry {
|
|
76
77
|
readonly permissionMode?: PermissionMode;
|
package/dist/leg-facts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 一条腿的**部署事实**(执行车道 · run 技能名册 · 受理见证 ·
|
|
2
|
+
* 一条腿的**部署事实**(执行车道 · run 技能名册 · 受理见证 · 会话绑定 · 继承的项目上下文 · 登记簿默认读层的种子项目)—— server 自有的载体,**不搭引擎 spec 的车**。
|
|
3
3
|
*
|
|
4
|
-
* 规则:`TaskSpec` 是引擎的类型面,上面只放引擎读的成员。本仓装配器(`boot/resolve-spec.ts` 的 `createResolveSpec`)
|
|
4
|
+
* 规则:`TaskSpec` 是引擎的类型面,上面只放引擎读的成员。本仓装配器(`boot/resolve-spec.ts` 的 `createResolveSpec`)同时还判出六件
|
|
5
5
|
* 只有 server 自己读的事实 —— 它们以装配器**自己的输出对象**为键登记在这一张表里(单一铸点 {@link mintLegFacts}),由两只漏斗
|
|
6
6
|
* (受理 `http/admission.ts` 的 `prepareSpec` · 续跑 `http/resume-legs.ts` 的 `resolveResumeSpec`)在拿到装配输出的**同一只对象**时
|
|
7
7
|
* 读一次(唯一读口 {@link legFactsOf},读在 `stampSpecRoot` 复制之前),此后作普通值随 `PreparedTaskSubmission.legFacts` /
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
import type { ScenarioHands } from "./capabilities/hands-lane.js";
|
|
19
19
|
import type { RunSkillEntry } from "./capabilities/skills.js";
|
|
20
20
|
import type { DelegationRootWitness } from "./delegated-session-owner.js";
|
|
21
|
+
import type { ProjectContext } from "./project-context.js";
|
|
22
|
+
import type { MemorySeed } from "./project-registry.js";
|
|
23
|
+
import type { SessionBindings } from "./session-bindings.js";
|
|
21
24
|
/** 一条腿的部署事实(冻结记录)。 */
|
|
22
25
|
export interface LegFacts {
|
|
23
26
|
/** 执行车道:`none` ⇒ 无手孪生 Runner。读者 = 生产选路器。 */
|
|
@@ -27,10 +30,21 @@ export interface LegFacts {
|
|
|
27
30
|
/** 受理时读根会话行的那一读(会话 id + 住客)。读者 = 腿的会话行记录座(`session-workspace.ts`)。 */
|
|
28
31
|
readonly sessionWitness: DelegationRootWitness;
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
33
|
+
* 这条腿要写在根会话上的绑定(工作目录 · shell 环境 · 继承策略;装配器只算)。读者 = run 认领之后的唯一提交点(`session-bindings.ts` 的 `commitLegBindings`):
|
|
34
|
+
* 受理的那一刻写这一笔,写了之后才收场 `refused` 的提交由提交出口按回执撤回;以及三只组合入口(同步 / 后台 / 续跑腿的梯子与验证门):工作目录那一格
|
|
35
|
+
* (这条腿跑在的那一枚)经 `compositionLegRoot`(`task-cwd.ts`)交给它们驱动的每一条腿当交活方的工作目录。
|
|
32
36
|
*/
|
|
33
|
-
readonly
|
|
37
|
+
readonly sessionBindings: SessionBindings;
|
|
38
|
+
/**
|
|
39
|
+
* 这条 run 继承到的项目上下文(`project-context.ts`):新提交腿在装配器头部判出的那一份,续跑腿是从续跑重建输入重放的那一份。缺席 = 没继承。
|
|
40
|
+
* 读者 = 提交腿写续跑重建输入的那一笔(`submit-ctx.ts` `persistSubmissionCtx` → `CheckpointCtx.projectContext`):判一次、随 run 冻结。
|
|
41
|
+
*/
|
|
42
|
+
readonly projectContext?: ProjectContext;
|
|
43
|
+
/**
|
|
44
|
+
* 这条 run 的登记簿默认读层种子(`project-registry.ts`:种子项目 + 判出它的那一位观者;`null` = 提交带了项目、判过,无):新提交腿判出的,续跑腿是从续跑重建输入重放的那一份。
|
|
45
|
+
* 缺席 = 没什么可判(提交没带项目)或没判过(续跑重放的行早于种子判)。读者 = 提交腿写续跑重建输入的那一笔(`submit-ctx.ts` `persistSubmissionCtx` → `CheckpointCtx.memorySeed`):判一次、随 run 冻结。
|
|
46
|
+
*/
|
|
47
|
+
readonly memorySeed?: MemorySeed | null;
|
|
34
48
|
}
|
|
35
49
|
/**
|
|
36
50
|
* 铸事实(**单一属主**:只允许 `createResolveSpec` 的出口调用)。同一只对象被第二次铸 ⇒ 当场抛 —— 两个写者是漂移的成因,
|
package/dist/leg-facts.js
CHANGED
|
@@ -6,7 +6,9 @@ export function mintLegFacts(resolved, facts) {
|
|
|
6
6
|
hands: facts.hands,
|
|
7
7
|
skills: Object.freeze(facts.skills.map((e) => Object.freeze({ ...e }))),
|
|
8
8
|
sessionWitness: Object.freeze({ ...facts.sessionWitness }),
|
|
9
|
-
...(facts.
|
|
9
|
+
sessionBindings: Object.freeze({ ...facts.sessionBindings, ...(facts.sessionBindings.shellEnv !== undefined ? { shellEnv: Object.freeze({ ...facts.sessionBindings.shellEnv }) } : {}) }),
|
|
10
|
+
...(facts.projectContext !== undefined ? { projectContext: Object.freeze({ ...facts.projectContext }) } : {}),
|
|
11
|
+
...(facts.memorySeed !== undefined ? { memorySeed: facts.memorySeed === null ? null : Object.freeze({ projectId: facts.memorySeed.projectId, viewer: Object.freeze({ ...facts.memorySeed.viewer }) }) } : {}),
|
|
10
12
|
}));
|
|
11
13
|
return resolved;
|
|
12
14
|
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP
|
|
3
|
-
*
|
|
2
|
+
* MCP 授权记录(core 7.59.0 `McpAuthorization`:`{ reason, authorizeUrl?, resourceMetadataUrl? }`,与 `errorCode: "unauthorized"` 同在)的**出门投影** ——
|
|
3
|
+
* 一条记录无论坐在哪个投影载体里,离开本服务只经这一张处置表、这一只投影。五个投影点同读它:状态行投影(`wiring_manifest.mcp[]` 行;账本帧、面板的
|
|
4
|
+
* `lastLegMcp.mcp[]`、能力面两口读的都是它的产物)、重拨回执的 `status`、会话 MCP 面板的 `servers[]`、通告 `mcp.authorization_required` 的 `detail`
|
|
5
|
+
* (登记 `NOTICE_DETAIL_RECORDS`,`trace/engine-notice-wire.ts`)、会话历史读面里工具结果卡的 `details.authorization`(登记 `TOOL_CARD_RECORDS`,`trace/tool-card.ts`)。
|
|
6
|
+
* (工具卡的读者 `trace/tool-card.ts` 是后者的那一只:活面 `tool_end.structured` 上挂着授权记录的自注册卡同读。)记录成员是**结构位**:只经本表出门,
|
|
7
|
+
* 不过自由文本的脱敏、深扫与截断。会话同步拉取口不是投影:它把存档逐字复制给属主,存档里带不带远端的地址由引擎的写入决定。
|
|
4
8
|
*
|
|
5
|
-
*
|
|
6
|
-
* 判据直读引擎的 `MCP_AUTHORIZATION_REASONS`(不抄词表);词出闭集、非串、整只不是对象 ⇒
|
|
7
|
-
*
|
|
8
|
-
* (
|
|
9
|
+
* `reason` 是闭集词(`rejected` = 端点答 401 且对端座的重问没给出能过的凭据 / `scope` = 403 `insufficient_scope` / `none` = 对端座答「未授权」):
|
|
10
|
+
* 判据直读引擎的 `MCP_AUTHORIZATION_REASONS`(不抄词表);词出闭集、非串、整只不是对象 ⇒ 整条记录缺席(最弱断言,不铸词)。
|
|
11
|
+
* 两只地址今天不出门:`authorizeUrl` 只来自对端座 —— 座在,但今天没有会答需授权的凭据来源(地址的唯一入口与它的判法随那一臂立);
|
|
12
|
+
* `resourceMetadataUrl` 是远端在挑战头里自报的地址(终态 `strip`:没有消费方需要它 —— 客户端不跑授权发现;摆在「去授权」旁边的远端地址是钓鱼面)。
|
|
9
13
|
*/
|
|
10
|
-
import { type McpAuthorizationReason } from "@sema-agent/core";
|
|
11
|
-
|
|
14
|
+
import { type McpAuthorization, type McpAuthorizationReason } from "@sema-agent/core";
|
|
15
|
+
import { type FaceOf } from "./trace/projection-table.js";
|
|
16
|
+
/** 授权记录的处置表(五个投影点同读;`core-keyset-guard.ts` 读表 —— 门与投影一个写者):`reason` 认得才出门(闭集词;在场而认不得 ⇒ 丢并计一次),两只地址不出门。 */
|
|
12
17
|
export declare const MCP_AUTHORIZATION_DISPOSITIONS: {
|
|
13
18
|
readonly reason: {
|
|
14
19
|
readonly forward: (w: unknown) => w is McpAuthorizationReason;
|
|
@@ -16,12 +21,11 @@ export declare const MCP_AUTHORIZATION_DISPOSITIONS: {
|
|
|
16
21
|
readonly authorizeUrl: "strip";
|
|
17
22
|
readonly resourceMetadataUrl: "strip";
|
|
18
23
|
};
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
24
|
+
/** 记录的成员名 = 表的键(冻结拷贝;成员集只有表一处写)。平铺载体(通告 `detail`)按它认哪几位是这条记录。 */
|
|
25
|
+
export declare const MCP_AUTHORIZATION_MEMBERS: readonly string[];
|
|
26
|
+
type TableFace = FaceOf<McpAuthorization, typeof MCP_AUTHORIZATION_DISPOSITIONS>;
|
|
27
|
+
/** 本投影的产物 = 表的出门型({@link FaceOf}:表翻一格,型随之变);记录级规则「`reason` 在 ⇔ 记录在」在出口上,所以 `reason` 必在。 */
|
|
28
|
+
export type McpAuthorizationFace = TableFace & Required<Pick<TableFace, "reason">>;
|
|
25
29
|
export declare function projectMcpAuthorization(v: unknown): McpAuthorizationFace | undefined;
|
|
26
30
|
export {};
|
|
27
31
|
//# sourceMappingURL=mcp-authorization-face.d.ts.map
|
|
@@ -6,10 +6,11 @@ export const MCP_AUTHORIZATION_DISPOSITIONS = {
|
|
|
6
6
|
authorizeUrl: "strip",
|
|
7
7
|
resourceMetadataUrl: "strip",
|
|
8
8
|
};
|
|
9
|
+
export const MCP_AUTHORIZATION_MEMBERS = Object.freeze(Object.keys(MCP_AUTHORIZATION_DISPOSITIONS));
|
|
9
10
|
export function projectMcpAuthorization(v) {
|
|
10
11
|
if (typeof v !== "object" || v === null || Array.isArray(v))
|
|
11
12
|
return undefined;
|
|
12
|
-
const
|
|
13
|
-
return reason
|
|
13
|
+
const face = projectByTable("mcp.authorization", MCP_AUTHORIZATION_DISPOSITIONS, v, undefined);
|
|
14
|
+
return face.reason === undefined ? undefined : { ...face, reason: face.reason };
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=mcp-authorization-face.js.map
|
package/dist/memory-scope.d.ts
CHANGED
|
@@ -175,8 +175,8 @@ export declare function memoryEngineRootFor(config: Pick<ServiceConfig, "memoryE
|
|
|
175
175
|
* 记忆搬到 `<localDataRoot>/memory-work`,存量记忆与控制面升级后隐形)。 */
|
|
176
176
|
export declare function fileMemoryEngineRoot(config: Pick<ServiceConfig, "memoryEngineDir">, fallbackRoot?: string): string;
|
|
177
177
|
/**
|
|
178
|
-
* 一条路径的**规范形**(给 {@link judgeMemoryRootOutsideDataRoot} 的 `canonical`
|
|
179
|
-
* · 既存的绝对路径 ⇒ **原样**交给 `realpath`(
|
|
178
|
+
* 一条路径的**规范形**(给 {@link judgeMemoryRootOutsideDataRoot} 的 `canonical` 座用的生产实现;host 车道的工作区托管判也读它):
|
|
179
|
+
* · 既存的绝对路径 ⇒ **原样**交给 `realpath`(core `physicalPathOf` = realpath(3):大小写不敏感的文件系统上返回盘上的拼写;符号链接、macOS 的 `/var` → `/private/var` 在这一步展平)。
|
|
180
180
|
* 不先在字串上折 `..`:操作系统在展开符号链接**之后**才折 `..`,`/link/..` 的真身是链接目标的父目录,字串折叠会把它读成 `/`;
|
|
181
181
|
* · 其余(尚不存在 / 相对)⇒ 绝对化(**不折叠**)后逐段走:既存的前缀每进一段取一次 `realpath`(符号链接在这一步展开),`..` 折在**已展开**的前缀上 ——
|
|
182
182
|
* 与操作系统同序(`/别名/../新目录` 的真身在链接目标的父目录下;先在字串上折会读成别名的父目录,判到另一只挂载上);第一段不存在起,余下是尚不存在的尾巴
|
|
@@ -194,8 +194,9 @@ export declare function canonicalPathOf(p: string): string;
|
|
|
194
194
|
/**
|
|
195
195
|
* **路径包含**(含相等)的判官:`child` 是不是 `root` 本身或它的后代 —— `path.relative(canonical(root), canonical(child))` 不是 `..`、不以 `..` 加分隔符起头、也不是绝对路径(跨盘符)。
|
|
196
196
|
* `..` 要按**整段**判:名为 `..data` 的子目录在其下;`startsWith("..")` 会把它读成在其外。`canonical` 座缺省 `path.resolve`(字串规范形),boot 递 {@link canonicalPathOf} 取符号链接展平后的形;
|
|
197
|
-
* 两侧同一只座(先 root、后 child)
|
|
198
|
-
*
|
|
197
|
+
* 两侧同一只座(先 root、后 child)。读者三处:记忆根「在数据根之外」那一判({@link judgeMemoryRootOutsideDataRoot})、起服时「配置根是不是工作区的祖先」那一判(`sema-config-dir.ts`)
|
|
198
|
+
* 与 host 车道工厂「腿的目录落在哪只本服务铸的临时根里」那一判(`plugins/remote-env-host.ts`,座 = {@link canonicalPathOf});
|
|
199
|
+
* 树里别处内联的同形表达式(`boot/deployment-mods.ts` · `plugins/local-data-dir-modes-m39.ts` · `plugins/remote-env-host.ts` 的残余镜像写判 · `plugins/worktree-isolation.ts`)不在本次收口范围。
|
|
199
200
|
*/
|
|
200
201
|
export declare function pathIsWithin(root: string, child: string, canonical?: (p: string) => string): boolean;
|
|
201
202
|
/** {@link judgeMemoryRootOutsideDataRoot} 的读数:记忆引擎的根落在本机数据根**之外**。三键即 boot 日志行的字段(`hint` 是一句带两条真路径的人话)。 */
|
package/dist/memory-scope.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
2
|
import { dirname, isAbsolute, join, parse, relative, resolve, sep } from "node:path";
|
|
3
|
-
import { FileMemoryEngineBackend, readMemoryLedgerForm, resolveMemoryEngineRoot, deriveControlPlaneDir, formatUserScope, formatProjScope, normalizeMemorySpec } from "@sema-agent/core";
|
|
3
|
+
import { FileMemoryEngineBackend, physicalPathOf, readMemoryLedgerForm, resolveMemoryEngineRoot, deriveControlPlaneDir, formatUserScope, formatProjScope, normalizeMemorySpec } from "@sema-agent/core";
|
|
4
4
|
import { capabilitiesFor, executionLaneOf } from "./execution-lane-caps.js";
|
|
5
5
|
import { errorCodeOf, errorKindOf } from "./observability/err-text.js";
|
|
6
6
|
import { assertMemoryScopeWidth } from "./plugins/memory-key-guards.js";
|
|
@@ -113,7 +113,7 @@ export function fileMemoryEngineRoot(config, fallbackRoot) {
|
|
|
113
113
|
}
|
|
114
114
|
export function canonicalPathOf(p) {
|
|
115
115
|
if (isAbsolute(p) && existsSync(p))
|
|
116
|
-
return
|
|
116
|
+
return physicalPathOf(p);
|
|
117
117
|
const abs = isAbsolute(p) ? p : `${process.cwd()}${sep}${p}`;
|
|
118
118
|
const { root } = parse(abs);
|
|
119
119
|
let existing = root;
|
|
@@ -134,7 +134,7 @@ export function canonicalPathOf(p) {
|
|
|
134
134
|
}
|
|
135
135
|
const next = join(existing, seg);
|
|
136
136
|
if (existsSync(next))
|
|
137
|
-
existing =
|
|
137
|
+
existing = physicalPathOf(next);
|
|
138
138
|
else
|
|
139
139
|
tail.push(seg);
|
|
140
140
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* 找码;这一半候 core 的结构化码位(登记在案,codex 一审 C3)。
|
|
31
31
|
*
|
|
32
32
|
* ## 不是这一族的形(core 同表「different surface」,本仓**不**自拼码,如实走各自既有臂;今两形 + 一只已退的形)
|
|
33
|
-
* · journal 重放目标目录成链 ⇒ `ControlPlaneCorruptError`(无 `.code`,
|
|
33
|
+
* · journal 重放目标目录成链 ⇒ `ControlPlaneCorruptError`(无 `.code`,[ref])⇒ 路由 typed 500 `internal.memory_control_plane_corrupt`
|
|
34
34
|
* (core 7.44.0 起 scope home 非目录**不再**走这一类 —— 它有了自己的码,见上;`ControlPlaneCorruptError` 只剩真控制面损坏);
|
|
35
35
|
* · (已不存在的一形)引擎原地写撞硬链(nlink>1):≤ 引擎 7.55.x 是无码文本 `has N names (a hard link) … not written`、走该写点既有的失败车道;
|
|
36
36
|
* 引擎 7.56.0 起那只写给**这个名字**另建一个新文件(原子改名落位,其余名字保留原文件),拒绝与那句文本一并消失 —— 本仓从未读过那句文本,零码;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type memorySyncReportOf, type MemorySyncTransport } from "@sema-agent/core";
|
|
1
|
+
import { type memorySyncReportOf, type MemorySyncLayerReport, type MemorySyncTransport } from "@sema-agent/core";
|
|
2
2
|
import type { ServiceConfig } from "./config-types.js";
|
|
3
3
|
import type { MemoryScopeStores } from "./memory-scope-stores.js";
|
|
4
4
|
import { type OneTimeMigrationWindow } from "./plugins/one-time-migrations.js";
|
|
@@ -48,10 +48,37 @@ export declare function memorySyncCursorDirFor(memoryEngineDir: string): string;
|
|
|
48
48
|
* 加一个词 ⇒ {@link wayOutSentence} 的穷尽 switch 编译红(句子先写好,词才上得了 wire)。
|
|
49
49
|
*/
|
|
50
50
|
export type MemorySyncWayOut = "delete_cursor";
|
|
51
|
-
/**
|
|
51
|
+
/** 引擎游标拒的 `detail`(轴 + 游标在那一轴上是缺席还是别的值);型取自引擎的同步报告,本仓不另写一份。 */
|
|
52
|
+
type CursorRefusalDetail = NonNullable<Extract<MemorySyncLayerReport, {
|
|
53
|
+
readonly outcome: "refused";
|
|
54
|
+
}>["detail"]>;
|
|
55
|
+
/** 一层为什么停驻(铸记录的输入):`kind` 与引擎读数经记录上 wire,`why` 句只进运维行的 `note`(不在记录里)。 */
|
|
56
|
+
type ParkCause = {
|
|
57
|
+
readonly kind: "cursor_refused";
|
|
58
|
+
readonly detail: CursorRefusalDetail | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: "cursor_unusable";
|
|
61
|
+
readonly why: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* ⑦ 停驻成因的闭集(词 = {@link ParkCause} 的 `kind`):`cursor_refused` = 同步引擎在游标上拒了这一层(轴与读数见 `axis` / `found`);`cursor_unusable` = 游标文件读不成游标。
|
|
65
|
+
* 与运维行的 `reason`(本轮的触发原因)是两回事 —— 本词答「为什么停」,不答「哪一轮撞上它」。
|
|
66
|
+
*/
|
|
67
|
+
export type MemorySyncParkCause = ParkCause["kind"];
|
|
68
|
+
/** 引擎游标拒读数的两个闭集(型取自引擎的同步报告,本仓不另写一份):被拒的是哪一轴;游标在那一轴上是缺席(`absent`)还是绑着别的值(`other`)。 */
|
|
69
|
+
export type MemorySyncCursorAxis = CursorRefusalDetail["axis"];
|
|
70
|
+
export type MemorySyncCursorFound = CursorRefusalDetail["found"];
|
|
71
|
+
/**
|
|
72
|
+
* ⑦ 一层停驻的记录(读面与运维行同读这一只;**整条**就是 `memory-status.memorySync.parked[]` 的条目,所以它不带盘路径 —— 路径只进运维行)。
|
|
73
|
+
* 在场律:`cause` 恒在;`axis` / `found` ⇔ 成因是 `cursor_refused` 且引擎的读数在闭集内(别的成因、读数不在闭集 ⇒ 两键缺席,不是 `undefined` 值)。
|
|
74
|
+
* 加一个键 ⇒ 它就上 wire:自铸登记表的键集(`memorySyncParkedKey`)按本型 `satisfies`,漏登是编译红。唯一铸点 = {@link parkedLayerOf}。
|
|
75
|
+
*/
|
|
52
76
|
export interface MemorySyncParkedLayer {
|
|
53
77
|
readonly scope: string;
|
|
54
78
|
readonly wayOut: MemorySyncWayOut;
|
|
79
|
+
readonly cause: MemorySyncParkCause;
|
|
80
|
+
readonly axis?: MemorySyncCursorAxis;
|
|
81
|
+
readonly found?: MemorySyncCursorFound;
|
|
55
82
|
}
|
|
56
83
|
/** M31 一次的读数(测试按它断言)。`window: "closed"` ⇒ 一行都没读。 */
|
|
57
84
|
export interface SyncCursorRelocationM31Report {
|
|
@@ -134,4 +161,5 @@ export declare function startMemorySyncRunner(deps: {
|
|
|
134
161
|
stores: MemoryScopeStores;
|
|
135
162
|
log: MemorySyncLog;
|
|
136
163
|
}): MemorySyncRunner;
|
|
164
|
+
export {};
|
|
137
165
|
//# sourceMappingURL=memory-sync-client.d.ts.map
|
|
@@ -55,6 +55,18 @@ export function memorySyncCursorDirFor(memoryEngineDir) {
|
|
|
55
55
|
}
|
|
56
56
|
const CURSOR_AXES = { scope: true, peer: true, store: true, incarnation: true };
|
|
57
57
|
const CURSOR_FOUND = { absent: true, other: true };
|
|
58
|
+
function parkedLayerOf(scope, cause, wayOut) {
|
|
59
|
+
switch (cause.kind) {
|
|
60
|
+
case "cursor_refused":
|
|
61
|
+
return Object.freeze({ scope, wayOut, cause: cause.kind, ...(cause.detail !== undefined ? { axis: cause.detail.axis, found: cause.detail.found } : {}) });
|
|
62
|
+
case "cursor_unusable":
|
|
63
|
+
return Object.freeze({ scope, wayOut, cause: cause.kind });
|
|
64
|
+
default: {
|
|
65
|
+
const unhandled = cause;
|
|
66
|
+
throw new Error(`memory sync: unknown park cause ${JSON.stringify(unhandled)}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
58
70
|
function wayOutSentence(wayOut, cursorPath) {
|
|
59
71
|
switch (wayOut) {
|
|
60
72
|
case "delete_cursor":
|
|
@@ -81,16 +93,12 @@ function parkCauseSentence(cause) {
|
|
|
81
93
|
}
|
|
82
94
|
}
|
|
83
95
|
class MemorySyncLayerParked extends Error {
|
|
84
|
-
scope;
|
|
85
96
|
cursorPath;
|
|
86
|
-
|
|
87
|
-
wayOut;
|
|
97
|
+
layer;
|
|
88
98
|
constructor(scope, cursorPath, parkCause, wayOut = "delete_cursor") {
|
|
89
99
|
super(`memory sync: layer ${JSON.stringify(scope)} parked — ${parkCauseSentence(parkCause)}; ${wayOutSentence(wayOut, cursorPath)}`);
|
|
90
|
-
this.scope = scope;
|
|
91
100
|
this.cursorPath = cursorPath;
|
|
92
|
-
this.
|
|
93
|
-
this.wayOut = wayOut;
|
|
101
|
+
this.layer = parkedLayerOf(scope, parkCause, wayOut);
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
function cursorRefusalOf(err) {
|
|
@@ -354,8 +362,7 @@ export function createMemorySyncRunner(opts) {
|
|
|
354
362
|
let parkedLayers = [];
|
|
355
363
|
const logLayerFailure = (reason, scope, err) => {
|
|
356
364
|
if (err instanceof MemorySyncLayerParked) {
|
|
357
|
-
|
|
358
|
-
opts.log.warn("memory_sync_layer_parked", { reason, scope, cursorPath: err.cursorPath, ...(refused !== undefined ? { axis: refused.axis, found: refused.found } : {}), wayOut: err.wayOut, note: err.message });
|
|
365
|
+
opts.log.warn("memory_sync_layer_parked", { reason, cursorPath: err.cursorPath, ...err.layer, note: err.message });
|
|
359
366
|
}
|
|
360
367
|
else {
|
|
361
368
|
opts.log.warn("memory_sync_layer_failed", { reason, scope, cursorPath: memorySyncCursorPath(memoryEngineDir, scope), err: errorText(err) });
|
|
@@ -386,7 +393,7 @@ export function createMemorySyncRunner(opts) {
|
|
|
386
393
|
catch (err) {
|
|
387
394
|
calls.push({ scope, thrown: err });
|
|
388
395
|
if (err instanceof MemorySyncLayerParked)
|
|
389
|
-
parkedNow.push(
|
|
396
|
+
parkedNow.push(err.layer);
|
|
390
397
|
logLayerFailure(reason, scope, err);
|
|
391
398
|
}
|
|
392
399
|
}
|
|
@@ -41,7 +41,7 @@ export declare function createCorruptReadFailOpenSeat(tag: FailOpenTag, leg?: (i
|
|
|
41
41
|
* 这一座里有安全轴的脸(session-policy),所以每命中一行 warn 保留(降成「每进程一次」是降级,[ref] 的裁定);**在此之上**,认出的脸另记账:
|
|
42
42
|
* · session-policy 脸 ⇒ R 类 tag(`server.session-policy.corrupt-read-fail-open`)—— 计数逐次 + 探针行 + 一次性 warn。core 7.39.2 起按键读拒;
|
|
43
43
|
* core 7.41.0 [ref] 起本会话的枚举拒、别的会话的抹除不动它、重绑带走它 —— 但只对**有归属**的坏行(行里的 `__sid`,否则同名高水位标记的 `__sid`);
|
|
44
|
-
* 无从归属的坏行仍按「无规则」(core 已知限制
|
|
44
|
+
* 无从归属的坏行仍按「无规则」(core 已知限制 [ref] 接受:无从归属 ≠ 本会话);座上分不出读法 ⇒ 这一脸每一发都计(含已拒的)。
|
|
45
45
|
* 抹除扫走无归属坏行那一形 core 是否披露、座上数不数得到,未亲核。放行是 core 的裁定、本仓不包层(源头修复纪律),所以**只记账、不改放行**(R 类:有界放行,计数长期保留);
|
|
46
46
|
* · 其余脸 ⇒ 不计(见 {@link DurableAbsenceFace})。
|
|
47
47
|
* 记账**先于** warn:记账是总函数,warn 可能抛(core 的 guard 会吞掉那个抛),一次日志故障不许吃掉计数。
|
|
@@ -14,4 +14,11 @@ export declare function errorKindOf(err: unknown): string;
|
|
|
14
14
|
* 不是串 ⇒ `undefined`(没有码,不编一个)。调用方按自己的形判(什么样的码配进一句拒句)再用它。
|
|
15
15
|
*/
|
|
16
16
|
export declare function errorCodeOf(err: unknown): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* 不可信对象上**一个成员**的读口(店边界读 `code` / `errno` / `cause` / `message` 的唯一一只;同一处兜底 {@link readOr}):不是对象 ⇒ 缺席;访问器 / 代理抛 ⇒ 缺席(`undefined`)。
|
|
19
|
+
* 三问(缺席倒向):错误落到哪 —— 成员被当作不在,不单独记(这一读不是任何一条路的判词);谁受害 —— 没有真实受害者(驱动错误是平面数据对象),只有 getter 会抛的对象读不出码 / 链 / 句;
|
|
20
|
+
* 缺席倒向 —— 码读不出 ⇒ 没有码扳机、`cause` 读不出 ⇒ 链在此处止步,而**驱动出身扳机按对象身份判、不读任何成员**(`plugins/error-origin.ts`),链深扳机数的是层数 —— 所以带驱动记号的错照样**触发**换形;
|
|
21
|
+
* 换形本身读 `code` 判类时,成员 getter 会抛的对象仍可能在那一步抛出(店边界既有的限制,不是本读口引入的;真实驱动错误是平面数据对象,不在射程内)。
|
|
22
|
+
*/
|
|
23
|
+
export declare function errorMemberOf(o: unknown, key: string): unknown;
|
|
17
24
|
//# sourceMappingURL=err-text.d.ts.map
|
|
@@ -30,4 +30,9 @@ export function errorCodeOf(err) {
|
|
|
30
30
|
}, "");
|
|
31
31
|
return code === "" ? undefined : code;
|
|
32
32
|
}
|
|
33
|
+
export function errorMemberOf(o, key) {
|
|
34
|
+
if (o === null || typeof o !== "object")
|
|
35
|
+
return undefined;
|
|
36
|
+
return readOr(() => o[key], undefined);
|
|
37
|
+
}
|
|
33
38
|
//# sourceMappingURL=err-text.js.map
|
|
@@ -55,13 +55,13 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
55
55
|
readonly cls: "F";
|
|
56
56
|
readonly note: "S-1173(`workflow-notify-journal.ts` 的 `ensurePointersFor`,park 指针的唯一写点):workflow run 记录的 `parks[]` **读不出**(在场却不是列表 / 某条目身份位或持有者两位形坏;读者 = `workflow-agent-session-index.ts` 的 `readRunParks`,整档成败制)⇒ 这一份指针投影派生不出来 ⇒ 写者这次**不写**指针,记录照写(已写过的指针只增不删,原样留着)。修前这一臂静默 `return`。**`parks` 缺席不进这一臂**:那是引擎契约里的合法形(更早引擎写的记录 / 准入没走完的续跑记录),读者答 `[]`(没有条目),没有要写的指针,不计。与指针**写**失败分家:写失败 ⇒ 记录写抛、记录不落(指针先于记录,不 fail-open);本臂没有丢任何一枚已写的指针 —— 读不出的是**记录本身**,引擎对条目形坏的记录整条拒续跑(`park_binding_broken`),读口对已有指针的 run 据记录响亮拒(`unproven/unreadable`),所以要的是查那条记录为什么读不出(投影把它写坏 / 手改)。放行的最坏后果:这条 run 首写就读不出时没有指针 ⇒ 这张卡没有别的指针时 `/decide` 落 legacy 腿、409 响亮拒,方向 fail-closed,不误配、不放行任何东西;例外 —— 同一张卡上另一支的指针在时分叉门判不出、决定投给那一支(引擎从不写坏形,要这一支在首写之前就被写坏);derived cache 没更新、真源读口自带响亮拒 ⇒ F 类。detail = `runId=`;计数非零 = 有记录的 `parks[]` 读不出,按 runId 去查记录。";
|
|
57
57
|
};
|
|
58
|
-
readonly "server.workflow-
|
|
58
|
+
readonly "server.workflow-park-holder.read-failed": {
|
|
59
59
|
readonly cls: "F";
|
|
60
|
-
readonly note: "
|
|
60
|
+
readonly note: "workflow 停驻卡持有进程的拉取腿(`orchestration/workflow-park-holder.ts`,维护拍上读本进程执行中、持有停驻卡的 run 的决定行,把立住的决定在本地交给引擎)这一拍对某条候选读不出:决定行的主键读抛或超过期限(`step=decision`)、卡 / 持有者那一读超过期限(`step=card`),或执行器视图等那条 run 的引擎观察通道收场的那一读拒(`step=channel`,core 的观察队列只关不拒,结构上不可达)。放行的最坏后果:这条决定这一拍不交,行留着、卡仍 pending —— 下一拍再来;`channel` 那一形这条 run 出视图,它的行改由 run 的收场送达交给宿主会话的下一跑(交付晚到 run 收场,不丢、不错交)。不放宽任何判定:交不交、交给谁仍由行 + 卡状态 + 引擎判。detail = `step=<decision|card|channel> runId=<持有者> err=<原句,经记录器脱敏>`;计数持续非零 = 决定店 / 检查点店对这几条读不出,按 runId 查。";
|
|
61
61
|
};
|
|
62
62
|
readonly "server.workflow-park-decision.card-unreadable": {
|
|
63
63
|
readonly cls: "F";
|
|
64
|
-
readonly note: "起跑读者(`parked-decide.ts` 的 `
|
|
64
|
+
readonly note: "交付决定行的三方(起跑读者 `heldWorkflowParkDecisions`,每一只起跑器开跑前一次;workflow 停驻卡持有进程的拉取腿;run 收场送达)共用的逐行判(`parked-decide.ts` 的 `deliverableEntryOf`)读某条已受理的 workflow 子代决定所属的那张卡(`step=card`)或那张卡的当下持有者(`step=holder`:park 索引 / 记录读)时店抛 ⇒ 这一次**不交付**这条决定,行留着(起跑读者:这一跑不带它,下一跑照带;拉取腿:下一拍再来;收场送达:不 ack、`recover` 重投)。放行的最坏后果:这一跑里宿主若续跑那条 workflow run,子代按同一个 token 再停驻一次(卡仍 pending,决定仍在,下一跑照带)—— 方向是少交付一次,不是错交付:这一读失败不代表引擎随后那一读也失败,而引擎对「卡已不 pending、却拿到一条决定」的序数会当确认结算,所以读不出时绝不照供。计数持续非零 = checkpoint 店 / park 索引 / 记录店对这张卡读不出(库故障 / 行坏 / 写者版本更新),按 detail 的 `runId=`(受理那一刻的持有者)去查。detail = `step=<card|holder> runId=<留存锚> err=<原句,经记录器脱敏>`。";
|
|
65
65
|
};
|
|
66
66
|
readonly "server.workflow-park-decision.store-unreadable": {
|
|
67
67
|
readonly cls: "F";
|
|
@@ -197,7 +197,7 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
197
197
|
};
|
|
198
198
|
readonly "server.approvals.queue-row-agent-unreadable": {
|
|
199
199
|
readonly cls: "F";
|
|
200
|
-
readonly note: "S-3000(`routes/approvals-assistant.ts` 的 `sessionAgentsOf`):运维待批队列(`GET /v1/approvals` 的 `pending[]` 与 `/v1/approvals/stream` 的 `pending` 帧)每一只停驻行带它那只会话在委派树里的位置 `agent`(会话视图的同名键,唯一读口 `
|
|
200
|
+
readonly note: "S-3000(`routes/approvals-assistant.ts` 的 `sessionAgentsOf`):运维待批队列(`GET /v1/approvals` 的 `pending[]` 与 `/v1/approvals/stream` 的 `pending` 帧)每一只停驻行带它那只会话在委派树里的位置 `agent`(会话视图的同名键,唯一读口 `http/owner-access.ts` 的 `readSessionAgent` = 会话店的 `placementOf` 一读)。某一只会话那一读抛(店瞬断 / 超时 / local 后端的会话存档行头读不出)⇒ **这只会话的行**缺 `agent` 键,列表其余照常。放行的最坏后果 = 这一行这一次没有委派归属线索:壳的归属判官认不到它(行照列、人从队列照样决得了 —— 与本键存在之前同形);`agent` 不是授权事实(队列行本就只列调用方 scope 的卡,决断口另有属主门)。不放行的代价是一只读不出的会话打掉整张待批列表(订阅流上每一拍都是读失败)。故 F 类;必须留痕,否则「这一次没读成」与「这不是一只 placed 委派子代」在 wire 上同形。detail = 会话 id 与经出口座的错误句。计数按次(订阅流每一拍各计一次)。";
|
|
201
201
|
};
|
|
202
202
|
readonly "server.approvals.durable-row-checkpoint-id-missing": {
|
|
203
203
|
readonly cls: "F";
|
|
@@ -351,6 +351,10 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
351
351
|
readonly cls: "F";
|
|
352
352
|
readonly note: "#329 / #343(黑板 [5100] Q3):停驻行迟到决议的**受理回执表**(本副本对「200 丢包后重试」的幂等承诺 + 重叠请求的单飞句柄;键 = 行的键 askId,只在一次赎回真开飞时开格;容量帽只数受理之后留下的回执,在飞的单飞句柄永不被逐)**拒留一张回执**。放行的最坏后果 = 这**一次**受理(照旧生效)没有本副本的回执可依:200 丢包后的重试会再进一次赎回腿、拿到那条腿的 409(那张 checkpoint 已被消费)而不是幂等 200 回放(终局恒由赎回腿的 gate CAS 定,不会错兑也不会双兑);迟到受理本身、`GET /v1/approvals` 列表与 `/v1/approvals/:sessionId/decide` 一个字节不动 ⇒ F 类。为什么方向是「拒新」而不是 FIFO 挤最旧:那个形让**甲的用量决定乙的可用性**(已鉴权租户量产受理即可把别家回执挤出,merge-rescan 744 confirmed 的同一病形)。必须留痕:「表被别人打满」与「这一次本来就没有回执」在 wire 上同形。detail 带 owner(判「压力来自谁」的第一手线索)。臂只有一条:全局回执帽满、本 principal 未到子帽、表里没有过期回执可收 ⇒ 拒留(detail 带 owner)。本 principal 到了子帽的常态臂逐自己最旧的一张回执(量产者自伤,设计内有界表纪律),不走本 tag;在飞的单飞句柄不占帽、永不被逐。";
|
|
353
353
|
};
|
|
354
|
+
readonly "server.approval.parked-decision-not-recorded": {
|
|
355
|
+
readonly cls: "F";
|
|
356
|
+
readonly note: "S-1054 α(`tool-approval.ts` 的 `recordParkedOutcome`,停驻赎回那一飞的落行步):停驻门**已经受理**了这次决定(续跑已开始),而把它的记录(决议向 · 署名 · 理由 · 回决幂等键 · 出处)落到仍 `PARKED` 的问行上没成 —— 店错 / 超时 / 行出了门判过的属主域 / 这把键已被同 task 另一只问占着(detail 带 `reason`)。放行的最坏后果 = 这一问在耐久决断口上的**同键回放**读不到这把键:同键重发得到 `409 conflict.ask_decided`(回显门上站着的那次决定,决议向 / 时刻 / 理由取自门,无署名),而不是 200 回放;审计面少一份署名。决定本身零影响(终局恒在停驻门上,门已决);不改判、不重赎、不双兑。计数非零 = 问账店在受理之后写不动了,运维要去看店。";
|
|
357
|
+
};
|
|
354
358
|
readonly "server.approvals.stale-echoed-token-unreadable": {
|
|
355
359
|
readonly cls: "F";
|
|
356
360
|
readonly note: "S-02 codex R1-[medium](验真后修):decide 的 409 `approval_stale` 臂对**调用方回显的旧 token** 做归属判定(`cs.get(binding.checkpointToken)`),那次读**抛了**(store 抖动 / 坏 checkpoint 行 / 行恰被清理)。修前这里是静默 `catch(()=>null)`,「读不出」被折成「确认不在库」——叠上 S-02 的 404 收口后,一次 store 抖动就会把合法旧 token 的 409+terminal 谎报成 404「没有这条审批」。修后:unreadable ⇒ **保持 409**(`terminal` 不披露——证不出归属就不说,与 2026-07-26 纪律同向;404 折叠只在读成功且未命中时走,探测方无法自控 store 故障 ⇒ 谕示封闭不破)。放行的最坏后果 = 该次拒体 `terminal` 诚实缺席(`currentPending` 由它自己的读口与属主复核另判,不受本臂牵连),壳退回重拉列表,judgment 面 fail-safe,故 F 类。留痕理由:这次读是 terminal 披露与 404 折叠两个判定的输入,长期抖动必须在遥测显形。";
|
|
@@ -569,13 +573,13 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
569
573
|
readonly cls: "R";
|
|
570
574
|
readonly ruling: "C-R296";
|
|
571
575
|
readonly bound: "FLEET_LEASE_OUTAGE_MAX_MS";
|
|
572
|
-
readonly note: "`fleet/serving-lease.ts`
|
|
576
|
+
readonly note: "`fleet/serving-lease.ts` 的「没确认」一段(两个调用点一只函数、一行 warn `fleet_serving_lease_unconfirmed`、一只连败计数;detail = `worker=<w> generation=<g> why=<…>`):① `renewOnce`(中心宣告了位之后每一次续租;`why=<不可达句 | HTTP <状态> | verdict=unknown>`)—— 中心这一次**没有确认**本实例该不该服务:不可达 / 超时 / 非 2xx / 答复读不成判决,或答 `unknown`(此刻没有本实例的生命周期对象);② `noteHeartbeat` 的沉默臂(fleet 成员还没听到任何声明的推定期,每一拍心跳;`why=heartbeat:<HTTP <状态> | 请求抛出的那句 | reply-unreadable:<因> | not-sent:<那句>>`,不带中心体片段)—— 成员起步即推定在围栏内,心跳没换来中心的声明。按设计**什么都不改**(规则 2 第三臂):到期之前照常 `granted`,过期后 / 推定期 `expired` 照常接单,直到最后一次授予的到期(没有授予 ⇒ 围栏在本进程生效的时刻,推定 = 本进程起点)满 `FLEET_LEASE_OUTAGE_MAX_MS`(`T_max`)才拒新工作(503 `state.lease_expired`,在飞不动、永不自停)。只在围栏生效时计(中心以不带位的声明解除围栏之后,在飞续租迟到的失败不计)。一段的收尾 = 续租判决(`granted` / `denied`)或中心以不带位的声明解除围栏,一行 `fleet_serving_lease_recovered`(`by: verdict | not-enforced`);宣告本身不是确认。归 R:方向与上界由裁定写定 —— 实例只在中心权威终止(`denied`)或运维覆盖时被替换,`T_max` 只是引擎自己「失联后最多再接单多久」的准入上界,不是替换依据;没确认不是被拒。放行的最坏后果 = 一只其实已被取代的实例在中心失联期间多服务至多「租约剩余 + `T_max`」(中心的代际下限持久,恢复后第一次续租即拒);从起步起一直没听到中心的成员**每个不间断进程**至多服务 `T_max`(钟不跨重启:重启即重计)。计数长期保留:持续非零 = 中心长时间没确认本实例,去看 detail 的 why(连不上 / 令牌被拒 / 中心不认识这只实例 / 答复不是声明)。";
|
|
573
577
|
};
|
|
574
578
|
readonly "server.fleet.serving-lease-capability-absent": {
|
|
575
579
|
readonly cls: "R";
|
|
576
580
|
readonly ruling: "C-R296";
|
|
577
581
|
readonly bound: "FLEET_LEASE_OUTAGE_MAX_MS";
|
|
578
|
-
readonly note: "`fleet/serving-lease.ts` 的 `
|
|
582
|
+
readonly note: "`fleet/serving-lease.ts` 的 `noteHeartbeat` 读数臂(fleet 成员每一次中心能力声明;detail = `worker=<w> generation=<g> was=<presumed|on|off>`):中心心跳答复里**显式的** `capabilities` 声明对象在、却**没有宣告** `servingLease`(中心关着围栏开关 / 共享令牌 / 降级中心 / 位撤掉)⇒ 规则 1:租约不生效,`leaseState: none`,零续租、零 503 —— 这只 fleet 成员此刻**不受围栏**。推定期的第一条声明就不带位(`was=presumed`)⇒ 推定作废(`expired → none`),钟不起,之后不限时(直到中心第一次宣告,那一拍起钟)。不是声明的答复不进这一臂(体读不出 / 不是对象 / 没有 `capabilities` 键 / 形坏 —— 那是沉默,推定、位与钟原样,`fleet-client.ts` `capabilityReadingOf`);已被拒的实例不进(拒是黏的,位消失不复活)。归 R:能力门控是契约规则(中心声明不执行 = 中心不执行围栏),裁定写定替换只来自中心权威终止或运维覆盖;位只开关围栏、不碰钟 —— 位缺席期间 `T_max` 的钟照走(最后一次授予的到期 / 围栏在本进程第一次生效的时刻),位一回来即按它判,所以位的抖动绕不过 `FLEET_LEASE_OUTAGE_MAX_MS`。放行的最坏后果 = 中心声明不执行围栏期间,一只被取代的实例照常服务(这一段由中心的选择定界,不由引擎)。计数长期保留:非零 = 这台中心没宣告租约能力。";
|
|
579
583
|
};
|
|
580
584
|
readonly "server.workspace-cache.unavailable": {
|
|
581
585
|
readonly cls: "F";
|
|
@@ -611,11 +615,11 @@ export declare const FAIL_OPEN_TAGS: {
|
|
|
611
615
|
};
|
|
612
616
|
readonly "server.fleet.announce-reply-unreadable": {
|
|
613
617
|
readonly cls: "P-DEBT";
|
|
614
|
-
readonly note: "7.121.0 修复验证轮(`fleet-client.ts` 的公告环,fleet 成员每一拍心跳 2xx 答复;detail = `why=<body|not-an-object|invalid-capabilities> leaseState=<此刻的租约态>`)
|
|
618
|
+
readonly note: "7.121.0 修复验证轮(`fleet-client.ts` 的公告环,fleet 成员每一拍心跳 2xx 答复;detail = `why=<body|not-an-object|capabilities-absent|invalid-capabilities> leaseState=<此刻的租约态>`):答复不是能力声明(体读不出 / 不是对象 / 没有 `capabilities` 键 / `capabilities` 键在场而形坏 —— settings-schema `readCapabilityReading` 的 `unreadable`〔没有键那一因自 25.0.0 起〕,外加本仓的 `body`)⇒ 这一拍是沉默(交租约客户端 `silent`,`why=reply-unreadable:<因>`),推定、租约的状态与钟原样。**一律**计数(不论租约此刻什么态):推定期(成员还没听到任何声明,`leaseState=expired`)的坏答复同时是一拍「没确认」(另计 `server.fleet.serving-lease-unconfirmed`),推定与钟照走、满 `T_max` 拒新工作;租约已生效时计数说明中心的答复在坏、围栏靠的是上一次声明。归 P 类:围栏轴;归 DEBT:本进程判不出中心为什么答坏体,收口条件 = 中心契约 / 监控(中心侧对心跳答复形的执法)落地。每段连拍另有一行 warn `fleet_announce_reply_unreadable`(带 `why`)。";
|
|
615
619
|
};
|
|
616
620
|
readonly "server.fleet.denied-marker-unpersisted": {
|
|
617
621
|
readonly cls: "P-DEBT";
|
|
618
|
-
readonly note: "7.121.0(`fleet/serving-lease.ts` 的 `enterDenied`,中心以正面证据拒了本实例的服务租约那一拍;detail = `worker=<w> generation=<g>`):拒要落成数据根下一只文件(重启后起步即排空),而这一次**没落下** —— 没有数据根,或写失败(盘满 / 只读挂载 / 目录不在)。本进程照样被拒、照样当拍排空、到期自停;放行的是**重启之后**:同代际重启的实例不记得被拒,在第一次续租得到答复之前会接新工作(中心宣告了能力位时,第一次续租就再被拒一次 ——
|
|
622
|
+
readonly note: "7.121.0(`fleet/serving-lease.ts` 的 `enterDenied`,中心以正面证据拒了本实例的服务租约那一拍;detail = `worker=<w> generation=<g>`):拒要落成数据根下一只文件(重启后起步即排空),而这一次**没落下** —— 没有数据根,或写失败(盘满 / 只读挂载 / 目录不在)。本进程照样被拒、照样当拍排空、到期自停;放行的是**重启之后**:同代际重启的实例不记得被拒,在第一次续租得到答复之前会接新工作(中心宣告了能力位时,第一次续租就再被拒一次 —— 中心的代际下限是持久的;中心那时不可达 / 心跳一直不通则按推定围栏接单到本进程起点满 `FLEET_LEASE_OUTAGE_MAX_MS`,每个进程各一段;重启后第一条声明就不带位 ⇒ 中心的话,不限时)。归 P 类:这是围栏的记忆;归 DEBT:进程内无法把「记不住」变成 fail-closed(「起步首次答复之前零容忍」形已否决:中心宕几秒 + 一次重启就停数据面),收口条件 = 契约给出持久拒位的公告位(心跳 / `/health` 上说「这一次拒只在本进程」,中心据此对该实例下一次续租照拒、并能看见它)。denied 行的 `sticky` 同拍说 `process-only`,不声称跨重启记得。计数非零 = 这台机器的数据根写不进,或部署没有数据根。";
|
|
619
623
|
};
|
|
620
624
|
readonly "server.sql.tidb-row-cap-unread": {
|
|
621
625
|
readonly cls: "F";
|