@sema-agent/server 7.134.0 → 7.135.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +134 -0
- package/USAGE.md +98 -30
- package/dist/adoption/plan.d.ts +1 -1
- package/dist/approval-ask-audit-store.d.ts +24 -24
- package/dist/approval-ask-machine.d.ts +2 -2
- package/dist/approval-card.d.ts +62 -150
- package/dist/approval-card.js +33 -51
- package/dist/approval-content-kind.d.ts +22 -5
- package/dist/approval-content-kind.js +8 -1
- package/dist/approval-deny-reasons.d.ts +1 -1
- package/dist/approval-gate-currency.d.ts +22 -3
- package/dist/approval-gate-currency.js +44 -18
- package/dist/approval-hmac.d.ts +7 -7
- package/dist/approval-policy-settlement.d.ts +2 -2
- package/dist/approval-reconciler.d.ts +3 -3
- package/dist/approval.d.ts +8 -8
- package/dist/approval.js +4 -2
- package/dist/auth-bridge.d.ts +1 -1
- package/dist/auto-mode-face.d.ts +4 -4
- package/dist/background-session-reap.d.ts +2 -2
- package/dist/bake-runner/main.d.ts +2 -2
- package/dist/bake-runner/runner.d.ts +4 -4
- package/dist/bench/s1/live-deps.d.ts +1 -1
- package/dist/bench/s1/run-firm.d.ts +1 -1
- package/dist/boot/coordinators.d.ts +2 -2
- package/dist/boot/coordinators.js +2 -2
- package/dist/boot/deferred-sandbox-path-env.d.ts +0 -6
- package/dist/boot/deferred-sandbox-path-env.js +0 -5
- package/dist/boot/engine-lease.d.ts +5 -5
- package/dist/boot/execution-env.d.ts +16 -15
- package/dist/boot/execution-env.js +19 -21
- package/dist/boot/fatal-exit.d.ts +2 -2
- package/dist/boot/late-binds.d.ts +1 -1
- package/dist/boot/leader.d.ts +1 -1
- package/dist/boot/memory-boundary.d.ts +2 -2
- package/dist/boot/memory-consolidation.d.ts +15 -15
- package/dist/boot/parked-revive-gate.d.ts +3 -3
- package/dist/boot/parked-revive-gate.js +3 -2
- package/dist/boot/reapers.d.ts +4 -4
- package/dist/boot/resolve-spec.d.ts +1 -1
- package/dist/boot/resolve-spec.js +28 -24
- package/dist/boot/runner-deps.d.ts +11 -11
- package/dist/boot/runner-deps.js +3 -2
- package/dist/boot/session-faces.d.ts +3 -3
- package/dist/boot/session-faces.js +11 -30
- package/dist/boot/shutdown.d.ts +5 -5
- package/dist/boot/side-query-lane.d.ts +2 -2
- package/dist/boot/stage-05-execution-env.js +4 -4
- package/dist/boot/stage-06-runners.js +0 -2
- package/dist/boot/stores.js +2 -1
- package/dist/boot/web-admin.d.ts +17 -17
- package/dist/boot/web-admin.js +5 -10
- package/dist/boot/workflow-orchestration.js +2 -9
- package/dist/brain.d.ts +11 -11
- package/dist/budget.d.ts +4 -4
- package/dist/capabilities/approvals-push.d.ts +4 -4
- package/dist/capabilities/builtin-tools.d.ts +5 -5
- package/dist/capabilities/center-plugins.d.ts +5 -5
- package/dist/capabilities/center-plugins.js +1 -1
- package/dist/capabilities/center-prompts.d.ts +1 -1
- package/dist/capabilities/center-wiring.d.ts +1 -1
- package/dist/capabilities/composite-members.d.ts +1 -1
- package/dist/capabilities/execution-lane.d.ts +5 -5
- package/dist/capabilities/execution-lane.js +2 -2
- package/dist/capabilities/hands-lane.d.ts +5 -5
- package/dist/capabilities/mcp-probe.d.ts +10 -7
- package/dist/capabilities/sandbox-file-send.d.ts +1 -18
- package/dist/capabilities/sandbox-file-send.js +0 -7
- package/dist/capabilities/scenarios.d.ts +28 -10
- package/dist/capabilities/scenarios.js +15 -5
- package/dist/capabilities/send-user-file-tool.d.ts +1 -1
- package/dist/capabilities/skills.d.ts +31 -12
- package/dist/capabilities/skills.js +23 -17
- package/dist/capabilities/tool-defer.d.ts +1 -1
- package/dist/capability-facts.d.ts +26 -25
- package/dist/capability-facts.js +14 -16
- package/dist/center-config-tier.d.ts +1 -1
- package/dist/center-credential.d.ts +4 -4
- package/dist/checkpoint-identity.d.ts +5 -0
- package/dist/checkpoint-identity.js +14 -0
- package/dist/config-catalog.d.ts +12 -12
- package/dist/config-invariants.d.ts +4 -4
- package/dist/config-invariants.js +3 -2
- package/dist/config-lkg.d.ts +1 -1
- package/dist/config-provider.d.ts +13 -13
- package/dist/config-provider.js +2 -1
- package/dist/config-types.d.ts +83 -83
- package/dist/config.d.ts +26 -24
- package/dist/config.js +12 -10
- package/dist/cross-session-settings.d.ts +1 -1
- package/dist/delegated-session-owner.d.ts +16 -13
- package/dist/delegated-session-owner.js +9 -10
- package/dist/deployment-governance.d.ts +16 -16
- package/dist/deployment-shape.d.ts +127 -0
- package/dist/deployment-shape.js +72 -0
- package/dist/device-store.d.ts +1 -1
- package/dist/device-ws-hub.d.ts +1 -1
- package/dist/egress-redirect.d.ts +1 -1
- package/dist/entry-mode-clamp-notice.d.ts +2 -2
- package/dist/env-facts.d.ts +10 -9
- package/dist/env-facts.js +1 -1
- package/dist/env-name-allowlist-knobs.d.ts +5 -5
- package/dist/exec-bounds.d.ts +2 -2
- package/dist/execution-lane-caps.d.ts +31 -43
- package/dist/execution-lane-caps.js +0 -13
- package/dist/file-history-capture.d.ts +9 -9
- package/dist/file-history-disclosure.d.ts +23 -11
- package/dist/file-history-disclosure.js +7 -12
- package/dist/fleet/drain-entry.d.ts +2 -2
- package/dist/fleet/fleet-bus.d.ts +22 -14
- package/dist/fleet/fleet-bus.js +5 -5
- package/dist/fleet/fleet-reconciler.d.ts +9 -9
- package/dist/fleet/subagent-tail-bus.d.ts +4 -4
- package/dist/fleet-client.d.ts +13 -13
- package/dist/fleet-lease.d.ts +16 -16
- package/dist/governance-http-status.d.ts +2 -2
- package/dist/hooks/hook-llm.d.ts +7 -7
- package/dist/hooks/hook-runner.d.ts +57 -30
- package/dist/hooks/hook-runner.js +36 -18
- package/dist/host-decision.d.ts +5 -5
- package/dist/host-lsp-manager.d.ts +5 -5
- package/dist/hosted-posture.d.ts +23 -13
- package/dist/hosted-posture.js +4 -9
- package/dist/http/admission.d.ts +2 -2
- package/dist/http/admission.js +20 -5
- package/dist/http/approval-sweeps.d.ts +1 -1
- package/dist/http/approval-sweeps.js +2 -1
- package/dist/http/checkpoint-ctx.d.ts +39 -13
- package/dist/http/checkpoint-ctx.js +74 -35
- package/dist/http/dispatch.d.ts +3 -3
- package/dist/http/durable-run-leg.js +4 -3
- package/dist/http/idempotency.d.ts +2 -2
- package/dist/http/mcp-dial-deadline.d.ts +7 -5
- package/dist/http/memory-compliance-failure-reply.d.ts +4 -4
- package/dist/http/owner-access.d.ts +4 -6
- package/dist/http/owner-access.js +1 -1
- package/dist/http/principal-gate.d.ts +7 -7
- package/dist/http/principal-gate.js +3 -2
- package/dist/http/readiness.d.ts +1 -1
- package/dist/http/request-guards.d.ts +4 -4
- package/dist/http/request-guards.js +2 -1
- package/dist/http/resume-ctx-read.d.ts +7 -7
- package/dist/http/resume-ctx-read.js +1 -1
- package/dist/http/resume-legs.d.ts +3 -3
- package/dist/http/resume-legs.js +11 -8
- package/dist/http/route-ctx.d.ts +29 -29
- package/dist/http/route-table.d.ts +9 -9
- package/dist/http/routes/agents-roster.d.ts +1 -1
- package/dist/http/routes/approvals-assistant.d.ts +5 -5
- package/dist/http/routes/approvals-assistant.js +55 -15
- package/dist/http/routes/background.d.ts +3 -3
- package/dist/http/routes/background.js +2 -2
- package/dist/http/routes/capabilities.d.ts +1 -1
- package/dist/http/routes/capabilities.js +16 -8
- package/dist/http/routes/config-catalog.d.ts +1 -1
- package/dist/http/routes/devices.d.ts +1 -1
- package/dist/http/routes/diagnostics.d.ts +3 -3
- package/dist/http/routes/fleet.d.ts +1 -1
- package/dist/http/routes/fleet.js +2 -1
- package/dist/http/routes/mcp-reconnect.d.ts +4 -4
- package/dist/http/routes/mcp-reconnect.js +3 -3
- package/dist/http/routes/memory-consolidation.d.ts +1 -1
- package/dist/http/routes/notify-wake.d.ts +1 -1
- package/dist/http/routes/notify-wake.js +2 -2
- package/dist/http/routes/rules.d.ts +1 -1
- package/dist/http/routes/runs.js +22 -10
- package/dist/http/routes/session-sync.d.ts +1 -1
- package/dist/http/routes/session-sync.js +73 -44
- package/dist/http/routes/sessions-list.js +1 -1
- package/dist/http/routes/sessions.js +30 -44
- package/dist/http/routes/tasks.d.ts +1 -1
- package/dist/http/routes/trace-usage.d.ts +1 -1
- package/dist/http/routes/workflows.d.ts +3 -0
- package/dist/http/routes/workflows.js +31 -28
- package/dist/http/send.d.ts +5 -5
- package/dist/http/server.d.ts +34 -34
- package/dist/http/session-inherit-env.d.ts +3 -3
- package/dist/http/sse-lifecycle.d.ts +1 -1
- package/dist/http/sse-log.d.ts +2 -2
- package/dist/http/submit-ctx.js +1 -1
- package/dist/http/sync-submit-body.d.ts +1 -1
- package/dist/http/verify-rounds.d.ts +1 -1
- package/dist/http/wire-types.d.ts +28 -21
- package/dist/instruction-source-notice.d.ts +2 -2
- package/dist/key-resolver.d.ts +3 -3
- package/dist/lane-home-probe.d.ts +1 -1
- package/dist/leader/diffout.d.ts +1 -1
- package/dist/leader/diffup.d.ts +2 -2
- package/dist/leader/endpoint.d.ts +1 -1
- package/dist/leader/fanout.d.ts +1 -1
- package/dist/leader/leader.d.ts +4 -4
- package/dist/leader/merge.d.ts +3 -3
- package/dist/leader/repair-wire.d.ts +1 -1
- package/dist/leader/wire.d.ts +6 -6
- package/dist/list-entry-display.d.ts +1 -1
- package/dist/lsp-evict.d.ts +1 -1
- package/dist/mcp-assertion-header.d.ts +1 -1
- package/dist/memory-layer-legacy-lock.d.ts +1 -1
- package/dist/memory-operator-faces.d.ts +1 -1
- package/dist/memory-posture.js +4 -2
- package/dist/memory-project-layer.d.ts +1 -1
- package/dist/memory-scope.d.ts +19 -19
- package/dist/memory-store-refusal.d.ts +4 -4
- package/dist/model-entry-headers.d.ts +2 -2
- package/dist/model-entry-refusal.d.ts +17 -17
- package/dist/model-provider.d.ts +10 -10
- package/dist/model-reach-scope.d.ts +1 -1
- package/dist/model-route-endpoint.d.ts +6 -6
- package/dist/model-route-url.d.ts +5 -5
- package/dist/model-select.d.ts +15 -6
- package/dist/model-select.js +5 -0
- package/dist/model-unreachable-notice.d.ts +3 -3
- package/dist/namespaced-rule-name.d.ts +15 -5
- package/dist/namespaced-rule-name.js +3 -2
- package/dist/observability/corrupt-read-seat.d.ts +9 -9
- package/dist/observability/cost-taxonomy.d.ts +1 -1
- package/dist/observability/err-text.d.ts +1 -1
- package/dist/observability/fail-open.d.ts +12 -8
- package/dist/observability/fail-open.js +12 -8
- package/dist/observability/metrics.d.ts +3 -3
- package/dist/observability/run-terminal.d.ts +36 -36
- package/dist/observability/secret-env-scrub.d.ts +3 -3
- package/dist/observability/tool-trace.d.ts +1 -1
- package/dist/operator-ask.d.ts +4 -4
- package/dist/orchestration/workflow-agent-session-index.d.ts +3 -3
- package/dist/orchestration/workflow-completion-inbox.d.ts +20 -5
- package/dist/orchestration/workflow-completion-inbox.js +29 -7
- package/dist/orchestration/workflow-notify-journal.d.ts +43 -19
- package/dist/orchestration/workflow-notify-journal.js +17 -0
- package/dist/outbound-dispatcher.d.ts +4 -4
- package/dist/parent-watch.d.ts +4 -4
- package/dist/parked-decide.d.ts +16 -15
- package/dist/parked-decide.js +5 -4
- package/dist/parked-revive-surface.d.ts +7 -7
- package/dist/parked-revive-surface.js +2 -3
- package/dist/peer-directory.d.ts +3 -3
- package/dist/peer-directory.js +1 -1
- package/dist/permission-rule-list.d.ts +10 -1
- package/dist/permission-rule-list.js +7 -5
- package/dist/permission-rule-vocab.d.ts +2 -2
- package/dist/plugins/adoption-log-sql.d.ts +1 -1
- package/dist/plugins/approval-ask-store-file.d.ts +8 -1
- package/dist/plugins/approval-ask-store-file.js +6 -3
- package/dist/plugins/approval-ask-store-memory.d.ts +11 -7
- package/dist/plugins/approval-ask-store-memory.js +11 -7
- package/dist/plugins/approval-ask-store-sql.d.ts +34 -15
- package/dist/plugins/approval-ask-store-sql.js +18 -5
- package/dist/plugins/approval-exemption-store.d.ts +3 -3
- package/dist/plugins/approval-nonce-store.d.ts +3 -3
- package/dist/plugins/background-agent-store-sql.d.ts +1 -1
- package/dist/plugins/background-shell-support.d.ts +2 -2
- package/dist/plugins/blob-backend.d.ts +1 -1
- package/dist/plugins/caching-session-store.d.ts +23 -32
- package/dist/plugins/caching-session-store.js +5 -17
- package/dist/plugins/checkpoint-index-columns.d.ts +81 -0
- package/dist/plugins/checkpoint-index-columns.js +62 -0
- package/dist/plugins/checkpoint-store-sql.d.ts +44 -66
- package/dist/plugins/checkpoint-store-sql.js +55 -102
- package/dist/plugins/device-store-sql.d.ts +7 -6
- package/dist/plugins/e2b-orphan-reclaim.d.ts +1 -1
- package/dist/plugins/ensure-schema-lock-policy.d.ts +1 -1
- package/dist/plugins/file-history-store-sql.d.ts +9 -7
- package/dist/plugins/file-history-store-sql.js +27 -15
- package/dist/plugins/file-run-store.d.ts +8 -8
- package/dist/plugins/fork-routing-session-store.d.ts +2 -2
- package/dist/plugins/fork-routing-session-store.js +1 -1
- package/dist/plugins/host-platform.d.ts +10 -10
- package/dist/plugins/image-bake-store-sql.d.ts +1 -1
- package/dist/plugins/image-index-sql.d.ts +1 -1
- package/dist/plugins/leader-run-store-sql.d.ts +1 -1
- package/dist/plugins/local-checkpoint-store.d.ts +10 -10
- package/dist/plugins/local-checkpoint-store.js +3 -4
- package/dist/plugins/local-session-store.d.ts +34 -38
- package/dist/plugins/local-session-store.js +20 -39
- package/dist/plugins/local-session-window.d.ts +1 -1
- package/dist/plugins/mailbox-store-sql.d.ts +2 -2
- package/dist/plugins/memory-engine-pg.d.ts +1 -1
- package/dist/plugins/memory-run-store.d.ts +4 -4
- package/dist/plugins/memory-sync-store-pg.d.ts +3 -3
- package/dist/plugins/one-time-migrations.d.ts +66 -40
- package/dist/plugins/one-time-migrations.js +115 -34
- package/dist/plugins/outcome-ledger-sql.d.ts +1 -1
- package/dist/plugins/park-commit-watch.d.ts +3 -3
- package/dist/plugins/permission-rule-store-file.d.ts +5 -5
- package/dist/plugins/permission-rule-store-file.js +12 -19
- package/dist/plugins/permission-rule-store-sql.d.ts +38 -4
- package/dist/plugins/permission-rule-store-sql.js +67 -24
- package/dist/plugins/pg-cost-quota.d.ts +1 -1
- package/dist/plugins/pg-pool.d.ts +2 -2
- package/dist/plugins/pg-pool.js +5 -2
- package/dist/plugins/pg-rate-limiter.d.ts +1 -1
- package/dist/plugins/pg-session-storage.d.ts +8 -20
- package/dist/plugins/pg-session-storage.js +14 -27
- package/dist/plugins/remote-env-adb.d.ts +10 -10
- package/dist/plugins/remote-env-device.d.ts +10 -9
- package/dist/plugins/remote-env-device.js +6 -2
- package/dist/plugins/remote-env-e2b.d.ts +3 -3
- package/dist/plugins/remote-env-host.d.ts +16 -16
- package/dist/plugins/remote-env-k8s.d.ts +8 -8
- package/dist/plugins/remote-env-local-docker.d.ts +2 -2
- package/dist/plugins/remote-env-ssh.d.ts +4 -4
- package/dist/plugins/remote-scratchpad.d.ts +2 -3
- package/dist/plugins/remote-scratchpad.js +0 -4
- package/dist/plugins/remote-shell.d.ts +6 -6
- package/dist/plugins/retention-lane-store-sql.d.ts +4 -4
- package/dist/plugins/retention-store-sql.d.ts +4 -4
- package/dist/plugins/roster-store-sql.d.ts +1 -1
- package/dist/plugins/run-store-sql.d.ts +8 -8
- package/dist/plugins/schema-consistency.d.ts +2 -2
- package/dist/plugins/schema-ensure-legs.d.ts +3 -3
- package/dist/plugins/schema-indexes.d.ts +1 -1
- package/dist/plugins/schema-live-columns.d.ts +1 -1
- package/dist/plugins/session-event-payload.d.ts +4 -4
- package/dist/plugins/session-fork.d.ts +34 -0
- package/dist/plugins/session-fork.js +29 -0
- package/dist/plugins/session-ownership.js +1 -1
- package/dist/plugins/session-placement.d.ts +1 -1
- package/dist/plugins/session-policy-store-sql.d.ts +12 -12
- package/dist/plugins/session-store.d.ts +2 -2
- package/dist/plugins/session-store.js +2 -2
- package/dist/plugins/shared-memory-store-sql.d.ts +2 -2
- package/dist/plugins/sql-driver.d.ts +8 -8
- package/dist/plugins/sql-errors.d.ts +1 -1
- package/dist/plugins/sql-json-column.d.ts +21 -21
- package/dist/plugins/sql-row-helpers.d.ts +2 -2
- package/dist/plugins/store-backend.d.ts +17 -16
- package/dist/plugins/store-backend.js +3 -3
- package/dist/plugins/store-contracts.d.ts +21 -21
- package/dist/plugins/task-attachment-store.d.ts +2 -2
- package/dist/plugins/task-list-store-sql.d.ts +1 -1
- package/dist/plugins/tidb-pool.d.ts +2 -2
- package/dist/plugins/tidb-pool.js +9 -2
- package/dist/plugins/tidb-session-store.d.ts +16 -26
- package/dist/plugins/tidb-session-store.js +15 -27
- package/dist/plugins/tool-result-store-sql.d.ts +1 -1
- package/dist/plugins/usage-window-store-sql.d.ts +3 -3
- package/dist/plugins/user-input-ledger-file.d.ts +1 -1
- package/dist/plugins/user-input-ledger-sql.d.ts +3 -3
- package/dist/plugins/web-search.d.ts +19 -5
- package/dist/plugins/web-search.js +19 -4
- package/dist/{orchestration/workflow-journal-entry.d.ts → plugins/workflow-journal-payload.d.ts} +23 -32
- package/dist/plugins/workflow-journal-payload.js +32 -0
- package/dist/plugins/workflow-journal-store-sql.d.ts +28 -14
- package/dist/plugins/workflow-journal-store-sql.js +34 -15
- package/dist/plugins/workflow-run-store-sql.d.ts +4 -4
- package/dist/posture-source.d.ts +11 -11
- package/dist/principal-jwt.d.ts +6 -6
- package/dist/project-identity.d.ts +3 -3
- package/dist/project-memory.d.ts +4 -4
- package/dist/read-face-posture.d.ts +7 -7
- package/dist/request-key-closure.d.ts +1 -1
- package/dist/request-key-closure.js +1 -1
- package/dist/request-value-closure.d.ts +15 -8
- package/dist/request-value-closure.js +2 -0
- package/dist/router/route-orchestration.d.ts +11 -16
- package/dist/router/route-orchestration.js +2 -12
- package/dist/rule-entry-list.d.ts +8 -7
- package/dist/rule-entry-list.js +2 -9
- package/dist/rules-consent.d.ts +6 -6
- package/dist/rules-consent.js +2 -0
- package/dist/run-cancel-context.d.ts +5 -5
- package/dist/run-local.d.ts +10 -10
- package/dist/runs.d.ts +13 -11
- package/dist/runs.js +15 -1
- package/dist/runtime-caps-resolver.d.ts +6 -6
- package/dist/runtime-governance.d.ts +9 -9
- package/dist/sandbox-pkg-source.d.ts +9 -31
- package/dist/sandbox-pkg-source.js +14 -8
- package/dist/sealed-key.d.ts +3 -3
- package/dist/security.d.ts +23 -26
- package/dist/security.js +12 -9
- package/dist/server-secret-env.d.ts +10 -10
- package/dist/session-children-retire.d.ts +1 -1
- package/dist/session-error-wire.d.ts +7 -7
- package/dist/session-incarnation.d.ts +52 -35
- package/dist/session-incarnation.js +23 -8
- package/dist/session-policy-wire.d.ts +27 -5
- package/dist/session-policy-wire.js +15 -1
- package/dist/session-records-skipped-notice.d.ts +1 -1
- package/dist/session-sync-kernel.d.ts +4 -4
- package/dist/session-sync.d.ts +49 -6
- package/dist/session-sync.js +52 -10
- package/dist/session-titler.d.ts +7 -6
- package/dist/session-titler.js +8 -13
- package/dist/session-watch.d.ts +3 -3
- package/dist/session-watch.js +4 -4
- package/dist/sighup-idle.d.ts +2 -2
- package/dist/spec-fields.d.ts +4 -4
- package/dist/sql-engine-posture.d.ts +3 -3
- package/dist/store-posture.d.ts +2 -2
- package/dist/stored-request-tool-axes-m19.d.ts +1 -1
- package/dist/task-a2a.d.ts +3 -1
- package/dist/task-a2a.js +34 -2
- package/dist/task-cwd.d.ts +7 -88
- package/dist/task-cwd.js +2 -15
- package/dist/task-mcp.d.ts +12 -8
- package/dist/task-mcp.js +19 -4
- package/dist/task-settings.d.ts +30 -18
- package/dist/task-settings.js +33 -3
- package/dist/task-workflow.d.ts +0 -24
- package/dist/task-workflow.js +2 -1
- package/dist/terminal.d.ts +5 -5
- package/dist/tighten-only-seats.d.ts +7 -6
- package/dist/tighten-only-seats.js +1 -1
- package/dist/tool-approval.d.ts +143 -197
- package/dist/tool-approval.js +13 -28
- package/dist/tool-rule-names.d.ts +2 -2
- package/dist/trace/core-keyset-guard.d.ts +12 -7
- package/dist/trace/engine-notice-wire.d.ts +5 -5
- package/dist/trace/engine-notice-wire.js +1 -0
- package/dist/trace/exit-seat.d.ts +31 -4
- package/dist/trace/exit-seat.js +41 -63
- package/dist/trace/ledger-events.d.ts +3 -3
- package/dist/trace/ledger-sink.d.ts +1 -1
- package/dist/trace/model-segment.d.ts +3 -3
- package/dist/trace/project.d.ts +47 -45
- package/dist/trace/project.js +33 -1
- package/dist/trace/redact.d.ts +44 -30
- package/dist/trace/redact.js +191 -89
- package/dist/trace/self-minted-wire.d.ts +35 -14
- package/dist/trace/self-minted-wire.js +8 -0
- package/dist/trace/sema-provenance.d.ts +1 -1
- package/dist/trace/task-notification-facets.d.ts +4 -4
- package/dist/trace/wire-projection-faces.d.ts +3 -3
- package/dist/trace/wire-projection-faces.js +1 -1
- package/dist/unattended-permission-mode.d.ts +5 -5
- package/dist/url-credential.d.ts +52 -0
- package/dist/url-credential.js +49 -0
- package/dist/url-refusal.d.ts +6 -2
- package/dist/url-refusal.js +8 -1
- package/dist/usage-analytics.d.ts +2 -2
- package/dist/user-input-ledger.d.ts +23 -23
- package/dist/web-admin-client/apply-effective.d.ts +5 -5
- package/dist/web-admin-client/apply-effective.js +2 -1
- package/dist/web-admin-client/apply-ledger.d.ts +2 -2
- package/dist/web-admin-client/center-request.d.ts +2 -2
- package/dist/web-admin-client/facade.d.ts +5 -5
- package/dist/web-admin-client/facade.js +1 -1
- package/dist/web-admin-client/hot-keys-registry.d.ts +2 -2
- package/dist/web-admin-client/http-client.d.ts +4 -4
- package/dist/web-admin-client/mcp-revocation.d.ts +1 -1
- package/dist/web-admin-client/pull-state.d.ts +1 -1
- package/dist/web-admin-client/read-face.d.ts +2 -2
- package/dist/web-admin-client/read-warnings.d.ts +5 -5
- package/dist/web-admin-client/restart-signal.d.ts +6 -6
- package/dist/web-admin-client/skills-mcp.d.ts +28 -3
- package/dist/web-admin-client/skills-mcp.js +29 -1
- package/dist/web-admin-client/types.d.ts +16 -9
- package/dist/workspace-space.d.ts +5 -3
- package/dist/write-protection.d.ts +2 -2
- package/package.json +4 -3
- package/scripts/drain-check-local.mjs +2 -1
- package/scripts/drain-check.mysql.sql +4 -2
- package/scripts/drain-check.pg.sql +4 -2
- package/skills/loop.md +1 -1
- package/dist/http/run-declared-families.d.ts +0 -16
- package/dist/http/run-declared-families.js +0 -12
- package/dist/orchestration/workflow-journal-entry.js +0 -27
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* **`session_event.payload` 这一列的单一属主**(
|
|
2
|
+
* **`session_event.payload` 这一列的单一属主**([ref] 车③a)—— 投影铸点、解码点、形读者各一份,三个
|
|
3
3
|
* 会话存储腿(`tidb-session-storage.ts` / `pg-session-storage.ts` / `tidb-session-store.ts`)共读本文件。
|
|
4
4
|
*
|
|
5
5
|
* ## 为什么必须收成一处
|
|
6
6
|
* 这一列此前有 **10 个** 各自写一遍的读法(`typeof p === "string" ? JSON.parse(p) : p as SessionTreeEntry`),
|
|
7
7
|
* 分布在三个文件的 wake / getEntry / getEpochAnchor / computeFloor / export / fork / import / 收尾 leaf
|
|
8
|
-
* 计算上。那个三元式正是
|
|
8
|
+
* 计算上。那个三元式正是 [ref] 要消灭的歧义本身:**从值本身分不出驱动解过没解过**,而这一列在 MySQL 侧是
|
|
9
9
|
* `JSON`、PG 侧是 `JSONB` —— 一台 MariaDB 部署上它以文本到达(驱动不自动解码),一条被迁移脚本多
|
|
10
10
|
* `JSON.stringify` 过一次的行则在真 JSON 列上「串就再解一次」地被读成好体。十份拷贝里只要有一份将来
|
|
11
11
|
* 忘了跟,那一条 wake 就会静默读出半棵树。
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* 静默跳过它则是**一段对话从历史里消失**(而模型会照着一棵少了一截的树继续说话)。两者都比一次响亮的
|
|
17
17
|
* wake 失败坏。
|
|
18
18
|
*
|
|
19
|
-
* ## 拒的**词** = core 的 `SessionError("corrupt_session")`(
|
|
19
|
+
* ## 拒的**词** = core 的 `SessionError("corrupt_session")`([ref],server 7.104.0)
|
|
20
20
|
* 写这段代码时 core 的 `SessionError` 闭集里还没有读侧的 corrupt 词(那时这里折成 `StoreCorruptError` / 更早是裸
|
|
21
|
-
* `Error`,点名 `<表>.<列>` + 行标识 ——
|
|
21
|
+
* `Error`,点名 `<表>.<列>` + 行标识 —— [ref] 车①② 裁定)。core 7.30.0([ref])给文件会话店铸了
|
|
22
22
|
* `corrupt_session`(「这只会话的存储读不出,无法唤醒」),于是同一件事在三种会话后端上说了两种话:文件后端上 wire
|
|
23
23
|
* 是 500 `corrupt_session`,SQL 后端上是一只未分类的失败。⇒ 改抛**同一个词**;句子只留坐标(`<表>.<列>` + 会话 +
|
|
24
24
|
* 行号 + 坏体种别),不带这一行的内容、不含任何盘上路径(codex r1 [high]:修前的句子带着坏体的前 64 个字符)。失败方向不变:仍然**拒**,不跳过(SQL 行没有「撕裂」这种自然形,坏行 = 被篡改或迁移
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 会话 fork 的**分叉点与拷贝范围**(core 7.55.0 [ref] 的本仓一半)—— 三只会话店(local / TiDB / PG)的 fork 同调。
|
|
3
|
+
*
|
|
4
|
+
* ## 规则(一句)
|
|
5
|
+
* 「fork 拷到哪一条」只有引擎一只判官:`settledForkOptions(源会话)` 答 `{}`(整份日志)或 `{ entryId: <在飞轮的父>, position: "at" }`(拷到那一条为止)。
|
|
6
|
+
* 本仓的店不写第二份「什么算在飞」—— local 店把它的答案原样交给引擎自己的 `repo.fork`;两只 SQL 孪生没有 `repo.fork`(它们按行搬字节),所以这里只管**按答案拷**:
|
|
7
|
+
* · `{}` ⇒ 整份日志(含别的分支),叶 = 源会话的叶(与引擎 `getEntriesToFork` 的无 `entryId` 臂同);
|
|
8
|
+
* · `at` 点 ⇒ 根到分叉点那一条**路径**上的条目(与引擎 `getPathToRoot(entryId)` 同:路径,不是日志前缀,别的分支不随),叶 = 分叉点。
|
|
9
|
+
*
|
|
10
|
+
* ## 为什么拷贝仍读整份日志、判官却读唤醒出来的会话
|
|
11
|
+
* 拷贝要的是**整份**持久日志(压缩地板绕过 —— 唤醒只装 `[地板..叶]`,从唤醒里拷会丢地板之前的全部历史);判官要的只是叶链上最近几条(它是引擎的一份纯函数,
|
|
12
|
+
* 吃一只 `Session`):唤醒出来的会话 `getEntry` 在地板之下会回读持久日志,所以判官在压缩过的会话上也看得见整条叶链。
|
|
13
|
+
*/
|
|
14
|
+
import { settledForkOptions, type SessionStorage } from "@sema-agent/core";
|
|
15
|
+
/** 引擎答的分叉点(`{}` = 整份;`entryId` + `position: "at"` = 拷到这一条为止)。 */
|
|
16
|
+
export type ForkPoint = Awaited<ReturnType<typeof settledForkOptions>>;
|
|
17
|
+
/** 问引擎:这只(已唤醒的)源会话从哪里拷。SQL 孪生用它;local 店手里就是引擎的 `Session`,直接调 `settledForkOptions`。 */
|
|
18
|
+
export declare function forkPointOf(storage: SessionStorage): Promise<ForkPoint>;
|
|
19
|
+
/** 整份日志里一行的父链两键(其余列原样搬,不读内容)。 */
|
|
20
|
+
export interface ForkLogRow {
|
|
21
|
+
readonly entry_id: string;
|
|
22
|
+
readonly parent_id: string | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 按引擎的分叉点从整份日志(oldest-first)里挑出要拷的行,与新会话的叶。行的相对顺序保留(调用方按顺序重铸 seq)。
|
|
26
|
+
*
|
|
27
|
+
* 分叉点不在日志里 ⇒ `invalid_fork_target`、路径中途的父不在日志里 ⇒ `invalid_session`(引擎 `getEntriesToFork` / `getPathToRoot` 同词同句);分叉点之上的父链成环 ⇒ `invalid_session`、
|
|
28
|
+
* 句子与引擎的父链守卫同(守卫类不在包根,走法是同一个意思:走过的条目再踩一次 = 环;沿用它的句子,让同一件事在三种后端上说同一句话);`position` 不是 `at` ⇒ 响亮拒(本函数只认引擎今天答的两形)。
|
|
29
|
+
*/
|
|
30
|
+
export declare function forkCopyOf<R extends ForkLogRow>(rows: readonly R[], sourceLeafId: string | null, point: ForkPoint): {
|
|
31
|
+
rows: R[];
|
|
32
|
+
leafId: string | null;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=session-fork.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SessionError, StoredSession, settledForkOptions } from "@sema-agent/core";
|
|
2
|
+
export async function forkPointOf(storage) {
|
|
3
|
+
return settledForkOptions(new StoredSession(storage));
|
|
4
|
+
}
|
|
5
|
+
export function forkCopyOf(rows, sourceLeafId, point) {
|
|
6
|
+
if (point.entryId === undefined)
|
|
7
|
+
return { rows: [...rows], leafId: sourceLeafId };
|
|
8
|
+
if (point.position !== "at") {
|
|
9
|
+
throw new SessionError("invalid_fork_target", `fork point ${point.entryId} comes with a position this store does not copy (${String(point.position)}) — only the engine's "at" point is read here`);
|
|
10
|
+
}
|
|
11
|
+
const byId = new Map();
|
|
12
|
+
for (const r of rows)
|
|
13
|
+
byId.set(r.entry_id, r);
|
|
14
|
+
const onPath = new Set();
|
|
15
|
+
let cursor = point.entryId;
|
|
16
|
+
while (cursor !== null) {
|
|
17
|
+
if (onPath.has(cursor)) {
|
|
18
|
+
throw new SessionError("invalid_session", `Entry ${cursor} is its own ancestor (parent chain cycles at ${cursor}) — start a new session, or fork from an entry above the loop`);
|
|
19
|
+
}
|
|
20
|
+
const row = byId.get(cursor);
|
|
21
|
+
if (row === undefined) {
|
|
22
|
+
throw new SessionError(cursor === point.entryId ? "invalid_fork_target" : "invalid_session", `Entry ${cursor} not found`);
|
|
23
|
+
}
|
|
24
|
+
onPath.add(cursor);
|
|
25
|
+
cursor = row.parent_id;
|
|
26
|
+
}
|
|
27
|
+
return { rows: rows.filter((r) => onPath.has(r.entry_id)), leafId: point.entryId };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=session-fork.js.map
|
|
@@ -6,6 +6,6 @@ export function assertFirstOwnerWritable(sessionId, owner) {
|
|
|
6
6
|
if (typeof owner === "string" || owner === null)
|
|
7
7
|
return;
|
|
8
8
|
throw new SessionError("storage", `register(${sessionId}): a first ownership write must carry a principal (string) or null (anonymous), got ${owner === undefined ? "undefined" : typeof owner} — ` +
|
|
9
|
-
"a stored value that
|
|
9
|
+
"a stored value that the head read reads back as 'no row' would leave the session claimable forever and ownable never; refusing, nothing written");
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=session-ownership.js.map
|
|
@@ -88,7 +88,7 @@ export interface PlacementAcquireOpts {
|
|
|
88
88
|
placement?: SessionPlacement;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
|
-
* 准入判据 —— 只有引擎那一只:core 包根导出 `admitSessionPlacement(sessionId, persisted, request, capability)`(core 7.54.0
|
|
91
|
+
* 准入判据 —— 只有引擎那一只:core 包根导出 `admitSessionPlacement(sessionId, persisted, request, capability)`(core 7.54.0 [ref] K2;
|
|
92
92
|
* `TtlSessionStore` 自己调的同一只函数,两个方向:claim 关门 / 镜像·squat,`placement_refused`)。`capability.subagentPlacement` 读的是**店自己的声明**
|
|
93
93
|
* (`placements.subagent` 在场 —— 与 core `TtlSessionStore` 同一只读法,{@link placementCapabilityOf}),不是另写一个「这只店声明了」的常量:声明只有一处。
|
|
94
94
|
* 修前本模块持一份 SQL 镜像(`assertPlacementAdmission`,逐条同义、文案自铸)—— 与引擎是两份判据;随 7.54.0 退役、零别名。
|
|
@@ -21,7 +21,7 @@ export type StoredSessionRulesBody = SessionPermissionRules & Pick<StoredSession
|
|
|
21
21
|
* `grammar` 戳同样由它拒)。本仓不另持一只读者:修前本仓自己那一只形读者与它对纯空白的 `allowDirs` 项给两个答案(本仓读得出、引擎判坏 ——
|
|
22
22
|
* 读出来交给运行期,运行期又把整份规则判成读不出、每个调用都拒),同一问两只读者。
|
|
23
23
|
*
|
|
24
|
-
* 🔴 **戳原样交出,不补、不改**(core 7.51.2
|
|
24
|
+
* 🔴 **戳原样交出,不补、不改**(core 7.51.2 [ref],行自带规则文法):一行条目的意思由行自带的 `grammar` 戳说,文法只有引擎一处读 ——
|
|
25
25
|
* 戳在写口判官的返回值里盖(`judgeSessionRulesWrite`,本店整只存),引擎读行时按戳读(`readSessionRulesShape`:戳缺席 ⇒ 与 `rev` 并排的值是戳之前
|
|
26
26
|
* 写的行,文法 0;不与 `rev` 并排的值是一次新写,文法 1)。列体里没有 `rev`(计数是另两列),所以形读法对一只**无戳的列体**解出的文法是「新写」的 1 ——
|
|
27
27
|
* 不是这一行的。本函数因此只取形读法读出的**桶**,戳按体里有无原样带出:带戳 ⇒ 戳(与形读法读出的同一个数);无戳 ⇒ 缺席,引擎拿到回装点交出的行
|
|
@@ -41,11 +41,11 @@ export type StoredSessionRulesBody = SessionPermissionRules & Pick<StoredSession
|
|
|
41
41
|
* JSON 列里的字符串标量按文本取出来**带着引号**(真库实测两方言同形:`"\"{}\""`)⇒ 解一次得到一只串 ⇒ 判坏;
|
|
42
42
|
* 文本承载的列取出来就是它自己 ⇒ 解一次得到对象 ⇒ 好体。**一条规则,两种承载,零方言分叉,不依赖驱动行为。**
|
|
43
43
|
*
|
|
44
|
-
* 🔴
|
|
44
|
+
* 🔴 [ref]:上面这一整段现在是**整仓**的口径,实现搬进唯一属主 `sql-json-column.ts`(投影 `jsonColumnText`
|
|
45
45
|
* + 恰好解一次 `decodeJsonColumn` + 折码 `foldJsonColumn`);本店只留「形判据是哪一只」与「坏体折成哪个码」。
|
|
46
46
|
*/
|
|
47
47
|
export declare function readSessionRulesBody(body: unknown): JsonColumnShape<StoredSessionRulesBody>;
|
|
48
|
-
/** 本店唯一的日志口:抹除封键那一臂(
|
|
48
|
+
/** 本店唯一的日志口:抹除封键那一臂([ref])的点名。缺席 ⇒ 退回 `console.warn`(不静默)。 */
|
|
49
49
|
export type SessionPolicyStoreLogger = Pick<Logger, "warn">;
|
|
50
50
|
/** Dual-dialect durable SessionPolicyStore. See the file header for the dialect-delta ledger. */
|
|
51
51
|
export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
@@ -57,13 +57,13 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
57
57
|
/** 判据属主 = `sql-errors.ts`([ref] P1-①;本站点旧形已是并集形,收编后语义不变)。 */
|
|
58
58
|
private isDupKey;
|
|
59
59
|
/** Read the stored rules for (session, principal-owner); null when none (parity with InMemory).
|
|
60
|
-
* 🔴
|
|
60
|
+
* 🔴 [ref](codex r1 [high] ①):同一条语句带上这把键的**封键记号** —— 封着 ⇒ `corrupt`,不答「没有规则」(见 {@link sealedKeyError})。 */
|
|
61
61
|
getRules(sessionId: string, principal?: string): Promise<StoredSessionRules | null>;
|
|
62
62
|
/** 2c session-sync: every (principal, rules) record for a session across ALL principals — getRules is
|
|
63
63
|
* per-(session,principal), but a cross-backend session EXPORT must bundle the WHOLE session's policy (the importer
|
|
64
64
|
* replays each via putRules). principal is read from the DENORMALIZED column (the sha256 policy_key is one-way);
|
|
65
65
|
* NULL → undefined = the session-wide row (parity with core's InMemory `principal ?? undefined`). Rules carry rev.
|
|
66
|
-
* 🔴
|
|
66
|
+
* 🔴 [ref]:会话里有**封着的键** ⇒ 整只枚举 `corrupt`(与一行读不出形时整只枚举拒同一口径 —— 导出一份缺了那把键的规则,
|
|
67
67
|
* 导入方就会把「状态未知」当成「这个 principal 没有规则」)。 */
|
|
68
68
|
listBySession(sessionId: string): Promise<SessionRulesRecord[]>;
|
|
69
69
|
/** Operator/owner write: CAS + tighten-only (unless operator) + rev bump, atomic in one txn; first-write race retried. */
|
|
@@ -80,9 +80,9 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
80
80
|
* `test/sql-lock-shape-innodb-integration.test.ts` (site ⑩, three engines). It exists because on REAL InnoDB
|
|
81
81
|
* (REPEATABLE READ) a `FOR UPDATE` read of a MISSING primary key takes a GAP lock, and gap locks are mutually
|
|
82
82
|
* compatible while both block the other side's INSERT — so N concurrent first writes on one key deadlock NO
|
|
83
|
-
* MATTER what order any table is touched in. Measured on the real engine (2026-09-20,
|
|
83
|
+
* MATTER what order any table is touched in. Measured on the real engine (2026-09-20, [ref], 8-way race on
|
|
84
84
|
* `main`'s statement sequence, zero mark table involved): InnoDB 1 winner / 7 `ER_LOCK_DEADLOCK`, TiDB 0,
|
|
85
|
-
* PG 0 — i.e. this is a PRE-EXISTING MySQL-leg defect that
|
|
85
|
+
* PG 0 — i.e. this is a PRE-EXISTING MySQL-leg defect that [ref]'s lock-shape site made visible, not a new one.
|
|
86
86
|
* After the first insert commits, the retried writers find the row and take the UPDATE path (record lock,
|
|
87
87
|
* no gap) ⇒ the loop converges in one extra round per missing-row window; the bound is the suite's concurrency.
|
|
88
88
|
* Lock-WAIT-TIMEOUT is deliberately NOT retried ({@link isDeadlockError}'s own note: it is a latency signal,
|
|
@@ -94,7 +94,7 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
94
94
|
* (`Promise<void>`) — the affectedRows count was incidental and unconsumed; the integration test asserts the
|
|
95
95
|
* post-state (listBySession empty) instead.
|
|
96
96
|
*
|
|
97
|
-
*
|
|
97
|
+
* [ref] (`@contract session_policy.rev_survives_delete`): the rules ROW dies, the key's REV LINE does not, and the
|
|
98
98
|
* erase ALSO ENDS THE ROW'S LINEAGE (`gen` + 1 — the next write on this key belongs to another generation, which no
|
|
99
99
|
* reader treats as a continuation of the erased row whatever rev it wears) — one
|
|
100
100
|
* transaction, three statements, and BOTH the order and the locking verb are load-bearing:
|
|
@@ -102,7 +102,7 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
102
102
|
* order. This is the SAME lock order putRules uses (policy row → mark row), which is the whole point: the
|
|
103
103
|
* obvious shape (`INSERT … SELECT` the marks, then DELETE) locks the MARK first and takes only a SHARED lock
|
|
104
104
|
* on the policy rows it reads, i.e. a reversed order PLUS an S→X upgrade — the textbook deadlock this repo
|
|
105
|
-
* 已经吃过两次(retention-store-sql.ts ④a/④b 的
|
|
105
|
+
* 已经吃过两次(retention-store-sql.ts ④a/④b 的 [ref] 案:一边持 boundary 等哨兵,一边持哨兵等 boundary)。
|
|
106
106
|
* ② the marks (their revs come from ①'s already-locked rows) — `GREATEST` merge, so a mark only ever RISES and
|
|
107
107
|
* repeated erases never walk the line back.
|
|
108
108
|
* ③ the DELETE — scoped to ①'s POLICY_KEY SET, never re-scanned by `session_id`. 🔴 This is the whole of
|
|
@@ -111,7 +111,7 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
111
111
|
* DIFFERENT principal that a concurrent putRules commits BETWEEN ① and ③ would be deleted by a session-wide
|
|
112
112
|
* DELETE while ② never marked it — a silently reset rev line, exactly the defect this batch exists to close.
|
|
113
113
|
* Scoped to the key set, the invariant is exact and checkable: **every row this seam deletes leaves a mark** —
|
|
114
|
-
* a readable row's mark continues its rev line and ends its lineage; an unreadable row's mark SEALS its key (
|
|
114
|
+
* a readable row's mark continues its rev line and ends its lineage; an unreadable row's mark SEALS its key ([ref], below).
|
|
115
115
|
* A row born after ① is simply not part of this erase (same as one born a microsecond after ③ — the caller
|
|
116
116
|
* that needs "and nothing came back" re-issues; the seam is idempotent).
|
|
117
117
|
* No rows ⇒ return early: an erase of a session that never had rules writes NO mark (no line, nothing to keep),
|
|
@@ -121,7 +121,7 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
121
121
|
* right-to-delete would degrade to buy rev ordering. The mark keeps only the one-way hash, the session id and
|
|
122
122
|
* an integer.
|
|
123
123
|
*
|
|
124
|
-
* 🔴 **
|
|
124
|
+
* 🔴 **[ref](7.106.0)—— 抹除恒删行;计数读不出的行留「封键记号」**。一行的计数读不出(三个读点的同一只判词
|
|
125
125
|
* {@link readRowCounters} 判坏:`rev` 不是 ≥ 1 的安全整数 / `gen` 不是 ≥ 0 的安全整数;或下一代的号 `gen + 1` 已出安全整数)
|
|
126
126
|
* ⇒ 这一行**照删**,它的记号元组写 `(键, 会话, {@link SEALED_MARK_REV}, 0, 时刻)`、走**同一句** `GREATEST` 合并:rev 落上界,
|
|
127
127
|
* 世代 = `GREATEST(旧记号.gen + 1, 0)`(有旧记号照抬,没有就是 0)。于是这把键的下一次 `putRules` 算出 `上界 + 1`,被写前那道
|
|
@@ -139,7 +139,7 @@ export declare class SqlSessionPolicyStore implements SessionPolicyStore {
|
|
|
139
139
|
* (驱动错误;那只记号本来就读不回,`putRules` 同样拒)—— 抹除不读记号,这一形不在本判词射程内。 */
|
|
140
140
|
deleteBySession(sessionId: string): Promise<void>;
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
142
|
+
* [ref] 封键的响亮面:一次抹除至多一条 warn。日志座**抛** ⇒ 退回 `console.warn` 带原句 —— 走到这里删除已经提交,
|
|
143
143
|
* 一次日志故障不许把它报成失败(E21 会因此 500、overwrite-dst 会因此中止;codex 7.105.0 修复验证轮 [medium] 同形)。
|
|
144
144
|
* 缺日志座(直接 `new` 本店的工具 / 测试)⇒ `console.warn`,不静默。
|
|
145
145
|
*/
|
|
@@ -45,7 +45,7 @@ export declare function ensureSessionDurable(hostStore: SessionStore, sessionId:
|
|
|
45
45
|
* [ref] 主动晋升版 ensureChildSessionDurable(cli TiDB 真机撞获:1.263 的只查不迁形在拆店生产形下
|
|
46
46
|
* 恒否决 park——bg 子会话住 subRunner 私有 TTL 店、从不在 host 店,core 收 veto 即 expire checkpoint
|
|
47
47
|
* (14ms~2s)+ settle failed,赎回窗口不存在):
|
|
48
|
-
* 0. 属主(
|
|
48
|
+
* 0. 属主([ref],`delegated-session-owner.ts`):按委派继承律判一次(唯一判据 `judgeDelegatedOwner`)—— 来源集 = 见证的根这一只(调用方交出的委派树根 + 调用方判断那一刻
|
|
49
49
|
* 读到的根行住客:请求腿 = 本请求经鉴权解析的会话与受理时那一读,`/decide` 赎回腿 = 行上的 `rootSessionId` 与 claim 前后两读的那一位;core 的挂点签名只给子代 id,
|
|
50
50
|
* 场景层把见证绑进闭包交下来)。此刻根行在而住客不是见证的那一位(删了、同 id 被重新登记)⇒ **拒**(`assertRootStillWitnessed`:不按新住客晋升 / 认领);
|
|
51
51
|
* 缺席(行上没有根)或根行此刻不在 ⇒ 孤行哨兵。
|
|
@@ -56,7 +56,7 @@ export declare function ensureSessionDurable(hostStore: SessionStore, sessionId:
|
|
|
56
56
|
* 三步见 ForkRoutingSessionStore.promoteToHost),宿主行在建行那一笔里带第 0 步的属主;写的是哨兵 ⇒ 写落下之后一行 warn。
|
|
57
57
|
* 3. 复验:同一把 `ensureSessionDurable` 严检(leaf 非空)+ 同一只属主定夺 —— 晋升产物必须达到与快路完全相同的
|
|
58
58
|
* 标准,任何一步失败=如实 reject=veto=pre-153 行为(不放大)。
|
|
59
|
-
* 宿主店必须读得出属主(`delegatedOwnerHostOf`:`
|
|
59
|
+
* 宿主店必须读得出属主(`delegatedOwnerHostOf`:`headOf`;记录委派树的店另交 `placementOf` + `claimOwnerless`,两只同在或同缺;生产的 SQL / local 店与缓存包装层都满足),
|
|
60
60
|
* 否则响亮拒。
|
|
61
61
|
* 调用方纪律与 {@link ensureSessionDurable} 同款:hostStore 必须是 release 非破坏性的真 durable 店
|
|
62
62
|
* (stage-07 的 `config.sessionBackend === "tidb"` 门不变 —— 该词在 local 后端上同样归一成 `tidb`,所以本腿在 local 宿主店上也跑)。
|
|
@@ -26,9 +26,9 @@ export async function ensureSessionDurable(hostStore, sessionId) {
|
|
|
26
26
|
export async function ensureChildSessionDurableWithPromotion(hostStore, routing, sessionId, root, log) {
|
|
27
27
|
const host = delegatedOwnerHostOf(hostStore);
|
|
28
28
|
if (host === undefined) {
|
|
29
|
-
throw new Error(`session "${sessionId}" cannot be parked: the host session store cannot read a session's owner (
|
|
29
|
+
throw new Error(`session "${sessionId}" cannot be parked: the host session store cannot read a session's owner (headOf), or records delegation trees without being able to claim under them (placementOf / claimOwnerless), so the delegated transcript's owner cannot be derived or checked`);
|
|
30
30
|
}
|
|
31
|
-
const judged = await readDelegatedOwner(sessionId, root === undefined ? {} : { rootSessionId: root.sessionId }, sourceFacesVia(host.
|
|
31
|
+
const judged = await readDelegatedOwner(sessionId, root === undefined ? {} : { rootSessionId: root.sessionId }, sourceFacesVia(host.headOf));
|
|
32
32
|
assertRootStillWitnessed(sessionId, root, judged);
|
|
33
33
|
let promoted = false;
|
|
34
34
|
try {
|
|
@@ -162,12 +162,12 @@ export declare class SqlSharedMemoryStore implements SharedMemoryStoreProvider {
|
|
|
162
162
|
/**
|
|
163
163
|
* 盘状态 + 库登记,**一条语句一个快照**。
|
|
164
164
|
*
|
|
165
|
-
* 🔴
|
|
165
|
+
* 🔴 [ref](codex 对抗复审 r1 [high] 采,[ref] 的终局):这一对读要的不是新鲜度,而是「scope 行与
|
|
166
166
|
* store 行读齐、不撕」——一个 importer 若落在两条读之间,快照会把**旧的 connected 盘态**和**新登记的
|
|
167
167
|
* 库**拼在一起,于是壳拿到一个「已连接」的盘和一份不完整的库,而 reader 只复核 (store, scope) 归属、
|
|
168
168
|
* 从不复核盘态。
|
|
169
169
|
*
|
|
170
|
-
* 此前这条保证挂在**隔离级**上(轮2 F3 起用事务,[ref] 又把两臂都钉成 REPEATABLE READ)。
|
|
170
|
+
* 此前这条保证挂在**隔离级**上(轮2 F3 起用事务,[ref] 又把两臂都钉成 REPEATABLE READ)。[ref] 把
|
|
171
171
|
* 隔离级收进连接初始化之后,那条路在 PG 腿上走不通:PG 的 REPEATABLE READ 是快照隔离,把会话钉过去
|
|
172
172
|
* 会让本仓每一条 `SELECT … FOR UPDATE` 从「等锁后读当前」变成 `40001` 序列化失败(`@contract
|
|
173
173
|
* txn.read-semantics` ② 的 PG 段),而 PG 的 `BEGIN` 是 READ COMMITTED、**每条语句各自取快照**。
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
* exec; this seam stays on the plain (sql, params) form.
|
|
27
27
|
*
|
|
28
28
|
* ─────────────────────────────────────────────────────────────────────────────────────────────────
|
|
29
|
-
* @contract txn.read-semantics — 本仓「事务里的读看到什么」的**唯一**成文处(
|
|
29
|
+
* @contract txn.read-semantics — 本仓「事务里的读看到什么」的**唯一**成文处([ref] / [ref] / [ref])
|
|
30
30
|
* ─────────────────────────────────────────────────────────────────────────────────────────────────
|
|
31
31
|
* 五只店的头注此前各写一套「为什么用这个事务动词」的理由(截断的、漏数的、讲历史沿革的都有)。
|
|
32
32
|
* 判据从今天起只有这一处,店里只留一行 `{@link SqlTxConn.begin}` 指回来。
|
|
33
33
|
*
|
|
34
34
|
* **① 事务动词只有一个** —— `begin()`。曾经那个「悲观」专用动词(MySQL 腿发 TiDB 专有的
|
|
35
35
|
* `BEGIN PESSIMISTIC`)已删除:那条语句在真 MySQL / MariaDB 上是 `ER_PARSE_ERROR`,四店 18 个事务
|
|
36
|
-
* 一个都开不了(**
|
|
36
|
+
* 一个都开不了(**[ref]**),而它真正保证的东西现在由 ② 结构性地给出。同理,那个「可重复读」专用
|
|
37
37
|
* 动词也一并并入:隔离级不再由动词决定。
|
|
38
38
|
*
|
|
39
39
|
* **② 隔离级与事务模式是「连接的事实」,不是「动词的参数」** —— 见 {@link SqlDriver.facts}。
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
* 的行**、读**值/时钟表达式**(不触任何存量行)、以及 PG 语法明禁加锁的形(**只有**聚合 / GROUP BY /
|
|
55
55
|
* DISTINCT / 窗口 / 集合运算;`ORDER BY … LIMIT 1` 尾行读在 PG 上**合法**加锁,不属此类——7.60.0 重扫纠)。
|
|
56
56
|
* 理由:TiDB 悲观事务的普通 SELECT 仍钉 `start_ts`,`lockScope` 的锁等待窗内别副本的提交看不见
|
|
57
|
-
* (**
|
|
57
|
+
* (**[ref]**);InnoDB REPEATABLE READ 下则由本事务的第一条一致性读建 read view —— 两条都是
|
|
58
58
|
* **版本相关的副作用**,不是保证。机器门:`test/sql-txn-semantics-gate.test.ts`(G-B,例外闭集
|
|
59
59
|
* `INTRA_TXN_PLAIN_READS` 每条带理由);真值神谕:`test/sql-txn-semantics-integration.test.ts`(三引擎)。
|
|
60
60
|
*
|
|
61
61
|
* **④ 引擎事实不进店** —— `SqlDriver.facts` 是**运维读面**(`GET /v1/diagnostics/wiring` 的 `sqlEngine`
|
|
62
|
-
* 段与 `GET /v1/capabilities` 的 `store.sql` 位(7.106.0 起;此前顶层 `sql`,
|
|
62
|
+
* 段与 `GET /v1/capabilities` 的 `store.sql` 位(7.106.0 起;此前顶层 `sql`,[ref] ①))的料。店里不许出现 `if (engine === …)`:引擎判别在全仓
|
|
63
63
|
* 只有连接初始化这一处,机器门 G-A 守着。`SqlDialect`(SQL **文本**方言,两值)与 `engine`(运行期
|
|
64
64
|
* 引擎事实,三值)是两条轴,刻意不合成一个三值。
|
|
65
65
|
*
|
|
@@ -125,7 +125,7 @@ export interface SqlExec {
|
|
|
125
125
|
/** A pooled connection with transaction control (released by the caller in a `finally`). */
|
|
126
126
|
export interface SqlTxConn extends SqlExec {
|
|
127
127
|
/**
|
|
128
|
-
* The ONE transaction verb (
|
|
128
|
+
* The ONE transaction verb ([ref]). What its reads see is NOT decided here — it is decided once per
|
|
129
129
|
* pooled connection at initialization and reported by {@link SqlDriver.facts}. Read the
|
|
130
130
|
* `@contract txn.read-semantics` block at the top of this file before adding a transaction: the
|
|
131
131
|
* short version is **intra-transaction collection reads are LOCKING reads**, and a plain `SELECT`
|
|
@@ -145,7 +145,7 @@ export interface SqlTxConn extends SqlExec {
|
|
|
145
145
|
*/
|
|
146
146
|
export type SqlEngine = "tidb" | "innodb" | "pg";
|
|
147
147
|
/**
|
|
148
|
-
* What connection initialization ESTABLISHED and then READ BACK on this driver's pool (
|
|
148
|
+
* What connection initialization ESTABLISHED and then READ BACK on this driver's pool ([ref] §1
|
|
149
149
|
* 补偿面). Operator read faces: `GET /v1/diagnostics/wiring` → `sqlEngine`, `GET /v1/capabilities`
|
|
150
150
|
* → `sql`. Store code must never read this (machine gate G-A) — engine discrimination exists in
|
|
151
151
|
* exactly one place in this repo, and it is `connect()`.
|
|
@@ -322,7 +322,7 @@ export declare const SQL_FACTS_ABSENT_WALLS: SqlWallsReading;
|
|
|
322
322
|
export declare function sqlWallsOf(engine: SqlEngineReading | undefined): SqlWallsReading;
|
|
323
323
|
/**
|
|
324
324
|
* **数据库自己的钟**(毫秒),两方言各一句 —— 本仓这口钟在 SQL 面的**唯一**铸点([ref] A7 / [ref] /
|
|
325
|
-
* 合并复审 R2 把
|
|
325
|
+
* 合并复审 R2 把 [ref] 的 nonce 店并进来)。
|
|
326
326
|
*
|
|
327
327
|
* 用处永远是同一条:**一个时刻量的铸造点与它的判定点必须在同一个钟域**。副本各拿各的墙钟时,两台机器
|
|
328
328
|
* 之间的偏差没有任何一条腿强制过上界(本仓 [ref]③ 记过一次真实的 11 分钟 NTP 纠正),于是
|
|
@@ -359,7 +359,7 @@ export interface SqlDriver extends SqlExec {
|
|
|
359
359
|
* · `null`(还没借出过连接)—— 没有可报的东西,**不猜**;
|
|
360
360
|
* · 事实 —— 最近一次初始化**回读复核**过的值。每条池连接首次借出都重跑一次初始化(记忆化按连接身份),
|
|
361
361
|
* 所以池在致命错误后重连时,保证是在新连接上**重新建立**的,不是继承来的;
|
|
362
|
-
* · `null`(借出过、但最近一次初始化被**拒**)——
|
|
362
|
+
* · `null`(借出过、但最近一次初始化被**拒**)—— [ref] ④:保证此刻建立不起来,读面就报缺席。
|
|
363
363
|
* 此前这里是「一次成功即长期有效」的快照:连接被驱逐、新连接初始化被拒之后,诊断面仍在陈述一条
|
|
364
364
|
* 已经不成立的结构保证。降级由 `establishSession()` 一处完成,并留 loud warn。
|
|
365
365
|
*/
|
|
@@ -90,7 +90,7 @@ export declare const PG_DEADLOCK_DETECTED_SQLSTATE = "40P01";
|
|
|
90
90
|
* 它**不是**「锁序可以随便写」的许可证 —— 锁序的属主仍是店(真值神谕 =
|
|
91
91
|
* `test/sql-lock-shape-innodb-integration.test.ts` 三引擎并发套)。
|
|
92
92
|
*
|
|
93
|
-
* 引擎事实(2026-09-20 真 InnoDB 实测,
|
|
93
|
+
* 引擎事实(2026-09-20 真 InnoDB 实测,[ref] 取证):同一把缺行主键上 N=8 路并发「`FOR UPDATE` 缺行读
|
|
94
94
|
* → `INSERT`」,InnoDB(REPEATABLE READ,gap lock + insert-intention)恒定 1 成 7 死锁;TiDB(悲观、无
|
|
95
95
|
* gap lock)与 PG(READ COMMITTED,缺行 `FOR UPDATE` 不取锁)各自零死锁。⇒ 这条谓词实际的受众是
|
|
96
96
|
* **MySQL 协议腿**,两方言都认只是为了让店不必自己判引擎。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* **SQL JSON 列读腿的唯一属主**(
|
|
2
|
+
* **SQL JSON 列读腿的唯一属主**([ref] 设计稿 §2)—— 一列 JSON 怎么**投影**、怎么**恰好解一次码**、
|
|
3
3
|
* 读不出形怎么**拒**,整仓只有这一份定义。
|
|
4
4
|
*
|
|
5
5
|
* ── 病(KM / 7.92.2 C1 的真案,三库实测两次换形之后的终形)────────────────────────────────────
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
* `test/sql-json-column-single-owner.test.ts` 四道:①`JSON.parse(` 在 `src/plugins/**` 只许出现在本文件
|
|
24
24
|
* (未改调的店走显式 `PENDING_STORES` 登记 + 反向门);②JSON 承载列(清单由 `schema-ensure-legs` 的录制
|
|
25
25
|
* 驱动**机器派生**,不手抄)在 SELECT 投影里必须经 {@link jsonColumnText};③{@link decodeJsonColumn} 的
|
|
26
|
-
* `read` 实参必须是具名读者,禁内联 `(b) => b as T`;④(
|
|
26
|
+
* `read` 实参必须是具名读者,禁内联 `(b) => b as T`;④([ref])**读者 × 列可空性**求交,**双向**:每一只
|
|
27
27
|
* 形读者对承载列的可空性要求写在门的那张闭集表里,与 DDL 机器派生的读数不符即红(两个方向各一格)。
|
|
28
28
|
* 那条要求此前是注释里的一句散文,而整仓第二个用它的地方把它违了一整版。
|
|
29
29
|
*
|
|
30
|
-
* ── 「任意 JSON 值」那一族的三只铸点(
|
|
30
|
+
* ── 「任意 JSON 值」那一族的三只铸点([ref];区别在**名字**里,不在散文里)─────────────────────
|
|
31
31
|
* 一列的载荷没有声明形时,`null` 字面算不算合法值,**只由这一列有没有「缺席」这个状态**决定 —— 而那是
|
|
32
32
|
* 列可空性的另一种说法。所以这一族按可空性拆成三只,各自的前置条件由门双向咬:
|
|
33
33
|
* | 铸点 | 承载列必须 | JSON 字面 `null` |
|
|
@@ -69,9 +69,9 @@ export interface JsonColumnMember {
|
|
|
69
69
|
*
|
|
70
70
|
* 🔴 存在的唯一理由是「别名位在那里不合法」,**不是**给读腿留第二条路:读腿一律用 {@link jsonColumnText}
|
|
71
71
|
* (别名是它的产物的一部分,理由见那只函数)。今天整仓**两处**消费方,各自的「别名位不合法」都是真的:
|
|
72
|
-
* · `one-time-migrations.ts`
|
|
73
|
-
*
|
|
74
|
-
* · `workflow-journal-store-sql.ts` 的 `loadPage`(
|
|
72
|
+
* · `one-time-migrations.ts` 的几条改写(M8 / M17 / M18 / M21 的候选扫描与按原文 CAS 回写)——
|
|
73
|
+
* 它们要在 `WHERE` 里判这一列的**文本**,而 `WHERE` 没有别名位;
|
|
74
|
+
* · `workflow-journal-store-sql.ts` 的 `loadPage`([ref] 车③a)—— 那一列的投影裹在一条
|
|
75
75
|
* `CASE WHEN LENGTH(result) > ? THEN NULL ELSE <expr> END AS result_json` 里:**别名属于整条 CASE**
|
|
76
76
|
* (`result_json`,因为超字节门的那一支要给 `NULL`),CASE 里面的表达式位上写别名是语法错。
|
|
77
77
|
* 而「怎么把一列 JSON 取成文本」这件事整仓只能有一种写法:两种承载(真 JSON 列 / LONGTEXT 别名)在这条
|
|
@@ -106,9 +106,9 @@ export type SqlJsonColumnBodyProblem = Exclude<SqlJsonColumnProblem, "not-text">
|
|
|
106
106
|
* 店层码,**不上 wire**:店层折码口 {@link foldJsonColumn} 把它折成 {@link StoreCorruptError}
|
|
107
107
|
* (有自己闭集契约词的店折成自己的码)。终局对外码经 7.92.2 的词法门,永不裸穿。
|
|
108
108
|
*
|
|
109
|
-
* 🔴 **它只许在 `not-text` 那一形上穿过店的边界**(
|
|
109
|
+
* 🔴 **它只许在 `not-text` 那一形上穿过店的边界**([ref]):`not-text` 是读腿自己的缺陷(投影漂),
|
|
110
110
|
* 按 {@link foldJsonColumn} 的规则不折、原样上抛;而体的两形一旦穿出去,上层就得**按列错误类**分类,
|
|
111
|
-
* 那正是
|
|
111
|
+
* 那正是 [ref] 的病 —— 读口按列错误分类、店按店拒绝形折码,两层各说各话,坏体于是落进「店抖动」臂。
|
|
112
112
|
*/
|
|
113
113
|
export declare class SqlJsonColumnError extends Error {
|
|
114
114
|
readonly problem: SqlJsonColumnProblem;
|
|
@@ -157,9 +157,9 @@ export declare function decodeNullableJsonColumn<T>(cell: unknown, read: JsonCol
|
|
|
157
157
|
/**
|
|
158
158
|
* **「这一格耐久载荷读不出来」的店层拒绝**(整仓唯一一只)—— {@link foldJsonColumn} 的**恒定产物**。
|
|
159
159
|
*
|
|
160
|
-
* 🔴 为什么它必须是一只**具名类**而不是 `new Error(…)`(
|
|
160
|
+
* 🔴 为什么它必须是一只**具名类**而不是 `new Error(…)`([ref] 真案,7.95.1):折码的产物是**店交给
|
|
161
161
|
* 上层的契约**。折成裸 `Error` 之后,「这一行确定性地读不出来」与「店抖了一下」在上层**没有任何判别位**,
|
|
162
|
-
* 而两者的处置完全相反(前者要人去修那一行,后者重试 / 保守当缺席)。
|
|
162
|
+
* 而两者的处置完全相反(前者要人去修那一行,后者重试 / 保守当缺席)。[ref] 给续跑上下文修的正是这条
|
|
163
163
|
* 分家,可它在 SQL 车道上**结构不可达**整整一版:读口按**列错误类**分类,而店早把列错误折成了裸
|
|
164
164
|
* `Error` ⇒ 坏体一路掉进「店抖动 ⇒ 当缺席」臂,用户拿到的还是那个 409(local 车道答对,只是因为它
|
|
165
165
|
* 根本没折码、把列错误漏了出来 —— 巧合式正确,不是同一份契约)。
|
|
@@ -187,9 +187,9 @@ export declare class StoreCorruptError extends Error {
|
|
|
187
187
|
/**
|
|
188
188
|
* 店层折码的**唯一规则**(`catch (e) { throw foldJsonColumn(e, (m) => \`XStore: ${m} — refusing …\`); }`)。
|
|
189
189
|
*
|
|
190
|
-
* 🔴 回调交出来的是**一句话**,不是一只错误(
|
|
190
|
+
* 🔴 回调交出来的是**一句话**,不是一只错误([ref] 按类改):产物恒是 {@link StoreCorruptError},于是
|
|
191
191
|
* 「折成一只没有判别位的错」在**构造上**写不出来。此前这一格的签名是 `(message) => Error`,21 个调用点
|
|
192
|
-
* 里 19 个折成了裸 `Error` —— 每一个都是一枚等着下一个消费方来踩的
|
|
192
|
+
* 里 19 个折成了裸 `Error` —— 每一个都是一枚等着下一个消费方来踩的 [ref]。
|
|
193
193
|
*
|
|
194
194
|
* 🔴 `not-text` **不折**:它是读腿自己的缺陷(投影漏了),折成「这一行坏了」会把一次代码漂伪装成一次
|
|
195
195
|
* 数据事故 —— 这条判别只写在这里一处(与它的容忍侧孪生 {@link isJsonColumnBodyProblem} 共用),
|
|
@@ -233,7 +233,7 @@ export declare function createZodColumnReader<T>(schema: z.ZodType<T>): JsonColu
|
|
|
233
233
|
* 该店的域型交出去。整仓**只有这一处**做这一跳断言。
|
|
234
234
|
*
|
|
235
235
|
* 🔴 什么时候用它(硬条件,别扩大):这一列的键表属主**不在本层**,而那一层**没有导出验证器**。
|
|
236
|
-
* 两族,判据同一条(
|
|
236
|
+
* 两族,判据同一条([ref] 把这段与本函数第一句对齐 —— 它此前只写了 core 那一族,于是第二族要么被迫
|
|
237
237
|
* 违注、要么被迫另造一只读者,而「加一只特例读者」在本仓是红旗):
|
|
238
238
|
* · 属主在 **core**:`Checkpoint` / `ResumeOutcome` / `GateOutcome` / `WorkflowRun` /
|
|
239
239
|
* `BackgroundAgentRecord` …;
|
|
@@ -246,7 +246,7 @@ export declare function createZodColumnReader<T>(schema: z.ZodType<T>): JsonColu
|
|
|
246
246
|
* 一列只要有**本层自己的** schema 属主,就必须用 {@link createZodColumnReader} —— 用本函数等于把形判据关小。
|
|
247
247
|
*
|
|
248
248
|
* 🔴 为什么是一只工厂而不是让每个店各写一遍 `typeof body !== "object"`:那是同一条判据的 N 份拷贝
|
|
249
|
-
* (
|
|
249
|
+
* ([ref] 车② 初版真的写了六份),而且每一份都要自己那一跳 `as`。收成一处之后,判据只有一个写者,
|
|
250
250
|
* 断言也只发生在这一行 —— 类型卫生门因此在每个店里都读到零。
|
|
251
251
|
*/
|
|
252
252
|
export declare function createObjectColumnReader<T extends object>(): JsonColumnReader<T>;
|
|
@@ -265,17 +265,17 @@ export declare function isJsonObject(v: unknown): v is Record<string, unknown>;
|
|
|
265
265
|
*
|
|
266
266
|
* 🔴 前置条件(**门④ 机器执法,不是散文**):承载列**可空**,而「缺席」在它上面由**列的 NULL** 单独表达
|
|
267
267
|
* (三态列);于是 JSON 字面 `null` 是一个与缺席**不同形**的合法值。用在 `NOT NULL` 列上当场红 —— 那种列
|
|
268
|
-
* 根本没有缺席态,`null` 字面与「没有这一行」在点读的消费点上逐字同答,而那正是
|
|
268
|
+
* 根本没有缺席态,`null` 字面与「没有这一行」在点读的消费点上逐字同答,而那正是 [ref] 的病灶
|
|
269
269
|
* (`checkpoint_ctx.ctx`:`JSON NOT NULL` + 有结构的载荷,一整版都读回一个没人分得出来的 `null`)。
|
|
270
270
|
* NOT NULL 且契约不透明的列用 {@link readOpaqueJsonValueColumn};缺席落 SQL NULL 的用
|
|
271
271
|
* {@link readNonNullJsonValueColumn}(那一族把 `null` 字面判坏)。
|
|
272
272
|
*
|
|
273
273
|
* 之所以叫得出「三态」:范本是 `approval_ask.updated_input`([ref] / [ref])—— 列 NULL = 没带编辑,
|
|
274
274
|
* JSON 文本 `"null"` = **编辑成 null**,对象 = 编辑成那只对象;把 `"null"` 判成坏体会把一条合法的人类
|
|
275
|
-
* 编辑抹掉。这一句是**理由**,不是名单:哪几处在用它由门数,别在这里写计数(
|
|
275
|
+
* 编辑抹掉。这一句是**理由**,不是名单:哪几处在用它由门数,别在这里写计数([ref] 之前这里写着
|
|
276
276
|
* 「今天整仓只有一处符合」—— 那句话当时就是假的,而没有门看着的计数,下一个人加第二处时不会来改它)。
|
|
277
277
|
*
|
|
278
|
-
* 一列只要有结构,就**不许**用它 —— 那是把形判据静默关掉(这条是
|
|
278
|
+
* 一列只要有结构,就**不许**用它 —— 那是把形判据静默关掉(这条是 [ref] 的病灶判据,三只铸点同守)。
|
|
279
279
|
*/
|
|
280
280
|
export declare const readTriStateJsonValueColumn: JsonColumnReader<unknown>;
|
|
281
281
|
/**
|
|
@@ -294,14 +294,14 @@ export declare const readTriStateJsonValueColumn: JsonColumnReader<unknown>;
|
|
|
294
294
|
* 🔴 **它与 {@link readTriStateJsonValueColumn} 的实现逐字相同,而且必须各自独立写出来** —— 不许收成
|
|
295
295
|
* `export const readOpaqueJsonValueColumn = readTriStateJsonValueColumn`(门④c2 会红)。两只的区别整个
|
|
296
296
|
* 落在**前置条件**上(一只要可空列、一只要 NOT NULL 列),而前置条件的载体就是**名字**:合成一个名字就等于
|
|
297
|
-
* 把两条互斥的前置条件重新揉回一起 —— 那正是
|
|
297
|
+
* 把两条互斥的前置条件重新揉回一起 —— 那正是 [ref] 立案时那条散文析取的形。「去重」在这里去掉的不是重复,
|
|
298
298
|
* 是判据。
|
|
299
299
|
*/
|
|
300
300
|
export declare const readOpaqueJsonValueColumn: JsonColumnReader<unknown>;
|
|
301
301
|
/**
|
|
302
302
|
* **任意 JSON 值,但缺席由「列 NULL」表达**的列的形读者 —— `null` 字面判坏,其余一律是值。
|
|
303
303
|
*
|
|
304
|
-
* 🔴 这是**写腿吃 `unknown` 的那一族列**的正解(codex 对抗复审 [high] 验真后定形,
|
|
304
|
+
* 🔴 这是**写腿吃 `unknown` 的那一族列**的正解(codex 对抗复审 [high] 验真后定形,[ref] 车②):
|
|
305
305
|
* 写腿接的是 `unknown`(`PendingAction.args` / 账本行载荷 / leader 结果……),于是**数组 / 串 / 数 /
|
|
306
306
|
* 布尔实参都写得进去** —— 拿 {@link readJsonObjectColumn} 判它们就是「写腿收得下、读腿读不出」,而且
|
|
307
307
|
* 后果往往不是一行坏:`rows.map` 里一条这样的合法行会让整只读面抛。
|
|
@@ -312,14 +312,14 @@ export declare const readOpaqueJsonValueColumn: JsonColumnReader<unknown>;
|
|
|
312
312
|
* (根本没有缺席态),用 {@link readOpaqueJsonValueColumn}。
|
|
313
313
|
*
|
|
314
314
|
* 🔴 与 {@link readTriStateJsonValueColumn} 同属「承载列必须**可空**」这一族,所以同受门④ 约束
|
|
315
|
-
* (
|
|
315
|
+
* ([ref]):这族读者用在 `NOT NULL` 列上一律红 —— 列上没有 NULL 这个状态,「缺席」就无处安放,而写腿把
|
|
316
316
|
* 缺席落成 SQL NULL 这句话在那种列上根本执行不了。
|
|
317
317
|
*/
|
|
318
318
|
export declare const readNonNullJsonValueColumn: JsonColumnReader<unknown>;
|
|
319
319
|
/**
|
|
320
320
|
* **一只 JSON 数组**的承载形读者(内容判据归各列自己的既有属主,这里只判承载形)。
|
|
321
321
|
*
|
|
322
|
-
* 🔴 为什么在属主里而不是各店各写一遍(
|
|
322
|
+
* 🔴 为什么在属主里而不是各店各写一遍([ref] 车③a 把车② 的店内私有形上收):今天有三个消费方
|
|
323
323
|
* (checkpoint 的 `rule_suggestions` / `pending_steer_queue`、memory-engine 的 `embedding`),判据逐字
|
|
324
324
|
* 相同,而「这一格是不是一只数组」恰好是坏体四形的落点 —— 三份拷贝迟早有一份忘了判 `null` 字面。
|
|
325
325
|
*/
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* These were duplicated verbatim across the pg-/tidb- store twin pairs; each store imports the flavor
|
|
5
5
|
* it was written against so call sites and semantics are byte-identical to before.
|
|
6
6
|
*
|
|
7
|
-
* 🔴 **JSON 列的解析不在这里,也永远不会回来**(
|
|
8
|
-
* (lenient → `null` / strict → 抛 / fallback → 兜底),三种失败方向由**调用点自选** —— 那正是
|
|
7
|
+
* 🔴 **JSON 列的解析不在这里,也永远不会回来**([ref]):本文件曾住着三只 `parseJson*`
|
|
8
|
+
* (lenient → `null` / strict → 抛 / fallback → 兜底),三种失败方向由**调用点自选** —— 那正是 [ref]
|
|
9
9
|
* 要消灭的现状:同一格读不出的 JSON,在一个店里是「空体」、在另一个店里是「这一行不存在」、在第三个
|
|
10
10
|
* 店里是异常。三只在车③b **删除**(零别名、零转出),整仓唯一属主 = `sql-json-column.ts`
|
|
11
11
|
* (按文本投影 · 恰好解一次码 · 坏体一律拒),容忍写在店的调用点上(显式 `try/catch` + `recordFailOpen`)。
|