@sema-agent/server 7.147.0 → 7.149.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 +1468 -24
- package/README.md +35 -7
- package/README.zh-CN.md +18 -8
- package/USAGE.md +444 -193
- package/deploy/sema-up/README.md +16 -5
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +20 -4
- package/deploy/sema-up/chart/values.yaml +3 -2
- package/deploy/sema-up/cluster-up.sh +74 -176
- package/deploy/sema-up/kube-up.sh +29 -49
- package/deploy/sema-up/lib/chart-run.sh +23 -0
- package/deploy/sema-up/lib/dataroot.sh +3 -3
- package/deploy/sema-up/lib/health.sh +62 -13
- package/deploy/sema-up/lib/helm-values-cluster.py +18 -0
- package/deploy/sema-up/lib/helm-values-kube.py +35 -0
- package/deploy/sema-up/lib/regcred.py +8 -0
- package/deploy/sema-up/lib/remote/helm-install.sh +3 -0
- package/deploy/sema-up/lib/remote/image-import.sh +6 -0
- package/deploy/sema-up/lib/remote/machine-precheck.sh +11 -0
- package/deploy/sema-up/lib/remote/region-probe.sh +3 -0
- package/deploy/sema-up/lib/remote/stack-ready.sh +26 -0
- package/deploy/sema-up/lib/remote/vxlan-guard.sh +8 -0
- package/deploy/sema-up/lib/render-stack.py +17 -0
- package/deploy/sema-up/lib/shell-text.sh +87 -0
- package/deploy/sema-up/lib/usage-flags.txt +10 -0
- package/deploy/sema-up/lib/usage-head.txt +1 -0
- package/deploy/sema-up/lib/usage-tail.txt +13 -0
- package/deploy/sema-up/preflight.sh +10 -8
- package/deploy/sema-up/sema-up.sh +14 -39
- package/deploy/sema-up/smoke.sh +7 -6
- package/deploy/sema-up/stack/compose.dataroot.yaml +3 -0
- package/deploy/sema-up/stack/compose.yaml +13 -1
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +21 -0
- package/dist/adoption/plan.d.ts +24 -0
- package/dist/adoption/plan.js +53 -1
- package/dist/adoption/runner.d.ts +10 -1
- package/dist/adoption/runner.js +36 -16
- package/dist/approval-card.d.ts +36 -38
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-leg-origin.d.ts +33 -0
- package/dist/approval-leg-origin.js +4 -0
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +13 -11
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +15 -7
- package/dist/auth-bridge.d.ts +9 -15
- package/dist/auth-bridge.js +4 -11
- package/dist/auth-keys.d.ts +10 -1
- package/dist/auth-keys.js +8 -0
- package/dist/auto-mode-face.d.ts +10 -7
- package/dist/auto-mode-face.js +7 -4
- package/dist/background-agent-name.d.ts +19 -1
- package/dist/background-agent-name.js +12 -2
- package/dist/background-session-reap.d.ts +1 -1
- package/dist/bake-runner/main.js +9 -6
- package/dist/bench/s1/arms.js +6 -5
- package/dist/bench/s1/live-deps.js +5 -2
- package/dist/bench/s1/run-firm.js +6 -5
- package/dist/bind-host.d.ts +25 -0
- package/dist/bind-host.js +25 -0
- package/dist/boot/adoption.d.ts +3 -0
- package/dist/boot/adoption.js +1 -0
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/execution-env.d.ts +17 -7
- package/dist/boot/execution-env.js +47 -42
- package/dist/boot/execution-lane.d.ts +6 -4
- package/dist/boot/execution-lane.js +3 -1
- package/dist/boot/exit-boundary.d.ts +2 -2
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +17 -15
- package/dist/boot/memory-consolidation.d.ts +37 -29
- package/dist/boot/memory-consolidation.js +11 -5
- package/dist/boot/org-delivery.d.ts +3 -2
- package/dist/boot/org-memory.js +1 -1
- package/dist/boot/parked-revive-gate.js +2 -2
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +19 -16
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +60 -70
- package/dist/boot/retention-lane.d.ts +4 -4
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +14 -5
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +16 -7
- package/dist/boot/session-faces.js +114 -94
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -0
- package/dist/boot/stage-01-config.js +13 -4
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -0
- package/dist/boot/stage-02-web-admin-pull.js +16 -3
- package/dist/boot/stage-03-store-backend.d.ts +4 -0
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -0
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +8 -3
- package/dist/boot/stage-05-execution-env.js +2 -2
- package/dist/boot/stage-06-runners.d.ts +12 -13
- package/dist/boot/stage-06-runners.js +23 -15
- package/dist/boot/stage-07-capability-layer.d.ts +13 -9
- package/dist/boot/stage-07-capability-layer.js +5 -3
- package/dist/boot/stage-08-reapers.d.ts +13 -9
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +14 -16
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +14 -16
- package/dist/boot/stage-10-http-server.js +7 -4
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +6 -0
- package/dist/boot/stores.js +41 -27
- package/dist/boot/task-list-lane.d.ts +4 -4
- package/dist/boot/web-admin.d.ts +4 -2
- package/dist/boot/web-admin.js +55 -35
- package/dist/boot/webfetch-summarize-lane.d.ts +1 -1
- package/dist/boot-reclaim.d.ts +3 -1
- package/dist/boot-reclaim.js +1 -1
- package/dist/brain.d.ts +7 -18
- package/dist/brain.js +5 -17
- package/dist/budget.js +6 -6
- package/dist/capabilities/center-plugins.d.ts +7 -1
- package/dist/capabilities/center-plugins.js +32 -10
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +2 -2
- package/dist/capabilities/composite-members.js +2 -2
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +6 -15
- package/dist/capabilities/scenarios.js +11 -16
- package/dist/capabilities/skills.d.ts +1 -1
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +39 -11
- package/dist/capability-facts.js +35 -7
- package/dist/card-settle-stored-scope.d.ts +56 -0
- package/dist/card-settle-stored-scope.js +27 -0
- package/dist/card-void.d.ts +8 -13
- package/dist/card-void.js +2 -7
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +7 -3
- package/dist/config-catalog.d.ts +28 -1
- package/dist/config-catalog.js +95 -85
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +43 -3
- package/dist/config-invariants.js +69 -5
- package/dist/config-lkg.d.ts +23 -1
- package/dist/config-lkg.js +17 -3
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -110
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +62 -21
- package/dist/config.d.ts +14 -21
- package/dist/config.js +141 -64
- package/dist/context-window-notice.d.ts +31 -0
- package/dist/context-window-notice.js +28 -0
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +46 -11
- package/dist/deployment-shape.js +8 -0
- package/dist/egress-redirect.d.ts +25 -7
- package/dist/egress-redirect.js +20 -2
- package/dist/elicitation.d.ts +6 -5
- package/dist/elicitation.js +23 -22
- package/dist/engine-identity.d.ts +28 -0
- package/dist/engine-identity.js +10 -0
- package/dist/entry-problems.d.ts +5 -7
- package/dist/entry-problems.js +1 -1
- package/dist/env-facts.js +2 -1
- package/dist/env-name-allowlist-knobs.d.ts +6 -5
- package/dist/env-name-allowlist-knobs.js +5 -0
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-lane-caps.d.ts +25 -23
- package/dist/execution-lane-caps.js +18 -26
- package/dist/execution-placement.d.ts +58 -18
- package/dist/execution-placement.js +41 -2
- package/dist/field-conflict.d.ts +7 -11
- package/dist/field-conflict.js +3 -3
- package/dist/file-history-capture.d.ts +3 -3
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/fleet-bus.d.ts +21 -3
- package/dist/fleet/fleet-bus.js +35 -25
- package/dist/fleet/fleet-reconciler.js +2 -2
- package/dist/fleet/serving-lease.js +3 -3
- package/dist/fleet-client.js +3 -3
- package/dist/fleet-lease.d.ts +0 -1
- package/dist/fleet-lease.js +4 -5
- package/dist/history-anchor.d.ts +23 -3
- package/dist/history-anchor.js +24 -4
- package/dist/hitl-delivery.d.ts +90 -0
- package/dist/hitl-delivery.js +98 -0
- package/dist/hooks/classic-stations.d.ts +8 -11
- package/dist/hooks/classic-stations.js +0 -7
- package/dist/hooks/command-spawn.d.ts +7 -2
- package/dist/hooks/command-spawn.js +13 -6
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +72 -57
- package/dist/hooks/hook-runner.js +271 -193
- package/dist/host-lsp-manager.d.ts +22 -8
- package/dist/host-lsp-manager.js +4 -1
- package/dist/http/active-run-conflict.d.ts +2 -43
- package/dist/http/active-run-conflict.js +3 -7
- package/dist/http/admission.d.ts +4 -18
- package/dist/http/admission.js +76 -79
- package/dist/http/approval-sweeps.d.ts +3 -3
- package/dist/http/approval-sweeps.js +56 -31
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claimed-run.d.ts +16 -8
- package/dist/http/claimed-run.js +8 -0
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +78 -30
- package/dist/http/durable-run-leg.d.ts +11 -4
- package/dist/http/durable-run-leg.js +45 -21
- package/dist/http/execution-context.d.ts +122 -47
- package/dist/http/execution-context.js +135 -43
- package/dist/http/health-reader.d.ts +36 -0
- package/dist/http/health-reader.js +21 -0
- package/dist/http/health-self-report.d.ts +9 -9
- package/dist/http/health-self-report.js +4 -4
- package/dist/http/idempotency.d.ts +9 -5
- package/dist/http/idempotency.js +4 -4
- package/dist/http/memory-compliance-failure-reply.d.ts +15 -16
- package/dist/http/memory-compliance-failure-reply.js +4 -2
- package/dist/http/memory-face-fault-reply.d.ts +67 -0
- package/dist/http/memory-face-fault-reply.js +71 -0
- package/dist/http/memory-store-refusal-reply.d.ts +1 -1
- package/dist/http/memory-store-refusal-reply.js +3 -0
- package/dist/http/owner-access.d.ts +392 -67
- package/dist/http/owner-access.js +370 -35
- package/dist/http/principal-gate.d.ts +39 -89
- package/dist/http/principal-gate.js +26 -68
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +9 -13
- package/dist/http/request-guards.js +34 -68
- package/dist/http/resume-composition.d.ts +37 -0
- package/dist/http/resume-composition.js +18 -0
- package/dist/http/resume-ctx-read.d.ts +46 -12
- package/dist/http/resume-ctx-read.js +31 -6
- package/dist/http/resume-legs.d.ts +54 -19
- package/dist/http/resume-legs.js +408 -196
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/route-ctx.d.ts +31 -32
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +60 -37
- package/dist/http/routes/admin-config-refresh.js +2 -2
- package/dist/http/routes/admin-drain.js +2 -2
- package/dist/http/routes/admin-memory-optout.js +4 -3
- package/dist/http/routes/adoption.d.ts +3 -0
- package/dist/http/routes/adoption.js +17 -10
- package/dist/http/routes/agents-roster.js +13 -7
- package/dist/http/routes/approvals-assistant.js +73 -67
- package/dist/http/routes/attachments.js +2 -2
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +9 -17
- package/dist/http/routes/capabilities.js +16 -19
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +4 -4
- package/dist/http/routes/diagnostics.d.ts +29 -3
- package/dist/http/routes/diagnostics.js +49 -18
- package/dist/http/routes/engine.js +2 -2
- package/dist/http/routes/fleet.js +5 -3
- package/dist/http/routes/images.js +10 -6
- package/dist/http/routes/leader.d.ts +7 -2
- package/dist/http/routes/leader.js +12 -3
- package/dist/http/routes/mcp-reconnect.d.ts +1 -1
- package/dist/http/routes/mcp-reconnect.js +7 -15
- package/dist/http/routes/memory-bundle.js +4 -7
- package/dist/http/routes/memory-compliance.js +4 -4
- package/dist/http/routes/memory-consolidation.js +6 -9
- package/dist/http/routes/memory-origin.d.ts +2 -0
- package/dist/http/routes/memory-origin.js +7 -8
- package/dist/http/routes/memory-policy.js +17 -12
- package/dist/http/routes/notify-wake.js +10 -19
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +4 -2
- package/dist/http/routes/principal-inbox.js +5 -4
- package/dist/http/routes/projects.d.ts +1 -1
- package/dist/http/routes/projects.js +3 -2
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +20 -5
- package/dist/http/routes/run-memory-capture.d.ts +2 -2
- package/dist/http/routes/run-memory-capture.js +6 -12
- package/dist/http/routes/run-permission-mode.d.ts +2 -2
- package/dist/http/routes/run-permission-mode.js +10 -17
- package/dist/http/routes/runs.js +155 -237
- package/dist/http/routes/session-memory-sync.d.ts +2 -2
- package/dist/http/routes/session-memory-sync.js +7 -13
- package/dist/http/routes/session-sync.d.ts +28 -7
- package/dist/http/routes/session-sync.js +63 -50
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.js +87 -124
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +237 -187
- package/dist/http/routes/trace-usage.d.ts +0 -12
- package/dist/http/routes/trace-usage.js +40 -46
- package/dist/http/routes/workflows.d.ts +39 -4
- package/dist/http/routes/workflows.js +42 -14
- package/dist/http/run-concurrency-cap.d.ts +20 -12
- package/dist/http/run-concurrency-cap.js +39 -26
- package/dist/http/run-read-face.d.ts +3 -5
- package/dist/http/run-read-face.js +8 -13
- package/dist/http/send.d.ts +12 -3
- package/dist/http/send.js +42 -6
- package/dist/http/server.d.ts +43 -45
- package/dist/http/server.js +61 -11
- package/dist/http/sse-log.d.ts +17 -10
- package/dist/http/sse-log.js +7 -7
- package/dist/http/stored-body-replay.d.ts +12 -0
- package/dist/http/stored-body-replay.js +2 -2
- package/dist/http/submit-ctx.d.ts +17 -8
- package/dist/http/submit-ctx.js +8 -5
- package/dist/http/submit-replay.d.ts +19 -6
- package/dist/http/submit-replay.js +18 -6
- package/dist/http/sync-submit-body.d.ts +3 -4
- package/dist/http/sync-submit-body.js +4 -5
- package/dist/http/wire-types.d.ts +4 -3
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +2 -0
- package/dist/key-resolver.d.ts +32 -0
- package/dist/key-resolver.js +23 -9
- package/dist/leader/diffup.js +2 -1
- package/dist/leader/endpoint.d.ts +26 -5
- package/dist/leader/endpoint.js +154 -14
- package/dist/leader/fanout.d.ts +3 -0
- package/dist/leader/fanout.js +78 -63
- package/dist/leader/leader.d.ts +16 -0
- package/dist/leader/leader.js +43 -3
- package/dist/leader/merge.d.ts +9 -1
- package/dist/leader/merge.js +16 -1
- package/dist/leader/repair-wire.js +1 -1
- package/dist/leader/wire.d.ts +36 -3
- package/dist/leader/wire.js +59 -18
- package/dist/leg-facts.d.ts +7 -2
- package/dist/leg-facts.js +1 -0
- package/dist/local-store-declaration.d.ts +54 -0
- package/dist/local-store-declaration.js +59 -0
- package/dist/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/mcp-assertion-header.js +1 -1
- package/dist/memory-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-project-layer.js +1 -1
- package/dist/memory-scope.d.ts +33 -6
- package/dist/memory-scope.js +68 -19
- package/dist/memory-store-refusal.d.ts +5 -2
- package/dist/memory-sync-client.d.ts +3 -2
- package/dist/memory-sync-client.js +8 -5
- package/dist/model-compat.d.ts +17 -8
- package/dist/model-compat.js +6 -2
- package/dist/model-context-window.d.ts +57 -0
- package/dist/model-context-window.js +21 -0
- package/dist/model-entry-headers.d.ts +46 -4
- package/dist/model-entry-headers.js +2 -2
- package/dist/model-entry-refusal.d.ts +40 -20
- package/dist/model-entry-refusal.js +57 -30
- package/dist/model-plane-face.d.ts +19 -11
- package/dist/model-plane-face.js +9 -1
- package/dist/model-plane-probe.d.ts +2 -0
- package/dist/model-plane-probe.js +17 -0
- package/dist/model-provider.d.ts +3 -3
- package/dist/model-reach-scope.d.ts +2 -1
- package/dist/model-route-endpoint.d.ts +9 -5
- package/dist/model-route-endpoint.js +29 -7
- package/dist/model-select.d.ts +16 -0
- package/dist/model-select.js +4 -0
- package/dist/mountinfo.d.ts +37 -0
- package/dist/mountinfo.js +47 -0
- package/dist/namespaced-rule-name.d.ts +23 -14
- package/dist/namespaced-rule-name.js +8 -11
- package/dist/net-address.d.ts +1 -1
- package/dist/observability/corrupt-read-seat.d.ts +4 -4
- package/dist/observability/corrupt-read-seat.js +5 -3
- package/dist/observability/fail-open.d.ts +72 -40
- package/dist/observability/fail-open.js +74 -40
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.js +4 -5
- package/dist/observability/otel-exporter.js +2 -1
- package/dist/observability/principal-context.d.ts +14 -7
- package/dist/observability/principal-context.js +8 -3
- package/dist/observability/run-terminal.d.ts +7 -1
- package/dist/observability/run-terminal.js +6 -2
- package/dist/observability/secret-env-scrub.d.ts +1 -1
- package/dist/observability/secret-env-scrub.js +1 -1
- package/dist/orchestration/hardened-vm-runner.d.ts +1 -0
- package/dist/orchestration/hardened-vm-runner.js +11 -5
- package/dist/orchestration/hardened-vm-worker-runner.d.ts +0 -14
- package/dist/orchestration/hardened-vm-worker-runner.js +5 -0
- package/dist/orchestration/hardened-vm-worker.js +2 -1
- package/dist/orchestration/workflow-completion-inbox.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.js +3 -2
- package/dist/org-delivery-gate.d.ts +36 -10
- package/dist/org-delivery-gate.js +12 -8
- package/dist/outbound-dispatcher.d.ts +1 -1
- package/dist/outbound-dispatcher.js +6 -12
- package/dist/owner-brands.d.ts +81 -0
- package/dist/owner-brands.js +42 -0
- package/dist/owner-faces.d.ts +532 -0
- package/dist/owner-faces.js +126 -0
- package/dist/park-row-commit.d.ts +67 -0
- package/dist/park-row-commit.js +76 -0
- package/dist/parked-decide.d.ts +76 -12
- package/dist/parked-decide.js +152 -11
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +7 -9
- package/dist/peer-directory.js +3 -2
- package/dist/permission-rule-vocab.d.ts +53 -8
- package/dist/permission-rule-vocab.js +30 -2
- package/dist/plugins/adoption-log-sql.d.ts +3 -25
- package/dist/plugins/adoption-log-sql.js +23 -21
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.d.ts +7 -0
- package/dist/plugins/approval-ask-retired-delete-by-task-m50.js +17 -0
- package/dist/plugins/approval-ask-store-file.d.ts +18 -7
- package/dist/plugins/approval-ask-store-file.js +37 -14
- package/dist/plugins/approval-ask-store-memory.d.ts +12 -4
- package/dist/plugins/approval-ask-store-memory.js +24 -10
- package/dist/plugins/approval-ask-store-sql.d.ts +40 -21
- package/dist/plugins/approval-ask-store-sql.js +44 -15
- package/dist/plugins/approval-exemption-skill-cutoff.d.ts +64 -0
- package/dist/plugins/approval-exemption-skill-cutoff.js +122 -0
- package/dist/plugins/approval-exemption-skill-m46.d.ts +14 -0
- package/dist/plugins/approval-exemption-skill-m46.js +21 -0
- package/dist/plugins/approval-exemption-store.d.ts +32 -2
- package/dist/plugins/approval-exemption-store.js +42 -19
- package/dist/plugins/approval-nonce-store.d.ts +39 -12
- package/dist/plugins/approval-nonce-store.js +72 -23
- package/dist/plugins/blob-backend.d.ts +2 -0
- package/dist/plugins/blob-backend.js +9 -6
- package/dist/plugins/caching-session-store.d.ts +13 -1
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +32 -5
- package/dist/plugins/checkpoint-index-columns.js +36 -1
- package/dist/plugins/checkpoint-store-face.d.ts +83 -10
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.js +1 -0
- package/dist/plugins/ensure-index.d.ts +13 -1
- package/dist/plugins/ensure-index.js +154 -21
- package/dist/plugins/ensure-schema-lock-policy.d.ts +36 -18
- package/dist/plugins/ensure-schema-lock-policy.js +76 -9
- package/dist/plugins/file-run-store.d.ts +85 -32
- package/dist/plugins/file-run-store.js +177 -94
- package/dist/plugins/host-platform.d.ts +24 -3
- package/dist/plugins/host-platform.js +15 -1
- package/dist/plugins/image-bake-store-sql.js +2 -0
- package/dist/plugins/imported-layer-root-retirement.d.ts +2 -2
- package/dist/plugins/k8s-pod-reaper.d.ts +1 -3
- package/dist/plugins/k8s-pod-reaper.js +0 -1
- package/dist/plugins/leader-run-store-sql.d.ts +22 -0
- package/dist/plugins/leader-run-store-sql.js +34 -4
- package/dist/plugins/local-checkpoint-store.d.ts +62 -23
- package/dist/plugins/local-checkpoint-store.js +197 -77
- package/dist/plugins/local-data-dir-modes-m39.js +2 -1
- package/dist/plugins/local-data-root-admission.d.ts +52 -0
- package/dist/plugins/local-data-root-admission.js +100 -0
- package/dist/plugins/local-docker-capacity.d.ts +93 -0
- package/dist/plugins/local-docker-capacity.js +194 -0
- package/dist/plugins/local-docker-reaper.d.ts +92 -0
- package/dist/plugins/local-docker-reaper.js +102 -0
- package/dist/plugins/local-engine-high-water.d.ts +29 -6
- package/dist/plugins/local-engine-high-water.js +27 -19
- package/dist/plugins/local-session-store.d.ts +458 -140
- package/dist/plugins/local-session-store.js +906 -292
- package/dist/plugins/local-session-window.d.ts +3 -2
- package/dist/plugins/local-session-window.js +3 -2
- package/dist/plugins/local-sidecar-quarantine.js +3 -2
- package/dist/plugins/local-task-attachment-store.d.ts +18 -1
- package/dist/plugins/local-task-attachment-store.js +22 -1
- package/dist/plugins/memory-embedder.js +9 -7
- package/dist/plugins/memory-engine-pg.d.ts +3 -2
- package/dist/plugins/memory-engine-pg.js +14 -5
- package/dist/plugins/memory-engine-sql-apply.d.ts +8 -4
- package/dist/plugins/memory-engine-sql-apply.js +6 -8
- package/dist/plugins/memory-engine-tidb.d.ts +4 -2
- package/dist/plugins/memory-engine-tidb.js +11 -2
- package/dist/plugins/memory-optout-grant-store-sql.d.ts +1 -1
- package/dist/plugins/memory-optout-grant-store-sql.js +3 -3
- package/dist/plugins/memory-run-store.d.ts +53 -36
- package/dist/plugins/memory-run-store.js +116 -88
- package/dist/plugins/one-time-migration-marker.d.ts +26 -0
- package/dist/plugins/one-time-migration-marker.js +13 -0
- package/dist/plugins/one-time-migrations.d.ts +214 -47
- package/dist/plugins/one-time-migrations.js +481 -135
- package/dist/plugins/org-delivery-quota-store.d.ts +34 -11
- package/dist/plugins/org-delivery-quota-store.js +31 -15
- package/dist/plugins/permission-rule-store-file.d.ts +3 -3
- package/dist/plugins/permission-rule-store-sql.d.ts +5 -64
- package/dist/plugins/permission-rule-store-sql.js +11 -95
- package/dist/plugins/pg-pool.d.ts +2 -32
- package/dist/plugins/pg-pool.js +24 -17
- package/dist/plugins/remote-env-device.d.ts +3 -2
- package/dist/plugins/remote-env-e2b.d.ts +8 -32
- package/dist/plugins/remote-env-e2b.js +44 -32
- package/dist/plugins/remote-env-host.d.ts +51 -17
- package/dist/plugins/remote-env-host.js +111 -42
- package/dist/plugins/remote-env-k8s.d.ts +40 -45
- package/dist/plugins/remote-env-k8s.js +111 -60
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +352 -72
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/retention-deployment.d.ts +49 -17
- package/dist/plugins/retention-deployment.js +39 -8
- package/dist/plugins/run-preview-m45.d.ts +11 -0
- package/dist/plugins/run-preview-m45.js +19 -0
- package/dist/plugins/run-store-sql.d.ts +82 -75
- package/dist/plugins/run-store-sql.js +164 -125
- package/dist/plugins/s3-answer.d.ts +2 -1
- package/dist/plugins/sandbox-reaper.d.ts +26 -0
- package/dist/plugins/sandbox-reaper.js +2 -0
- package/dist/plugins/scenario-prefix-switch-m42.d.ts +56 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +56 -0
- package/dist/plugins/scheduler-support.d.ts +16 -1
- package/dist/plugins/scheduler-support.js +22 -2
- package/dist/plugins/schema-consistency.d.ts +131 -14
- package/dist/plugins/schema-consistency.js +388 -18
- package/dist/plugins/schema-drift-sentence.d.ts +10 -6
- package/dist/plugins/schema-drift-sentence.js +15 -7
- package/dist/plugins/schema-ensure-legs.d.ts +9 -0
- package/dist/plugins/schema-ensure-legs.js +1 -1
- package/dist/plugins/schema-indexes.js +3 -0
- package/dist/plugins/schema-live-columns.d.ts +14 -5
- package/dist/plugins/schema-live-columns.js +10 -10
- package/dist/plugins/send-user-file.js +2 -1
- package/dist/plugins/session-birth.d.ts +37 -0
- package/dist/plugins/session-birth.js +38 -0
- package/dist/plugins/session-epoch-anchor.d.ts +40 -12
- package/dist/plugins/session-epoch-anchor.js +33 -11
- package/dist/plugins/session-ext-table.d.ts +27 -3
- package/dist/plugins/session-ext-table.js +19 -6
- package/dist/plugins/session-fork.d.ts +15 -1
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +27 -20
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +12 -0
- package/dist/plugins/session-row-sql.js +3 -3
- package/dist/plugins/session-run-rollup.d.ts +29 -0
- package/dist/plugins/session-run-rollup.js +40 -0
- package/dist/plugins/session-store-sql.d.ts +38 -12
- package/dist/plugins/session-store-sql.js +130 -30
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/shared-memory-store-sql.d.ts +0 -69
- package/dist/plugins/shared-memory-store-sql.js +2 -1
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +42 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +9 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/sql-driver.d.ts +1 -1
- package/dist/plugins/sql-driver.js +2 -1
- package/dist/plugins/sql-errors.d.ts +32 -5
- package/dist/plugins/sql-errors.js +55 -7
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/stop-then-start-sentence.d.ts +16 -0
- package/dist/plugins/stop-then-start-sentence.js +7 -0
- package/dist/plugins/store-backend.d.ts +99 -16
- package/dist/plugins/store-backend.js +230 -65
- package/dist/plugins/store-contracts.d.ts +123 -33
- package/dist/plugins/store-contracts.js +38 -1
- package/dist/plugins/store-fault.d.ts +28 -2
- package/dist/plugins/store-fault.js +20 -2
- package/dist/plugins/task-attachment-store.d.ts +15 -3
- package/dist/plugins/task-attachment-store.js +22 -9
- package/dist/plugins/tidb-pool.d.ts +11 -6
- package/dist/plugins/tidb-pool.js +39 -18
- package/dist/plugins/web-search.js +5 -3
- package/dist/plugins/workflow-run-store-sql.d.ts +6 -1
- package/dist/plugins/workflow-run-store-sql.js +11 -5
- package/dist/plugins/workspace-custody.d.ts +44 -0
- package/dist/plugins/workspace-custody.js +47 -0
- package/dist/principal-jwt.d.ts +4 -4
- package/dist/principal-jwt.js +20 -5
- package/dist/principal-shape.d.ts +41 -0
- package/dist/principal-shape.js +19 -0
- package/dist/project-identity.d.ts +8 -7
- package/dist/project-identity.js +40 -17
- package/dist/project-layer-key.d.ts +13 -2
- package/dist/project-layer-key.js +9 -1
- package/dist/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-deny-floor-notice.d.ts +36 -0
- package/dist/read-deny-floor-notice.js +40 -0
- package/dist/{plain-string-record.d.ts → request-declaration-disposition.d.ts} +9 -23
- package/dist/request-declaration-disposition.js +39 -0
- package/dist/request-declaration-refusal.d.ts +35 -12
- package/dist/request-declaration-refusal.js +21 -9
- package/dist/request-form.d.ts +58 -0
- package/dist/request-form.js +72 -0
- package/dist/request-image-urls.d.ts +8 -2
- package/dist/request-image-urls.js +2 -1
- package/dist/request-images.d.ts +20 -0
- package/dist/request-images.js +59 -0
- package/dist/request-key-closure.d.ts +6 -7
- package/dist/request-key-closure.js +15 -2
- package/dist/resource-suspend.d.ts +7 -16
- package/dist/resource-suspend.js +1 -1
- package/dist/retired-name-host-notice.d.ts +21 -0
- package/dist/retired-name-host-notice.js +12 -0
- package/dist/rule-entry-list.d.ts +2 -2
- package/dist/rule-entry-list.js +3 -4
- package/dist/rule-issue-reading.d.ts +58 -0
- package/dist/rule-issue-reading.js +14 -0
- package/dist/rules-consent.d.ts +5 -3
- package/dist/rules-consent.js +1 -0
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-cancel-card.d.ts +28 -0
- package/dist/run-cancel-card.js +19 -0
- package/dist/run-cancel-context.d.ts +10 -0
- package/dist/run-cancel-context.js +1 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +117 -90
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +56 -21
- package/dist/runs.js +73 -43
- package/dist/runtime-caps-resolver.d.ts +21 -6
- package/dist/runtime-caps-resolver.js +17 -4
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -5
- package/dist/sealed-key-layout.js +5 -0
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +115 -27
- package/dist/security.d.ts +128 -158
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +25 -0
- package/dist/server-secret-env.d.ts +55 -25
- package/dist/server-secret-env.js +75 -22
- package/dist/session-agent.d.ts +3 -2
- package/dist/session-children-retire.d.ts +13 -8
- package/dist/session-children-retire.js +9 -7
- package/dist/session-deletion.d.ts +88 -0
- package/dist/session-deletion.js +8 -0
- package/dist/session-erase.d.ts +145 -0
- package/dist/session-erase.js +115 -0
- package/dist/session-error-wire.d.ts +5 -5
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +52 -5
- package/dist/session-incarnation.js +19 -2
- package/dist/session-policy-wire.d.ts +6 -3
- package/dist/session-policy-wire.js +11 -1
- package/dist/session-resident-background.d.ts +0 -71
- package/dist/session-resident-background.js +4 -3
- package/dist/session-row.d.ts +2 -1
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +3 -3
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-admission.d.ts +33 -0
- package/dist/store-admission.js +49 -0
- package/dist/store-posture.d.ts +141 -20
- package/dist/store-posture.js +205 -3
- package/dist/stored-request-hooks-m20.js +2 -2
- package/dist/stores-sql/background-agent-store-sql.d.ts +11 -2
- package/dist/stores-sql/background-agent-store-sql.js +73 -20
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +78 -49
- package/dist/stores-sql/file-history-store-sql.d.ts +1 -1
- package/dist/stores-sql/file-history-store-sql.js +3 -5
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/stores-sql/pg-session-storage.d.ts +7 -5
- package/dist/stores-sql/pg-session-storage.js +54 -46
- package/dist/stores-sql/retention-store-sql.d.ts +87 -19
- package/dist/stores-sql/retention-store-sql.js +92 -27
- package/dist/stores-sql/session-policy-store-sql.d.ts +32 -10
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +12 -6
- package/dist/stores-sql/tidb-session-storage.d.ts +4 -4
- package/dist/stores-sql/tidb-session-storage.js +13 -8
- package/dist/stores-sql/tidb-session-store.d.ts +36 -17
- package/dist/stores-sql/tidb-session-store.js +69 -39
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +4 -6
- package/dist/stores-sql/windowed-session-storage.d.ts +5 -0
- package/dist/stores-sql/windowed-session-storage.js +9 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +3 -8
- package/dist/task-a2a.js +28 -30
- package/dist/task-cwd.d.ts +43 -7
- package/dist/task-cwd.js +11 -0
- package/dist/task-mcp.d.ts +3 -3
- package/dist/task-mcp.js +4 -4
- package/dist/task-settings.d.ts +14 -10
- package/dist/task-settings.js +19 -7
- package/dist/terminal.d.ts +27 -43
- package/dist/terminal.js +49 -14
- package/dist/tool-approval.d.ts +173 -163
- package/dist/tool-approval.js +247 -232
- package/dist/trace/core-keyset-guard.d.ts +13 -6
- package/dist/trace/core-vocab-wire.d.ts +95 -0
- package/dist/trace/core-vocab-wire.js +15 -0
- package/dist/trace/engine-notice-wire.d.ts +24 -21
- package/dist/trace/engine-notice-wire.js +7 -3
- package/dist/trace/exit-seat.d.ts +30 -4
- package/dist/trace/exit-seat.js +40 -36
- package/dist/trace/extension-call-face.d.ts +3 -2
- package/dist/trace/extension-call-face.js +3 -1
- package/dist/trace/ledger-events.d.ts +4 -7
- package/dist/trace/ledger-sink.d.ts +4 -31
- package/dist/trace/ledger-sink.js +0 -11
- package/dist/trace/model-segment.d.ts +5 -5
- package/dist/trace/model-segment.js +5 -5
- package/dist/trace/project.d.ts +59 -44
- package/dist/trace/project.js +60 -26
- package/dist/trace/redact.d.ts +135 -27
- package/dist/trace/redact.js +884 -260
- package/dist/trace/self-minted-wire.d.ts +567 -20
- package/dist/trace/self-minted-wire.js +205 -24
- package/dist/trace/wire-projection-faces.d.ts +5 -6
- package/dist/trace/wire-projection-faces.js +2 -2
- package/dist/upstream-body.d.ts +23 -0
- package/dist/upstream-body.js +16 -0
- package/dist/url-refusal.d.ts +3 -3
- package/dist/url-refusal.js +11 -4
- package/dist/user-authored-text.d.ts +1 -1
- package/dist/user-input-ledger.d.ts +7 -8
- package/dist/user-input-ledger.js +1 -1
- package/dist/web-admin-client/apply-effective.d.ts +6 -3
- package/dist/web-admin-client/apply-effective.js +33 -23
- package/dist/web-admin-client/apply-ledger.d.ts +16 -7
- package/dist/web-admin-client/apply-ledger.js +5 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/center-request.js +15 -15
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -1
- package/dist/web-admin-client/entry-metadata.d.ts +8 -0
- package/dist/web-admin-client/entry-metadata.js +13 -0
- package/dist/web-admin-client/http-client.d.ts +1 -1
- package/dist/web-admin-client/http-client.js +23 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/mcp-revocation.js +2 -1
- package/dist/web-admin-client/read-warnings.d.ts +1 -0
- package/dist/web-admin-client/read-warnings.js +1 -0
- package/dist/web-admin-client/restart-signal.js +8 -4
- package/dist/web-admin-client/skills-mcp.d.ts +2 -2
- package/dist/web-admin-client/types.d.ts +1 -2
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/docs/error-text-lexicon.json +317 -0
- package/package.json +8 -3
- package/scripts/drain-check-local.mjs +118 -147
- package/scripts/drain-check.mysql.sql +22 -2
- package/scripts/drain-check.pg.sql +22 -2
- package/scripts/embed-minimal.mjs +183 -0
- package/wire-changes/server@7.148.0.json +1517 -0
- package/wire-changes/server@7.149.0.json +372 -0
- package/dist/http/memory-control-plane-corrupt-reply.d.ts +0 -25
- package/dist/http/memory-control-plane-corrupt-reply.js +0 -19
- package/dist/http/memory-layer-reply.d.ts +0 -30
- package/dist/http/memory-layer-reply.js +0 -24
- package/dist/lsp/e2b-bridge.d.ts +0 -57
- package/dist/lsp/e2b-bridge.js +0 -139
- package/dist/lsp/e2b-manager.d.ts +0 -93
- package/dist/lsp/e2b-manager.js +0 -178
- package/dist/lsp/lsp-frames.d.ts +0 -14
- package/dist/lsp/lsp-frames.js +0 -25
- package/dist/lsp/manager.d.ts +0 -129
- package/dist/lsp/manager.js +0 -127
- package/dist/lsp/types.d.ts +0 -12
- package/dist/lsp/types.js +0 -2
- package/dist/lsp/ws-transport.d.ts +0 -40
- package/dist/lsp/ws-transport.js +0 -210
- package/dist/plain-string-record.js +0 -70
|
@@ -7,7 +7,13 @@ import { PG_SCHEMA_STATEMENTS, acquirePgEnsureSchemaLock, releasePgEnsureSchemaL
|
|
|
7
7
|
import { createObjectColumnReader, decodeJsonColumn, decodeNullableJsonColumn, isJsonColumnBodyProblem, jsonColumnText, jsonColumnTextExpr, readOpaqueJsonValueColumn, } from "./sql-json-column.js";
|
|
8
8
|
import { incarnationFromCell, sessionFaceFromRow } from "../session-incarnation.js";
|
|
9
9
|
import { StoreBootRefusalError } from "./store-contracts.js";
|
|
10
|
-
import {
|
|
10
|
+
import { decodeRunResultCellM44 } from "./run-store-sql.js";
|
|
11
|
+
import { persistedPlaneOf } from "../terminal.js";
|
|
12
|
+
import { RUN_PREVIEW_COARSE_PREFIXES_M45, normalizedRunPreviewM45 } from "./run-preview-m45.js";
|
|
13
|
+
import { SHELL_SENTINEL_OWNER_M48, SHELL_SENTINEL_OWNER_TABLES_M48, shellSentinelOwnerWhereM48 } from "./shell-sentinel-owner-m48.js";
|
|
14
|
+
import { LEGACY_SKILL_EXEMPTION_PAGE } from "./approval-exemption-skill-m46.js";
|
|
15
|
+
import { SKILL_EXEMPTION_TOOL_NAME, readSqlSkillExemptionCutoff } from "./approval-exemption-skill-cutoff.js";
|
|
16
|
+
import { PERMISSION_RULE_TABLE, SqlDurableRulePartitionProvider, isSqlBucketRefusal, isSqlBucketVanished, listRuleBucketOwners } from "./permission-rule-store-sql.js";
|
|
11
17
|
import { SESSION_RULES_COLUMN } from "./session-rules-column.js";
|
|
12
18
|
import { readJsonObjectColumn } from "./sql-json-column.js";
|
|
13
19
|
import { retireStoredCardWords } from "../retired-card-words.js";
|
|
@@ -15,17 +21,19 @@ import { redactSecrets } from "../trace/redact.js";
|
|
|
15
21
|
import { CLAIM_OWNERLESS_PLACED_SQL, claimOwnerlessParams, isOrphanSessionOwner, judgeDelegatedOwner } from "../delegated-session-owner.js";
|
|
16
22
|
import { MAILBOX_KEYED_TABLES, mailboxKeyDeleteSql, storedMailboxKeyless } from "../stores-sql/mailbox-store-sql.js";
|
|
17
23
|
import { backfillWriterStatement, countOrphanBindingsStatement, migrateDeviceBindingsOntoSideTableStatements, migrateDeviceBindingsStatement } from "./execution-placement-sql.js";
|
|
18
|
-
import {
|
|
24
|
+
import { WITHDRAW_MARK_ID } from "./session-withdraw-sql.js";
|
|
25
|
+
import { EXECUTION_PLACEMENT_COLUMNS, SESSION_EXT_MOVED_COLUMNS, SESSION_EXT_TABLE } from "./session-ext-table.js";
|
|
19
26
|
import { APPROVAL_ASK_ENDING_CAUSE_COLUMN, APPROVAL_ASK_EXECUTION_LANE_COLUMN, APPROVAL_ASK_PARK_TRIGGER_COLUMN, APPROVAL_ASK_TABLE } from "./approval-ask-store-sql.js";
|
|
20
27
|
import { RENAMED_EXECUTION_LANE_M40, RETIRED_EXECUTION_LANE_WORD_M40, retiredExecutionLaneHintM40 } from "./execution-lane-rename-m40.js";
|
|
21
28
|
import { retireImportedLayerRootAllows } from "./imported-layer-root-retirement.js";
|
|
22
29
|
import { isUnusableArchive } from "../execution-placement.js";
|
|
30
|
+
import { IDENTITY_COLUMN_NAME, SCENARIO_PREFIX_LIKE, SCENARIO_PREFIX_MARKER_ID, ScenarioPrefixSwitchRefusedError } from "./scenario-prefix-switch-m42.js";
|
|
31
|
+
import { MIGRATION_MARKER_TABLE, SKILL_EXEMPTION_CUTOFF_ID, markIfAbsentSql, migrationMarkerDdl } from "./one-time-migration-marker.js";
|
|
32
|
+
import { describeUpgradeDriftTail, expectedTableShapes } from "./schema-consistency.js";
|
|
33
|
+
import { stopThenStartAction } from "./stop-then-start-sentence.js";
|
|
23
34
|
const RETIRED_SESSION_RULE_BUCKETS = ["commandAllow", "commandDeny"];
|
|
24
35
|
export function buildMigrationReceipts() {
|
|
25
36
|
return {
|
|
26
|
-
undurableScopeRuleRows: [],
|
|
27
|
-
undurableScopeRuleBucketsDeferred: 0,
|
|
28
|
-
undurableScopeRuleBucketsUnreadable: [],
|
|
29
37
|
sessionRuleRowsWithRetiredBuckets: [],
|
|
30
38
|
sessionRuleRowsWithOldGrammarEntries: [],
|
|
31
39
|
sessionRuleRowsWithUnreadableDeny: [],
|
|
@@ -54,12 +62,23 @@ export function buildMigrationReceipts() {
|
|
|
54
62
|
executionLaneWordsRenamed: 0,
|
|
55
63
|
sessionExtRowsMoved: 0,
|
|
56
64
|
sessionMetaColumnsDropped: 0,
|
|
65
|
+
scenarioPrefixSourcesScanned: 0,
|
|
66
|
+
withdrawMarkWritten: 0,
|
|
67
|
+
sessionDeletingSwitchMarked: 0,
|
|
68
|
+
runErrorCodeColumnRewritten: 0,
|
|
69
|
+
runObjectivePreviewRewritten: 0,
|
|
70
|
+
shellSentinelOwnersCleared: 0,
|
|
71
|
+
shellSentinelOwnerRowsRetained: [],
|
|
72
|
+
checkpointHostSessionsBackfilled: 0,
|
|
73
|
+
legacySkillExemptionsDropped: 0,
|
|
57
74
|
executionPlacementSessionsUnreadable: [],
|
|
58
75
|
localArchiveRowFactsBackfilled: 0,
|
|
59
76
|
localArchivesAnonymized: 0,
|
|
60
77
|
localArchivesKeptStamped: [],
|
|
61
78
|
localArchivesUnreadable: [],
|
|
62
79
|
localArchiveSnapshotsRecovered: 0,
|
|
80
|
+
localArchiveTokensAdopted: 0,
|
|
81
|
+
localArchiveTokensMinted: 0,
|
|
63
82
|
askCauseColumnsChanged: 0,
|
|
64
83
|
askParkTriggersMoved: 0,
|
|
65
84
|
askJournalRecordsUpgraded: 0,
|
|
@@ -76,10 +95,7 @@ function completedReport(r) {
|
|
|
76
95
|
return { ...r, sessionRuleColumn, workflowJournalScopeColumn };
|
|
77
96
|
}
|
|
78
97
|
function changedAnything(r) {
|
|
79
|
-
return (r.
|
|
80
|
-
r.undurableScopeRuleBucketsDeferred > 0 ||
|
|
81
|
-
r.undurableScopeRuleBucketsUnreadable.length > 0 ||
|
|
82
|
-
r.sessionRuleColumn === "renamed" ||
|
|
98
|
+
return (r.sessionRuleColumn === "renamed" ||
|
|
83
99
|
r.sessionRuleRowsWithRetiredBuckets.length > 0 ||
|
|
84
100
|
r.sessionRuleRowsWithOldGrammarEntries.length > 0 ||
|
|
85
101
|
r.sessionRuleRowsWithUnreadableDeny.length > 0 ||
|
|
@@ -109,12 +125,22 @@ function changedAnything(r) {
|
|
|
109
125
|
r.executionLaneWordsRenamed > 0 ||
|
|
110
126
|
r.sessionExtRowsMoved > 0 ||
|
|
111
127
|
r.sessionMetaColumnsDropped > 0 ||
|
|
128
|
+
r.withdrawMarkWritten > 0 ||
|
|
129
|
+
r.sessionDeletingSwitchMarked > 0 ||
|
|
130
|
+
r.runErrorCodeColumnRewritten > 0 ||
|
|
131
|
+
r.runObjectivePreviewRewritten > 0 ||
|
|
132
|
+
r.shellSentinelOwnersCleared > 0 ||
|
|
133
|
+
r.shellSentinelOwnerRowsRetained.length > 0 ||
|
|
134
|
+
r.checkpointHostSessionsBackfilled > 0 ||
|
|
135
|
+
r.legacySkillExemptionsDropped > 0 ||
|
|
112
136
|
r.executionPlacementSessionsUnreadable.length > 0 ||
|
|
113
137
|
r.localArchiveRowFactsBackfilled > 0 ||
|
|
114
138
|
r.localArchivesAnonymized > 0 ||
|
|
115
139
|
r.localArchivesKeptStamped.length > 0 ||
|
|
116
140
|
r.localArchivesUnreadable.length > 0 ||
|
|
117
141
|
r.localArchiveSnapshotsRecovered > 0 ||
|
|
142
|
+
r.localArchiveTokensAdopted > 0 ||
|
|
143
|
+
r.localArchiveTokensMinted > 0 ||
|
|
118
144
|
r.askCauseColumnsChanged > 0 ||
|
|
119
145
|
r.askParkTriggersMoved > 0 ||
|
|
120
146
|
r.askJournalRecordsUpgraded > 0 ||
|
|
@@ -125,13 +151,12 @@ function changedAnything(r) {
|
|
|
125
151
|
function readingsSnapshot(r) {
|
|
126
152
|
return {
|
|
127
153
|
...r,
|
|
128
|
-
undurableScopeRuleRows: [...r.undurableScopeRuleRows],
|
|
129
|
-
undurableScopeRuleBucketsUnreadable: [...r.undurableScopeRuleBucketsUnreadable],
|
|
130
154
|
sessionRuleRowsWithRetiredBuckets: [...r.sessionRuleRowsWithRetiredBuckets],
|
|
131
155
|
sessionRuleRowsWithOldGrammarEntries: [...r.sessionRuleRowsWithOldGrammarEntries],
|
|
132
156
|
sessionRuleRowsWithUnreadableDeny: [...r.sessionRuleRowsWithUnreadableDeny],
|
|
133
157
|
parkedApprovalCardRowsUnreadable: [...r.parkedApprovalCardRowsUnreadable],
|
|
134
158
|
parkedApprovalCardRowsTooLong: [...r.parkedApprovalCardRowsTooLong],
|
|
159
|
+
shellSentinelOwnerRowsRetained: [...r.shellSentinelOwnerRowsRetained],
|
|
135
160
|
executionPlacementSessionsUnreadable: [...r.executionPlacementSessionsUnreadable],
|
|
136
161
|
localArchivesKeptStamped: [...r.localArchivesKeptStamped],
|
|
137
162
|
localArchivesUnreadable: [...r.localArchivesUnreadable],
|
|
@@ -144,7 +169,6 @@ function receiptSentence(r) {
|
|
|
144
169
|
.filter(([, v]) => (typeof v === "number" ? v > 0 : v !== undefined))
|
|
145
170
|
.map(([k, v]) => `${k}=${String(v)}`);
|
|
146
171
|
const rows = [
|
|
147
|
-
...r.undurableScopeRuleRows.map((x) => `removed ${x.kind} in permission-rule bucket ${x.ownerKey} (${x.behavior} ${x.tool}, scope root ${JSON.stringify(x.scopeRoot)})`),
|
|
148
172
|
...r.sessionRuleRowsWithOldGrammarEntries.map((x) => `${x.policyKey} (session ${x.sessionId}): toolAllowDropped=${JSON.stringify(x.toolAllowDropped)}`),
|
|
149
173
|
...r.sessionRuleRowsWithUnreadableDeny.map((x) => `${x.policyKey} (session ${x.sessionId}): left as stored, toolDenyUnreadable=${JSON.stringify(x.toolDenyUnreadable)}${x.retiredBuckets !== undefined ? `, retiredBuckets=${JSON.stringify(x.retiredBuckets)}` : ""}`),
|
|
150
174
|
...r.importedLayerRootAllowsRetired.map((x) => `retired ${x.addsRetired} imported add(s) of an allow ${x.tool} rule in permission-rule bucket ${x.ownerKey} (${x.stillLive ? "the rule stays in effect through another approval" : "the rule no longer takes effect"})`),
|
|
@@ -161,36 +185,18 @@ export class OneTimeMigrationInterruptedError extends Error {
|
|
|
161
185
|
this.receipts = receipts;
|
|
162
186
|
}
|
|
163
187
|
}
|
|
188
|
+
const WORKFLOW_JOURNAL_TABLE = "workflow_journal";
|
|
189
|
+
const WORKFLOW_JOURNAL_OWNER_TABLE = "workflow_journal_owner";
|
|
190
|
+
const WORKFLOW_JOURNAL_STAGING = `${WORKFLOW_JOURNAL_TABLE}_m24`;
|
|
191
|
+
const WORKFLOW_JOURNAL_RETIRED = `${WORKFLOW_JOURNAL_TABLE}_m24_old`;
|
|
192
|
+
const WORKFLOW_JOURNAL_SUPPLIED_COLUMN = "incarnation";
|
|
193
|
+
const RETIRED_JOURNAL_SCOPE_COLUMN = "scope";
|
|
194
|
+
const SESSION_POLICY_TABLE = "session_policy";
|
|
195
|
+
const RETIRED_SESSION_RULES_COLUMN = "rules";
|
|
196
|
+
const OLD_GRAMMAR_SESSION_RULES_COLUMN = "rule_entries_old_grammar";
|
|
197
|
+
const RETIRED_ASK_CAUSE_COLUMN = "denied_reason";
|
|
198
|
+
const ASK_EXECUTION_LANE_COLUMN = "execution_lane";
|
|
164
199
|
export const ONE_TIME_MIGRATIONS = [
|
|
165
|
-
{
|
|
166
|
-
id: "M10",
|
|
167
|
-
introducedIn: "7.119.0",
|
|
168
|
-
releasedOn: "2026-10-08",
|
|
169
|
-
removableAfter: "2026-11-07",
|
|
170
|
-
removal: "删 local 车道的认领臂:`LocalSessionStore.register` 里「属主从没被记下的存量会话 ⇒ 带 principal 的登记认领它」那一支、认领日志行 `session_owner_claimed`" +
|
|
171
|
-
"(连同店构造参数里只为它存在的 `log` 位)与读本表 M10 行的 `ownerClaimWindowOpen`;`security.ts` `createAuthorizer` 里对无主会话的那次认领 `register` 调用;" +
|
|
172
|
-
"`http/routes/sessions.ts` 409 `conflict.session_ownerless` 句里「Ways out: on the local backend, during the upgrade window …」那半句(连同冻结表 " +
|
|
173
|
-
"`test/api-error-text-freeze.test.ts` 那一行、契约码目录 `docs/ASSISTANT-WIRE-CONTRACT.md` 那一行);本文件的 `migrationWindowOpen`(若再无别的读者)",
|
|
174
|
-
afterRemoval: "没有响亮臂(删码本身零行为变化:窗关那一刻起认领臂已经不生效):属主从没被记下的存量会话(边档那一格只有化身 —— 跳过了带本条的版本直接升," +
|
|
175
|
-
"或窗内从没被带 principal 提交过)照旧答无主(`headOf(id)?.owner` = null):它的会话规则这条路由读不了也改不了(409 `conflict.session_ownerless`)," +
|
|
176
|
-
"已存的规则对写下它们的 principal 的 run 照旧生效;出路 = 删会话(`DELETE /v1/sessions/:id`,规则随之删)",
|
|
177
|
-
reportKeys: [],
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
id: "M11",
|
|
181
|
-
introducedIn: "7.120.0",
|
|
182
|
-
releasedOn: "2026-10-08",
|
|
183
|
-
removableAfter: "2026-11-07",
|
|
184
|
-
removal: "删 migrateOn 的 M11 步(`permission_rule` 在场探针 + `purgeUndurableScopeRows` 调用)与 `permission-rule-store-sql.ts` 的 `purgeUndurableScopeRows` / " +
|
|
185
|
-
"`purgeOneBucket` / `contentFreeRefusal` / `UndurableScopeRuleRow` / `UnreadableRuleBucket` / `UndurableScopePurgeReadings` / " +
|
|
186
|
-
"`UndurableScopePurgeDb` / `UNDURABLE_PURGE_PAGE` / `UNDURABLE_PURGE_OCC_ATTEMPTS`、本文件的 `removedRuleRowNote`,以及 `BucketRefusedError` 的 `verdict` 位(若届时再无别的读者;" +
|
|
187
|
-
"判官 `decodeBucketRow` 与写法 `writeBucket` 是读腿 / 写臂本身,留);报告、日志行(含逐行的 `permission_rule_row_removed` 与逐桶的 " +
|
|
188
|
-
"`permission_rule_bucket_unreadable`)与 `NO_SQL_MIGRATIONS` 的 `undurableScopeRuleRows` / `undurableScopeRuleBucketsDeferred` / `undurableScopeRuleBucketsUnreadable`",
|
|
189
|
-
afterRemoval: "引擎读侧的既有响亮臂:scope root 不是完整绝对路径的存量行(跳过了带本条的版本直接升的库,或窗关之后别的写者写进来的)在有效视图里被丢、" +
|
|
190
|
-
"每次 run 一条 `permission.rule_row_dropped`(点名规则与 root)—— 那一行不参与任何检查,但撤销口删不动它(引擎的写臂对这种 scope 同样拒);" +
|
|
191
|
-
"出路 = 运维在库里把那只桶的那一行删掉(整桶 OCC 回写,指纹按 `buildRuleBucketChecksum` 重算)",
|
|
192
|
-
reportKeys: ["undurableScopeRuleRows", "undurableScopeRuleBucketsDeferred", "undurableScopeRuleBucketsUnreadable"],
|
|
193
|
-
},
|
|
194
200
|
{
|
|
195
201
|
id: "M12",
|
|
196
202
|
introducedIn: "7.122.0",
|
|
@@ -260,6 +266,7 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
260
266
|
"出路是先在一只带本条的版本上起服一次;② 行里仍带退役命令桶:SQL 店读回照旧答 `corrupt`(引擎的形读法点名那只桶,与本条在场时同一个结局),只是起服日志不再逐行点名 —— " +
|
|
261
267
|
"运维在库里把那一行改写成引擎文法或删掉它(删会话即删规则);③ 跳过本条直接升的库同样没有改名那一拍的条目判读 —— 由 ① 的拒启接住(出路同 ①)",
|
|
262
268
|
reportKeys: ["sessionRuleColumn", "sessionRuleRowsWithRetiredBuckets", "sessionRuleRowsWithOldGrammarEntries", "sessionRuleRowsWithUnreadableDeny"],
|
|
269
|
+
shapeChanges: [{ kind: "rename", table: SESSION_POLICY_TABLE, from: [RETIRED_SESSION_RULES_COLUMN, OLD_GRAMMAR_SESSION_RULES_COLUMN], to: SESSION_RULES_COLUMN.name }],
|
|
263
270
|
},
|
|
264
271
|
{
|
|
265
272
|
id: "M18",
|
|
@@ -313,7 +320,7 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
313
320
|
removal: "删 `src/stored-request-hooks-m20.ts` 整只文件(`storedHooksRereadM20` / `rereadStoredHooksM20` / `StoredHooksRereadM20` / `MATCHER_FIELD_NAMES` / `nodeAt` / `cloneDoc` / `removeKeyAt`);" +
|
|
314
321
|
"`boot/resolve-spec.ts` 里递给 `parseTaskSettings` 的重读座实参(`opts?.leg === \"fresh\" || !taskHooksHonored(config) ? {} : { storedHooksReread: storedHooksRereadM20(…) }`)与它的 import、" +
|
|
315
322
|
"`hooks_read_as_before_upgrade` 那一段 warn;`task-settings.ts` 的 `ParseTaskSettingsSeats` / `ParseTaskSettingsResult.hooksReread` / `parseTaskSettings` 第二形参与 hooks 臂里的重读那一支;" +
|
|
316
|
-
"`hooks/hook-runner.ts` 的 `ParseHooksConfigResult.pieces` / `HooksRefusalPiece`(若再无别的读者)
|
|
323
|
+
"`hooks/hook-runner.ts` 的 `ParseHooksConfigResult.pieces` / `HooksRefusalPiece`(若再无别的读者);" +
|
|
317
324
|
"「请求成员读不出」一问上的重读座走线:`unread-request-members.ts` 的 `storedHooksRereadM20` import 与 `unreadRequestMembers` 里 `hooksReread` 那一行(递给 `parseTaskSettings` 的 `storedHooksReread` 座)、" +
|
|
318
325
|
"`UnreadMembersLeg` 续跑臂的 `today` 字段(只为 M20 的窗问它)与 `http/stored-body-replay.ts`、`boot/resolve-spec.ts` 递 `today` 的那两处(`stored-body-replay.ts` 的 `today` 局部若 M19 已删再无读者一并删);" +
|
|
319
326
|
"`test/hooks-stored-reread-m20.test.ts`(窗关那一格 —— 续跑拒 409 `resume_blocked_by_policy` —— 改钉到 `test/hooks-entry-admission.test.ts` 的续跑腿组)",
|
|
@@ -380,6 +387,7 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
380
387
|
afterRemoval: "起服对账一族的列集探针接住(`schema-consistency.ts` 的 `assertSchemaMatchesCode`,常设):跳过了带本条的版本直接升的库,`workflow_journal` 上仍带 scope 列、没有 incarnation 列 = 库与代码列集不符 ⇒ " +
|
|
381
388
|
"响亮拒启(`config.schema_mismatch`),拒句点名两列;出路是先在带本条的版本(7.133.x)起服一次让它走完,再升",
|
|
382
389
|
reportKeys: ["workflowJournalScopeColumn", "workflowJournalOwnersBackfilled", "workflowJournalForeignScopeRowsRemoved"],
|
|
390
|
+
shapeChanges: [{ kind: "rebuild", table: WORKFLOW_JOURNAL_TABLE, whilePresent: RETIRED_JOURNAL_SCOPE_COLUMN, supplies: [WORKFLOW_JOURNAL_SUPPLIED_COLUMN] }],
|
|
383
391
|
},
|
|
384
392
|
{
|
|
385
393
|
id: "M25",
|
|
@@ -499,27 +507,31 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
499
507
|
"`runSqlOneTimeMigrations` 的第三参 `ExecutionPlacementSwitchInput`(若再无别的条目用它)与它在两只 SQL 后端 / 测试夹具上的实参;local 腿(`LocalBackend.runOneTimeMigrations` 里的 `backfillLocalExecutionPlacements` 与 `FileRunStore.sessionIdsWithRuns`);" +
|
|
500
508
|
"`execution-placement-sql.ts` 的 `backfillWriterStatement` / `migrateDeviceBindingsStatement` / `migrateDeviceBindingsOntoSideTableStatements` / `countOrphanBindingsStatement`;报告、日志行与 `NO_SQL_MIGRATIONS` 的 `executionPlacementColumnsAdded` / `deviceBindingsMoved` / " +
|
|
501
509
|
"`deviceBindingsOrphaned` / `deviceBindingTablesDropped` / `executionPlacementsBackfilled` / `executionPlacementSessionsUnreadable` 与 `device_bindings_orphaned` / `execution_placement_session_unreadable` 两行 warn;`test/execution-placement-switch-db-integration.test.ts` 整份与 `test/one-time-migrations.test.ts` 的 M32 组。" +
|
|
502
|
-
"**local 腿的回填席与它的点名词一并删**:`LocalSessionStore` 的 `executionPlacementBackfill`(属性与构造里的那一臂)
|
|
503
|
-
"`
|
|
510
|
+
"**local 腿的回填席与它的点名词一并删**:`LocalSessionStore` 的 `executionPlacementBackfill`(属性与构造里的那一臂)与它唯一的成员 `backfillPlacement`、`unusableArchiveOfFault`、" +
|
|
511
|
+
"`execution-placement.ts` 的 `LocalPlacementBackfillSeat` / `LocalPlacementBackfillOutcome` / `UnusableArchive` / `UnusableArchiveWord`(含它的 `storage` 词 —— 读存档文件时抛了别的故障、`errno` 随带,该词只有回填点名用)/ `isUnusableArchive`、" +
|
|
512
|
+
"`ExecutionPlacementSessionUnreadable`(会话店的观察与存档探针不随删:它们不带这几只型,说不出在不在就原样抛);" +
|
|
504
513
|
"`test/execution-placement-switch-local.test.ts` 与 `test/execution-placement-local-boot-unreadable-e2e.test.ts` 整份。" +
|
|
505
514
|
"**不随本条删**:执行放置八列、会话店的执行席、设备店的首绑 / 换绑两只写(常设的数据形)",
|
|
506
515
|
afterRemoval: "起服对账一族的跳版库拒启臂接住:删码同版把 `device_session` / `device_session_retired` 两张表加进退役 schema 判据(`schema-consistency.ts` 的跳版库探针,先于建表)⇒ " +
|
|
507
516
|
"跳过了带本条的版本直接升的库响亮拒启,出路 = 先在带本条的版本起服一次让切换走完,再升;缺执行放置列的库由列集对账缺列拒启(`config.schema_mismatch`,拒句给 ALTER),同一出路",
|
|
508
517
|
reportKeys: ["executionPlacementColumnsAdded", "deviceBindingsMoved", "deviceBindingsOrphaned", "deviceBindingTablesDropped", "executionPlacementsBackfilled", "askExecutionLanesBackfilled", "executionPlacementSessionsUnreadable"],
|
|
518
|
+
shapeChanges: [{ kind: "add", table: APPROVAL_ASK_TABLE, column: ASK_EXECUTION_LANE_COLUMN, whilePresent: { table: "session_meta", anyOf: SESSION_EXT_MOVED_COLUMNS.map((c) => c.name) } }],
|
|
509
519
|
},
|
|
510
520
|
{
|
|
511
521
|
id: "M33",
|
|
512
522
|
introducedIn: "7.141.0",
|
|
513
523
|
releasedOn: "2026-10-30",
|
|
514
524
|
removableAfter: "2026-11-29",
|
|
515
|
-
removal: "删 `LocalSessionStore.migrateLocalArchives` 与它的私有助手 `anonymizeArchiveHeld` / `fillRowFacts`、`settleArchiveSnapshots`
|
|
516
|
-
"
|
|
525
|
+
removal: "删 `LocalSessionStore.migrateLocalArchives` 与它的私有助手 `anonymizeArchiveHeld` / `fillRowFacts`、`settleArchiveSnapshots` 整只(逐份消化的循环与 `settleArchiveSnapshot`;`LocalBackend.ensureSchema` 里那一步)—— " +
|
|
526
|
+
"常设臂 `assertNoArchiveSnapshots`(只读)搬进数据根准入 `local-data-root-admission.ts` 的 `admitLocalDataRoot`(一格,本进程第一笔写之前判)、" +
|
|
527
|
+
"`archiveSnapshotsSettled` 字段、`rowFactsFilled` / `ARCHIVE_SNAPSHOT_RECORD` / `ArchiveSnapshotRecord` / `readArchiveSnapshotRecord` / `sameLog` / " +
|
|
528
|
+
"`ArchivedRowFacts` / `archivedRowFactsOf`(M47 仍在树时留着,随 M47 删)/ " +
|
|
517
529
|
"`ArchiveRewriteStep` / `LocalArchiveMigrationReading` / `errnoOf`、" +
|
|
518
|
-
"`archiveRewriteReadScope` / `noteReplayInArchiveRewriteRead` 与 `createLocalSessionRepo` 座里调它的那一腿、`SidecarMap.syncToDisk`(若再无别的调用方)
|
|
530
|
+
"`archiveRewriteReadScope` / `noteReplayInArchiveRewriteRead` 与 `createLocalSessionRepo` 座里调它的那一腿、`SidecarMap.syncToDisk`(若再无别的调用方);" +
|
|
519
531
|
"`store-backend.ts` 的 `LocalBackend.runOneTimeMigrations` 里对 `migrateLocalArchives` 的调用与报告五键的那五行;本文件的 `LocalArchiveKeptReason` / `LocalArchiveKeptStamped` / `LocalArchiveUnreadable`、" +
|
|
520
532
|
"报告 / 收据 / `changedAnything` / `readingsSnapshot` / `readingFields` 里的 `localArchiveRowFactsBackfilled` / `localArchivesAnonymized` / `localArchivesKeptStamped` / `localArchivesUnreadable` / `localArchiveSnapshotsRecovered`、" +
|
|
521
533
|
"`local_archive_kept_stamped` / `local_archive_unreadable` 两行 warn、读数行 note 里的 M33 句与头注 M33 段;`test/local-archive-owner.test.ts` 里标题含 `P3` / `P4` / `P5` / `P6` / `F1` / `F2` / `F3` 的格与 `legacyRoot` / `writeArchive` / `boot` / `M33_ZERO` / `m33Of` 助手。" +
|
|
522
|
-
"**不随本条删**:行格的 `createdAt` / `forkedFrom` 两键(常设的数据形)、`LocalArchiveSnapshotsPresentError` / `assertNoArchiveSnapshots` / `LOCAL_ARCHIVE_SNAPSHOT_DIR` 与 `LocalBackend.ensureSchema` 里调它的那一句、" +
|
|
534
|
+
"**不随本条删**:行格的 `createdAt` / `forkedFrom` 两键(常设的数据形)、存档目录屏障 `syncArchiveDirectory` 与 `fsyncPaths`(会话删序的常设一步)、`LocalArchiveSnapshotsPresentError` / `assertNoArchiveSnapshots` / `LOCAL_ARCHIVE_SNAPSHOT_DIR` 与 `LocalBackend.ensureSchema` 里调它的那一句、" +
|
|
523
535
|
"`session-error-wire.ts` 的 `StampedSessionArchiveError` / `STAMPED_SESSION_ARCHIVE_SENTENCE` / `sessionErrorWireOf` 与本店带戳判的唯一读口 `assertArchiveAnonymous`(fork 的源、改日志推送的落点、会话同步导入第一阶段的早拒三处问它)、行上缺建档时刻的 F 类读法(`server.local-session-row.created-at-absent`)",
|
|
524
536
|
afterRemoval: "三只常设臂接住:① 数据根下的快照目录非空 ⇒ 拒启(`config.local_archive_snapshot_present`,点名文件与两条出路);② 跳过了带本条的版本直接升的数据根(或本条留着的存档),带属主戳的存档被 fork、改日志的推送与会话同步导入第一阶段对 fork / stale 的早拒同一只具名拒(409 `conflict.session_archive_stamped` + 固定句,零写 / 行格净零写)," +
|
|
525
537
|
"读 / 续跑 / 拉取照常 —— 出路 = 删掉会话后重推,或升级时先过一次带本条的版本并在窗内起服;③ 行上没有建档时刻的格(同一类数据根)⇒ 列表 / 会话视图 / 交出的元数据读纪元(F 类 tag 计数)",
|
|
@@ -540,6 +552,10 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
540
552
|
"出路 = 先在带本条的版本起服一次让迁移走完,再升(列册对账见幽灵列 / 缺列同样拒启,但它的拒句给的是加列,不是这一出路 —— 所以退役判据要在删码同版加上);" +
|
|
541
553
|
"② local —— 信封号 1 的日志记录走 File 问账店「认不出的信封号」拒启(`unknown envelope version`,点名文件与出路:用写下它的那一版起服一次,或移开文件)",
|
|
542
554
|
reportKeys: ["askCauseColumnsChanged", "askParkTriggersMoved", "askJournalRecordsUpgraded"],
|
|
555
|
+
shapeChanges: [
|
|
556
|
+
{ kind: "rename", table: APPROVAL_ASK_TABLE, from: [RETIRED_ASK_CAUSE_COLUMN], to: APPROVAL_ASK_ENDING_CAUSE_COLUMN.name },
|
|
557
|
+
{ kind: "add", table: APPROVAL_ASK_TABLE, column: APPROVAL_ASK_PARK_TRIGGER_COLUMN.name },
|
|
558
|
+
],
|
|
543
559
|
},
|
|
544
560
|
{
|
|
545
561
|
id: "M35",
|
|
@@ -614,13 +630,15 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
614
630
|
introducedIn: "7.147.0",
|
|
615
631
|
releasedOn: "2026-11-07",
|
|
616
632
|
removableAfter: "2026-12-07",
|
|
617
|
-
removal: "删 `src/plugins/execution-lane-rename-m40.ts` 整只文件;本文件的 M40 步(`renameRetiredExecutionLaneWordsM40` / `refuseWhileRunsHeartbeat`〔它读的 `readLiveRunHeartbeat` / `LiveRunHeartbeat` 由 M41
|
|
633
|
+
removal: "删 `src/plugins/execution-lane-rename-m40.ts` 整只文件;本文件的 M40 步(`renameRetiredExecutionLaneWordsM40` / `refuseWhileRunsHeartbeat`〔它读的 `readLiveRunHeartbeat` / `LiveRunHeartbeat` 由 M41 / M42 共读,两条也已删码时随之删〕/ `ExecutionLaneRenameRefusedError` / " +
|
|
618
634
|
"`EXECUTION_LANE_RENAME_REFUSED_CODE` / `ExecutionLaneRenameInput`,`migrateStepsOn` 第一步那一行与 `SqlOneTimeMigrationInput` 里的那一半)、报告 / 收据 / 日志 / `NO_SQL_MIGRATIONS` 的 `executionLaneWordsRenamed`、头注 M40 段;" +
|
|
619
635
|
"`store-backend.ts` 的 `LocalBackend.ensureSchema` 第一步与 `executionLaneWordsRenamed` 字段、两只 SQL 后端递 `liveRunWindowMs` 的那一半;" +
|
|
636
|
+
"`local-session-store.ts` 的内核 `renameRetiredExecutionLaneWordsInCellsM40` 与数据根准入的具名读者 `readSessionMetaSidecarInWindow`(在内存里套的那一步;准入的解码点改用 `readSessionMetaSidecar`);" +
|
|
620
637
|
"`LocalSessionStore.renameRetiredExecutionLaneWordM40`、`FileApprovalAskStore.renameRetiredExecutionLaneWordM40` 与内核的 `renameExecutionLaneWord`;" +
|
|
621
638
|
"`approval-ask-store-sql.ts` / `execution-placement-sql.ts` 拒句里的 `retiredExecutionLaneHintM40(…)` 补句;`test/execution-lane-rename-m40.test.ts` 整只文件与 `test/execution-placement-switch-db-integration.test.ts` 的 M40 组",
|
|
622
639
|
afterRemoval: "既有读口的拒臂接住(响亮,不再改名):仍带旧词的行 —— 跳过了带本条的版本直接升的库、窗关之后还在写的更早版本副本 —— SQL 问行读口拒、会话执行格读口拒(`ExecutionPlacementRowError`)," +
|
|
623
640
|
"local 会话元数据边档整只严格拒启(`config.schema_mismatch`),local 问账日志由 M32 回填的词表外拒臂拒启(M32 删码之后:那只问行原样装回)。出路 = 升级时先过一次带本条的版本并起服",
|
|
641
|
+
stopThenStart: "renames the retired execution-lane word \"in-process\" to \"none\" on stored approval asks and sessions; a replica of an earlier version would keep writing the old word after the rename",
|
|
624
642
|
reportKeys: ["executionLaneWordsRenamed"],
|
|
625
643
|
},
|
|
626
644
|
{
|
|
@@ -631,10 +649,148 @@ export const ONE_TIME_MIGRATIONS = [
|
|
|
631
649
|
removal: "删本文件的 M41 步(`moveSessionCellsToSideTable` / `refuseSessionExtMoveWhileRunsHeartbeat` / `deploymentColumnsOnMeta` / `SessionExtMoveRefusedError` / `SESSION_EXT_MOVE_REFUSED_CODE` / " +
|
|
632
650
|
"`SessionExtMoveRefusalReason` / `sameCell` / `SESSION_EXT_MOVE_PAGE`,`migrateStepsOn` 里那两行)、报告 / 收据 / 日志 / `NO_SQL_MIGRATIONS` 的 `sessionExtRowsMoved` / `sessionMetaColumnsDropped`、头注 M41 段;" +
|
|
633
651
|
"M32 读形里的 `cellsOnSideTable` 判(它读本条的 `deploymentColumnsOnMeta`):M32 还在时改成恒旁表形 —— 删 M32 写 `session_meta` 八列的那些臂(② ④ ④b ⑥ 与 ③ 的 `migrateDeviceBindingsStatement` 臂)," +
|
|
634
|
-
"留 ③ 的旁表臂(`migrateDeviceBindingsOntoSideTableStatements`:围栏拒句的「采旧」在任何库上仍要能落到执行格);M32 先于本条删码时这些随 M32 一并删;`readLiveRunHeartbeat` 在 M40 也已删码时随之删;`test/session-ext-move-db-integration.test.ts` 整只文件",
|
|
652
|
+
"留 ③ 的旁表臂(`migrateDeviceBindingsOntoSideTableStatements`:围栏拒句的「采旧」在任何库上仍要能落到执行格);M32 先于本条删码时这些随 M32 一并删;`readLiveRunHeartbeat` 在 M40 与 M42 也已删码时随之删;`test/session-ext-move-db-integration.test.ts` 整只文件",
|
|
635
653
|
afterRemoval: "跳过了带本条的版本直接升上来的库:`session_meta` 上仍带部署格列 ⇒ 起服列册对账拒启(`config.schema_mismatch`,那几列是本树之外的多余列,拒句不给 ALTER —— 出路是带本条的版本);" +
|
|
636
654
|
"部署格从旁表读,旧列上的值不被任何读者读。出路 = 升级时先过一次带本条的版本并起服",
|
|
655
|
+
stopThenStart: "moves the session deployment cells from session_meta to session_ext and then retires the old columns; a cell an earlier replica writes between the copy and the retirement is lost, and every cell write it makes afterwards fails",
|
|
637
656
|
reportKeys: ["sessionExtRowsMoved", "sessionMetaColumnsDropped"],
|
|
657
|
+
shapeChanges: [{ kind: "drop", table: "session_meta", columns: SESSION_EXT_MOVED_COLUMNS.map((c) => c.name) }],
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
id: "M42",
|
|
661
|
+
introducedIn: "7.148.0",
|
|
662
|
+
releasedOn: "2026-11-08",
|
|
663
|
+
removableAfter: "2026-12-08",
|
|
664
|
+
removal: "删 `src/plugins/scenario-prefix-switch-m42.ts` 整只文件;本文件的 M42 步(`switchScenarioPrefixM42` / `scannedIdentityColumnsM42`,`migrateStepsOn` 第一步那一行)、报告 / 收据 / 日志的 `scenarioPrefixSourcesScanned`、头注 M42 段;" +
|
|
665
|
+
"`readLiveRunHeartbeat` / `LiveRunHeartbeat` 在 M40 与 M41 也已删码时随之删;`store-backend.ts` 的 `LocalBackend.runOneTimeMigrations` 里 M42 那一腿(`switchLocalScenarioPrefixM42`)与四只 File 店的 `scenarioPrefixOwnerRowsM42`(run / 会话 / 问 / 附件);`test/scenario-prefix-switch-m42.test.ts` 与 `test/scenario-prefix-switch-db-integration.test.ts` 两只文件。" +
|
|
666
|
+
"标记表 `one-time-migration-marker.ts` 不随删(常设:中央建表语句建它,`Skill` 豁免截点那一行的家);库里留下的 `M42` 标记行 / 数据根里的标记文件无人再读,不删",
|
|
667
|
+
afterRemoval: "没有响亮臂(如实):跳过了带本条的版本直接升的库,存量里以 `_scn:` 开头的身份被恢复管线读作某个人的场景(拆不出合文法的场景与人的 ⇒ `owner.malformed_subject` 响亮)。" +
|
|
668
|
+
"出路 = 升级时先过一次带本条的版本并起服(它扫一次、命中即拒启点名)",
|
|
669
|
+
stopThenStart: "scans stored identities for the reserved scenario prefix and records a marker; an earlier replica does not reserve the prefix and would keep accepting such identities after the scan",
|
|
670
|
+
reportKeys: ["scenarioPrefixSourcesScanned"],
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
id: "M43",
|
|
674
|
+
introducedIn: "7.148.0",
|
|
675
|
+
releasedOn: "2026-11-08",
|
|
676
|
+
removableAfter: "2026-12-08",
|
|
677
|
+
removal: "删本文件的 M43 步(`markWithdrawEnabledM43`,`migrateStepsOn` 里那一行)、报告 / 收据 / 日志 / `NO_SQL_MIGRATIONS` 的 `withdrawMarkWritten`、头注 M43 段;" +
|
|
678
|
+
"`plugins/session-withdraw-sql.ts` 的 `WITHDRAW_MARK_ID` 与部署判据里读标记的那一句(撤回出口无条件启用);标记表 `one-time-migration-marker.ts` 不随删(常设)、`plugins/session-birth.ts` 的 `upgrade_pending` 词与出口计数里的同名词;" +
|
|
679
|
+
"local 会话元数据格「没有 `clientWrites` 位 ⇒ upgrade_pending」那一臂;库里留下的标记行无人再读,不删(与 M42 同一张标记表)",
|
|
680
|
+
afterRemoval: "窗 30 天之后更早版本的副本早已不在;标记行不再被任何读者读(留着无害)。跳过了带本条的版本直接升上来的库:撤回出口从第一次起服就启用 —— " +
|
|
681
|
+
"跨两版以上的混跑本就不被支持(7.147.0 起的停-迁-起)。出路 = 升级时先过一次带本条的版本并起服",
|
|
682
|
+
reportKeys: ["withdrawMarkWritten"],
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
id: "M44",
|
|
686
|
+
introducedIn: "7.148.0",
|
|
687
|
+
releasedOn: "2026-11-08",
|
|
688
|
+
removableAfter: "2026-12-08",
|
|
689
|
+
removal: "删本文件的 M44 步(`rewriteRunErrorCodeColumnM44`,`migrateStepsOn` 里那一行)、报告 / 收据 / 日志 / `NO_SQL_MIGRATIONS` 的 `runErrorCodeColumnRewritten`、头注 M44 段;" +
|
|
690
|
+
"`run-store-sql.ts` 的读侧半场 `m44ErrorCodeReadSide`(行映射的码改成只读列;窗内停驻行列空时读结果体的码)与 `decodeRunResultCellM44`;" +
|
|
691
|
+
"local 腿 `FileRunStore.migrateRunErrorCodeColumnM44` 与 `LocalBackend.runOneTimeMigrations` 里那一格;`test/run-error-code-column.test.ts` 的 M44 组与双库集成文件的 M44 组",
|
|
692
|
+
afterRemoval: "没有响亮臂(如实):跳过了带本条的版本直接升上来的库,旧行按列答 —— 停驻两口在列建立之前写下的 `needs_review` 行 `errorCode` 缺席(`review.pending` 仍在 `result` 里)、" +
|
|
693
|
+
"列里是没折过的原码的旧行答原码;`result.terminal.code` 仍在 `result` 里。调长了停驻终局兜底(`APPROVAL_TERMINAL_BACKSTOP_MS` > 30 天)的部署,窗关时还可能有更早版本写下的停驻没结清,读法同上。" +
|
|
694
|
+
"出路 = 升级时先过一次带本条的版本并起服",
|
|
695
|
+
reportKeys: ["runErrorCodeColumnRewritten"],
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
id: "M45",
|
|
699
|
+
introducedIn: "7.148.0",
|
|
700
|
+
releasedOn: "2026-11-08",
|
|
701
|
+
removableAfter: "2026-12-08",
|
|
702
|
+
removal: "删 `src/plugins/run-preview-m45.ts` 整个文件;本文件的 M45 步(`rewriteRunObjectivePreviewM45`,`migrateStepsOn` 里那一行)、报告 / 收据 / 日志 / `NO_SQL_MIGRATIONS` 的 `runObjectivePreviewRewritten`、头注 M45 段;" +
|
|
703
|
+
"local 腿 `FileRunStore.migrateRunObjectivePreviewM45` 与 `LocalBackend.runOneTimeMigrations` 里那一格;" +
|
|
704
|
+
"`test/run-preview-m45.test.ts` 与 `test/helpers/run-preview-m45-rows.ts` 整个文件、`test/session-preview-single-source-db-integration.test.ts` 的 M45 组",
|
|
705
|
+
afterRemoval: "没有响亮臂(如实):跳过了带本条的版本直接升上来的库,7.124.0 之前写下的、以注入块起头的预览照旧按列答 —— 会话列表 / `GET /v1/tasks` / 助手任务行名 / 收件箱上显示那段块文本。" +
|
|
706
|
+
"出路 = 升级时先过一次带本条的版本并起服",
|
|
707
|
+
reportKeys: ["runObjectivePreviewRewritten"],
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
id: "M46",
|
|
711
|
+
introducedIn: "7.148.0",
|
|
712
|
+
releasedOn: "2026-11-08",
|
|
713
|
+
removableAfter: "2026-12-08",
|
|
714
|
+
removal: "删 `src/plugins/approval-exemption-skill-m46.ts` 整个文件;本文件的 M46 步(`dropLegacySkillExemptionsM46`,`migrateStepsOn` 里那一行)、报告 / 收据 / 日志 / `NO_SQL_MIGRATIONS` 的 `legacySkillExemptionsDropped`、头注 M46 段、`logReceiptRows` 里的 `legacy_skill_exemptions_dropped` 一行;" +
|
|
715
|
+
"`approval-exemption-store.ts` 的 `FileApprovalExemptionStore.dropToolRowsCreatedBeforeM46` 与 `LocalBackend.runOneTimeMigrations` 里那一格;" +
|
|
716
|
+
"`test/approval-exemption-skill-m46.test.ts` 整个文件、`test/one-time-migrations-db-integration.test.ts` 的 M46 组;" +
|
|
717
|
+
"跳版拒启臂的豁免:`store-backend.ts` 的 `withRetiredSchemaProbe` 与 `local-data-root-admission.ts` 的 `admitLocalDataRoot` 各一处 `migrationCarried(SKILL_EXEMPTION_CUTOFF_ID)` 实参、" +
|
|
718
|
+
"`assertSkillExemptionCutoffHeldOnPool` / `judgeSqlSkillExemptionCutoff` / `judgeLocalSkillExemptionCutoff` 的 `carried` 参数与它那一支(臂恒判;截点读不出的拒本来就不看它)。" +
|
|
719
|
+
"**不随本条删**(常设):`approval-exemption-skill-cutoff.ts` 整只(截点、工具名、两车道的判与落)、标记表 `one-time-migration-marker.ts` 与它的 `M46` 行(截点的家)、" +
|
|
720
|
+
"数据根里的 `one-time-migration-M46.marker`、`ensureSchema()` 的截点种子行、数据根准入锁内一步的落截点、`approval-exemption-store.ts` 的 `readExemptionLog`",
|
|
721
|
+
afterRemoval: "跳版拒启臂接住(常设,起服对账一族,先于本次起服对这只库的任何写;`approval-exemption-skill-cutoff.ts`):库里有首次放行早于 `Skill` 豁免截点 T0 的 `Skill` 行" +
|
|
722
|
+
"(SQL:标记表 `M46` 行 / local:`one-time-migration-M46.marker`;T0 缺席 ⇒ 任一 `Skill` 行)⇒ 拒启 `config.schema_mismatch`,零写 —— " +
|
|
723
|
+
"SQL 在 `ensureSchema()` 建表之前(`LegacySkillExemptionsPresentError`,与退役 schema 探针同一处),local 在数据根准入(读数种别 `skipped-required-migration`)。" +
|
|
724
|
+
"出路 = 先用一个仍带本条、不低于 7.148.0(local 还要不低于拒句里已记的引擎高水位)的版本对这只库完整起一次,再升;SQL 另可手工 `DELETE FROM approval_exemption WHERE tool_name = 'Skill'`。" +
|
|
725
|
+
"T0 由常设的一步落(SQL:`ensureSchema()` 建表之后的种子行;local:准入的锁内一步):判过、缺席才落 —— 删码之后全新的库照样有 T0,不会被自己写下的合法行拒",
|
|
726
|
+
reportKeys: ["legacySkillExemptionsDropped"],
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
id: "M47",
|
|
730
|
+
introducedIn: "7.148.0",
|
|
731
|
+
releasedOn: "2026-11-08",
|
|
732
|
+
removableAfter: "2026-12-08",
|
|
733
|
+
removal: "删 `LocalSessionStore.adoptArchiveTokensM47`(含欠账起服的 `required` 分档、证明 `assertArchiveTokensAdoptedM47` / `adoptionScopeOf` / `skippedFromAdoption` 与它那一处销账)与 `LocalArchiveTokenAdoption`;" +
|
|
734
|
+
"收令牌欠账的记账(`recordArchiveTokenAdoptionPending`);窗内长第一格的规则 `firstCellIncarnationOf` / `LocalSessionStore.firstCellIncarnationHeld`(调用点 —— 补铸、登记、执行位回填、M33 的行回填与快照恢复 —— 回到新铸);" +
|
|
735
|
+
"`judgeArchiveTokenAdoptionDuty` 的 `adoptionCarried` 参数与 `record` 那一支(`ArchiveTokenAdoptionDutyAction` 随之少 `record`,`settleArchiveTokenAdoptionDuty` 的那一臂同删)、`local-data-root-admission.ts` 里传它的那一处 `migrationCarried(\"M47\")`(臂恒判);" +
|
|
736
|
+
"`LocalBackend.ensureSchema` 里对 `adoptArchiveTokensM47` 的调用与两只读数字段、`runOneTimeMigrations` 里报告两键那几行;报告 / 收据 / `changedAnything` / `readingFields` / `NO_SQL_MIGRATIONS` 的 `localArchiveTokensAdopted` / `localArchiveTokensMinted`、头注 M47 段;" +
|
|
737
|
+
"M33 也已删码时连同 `archivedRowFactsOf` / `ArchivedRowFacts`;`test/local-root-one-row-store.test.ts` 里标题含 `P3` / `P4` 的格。" +
|
|
738
|
+
"**不随本条删**:跳版拒启臂 `judgeArchiveTokenAdoptionDuty`(不带本条那一支:标记在而无格存档为零 ⇒ `discharge`)/ `settleArchiveTokenAdoptionDuty` / `readSessionMetaCellsSync` / `archiveTokenAdoptionPendingPresent` / `dischargeArchiveTokenAdoptionPending` / `ARCHIVE_TOKEN_ADOPTION_SINCE`、读数种别 `skipped-required-migration` 与它按高水位分支的拒句(常设)",
|
|
739
|
+
afterRemoval: "跳版拒启臂接住(常设,数据根准入的一格:只读、本进程第一笔写之前、引擎高水位抬之前):(打开之前的引擎高水位早于 7.148.0 或缺席 ∨ 数据根里的收令牌欠账标记还在 —— 带本条的版本打开过、没收完)" +
|
|
740
|
+
"∧ 根里有存档在而会话元数据格缺的会话 ⇒ 拒启 `config.schema_mismatch`(读数种别 `skipped-required-migration`,点名会话数与版本),零写、不抬高水位 —— " +
|
|
741
|
+
"出路 = 先用一个仍带本条、不低于 7.148.0 且不低于已记高水位的版本(服务或 run-local)完整起一次,再升",
|
|
742
|
+
reportKeys: ["localArchiveTokensAdopted", "localArchiveTokensMinted"],
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
id: "M48",
|
|
746
|
+
introducedIn: "7.148.0",
|
|
747
|
+
releasedOn: "2026-11-08",
|
|
748
|
+
removableAfter: "2026-12-08",
|
|
749
|
+
removal: "删 `src/plugins/shell-sentinel-owner-m48.ts` 整个文件;本文件的 M48 步(`clearShellSentinelOwnersM48`,`migrateStepsOn` 里那一行)、报告 / 收据 / `changedAnything` / `readingFields` / `readingsSnapshot` / 日志的 `shellSentinelOwnersCleared` 与 `shellSentinelOwnerRowsRetained`(连同 `logReceiptRows` 里 `shell_sentinel_rows_retained` 那一支)、头注 M48 段;" +
|
|
750
|
+
"`SqlOneTimeMigrationInput` 里 M48 那一半(`ShellSentinelOwnerInput`)与它在两只 SQL 后端 / 测试夹具上的实参(`identityBoundary`);" +
|
|
751
|
+
"local 腿 `LocalSessionStore.clearShellSentinelOwnersM48` / `countShellSentinelOwnersM48` 与 `FileRunStore.clearShellSentinelOwnersM48` / `countShellSentinelOwnersM48`,以及 `LocalBackend.runOneTimeMigrations` 里那两格(改写读数与留存读数)(连同后端的 `identityBoundary` 字段);部署形表行 `identityBoundary` 不随删(dev-open 判据读它);" +
|
|
752
|
+
"`test/shell-sentinel-owner-m48.test.ts` 整个文件、`test/one-time-migrations-db-integration.test.ts` 的 M48 组",
|
|
753
|
+
afterRemoval: "没有响亮臂(如实):没有身份边界的部署跳过了带本条的版本直接升上来,哨兵属主的存量行仍记着那个字面量,属主面表已不认它 —— 不带主体的本地单用户读不到、续不上那些会话与 run(404)," +
|
|
754
|
+
"带同一个头的请求仍读得到(属主相同)。出路 = 升级时先过一次带本条的版本并起服(或运维手工 `UPDATE <表> SET owner = NULL WHERE owner = 'anon:shell-live'`,三张表见删法)。" +
|
|
755
|
+
"有身份边界的部署本条本来就零改写,删码前后同答(哨兵是一位普通的具名属主)",
|
|
756
|
+
reportKeys: ["shellSentinelOwnersCleared", "shellSentinelOwnerRowsRetained"],
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
id: "M49",
|
|
760
|
+
introducedIn: "7.148.0",
|
|
761
|
+
releasedOn: "2026-11-08",
|
|
762
|
+
removableAfter: "2026-12-08",
|
|
763
|
+
removal: "删本文件的 M49 步(`backfillCheckpointHostSessionsM49`,`migrateStepsOn` 里那一行)与 `HOST_SESSION_BACKFILL_PAGE`、报告 / 收据 / 日志的 `checkpointHostSessionsBackfilled`、头注 M49 段;" +
|
|
764
|
+
"local 腿 `LocalCheckpointStore.backfillHostSessionsM49` 与 `LocalBackend.runOneTimeMigrations` 里那一格;`test/checkpoint-host-session.test.ts` 的 M49 组、" +
|
|
765
|
+
"`test/one-time-migrations-db-integration.test.ts` 的 M49 组。**不随本条删**:`host_session_id` 列、写口的 `hostSessionOf`、按 run 找卡的读口(常设)",
|
|
766
|
+
afterRemoval: "没有响亮臂(如实):跳过了带本条的版本直接升上来的库,升级前停下、升级后仍挂着的卡归属为空 —— 按 run 找卡的读口找不到它:取消那条 run 不作废它、" +
|
|
767
|
+
"两条停驻收割把那条 run 当成「卡已不在」收掉(`approval.expired`)、决断答 409 `conflict.resume_context_unavailable`,卡由终局兜底收割收走。出路 = 升级前答完 / 拒掉停驻的卡," +
|
|
768
|
+
"或升级时先过一次带本条的版本并起服(或运维手工 `UPDATE checkpoint SET host_session_id = session_id WHERE host_session_id IS NULL`)",
|
|
769
|
+
reportKeys: ["checkpointHostSessionsBackfilled"],
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
id: "M50",
|
|
773
|
+
introducedIn: "7.148.0",
|
|
774
|
+
releasedOn: "2026-11-08",
|
|
775
|
+
removableAfter: "2026-12-08",
|
|
776
|
+
removal: "删 `src/plugins/approval-ask-retired-delete-by-task-m50.ts` 整只文件(`RETIRED_DELETE_BY_TASK_OP_M50` / `retiredDeleteByTaskReplayOpenM50` / `retiredDeleteByTaskClosedWhyM50`);" +
|
|
777
|
+
"`approval-ask-store-file.ts` 重放里认它的那一段(`replayRecord` 里 `probe.op === RETIRED_DELETE_BY_TASK_OP_M50` 一段)、`retiredDeleteByTaskRecordsM50` 计数与构造器末段那一行 stderr、那一行 import、顶注里随 M50 的那半句;" +
|
|
778
|
+
"`approval-ask-store-memory.ts` 的 `deleteByTaskM50`;`test/approval-ask-session-cascade.test.ts` 的 M50 组(窗内 / 窗关当天 / 窗关次日 / 坏记录四格与 `withM50Window` 助手);本文件头注 M50 段",
|
|
779
|
+
afterRemoval: "既有的词表外动词拒启(`approval-ask-store-file.ts` 重放的动词闭集判,拒句点名账本路径,出路 = 用写下它的那一版起服一次或把文件挪开)—— 与窗关之后本条自己的拒启同一个结局,删码零行为变化。" +
|
|
780
|
+
"会撞上它的是窗内一次都没在带本条的版本上起过服的 local 数据根(跳过本版直接升的),账本里又恰好留着一条嵌入方写下的这只词",
|
|
781
|
+
reportKeys: [],
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
id: "M51",
|
|
785
|
+
introducedIn: "7.148.0",
|
|
786
|
+
releasedOn: "2026-11-08",
|
|
787
|
+
removableAfter: "2026-12-08",
|
|
788
|
+
removal: "删本文件的 M51 步(`switchSessionDeletingM51` / `SessionDeletingSwitchRefusedError` / `SESSION_DELETING_SWITCH_REFUSED_CODE` / `SESSION_DELETING_MARK_ID`,`migrateStepsOn` 里那一行)、" +
|
|
789
|
+
"报告 / 收据 / `changedAnything` / `readingFields` / `NO_SQL_MIGRATIONS` 的 `sessionDeletingSwitchMarked`、头注 M51 段;`test/session-deleting-state-db-integration.test.ts` 的 M51 组;" +
|
|
790
|
+
"库里留下的 `M51` 标记行无人再读,不删。**不随本条删**:在删态本身(列、围栏、规则 L 的在删半、终刀判令牌 —— 常设)、标记表 `one-time-migration-marker.ts`(常设)",
|
|
791
|
+
afterRemoval: "没有响亮臂(也无需):窗 30 天之后更早版本的副本早已不在;跳过了带本条的版本直接升上来的库 —— 跨两版以上的混跑本就不被支持(7.147.0 起的停-迁-起)。出路 = 升级时先过一次带本条的版本并起服",
|
|
792
|
+
stopThenStart: "switches session deletion to a deleting state that every replica must read; an earlier replica does not read it and would accept a submission on a session this version is deleting",
|
|
793
|
+
reportKeys: ["sessionDeletingSwitchMarked"],
|
|
638
794
|
},
|
|
639
795
|
];
|
|
640
796
|
export function migrationWindowOpen(window, today) {
|
|
@@ -648,10 +804,13 @@ export function migrationWindowEnd(id) {
|
|
|
648
804
|
throw new Error(`one-time-migrations: ${id} is in the unreleased form (removableAfter: null) — there is no window end to quote yet`);
|
|
649
805
|
return row.removableAfter;
|
|
650
806
|
}
|
|
807
|
+
export function migrationCarried(id) {
|
|
808
|
+
return ONE_TIME_MIGRATIONS.some((w) => w.id === id);
|
|
809
|
+
}
|
|
810
|
+
export function stopThenStartMigrations(registry = ONE_TIME_MIGRATIONS) {
|
|
811
|
+
return registry.flatMap((row) => (row.stopThenStart === undefined ? [] : [{ id: row.id, reason: row.stopThenStart }]));
|
|
812
|
+
}
|
|
651
813
|
export const NO_SQL_MIGRATIONS = {
|
|
652
|
-
undurableScopeRuleRows: [],
|
|
653
|
-
undurableScopeRuleBucketsDeferred: 0,
|
|
654
|
-
undurableScopeRuleBucketsUnreadable: [],
|
|
655
814
|
sessionRuleColumn: "file-store",
|
|
656
815
|
sessionRuleRowsWithRetiredBuckets: [],
|
|
657
816
|
sessionRuleRowsWithOldGrammarEntries: [],
|
|
@@ -679,6 +838,8 @@ export const NO_SQL_MIGRATIONS = {
|
|
|
679
838
|
deviceBindingTablesDropped: 0,
|
|
680
839
|
sessionExtRowsMoved: 0,
|
|
681
840
|
sessionMetaColumnsDropped: 0,
|
|
841
|
+
withdrawMarkWritten: 0,
|
|
842
|
+
sessionDeletingSwitchMarked: 0,
|
|
682
843
|
askCauseColumnsChanged: 0,
|
|
683
844
|
askParkTriggersMoved: 0,
|
|
684
845
|
};
|
|
@@ -779,8 +940,14 @@ async function migrateOn(db, dialect, input) {
|
|
|
779
940
|
return completedReport(receipts);
|
|
780
941
|
}
|
|
781
942
|
async function migrateStepsOn(db, dialect, receipts, input) {
|
|
943
|
+
await switchScenarioPrefixM42(db, dialect, receipts, input);
|
|
782
944
|
await renameRetiredExecutionLaneWordsM40(db, dialect, receipts, input);
|
|
783
945
|
await refuseSessionExtMoveWhileRunsHeartbeat(db, dialect, input);
|
|
946
|
+
await switchSessionDeletingM51(db, dialect, receipts, input);
|
|
947
|
+
await rewriteRunErrorCodeColumnM44(db, dialect, receipts);
|
|
948
|
+
await rewriteRunObjectivePreviewM45(db, dialect, receipts);
|
|
949
|
+
await clearShellSentinelOwnersM48(db, dialect, receipts, input);
|
|
950
|
+
await backfillCheckpointHostSessionsM49(db, dialect, receipts);
|
|
784
951
|
await migrateRetiredCardWords(db, dialect, receipts);
|
|
785
952
|
await splitApprovalAskCauseColumns(db, dialect, receipts);
|
|
786
953
|
await migrateSessionRuleGrammar(db, dialect, receipts);
|
|
@@ -788,8 +955,6 @@ async function migrateStepsOn(db, dialect, receipts, input) {
|
|
|
788
955
|
await backfillParkedApprovalCards(db, dialect, receipts);
|
|
789
956
|
if (await tableExists(db, dialect, "session_meta"))
|
|
790
957
|
await inheritPlacedSessionOwners(db, dialect, receipts);
|
|
791
|
-
if ((await tableExists(db, dialect, PERMISSION_RULE_TABLE)) && (await columnExists(db, dialect, PERMISSION_RULE_TABLE, "grammar")))
|
|
792
|
-
await purgeUndurableScopeRows(db, dialect, receipts);
|
|
793
958
|
if ((await tableExists(db, dialect, PERMISSION_RULE_TABLE)) && (await columnExists(db, dialect, PERMISSION_RULE_TABLE, "grammar"))) {
|
|
794
959
|
await retireImportedLayerRootAllows(createSqlImportedLayerRootSource({ dialect, query: (sql, params) => db.query(sql, params) }), receipts);
|
|
795
960
|
}
|
|
@@ -799,6 +964,202 @@ async function migrateStepsOn(db, dialect, receipts, input) {
|
|
|
799
964
|
await dropRejectedMailboxKeys(db, dialect, receipts);
|
|
800
965
|
await switchExecutionPlacement(db, dialect, receipts, input);
|
|
801
966
|
await moveSessionCellsToSideTable(db, dialect, receipts);
|
|
967
|
+
await markWithdrawEnabledM43(db, dialect, receipts, input);
|
|
968
|
+
await dropLegacySkillExemptionsM46(db, dialect, receipts);
|
|
969
|
+
}
|
|
970
|
+
const M44_PAGE = 500;
|
|
971
|
+
async function rewriteRunErrorCodeColumnM44(db, dialect, receipts) {
|
|
972
|
+
if (!(await tableExists(db, dialect, "task_run")))
|
|
973
|
+
return;
|
|
974
|
+
receipts.runErrorCodeColumnRewritten += await db.exec("UPDATE task_run SET error_code = NULL WHERE status = 'running' AND error_code IS NOT NULL");
|
|
975
|
+
let after = "";
|
|
976
|
+
for (;;) {
|
|
977
|
+
const page = await db.rows(dialect === "mysql"
|
|
978
|
+
? `SELECT task_id, status, updated_at, error_code, ${jsonColumnText(dialect, "result")} FROM task_run WHERE task_id > ? AND result IS NOT NULL AND status <> 'running' ORDER BY task_id LIMIT ${M44_PAGE}`
|
|
979
|
+
: `SELECT task_id, status, updated_at, error_code, ${jsonColumnText(dialect, "result")} FROM task_run WHERE task_id > $1 AND result IS NOT NULL AND status <> 'running' ORDER BY task_id LIMIT ${M44_PAGE}`, [after]);
|
|
980
|
+
for (const row of page) {
|
|
981
|
+
const taskId = String(row["task_id"]);
|
|
982
|
+
const first = await rewriteOneRunErrorCodeM44(db, dialect, row);
|
|
983
|
+
if (first !== 0) {
|
|
984
|
+
if (first > 0)
|
|
985
|
+
receipts.runErrorCodeColumnRewritten += 1;
|
|
986
|
+
continue;
|
|
987
|
+
}
|
|
988
|
+
const [now] = await db.rows(dialect === "mysql"
|
|
989
|
+
? `SELECT task_id, status, updated_at, error_code, ${jsonColumnText(dialect, "result")} FROM task_run WHERE task_id = ? AND result IS NOT NULL AND status <> 'running'`
|
|
990
|
+
: `SELECT task_id, status, updated_at, error_code, ${jsonColumnText(dialect, "result")} FROM task_run WHERE task_id = $1 AND result IS NOT NULL AND status <> 'running'`, [taskId]);
|
|
991
|
+
if (now !== undefined && (await rewriteOneRunErrorCodeM44(db, dialect, now)) > 0)
|
|
992
|
+
receipts.runErrorCodeColumnRewritten += 1;
|
|
993
|
+
}
|
|
994
|
+
if (page.length < M44_PAGE)
|
|
995
|
+
return;
|
|
996
|
+
after = String(page[page.length - 1]["task_id"]);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
async function rewriteOneRunErrorCodeM44(db, dialect, row) {
|
|
1000
|
+
const taskId = String(row["task_id"]);
|
|
1001
|
+
const storedCode = row["error_code"] ?? null;
|
|
1002
|
+
const result = decodeRunResultCellM44(row["result"], taskId);
|
|
1003
|
+
if (result === "unreadable" || result === null)
|
|
1004
|
+
return -1;
|
|
1005
|
+
const target = persistedPlaneOf(result).errorCode ?? storedCode;
|
|
1006
|
+
if (target === storedCode)
|
|
1007
|
+
return -1;
|
|
1008
|
+
return db.exec(dialect === "mysql"
|
|
1009
|
+
? "UPDATE task_run SET error_code = ? WHERE task_id = ? AND status = ? AND updated_at = ? AND error_code <=> ?"
|
|
1010
|
+
: "UPDATE task_run SET error_code = $1 WHERE task_id = $2 AND status = $3 AND updated_at = $4 AND error_code IS NOT DISTINCT FROM $5", [target, taskId, String(row["status"]), row["updated_at"], storedCode]);
|
|
1011
|
+
}
|
|
1012
|
+
const M45_PAGE = 500;
|
|
1013
|
+
async function rewriteRunObjectivePreviewM45(db, dialect, receipts) {
|
|
1014
|
+
if (!(await tableExists(db, dialect, "task_run")))
|
|
1015
|
+
return;
|
|
1016
|
+
const ph = (i) => (dialect === "mysql" ? "?" : `$${i}`);
|
|
1017
|
+
const coarse = RUN_PREVIEW_COARSE_PREFIXES_M45.map((_, i) => `objective_preview LIKE ${ph(i + 2)}`).join(" OR ");
|
|
1018
|
+
let after = "";
|
|
1019
|
+
for (;;) {
|
|
1020
|
+
const page = await db.rows(`SELECT task_id, objective_preview FROM task_run WHERE task_id > ${ph(1)} AND (${coarse}) ORDER BY task_id LIMIT ${M45_PAGE}`, [after, ...RUN_PREVIEW_COARSE_PREFIXES_M45]);
|
|
1021
|
+
for (const row of page) {
|
|
1022
|
+
const current = row["objective_preview"];
|
|
1023
|
+
if (typeof current !== "string")
|
|
1024
|
+
continue;
|
|
1025
|
+
const target = normalizedRunPreviewM45(current);
|
|
1026
|
+
if (target === undefined || target === current)
|
|
1027
|
+
continue;
|
|
1028
|
+
receipts.runObjectivePreviewRewritten += await db.exec(dialect === "mysql" ? "UPDATE task_run SET objective_preview = ? WHERE task_id = ? AND objective_preview = ?" : "UPDATE task_run SET objective_preview = $1 WHERE task_id = $2 AND objective_preview = $3", [target, String(row["task_id"]), current]);
|
|
1029
|
+
}
|
|
1030
|
+
if (page.length < M45_PAGE)
|
|
1031
|
+
return;
|
|
1032
|
+
after = String(page[page.length - 1]["task_id"]);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
export async function clearShellSentinelOwnersM48(db, dialect, receipts, input) {
|
|
1036
|
+
const rewrite = input.identityBoundary === false;
|
|
1037
|
+
const sentinelOwner = shellSentinelOwnerWhereM48(dialect);
|
|
1038
|
+
for (const table of SHELL_SENTINEL_OWNER_TABLES_M48) {
|
|
1039
|
+
if (!(await tableExists(db, dialect, table)))
|
|
1040
|
+
continue;
|
|
1041
|
+
if (rewrite) {
|
|
1042
|
+
receipts.shellSentinelOwnersCleared += await db.exec(`UPDATE ${table} SET owner = NULL WHERE ${sentinelOwner}`, [SHELL_SENTINEL_OWNER_M48]);
|
|
1043
|
+
continue;
|
|
1044
|
+
}
|
|
1045
|
+
const rows = Number((await db.rows(`SELECT COUNT(*) AS n FROM ${table} WHERE ${sentinelOwner}`, [SHELL_SENTINEL_OWNER_M48]))[0]?.["n"] ?? 0);
|
|
1046
|
+
if (rows > 0)
|
|
1047
|
+
receipts.shellSentinelOwnerRowsRetained.push({ surface: table, rows });
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const HOST_SESSION_BACKFILL_PAGE = 500;
|
|
1051
|
+
async function backfillCheckpointHostSessionsM49(db, dialect, receipts) {
|
|
1052
|
+
if (!(await tableExists(db, dialect, "checkpoint")) || !(await columnExists(db, dialect, "checkpoint", "host_session_id")))
|
|
1053
|
+
return;
|
|
1054
|
+
const ph = (i) => (dialect === "mysql" ? "?" : `$${i}`);
|
|
1055
|
+
let after = "";
|
|
1056
|
+
for (;;) {
|
|
1057
|
+
const page = (await db.rows(`SELECT token FROM checkpoint WHERE host_session_id IS NULL AND token > ${ph(1)} ORDER BY token ASC LIMIT ${HOST_SESSION_BACKFILL_PAGE}`, [after])).map((r) => String(r.token));
|
|
1058
|
+
if (page.length === 0)
|
|
1059
|
+
return;
|
|
1060
|
+
receipts.checkpointHostSessionsBackfilled += await db.exec(`UPDATE checkpoint SET host_session_id = session_id WHERE host_session_id IS NULL AND token IN (${page.map((_, i) => ph(i + 1)).join(", ")})`, page);
|
|
1061
|
+
after = page[page.length - 1];
|
|
1062
|
+
if (page.length < HOST_SESSION_BACKFILL_PAGE)
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
export async function dropLegacySkillExemptionsM46(db, dialect, receipts) {
|
|
1067
|
+
if (!(await tableExists(db, dialect, "approval_exemption")))
|
|
1068
|
+
return;
|
|
1069
|
+
if (!(await tableExists(db, dialect, MIGRATION_MARKER_TABLE)))
|
|
1070
|
+
await execUntil(db, migrationMarkerDdl(dialect), () => tableExists(db, dialect, MIGRATION_MARKER_TABLE));
|
|
1071
|
+
const ph = (i) => (dialect === "mysql" ? "?" : `$${i}`);
|
|
1072
|
+
const readMark = () => readSqlSkillExemptionCutoff((sql, params) => db.rows(sql, params), dialect);
|
|
1073
|
+
let markedAtMs = await readMark();
|
|
1074
|
+
if (markedAtMs === undefined) {
|
|
1075
|
+
await db.exec(markIfAbsentSql(dialect), [SKILL_EXEMPTION_CUTOFF_ID, Date.now()]);
|
|
1076
|
+
markedAtMs = await readMark();
|
|
1077
|
+
}
|
|
1078
|
+
if (markedAtMs === undefined)
|
|
1079
|
+
throw new Error("one-time migration M46: the marker row is missing right after it was written — refusing to delete rows without a recorded cutoff");
|
|
1080
|
+
const cutoff = new Date(markedAtMs);
|
|
1081
|
+
let after = "";
|
|
1082
|
+
for (;;) {
|
|
1083
|
+
const page = await db.rows(`SELECT session_id FROM approval_exemption WHERE tool_name = ${ph(1)} AND created_at < ${ph(2)} AND session_id > ${ph(3)} ORDER BY session_id LIMIT ${LEGACY_SKILL_EXEMPTION_PAGE}`, [SKILL_EXEMPTION_TOOL_NAME, cutoff, after]);
|
|
1084
|
+
if (page.length === 0)
|
|
1085
|
+
return;
|
|
1086
|
+
const sessionIds = page.map((r) => String(r["session_id"]));
|
|
1087
|
+
receipts.legacySkillExemptionsDropped += await db.exec(`DELETE FROM approval_exemption WHERE tool_name = ${ph(1)} AND created_at < ${ph(2)} AND session_id IN (${sessionIds.map((_, i) => ph(i + 3)).join(", ")})`, [SKILL_EXEMPTION_TOOL_NAME, cutoff, ...sessionIds]);
|
|
1088
|
+
if (page.length < LEGACY_SKILL_EXEMPTION_PAGE)
|
|
1089
|
+
return;
|
|
1090
|
+
after = sessionIds[sessionIds.length - 1];
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
async function markWithdrawEnabledM43(db, dialect, receipts, input) {
|
|
1094
|
+
if (!(await tableExists(db, dialect, MIGRATION_MARKER_TABLE)))
|
|
1095
|
+
await execUntil(db, migrationMarkerDdl(dialect), () => tableExists(db, dialect, MIGRATION_MARKER_TABLE));
|
|
1096
|
+
const marked = await db.rows(dialect === "mysql" ? `SELECT 1 AS present FROM ${MIGRATION_MARKER_TABLE} WHERE migration_id = ?` : `SELECT 1 AS present FROM ${MIGRATION_MARKER_TABLE} WHERE migration_id = $1`, [WITHDRAW_MARK_ID]);
|
|
1097
|
+
if (marked.length > 0)
|
|
1098
|
+
return;
|
|
1099
|
+
if ((await readLiveRunHeartbeat(db, dialect, input)) !== undefined)
|
|
1100
|
+
return;
|
|
1101
|
+
receipts.withdrawMarkWritten += await db.exec(markIfAbsentSql(dialect), [WITHDRAW_MARK_ID, Date.now()]);
|
|
1102
|
+
}
|
|
1103
|
+
export const SESSION_DELETING_MARK_ID = "M51";
|
|
1104
|
+
export const SESSION_DELETING_SWITCH_REFUSED_CODE = "config.session_deleting_switch_refused";
|
|
1105
|
+
export class SessionDeletingSwitchRefusedError extends StoreBootRefusalError {
|
|
1106
|
+
code = SESSION_DELETING_SWITCH_REFUSED_CODE;
|
|
1107
|
+
reason = "live_runs";
|
|
1108
|
+
constructor(live, tail = "") {
|
|
1109
|
+
super(`${SESSION_DELETING_SWITCH_REFUSED_CODE} (reason: live_runs): this version deletes a session through a deleting state that every replica must read ` +
|
|
1110
|
+
`(a submission on a session being deleted is refused), but ${live.liveRuns} running run(s) heartbeated on this database within the last ${live.windowSec}s (REAP_RUN_STALE_SEC) — ` +
|
|
1111
|
+
"a replica of an earlier version may still be serving; it does not read that state and would accept a submission on a session this version is deleting. Nothing was changed and no marker was written. " +
|
|
1112
|
+
stopThenStartAction(live.after) +
|
|
1113
|
+
tail);
|
|
1114
|
+
this.name = "SessionDeletingSwitchRefusedError";
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
async function switchSessionDeletingM51(db, dialect, receipts, input) {
|
|
1118
|
+
if (!(await tableExists(db, dialect, MIGRATION_MARKER_TABLE)))
|
|
1119
|
+
await execUntil(db, migrationMarkerDdl(dialect), () => tableExists(db, dialect, MIGRATION_MARKER_TABLE));
|
|
1120
|
+
const marked = await db.rows(dialect === "mysql" ? `SELECT 1 AS present FROM ${MIGRATION_MARKER_TABLE} WHERE migration_id = ?` : `SELECT 1 AS present FROM ${MIGRATION_MARKER_TABLE} WHERE migration_id = $1`, [SESSION_DELETING_MARK_ID]);
|
|
1121
|
+
if (marked.length > 0)
|
|
1122
|
+
return;
|
|
1123
|
+
const heartbeat = await readLiveRunHeartbeat(db, dialect, input);
|
|
1124
|
+
if (heartbeat !== undefined)
|
|
1125
|
+
throw new SessionDeletingSwitchRefusedError(heartbeat, await describeUpgradeDriftTail((sql) => db.rows(sql), dialect));
|
|
1126
|
+
receipts.sessionDeletingSwitchMarked += await db.exec(markIfAbsentSql(dialect), [SESSION_DELETING_MARK_ID, Date.now()]);
|
|
1127
|
+
}
|
|
1128
|
+
export async function scannedIdentityColumnsM42(db, dialect) {
|
|
1129
|
+
const scope = dialect === "mysql" ? "DATABASE()" : "current_schema()";
|
|
1130
|
+
const live = new Set((await db.rows(`SELECT table_name AS t, column_name AS c FROM information_schema.columns WHERE table_schema = ${scope}`)).map((r) => `${String(r["t"] ?? r["T"])}.${String(r["c"] ?? r["C"])}`));
|
|
1131
|
+
const out = [];
|
|
1132
|
+
for (const [table, shape] of await expectedTableShapes(dialect)) {
|
|
1133
|
+
for (const c of shape.columns) {
|
|
1134
|
+
if (!IDENTITY_COLUMN_NAME.test(c.name) || !/^\S+\s+(VAR)?(CHAR|BINARY)\(|^\S+\s+TEXT\b/i.test(c.ddl))
|
|
1135
|
+
continue;
|
|
1136
|
+
if (live.has(`${table}.${c.name}`))
|
|
1137
|
+
out.push({ table, column: c.name });
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
return out.sort((a, b) => `${a.table}.${a.column}`.localeCompare(`${b.table}.${b.column}`));
|
|
1141
|
+
}
|
|
1142
|
+
export async function switchScenarioPrefixM42(db, dialect, receipts, input) {
|
|
1143
|
+
if (!(await tableExists(db, dialect, MIGRATION_MARKER_TABLE)))
|
|
1144
|
+
await execUntil(db, migrationMarkerDdl(dialect), () => tableExists(db, dialect, MIGRATION_MARKER_TABLE));
|
|
1145
|
+
const marked = await db.rows(dialect === "mysql" ? `SELECT 1 AS present FROM ${MIGRATION_MARKER_TABLE} WHERE migration_id = ?` : `SELECT 1 AS present FROM ${MIGRATION_MARKER_TABLE} WHERE migration_id = $1`, [SCENARIO_PREFIX_MARKER_ID]);
|
|
1146
|
+
if (marked.length > 0)
|
|
1147
|
+
return;
|
|
1148
|
+
const columns = await scannedIdentityColumnsM42(db, dialect);
|
|
1149
|
+
const hits = [];
|
|
1150
|
+
for (const { table, column } of columns) {
|
|
1151
|
+
const sql = dialect === "mysql" ? `SELECT COUNT(*) AS n FROM ${table} WHERE ${column} LIKE ? ESCAPE '!'` : `SELECT COUNT(*) AS n FROM ${table} WHERE ${column} LIKE $1 ESCAPE '!'`;
|
|
1152
|
+
const n = Number((await db.rows(sql, [SCENARIO_PREFIX_LIKE]))[0]?.["n"] ?? 0);
|
|
1153
|
+
if (n > 0)
|
|
1154
|
+
hits.push({ source: `${table}.${column}`, rows: n });
|
|
1155
|
+
}
|
|
1156
|
+
receipts.scenarioPrefixSourcesScanned += columns.length;
|
|
1157
|
+
if (hits.length > 0)
|
|
1158
|
+
throw new ScenarioPrefixSwitchRefusedError("stored_prefix", hits, undefined, await describeUpgradeDriftTail((sql) => db.rows(sql), dialect));
|
|
1159
|
+
const live = await readLiveRunHeartbeat(db, dialect, input);
|
|
1160
|
+
if (live !== undefined)
|
|
1161
|
+
throw new ScenarioPrefixSwitchRefusedError("live_runs", [], live, await describeUpgradeDriftTail((sql) => db.rows(sql), dialect));
|
|
1162
|
+
await db.exec(markIfAbsentSql(dialect), [SCENARIO_PREFIX_MARKER_ID, Date.now()]);
|
|
802
1163
|
}
|
|
803
1164
|
export const EXECUTION_LANE_RENAME_REFUSED_CODE = "config.execution_lane_rename_refused";
|
|
804
1165
|
export class ExecutionLaneRenameRefusedError extends StoreBootRefusalError {
|
|
@@ -874,8 +1235,8 @@ async function refuseWhileRunsHeartbeat(db, dialect, pendingRows, input) {
|
|
|
874
1235
|
throw new ExecutionLaneRenameRefusedError(pendingRows, liveRuns, restartAfter, `${pendingRows} stored rows (approval asks / sessions) carry the execution lane word "${RETIRED_EXECUTION_LANE_WORD_M40}", the name an earlier version gave the lane with no execution environment, ` +
|
|
875
1236
|
`which this version calls "${RENAMED_EXECUTION_LANE_M40}" and does not read; this boot renames them (one-time migration M40), but ${liveRuns} running runs on this database heartbeat within the last ${windowSec}s ` +
|
|
876
1237
|
`(REAP_RUN_STALE_SEC) — a replica of an earlier version is still serving, and it would keep writing the old word after the rename. No stored row was changed. ` +
|
|
877
|
-
|
|
878
|
-
|
|
1238
|
+
stopThenStartAction(after) +
|
|
1239
|
+
(await describeUpgradeDriftTail((sql) => db.rows(sql), dialect)));
|
|
879
1240
|
}
|
|
880
1241
|
export const SESSION_EXT_MOVE_REFUSED_CODE = "config.session_ext_move_refused";
|
|
881
1242
|
export class SessionExtMoveRefusedError extends StoreBootRefusalError {
|
|
@@ -891,7 +1252,7 @@ async function deploymentColumnsOnMeta(db, dialect) {
|
|
|
891
1252
|
if (!(await tableExists(db, dialect, "session_meta")))
|
|
892
1253
|
return [];
|
|
893
1254
|
const present = [];
|
|
894
|
-
for (const column of
|
|
1255
|
+
for (const column of SESSION_EXT_MOVED_COLUMNS)
|
|
895
1256
|
if (await columnExists(db, dialect, "session_meta", column.name))
|
|
896
1257
|
present.push(column);
|
|
897
1258
|
return present;
|
|
@@ -911,8 +1272,8 @@ export async function refuseSessionExtMoveWhileRunsHeartbeat(db, dialect, input)
|
|
|
911
1272
|
throw new SessionExtMoveRefusedError("live_runs", `${columns.length} session cells (${columns.map((c) => c.name).join(", ")}) still live on session_meta; this version keeps them on the side table ${SESSION_EXT_TABLE} and moves them on this boot ` +
|
|
912
1273
|
`(one-time migration M41: copy, verify, then drop the columns), but ${heartbeat.liveRuns} running runs on this database heartbeat within the last ${heartbeat.windowSec}s (REAP_RUN_STALE_SEC) — ` +
|
|
913
1274
|
"a replica of an earlier version is still serving; a cell it writes between the copy and the drop would be lost, and every cell write it makes after the drop fails. Nothing was changed. " +
|
|
914
|
-
|
|
915
|
-
|
|
1275
|
+
stopThenStartAction(heartbeat.after) +
|
|
1276
|
+
(await describeUpgradeDriftTail((sql) => db.rows(sql), dialect)));
|
|
916
1277
|
}
|
|
917
1278
|
export async function moveSessionCellsToSideTable(db, dialect, receipts) {
|
|
918
1279
|
const columns = await deploymentColumnsOnMeta(db, dialect);
|
|
@@ -942,7 +1303,6 @@ export async function moveSessionCellsToSideTable(db, dialect, receipts) {
|
|
|
942
1303
|
await execUntil(db, `ALTER TABLE session_meta ${names.map((n) => `DROP COLUMN ${n}`).join(", ")}`, async () => (await deploymentColumnsOnMeta(db, dialect)).length === 0);
|
|
943
1304
|
receipts.sessionMetaColumnsDropped += columns.length;
|
|
944
1305
|
}
|
|
945
|
-
const RETIRED_ASK_CAUSE_COLUMN = "denied_reason";
|
|
946
1306
|
function renameAskCauseColumnSql(dialect) {
|
|
947
1307
|
return dialect === "mysql"
|
|
948
1308
|
? `ALTER TABLE ${APPROVAL_ASK_TABLE} CHANGE COLUMN ${RETIRED_ASK_CAUSE_COLUMN} ${APPROVAL_ASK_ENDING_CAUSE_COLUMN.mysql}`
|
|
@@ -997,7 +1357,7 @@ async function readSwitchShape(db, dialect) {
|
|
|
997
1357
|
}
|
|
998
1358
|
async function askTableShape(db, dialect) {
|
|
999
1359
|
const askTable = await tableExists(db, dialect, APPROVAL_ASK_TABLE);
|
|
1000
|
-
return { askTable, askLaneColumn: askTable && (await columnExists(db, dialect, APPROVAL_ASK_TABLE,
|
|
1360
|
+
return { askTable, askLaneColumn: askTable && (await columnExists(db, dialect, APPROVAL_ASK_TABLE, ASK_EXECUTION_LANE_COLUMN)) };
|
|
1001
1361
|
}
|
|
1002
1362
|
function switchStarted(s) {
|
|
1003
1363
|
return s.placementColumns.has("execution_role") || s.parkedTable || s.cellsOnSideTable;
|
|
@@ -1226,31 +1586,36 @@ export async function switchExecutionPlacement(db, dialect, receipts, input) {
|
|
|
1226
1586
|
await step.run({ db, dialect, input, receipts, shape });
|
|
1227
1587
|
}
|
|
1228
1588
|
export async function backfillLocalExecutionPlacements(sessionIds, seat, input) {
|
|
1229
|
-
|
|
1589
|
+
let backfilled = 0;
|
|
1590
|
+
let ambiguous = 0;
|
|
1230
1591
|
const unreadable = [];
|
|
1231
1592
|
for (const root of sessionIds) {
|
|
1232
|
-
const
|
|
1233
|
-
if (
|
|
1593
|
+
const out = await seat.backfill(root, input.lanes);
|
|
1594
|
+
if (isUnusableArchive(out)) {
|
|
1595
|
+
unreadable.push({ sessionId: root, fault: out.word, ...(out.errno !== undefined ? { errno: out.errno } : {}) });
|
|
1234
1596
|
continue;
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1597
|
+
}
|
|
1598
|
+
switch (out.outcome) {
|
|
1599
|
+
case "placed":
|
|
1600
|
+
backfilled += 1;
|
|
1601
|
+
break;
|
|
1602
|
+
case "ambiguous":
|
|
1603
|
+
ambiguous += 1;
|
|
1604
|
+
break;
|
|
1605
|
+
case "skipped":
|
|
1606
|
+
break;
|
|
1607
|
+
default: {
|
|
1608
|
+
const unknownOutcome = out;
|
|
1609
|
+
throw new Error(`backfillLocalExecutionPlacements: no outcome ${JSON.stringify(unknownOutcome)}`);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
if (ambiguous > 0) {
|
|
1614
|
+
throw new ExecutionPlacementSwitchRefusedError("backfill_ambiguous", `the local data root holds sessions that have runs but no execution placement (${ambiguous}), and the deployment declares ${input.lanes.length === 0 ? "no lane" : `${input.lanes.length} lanes (${input.lanes.join(", ")})`} — ` +
|
|
1244
1615
|
"with more than one lane there is no single right answer, and this server will not guess one. Nothing was changed. " +
|
|
1245
1616
|
"Start this version once with a single declared lane (REMOTE_EXEC set to one lane), then declare the additional lanes");
|
|
1246
1617
|
}
|
|
1247
|
-
|
|
1248
|
-
let placed = 0;
|
|
1249
|
-
for (const { root, occupant } of absent) {
|
|
1250
|
-
if ((await seat.place(root, occupant, { role: "writer", lane })).outcome === "placed")
|
|
1251
|
-
placed += 1;
|
|
1252
|
-
}
|
|
1253
|
-
return { backfilled: placed, unreadable };
|
|
1618
|
+
return { backfilled, unreadable };
|
|
1254
1619
|
}
|
|
1255
1620
|
const UNKNOWN_LANE_ASKS_SHOWN = 5;
|
|
1256
1621
|
export function backfillLocalAskExecutionLanes(store, input) {
|
|
@@ -1298,11 +1663,6 @@ async function dropRetiredBreakerTable(db, dialect, receipts) {
|
|
|
1298
1663
|
await execUntil(db, `DROP TABLE IF EXISTS ${RETIRED_BREAKER_TABLE}`, async () => !(await tableExists(db, dialect, RETIRED_BREAKER_TABLE)));
|
|
1299
1664
|
receipts.retiredBreakerTablesDropped += 1;
|
|
1300
1665
|
}
|
|
1301
|
-
const WORKFLOW_JOURNAL_TABLE = "workflow_journal";
|
|
1302
|
-
const WORKFLOW_JOURNAL_OWNER_TABLE = "workflow_journal_owner";
|
|
1303
|
-
const WORKFLOW_JOURNAL_STAGING = `${WORKFLOW_JOURNAL_TABLE}_m24`;
|
|
1304
|
-
const WORKFLOW_JOURNAL_RETIRED = `${WORKFLOW_JOURNAL_TABLE}_m24_old`;
|
|
1305
|
-
const RETIRED_JOURNAL_SCOPE_COLUMN = "scope";
|
|
1306
1666
|
const M24_OWNER_INCARNATION = "m24-backfill";
|
|
1307
1667
|
const M24_COPY_BATCH_BYTES = 32 * 1024 * 1024;
|
|
1308
1668
|
const M24_COPY_SCAN_PAGE = 1000;
|
|
@@ -1316,7 +1676,7 @@ async function copyJournalInBatches(db, dialect) {
|
|
|
1316
1676
|
const T = WORKFLOW_JOURNAL_TABLE;
|
|
1317
1677
|
const bytes = dialect === "mysql" ? "LENGTH(result)" : "OCTET_LENGTH(result)";
|
|
1318
1678
|
const copyHead = `INSERT INTO ${WORKFLOW_JOURNAL_STAGING} (run_id, incarnation, ordinal, call_key, result, created_at_ms) ` +
|
|
1319
|
-
`SELECT ${T}.run_id, o
|
|
1679
|
+
`SELECT ${T}.run_id, o.${WORKFLOW_JOURNAL_SUPPLIED_COLUMN}, ordinal, call_key, ${jsonColumnText(dialect, "result")}, created_at_ms FROM ${T} ` +
|
|
1320
1680
|
`JOIN ${WORKFLOW_JOURNAL_OWNER_TABLE} o ON o.run_id = ${T}.run_id AND o.scope = ${T}.${RETIRED_JOURNAL_SCOPE_COLUMN} WHERE `;
|
|
1321
1681
|
let after;
|
|
1322
1682
|
for (;;) {
|
|
@@ -1378,9 +1738,6 @@ export async function moveWorkflowJournalScope(db, dialect, receipts) {
|
|
|
1378
1738
|
}
|
|
1379
1739
|
receipts.workflowJournalScopeColumn = "moved";
|
|
1380
1740
|
}
|
|
1381
|
-
const SESSION_POLICY_TABLE = "session_policy";
|
|
1382
|
-
const RETIRED_SESSION_RULES_COLUMN = "rules";
|
|
1383
|
-
const OLD_GRAMMAR_SESSION_RULES_COLUMN = "rule_entries_old_grammar";
|
|
1384
1741
|
const SESSION_RULES_SCAN_PAGE = 500;
|
|
1385
1742
|
export function retiredSessionRuleBucketsOf(body) {
|
|
1386
1743
|
if (body === null || typeof body !== "object" || Array.isArray(body))
|
|
@@ -1559,8 +1916,8 @@ async function migrateRetiredCardWords(db, dialect, receipts) {
|
|
|
1559
1916
|
return;
|
|
1560
1917
|
}
|
|
1561
1918
|
}
|
|
1562
|
-
const M21_GATE = {
|
|
1563
|
-
const M21_PENDING_ACTION = {
|
|
1919
|
+
const M21_GATE = { path: ["gate"], as: "m21_gate" };
|
|
1920
|
+
const M21_PENDING_ACTION = { path: ["pendingAction"], as: "m21_pending_action" };
|
|
1564
1921
|
const PARKED_ROW_REPAIR_PAGE = 200;
|
|
1565
1922
|
const QUESTION_CARD = "question";
|
|
1566
1923
|
const readM21Subtree = createObjectColumnReader();
|
|
@@ -1759,9 +2116,6 @@ export async function inheritPlacedSessionOwners(db, dialect, receipts) {
|
|
|
1759
2116
|
}
|
|
1760
2117
|
function readingFields(r) {
|
|
1761
2118
|
return {
|
|
1762
|
-
undurableScopeRuleRowsRemoved: r.undurableScopeRuleRows.length,
|
|
1763
|
-
undurableScopeRuleBucketsDeferred: r.undurableScopeRuleBucketsDeferred,
|
|
1764
|
-
undurableScopeRuleBucketsUnreadable: r.undurableScopeRuleBucketsUnreadable.length,
|
|
1765
2119
|
...(r.sessionRuleColumn !== undefined ? { sessionRuleColumn: r.sessionRuleColumn } : {}),
|
|
1766
2120
|
sessionRuleRowsWithRetiredBuckets: r.sessionRuleRowsWithRetiredBuckets.length,
|
|
1767
2121
|
sessionRuleRowsWithOldGrammarEntries: r.sessionRuleRowsWithOldGrammarEntries.length,
|
|
@@ -1792,12 +2146,23 @@ function readingFields(r) {
|
|
|
1792
2146
|
executionLaneWordsRenamed: r.executionLaneWordsRenamed,
|
|
1793
2147
|
sessionExtRowsMoved: r.sessionExtRowsMoved,
|
|
1794
2148
|
sessionMetaColumnsDropped: r.sessionMetaColumnsDropped,
|
|
2149
|
+
scenarioPrefixSourcesScanned: r.scenarioPrefixSourcesScanned,
|
|
2150
|
+
withdrawMarkWritten: r.withdrawMarkWritten,
|
|
2151
|
+
sessionDeletingSwitchMarked: r.sessionDeletingSwitchMarked,
|
|
2152
|
+
runErrorCodeColumnRewritten: r.runErrorCodeColumnRewritten,
|
|
2153
|
+
runObjectivePreviewRewritten: r.runObjectivePreviewRewritten,
|
|
2154
|
+
shellSentinelOwnersCleared: r.shellSentinelOwnersCleared,
|
|
2155
|
+
shellSentinelOwnerRowsRetained: r.shellSentinelOwnerRowsRetained.reduce((n, surface) => n + surface.rows, 0),
|
|
2156
|
+
checkpointHostSessionsBackfilled: r.checkpointHostSessionsBackfilled,
|
|
2157
|
+
legacySkillExemptionsDropped: r.legacySkillExemptionsDropped,
|
|
1795
2158
|
executionPlacementSessionsUnreadable: r.executionPlacementSessionsUnreadable.length,
|
|
1796
2159
|
localArchiveRowFactsBackfilled: r.localArchiveRowFactsBackfilled,
|
|
1797
2160
|
localArchivesAnonymized: r.localArchivesAnonymized,
|
|
1798
2161
|
localArchivesKeptStamped: r.localArchivesKeptStamped.length,
|
|
1799
2162
|
localArchivesUnreadable: r.localArchivesUnreadable.length,
|
|
1800
2163
|
localArchiveSnapshotsRecovered: r.localArchiveSnapshotsRecovered,
|
|
2164
|
+
localArchiveTokensAdopted: r.localArchiveTokensAdopted,
|
|
2165
|
+
localArchiveTokensMinted: r.localArchiveTokensMinted,
|
|
1801
2166
|
askCauseColumnsChanged: r.askCauseColumnsChanged,
|
|
1802
2167
|
askParkTriggersMoved: r.askParkTriggersMoved,
|
|
1803
2168
|
askJournalRecordsUpgraded: r.askJournalRecordsUpgraded,
|
|
@@ -1811,11 +2176,7 @@ export function logOneTimeMigrations(log, backend, report) {
|
|
|
1811
2176
|
backend,
|
|
1812
2177
|
...readingFields(report),
|
|
1813
2178
|
removableAfter: Object.fromEntries(ONE_TIME_MIGRATIONS.map((w) => [w.id, w.removableAfter])),
|
|
1814
|
-
note: "one-time persisted-data migrations (
|
|
1815
|
-
"on a session written by an earlier version (which recorded no owner) claims that session for the principal, one session_owner_claimed line per claim; " +
|
|
1816
|
-
"M11: persisted permission rules whose project scope root is not a complete absolute path — accepted by earlier versions, dropped on every read " +
|
|
1817
|
-
"by the current engine and not removable through DELETE /v1/rules — removed, one permission_rule_row_removed line per row; a bucket the read path " +
|
|
1818
|
-
"refuses in whole is left untouched, one permission_rule_bucket_unreadable line per bucket; M17: the session-rules column renamed from `rules` to " +
|
|
2179
|
+
note: "one-time persisted-data migrations (M17: the session-rules column renamed from `rules` to " +
|
|
1819
2180
|
"`rule_entries`, so a build that reads rules under the earlier name-only grammar finds no column to misread; at that rename every row's rule entries " +
|
|
1820
2181
|
"are read by the engine in the grammar the row carries (none = the grammar before the stamp) and rewritten as the same statement in the current grammar " +
|
|
1821
2182
|
"(the column carries the in-progress name rule_entries_old_grammar until every row is rewritten, so an interrupted boot resumes there) — toolAllow entries " +
|
|
@@ -1893,6 +2254,26 @@ function logReceiptRows(log, backend, r) {
|
|
|
1893
2254
|
"(the next boot then migrates it) or the session is deleted. Named on every boot until then",
|
|
1894
2255
|
});
|
|
1895
2256
|
}
|
|
2257
|
+
if (r.shellSentinelOwnerRowsRetained.length > 0) {
|
|
2258
|
+
log.warn("shell_sentinel_rows_retained", {
|
|
2259
|
+
backend,
|
|
2260
|
+
rows: r.shellSentinelOwnerRowsRetained.reduce((n, surface) => n + surface.rows, 0),
|
|
2261
|
+
surfaces: Object.fromEntries(r.shellSentinelOwnerRowsRetained.map((surface) => [surface.surface, surface.rows])),
|
|
2262
|
+
note: "this deployment has an identity boundary, so the one-time migration that clears the old cli shell sentinel owner (`anon:shell-live`) to no owner did not touch these rows: they keep that owner, and only a caller whose principal is exactly that value reads them as its own " +
|
|
2263
|
+
"(on the local backend session_meta = the session-metadata cells and task_run = the run rows). The reading comes from the configuration of THE ONE PROCESS that starts the migration, and the rewrite lands on the whole database / data root and cannot be undone: " +
|
|
2264
|
+
"every process that opens this same database or data root (run-local, an embedding host's boot, a one-off tool process) must carry at least one identity key (service credential, auth bridge, REQUIRE_PRINCIPAL, direct door, read-only trace credential — any one is enough; the rewrite runs only when the starting process has none of them); " +
|
|
2265
|
+
"a process started with no identity key at all first would clear these rows to no owner on the boundary deployment's behalf. To clear them deliberately, run the manual step in MIGRATION.md entry 86 of the 7.148.0 section. Counted on every start until then",
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
if (r.legacySkillExemptionsDropped > 0) {
|
|
2269
|
+
log.warn("legacy_skill_exemptions_dropped", {
|
|
2270
|
+
backend,
|
|
2271
|
+
count: r.legacySkillExemptionsDropped,
|
|
2272
|
+
note: "session approval-exemption rows for the engine's Skill tool that were written before this boot's first run of this step (by 7.116.0 or earlier for an activation card or a deployment-list question that named Skill, " +
|
|
2273
|
+
"or by a later version for a call that granted nothing) were deleted: a stored row for a tool by that name would answer a call by that name — and when no skill is loaded a call by that name is another tool, not the activation the person approved. " +
|
|
2274
|
+
"The people in those sessions are asked once more on their next Skill call. Rows written after this step first ran are never touched",
|
|
2275
|
+
});
|
|
2276
|
+
}
|
|
1896
2277
|
if (r.deviceBindingsOrphaned > 0) {
|
|
1897
2278
|
log.warn("device_bindings_orphaned", {
|
|
1898
2279
|
backend,
|
|
@@ -1955,17 +2336,6 @@ function logReceiptRows(log, backend, r) {
|
|
|
1955
2336
|
"in the session store by hand if someone should read one, or leave them to the transcript retention",
|
|
1956
2337
|
});
|
|
1957
2338
|
}
|
|
1958
|
-
for (const row of r.undurableScopeRuleRows) {
|
|
1959
|
-
log.warn("permission_rule_row_removed", {
|
|
1960
|
-
backend,
|
|
1961
|
-
ownerKey: row.ownerKey,
|
|
1962
|
-
kind: row.kind,
|
|
1963
|
-
behavior: row.behavior,
|
|
1964
|
-
tool: row.tool,
|
|
1965
|
-
scopeRoot: row.scopeRoot,
|
|
1966
|
-
note: removedRuleRowNote(row.kind),
|
|
1967
|
-
});
|
|
1968
|
-
}
|
|
1969
2339
|
for (const row of r.importedLayerRootAllowsRetired) {
|
|
1970
2340
|
log.warn("imported_layer_root_allow_retired", {
|
|
1971
2341
|
backend,
|
|
@@ -1993,16 +2363,6 @@ function logReceiptRows(log, backend, r) {
|
|
|
1993
2363
|
"list the rules of every owner you know (`GET /v1/rules`) and remove what should not stand",
|
|
1994
2364
|
});
|
|
1995
2365
|
}
|
|
1996
|
-
for (const bucket of r.undurableScopeRuleBucketsUnreadable) {
|
|
1997
|
-
log.warn("permission_rule_bucket_unreadable", {
|
|
1998
|
-
backend,
|
|
1999
|
-
ownerKey: bucket.ownerKey,
|
|
2000
|
-
why: bucket.why,
|
|
2001
|
-
note: "a persisted permission-rule bucket that the read path refuses in whole was left untouched by the one-time removal of rows whose project scope root " +
|
|
2002
|
-
"is not a complete absolute path (removing rows from a bucket the read path refuses would turn that refusal into a readable bucket): every read of it " +
|
|
2003
|
-
"keeps being refused, as before this release, until someone repairs or deletes that row by hand",
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
2366
|
for (const row of r.sessionRuleRowsWithOldGrammarEntries) {
|
|
2007
2367
|
log.warn("session_rule_row_old_grammar_entries", {
|
|
2008
2368
|
backend,
|
|
@@ -2088,18 +2448,4 @@ function importedLayerRootSkipNote(reason) {
|
|
|
2088
2448
|
}
|
|
2089
2449
|
}
|
|
2090
2450
|
}
|
|
2091
|
-
function removedRuleRowNote(kind) {
|
|
2092
|
-
switch (kind) {
|
|
2093
|
-
case "rule":
|
|
2094
|
-
return "a persisted permission rule whose project scope root is not a complete absolute path was removed by a one-time migration: the current engine drops such a row on every read (it protected nothing) and refuses any write naming that scope, so it could not be revoked through DELETE /v1/rules; re-add it with the project's full path if it is still wanted";
|
|
2095
|
-
case "revoked-rule":
|
|
2096
|
-
return "a persisted permission rule row whose project scope root is not a complete absolute path, and which had no live approval left (every approval behind it was already removed, or it never had one), was removed by a one-time migration: the row took effect nowhere before and takes effect nowhere now — no action needed";
|
|
2097
|
-
case "tombstone":
|
|
2098
|
-
return "a revocation record (tombstone) whose project scope root is not a complete absolute path was removed by a one-time migration: it can only cover rules with that same scope, which were removed with it or were never there, so nothing it revoked comes back — no action needed";
|
|
2099
|
-
default: {
|
|
2100
|
-
const unknown = kind;
|
|
2101
|
-
throw new Error(`M11: no log sentence for removed-row kind ${JSON.stringify(unknown)}`);
|
|
2102
|
-
}
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
2451
|
//# sourceMappingURL=one-time-migrations.js.map
|