@sema-agent/server 7.146.0 → 7.148.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 +1423 -24
- package/README.md +21 -8
- package/README.zh-CN.md +15 -9
- package/USAGE.md +537 -216
- package/deploy/facts/lanes.json +7 -0
- package/deploy/sema-up/README.md +18 -7
- package/deploy/sema-up/chart/templates/NOTES.txt +1 -1
- package/deploy/sema-up/chart/templates/_helpers.tpl +42 -4
- package/deploy/sema-up/chart/templates/server-v4pro.yaml +5 -4
- package/deploy/sema-up/chart/templates/server.yaml +5 -4
- package/deploy/sema-up/chart/values.yaml +4 -3
- package/deploy/sema-up/cluster-up.sh +75 -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/flagshape.sh +4 -0
- 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/lanes.json +2 -5
- 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 +26 -48
- 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 +18 -5
- package/deploy/sema-up/stack/sema-stack-cluster.yaml +25 -3
- 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/adoption/wire.d.ts +3 -3
- package/dist/approval-card.d.ts +32 -34
- package/dist/approval-gate-currency.js +3 -2
- package/dist/approval-reconciler.d.ts +4 -13
- package/dist/approval-reconciler.js +2 -2
- package/dist/approval.d.ts +16 -14
- package/dist/approval.js +3 -3
- package/dist/audit.d.ts +10 -3
- package/dist/audit.js +17 -9
- package/dist/auth-bridge.d.ts +0 -14
- package/dist/auth-bridge.js +0 -7
- 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 +8 -3
- 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/crash-last.js +2 -1
- package/dist/boot/deployment-mods.d.ts +1 -1
- package/dist/boot/device-lane.js +5 -5
- package/dist/boot/engine-lease.d.ts +12 -11
- package/dist/boot/execution-env.d.ts +19 -8
- package/dist/boot/execution-env.js +80 -62
- package/dist/boot/execution-lane.d.ts +37 -9
- package/dist/boot/execution-lane.js +74 -20
- package/dist/boot/exit-boundary.d.ts +3 -3
- package/dist/boot/exit-boundary.js +6 -5
- package/dist/boot/exit-last.js +2 -1
- package/dist/boot/fatal-exit.d.ts +3 -5
- package/dist/boot/fatal-exit.js +2 -2
- package/dist/boot/governance-seams.d.ts +2 -2
- package/dist/boot/leader.d.ts +15 -0
- package/dist/boot/leader.js +18 -16
- package/dist/boot/memory-boundary.d.ts +11 -11
- package/dist/boot/memory-boundary.js +3 -3
- package/dist/boot/memory-consolidation.d.ts +50 -53
- package/dist/boot/memory-consolidation.js +11 -18
- package/dist/boot/org-memory.js +4 -3
- package/dist/boot/parked-revive-gate.d.ts +1 -1
- package/dist/boot/parked-revive-gate.js +3 -3
- package/dist/boot/reapers.d.ts +4 -3
- package/dist/boot/reapers.js +20 -17
- package/dist/boot/resolve-spec.d.ts +5 -3
- package/dist/boot/resolve-spec.js +133 -165
- package/dist/boot/retention-lane.d.ts +7 -45
- package/dist/boot/retention-lane.js +2 -2
- package/dist/boot/runner-deps.d.ts +28 -7
- package/dist/boot/runner-deps.js +11 -4
- package/dist/boot/runtime-caps.d.ts +2 -2
- package/dist/boot/runtime-caps.js +16 -2
- package/dist/boot/session-faces.d.ts +17 -7
- package/dist/boot/session-faces.js +122 -96
- package/dist/boot/shutdown.d.ts +5 -4
- package/dist/boot/shutdown.js +6 -4
- package/dist/boot/stage-01-config.d.ts +1 -1
- package/dist/boot/stage-01-config.js +14 -2
- package/dist/boot/stage-02-web-admin-pull.d.ts +2 -1
- package/dist/boot/stage-02-web-admin-pull.js +15 -8
- package/dist/boot/stage-03-store-backend.d.ts +4 -1
- package/dist/boot/stage-03-store-backend.js +4 -3
- package/dist/boot/stage-04-stores.d.ts +3 -1
- package/dist/boot/stage-04-stores.js +2 -2
- package/dist/boot/stage-05-execution-env.d.ts +9 -5
- package/dist/boot/stage-05-execution-env.js +5 -5
- package/dist/boot/stage-06-runners.d.ts +13 -15
- package/dist/boot/stage-06-runners.js +24 -18
- package/dist/boot/stage-07-capability-layer.d.ts +14 -11
- package/dist/boot/stage-07-capability-layer.js +9 -12
- package/dist/boot/stage-08-reapers.d.ts +14 -11
- package/dist/boot/stage-08-reapers.js +3 -3
- package/dist/boot/stage-09-leader.d.ts +16 -18
- package/dist/boot/stage-09-leader.js +12 -4
- package/dist/boot/stage-10-http-server.d.ts +16 -18
- package/dist/boot/stage-10-http-server.js +9 -5
- package/dist/boot/store-evidence.d.ts +20 -0
- package/dist/boot/store-evidence.js +13 -0
- package/dist/boot/stores.d.ts +12 -0
- package/dist/boot/stores.js +39 -17
- 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 +58 -38
- 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 +9 -1
- package/dist/capabilities/center-plugins.js +37 -11
- package/dist/capabilities/center-wiring.js +1 -1
- package/dist/capabilities/composite-members.d.ts +3 -2
- package/dist/capabilities/composite-members.js +3 -2
- package/dist/capabilities/execution-lane.d.ts +7 -7
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +1 -1
- package/dist/capabilities/repo-tools.d.ts +2 -0
- package/dist/capabilities/repo-tools.js +14 -12
- package/dist/capabilities/scenarios.d.ts +38 -33
- package/dist/capabilities/scenarios.js +24 -25
- package/dist/capabilities/settings-contract.d.ts +29 -0
- package/dist/capabilities/settings-contract.js +14 -0
- package/dist/capabilities/skills.d.ts +6 -6
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +69 -4
- package/dist/capability-facts.js +77 -5
- package/dist/card-void.d.ts +4 -4
- package/dist/card-void.js +1 -1
- package/dist/center-credential-renewer.d.ts +6 -2
- package/dist/center-credential-renewer.js +10 -5
- package/dist/config-catalog.d.ts +16 -1
- package/dist/config-catalog.js +68 -61
- package/dist/config-dir-trust.d.ts +37 -4
- package/dist/config-dir-trust.js +88 -44
- package/dist/config-invariants.d.ts +58 -4
- package/dist/config-invariants.js +104 -23
- package/dist/config-lkg.d.ts +24 -2
- package/dist/config-lkg.js +22 -9
- package/dist/config-provider.d.ts +9 -9
- package/dist/config-provider.js +25 -108
- package/dist/config-pull-failure.d.ts +50 -0
- package/dist/config-pull-failure.js +48 -0
- package/dist/config-types.d.ts +215 -202
- package/dist/config.d.ts +69 -14
- package/dist/config.js +188 -96
- package/dist/degenerate-instrument.js +1 -1
- package/dist/delegated-session-owner.d.ts +1 -1
- package/dist/deleted-session-ids.d.ts +3 -2
- package/dist/deploy-facts.js +3 -2
- package/dist/deployment-governance.d.ts +3 -3
- package/dist/deployment-shape.d.ts +51 -16
- package/dist/deployment-shape.js +31 -6
- 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.d.ts +7 -5
- package/dist/env-facts.js +12 -7
- package/dist/env-witness.d.ts +7 -0
- package/dist/env-witness.js +16 -0
- package/dist/execution-config-root.d.ts +5 -5
- package/dist/execution-config-root.js +5 -5
- package/dist/execution-env-purpose.d.ts +14 -0
- package/dist/execution-env-purpose.js +29 -0
- package/dist/execution-lane-caps.d.ts +53 -103
- package/dist/execution-lane-caps.js +51 -83
- package/dist/execution-placement.d.ts +65 -9
- package/dist/execution-placement.js +58 -0
- 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.d.ts +2 -2
- package/dist/file-history-disclosure.js +1 -0
- package/dist/fleet/drain-entry.d.ts +17 -10
- package/dist/fleet/drain-entry.js +1 -1
- 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 +6 -7
- 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 +42 -0
- package/dist/history-anchor.js +34 -0
- 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 +1 -4
- package/dist/hooks/command-spawn.js +0 -11
- package/dist/hooks/hook-llm.d.ts +5 -1
- package/dist/hooks/hook-llm.js +24 -15
- package/dist/hooks/hook-runner.d.ts +119 -65
- package/dist/hooks/hook-runner.js +415 -217
- 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 +75 -78
- package/dist/http/approval-sweeps.d.ts +5 -8
- package/dist/http/approval-sweeps.js +55 -30
- package/dist/http/caller-trust.d.ts +8 -10
- package/dist/http/caller-trust.js +1 -2
- package/dist/http/checkpoint-ctx.d.ts +17 -0
- package/dist/http/checkpoint-ctx.js +6 -0
- package/dist/http/claim-heartbeat.d.ts +49 -0
- package/dist/http/claim-heartbeat.js +46 -0
- package/dist/http/claim-latency.d.ts +10 -0
- package/dist/http/claim-latency.js +12 -0
- package/dist/http/claimed-run.d.ts +4 -3
- package/dist/http/dispatch.d.ts +8 -1
- package/dist/http/dispatch.js +77 -31
- package/dist/http/durable-run-leg.d.ts +3 -3
- package/dist/http/durable-run-leg.js +18 -12
- package/dist/http/execution-context.d.ts +18 -42
- package/dist/http/execution-context.js +11 -5
- 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 +7 -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 +3 -3
- package/dist/http/memory-store-refusal-reply.js +6 -0
- package/dist/http/owner-access.d.ts +391 -56
- package/dist/http/owner-access.js +372 -33
- package/dist/http/principal-gate.d.ts +26 -94
- package/dist/http/principal-gate.js +24 -81
- package/dist/http/refusal-body.d.ts +35 -2
- package/dist/http/refusal-body.js +34 -0
- package/dist/http/request-guards.d.ts +10 -14
- 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 +35 -12
- package/dist/http/resume-ctx-read.js +25 -6
- package/dist/http/resume-legs.d.ts +24 -24
- package/dist/http/resume-legs.js +260 -171
- package/dist/http/retired-skill-manifest.d.ts +1 -1
- package/dist/http/rewind-files-reply.d.ts +34 -0
- package/dist/http/rewind-files-reply.js +36 -0
- package/dist/http/route-ctx.d.ts +56 -47
- package/dist/http/route-table.js +2 -0
- package/dist/http/routes/a2a-serve.d.ts +43 -5
- package/dist/http/routes/a2a-serve.js +58 -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 -88
- 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 +23 -20
- package/dist/http/routes/config-catalog.js +2 -2
- package/dist/http/routes/devices.d.ts +3 -3
- package/dist/http/routes/devices.js +5 -5
- package/dist/http/routes/diagnostics.d.ts +27 -3
- package/dist/http/routes/diagnostics.js +27 -21
- 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 +3 -1
- 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 +12 -20
- package/dist/http/routes/observability.js +3 -3
- package/dist/http/routes/principal-inbox.d.ts +1 -1
- package/dist/http/routes/principal-inbox.js +2 -2
- package/dist/http/routes/projects.d.ts +70 -0
- package/dist/http/routes/projects.js +87 -0
- package/dist/http/routes/retention-ops.js +6 -9
- package/dist/http/routes/rules.js +50 -7
- 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 +148 -233
- 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 +4 -2
- package/dist/http/routes/session-sync.js +48 -30
- package/dist/http/routes/sessions-list.d.ts +3 -3
- package/dist/http/routes/sessions-list.js +9 -9
- package/dist/http/routes/sessions.d.ts +7 -1
- package/dist/http/routes/sessions.js +177 -112
- package/dist/http/routes/shared-memory.js +6 -6
- package/dist/http/routes/side-query.js +2 -2
- package/dist/http/routes/tasks.js +144 -122
- 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 +63 -50
- package/dist/http/server.js +52 -16
- 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 +17 -3
- package/dist/http/stored-body-replay.js +11 -2
- package/dist/http/submit-ctx.d.ts +16 -8
- package/dist/http/submit-ctx.js +6 -2
- 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 +23 -13
- package/dist/identity-source.d.ts +36 -5
- package/dist/identity-source.js +27 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/instruction-source-notice.d.ts +1 -1
- 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/lsp-evict.d.ts +6 -4
- package/dist/lsp-evict.js +2 -3
- package/dist/memory-embedder-reembed.d.ts +38 -0
- package/dist/memory-embedder-reembed.js +20 -0
- package/dist/memory-incident-sink.d.ts +0 -28
- package/dist/memory-incident-sink.js +5 -0
- package/dist/memory-operator-faces.d.ts +5 -4
- package/dist/memory-operator-faces.js +1 -1
- package/dist/memory-scope.d.ts +31 -4
- package/dist/memory-scope.js +65 -16
- package/dist/memory-store-refusal.d.ts +20 -4
- package/dist/memory-store-refusal.js +1 -1
- package/dist/memory-sync-client.d.ts +5 -2
- package/dist/memory-sync-client.js +19 -14
- package/dist/memory-sync.js +1 -1
- package/dist/model-compat.d.ts +51 -28
- package/dist/model-compat.js +55 -23
- package/dist/model-context-window.d.ts +18 -0
- package/dist/model-context-window.js +2 -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 +46 -17
- package/dist/model-entry-refusal.js +47 -27
- 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-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 +28 -2
- package/dist/namespaced-rule-name.js +10 -1
- 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 +75 -47
- package/dist/observability/fail-open.js +77 -47
- package/dist/observability/logger.d.ts +22 -1
- package/dist/observability/logger.js +89 -12
- package/dist/observability/metrics.d.ts +2 -0
- package/dist/observability/metrics.js +5 -4
- 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 +5 -2
- package/dist/observability/secret-env-scrub.d.ts +30 -4
- package/dist/observability/secret-env-scrub.js +15 -3
- 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-agent-session-index.d.ts +7 -12
- package/dist/orchestration/workflow-agent-session-index.js +1 -6
- package/dist/orchestration/workflow-completion-inbox.d.ts +29 -9
- package/dist/orchestration/workflow-completion-inbox.js +65 -46
- package/dist/org-delivery-gate.d.ts +5 -4
- package/dist/org-delivery-gate.js +7 -6
- package/dist/org-memory-admission.d.ts +5 -2
- package/dist/org-memory-admission.js +25 -10
- 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 +531 -0
- package/dist/owner-faces.js +126 -0
- package/dist/parked-decide.d.ts +100 -31
- package/dist/parked-decide.js +162 -48
- package/dist/parked-revive-surface.d.ts +14 -4
- package/dist/parked-revive-surface.js +5 -4
- package/dist/peer-directory.d.ts +6 -8
- 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 +0 -22
- package/dist/plugins/adoption-log-sql.js +5 -3
- 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 +28 -9
- package/dist/plugins/approval-ask-store-file.js +74 -18
- package/dist/plugins/approval-ask-store-memory.d.ts +17 -7
- package/dist/plugins/approval-ask-store-memory.js +35 -12
- package/dist/plugins/approval-ask-store-sql.d.ts +42 -20
- package/dist/plugins/approval-ask-store-sql.js +44 -11
- package/dist/plugins/approval-exemption-skill-m46.d.ts +20 -0
- package/dist/plugins/approval-exemption-skill-m46.js +25 -0
- package/dist/plugins/approval-exemption-store.d.ts +6 -1
- package/dist/plugins/approval-exemption-store.js +14 -0
- 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 +40 -195
- package/dist/plugins/blob-backend.js +41 -234
- package/dist/plugins/caching-session-store.d.ts +22 -5
- package/dist/plugins/caching-session-store.js +43 -4
- package/dist/plugins/checkpoint-index-columns.d.ts +33 -6
- package/dist/plugins/checkpoint-index-columns.js +39 -3
- package/dist/plugins/checkpoint-store-face.d.ts +84 -11
- package/dist/plugins/checkpoint-store-face.js +18 -1
- package/dist/plugins/device-store-sql.d.ts +2 -2
- package/dist/plugins/device-store-sql.js +6 -10
- 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 +0 -15
- package/dist/plugins/ensure-schema-lock-policy.js +3 -2
- package/dist/plugins/execution-lane-rename-m40.d.ts +20 -0
- package/dist/plugins/execution-lane-rename-m40.js +10 -0
- package/dist/plugins/execution-placement-sql.d.ts +63 -88
- package/dist/plugins/execution-placement-sql.js +94 -54
- package/dist/plugins/file-run-store.d.ts +89 -35
- package/dist/plugins/file-run-store.js +197 -142
- 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 +19 -10
- package/dist/plugins/imported-layer-root-retirement.js +4 -8
- package/dist/plugins/inbox-payload-column.d.ts +14 -0
- package/dist/plugins/inbox-payload-column.js +13 -0
- 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 +63 -23
- package/dist/plugins/local-checkpoint-store.js +204 -81
- package/dist/plugins/local-data-dir-modes-m39.d.ts +48 -0
- package/dist/plugins/local-data-dir-modes-m39.js +183 -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 +13 -0
- package/dist/plugins/local-engine-high-water.js +62 -0
- package/dist/plugins/local-session-store.d.ts +442 -143
- package/dist/plugins/local-session-store.js +941 -289
- 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 +20 -1
- package/dist/plugins/local-task-attachment-store.js +32 -12
- package/dist/plugins/memory-embedder-fingerprint.d.ts +33 -10
- package/dist/plugins/memory-embedder-fingerprint.js +52 -12
- package/dist/plugins/memory-embedder.d.ts +1 -1
- package/dist/plugins/memory-embedder.js +11 -9
- package/dist/plugins/memory-engine-pg.d.ts +7 -5
- package/dist/plugins/memory-engine-pg.js +18 -9
- package/dist/plugins/memory-engine-sql-apply.d.ts +21 -8
- package/dist/plugins/memory-engine-sql-apply.js +7 -9
- package/dist/plugins/memory-engine-tidb.d.ts +12 -7
- package/dist/plugins/memory-engine-tidb.js +18 -10
- 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 +39 -27
- package/dist/plugins/memory-run-store.js +72 -70
- package/dist/plugins/one-time-migration-marker.d.ts +10 -0
- package/dist/plugins/one-time-migration-marker.js +7 -0
- package/dist/plugins/one-time-migrations.d.ts +325 -74
- package/dist/plugins/one-time-migrations.js +705 -230
- package/dist/plugins/org-delivery-quota-store.js +2 -1
- package/dist/plugins/owner-only-file-mode.d.ts +29 -0
- package/dist/plugins/owner-only-file-mode.js +141 -0
- package/dist/plugins/permission-rule-store-file.d.ts +11 -11
- package/dist/plugins/permission-rule-store-file.js +14 -2
- package/dist/plugins/permission-rule-store-sql.d.ts +4 -63
- package/dist/plugins/permission-rule-store-sql.js +6 -86
- package/dist/plugins/pg-pool.d.ts +3 -32
- package/dist/plugins/pg-pool.js +27 -11
- package/dist/plugins/release-version.d.ts +20 -0
- package/dist/plugins/release-version.js +28 -0
- package/dist/plugins/remote-env-adb.d.ts +20 -4
- package/dist/plugins/remote-env-adb.js +39 -11
- package/dist/plugins/remote-env-e2b.d.ts +19 -28
- package/dist/plugins/remote-env-e2b.js +40 -29
- package/dist/plugins/remote-env-host.d.ts +11 -10
- package/dist/plugins/remote-env-host.js +40 -27
- package/dist/plugins/remote-env-k8s.d.ts +45 -47
- package/dist/plugins/remote-env-k8s.js +122 -62
- package/dist/plugins/remote-env-local-docker.d.ts +152 -15
- package/dist/plugins/remote-env-local-docker.js +370 -75
- package/dist/plugins/remote-env-ssh.d.ts +8 -2
- package/dist/plugins/remote-env-ssh.js +26 -24
- package/dist/plugins/remote-scratchpad.js +4 -0
- package/dist/plugins/remote-shell.d.ts +59 -30
- package/dist/plugins/remote-shell.js +175 -62
- package/dist/plugins/retention-declaration.d.ts +37 -0
- package/dist/plugins/retention-declaration.js +9 -0
- package/dist/plugins/retention-deployment.d.ts +158 -0
- package/dist/plugins/retention-deployment.js +119 -0
- package/dist/plugins/retention-lane-store-sql.d.ts +74 -4
- package/dist/plugins/retention-lane-store-sql.js +103 -1
- package/dist/plugins/retention-sql.d.ts +29 -0
- package/dist/plugins/retention-sql.js +8 -0
- 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 +56 -68
- package/dist/plugins/run-store-sql.js +127 -116
- 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 +54 -0
- package/dist/plugins/scenario-prefix-switch-m42.js +55 -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 +42 -15
- package/dist/plugins/schema-consistency.js +213 -13
- package/dist/plugins/schema-drift-sentence.d.ts +4 -1
- package/dist/plugins/schema-drift-sentence.js +4 -4
- package/dist/plugins/schema-ensure-legs.d.ts +10 -1
- package/dist/plugins/schema-ensure-legs.js +12 -2
- 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 +98 -0
- package/dist/plugins/session-ext-table.js +134 -0
- package/dist/plugins/session-fork.d.ts +16 -2
- package/dist/plugins/session-fork.js +3 -0
- package/dist/plugins/session-ownership.d.ts +1 -1
- package/dist/plugins/session-placement.d.ts +22 -16
- package/dist/plugins/session-placement.js +15 -12
- package/dist/plugins/session-row-sql.d.ts +20 -7
- package/dist/plugins/session-row-sql.js +16 -8
- 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 +157 -0
- package/dist/plugins/session-store-sql.js +398 -0
- package/dist/plugins/session-withdraw-sql.d.ts +36 -0
- package/dist/plugins/session-withdraw-sql.js +42 -0
- package/dist/plugins/session-workspace-cell.d.ts +2 -2
- package/dist/plugins/session-workspace-cell.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +10 -69
- package/dist/plugins/shared-memory-store-sql.js +15 -14
- package/dist/plugins/shell-sentinel-owner-m48.d.ts +20 -0
- package/dist/plugins/shell-sentinel-owner-m48.js +3 -0
- package/dist/plugins/snapshot-bucket-presence.d.ts +2 -1
- package/dist/plugins/snapshot-bucket-presence.js +1 -1
- package/dist/plugins/sql-driver.d.ts +24 -8
- package/dist/plugins/sql-driver.js +43 -9
- package/dist/plugins/sql-errors.d.ts +35 -5
- package/dist/plugins/sql-errors.js +55 -3
- package/dist/plugins/sql-json-column.d.ts +8 -7
- package/dist/plugins/sql-json-column.js +10 -6
- package/dist/plugins/store-backend.d.ts +114 -18
- package/dist/plugins/store-backend.js +340 -87
- package/dist/plugins/store-contracts.d.ts +97 -30
- package/dist/plugins/store-contracts.js +23 -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 +21 -11
- package/dist/plugins/task-attachment-store.js +37 -19
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/text-column-capacity.d.ts +21 -0
- package/dist/plugins/text-column-capacity.js +5 -0
- package/dist/plugins/tidb-pool.d.ts +3 -2
- package/dist/plugins/tidb-pool.js +42 -39
- package/dist/plugins/user-input-ledger-sql.d.ts +1 -1
- 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/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/question.d.ts +13 -23
- package/dist/question.js +21 -39
- package/dist/read-face-posture.d.ts +6 -6
- package/dist/read-face-posture.js +2 -2
- 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/request-value-closure.d.ts +5 -5
- package/dist/request-value-closure.js +1 -1
- 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 +46 -16
- package/dist/rules-consent.js +102 -53
- package/dist/run-acceptance.d.ts +3 -1
- package/dist/run-acceptance.js +3 -0
- package/dist/run-local.d.ts +14 -6
- package/dist/run-local.js +109 -93
- package/dist/run-stale-default.d.ts +7 -0
- package/dist/run-stale-default.js +2 -0
- package/dist/runs.d.ts +73 -44
- package/dist/runs.js +65 -43
- package/dist/runtime-caps-resolver.d.ts +36 -14
- package/dist/runtime-caps-resolver.js +31 -14
- package/dist/runtime-governance.d.ts +2 -2
- package/dist/runtime-governance.js +5 -3
- package/dist/sealed-key-layout.d.ts +12 -6
- package/dist/sealed-key-layout.js +5 -1
- package/dist/sealed-key.d.ts +12 -2
- package/dist/sealed-key.js +116 -26
- package/dist/security.d.ts +133 -161
- package/dist/security.js +163 -59
- package/dist/sema-config-dir.d.ts +20 -0
- package/dist/sema-config-dir.js +27 -2
- package/dist/server-secret-env.d.ts +23 -5
- package/dist/server-secret-env.js +14 -4
- package/dist/service-version.d.ts +2 -1
- package/dist/service-version.js +2 -2
- package/dist/session-children-retire.d.ts +7 -5
- package/dist/session-children-retire.js +7 -2
- 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 +6 -6
- package/dist/session-error-wire.js +1 -1
- package/dist/session-incarnation.d.ts +60 -10
- 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 +29 -47
- package/dist/session-resident-background.js +77 -8
- package/dist/session-row.d.ts +3 -2
- package/dist/session-rules-seat.d.ts +12 -0
- package/dist/session-rules-seat.js +19 -0
- package/dist/session-sync-kernel.d.ts +1 -1
- package/dist/session-titler.d.ts +7 -15
- package/dist/session-titler.js +1 -1
- package/dist/session-workspace.d.ts +11 -2
- package/dist/session-workspace.js +5 -0
- package/dist/sighup-idle.d.ts +1 -1
- package/dist/spec-fields.d.ts +57 -3
- package/dist/spec-fields.js +72 -51
- package/dist/store-posture.d.ts +138 -21
- package/dist/store-posture.js +188 -3
- package/dist/stored-request-hooks-m20.d.ts +3 -2
- package/dist/stored-request-hooks-m20.js +21 -16
- 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/blob-index-sql.d.ts +148 -0
- package/dist/stores-sql/blob-index-sql.js +154 -0
- package/dist/stores-sql/checkpoint-store-sql.d.ts +34 -29
- package/dist/stores-sql/checkpoint-store-sql.js +86 -71
- package/dist/{plugins → stores-sql}/file-history-store-sql.d.ts +23 -11
- package/dist/{plugins → stores-sql}/file-history-store-sql.js +23 -18
- package/dist/stores-sql/mailbox-store-sql.d.ts +7 -4
- package/dist/stores-sql/mailbox-store-sql.js +31 -32
- package/dist/{plugins → stores-sql}/pg-session-storage.d.ts +30 -81
- package/dist/{plugins → stores-sql}/pg-session-storage.js +123 -244
- package/dist/{plugins → stores-sql}/retention-store-sql.d.ts +197 -223
- package/dist/{plugins → stores-sql}/retention-store-sql.js +148 -207
- package/dist/{plugins → stores-sql}/session-event-payload.d.ts +1 -1
- package/dist/{plugins → stores-sql}/session-event-payload.js +1 -1
- package/dist/stores-sql/session-policy-store-sql.d.ts +33 -11
- package/dist/stores-sql/session-policy-store-sql.js +44 -36
- package/dist/stores-sql/session-write-hooks.d.ts +65 -0
- package/dist/stores-sql/session-write-hooks.js +2 -0
- package/dist/{plugins → stores-sql}/tidb-session-storage.d.ts +14 -15
- package/dist/{plugins → stores-sql}/tidb-session-storage.js +22 -28
- package/dist/{plugins → stores-sql}/tidb-session-store.d.ts +67 -138
- package/dist/{plugins → stores-sql}/tidb-session-store.js +130 -200
- package/dist/stores-sql/tool-result-store-sql.d.ts +1 -1
- package/dist/stores-sql/tool-result-store-sql.js +1 -1
- package/dist/stores-sql/windowed-session-storage.d.ts +61 -0
- package/dist/stores-sql/windowed-session-storage.js +70 -0
- package/dist/submission-exit.d.ts +50 -0
- package/dist/submission-exit.js +108 -0
- package/dist/task-a2a.d.ts +7 -1
- package/dist/task-a2a.js +18 -17
- package/dist/task-cwd.d.ts +31 -3
- package/dist/task-cwd.js +25 -1
- package/dist/task-mcp.d.ts +11 -3
- package/dist/task-mcp.js +16 -19
- package/dist/task-settings.d.ts +23 -14
- package/dist/task-settings.js +35 -13
- package/dist/terminal.d.ts +25 -43
- package/dist/terminal.js +31 -11
- package/dist/tool-approval.d.ts +152 -137
- package/dist/tool-approval.js +199 -199
- package/dist/trace/core-keyset-guard.d.ts +22 -9
- 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 +1 -1
- package/dist/trace/engine-notice-wire.js +2 -0
- package/dist/trace/exit-seat.d.ts +52 -4
- package/dist/trace/exit-seat.js +43 -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 +1 -30
- 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 +88 -58
- package/dist/trace/project.js +64 -28
- package/dist/trace/redact.d.ts +124 -28
- package/dist/trace/redact.js +936 -328
- package/dist/trace/self-minted-wire.d.ts +750 -29
- package/dist/trace/self-minted-wire.js +262 -25
- package/dist/trace/sema-provenance.d.ts +45 -41
- package/dist/trace/sema-provenance.js +81 -10
- package/dist/trace/task-notification-facets.d.ts +70 -2
- package/dist/trace/task-notification-facets.js +71 -1
- package/dist/trace/wire-projection-faces.d.ts +43 -8
- package/dist/trace/wire-projection-faces.js +28 -3
- package/dist/unread-request-members.d.ts +66 -0
- package/dist/unread-request-members.js +41 -0
- 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 -40
- 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/candidate-gate.d.ts +35 -3
- package/dist/web-admin-client/candidate-gate.js +53 -5
- package/dist/web-admin-client/center-request.d.ts +6 -3
- package/dist/web-admin-client/center-request.js +17 -16
- package/dist/web-admin-client/effective-keys.d.ts +1 -1
- package/dist/web-admin-client/effective-keys.js +1 -2
- 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/facade.d.ts +1 -1
- package/dist/web-admin-client/http-client.d.ts +2 -1
- package/dist/web-admin-client/http-client.js +40 -13
- 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 +13 -6
- package/dist/web-admin-client/skills-mcp.d.ts +22 -8
- package/dist/web-admin-client/skills-mcp.js +26 -21
- package/dist/web-admin-client/types.d.ts +35 -51
- package/dist/workspace-space.d.ts +3 -2
- package/docs/DEVICE-EXECUTOR-PROTOCOL.md +4 -4
- package/package.json +16 -12
- package/scripts/drain-check-local.mjs +118 -173
- package/scripts/drain-check.mysql.sql +20 -16
- package/scripts/drain-check.pg.sql +20 -16
- package/wire-changes/server@7.147.0.json +813 -0
- package/wire-changes/server@7.148.0.json +1517 -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
|
@@ -22,16 +22,9 @@
|
|
|
22
22
|
* 判据**就是**服务提交与续跑两腿同经的那一只判官(`src/rule-entry-list.ts`:两腿经 `inertToolListEntryOf` 判全部工具名清单,它先调技能两层的取清单函数 `skillDenyInertEntryOf`,
|
|
23
23
|
* 后者调引擎包根的 `compileAllowList`),本脚本取的是技能两层那一只,经编译产物 `dist/rule-entry-list.js` 取 —— 不写第二份。7.131.0 起读成空即拒的清单扩到根 run 的 `allowTools` / `excludeTools` 与子代定义的 `allowTools` / `denyTools`,
|
|
24
24
|
* 本判据(窗在 7.117.0)与随包 SQL 孪生**仍只数技能两层**,不覆盖那几张清单(续跑时的 409 是它们的响亮道);
|
|
25
|
-
* · `workflow-park-holder`(换钉 7.118.0 前,引擎 7.44.0 起 workflow 子代卡交给哪条 run 只看记录 `parks[]` 条目上的持有者位 `parkedBy` / `generation`):
|
|
26
|
-
* pending 行的子会话被 workflow park 索引点名(`<数据根>/workflows/workflow-agent-sessions/index.jsonl`:一行 = 一条 workflow run 的整份指针集
|
|
27
|
-
* `{ runId, rows: [{ sessionId, runId, agentKey, scope }] }`,同一条 run 后写的一行整份覆盖先写的,空集 = 它不再点名任何子会话)= 一张待批的 workflow 子代卡。
|
|
28
|
-
* 在**换钉之前、对旧版本的数据**跑:引擎 7.43 及以前写下的记录没有持有者位 ⇒ 这样的卡升级后在决定口答 409 `decide.workflow_parks_unreadable`
|
|
29
|
-
* (更早的引擎写下、记录上根本没有 `parks` 的,答 409 `conflict.resume_context_unavailable`;卡都仍待批,出路相同 = 续跑那条 workflow run 再决,见随包 `MIGRATION.md` 7.118.0 节);换钉之后再跑会把新引擎写下的卡也数进来。命中行点名点它的 run(`runId=`)。
|
|
30
|
-
* 账本行的读法是服务里那一只(`src/orchestration/workflow-agent-session-index.ts` 的 `readAgentSessionLedgerLine`),经编译产物
|
|
31
|
-
* `dist/orchestration/workflow-agent-session-index.js` 取 —— 本脚本只按 runId 折叠;读不出的行计入 `corrupt`(rc 2:读不出的那一行可能正是点名某张待批卡的那一份);
|
|
32
|
-
* 窗与删码:本判据是一次性迁移 M9 的读侧半场 —— 窗口与删码清单见引擎启动期一次性迁移登记表(one-time-migrations)M9 一行,随 M9 一起删;这里不写第二份窗。
|
|
33
25
|
* · `parked-tool-lists`(升级到 7.132.0 前)/ `own-tool-lists-rollback`(从 7.132.0 回滚前):停驻行记下的工具名清单 / 7.52 写下的 `ownToolLists`(判据与出路见判据表那两条的注);
|
|
34
26
|
* · `sealed-credentials-rollback`(从 7.134.0 回滚前;从 7.135.0 / 7.136.0 回滚到上一版前同用):续跑上下文的凭据位上带封签的 pending 行(7.133.x 读不懂封签,续跑时把这些位当没有;判据与出路见判据表那一条的注);
|
|
27
|
+
* · `prompt-lean-rollback`(从 7.137.0 及以后回滚到 7.136.x 前):续跑上下文的提交体里 `promptLean` 为 `false`(要长形提示词)的 pending 行(7.136.x 不认这个键,续跑时回到缺省形;判据与出路见判据表那一条的注);
|
|
35
28
|
* · `retired-mode-seed`(换钉 7.113.0 前,core 7.39.0 删掉退役 mode-seed 的一次性迁移):pending 行的 `state.inheritedGate` 仍带退役成员;
|
|
36
29
|
* 扫描骨架(快照 + 账本折成当前行、一致性重读、数据根判定)各条判据共用;判据只回答「这一条 pending 行算不算命中」。
|
|
37
30
|
*
|
|
@@ -40,23 +33,23 @@
|
|
|
40
33
|
* `shellGate` **不是 `"always"`**(含 JSON null)。`"always"` 是 7.34.0 起的合法新形,grep 表达不了「值不是 always」;
|
|
41
34
|
* ② core 的 File 店是**快照 + 账本**两只文件(`checkpoints/checkpoints.snapshot.jsonl` 每行一条行,`checkpoints/checkpoints.jsonl` 是快照之后的事件):
|
|
42
35
|
* 压实之后旧行**只在快照里**,只扫账本会把最该排的那批(≤7.105.0 停放的老行)整批漏掉;
|
|
43
|
-
* ③ 账本是追加写:同一条行先 `put` 后 `resolve` / `expire` / `reopen`,只有折叠到**当前状态**才知道它还 pending 没有。
|
|
44
|
-
* ⇒
|
|
36
|
+
* ③ 账本是追加写:同一条行先 `put` 后 `resolve` / `expire` / `reopen` / `delete`,只有折叠到**当前状态**才知道它还 pending 没有。
|
|
37
|
+
* ⇒ 当前行由引擎包根的 `readCheckpointLedger` 给(引擎自己的折叠 + 快照换新时的有界重读);本脚本不自带事件词表、不自己折叠,只按上面三条成员判它给出的 pending 行。
|
|
45
38
|
*
|
|
46
|
-
* ##
|
|
47
|
-
* ·
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* · 重放序:`stores/file/shared-ledger.js:20-31` 先快照、后账本。压实 `stores/file/shared-ledger.js:63-72` `compact()` 先**原子换新快照**、再**清空账本**。
|
|
53
|
-
* · 退役成员:`core/checkpoint-store.js:739-756` `RETIRED_MODE_SEED_MEMBERS` / `refuseRetiredModeSeed`。
|
|
39
|
+
* ## 账本的读法只有一只 —— 引擎包根的 `readCheckpointLedger`(坐标:引擎安装树 `node_modules/@sema-agent/core/dist/` 的 `stores/file/checkpoint-store.js`,符号 `readCheckpointLedger` / `CHECKPOINT_LEDGER_EVENT_KINDS`)
|
|
40
|
+
* · 行形与事件词是引擎的:快照行与账本 `put` 的 `cp` 同一只行形判,不合形的记录引擎**跳过并披露、保留旧行**(升级后那张旧卡照样在、照样被拒)—— 经读口的 `onCorruptRead` 回调
|
|
41
|
+
* 计入 `corrupt`(⇒ rc 2),旧卡仍被数到;崩在半行的**尾**行(无换行结尾、读不成)引擎不当记录 —— 那是非优雅退出的正常落盘形,不计 `corrupt`(与店的重放同判)。
|
|
42
|
+
* · 不认的事件词(新版 worker 写下的,或引擎已退役的词)引擎**拒绝这次读**(`checkpoint.unsupported_version`,`detail.reason` 为 `ledger_event_unknown`)⇒ rc 2 + `reason=ledger-event-unknown`,
|
|
43
|
+
* 句子里列的「引擎认得的词」读自 `CHECKPOINT_LEDGER_EVENT_KINDS`;本脚本不替它猜、不抄这张词表。
|
|
44
|
+
* · 退役成员:`core/checkpoint-store.js:739-756` `RETIRED_MODE_SEED_MEMBERS` / `refuseRetiredModeSeed`(本脚本里 `retiredMember` 是它的逐字投影)。
|
|
54
45
|
*
|
|
55
46
|
* ## 只读、不取锁;服务运行中也可以跑,但脚本只对**一致的**快照 + 账本组合下结论
|
|
56
|
-
*
|
|
47
|
+
* 读口不打开 core 的店(不取 `checkpoints/LOCK`、与在跑的服务不争锁、不建任何东西),只读两只 JSONL。服务在写时,两次读之间可能发生压实 ——
|
|
57
48
|
* 先读快照(旧)、压实(新快照含账本里的行,账本清空)、再读账本(空)⇒ 只在账本里的 pending 退役卡两边都读不到,读出一个假的「干净」。
|
|
58
|
-
*
|
|
59
|
-
*
|
|
49
|
+
* 读口自己在读前读后比快照的身份,变了就**重读**,至多 3 次;仍不稳(`settled:false`)⇒ rc 2 + 一句话(服务在写:停写或重跑),不给结论。
|
|
50
|
+
* 账本只追加:读期间服务追加的行不使这一次读不一致(读到的是读那一刻的前缀),所以追加本身不再逼出 rc 2(旧脚本连账本的身份也比,追加也算「变了」);
|
|
51
|
+
* rc 0 / 1 是读那一刻的一致视图,不是对此后写入的担保 —— 换钉 / 回滚前仍要先停写、排空。
|
|
52
|
+
* 数据根上有一次进行中的收编(adoption)⇒ 读口按店同样拒 ⇒ rc 2 + `reason=read-error`,句子带引擎的原话。
|
|
60
53
|
*
|
|
61
54
|
* ## 数据根
|
|
62
55
|
* · 带参:`node scripts/drain-check-local.mjs <数据根>` —— 读那个目录;
|
|
@@ -69,23 +62,22 @@
|
|
|
69
62
|
* ## 读数(机读末行 + 退出码)
|
|
70
63
|
* · 每条命中一行:`SKILL-GRANTS-ROW token=<token> sessionId=<id> createdAt=<ms> member=<skillGrants|boundGrantDigest|userInvokedSkills|disallowedTools>` / `SKILL-MANIFEST-ROW token=<token> sessionId=<id> createdAt=<ms> member=<skills|agents.skills>` /
|
|
71
64
|
* `SKILL-DENY-INERT-ROW token=<token> sessionId=<id> createdAt=<ms> member=<skills|agents.skills>` /
|
|
72
|
-
* `WORKFLOW-PARK-ROW token=<token> sessionId=<id> createdAt=<ms> runId=<点名它的 run,逗号连接>` /
|
|
73
65
|
* `PARKED-TOOL-LISTS-ROW token=<token> sessionId=<id> createdAt=<ms> member=<toolCeiling|constraintChain|boundGrantDigest>` / `OWN-TOOL-LISTS-ROW token=<token> sessionId=<id> createdAt=<ms>` /
|
|
74
66
|
* `SEALED-CREDENTIALS-ROW token=<token> sessionId=<id> createdAt=<ms> field=<第一处带封签的凭据位>|runId=<workflow 子代卡:点它的 run>` /
|
|
75
67
|
* `RETIRED-ROW token=<token> sessionId=<id> createdAt=<ms> member=<成员>`;
|
|
76
68
|
* · 每条判据一行末行(表序;`RETIRED-MODE-SEED` 那一行恒在最后,7.113.0 起读「最后一行」的下游不受影响):
|
|
77
|
-
* `SKILL-GRANTS rows=<命中数> pending=<pending 行数> total=<行数>
|
|
78
|
-
* `RETIRED-SKILL-MANIFEST rows=<命中数> pending=<pending 行数> total=<行数>
|
|
79
|
-
* `SKILL-DENY-INERT rows=<命中数> pending=<pending 行数> total=<行数>
|
|
80
|
-
* `
|
|
81
|
-
* `
|
|
82
|
-
* `
|
|
83
|
-
* `
|
|
84
|
-
* `RETIRED-MODE-SEED rows=<命中数> pending=<pending 行数> total=<行数>
|
|
69
|
+
* `SKILL-GRANTS rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
70
|
+
* `RETIRED-SKILL-MANIFEST rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
71
|
+
* `SKILL-DENY-INERT rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
72
|
+
* `PARKED-TOOL-LISTS rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
73
|
+
* `OWN-TOOL-LISTS-ROLLBACK rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
74
|
+
* `SEALED-CREDENTIALS-ROLLBACK rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
75
|
+
* `PROMPT-LEAN-ROLLBACK rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`,
|
|
76
|
+
* `RETIRED-MODE-SEED rows=<命中数> pending=<pending 行数> total=<行数> corrupt=<n> root=<实际读的数据根>`;
|
|
85
77
|
* `corrupt` = 共用扫描的坏记录 + 这条判据自己读不懂的旁路输入(读不懂的 ctx 档,文件名进 stderr —— 一份读不懂的 ctx 可能正是让某条 pending 行命中的那一份;
|
|
86
|
-
* `
|
|
87
|
-
* 没读成 / 不能下结论(rc 2 的几种缺席与不稳形)
|
|
88
|
-
* · rc 0 = 每条判据都零命中(可换钉 / 可回滚)· rc 1 = 有命中(逐行列出;答完或取消再跑)· rc 2 = 读不懂 / 没读成 / 不能下结论(
|
|
78
|
+
* `sealed-credentials-rollback` 另读 workflow park 索引:索引账本里读不出的行,行号进 stderr);
|
|
79
|
+
* 没读成 / 不能下结论(rc 2 的几种缺席与不稳形)时前四个计数是 `-`、多一个 `reason=<词>`,**不会出现 `rows=0`**(下游读 `rows=0` 即「干净」);
|
|
80
|
+
* · rc 0 = 每条判据都零命中(可换钉 / 可回滚)· rc 1 = 有命中(逐行列出;答完或取消再跑)· rc 2 = 读不懂 / 没读成 / 不能下结论(账本里有引擎不认的事件词 / 不合形的记录 / 读不懂的 ctx 档 /
|
|
89
81
|
* 数据根缺席 / 缺省根解析不可用 / 判据模块不可用(脚本隔壁没有 `dist/`:源码树没 build)/ 读期间文件一直在变 / 读文件出错 / 用法错)—— 不给结论(缺席 ≠ 干净:一条读不懂的记录可能正是让某行回到 pending 的那一条)。
|
|
90
82
|
* rc 2 与 rc 1 同时成立时(有命中、也有读不懂的记录)报 rc 2,命中行照列。
|
|
91
83
|
*/
|
|
@@ -94,14 +86,13 @@ import { homedir } from "node:os";
|
|
|
94
86
|
import { join } from "node:path";
|
|
95
87
|
import { fileURLToPath } from "node:url";
|
|
96
88
|
|
|
89
|
+
/** 引擎包根的账本读口(`readCheckpointLedger`)的形;`onCorruptRead` 收引擎披露的每条被跳过的记录(`kind: "record"`,带 `path` / `line`)。
|
|
90
|
+
* @typedef {import("@sema-agent/core").CheckpointLedgerReading} CheckpointLedgerReading
|
|
91
|
+
* @typedef {(root: string, opts?: { onCorruptRead?: (info: { kind: string, path: string, line?: number }) => void }) => CheckpointLedgerReading} LedgerReader */
|
|
92
|
+
|
|
97
93
|
/** 从脚本隔壁的编译产物取来的服务判据(脚本不持第二份实现)。
|
|
98
94
|
* @typedef {{ sealedCredentialFieldOf: (ctx: unknown) => string | undefined, retiredSkillManifestLayerOf: (body: unknown) => "skills" | "agents.skills" | undefined, skillDenyInertEntryOf: (body: unknown) => { layer: "skills" | "agents.skills", message: string } | undefined, readAgentSessionLedgerLine: (v: unknown) => { runId: string, rows: Array<{ sessionId: string }> } | undefined }} ServiceCriteria */
|
|
99
95
|
|
|
100
|
-
/** 读期间文件在变时的有界重读次数(含第一次)。 */
|
|
101
|
-
const STABLE_READ_ATTEMPTS = 3;
|
|
102
|
-
/** core 账本事件注册表(`stores/file/checkpoint-store.js:7-14`)。 */
|
|
103
|
-
const KNOWN_LEDGER_EVENTS = new Set(["put", "resolve", "reopen", "execution", "expire", "steer_append"]);
|
|
104
|
-
|
|
105
96
|
/** @param {string} path */
|
|
106
97
|
const dirKind = (path) => {
|
|
107
98
|
try {
|
|
@@ -122,9 +113,6 @@ const textOf = (path) => {
|
|
|
122
113
|
}
|
|
123
114
|
};
|
|
124
115
|
|
|
125
|
-
/** @param {string} path */
|
|
126
|
-
const linesOf = (path) => textOf(path).split("\n").filter((l) => l.trim().length > 0);
|
|
127
|
-
|
|
128
116
|
/** @param {string} line */
|
|
129
117
|
const parse = (line) => {
|
|
130
118
|
try {
|
|
@@ -135,112 +123,6 @@ const parse = (line) => {
|
|
|
135
123
|
}
|
|
136
124
|
};
|
|
137
125
|
|
|
138
|
-
/** core `isCheckpointRow`(`stores/file/checkpoint-store.js:61`)逐字:`token` / `scope` / `status` 三个串。快照行与账本 `put` 的 `cp` 同一只判。
|
|
139
|
-
* @param {unknown} x
|
|
140
|
-
* @returns {x is Record<string, unknown> & { token: string, scope: string, status: string }} */
|
|
141
|
-
const isCheckpointRow = (x) =>
|
|
142
|
-
x !== null && typeof x === "object" && typeof (/** @type {Record<string, unknown>} */ (x).token) === "string" && typeof (/** @type {Record<string, unknown>} */ (x).scope) === "string" && typeof (/** @type {Record<string, unknown>} */ (x).status) === "string";
|
|
143
|
-
|
|
144
|
-
/** 一只文件的身份;不存在 = `absent`(账本可以合法不存在);其余 stat 错误抛出。
|
|
145
|
-
* @param {string} path */
|
|
146
|
-
const identityOf = (path) => {
|
|
147
|
-
try {
|
|
148
|
-
const st = statSync(path, { bigint: true });
|
|
149
|
-
return `${st.dev}:${st.ino}:${st.size}:${st.mtimeNs}`;
|
|
150
|
-
} catch (e) {
|
|
151
|
-
if (/** @type {NodeJS.ErrnoException} */ (e).code === "ENOENT") return "absent";
|
|
152
|
-
throw e;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
/** 两只文件的身份(快照 | 账本)。
|
|
157
|
-
* @param {string} dir */
|
|
158
|
-
const identitiesOf = (dir) => `${identityOf(join(dir, "checkpoints.snapshot.jsonl"))}|${identityOf(join(dir, "checkpoints.jsonl"))}`;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* 读一遍(不判一致性):快照 → 钩子 → 账本,折成当前行。
|
|
162
|
-
* @param {string} dir
|
|
163
|
-
* @param {() => void | Promise<void>} betweenReads
|
|
164
|
-
* @returns {Promise<{ rows: Map<string, Record<string, unknown>>, corrupt: number, unknownEvents: number }>}
|
|
165
|
-
*/
|
|
166
|
-
async function foldOnce(dir, betweenReads) {
|
|
167
|
-
/** @type {Map<string, Record<string, unknown>>} token → 行(当前状态) */
|
|
168
|
-
const rows = new Map();
|
|
169
|
-
let corrupt = 0;
|
|
170
|
-
let unknownEvents = 0;
|
|
171
|
-
|
|
172
|
-
// ① 快照:每行一条行;不合形(core `isCheckpointRow`)⇒ core 跳过 ⇒ 本脚本也不当行数,计 corrupt
|
|
173
|
-
for (const line of linesOf(join(dir, "checkpoints.snapshot.jsonl"))) {
|
|
174
|
-
const r = parse(line);
|
|
175
|
-
if (r === undefined || !isCheckpointRow(r)) {
|
|
176
|
-
corrupt++;
|
|
177
|
-
continue;
|
|
178
|
-
}
|
|
179
|
-
rows.set(r.token, r);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
await betweenReads();
|
|
183
|
-
|
|
184
|
-
// ② 账本:快照之后的事件,照 core `applyCheckpointEvent` 的同一组词折叠(状态相关的三词改 status;其余两词与 pending 判定无关)
|
|
185
|
-
for (const line of linesOf(join(dir, "checkpoints.jsonl"))) {
|
|
186
|
-
const ev = parse(line);
|
|
187
|
-
if (ev === undefined || typeof ev.t !== "string") {
|
|
188
|
-
corrupt++;
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
if (!KNOWN_LEDGER_EVENTS.has(ev.t)) {
|
|
192
|
-
unknownEvents++; // 新版本写的事件词:本脚本不替它猜(core 对未知词拒绝重放)
|
|
193
|
-
continue;
|
|
194
|
-
}
|
|
195
|
-
if (typeof ev.token !== "string") {
|
|
196
|
-
corrupt++;
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
if (ev.t === "put") {
|
|
200
|
-
// core:`put` 的 cp 不合形 ⇒ 跳过该事件、保留旧行。本脚本同:不覆盖,计 corrupt(⇒ rc 2),旧行照数。
|
|
201
|
-
if (!isCheckpointRow(ev.cp)) {
|
|
202
|
-
corrupt++;
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
rows.set(ev.token, ev.cp);
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
const row = rows.get(ev.token);
|
|
209
|
-
switch (ev.t) {
|
|
210
|
-
case "resolve":
|
|
211
|
-
if (row) row.status = "resolved";
|
|
212
|
-
break;
|
|
213
|
-
case "reopen":
|
|
214
|
-
if (row) row.status = "pending";
|
|
215
|
-
break;
|
|
216
|
-
case "expire":
|
|
217
|
-
if (row) row.status = "expired";
|
|
218
|
-
break;
|
|
219
|
-
default:
|
|
220
|
-
break; // execution / steer_append:不改 status
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return { rows, corrupt, unknownEvents };
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* 把 `<dir>` 下的快照 + 账本折成当前行,**只对一致的组合交结果**(导出:测试与 CLI 共用同一只;CLI 不传钩子)。
|
|
228
|
-
* 读前读后各取两文件身份,变了就重读,至多 {@link STABLE_READ_ATTEMPTS} 次;仍变 ⇒ `stable:false`(不交行)。
|
|
229
|
-
* @param {string} dir `<数据根>/checkpoints`
|
|
230
|
-
* @param {{ afterSnapshotRead?: (attempt: number) => void | Promise<void> }} [opts] 测试钩子:快照读完、账本还没读的那一刻(`attempt` 从 1 起)
|
|
231
|
-
* @returns {Promise<{ stable: true, attempts: number, rows: Map<string, Record<string, unknown>>, corrupt: number, unknownEvents: number } | { stable: false, attempts: number }>}
|
|
232
|
-
*/
|
|
233
|
-
export async function scanCheckpointDir(dir, opts = {}) {
|
|
234
|
-
for (let attempt = 1; attempt <= STABLE_READ_ATTEMPTS; attempt++) {
|
|
235
|
-
const before = identitiesOf(dir);
|
|
236
|
-
const folded = await foldOnce(dir, async () => {
|
|
237
|
-
await opts.afterSnapshotRead?.(attempt);
|
|
238
|
-
});
|
|
239
|
-
if (identitiesOf(dir) === before) return { stable: true, attempts: attempt, ...folded };
|
|
240
|
-
}
|
|
241
|
-
return { stable: false, attempts: STABLE_READ_ATTEMPTS };
|
|
242
|
-
}
|
|
243
|
-
|
|
244
126
|
/** core `refuseRetiredModeSeed` 的三条成员(`core/checkpoint-store.js:739-756` 逐字):前两条任何值都算(含 null),`shellGate` 不是 "always" 才算。
|
|
245
127
|
* @param {unknown} gate
|
|
246
128
|
* @returns {string | undefined} */
|
|
@@ -349,6 +231,12 @@ function readParkIndex(root, readLine) {
|
|
|
349
231
|
return { bySession, corrupt: unreadable.length, unreadable };
|
|
350
232
|
}
|
|
351
233
|
|
|
234
|
+
/** 续跑上下文的提交体要不要长形提示词(`body.promptLean === false`;`prompt-lean-rollback` 的判据)。
|
|
235
|
+
* @param {Record<string, unknown>} ctx */
|
|
236
|
+
function asksLongPromptForm(ctx) {
|
|
237
|
+
return isObject(ctx.body) && /** @type {Record<string, unknown>} */ (ctx.body).promptLean === false;
|
|
238
|
+
}
|
|
239
|
+
|
|
352
240
|
/**
|
|
353
241
|
* 判据表 —— 「哪些 pending 行算命中」。扫描骨架(快照 + 账本折成当前行、一致性重读、数据根判定)各条共用,判据只管这一问:
|
|
354
242
|
* · `tail` / `hit`:末行前缀 / 命中行前缀;
|
|
@@ -413,22 +301,6 @@ export const DRAIN_CRITERIA = [
|
|
|
413
301
|
return hit === undefined ? undefined : ` member=${hit.layer}`;
|
|
414
302
|
},
|
|
415
303
|
},
|
|
416
|
-
{
|
|
417
|
-
// 换钉 7.118.0 之前:待批、且子会话被 workflow park 索引点名的卡(头注里那一条)。账本行的读法是服务里那一只(`readAgentSessionLedgerLine`,经编译产物取);
|
|
418
|
-
// 命中行点名点它的 run。表序 `RETIRED-MODE-SEED` 仍最后。
|
|
419
|
-
name: "workflow-park-holder",
|
|
420
|
-
tail: "WORKFLOW-PARK-HOLDER",
|
|
421
|
-
hit: "WORKFLOW-PARK-ROW",
|
|
422
|
-
load: (root, service) => {
|
|
423
|
-
const idx = readParkIndex(root, service.readAgentSessionLedgerLine);
|
|
424
|
-
return { input: idx.bySession, corrupt: idx.corrupt, unreadable: idx.unreadable };
|
|
425
|
-
},
|
|
426
|
-
judge: (row, input) => {
|
|
427
|
-
const bySession = /** @type {Map<string, string[]>} */ (input);
|
|
428
|
-
const runs = typeof row.sessionId === "string" ? bySession.get(row.sessionId) : undefined;
|
|
429
|
-
return runs === undefined ? undefined : ` runId=${runs.join(",")}`;
|
|
430
|
-
},
|
|
431
|
-
},
|
|
432
304
|
{
|
|
433
305
|
// 升级到 7.132.0 之前(引擎 7.52 在认领前按规范拼写读停驻行记下的工具名清单):pending 行带这三座任一 —— 子代的工具天花板 `state.toolCeiling`(键在场且不是空数组)、
|
|
434
306
|
// 冻结的父约束链 `state.inheritedGate.constraintChain`(非空数组)、Skill 卡的清单绑定 `pendingAction.boundGrantDigest`。7.51 按原拼写记它们,7.52 读到 `Bash(*)` / `Tool()` /
|
|
@@ -487,6 +359,31 @@ export const DRAIN_CRITERIA = [
|
|
|
487
359
|
return runs !== undefined && anySealed ? ` runId=${runs.join(",")}` : undefined;
|
|
488
360
|
},
|
|
489
361
|
},
|
|
362
|
+
{
|
|
363
|
+
// 从 7.137.0 及以后回滚到 7.136.x 之前:pending 行所在会话的续跑上下文里,提交体的 `promptLean` 恰为 `false`(长的 classic 提示词形)。7.136.x 读的是退役键 `promptProfile`、
|
|
364
|
+
// 不认 `promptLean`(续跑重放存下的请求体时不过键闭集门)⇒ 回滚后这些行续跑时回到模型声明的缺省形,不报错。一次性迁移 M30 把 7.136.x 停驻、带 `"classic"` 的行改写成
|
|
365
|
+
// `promptLean: false`(不留记号),所以 M30 改写过的行全在其中;7.137.0 起新提交时就带 `promptLean: false` 的行同样在。`true` / 缺席不数(回滚后读法不变)。
|
|
366
|
+
// 判据是请求体上的一个值形事实(与 `own-tool-lists-rollback` 同:本服务运行期没有「回滚后会丢」这只判据的函数),所以写在这一张表里;精确。出路:回滚前把它们决掉或取消(随包 `MIGRATION.md` 7.137.0 节)。
|
|
367
|
+
// 读哪一份续跑上下文与续跑腿同(同 `sealed-credentials-rollback` 那一条的注):workflow 子代卡读**发起会话**那一份 ⇒ 子代卡数的是真超集 —— 自己那一份命中,
|
|
368
|
+
// 或子会话被 park 索引点名、而数据根里任一份 ctx 命中,即记为候选并点名点它的 run(`runId=`);读不懂的 ctx 档 / 索引账本行计入 `corrupt`(rc 2)。
|
|
369
|
+
name: "prompt-lean-rollback",
|
|
370
|
+
tail: "PROMPT-LEAN-ROLLBACK",
|
|
371
|
+
hit: "PROMPT-LEAN-ROW",
|
|
372
|
+
load: (root, service) => {
|
|
373
|
+
const idx = readCtxIndex(root);
|
|
374
|
+
const parks = readParkIndex(root, service.readAgentSessionLedgerLine);
|
|
375
|
+
const anyLongForm = [...idx.bySession.values()].some((ctx) => asksLongPromptForm(ctx));
|
|
376
|
+
return { input: { bySession: idx.bySession, parkedBy: parks.bySession, anyLongForm }, corrupt: idx.corrupt + parks.corrupt, unreadable: [...idx.unreadable, ...parks.unreadable] };
|
|
377
|
+
},
|
|
378
|
+
judge: (row, input) => {
|
|
379
|
+
const { bySession, parkedBy, anyLongForm } = /** @type {{ bySession: Map<string, Record<string, unknown>>, parkedBy: Map<string, string[]>, anyLongForm: boolean }} */ (input);
|
|
380
|
+
if (typeof row.sessionId !== "string") return undefined;
|
|
381
|
+
const ctx = bySession.get(row.sessionId);
|
|
382
|
+
if (ctx !== undefined && asksLongPromptForm(ctx)) return "";
|
|
383
|
+
const runs = parkedBy.get(row.sessionId);
|
|
384
|
+
return runs !== undefined && anyLongForm ? ` runId=${runs.join(",")}` : undefined;
|
|
385
|
+
},
|
|
386
|
+
},
|
|
490
387
|
{
|
|
491
388
|
name: "retired-mode-seed",
|
|
492
389
|
tail: "RETIRED-MODE-SEED",
|
|
@@ -505,7 +402,7 @@ export const DRAIN_CRITERIA = [
|
|
|
505
402
|
* @param {string} sentence
|
|
506
403
|
* @param {string} rootEcho */
|
|
507
404
|
function unreadableReport(reason, sentence, rootEcho) {
|
|
508
|
-
return { rc: /** @type {const} */ (2), stdout: DRAIN_CRITERIA.map((c) => `${c.tail} rows=- pending=- total=-
|
|
405
|
+
return { rc: /** @type {const} */ (2), stdout: DRAIN_CRITERIA.map((c) => `${c.tail} rows=- pending=- total=- corrupt=- reason=${reason} root=${rootEcho}`), stderr: [sentence] };
|
|
509
406
|
}
|
|
510
407
|
|
|
511
408
|
/**
|
|
@@ -546,10 +443,40 @@ async function loadServiceCriteria(rootEcho) {
|
|
|
546
443
|
return /** @type {ServiceCriteria} */ (fns);
|
|
547
444
|
}
|
|
548
445
|
|
|
446
|
+
/**
|
|
447
|
+
* 引擎包根的账本读法(动态导入的具名解构:引擎是本包的依赖,随包安装时恒在脚本隔壁的 `node_modules`;取不到 / 导出缺席 ⇒ 同一条 `criterion-unavailable` 不给结论,
|
|
448
|
+
* 不退回自抄的读法 —— 装载期崩出去的话 Node 的退出码是 1,与「有命中」同码)。
|
|
449
|
+
* @param {string} rootEcho
|
|
450
|
+
* @returns {Promise<{ readCheckpointLedger: LedgerReader, eventKinds: readonly string[] } | ReturnType<typeof unreadableReport>>} */
|
|
451
|
+
async function loadLedgerApi(rootEcho) {
|
|
452
|
+
try {
|
|
453
|
+
const { readCheckpointLedger, CHECKPOINT_LEDGER_EVENT_KINDS } = await import("@sema-agent/core");
|
|
454
|
+
if (typeof readCheckpointLedger !== "function" || !Array.isArray(CHECKPOINT_LEDGER_EVENT_KINDS)) {
|
|
455
|
+
return unreadableReport(
|
|
456
|
+
"criterion-unavailable",
|
|
457
|
+
"cannot use the engine's checkpoint-ledger reader (@sema-agent/core loaded but does not export readCheckpointLedger / CHECKPOINT_LEDGER_EVENT_KINDS — the installed engine is older than this script needs) — no verdict: reinstall @sema-agent/server and run the copy inside the installed package",
|
|
458
|
+
rootEcho,
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
return { readCheckpointLedger, eventKinds: CHECKPOINT_LEDGER_EVENT_KINDS };
|
|
462
|
+
} catch (e) {
|
|
463
|
+
return unreadableReport(
|
|
464
|
+
"criterion-unavailable",
|
|
465
|
+
`cannot load the engine's checkpoint-ledger reader (@sema-agent/core is not loadable from next to scripts/: ${e instanceof Error ? e.message : String(e)}) — no verdict: run the copy inside an installed @sema-agent/server package`,
|
|
466
|
+
rootEcho,
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** 引擎认的「这次读被拒:账本里有它不认的事件词」(`checkpoint.unsupported_version` + `detail.reason: "ledger_event_unknown"`,引擎读口的契约句)。
|
|
472
|
+
* @param {unknown} e */
|
|
473
|
+
const isUnknownLedgerEvent = (e) =>
|
|
474
|
+
e instanceof Error && /** @type {{ code?: unknown }} */ (e).code === "checkpoint.unsupported_version" && /** @type {{ detail?: { reason?: unknown } }} */ (e).detail?.reason === "ledger_event_unknown";
|
|
475
|
+
|
|
549
476
|
/**
|
|
550
477
|
* 一次排空检查的完整报告(导出:CLI 与测试共用)。
|
|
551
478
|
* @param {string} root 数据根
|
|
552
|
-
* @param {{
|
|
479
|
+
* @param {{ readLedger?: LedgerReader }} [opts] 测试缝:换掉账本读口(缺省 = 引擎包根的 `readCheckpointLedger`;CLI 不传)
|
|
553
480
|
* @returns {Promise<{ rc: 0 | 1 | 2, stdout: string[], stderr: string[] }>}
|
|
554
481
|
*/
|
|
555
482
|
export async function drainReport(root, opts = {}) {
|
|
@@ -574,24 +501,42 @@ export async function drainReport(root, opts = {}) {
|
|
|
574
501
|
// 不许在没有行可判时读成 rows=0,也不许等到调用处抛出(未捕获异常的退出码是 1 = 「有命中」)。
|
|
575
502
|
const service = await loadServiceCriteria(root);
|
|
576
503
|
if ("rc" in service) return service;
|
|
577
|
-
|
|
504
|
+
const ledgerApi = await loadLedgerApi(root);
|
|
505
|
+
if ("rc" in ledgerApi) return ledgerApi;
|
|
506
|
+
/** 引擎读口披露的坏记录(按「文件:行」去重 —— 快照中途换新时读口会重读,同一条坏记录不记两次)。 */
|
|
507
|
+
const damaged = new Set();
|
|
578
508
|
/** @type {Array<{ input: unknown, corrupt: number, unreadable: string[] }>} */
|
|
579
509
|
let inputs;
|
|
510
|
+
/** @type {CheckpointLedgerReading} */
|
|
511
|
+
let reading;
|
|
580
512
|
try {
|
|
581
|
-
|
|
513
|
+
reading = (opts.readLedger ?? ledgerApi.readCheckpointLedger)(root, {
|
|
514
|
+
onCorruptRead: (info) => {
|
|
515
|
+
if (info.kind === "record") damaged.add(`${info.path}:${info.line}`);
|
|
516
|
+
else if (info.kind === "file") damaged.add(info.path);
|
|
517
|
+
},
|
|
518
|
+
});
|
|
582
519
|
inputs = DRAIN_CRITERIA.map((c) => c.load(root, service));
|
|
583
520
|
} catch (e) {
|
|
584
|
-
|
|
521
|
+
if (isUnknownLedgerEvent(e)) {
|
|
522
|
+
return unreadableReport(
|
|
523
|
+
"ledger-event-unknown",
|
|
524
|
+
`the checkpoint ledger under ${dir} holds an event kind the installed engine does not know (it knows: ${ledgerApi.eventKinds.join(" / ")}) — it was written by a newer worker, or the kind was retired: no verdict; run this script from a package whose engine is at least as new as the worker that wrote the ledger`,
|
|
525
|
+
root,
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
// 读文件出错(权限 / 路径是目录 / 收编进行中 / …)⇒ 不给结论。未捕获异常的退出码是 1 = 「有命中」,会被下游读成有停放行。
|
|
585
529
|
return unreadableReport("read-error", `cannot read the checkpoint files under ${root}: ${e instanceof Error ? e.message : String(e)} — no verdict`, root);
|
|
586
530
|
}
|
|
587
|
-
if (!
|
|
531
|
+
if (!reading.settled) {
|
|
588
532
|
return unreadableReport(
|
|
589
533
|
"unstable-read",
|
|
590
|
-
`the checkpoint files under ${dir}
|
|
534
|
+
`the checkpoint files under ${dir} kept changing while being read (the engine's bounded re-read ran out) — the service is writing to its checkpoint store, so no consistent snapshot + ledger could be read: no verdict; stop the service (or its checkpoint traffic) and rerun`,
|
|
591
535
|
root,
|
|
592
536
|
);
|
|
593
537
|
}
|
|
594
|
-
const {
|
|
538
|
+
const rows = /** @type {ReadonlyMap<string, Record<string, unknown>>} */ (reading.rows);
|
|
539
|
+
const corrupt = damaged.size;
|
|
595
540
|
/** @type {string[]} */
|
|
596
541
|
const stdout = [];
|
|
597
542
|
/** @type {string[]} */
|
|
@@ -599,7 +544,7 @@ export async function drainReport(root, opts = {}) {
|
|
|
599
544
|
/** @type {string[]} */
|
|
600
545
|
const tails = [];
|
|
601
546
|
let anyHit = false;
|
|
602
|
-
let anyUnreadable =
|
|
547
|
+
let anyUnreadable = corrupt > 0;
|
|
603
548
|
DRAIN_CRITERIA.forEach((criterion, i) => {
|
|
604
549
|
const { input, corrupt: ownCorrupt, unreadable } = inputs[i];
|
|
605
550
|
let hits = 0;
|
|
@@ -615,7 +560,7 @@ export async function drainReport(root, opts = {}) {
|
|
|
615
560
|
if (unreadable.length > 0) stderr.push(`${criterion.name}: unreadable input files (no verdict — one of them may be what makes a pending row count): ${unreadable.join(", ")}`);
|
|
616
561
|
if (ownCorrupt > 0) anyUnreadable = true;
|
|
617
562
|
if (hits > 0) anyHit = true;
|
|
618
|
-
tails.push(`${criterion.tail} rows=${hits} pending=${pending} total=${rows.size}
|
|
563
|
+
tails.push(`${criterion.tail} rows=${hits} pending=${pending} total=${rows.size} corrupt=${corrupt + ownCorrupt} root=${root}`);
|
|
619
564
|
});
|
|
620
565
|
return { rc: anyUnreadable ? 2 : anyHit ? 1 : 0, stdout: [...stdout, ...tails], stderr };
|
|
621
566
|
}
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
-- skill-grants-rollback 回滚到 7.115.x(引擎 7.40)之前:7.116.0 停驻的行带 7.40 不读的技能授予节 / 卡绑定 / 会话上下文里的人点名技能 / 还没被激活的技能声明的禁止清单。
|
|
15
15
|
-- retired-skill-manifest 升级到 7.116.0 之前:停驻、持久化提交体里技能(顶层 skills[] 或子代 agents[].skills[])还带已退役的 manifest 键。
|
|
16
16
|
-- skill-deny-inert 换钉 7.117.0 之前:停驻、提交体里技能(顶层 skills[] 或子代 agents[].skills[])的 disallowedTools 有引擎会读成空的条目的**候选**(见该段注)。
|
|
17
|
-
-- workflow-park-holder 换钉 7.118.0 之前 / 从 7.118.0 回滚到 7.117.x 之前:此刻待批、且子会话被 workflow park 索引点名的卡(workflow 子代卡;见该段注)。
|
|
18
17
|
-- parked-tool-lists 升级到 7.132.0 之前:停驻行记着子代工具天花板 / 冻结的父约束链 / Skill 卡的清单绑定(7.52 在认领前按规范拼写读它们)的**候选**(见该段注)。
|
|
19
18
|
-- own-tool-lists-rollback 从 7.132.0 回滚到 7.131.x 之前:7.132.0 停驻、带 state.ownToolLists 的行(7.131.x 读不了)。
|
|
20
19
|
-- sealed-credentials-rollback 从 7.134.0 回滚到 7.133.x(或从 7.135.0 回滚到 7.134.x、从 7.136.0 回滚到 7.135.x)之前:停驻、续跑上下文里提交体的凭据位上带封签的行(7.133.x 读不懂封签,续跑时把这些位当没有)的**候选**(见该段注)。
|
|
20
|
+
-- prompt-lean-rollback 从 7.137.0 及以后回滚到 7.136.x 之前:停驻、续跑上下文里提交体的 promptLean 为 false(要长形提示词)的行 —— 7.136.x 不认这个键,续跑时回到缺省形(一次性迁移 M30 改写过的行全在其中)。
|
|
21
21
|
-- retired-mode-seed 换钉 7.113.0 之前:检查点的 inheritedGate 里仍带退役 mode-seed 成员。
|
|
22
22
|
|
|
23
23
|
-- drain-check:skill-grants-rollback:mysql —— 期望 hit_rows = 0;每一行 = 一条回滚到 7.115.x 后续跑会丢技能禁止行 / 不核卡绑定的停驻行。
|
|
@@ -74,21 +74,6 @@ WHERE k.status = 'pending'
|
|
|
74
74
|
OR (JSON_TYPE(JSON_EXTRACT(c.ctx, '$.body.agents')) = 'ARRAY'
|
|
75
75
|
AND JSON_CONTAINS_PATH(c.ctx, 'one', '$.body.agents[*].skills[*].disallowedTools[0]'))));
|
|
76
76
|
|
|
77
|
-
-- drain-check:workflow-park-holder:mysql —— 期望 hit_rows = 0;每一行 = 一张待批的 workflow 子代卡(它的子会话被 workflow_agent_session 里的一条指针点名)。
|
|
78
|
-
-- 在**换钉之前**、对旧版本的数据跑:7.118.0 起 workflow 子代卡交给哪条 run 只看记录 parks[] 条目上的持有者位(parkedBy / generation),
|
|
79
|
-
-- 引擎 7.43 及以前写下的记录没有这两位 ⇒ 这样的卡升级后在决定口答 409 decide.workflow_parks_unreadable(更早的引擎写下、记录上根本没有 parks 的,答 409
|
|
80
|
-
-- conflict.resume_context_unavailable;卡都仍待批,出路相同 = 续跑那条 workflow run 再决)。
|
|
81
|
-
-- 换钉前把它们决掉(或取消发起它的任务)就省掉这一步。换钉之后再跑本段会把新引擎写下的卡也数进来(那时它不再是「会被拒的卡」的读数)。
|
|
82
|
-
-- 从 7.118.0 回滚到 7.117.x 之前、对 7.118.0 的数据跑:数出的就是全部待批的 workflow 子代卡 —— 回滚要删掉这张索引表(7.117.x 按旧主键重建,
|
|
83
|
-
-- 旧副本在新主键上写不进 / 读不准,见随包 MIGRATION.md 7.118.0 节),删表之后这些卡没有指针、决不掉;先把它们决掉或取消。
|
|
84
|
-
-- 对索引表用 EXISTS 而不 JOIN:一个子会话可以被好几条记录点名,JOIN 会把一张卡数成几张。
|
|
85
|
-
-- 窗与删码:本判据是一次性迁移 M9 的读侧半场 —— 窗口与删码清单见引擎启动期一次性迁移登记表(one-time-migrations)M9 一行,随 M9 一起删;这里不写第二份窗。
|
|
86
|
-
SELECT 'workflow-park-holder' AS criterion, COUNT(*) AS hit_rows,
|
|
87
|
-
COALESCE(GROUP_CONCAT(k.session_id ORDER BY k.created_at_ms DESC SEPARATOR ','), '') AS sessions
|
|
88
|
-
FROM checkpoint k
|
|
89
|
-
WHERE k.status = 'pending'
|
|
90
|
-
AND EXISTS (SELECT 1 FROM workflow_agent_session w WHERE w.session_id = k.session_id);
|
|
91
|
-
|
|
92
77
|
-- drain-check:parked-tool-lists:mysql —— 期望 hit_rows = 0;每一行 = 一条**候选**:升级到 7.132.0 后续跑可能在认领前被拒的停驻行。
|
|
93
78
|
-- 在**升级之前**、对 7.131.x 的数据跑。7.131.x 的引擎(7.51)把行上的三样按原拼写记下,7.132.0 的引擎(7.52)在认领前按规范拼写读它们:
|
|
94
79
|
-- 子代的工具天花板 state.toolCeiling(`Bash(*)` / `Tool()` / 内容形 / 读不出的名 / deny `*` ⇒ 409 checkpoint.config_refused,blockedBy = config.tool_face_control,field = inheritedGate);
|
|
@@ -136,6 +121,25 @@ WHERE k.status = 'pending'
|
|
|
136
121
|
WHERE kk.token = k.token
|
|
137
122
|
AND LOCATE('"checkpoint-ctx-sealedbox-v1"', CAST(JSON_EXTRACT(c.ctx, '$.body') AS CHAR)) > 0);
|
|
138
123
|
|
|
124
|
+
-- drain-check:prompt-lean-rollback:mysql —— 期望 hit_rows = 0;每一行 = 一条从 7.137.0 及以后回滚到 7.136.x 后续跑会丢掉长形提示词的停驻行。
|
|
125
|
+
-- 在**回滚之前**、对当前版本的数据跑:7.137.0 起请求体的提示词形是布尔 promptLean(false = 长的 classic 形),7.136.x 读的是退役键 promptProfile、不认 promptLean
|
|
126
|
+
-- (续跑重放存下的请求体时不过键闭集门)⇒ 回滚后这些行续跑时回到模型声明的缺省形(短形),不报错。一次性迁移 M30 把 7.136.x 停驻、带 "classic" 的行改写成
|
|
127
|
+
-- promptLean: false(不留记号),所以 M30 改写过的行全在这里;7.137.0 起新提交时就带 promptLean: false 的停驻行同样在(回滚后同样丢长形)。
|
|
128
|
+
-- 判据 = 续跑腿读的那一份续跑上下文(连接形与 skill-deny-inert 段逐字同,理由见该段注)的提交体里 promptLean 恰为 JSON false(值判精确;true / 缺席不数 —— 回滚后读法不变)。
|
|
129
|
+
-- workflow 子代卡按全部指针数(历史指针的发起会话要长形也数)⇒ 对它们是真超集,与 skill-deny-inert / sealed-credentials-rollback 两段同。
|
|
130
|
+
-- 出路:回滚前把它们决掉或取消(见随包 MIGRATION.md 7.137.0 节「回滚到 7.136.x 前先决完或取消停驻任务」)。
|
|
131
|
+
SELECT 'prompt-lean-rollback' AS criterion, COUNT(*) AS hit_rows,
|
|
132
|
+
COALESCE(GROUP_CONCAT(k.session_id ORDER BY k.created_at_ms DESC SEPARATOR ','), '') AS sessions
|
|
133
|
+
FROM checkpoint k
|
|
134
|
+
WHERE k.status = 'pending'
|
|
135
|
+
AND EXISTS (SELECT 1
|
|
136
|
+
FROM checkpoint kk
|
|
137
|
+
LEFT JOIN workflow_agent_session w ON w.session_id = kk.session_id
|
|
138
|
+
LEFT JOIN workflow_run r ON r.id = w.run_id
|
|
139
|
+
JOIN checkpoint_ctx c ON c.session_id = COALESCE(JSON_UNQUOTE(JSON_EXTRACT(r.run, '$.originatingSessionId')), kk.session_id)
|
|
140
|
+
WHERE kk.token = k.token
|
|
141
|
+
AND JSON_TYPE(JSON_EXTRACT(c.ctx, '$.body.promptLean')) = 'BOOLEAN' AND CAST(JSON_EXTRACT(c.ctx, '$.body.promptLean') AS CHAR) = 'false');
|
|
142
|
+
|
|
139
143
|
-- drain-check:retired-mode-seed:mysql —— 期望 hit_rows = 0;每一行 = 一条升级后会被拒的停放行。
|
|
140
144
|
-- 判据逐字照引擎 refuseRetiredModeSeed:inheritedGate 带 autoModeRequested / approverPosture(任何值,含 JSON null),或 shellGate 不是 "always"(含 JSON null)。
|
|
141
145
|
SELECT 'retired-mode-seed' AS criterion, COUNT(*) AS hit_rows,
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
-- skill-grants-rollback 回滚到 7.115.x(引擎 7.40)之前:7.116.0 停驻的行带 7.40 不读的技能授予节 / 卡绑定 / 会话上下文里的人点名技能 / 还没被激活的技能声明的禁止清单。
|
|
14
14
|
-- retired-skill-manifest 升级到 7.116.0 之前:停驻、持久化提交体里技能(顶层 skills[] 或子代 agents[].skills[])还带已退役的 manifest 键。
|
|
15
15
|
-- skill-deny-inert 换钉 7.117.0 之前:停驻、提交体里技能(顶层 skills[] 或子代 agents[].skills[])的 disallowedTools 有引擎会读成空的条目的**候选**(见该段注)。
|
|
16
|
-
-- workflow-park-holder 换钉 7.118.0 之前 / 从 7.118.0 回滚到 7.117.x 之前:此刻待批、且子会话被 workflow park 索引点名的卡(workflow 子代卡;见该段注)。
|
|
17
16
|
-- parked-tool-lists 升级到 7.132.0 之前:停驻行记着子代工具天花板 / 冻结的父约束链 / Skill 卡的清单绑定(7.52 在认领前按规范拼写读它们)的**候选**(见该段注)。
|
|
18
17
|
-- own-tool-lists-rollback 从 7.132.0 回滚到 7.131.x 之前:7.132.0 停驻、带 state.ownToolLists 的行(7.131.x 读不了)。
|
|
19
18
|
-- sealed-credentials-rollback 从 7.134.0 回滚到 7.133.x(或从 7.135.0 回滚到 7.134.x、从 7.136.0 回滚到 7.135.x)之前:停驻、续跑上下文里提交体的凭据位上带封签的行(7.133.x 读不懂封签,续跑时把这些位当没有)的**候选**(见该段注)。
|
|
19
|
+
-- prompt-lean-rollback 从 7.137.0 及以后回滚到 7.136.x 之前:停驻、续跑上下文里提交体的 promptLean 为 false(要长形提示词)的行 —— 7.136.x 不认这个键,续跑时回到缺省形(一次性迁移 M30 改写过的行全在其中)。
|
|
20
20
|
-- retired-mode-seed 换钉 7.113.0 之前:检查点的 inheritedGate 里仍带退役 mode-seed 成员。
|
|
21
21
|
|
|
22
22
|
-- drain-check:skill-grants-rollback:pg —— 期望 hit_rows = 0;每一行 = 一条回滚到 7.115.x 后续跑会丢技能禁止行 / 不核卡绑定的停驻行。
|
|
@@ -83,21 +83,6 @@ WHERE k.status = 'pending'
|
|
|
83
83
|
jsonb_array_elements(CASE WHEN jsonb_typeof(a -> 'skills') = 'array' THEN a -> 'skills' ELSE '[]'::jsonb END) AS s) AS sk
|
|
84
84
|
WHERE jsonb_typeof(sk.s) = 'object' AND jsonb_typeof(sk.s -> 'disallowedTools') = 'array' AND (sk.s -> 'disallowedTools') <> '[]'::jsonb));
|
|
85
85
|
|
|
86
|
-
-- drain-check:workflow-park-holder:pg —— 期望 hit_rows = 0;每一行 = 一张待批的 workflow 子代卡(它的子会话被 workflow_agent_session 里的一条指针点名)。
|
|
87
|
-
-- 在**换钉之前**、对旧版本的数据跑:7.118.0 起 workflow 子代卡交给哪条 run 只看记录 parks[] 条目上的持有者位(parkedBy / generation),
|
|
88
|
-
-- 引擎 7.43 及以前写下的记录没有这两位 ⇒ 这样的卡升级后在决定口答 409 decide.workflow_parks_unreadable(更早的引擎写下、记录上根本没有 parks 的,答 409
|
|
89
|
-
-- conflict.resume_context_unavailable;卡都仍待批,出路相同 = 续跑那条 workflow run 再决)。
|
|
90
|
-
-- 换钉前把它们决掉(或取消发起它的任务)就省掉这一步。换钉之后再跑本段会把新引擎写下的卡也数进来(那时它不再是「会被拒的卡」的读数)。
|
|
91
|
-
-- 从 7.118.0 回滚到 7.117.x 之前、对 7.118.0 的数据跑:数出的就是全部待批的 workflow 子代卡 —— 回滚要删掉这张索引表(7.117.x 按旧主键重建,
|
|
92
|
-
-- 旧副本在新主键上写不进 / 读不准,见随包 MIGRATION.md 7.118.0 节),删表之后这些卡没有指针、决不掉;先把它们决掉或取消。
|
|
93
|
-
-- 对索引表用 EXISTS 而不 JOIN:一个子会话可以被好几条记录点名,JOIN 会把一张卡数成几张。
|
|
94
|
-
-- 窗与删码:本判据是一次性迁移 M9 的读侧半场 —— 窗口与删码清单见引擎启动期一次性迁移登记表(one-time-migrations)M9 一行,随 M9 一起删;这里不写第二份窗。
|
|
95
|
-
SELECT 'workflow-park-holder' AS criterion, count(*) AS hit_rows,
|
|
96
|
-
coalesce(string_agg(k.session_id, ',' ORDER BY k.created_at_ms DESC), '') AS sessions
|
|
97
|
-
FROM checkpoint k
|
|
98
|
-
WHERE k.status = 'pending'
|
|
99
|
-
AND EXISTS (SELECT 1 FROM workflow_agent_session w WHERE w.session_id = k.session_id);
|
|
100
|
-
|
|
101
86
|
-- drain-check:parked-tool-lists:pg —— 期望 hit_rows = 0;每一行 = 一条**候选**:升级到 7.132.0 后续跑可能在认领前被拒的停驻行。
|
|
102
87
|
-- 在**升级之前**、对 7.131.x 的数据跑。7.131.x 的引擎(7.51)把行上的三样按原拼写记下,7.132.0 的引擎(7.52)在认领前按规范拼写读它们:
|
|
103
88
|
-- 子代的工具天花板 state.toolCeiling(`Bash(*)` / `Tool()` / 内容形 / 读不出的名 / deny `*` ⇒ 409 checkpoint.config_refused,blockedBy = config.tool_face_control,field = inheritedGate);
|
|
@@ -144,6 +129,25 @@ WHERE k.status = 'pending'
|
|
|
144
129
|
WHERE kk.token = k.token
|
|
145
130
|
AND strpos((c.ctx -> 'body')::text, '"checkpoint-ctx-sealedbox-v1"') > 0);
|
|
146
131
|
|
|
132
|
+
-- drain-check:prompt-lean-rollback:pg —— 期望 hit_rows = 0;每一行 = 一条从 7.137.0 及以后回滚到 7.136.x 后续跑会丢掉长形提示词的停驻行。
|
|
133
|
+
-- 在**回滚之前**、对当前版本的数据跑:7.137.0 起请求体的提示词形是布尔 promptLean(false = 长的 classic 形),7.136.x 读的是退役键 promptProfile、不认 promptLean
|
|
134
|
+
-- (续跑重放存下的请求体时不过键闭集门)⇒ 回滚后这些行续跑时回到模型声明的缺省形(短形),不报错。一次性迁移 M30 把 7.136.x 停驻、带 "classic" 的行改写成
|
|
135
|
+
-- promptLean: false(不留记号),所以 M30 改写过的行全在这里;7.137.0 起新提交时就带 promptLean: false 的停驻行同样在(回滚后同样丢长形)。
|
|
136
|
+
-- 判据 = 续跑腿读的那一份续跑上下文(连接形与 skill-deny-inert 段逐字同,理由见该段注)的提交体里 promptLean 恰为 JSON false(值判精确;true / 缺席不数 —— 回滚后读法不变)。
|
|
137
|
+
-- workflow 子代卡按全部指针数(历史指针的发起会话要长形也数)⇒ 对它们是真超集,与 skill-deny-inert / sealed-credentials-rollback 两段同。
|
|
138
|
+
-- 出路:回滚前把它们决掉或取消(见随包 MIGRATION.md 7.137.0 节「回滚到 7.136.x 前先决完或取消停驻任务」)。
|
|
139
|
+
SELECT 'prompt-lean-rollback' AS criterion, count(*) AS hit_rows,
|
|
140
|
+
coalesce(string_agg(k.session_id, ',' ORDER BY k.created_at_ms DESC), '') AS sessions
|
|
141
|
+
FROM checkpoint k
|
|
142
|
+
WHERE k.status = 'pending'
|
|
143
|
+
AND EXISTS (SELECT 1
|
|
144
|
+
FROM checkpoint kk
|
|
145
|
+
LEFT JOIN workflow_agent_session w ON w.session_id = kk.session_id
|
|
146
|
+
LEFT JOIN workflow_run r ON r.id = w.run_id
|
|
147
|
+
JOIN checkpoint_ctx c ON c.session_id = COALESCE(r.run::json->>'originatingSessionId', kk.session_id)
|
|
148
|
+
WHERE kk.token = k.token
|
|
149
|
+
AND (c.ctx #> '{body,promptLean}') = 'false'::jsonb);
|
|
150
|
+
|
|
147
151
|
-- drain-check:retired-mode-seed:pg —— 期望 hit_rows = 0;每一行 = 一条升级后会被拒的停放行。
|
|
148
152
|
-- 判据逐字照引擎 refuseRetiredModeSeed:inheritedGate 带 autoModeRequested / approverPosture(任何值,含 JSON null),或 shellGate 不是 "always"(含 JSON null)。
|
|
149
153
|
SELECT 'retired-mode-seed' AS criterion, count(*) AS hit_rows,
|