@cleocode/core 2026.10.4 → 2026.10.5-rc.ci.672
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/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +7 -37
- package/dist/bootstrap.js.map +1 -1
- package/dist/build-provenance.json +2 -2
- package/dist/caamp/adapter.d.ts.map +1 -1
- package/dist/caamp/adapter.js +5 -2
- package/dist/caamp/adapter.js.map +1 -1
- package/dist/changesets/parse-frontmatter.d.ts +1 -1
- package/dist/changesets/parse-frontmatter.d.ts.map +1 -1
- package/dist/changesets/parse-frontmatter.js +2 -1
- package/dist/changesets/parse-frontmatter.js.map +1 -1
- package/dist/changesets/parser.d.ts +1 -1
- package/dist/changesets/parser.d.ts.map +1 -1
- package/dist/changesets/parser.js +2 -1
- package/dist/changesets/parser.js.map +1 -1
- package/dist/changesets/writer.d.ts +8 -1
- package/dist/changesets/writer.d.ts.map +1 -1
- package/dist/changesets/writer.js +56 -5
- package/dist/changesets/writer.js.map +1 -1
- package/dist/cloud/keys.d.ts +9 -0
- package/dist/cloud/keys.d.ts.map +1 -1
- package/dist/cloud/keys.js +11 -0
- package/dist/cloud/keys.js.map +1 -1
- package/dist/cloud/nexus-attach.d.ts +17 -0
- package/dist/cloud/nexus-attach.d.ts.map +1 -1
- package/dist/cloud/nexus-attach.js +30 -9
- package/dist/cloud/nexus-attach.js.map +1 -1
- package/dist/cloud/nexus-auth.d.ts +7 -1
- package/dist/cloud/nexus-auth.d.ts.map +1 -1
- package/dist/cloud/nexus-auth.js +7 -1
- package/dist/cloud/nexus-auth.js.map +1 -1
- package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud-activity.js +2 -1
- package/dist/cloud/nexus-cloud-activity.js.map +1 -1
- package/dist/cloud/nexus-cloud-conflicts.d.ts +48 -0
- package/dist/cloud/nexus-cloud-conflicts.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud-conflicts.js +68 -0
- package/dist/cloud/nexus-cloud-conflicts.js.map +1 -0
- package/dist/cloud/nexus-cloud-status.d.ts +42 -6
- package/dist/cloud/nexus-cloud-status.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud-status.js +233 -19
- package/dist/cloud/nexus-cloud-status.js.map +1 -1
- package/dist/cloud/nexus-cloud.d.ts +18 -1
- package/dist/cloud/nexus-cloud.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud.js +56 -2
- package/dist/cloud/nexus-cloud.js.map +1 -1
- package/dist/cloud/nexus-credentials.d.ts +1 -1
- package/dist/cloud/nexus-credentials.d.ts.map +1 -1
- package/dist/cloud/nexus-credentials.js +1 -1
- package/dist/cloud/nexus-credentials.js.map +1 -1
- package/dist/cloud/nexus-enrol.d.ts +1 -1
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +2 -1
- package/dist/cloud/nexus-enrol.js.map +1 -1
- package/dist/cloud/nexus-first-run.d.ts +6 -2
- package/dist/cloud/nexus-first-run.d.ts.map +1 -1
- package/dist/cloud/nexus-first-run.js +8 -2
- package/dist/cloud/nexus-first-run.js.map +1 -1
- package/dist/cloud/nexus-link.d.ts +35 -4
- package/dist/cloud/nexus-link.d.ts.map +1 -1
- package/dist/cloud/nexus-link.js +172 -7
- package/dist/cloud/nexus-link.js.map +1 -1
- package/dist/cloud/nexus-presence-refresh.d.ts +65 -0
- package/dist/cloud/nexus-presence-refresh.d.ts.map +1 -0
- package/dist/cloud/nexus-presence-refresh.js +122 -0
- package/dist/cloud/nexus-presence-refresh.js.map +1 -0
- package/dist/cloud/nexus-project-history.d.ts +54 -0
- package/dist/cloud/nexus-project-history.d.ts.map +1 -0
- package/dist/cloud/nexus-project-history.js +108 -0
- package/dist/cloud/nexus-project-history.js.map +1 -0
- package/dist/cloud/nexus-vault-keys.d.ts.map +1 -1
- package/dist/cloud/nexus-vault-keys.js +12 -6
- package/dist/cloud/nexus-vault-keys.js.map +1 -1
- package/dist/cloud/nexus-vault.d.ts +7 -3
- package/dist/cloud/nexus-vault.d.ts.map +1 -1
- package/dist/cloud/nexus-vault.js +176 -29
- package/dist/cloud/nexus-vault.js.map +1 -1
- package/dist/cloud/presence.d.ts +1 -1
- package/dist/cloud/presence.d.ts.map +1 -1
- package/dist/cloud/presence.js +1 -1
- package/dist/cloud/presence.js.map +1 -1
- package/dist/cloud/projects.d.ts +7 -4
- package/dist/cloud/projects.d.ts.map +1 -1
- package/dist/cloud/projects.js +10 -1
- package/dist/cloud/projects.js.map +1 -1
- package/dist/cloud/signing.d.ts +14 -0
- package/dist/cloud/signing.d.ts.map +1 -1
- package/dist/cloud/signing.js +9 -0
- package/dist/cloud/signing.js.map +1 -1
- package/dist/conduit/cloud-endpoint.d.ts +96 -0
- package/dist/conduit/cloud-endpoint.d.ts.map +1 -0
- package/dist/conduit/cloud-endpoint.js +191 -0
- package/dist/conduit/cloud-endpoint.js.map +1 -0
- package/dist/conduit/conduit-client.d.ts.map +1 -1
- package/dist/conduit/conduit-client.js +2 -1
- package/dist/conduit/conduit-client.js.map +1 -1
- package/dist/conduit/factory.d.ts +4 -0
- package/dist/conduit/factory.d.ts.map +1 -1
- package/dist/conduit/factory.js +7 -1
- package/dist/conduit/factory.js.map +1 -1
- package/dist/conduit/http-transport.d.ts +12 -7
- package/dist/conduit/http-transport.d.ts.map +1 -1
- package/dist/conduit/http-transport.js +18 -11
- package/dist/conduit/http-transport.js.map +1 -1
- package/dist/conduit/index.d.ts +3 -1
- package/dist/conduit/index.d.ts.map +1 -1
- package/dist/conduit/index.js +3 -1
- package/dist/conduit/index.js.map +1 -1
- package/dist/conduit/sse-transport.d.ts +5 -1
- package/dist/conduit/sse-transport.d.ts.map +1 -1
- package/dist/conduit/sse-transport.js +10 -2
- package/dist/conduit/sse-transport.js.map +1 -1
- package/dist/config/registry.js +1 -1
- package/dist/config/registry.js.map +1 -1
- package/dist/core-paths.d.ts +13 -0
- package/dist/core-paths.d.ts.map +1 -0
- package/dist/core-paths.js +13 -0
- package/dist/core-paths.js.map +1 -0
- package/dist/decide/bench/source.js +1 -1
- package/dist/decide/bench/source.js.map +1 -1
- package/dist/decide/client.d.ts +1 -1
- package/dist/decide/client.d.ts.map +1 -1
- package/dist/decide/client.js +1 -1
- package/dist/decide/client.js.map +1 -1
- package/dist/decide/credentials.d.ts +1 -1
- package/dist/decide/credentials.d.ts.map +1 -1
- package/dist/decide/credentials.js +1 -1
- package/dist/decide/credentials.js.map +1 -1
- package/dist/decide/jev-wire.d.ts +1 -1
- package/dist/decide/jev-wire.d.ts.map +1 -1
- package/dist/decide/jev-wire.js +1 -1
- package/dist/decide/jev-wire.js.map +1 -1
- package/dist/decide/operations.d.ts +1 -1
- package/dist/decide/operations.d.ts.map +1 -1
- package/dist/decide/operations.js +1 -1
- package/dist/decide/operations.js.map +1 -1
- package/dist/decide/providers.d.ts +1 -1
- package/dist/decide/providers.d.ts.map +1 -1
- package/dist/decide/providers.js +1 -1
- package/dist/decide/providers.js.map +1 -1
- package/dist/decide/wizard.d.ts.map +1 -1
- package/dist/decide/wizard.js +1 -1
- package/dist/decide/wizard.js.map +1 -1
- package/dist/dispatch/config-domain-handler.d.ts +1 -1
- package/dist/dispatch/config-domain-handler.d.ts.map +1 -1
- package/dist/dispatch/config-domain-handler.js +1 -1
- package/dist/dispatch/config-domain-handler.js.map +1 -1
- package/dist/dispatch/contracts/ensures-schema.d.ts +1 -1
- package/dist/dispatch/contracts/ensures-schema.d.ts.map +1 -1
- package/dist/dispatch/contracts/ensures-schema.js +1 -1
- package/dist/dispatch/contracts/ensures-schema.js.map +1 -1
- package/dist/dispatch/contracts/input-contracts.d.ts +1 -1
- package/dist/dispatch/contracts/input-contracts.d.ts.map +1 -1
- package/dist/dispatch/contracts/input-contracts.js +3 -1
- package/dist/dispatch/contracts/input-contracts.js.map +1 -1
- package/dist/dispatch/describe-operation.d.ts +1 -1
- package/dist/dispatch/describe-operation.d.ts.map +1 -1
- package/dist/dispatch/describe-operation.js +1 -1
- package/dist/dispatch/describe-operation.js.map +1 -1
- package/dist/docs/display-alias.js +1 -1
- package/dist/docs/display-alias.js.map +1 -1
- package/dist/docs/docs-update.d.ts +1 -1
- package/dist/docs/docs-update.d.ts.map +1 -1
- package/dist/docs/docs-update.js +2 -1
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/export-document.js +14 -58300
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/publish-pr.js +1 -1
- package/dist/docs/publish-pr.js.map +1 -1
- package/dist/docs/supersede.js +1 -1
- package/dist/docs/supersede.js.map +1 -1
- package/dist/docs/validate-body.d.ts +1 -1
- package/dist/docs/validate-body.d.ts.map +1 -1
- package/dist/docs/validate-body.js +1 -1
- package/dist/docs/validate-body.js.map +1 -1
- package/dist/docs/writer-registry.js +1 -1
- package/dist/docs/writer-registry.js.map +1 -1
- package/dist/doctor/acceptance-drift.js +1 -1
- package/dist/doctor/acceptance-drift.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts +1 -1
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +1 -1
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/invariant-audit.js +1 -1
- package/dist/doctor/invariant-audit.js.map +1 -1
- package/dist/doctor/malformed-task-ids.js +1 -1
- package/dist/doctor/malformed-task-ids.js.map +1 -1
- package/dist/doctor/row-identity-refill.d.ts +43 -0
- package/dist/doctor/row-identity-refill.d.ts.map +1 -0
- package/dist/doctor/row-identity-refill.js +186 -0
- package/dist/doctor/row-identity-refill.js.map +1 -0
- package/dist/doctor/superseded-store.d.ts.map +1 -1
- package/dist/doctor/superseded-store.js +51 -2
- package/dist/doctor/superseded-store.js.map +1 -1
- package/dist/doctor/sync-repair.d.ts +39 -0
- package/dist/doctor/sync-repair.d.ts.map +1 -0
- package/dist/doctor/sync-repair.js +71 -0
- package/dist/doctor/sync-repair.js.map +1 -0
- package/dist/doctor/sync-triggers.d.ts +63 -4
- package/dist/doctor/sync-triggers.d.ts.map +1 -1
- package/dist/doctor/sync-triggers.js +352 -9
- package/dist/doctor/sync-triggers.js.map +1 -1
- package/dist/doctor/twin-collapse.js +1 -1
- package/dist/doctor/twin-collapse.js.map +1 -1
- package/dist/engine/engine-ops.d.ts.map +1 -1
- package/dist/engine/engine-ops.js +7 -1
- package/dist/engine/engine-ops.js.map +1 -1
- package/dist/engine-result.d.ts +1 -1
- package/dist/engine-result.d.ts.map +1 -1
- package/dist/engine-result.js +1 -1
- package/dist/engine-result.js.map +1 -1
- package/dist/error-registry.d.ts +1 -1
- package/dist/error-registry.d.ts.map +1 -1
- package/dist/error-registry.js +1 -1
- package/dist/error-registry.js.map +1 -1
- package/dist/errors-to-engine.d.ts +20 -0
- package/dist/errors-to-engine.d.ts.map +1 -1
- package/dist/errors-to-engine.js +37 -0
- package/dist/errors-to-engine.js.map +1 -1
- package/dist/gc/janitor.d.ts +23 -4
- package/dist/gc/janitor.d.ts.map +1 -1
- package/dist/gc/janitor.js +71 -11
- package/dist/gc/janitor.js.map +1 -1
- package/dist/goal/continuation.d.ts +1 -1
- package/dist/goal/continuation.d.ts.map +1 -1
- package/dist/goal/continuation.js +1 -1
- package/dist/goal/continuation.js.map +1 -1
- package/dist/goal/judge.d.ts.map +1 -1
- package/dist/goal/judge.js +2 -1
- package/dist/goal/judge.js.map +1 -1
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/session-hooks.js +1 -1
- package/dist/hooks/handlers/session-hooks.js.map +1 -1
- package/dist/init/engine-ops.js +1 -1
- package/dist/init/engine-ops.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +10 -41
- package/dist/init.js.map +1 -1
- package/dist/inject/index.js +1 -1
- package/dist/inject/index.js.map +1 -1
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +13 -0
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +4 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -4
- package/dist/internal.js.map +1 -1
- package/dist/issue/create.js +1 -1
- package/dist/issue/create.js.map +1 -1
- package/dist/json-schema-validator.js +1 -1
- package/dist/json-schema-validator.js.map +1 -1
- package/dist/lifecycle/index.d.ts +2 -23
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +5 -112
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/kind-requirements.d.ts +1 -1
- package/dist/lifecycle/kind-requirements.d.ts.map +1 -1
- package/dist/lifecycle/kind-requirements.js +1 -1
- package/dist/lifecycle/kind-requirements.js.map +1 -1
- package/dist/lifecycle/pipeline.js +1 -1
- package/dist/lifecycle/pipeline.js.map +1 -1
- package/dist/lifecycle/resume.js +2 -2
- package/dist/lifecycle/resume.js.map +1 -1
- package/dist/lifecycle/state-machine.js +1 -1
- package/dist/lifecycle/state-machine.js.map +1 -1
- package/dist/lifecycle/status.d.ts +46 -0
- package/dist/lifecycle/status.d.ts.map +1 -0
- package/dist/lifecycle/status.js +147 -0
- package/dist/lifecycle/status.js.map +1 -0
- package/dist/lifecycle/verification/satisfies-validator.js +1 -1
- package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
- package/dist/llm/catalog-seeder.d.ts +1 -1
- package/dist/llm/catalog-seeder.d.ts.map +1 -1
- package/dist/llm/catalog-seeder.js +1 -1
- package/dist/llm/catalog-seeder.js.map +1 -1
- package/dist/llm/cli-ops.d.ts +1 -2
- package/dist/llm/cli-ops.d.ts.map +1 -1
- package/dist/llm/cli-ops.js +2 -1
- package/dist/llm/cli-ops.js.map +1 -1
- package/dist/llm/credential-seeders/claude-code-seeder.js +1 -1
- package/dist/llm/credential-seeders/claude-code-seeder.js.map +1 -1
- package/dist/llm/credential-seeders/cleo-pkce-seeder.js +1 -1
- package/dist/llm/credential-seeders/cleo-pkce-seeder.js.map +1 -1
- package/dist/llm/credential-writeback.js +1 -1
- package/dist/llm/credential-writeback.js.map +1 -1
- package/dist/llm/entity-ops.d.ts +1 -1
- package/dist/llm/entity-ops.d.ts.map +1 -1
- package/dist/llm/entity-ops.js +2 -1
- package/dist/llm/entity-ops.js.map +1 -1
- package/dist/llm/llm-queue-admit.d.ts +1 -1
- package/dist/llm/llm-queue-admit.d.ts.map +1 -1
- package/dist/llm/llm-queue-admit.js +2 -1
- package/dist/llm/llm-queue-admit.js.map +1 -1
- package/dist/llm/onboarding/login-engine.js +1 -1
- package/dist/llm/onboarding/login-engine.js.map +1 -1
- package/dist/llm/pi/pi-errors.d.ts +1 -1
- package/dist/llm/pi/pi-errors.d.ts.map +1 -1
- package/dist/llm/pi/pi-errors.js +1 -1
- package/dist/llm/pi/pi-errors.js.map +1 -1
- package/dist/llm/plugin-facade.d.ts.map +1 -1
- package/dist/llm/plugin-facade.js +14 -93552
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/system-key.d.ts +1 -1
- package/dist/llm/system-key.d.ts.map +1 -1
- package/dist/llm/system-key.js +1 -1
- package/dist/llm/system-key.js.map +1 -1
- package/dist/llm/system-of-use-registry.d.ts +1 -1
- package/dist/llm/system-of-use-registry.d.ts.map +1 -1
- package/dist/llm/system-of-use-registry.js +1 -1
- package/dist/llm/system-of-use-registry.js.map +1 -1
- package/dist/llm/system-resolver.js +1 -1
- package/dist/llm/system-resolver.js.map +1 -1
- package/dist/memory/brain-host.d.ts +71 -0
- package/dist/memory/brain-host.d.ts.map +1 -0
- package/dist/memory/brain-host.js +84 -0
- package/dist/memory/brain-host.js.map +1 -0
- package/dist/memory/brain-writer-handlers.d.ts.map +1 -1
- package/dist/memory/brain-writer-handlers.js +24 -7
- package/dist/memory/brain-writer-handlers.js.map +1 -1
- package/dist/memory/brain-writer-thread.d.ts +66 -6
- package/dist/memory/brain-writer-thread.d.ts.map +1 -1
- package/dist/memory/brain-writer-thread.js +67 -10
- package/dist/memory/brain-writer-thread.js.map +1 -1
- package/dist/memory/brain-writer-worker.js +7 -0
- package/dist/memory/brain-writer-worker.js.map +1 -1
- package/dist/memory/decisions.js +2 -1
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/embedding-backfill.d.ts +70 -0
- package/dist/memory/embedding-backfill.d.ts.map +1 -0
- package/dist/memory/embedding-backfill.js +110 -0
- package/dist/memory/embedding-backfill.js.map +1 -0
- package/dist/memory/index.js +1 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/manifest-identity.js +1 -1
- package/dist/memory/manifest-identity.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts +23 -0
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +82 -36
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/metrics/model-provider-registry.d.ts.map +1 -1
- package/dist/metrics/model-provider-registry.js +6 -0
- package/dist/metrics/model-provider-registry.js.map +1 -1
- package/dist/metrics/token-service.d.ts +17 -0
- package/dist/metrics/token-service.d.ts.map +1 -1
- package/dist/metrics/token-service.js +17 -0
- package/dist/metrics/token-service.js.map +1 -1
- package/dist/migration/index.js +1 -1
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/manual/T10165-backfill-adr-index.js +1 -1
- package/dist/migration/manual/T10165-backfill-adr-index.js.map +1 -1
- package/dist/nexus/assessment-projection.d.ts +1 -1
- package/dist/nexus/assessment-projection.d.ts.map +1 -1
- package/dist/nexus/assessment-projection.js +1 -1
- package/dist/nexus/assessment-projection.js.map +1 -1
- package/dist/nexus/deps.d.ts +1 -1
- package/dist/nexus/deps.d.ts.map +1 -1
- package/dist/nexus/deps.js +1 -1
- package/dist/nexus/deps.js.map +1 -1
- package/dist/nexus/fleet-status.d.ts +1 -1
- package/dist/nexus/fleet-status.d.ts.map +1 -1
- package/dist/nexus/fleet-status.js +1 -1
- package/dist/nexus/fleet-status.js.map +1 -1
- package/dist/nexus/identity.js +1 -1
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/permissions.d.ts +1 -1
- package/dist/nexus/permissions.d.ts.map +1 -1
- package/dist/nexus/permissions.js +1 -1
- package/dist/nexus/permissions.js.map +1 -1
- package/dist/nexus/query-dsl.js +1 -1
- package/dist/nexus/query-dsl.js.map +1 -1
- package/dist/nexus/query.d.ts +1 -2
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +1 -1
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry-errors.js +1 -1
- package/dist/nexus/registry-errors.js.map +1 -1
- package/dist/nexus/registry.d.ts +1 -1
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +1 -1
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/workspace.js +1 -1
- package/dist/nexus/workspace.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +2 -1
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/query-ops.js +1 -1
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestrate/spawn-ops.js +1 -1
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/atomicity.d.ts +1 -1
- package/dist/orchestration/atomicity.d.ts.map +1 -1
- package/dist/orchestration/atomicity.js +1 -1
- package/dist/orchestration/atomicity.js.map +1 -1
- package/dist/orchestration/classify.js +1 -1
- package/dist/orchestration/classify.js.map +1 -1
- package/dist/orchestration/index.js +1 -1
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/parallel.js +1 -1
- package/dist/orchestration/parallel.js.map +1 -1
- package/dist/orchestration/protocol-validators.d.ts +1 -1
- package/dist/orchestration/protocol-validators.d.ts.map +1 -1
- package/dist/orchestration/protocol-validators.js +1 -1
- package/dist/orchestration/protocol-validators.js.map +1 -1
- package/dist/orchestration/skill-ops.js +1 -1
- package/dist/orchestration/skill-ops.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts +9 -0
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +13 -2
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/spawn.js +1 -1
- package/dist/orchestration/spawn.js.map +1 -1
- package/dist/paths.d.ts +3 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +3 -1
- package/dist/paths.js.map +1 -1
- package/dist/phases/deps.js +1 -1
- package/dist/phases/deps.js.map +1 -1
- package/dist/phases/index.js +1 -1
- package/dist/phases/index.js.map +1 -1
- package/dist/project-lifecycle.js +3 -3
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/registrations.d.ts +30 -0
- package/dist/registrations.d.ts.map +1 -0
- package/dist/registrations.js +30 -0
- package/dist/registrations.js.map +1 -0
- package/dist/release/changesets-aggregator.js +1 -1
- package/dist/release/changesets-aggregator.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +68 -2
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +203 -39
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/release/invariants/archive-reason-invariant.d.ts +1 -1
- package/dist/release/invariants/archive-reason-invariant.d.ts.map +1 -1
- package/dist/release/invariants/archive-reason-invariant.js +1 -1
- package/dist/release/invariants/archive-reason-invariant.js.map +1 -1
- package/dist/release/invariants/registry.d.ts +1 -1
- package/dist/release/invariants/registry.d.ts.map +1 -1
- package/dist/release/invariants/registry.js +1 -1
- package/dist/release/invariants/registry.js.map +1 -1
- package/dist/release/open.d.ts +1 -1
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +3 -1
- package/dist/release/open.js.map +1 -1
- package/dist/release/plan.d.ts +1 -2
- package/dist/release/plan.d.ts.map +1 -1
- package/dist/release/plan.js +4 -1
- package/dist/release/plan.js.map +1 -1
- package/dist/release/pr-evidence.d.ts +1 -1
- package/dist/release/pr-evidence.d.ts.map +1 -1
- package/dist/release/pr-evidence.js +2 -2
- package/dist/release/pr-evidence.js.map +1 -1
- package/dist/release/preflight-skip.d.ts +5 -0
- package/dist/release/preflight-skip.d.ts.map +1 -1
- package/dist/release/preflight-skip.js +60 -1
- package/dist/release/preflight-skip.js.map +1 -1
- package/dist/release/reconcile.d.ts +1 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +19 -3
- package/dist/release/reconcile.js.map +1 -1
- package/dist/release/version-bump.d.ts +1 -1
- package/dist/release/version-bump.d.ts.map +1 -1
- package/dist/release/version-bump.js +1 -1
- package/dist/release/version-bump.js.map +1 -1
- package/dist/resources/admission-ledger.d.ts +587 -0
- package/dist/resources/admission-ledger.d.ts.map +1 -0
- package/dist/resources/admission-ledger.js +1401 -0
- package/dist/resources/admission-ledger.js.map +1 -0
- package/dist/resources/backend.d.ts +37 -1
- package/dist/resources/backend.d.ts.map +1 -1
- package/dist/resources/backend.js +1 -1
- package/dist/resources/darwin-backend.d.ts +152 -26
- package/dist/resources/darwin-backend.d.ts.map +1 -1
- package/dist/resources/darwin-backend.js +217 -34
- package/dist/resources/darwin-backend.js.map +1 -1
- package/dist/resources/governor.d.ts +36 -39
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +140 -49
- package/dist/resources/governor.js.map +1 -1
- package/dist/resources/pressure-gate.d.ts +148 -0
- package/dist/resources/pressure-gate.d.ts.map +1 -0
- package/dist/resources/pressure-gate.js +273 -0
- package/dist/resources/pressure-gate.js.map +1 -0
- package/dist/resources/run-admission.d.ts +33 -45
- package/dist/resources/run-admission.d.ts.map +1 -1
- package/dist/resources/run-admission.js +50 -118
- package/dist/resources/run-admission.js.map +1 -1
- package/dist/resources/run-class.d.ts +60 -4
- package/dist/resources/run-class.d.ts.map +1 -1
- package/dist/resources/run-class.js +473 -6
- package/dist/resources/run-class.js.map +1 -1
- package/dist/resources/run-governed.d.ts +43 -11
- package/dist/resources/run-governed.d.ts.map +1 -1
- package/dist/resources/run-governed.js +139 -99
- package/dist/resources/run-governed.js.map +1 -1
- package/dist/resources/slot-holder.d.ts +12 -4
- package/dist/resources/slot-holder.d.ts.map +1 -1
- package/dist/resources/slot-holder.js +19 -14
- package/dist/resources/slot-holder.js.map +1 -1
- package/dist/resources/spawn-wrapper.js +1 -1
- package/dist/resources/spawn-wrapper.js.map +1 -1
- package/dist/resources/supervisor-admit.d.ts +1 -1
- package/dist/resources/supervisor-admit.d.ts.map +1 -1
- package/dist/resources/supervisor-admit.js +2 -1
- package/dist/resources/supervisor-admit.js.map +1 -1
- package/dist/runtime/openapi/generate-openapi.d.ts +1 -1
- package/dist/runtime/openapi/generate-openapi.d.ts.map +1 -1
- package/dist/runtime/openapi/generate-openapi.js +1 -1
- package/dist/runtime/openapi/generate-openapi.js.map +1 -1
- package/dist/sagas/index.d.ts +3 -1
- package/dist/sagas/index.d.ts.map +1 -1
- package/dist/sagas/index.js +2 -5
- package/dist/sagas/index.js.map +1 -1
- package/dist/scaffold/project-identity.js +1 -1
- package/dist/scaffold/project-identity.js.map +1 -1
- package/dist/sdk/validator-attest.d.ts +1 -1
- package/dist/sdk/validator-attest.d.ts.map +1 -1
- package/dist/sdk/validator-attest.js +1 -1
- package/dist/sdk/validator-attest.js.map +1 -1
- package/dist/sdk/validator-reject.d.ts +1 -1
- package/dist/sdk/validator-reject.d.ts.map +1 -1
- package/dist/sdk/validator-reject.js +1 -1
- package/dist/sdk/validator-reject.js.map +1 -1
- package/dist/security/input-sanitization.js +2 -1
- package/dist/security/input-sanitization.js.map +1 -1
- package/dist/security/override-cap.js +1 -1
- package/dist/security/override-cap.js.map +1 -1
- package/dist/security/owner-override-auth.js +1 -1
- package/dist/security/owner-override-auth.js.map +1 -1
- package/dist/security/shared-evidence-tracker.js +1 -1
- package/dist/security/shared-evidence-tracker.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +35 -93037
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/daemon.d.ts.map +1 -1
- package/dist/sentient/daemon.js +3 -0
- package/dist/sentient/daemon.js.map +1 -1
- package/dist/sentient/tick.d.ts +7 -0
- package/dist/sentient/tick.d.ts.map +1 -1
- package/dist/sentient/tick.js +11 -0
- package/dist/sentient/tick.js.map +1 -1
- package/dist/sequence/index.js +1 -1
- package/dist/sequence/index.js.map +1 -1
- package/dist/session/engine-ops.d.ts +3 -45
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +63 -112
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/session/status-op.d.ts +40 -0
- package/dist/session/status-op.d.ts.map +1 -0
- package/dist/session/status-op.js +71 -0
- package/dist/session/status-op.js.map +1 -0
- package/dist/session/task-current.d.ts +31 -0
- package/dist/session/task-current.d.ts.map +1 -0
- package/dist/session/task-current.js +59 -0
- package/dist/session/task-current.js.map +1 -0
- package/dist/sessions/assumptions.d.ts +1 -1
- package/dist/sessions/assumptions.d.ts.map +1 -1
- package/dist/sessions/assumptions.js +1 -1
- package/dist/sessions/assumptions.js.map +1 -1
- package/dist/sessions/context-inject.js +1 -1
- package/dist/sessions/context-inject.js.map +1 -1
- package/dist/sessions/decisions.d.ts +1 -1
- package/dist/sessions/decisions.d.ts.map +1 -1
- package/dist/sessions/decisions.js +1 -1
- package/dist/sessions/decisions.js.map +1 -1
- package/dist/sessions/focus-state-store.d.ts.map +1 -1
- package/dist/sessions/focus-state-store.js +2 -1
- package/dist/sessions/focus-state-store.js.map +1 -1
- package/dist/sessions/handoff.js +1 -1
- package/dist/sessions/handoff.js.map +1 -1
- package/dist/sessions/index.d.ts +1 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +3 -2
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/session-drift.js +1 -1
- package/dist/sessions/session-drift.js.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.d.ts +4 -0
- package/dist/sessions/session-end-snapshot-entry.d.ts.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.js +11 -0
- package/dist/sessions/session-end-snapshot-entry.js.map +1 -1
- package/dist/sessions/session-end-snapshot.d.ts.map +1 -1
- package/dist/sessions/session-end-snapshot.js +4 -0
- package/dist/sessions/session-end-snapshot.js.map +1 -1
- package/dist/sessions/session-enforcement.js +1 -1
- package/dist/sessions/session-enforcement.js.map +1 -1
- package/dist/sessions/session-show.d.ts +1 -2
- package/dist/sessions/session-show.d.ts.map +1 -1
- package/dist/sessions/session-show.js +1 -1
- package/dist/sessions/session-show.js.map +1 -1
- package/dist/sessions/session-stats.js +1 -1
- package/dist/sessions/session-stats.js.map +1 -1
- package/dist/sessions/session-suspend.d.ts +1 -2
- package/dist/sessions/session-suspend.d.ts.map +1 -1
- package/dist/sessions/session-suspend.js +1 -1
- package/dist/sessions/session-suspend.js.map +1 -1
- package/dist/sessions/session-switch.js +1 -1
- package/dist/sessions/session-switch.js.map +1 -1
- package/dist/sessions/snapshot.js +1 -1
- package/dist/sessions/snapshot.js.map +1 -1
- package/dist/sessions/terminal-identity.d.ts +1 -1
- package/dist/sessions/terminal-identity.d.ts.map +1 -1
- package/dist/sessions/terminal-identity.js +1 -1
- package/dist/sessions/terminal-identity.js.map +1 -1
- package/dist/setup/sections/integrations.d.ts.map +1 -1
- package/dist/setup/sections/integrations.js +9 -0
- package/dist/setup/sections/integrations.js.map +1 -1
- package/dist/setup/sections/models-roles.js +1 -1
- package/dist/setup/sections/models-roles.js.map +1 -1
- package/dist/setup/sections/verification.d.ts.map +1 -1
- package/dist/setup/sections/verification.js +8 -2
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/shutdown.d.ts +24 -0
- package/dist/shutdown.d.ts.map +1 -1
- package/dist/shutdown.js +30 -1
- package/dist/shutdown.js.map +1 -1
- package/dist/skills/agents/install.d.ts +46 -6
- package/dist/skills/agents/install.d.ts.map +1 -1
- package/dist/skills/agents/install.js +86 -17
- package/dist/skills/agents/install.js.map +1 -1
- package/dist/skills/injection/subagent.js +1 -1
- package/dist/skills/injection/subagent.js.map +1 -1
- package/dist/skills/manifests/research.d.ts.map +1 -1
- package/dist/skills/manifests/research.js +2 -1
- package/dist/skills/manifests/research.js.map +1 -1
- package/dist/skills/orchestrator/spawn.js +1 -1
- package/dist/skills/orchestrator/spawn.js.map +1 -1
- package/dist/skills/orchestrator/validator.js +1 -1
- package/dist/skills/orchestrator/validator.js.map +1 -1
- package/dist/snapshot/index.d.ts.map +1 -1
- package/dist/snapshot/index.js +13 -0
- package/dist/snapshot/index.js.map +1 -1
- package/dist/spawn/agent-identity.js +1 -1
- package/dist/spawn/agent-identity.js.map +1 -1
- package/dist/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +2 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/store/agent-install.d.ts.map +1 -1
- package/dist/store/agent-install.js +2 -1
- package/dist/store/agent-install.js.map +1 -1
- package/dist/store/agent-registry-accessor.d.ts +1 -0
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.js +3 -1
- package/dist/store/agent-registry-accessor.js.map +1 -1
- package/dist/store/atomic.js +1 -1
- package/dist/store/atomic.js.map +1 -1
- package/dist/store/attachment-store.js +1 -1
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/audit-log-schema.d.ts +645 -0
- package/dist/store/audit-log-schema.d.ts.map +1 -0
- package/dist/store/audit-log-schema.js +30 -0
- package/dist/store/audit-log-schema.js.map +1 -0
- package/dist/store/background-ops.d.ts +26 -0
- package/dist/store/background-ops.d.ts.map +1 -1
- package/dist/store/background-ops.js +46 -0
- package/dist/store/background-ops.js.map +1 -1
- package/dist/store/backup-recover.d.ts +36 -1
- package/dist/store/backup-recover.d.ts.map +1 -1
- package/dist/store/backup-recover.js +99 -1
- package/dist/store/backup-recover.js.map +1 -1
- package/dist/store/backup-verify.d.ts +1 -1
- package/dist/store/backup-verify.d.ts.map +1 -1
- package/dist/store/backup-verify.js +6 -1
- package/dist/store/backup-verify.js.map +1 -1
- package/dist/store/backup.js +1 -1
- package/dist/store/backup.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +2 -26
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/converters.js +1 -1
- package/dist/store/converters.js.map +1 -1
- package/dist/store/db-helpers.js +1 -1
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/dependency-cycles.js +1 -1
- package/dist/store/dependency-cycles.js.map +1 -1
- package/dist/store/display-id-alias.d.ts +2 -2
- package/dist/store/display-id-alias.d.ts.map +1 -1
- package/dist/store/display-id-alias.js +5 -28
- package/dist/store/display-id-alias.js.map +1 -1
- package/dist/store/drizzle-node-sqlite.d.ts +56 -0
- package/dist/store/drizzle-node-sqlite.d.ts.map +1 -0
- package/dist/store/drizzle-node-sqlite.js +87 -0
- package/dist/store/drizzle-node-sqlite.js.map +1 -0
- package/dist/store/dual-scope-db.d.ts +26 -33
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +416 -127
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/abort-events.d.ts +134 -0
- package/dist/store/exodus/abort-events.d.ts.map +1 -1
- package/dist/store/exodus/abort-events.js +201 -0
- package/dist/store/exodus/abort-events.js.map +1 -1
- package/dist/store/exodus/migrate.d.ts +7 -0
- package/dist/store/exodus/migrate.d.ts.map +1 -1
- package/dist/store/exodus/migrate.js +156 -118
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/on-open.d.ts +36 -0
- package/dist/store/exodus/on-open.d.ts.map +1 -1
- package/dist/store/exodus/on-open.js +102 -27
- package/dist/store/exodus/on-open.js.map +1 -1
- package/dist/store/exodus/prior-recoveries.d.ts +75 -0
- package/dist/store/exodus/prior-recoveries.d.ts.map +1 -0
- package/dist/store/exodus/prior-recoveries.js +122 -0
- package/dist/store/exodus/prior-recoveries.js.map +1 -0
- package/dist/store/exodus/reconcile.d.ts.map +1 -1
- package/dist/store/exodus/reconcile.js +188 -24
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +3 -3
- package/dist/store/exodus/runtime-targets.js +3 -3
- package/dist/store/exodus/task-id-collision-sql.d.ts +52 -0
- package/dist/store/exodus/task-id-collision-sql.d.ts.map +1 -0
- package/dist/store/exodus/task-id-collision-sql.js +97 -0
- package/dist/store/exodus/task-id-collision-sql.js.map +1 -0
- package/dist/store/exodus/task-id-remap.d.ts +113 -0
- package/dist/store/exodus/task-id-remap.d.ts.map +1 -0
- package/dist/store/exodus/task-id-remap.js +301 -0
- package/dist/store/exodus/task-id-remap.js.map +1 -0
- package/dist/store/exodus/verify-migration.js +1 -1
- package/dist/store/exodus/verify-migration.js.map +1 -1
- package/dist/store/exodus/write-guard.d.ts +136 -0
- package/dist/store/exodus/write-guard.d.ts.map +1 -0
- package/dist/store/exodus/write-guard.js +289 -0
- package/dist/store/exodus/write-guard.js.map +1 -0
- package/dist/store/identity-share.d.ts +31 -0
- package/dist/store/identity-share.d.ts.map +1 -0
- package/dist/store/identity-share.js +54 -0
- package/dist/store/identity-share.js.map +1 -0
- package/dist/store/import-remap.js +1 -1
- package/dist/store/import-remap.js.map +1 -1
- package/dist/store/import-sort.js +1 -1
- package/dist/store/import-sort.js.map +1 -1
- package/dist/store/json.js +1 -1
- package/dist/store/json.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +3 -3
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +17 -0
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +18 -1
- package/dist/store/lock.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +2 -25
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/migration-files.d.ts +30 -0
- package/dist/store/migration-files.d.ts.map +1 -0
- package/dist/store/migration-files.js +59 -0
- package/dist/store/migration-files.js.map +1 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +14 -14
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/migration-runner.d.ts.map +1 -1
- package/dist/store/migration-runner.js +2 -2
- package/dist/store/migration-runner.js.map +1 -1
- package/dist/store/migration-sqlite.d.ts +1 -1
- package/dist/store/migration-sqlite.d.ts.map +1 -1
- package/dist/store/migration-sqlite.js +290 -355
- package/dist/store/migration-sqlite.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +4 -2
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/pid-alive.d.ts +15 -0
- package/dist/store/pid-alive.d.ts.map +1 -0
- package/dist/store/pid-alive.js +24 -0
- package/dist/store/pid-alive.js.map +1 -0
- package/dist/store/portable-bundle-scan.d.ts +1 -1
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +1 -1
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts +10 -1
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +10 -1
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/recover-malformed-db.d.ts +1 -1
- package/dist/store/recover-malformed-db.d.ts.map +1 -1
- package/dist/store/recover-malformed-db.js +1 -1
- package/dist/store/recover-malformed-db.js.map +1 -1
- package/dist/store/repair-malformed-dbs.d.ts +1 -1
- package/dist/store/repair-malformed-dbs.d.ts.map +1 -1
- package/dist/store/repair-malformed-dbs.js +1 -1
- package/dist/store/repair-malformed-dbs.js.map +1 -1
- package/dist/store/restore-marker.d.ts +89 -0
- package/dist/store/restore-marker.d.ts.map +1 -0
- package/dist/store/restore-marker.js +197 -0
- package/dist/store/restore-marker.js.map +1 -0
- package/dist/store/restore-store.d.ts +85 -0
- package/dist/store/restore-store.d.ts.map +1 -0
- package/dist/store/restore-store.js +391 -0
- package/dist/store/restore-store.js.map +1 -0
- package/dist/store/row-identity.d.ts +123 -1
- package/dist/store/row-identity.d.ts.map +1 -1
- package/dist/store/row-identity.js +454 -80
- package/dist/store/row-identity.js.map +1 -1
- package/dist/store/schema/agent-registry-schema.d.ts +1 -1
- package/dist/store/schema/agent-registry-schema.d.ts.map +1 -1
- package/dist/store/schema/agent-registry-schema.js +5 -1
- package/dist/store/schema/agent-registry-schema.js.map +1 -1
- package/dist/store/schema/cleo-global/agent-registry.d.ts +1 -1
- package/dist/store/schema/cleo-global/agent-registry.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/agent-registry.js +9 -5
- package/dist/store/schema/cleo-global/agent-registry.js.map +1 -1
- package/dist/store/schema/cleo-global/models-catalog.js +1 -1
- package/dist/store/schema/cleo-global/models-catalog.js.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +1 -1
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/provenance-orphans.js +9 -2
- package/dist/store/schema/cleo-project/provenance-orphans.js.map +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.js +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.js.map +1 -1
- package/dist/store/schema/cleo-shared/brain.js +1 -1
- package/dist/store/schema/cleo-shared/brain.js.map +1 -1
- package/dist/store/schema/memory-schema.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts.map +1 -1
- package/dist/store/schema/memory-schema.js +1 -1
- package/dist/store/schema/memory-schema.js.map +1 -1
- package/dist/store/schema/nexus-schema.js +1 -1
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/service-host-matcher.d.ts +1 -1
- package/dist/store/service-host-matcher.d.ts.map +1 -1
- package/dist/store/service-host-matcher.js +1 -1
- package/dist/store/service-host-matcher.js.map +1 -1
- package/dist/store/service-oauth.js +1 -1
- package/dist/store/service-oauth.js.map +1 -1
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +7 -1
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +1 -1
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +1 -1
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +52 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +95 -22
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite-native.d.ts.map +1 -1
- package/dist/store/sqlite-native.js +9 -9
- package/dist/store/sqlite-native.js.map +1 -1
- package/dist/store/sqlite-pragmas.d.ts +12 -5
- package/dist/store/sqlite-pragmas.d.ts.map +1 -1
- package/dist/store/sqlite-pragmas.js +13 -2
- package/dist/store/sqlite-pragmas.js.map +1 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +7 -32
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/status-registry.d.ts +1 -1
- package/dist/store/status-registry.d.ts.map +1 -1
- package/dist/store/status-registry.js +1 -1
- package/dist/store/status-registry.js.map +1 -1
- package/dist/store/sync/apply/applier.d.ts +119 -0
- package/dist/store/sync/apply/applier.d.ts.map +1 -0
- package/dist/store/sync/apply/applier.js +1239 -0
- package/dist/store/sync/apply/applier.js.map +1 -0
- package/dist/store/sync/apply/fk.d.ts +47 -0
- package/dist/store/sync/apply/fk.d.ts.map +1 -0
- package/dist/store/sync/apply/fk.js +89 -0
- package/dist/store/sync/apply/fk.js.map +1 -0
- package/dist/store/sync/apply/footprints.d.ts +60 -0
- package/dist/store/sync/apply/footprints.d.ts.map +1 -0
- package/dist/store/sync/apply/footprints.js +235 -0
- package/dist/store/sync/apply/footprints.js.map +1 -0
- package/dist/store/sync/apply/frame.d.ts +80 -0
- package/dist/store/sync/apply/frame.d.ts.map +1 -0
- package/dist/store/sync/apply/frame.js +127 -0
- package/dist/store/sync/apply/frame.js.map +1 -0
- package/dist/store/sync/apply/index.d.ts +11 -0
- package/dist/store/sync/apply/index.d.ts.map +1 -0
- package/dist/store/sync/apply/index.js +11 -0
- package/dist/store/sync/apply/index.js.map +1 -0
- package/dist/store/sync/apply/parent-delete.d.ts +38 -0
- package/dist/store/sync/apply/parent-delete.d.ts.map +1 -0
- package/dist/store/sync/apply/parent-delete.js +41 -0
- package/dist/store/sync/apply/parent-delete.js.map +1 -0
- package/dist/store/sync/apply/post-apply.d.ts +67 -0
- package/dist/store/sync/apply/post-apply.d.ts.map +1 -0
- package/dist/store/sync/apply/post-apply.js +118 -0
- package/dist/store/sync/apply/post-apply.js.map +1 -0
- package/dist/store/sync/apply/refs.d.ts +60 -0
- package/dist/store/sync/apply/refs.d.ts.map +1 -0
- package/dist/store/sync/apply/refs.js +90 -0
- package/dist/store/sync/apply/refs.js.map +1 -0
- package/dist/store/sync/apply/write-api.d.ts +195 -0
- package/dist/store/sync/apply/write-api.d.ts.map +1 -0
- package/dist/store/sync/apply/write-api.js +416 -0
- package/dist/store/sync/apply/write-api.js.map +1 -0
- package/dist/store/sync/apply-intent.d.ts +117 -0
- package/dist/store/sync/apply-intent.d.ts.map +1 -0
- package/dist/store/sync/apply-intent.js +225 -0
- package/dist/store/sync/apply-intent.js.map +1 -0
- package/dist/store/sync/capture.d.ts +32 -2
- package/dist/store/sync/capture.d.ts.map +1 -1
- package/dist/store/sync/capture.js +47 -13
- package/dist/store/sync/capture.js.map +1 -1
- package/dist/store/sync/conflicts.d.ts +81 -0
- package/dist/store/sync/conflicts.d.ts.map +1 -0
- package/dist/store/sync/conflicts.js +98 -0
- package/dist/store/sync/conflicts.js.map +1 -0
- package/dist/store/sync/field-leave.d.ts +146 -0
- package/dist/store/sync/field-leave.d.ts.map +1 -0
- package/dist/store/sync/field-leave.js +241 -0
- package/dist/store/sync/field-leave.js.map +1 -0
- package/dist/store/sync/flags.d.ts +119 -0
- package/dist/store/sync/flags.d.ts.map +1 -1
- package/dist/store/sync/flags.js +360 -0
- package/dist/store/sync/flags.js.map +1 -1
- package/dist/store/sync/held.d.ts +197 -0
- package/dist/store/sync/held.d.ts.map +1 -0
- package/dist/store/sync/held.js +314 -0
- package/dist/store/sync/held.js.map +1 -0
- package/dist/store/sync/identity-fill.d.ts.map +1 -1
- package/dist/store/sync/identity-fill.js +10 -2
- package/dist/store/sync/identity-fill.js.map +1 -1
- package/dist/store/sync/inbox.d.ts +114 -0
- package/dist/store/sync/inbox.d.ts.map +1 -0
- package/dist/store/sync/inbox.js +222 -0
- package/dist/store/sync/inbox.js.map +1 -0
- package/dist/store/sync/inherit.d.ts +36 -0
- package/dist/store/sync/inherit.d.ts.map +1 -0
- package/dist/store/sync/inherit.js +38 -0
- package/dist/store/sync/inherit.js.map +1 -0
- package/dist/store/sync/merge/engine.d.ts +114 -0
- package/dist/store/sync/merge/engine.d.ts.map +1 -0
- package/dist/store/sync/merge/engine.js +698 -0
- package/dist/store/sync/merge/engine.js.map +1 -0
- package/dist/store/sync/merge/index.d.ts +11 -0
- package/dist/store/sync/merge/index.d.ts.map +1 -0
- package/dist/store/sync/merge/index.js +11 -0
- package/dist/store/sync/merge/index.js.map +1 -0
- package/dist/store/sync/merge/rules.d.ts +91 -0
- package/dist/store/sync/merge/rules.d.ts.map +1 -0
- package/dist/store/sync/merge/rules.js +151 -0
- package/dist/store/sync/merge/rules.js.map +1 -0
- package/dist/store/sync/merge/types.d.ts +206 -0
- package/dist/store/sync/merge/types.d.ts.map +1 -0
- package/dist/store/sync/merge/types.js +15 -0
- package/dist/store/sync/merge/types.js.map +1 -0
- package/dist/store/sync/migration-hooks.d.ts +47 -0
- package/dist/store/sync/migration-hooks.d.ts.map +1 -0
- package/dist/store/sync/migration-hooks.js +74 -0
- package/dist/store/sync/migration-hooks.js.map +1 -0
- package/dist/store/sync/netting.d.ts +5 -0
- package/dist/store/sync/netting.d.ts.map +1 -1
- package/dist/store/sync/netting.js +29 -2
- package/dist/store/sync/netting.js.map +1 -1
- package/dist/store/sync/remap.d.ts +72 -0
- package/dist/store/sync/remap.d.ts.map +1 -0
- package/dist/store/sync/remap.js +209 -0
- package/dist/store/sync/remap.js.map +1 -0
- package/dist/store/sync/repair.d.ts +180 -0
- package/dist/store/sync/repair.d.ts.map +1 -0
- package/dist/store/sync/repair.js +499 -0
- package/dist/store/sync/repair.js.map +1 -0
- package/dist/store/sync/replica-registry.d.ts +54 -0
- package/dist/store/sync/replica-registry.d.ts.map +1 -1
- package/dist/store/sync/replica-registry.js +72 -2
- package/dist/store/sync/replica-registry.js.map +1 -1
- package/dist/store/sync/replica.d.ts +71 -9
- package/dist/store/sync/replica.d.ts.map +1 -1
- package/dist/store/sync/replica.js +95 -11
- package/dist/store/sync/replica.js.map +1 -1
- package/dist/store/sync/row-meta.d.ts +148 -0
- package/dist/store/sync/row-meta.d.ts.map +1 -0
- package/dist/store/sync/row-meta.js +200 -0
- package/dist/store/sync/row-meta.js.map +1 -0
- package/dist/store/sync/schema.d.ts +13 -5
- package/dist/store/sync/schema.d.ts.map +1 -1
- package/dist/store/sync/schema.js +34 -7
- package/dist/store/sync/schema.js.map +1 -1
- package/dist/store/sync/sealer-values.d.ts.map +1 -1
- package/dist/store/sync/sealer-values.js +1 -0
- package/dist/store/sync/sealer-values.js.map +1 -1
- package/dist/store/sync/sealer.d.ts +96 -0
- package/dist/store/sync/sealer.d.ts.map +1 -1
- package/dist/store/sync/sealer.js +532 -58
- package/dist/store/sync/sealer.js.map +1 -1
- package/dist/store/sync/sequencing.d.ts +175 -0
- package/dist/store/sync/sequencing.d.ts.map +1 -0
- package/dist/store/sync/sequencing.js +295 -0
- package/dist/store/sync/sequencing.js.map +1 -0
- package/dist/store/sync/structural.d.ts +30 -2
- package/dist/store/sync/structural.d.ts.map +1 -1
- package/dist/store/sync/structural.js +64 -2
- package/dist/store/sync/structural.js.map +1 -1
- package/dist/store/sync/timestamp-canon.d.ts +44 -0
- package/dist/store/sync/timestamp-canon.d.ts.map +1 -0
- package/dist/store/sync/timestamp-canon.js +102 -0
- package/dist/store/sync/timestamp-canon.js.map +1 -0
- package/dist/store/sync/timestamps.d.ts +1 -30
- package/dist/store/sync/timestamps.d.ts.map +1 -1
- package/dist/store/sync/timestamps.js +2 -89
- package/dist/store/sync/timestamps.js.map +1 -1
- package/dist/store/sync/trigger-classes.d.ts +8 -0
- package/dist/store/sync/trigger-classes.d.ts.map +1 -1
- package/dist/store/sync/trigger-classes.js +13 -0
- package/dist/store/sync/trigger-classes.js.map +1 -1
- package/dist/store/sync/write-actor.d.ts +58 -0
- package/dist/store/sync/write-actor.d.ts.map +1 -0
- package/dist/store/sync/write-actor.js +67 -0
- package/dist/store/sync/write-actor.js.map +1 -0
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +84 -0
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/task-claim.d.ts +1 -1
- package/dist/store/task-claim.d.ts.map +1 -1
- package/dist/store/task-claim.js +1 -1
- package/dist/store/task-claim.js.map +1 -1
- package/dist/store/task-reference-columns.d.ts +27 -0
- package/dist/store/task-reference-columns.d.ts.map +1 -0
- package/dist/store/task-reference-columns.js +65 -0
- package/dist/store/task-reference-columns.js.map +1 -0
- package/dist/store/task-version.d.ts +1 -1
- package/dist/store/task-version.d.ts.map +1 -1
- package/dist/store/task-version.js +1 -1
- package/dist/store/task-version.js.map +1 -1
- package/dist/store/tasks-schema.d.ts +2 -1
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +5 -4
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +1 -1
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +3 -1
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +43 -14
- package/dist/store/twin-collapse.d.ts.map +1 -1
- package/dist/store/twin-collapse.js +373 -32
- package/dist/store/twin-collapse.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +44 -674
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/store/validation-schemas.js +2 -22
- package/dist/store/validation-schemas.js.map +1 -1
- package/dist/store/vault-manifest.d.ts +1 -1
- package/dist/store/vault-manifest.d.ts.map +1 -1
- package/dist/store/vault-manifest.js +1 -1
- package/dist/store/vault-manifest.js.map +1 -1
- package/dist/store/worktree-build-guard.js +1 -1
- package/dist/store/worktree-build-guard.js.map +1 -1
- package/dist/store/worktree-isolation-guard.js +1 -1
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/store/writer-lease.d.ts.map +1 -1
- package/dist/store/writer-lease.js +1 -11
- package/dist/store/writer-lease.js.map +1 -1
- package/dist/store/zod-schema-factory.d.ts +16 -0
- package/dist/store/zod-schema-factory.d.ts.map +1 -0
- package/dist/store/zod-schema-factory.js +23 -0
- package/dist/store/zod-schema-factory.js.map +1 -0
- package/dist/system/backup.d.ts +106 -0
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +295 -19
- package/dist/system/backup.js.map +1 -1
- package/dist/system/cleanup.js +1 -1
- package/dist/system/cleanup.js.map +1 -1
- package/dist/system/labels.js +1 -1
- package/dist/system/labels.js.map +1 -1
- package/dist/system/migrate.js +1 -1
- package/dist/system/migrate.js.map +1 -1
- package/dist/system/safestop.d.ts.map +1 -1
- package/dist/system/safestop.js +1 -1
- package/dist/system/safestop.js.map +1 -1
- package/dist/task-work/current.d.ts +34 -0
- package/dist/task-work/current.d.ts.map +1 -0
- package/dist/task-work/current.js +34 -0
- package/dist/task-work/current.js.map +1 -0
- package/dist/task-work/index.d.ts +2 -19
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +6 -20
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/ac-identity.d.ts +28 -0
- package/dist/tasks/ac-identity.d.ts.map +1 -0
- package/dist/tasks/ac-identity.js +43 -0
- package/dist/tasks/ac-identity.js.map +1 -0
- package/dist/tasks/ac-immutability.d.ts +1 -1
- package/dist/tasks/ac-immutability.d.ts.map +1 -1
- package/dist/tasks/ac-immutability.js +1 -1
- package/dist/tasks/ac-immutability.js.map +1 -1
- package/dist/tasks/ac-table.d.ts +2 -14
- package/dist/tasks/ac-table.d.ts.map +1 -1
- package/dist/tasks/ac-table.js +6 -29
- package/dist/tasks/ac-table.js.map +1 -1
- package/dist/tasks/acceptance-input.js +1 -1
- package/dist/tasks/acceptance-input.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +3 -1
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +80 -12
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +130 -19
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/archive.d.ts.map +1 -1
- package/dist/tasks/archive.js +1 -1
- package/dist/tasks/archive.js.map +1 -1
- package/dist/tasks/axis-filters.d.ts.map +1 -1
- package/dist/tasks/axis-filters.js +2 -1
- package/dist/tasks/axis-filters.js.map +1 -1
- package/dist/tasks/child-disposition.js +1 -1
- package/dist/tasks/child-disposition.js.map +1 -1
- package/dist/tasks/collection.js +1 -1
- package/dist/tasks/collection.js.map +1 -1
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +2 -1
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/decompose.js +1 -1
- package/dist/tasks/decompose.js.map +1 -1
- package/dist/tasks/delete.js +1 -1
- package/dist/tasks/delete.js.map +1 -1
- package/dist/tasks/done-plan.d.ts +2 -1
- package/dist/tasks/done-plan.d.ts.map +1 -1
- package/dist/tasks/done-plan.js +10 -20
- package/dist/tasks/done-plan.js.map +1 -1
- package/dist/tasks/done-record.d.ts +1 -1
- package/dist/tasks/done-record.d.ts.map +1 -1
- package/dist/tasks/done-record.js +1 -1
- package/dist/tasks/done-record.js.map +1 -1
- package/dist/tasks/enforcement.d.ts +2 -1
- package/dist/tasks/enforcement.d.ts.map +1 -1
- package/dist/tasks/enforcement.js +1 -1
- package/dist/tasks/enforcement.js.map +1 -1
- package/dist/tasks/engine-wrap-ops.js +1 -1
- package/dist/tasks/engine-wrap-ops.js.map +1 -1
- package/dist/tasks/engine-wrap.d.ts.map +1 -1
- package/dist/tasks/engine-wrap.js +7 -3
- package/dist/tasks/engine-wrap.js.map +1 -1
- package/dist/tasks/epic-enforcement.js +1 -1
- package/dist/tasks/epic-enforcement.js.map +1 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +41 -19
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/find.js +1 -1
- package/dist/tasks/find.js.map +1 -1
- package/dist/tasks/gate-result-cache.js +1 -1
- package/dist/tasks/gate-result-cache.js.map +1 -1
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +1 -1
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/heavy-tool-env.d.ts +79 -11
- package/dist/tasks/heavy-tool-env.d.ts.map +1 -1
- package/dist/tasks/heavy-tool-env.js +111 -14
- package/dist/tasks/heavy-tool-env.js.map +1 -1
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +2 -2
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/labels.js +1 -1
- package/dist/tasks/labels.js.map +1 -1
- package/dist/tasks/nexus-impact-gate.js +1 -1
- package/dist/tasks/nexus-impact-gate.js.map +1 -1
- package/dist/tasks/pipeline-stage.js +1 -1
- package/dist/tasks/pipeline-stage.js.map +1 -1
- package/dist/tasks/population.js +1 -1
- package/dist/tasks/population.js.map +1 -1
- package/dist/tasks/ranking-audit.js +1 -1
- package/dist/tasks/ranking-audit.js.map +1 -1
- package/dist/tasks/reconcile-scope.js +1 -1
- package/dist/tasks/reconcile-scope.js.map +1 -1
- package/dist/tasks/relates.js +1 -1
- package/dist/tasks/relates.js.map +1 -1
- package/dist/tasks/req.d.ts.map +1 -1
- package/dist/tasks/req.js +2 -1
- package/dist/tasks/req.js.map +1 -1
- package/dist/tasks/severity-attestation.d.ts +1 -1
- package/dist/tasks/severity-attestation.d.ts.map +1 -1
- package/dist/tasks/severity-attestation.js +1 -1
- package/dist/tasks/severity-attestation.js.map +1 -1
- package/dist/tasks/show.d.ts.map +1 -1
- package/dist/tasks/show.js +47 -3
- package/dist/tasks/show.js.map +1 -1
- package/dist/tasks/task-import.js +1 -1
- package/dist/tasks/task-import.js.map +1 -1
- package/dist/tasks/task-reparent.d.ts.map +1 -1
- package/dist/tasks/task-reparent.js +2 -1
- package/dist/tasks/task-reparent.js.map +1 -1
- package/dist/tasks/test-run-binding.d.ts.map +1 -1
- package/dist/tasks/test-run-binding.js +9 -2
- package/dist/tasks/test-run-binding.js.map +1 -1
- package/dist/tasks/tool-cache.d.ts +23 -8
- package/dist/tasks/tool-cache.d.ts.map +1 -1
- package/dist/tasks/tool-cache.js +57 -16
- package/dist/tasks/tool-cache.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +8 -0
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +15 -1
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-runner-guard.d.ts +131 -0
- package/dist/tasks/tool-runner-guard.d.ts.map +1 -0
- package/dist/tasks/tool-runner-guard.js +141 -0
- package/dist/tasks/tool-runner-guard.js.map +1 -0
- package/dist/tasks/tool-semaphore.d.ts +103 -342
- package/dist/tasks/tool-semaphore.d.ts.map +1 -1
- package/dist/tasks/tool-semaphore.js +131 -619
- package/dist/tasks/tool-semaphore.js.map +1 -1
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +2 -1
- package/dist/tasks/update.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +5 -34
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +24 -0
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +168 -0
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/doctor/index.d.ts +1 -1
- package/dist/validation/doctor/index.d.ts.map +1 -1
- package/dist/validation/doctor/index.js +1 -1
- package/dist/validation/doctor/index.js.map +1 -1
- package/dist/validation/engine-ops.js +1 -1
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/validation/engine.d.ts +1 -1
- package/dist/validation/engine.d.ts.map +1 -1
- package/dist/validation/engine.js +2 -1
- package/dist/validation/engine.js.map +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/operation-gate-validators.js +1 -1
- package/dist/validation/operation-gate-validators.js.map +1 -1
- package/dist/validation/protocol-common.js +1 -1
- package/dist/validation/protocol-common.js.map +1 -1
- package/dist/validation/protocols/_shared.js +1 -1
- package/dist/validation/protocols/_shared.js.map +1 -1
- package/dist/validation/validate-ops.js +1 -1
- package/dist/validation/validate-ops.js.map +1 -1
- package/dist/validation/verification.js +1 -1
- package/dist/validation/verification.js.map +1 -1
- package/dist/workgraph/index.d.ts +1 -1
- package/dist/workgraph/index.d.ts.map +1 -1
- package/dist/workgraph/index.js +1 -1
- package/dist/workgraph/index.js.map +1 -1
- package/dist/workgraph/reparent-preflight.d.ts +1 -2
- package/dist/workgraph/reparent-preflight.d.ts.map +1 -1
- package/dist/workgraph/reparent-preflight.js +1 -1
- package/dist/workgraph/reparent-preflight.js.map +1 -1
- package/dist/workgraph/scaffold-validate.js +1 -1
- package/dist/workgraph/scaffold-validate.js.map +1 -1
- package/dist/worktree/force-unlock.d.ts +1 -1
- package/dist/worktree/force-unlock.d.ts.map +1 -1
- package/dist/worktree/force-unlock.js +1 -1
- package/dist/worktree/force-unlock.js.map +1 -1
- package/dist/worktree/isolation.d.ts +1 -1
- package/dist/worktree/isolation.d.ts.map +1 -1
- package/dist/worktree/isolation.js +1 -1
- package/dist/worktree/isolation.js.map +1 -1
- package/dist/worktree/list.d.ts +1 -1
- package/dist/worktree/list.d.ts.map +1 -1
- package/dist/worktree/list.js +1 -1
- package/dist/worktree/list.js.map +1 -1
- package/dist/worktree/prune.d.ts +1 -1
- package/dist/worktree/prune.d.ts.map +1 -1
- package/dist/worktree/prune.js +1 -1
- package/dist/worktree/prune.js.map +1 -1
- package/dist/worktree/worktree-adopt.d.ts +1 -2
- package/dist/worktree/worktree-adopt.d.ts.map +1 -1
- package/dist/worktree/worktree-adopt.js +1 -1
- package/dist/worktree/worktree-adopt.js.map +1 -1
- package/migrations/sync-journal/20261004120000_t12757-apply-intent/migration.sql +21 -0
- package/migrations/sync-journal/20261005120000_t12344-inbox/migration.sql +67 -0
- package/migrations/sync-journal/20261006120000_t13193-rebase-undo/migration.sql +51 -0
- package/migrations/sync-journal/20261006130000_t13193-rebase-state/migration.sql +17 -0
- package/migrations/sync-journal/20261006140000_t13193-held-rows/migration.sql +24 -0
- package/package.json +13 -13
- package/schemas/project-context.schema.json +14 -0
- package/templates/CLEO-INJECTION.md +11 -11
- package/templates/CLEO-REFERENCE.md +2 -2
- package/templates/workflows/release-prepare.yml.tmpl +10 -10
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure merge engine (T12344; journal spec §1.7, §2.6, §2.9, §3.2, §3.6).
|
|
3
|
+
*
|
|
4
|
+
* {@link applyOp} decides one incoming I, U or D op against the stream-derived
|
|
5
|
+
* state of its row and returns the next state, the row-level effect and the
|
|
6
|
+
* conflicts to record. Receivers apply in stream `seq` order and decide by HLC
|
|
7
|
+
* (§2.9), so every replica that folds the same stream reaches the same state:
|
|
8
|
+
*
|
|
9
|
+
* - **Per-field LWW by HLC.** A column's incoming HLC is `fh[col] ?? h`; it
|
|
10
|
+
* wins when it is greater than the column's stored HLC. LWW is commutative,
|
|
11
|
+
* so plain columns converge whatever the order.
|
|
12
|
+
* - **Groups** merge as one LWW unit and travel whole (T13222): a U op
|
|
13
|
+
* carries every member of a group it touches (the capture trigger records
|
|
14
|
+
* the whole group, subtraction keeps it whole), an I op's omitted members
|
|
15
|
+
* are NULL, and the winner sets every member. A U op carrying part of a
|
|
16
|
+
* group is refused (`malformed`), never half-applied.
|
|
17
|
+
* - **Counters** merge by delta (`sum`: a U carries `{ $inc }` only) or by
|
|
18
|
+
* `max`/`min` (absolute numbers only), never by plain LWW; any other shape
|
|
19
|
+
* is refused (`malformed`), since mixing deltas and absolute values would
|
|
20
|
+
* make the result depend on order.
|
|
21
|
+
* - **Rank-max** (pipeline_stage) is a max over (rank, HLC), with NULL and
|
|
22
|
+
* unranked values lowest, and the winner keeps its own HLC; a restore
|
|
23
|
+
* raises a floor below which writes are dead (T13223). It converges in
|
|
24
|
+
* every order, HLCs included.
|
|
25
|
+
* - **Other typed rules** (absorbing states, frozen-while, write-once) are
|
|
26
|
+
* evaluated against the current state, so where an explicit op races them
|
|
27
|
+
* they depend on stream order and are deterministic for a given stream
|
|
28
|
+
* (§3.5 Rule 1).
|
|
29
|
+
* - **Leave, restore and unfreeze are granted per transaction:** every op of
|
|
30
|
+
* a transaction whose `actor.op` is such a command may use it, on every row
|
|
31
|
+
* the transaction writes. That is deliberate: the command's own cascade
|
|
32
|
+
* (children restored or reopened with their parent) is part of its
|
|
33
|
+
* transaction.
|
|
34
|
+
* - **Deletes:** a D removes a live row whatever its HLC, recording the newer
|
|
35
|
+
* edits it removes. Tombstones never resurrect: an op older than the delete
|
|
36
|
+
* is skipped; a newer update of a deleted row is voided with an
|
|
37
|
+
* `edit-vs-delete` conflict. A newer insert re-creates the row (a
|
|
38
|
+
* natural-key re-add), so a re-insert racing a delete is ORDER-SENSITIVE:
|
|
39
|
+
* deterministic per stream (§3.5 Rule 1), not order-free, since the row
|
|
40
|
+
* state keeps no birth HLC to compare the delete against.
|
|
41
|
+
* - **Conflicts are never dropped:** a concurrent divergent edit (the op's
|
|
42
|
+
* before-image differs from the current value) is recorded whichever side
|
|
43
|
+
* wins, as is every typed-rule refusal or override, rank-max included.
|
|
44
|
+
* - **Schema skew is refused** explicitly: an op naming a column this schema
|
|
45
|
+
* lacks is `refused-schema`, never partly applied ({@link checkSchemaVersion}
|
|
46
|
+
* covers the segment level).
|
|
47
|
+
*
|
|
48
|
+
* K ops are not field merges: the re-key path of the applier handles them.
|
|
49
|
+
*
|
|
50
|
+
* @module store/sync/merge/engine
|
|
51
|
+
* @task T12344
|
|
52
|
+
*/
|
|
53
|
+
import { LEDGER_TXN_VERSION, } from '@cleocode/contracts/ledger';
|
|
54
|
+
import { SYNC_SCHEMA_VERSION } from '@cleocode/contracts/sync-schema.js';
|
|
55
|
+
import { compareHlc, parseHlc } from '../hlc.js';
|
|
56
|
+
import { canonicalJson } from '../sealer-values.js';
|
|
57
|
+
import { UNSEEN_ROW } from './types.js';
|
|
58
|
+
/** A K op reached the field merge, or a spec is inconsistent. */
|
|
59
|
+
export class MergeEngineError extends Error {
|
|
60
|
+
code = 'E_SYNC_MERGE_ENGINE';
|
|
61
|
+
constructor(message) {
|
|
62
|
+
super(message);
|
|
63
|
+
this.name = 'MergeEngineError';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Refuse a segment or transaction written by a newer schema or format (§2.9):
|
|
68
|
+
* a segment `schemaVersion` above {@link SYNC_SCHEMA_VERSION}, or a transaction
|
|
69
|
+
* `v` above {@link LEDGER_TXN_VERSION}. The receiver stages it `refused-schema`
|
|
70
|
+
* and replays it after an upgrade; it is never silently skipped.
|
|
71
|
+
*
|
|
72
|
+
* @param segmentSchemaVersion - The segment's `schemaVersion`.
|
|
73
|
+
* @param txnVersion - The transaction's `v`, when checking one.
|
|
74
|
+
* @returns The refusal, or `null` when this build can apply it.
|
|
75
|
+
*/
|
|
76
|
+
export function checkSchemaVersion(segmentSchemaVersion, txnVersion) {
|
|
77
|
+
if (segmentSchemaVersion > SYNC_SCHEMA_VERSION) {
|
|
78
|
+
return {
|
|
79
|
+
// @sync-invariant none:input-shape a stream payload newer than this build is staged refused-schema before any write
|
|
80
|
+
code: 'E_SCHEMA_AHEAD',
|
|
81
|
+
message: `segment schemaVersion ${segmentSchemaVersion} is newer than this build's ${SYNC_SCHEMA_VERSION}; upgrade CLEO to apply it`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (txnVersion !== undefined && txnVersion > LEDGER_TXN_VERSION) {
|
|
85
|
+
return {
|
|
86
|
+
// @sync-invariant none:input-shape a stream payload newer than this build is staged refused-schema before any write
|
|
87
|
+
code: 'E_SCHEMA_AHEAD',
|
|
88
|
+
message: `transaction format v${txnVersion} is newer than this build's v${LEDGER_TXN_VERSION}; upgrade CLEO to apply it`,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
/** Compare two encoded HLCs. */
|
|
94
|
+
function cmp(a, b) {
|
|
95
|
+
return compareHlc(parseHlc(a), parseHlc(b));
|
|
96
|
+
}
|
|
97
|
+
function maxOf(a, b) {
|
|
98
|
+
if (a === undefined)
|
|
99
|
+
return b;
|
|
100
|
+
if (b === undefined)
|
|
101
|
+
return a;
|
|
102
|
+
return cmp(a, b) >= 0 ? a : b;
|
|
103
|
+
}
|
|
104
|
+
function same(a, b) {
|
|
105
|
+
return canonicalJson(a ?? null) === canonicalJson(b ?? null);
|
|
106
|
+
}
|
|
107
|
+
function isIncrement(v) {
|
|
108
|
+
return typeof v === 'object' && v !== null && '$inc' in v;
|
|
109
|
+
}
|
|
110
|
+
/** A wire value as a number, or null when it is not numeric. */
|
|
111
|
+
function asNumber(v) {
|
|
112
|
+
if (typeof v === 'number')
|
|
113
|
+
return v;
|
|
114
|
+
if (v !== null && typeof v === 'object') {
|
|
115
|
+
if ('$r' in v) {
|
|
116
|
+
const t = v.$r.replace(/^\+?Inf$/, 'Infinity').replace(/^-Inf$/, '-Infinity');
|
|
117
|
+
const n = Number(t);
|
|
118
|
+
return Number.isNaN(n) ? null : n;
|
|
119
|
+
}
|
|
120
|
+
if ('$i' in v)
|
|
121
|
+
return Number(v.$i);
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
function fromNumber(n) {
|
|
126
|
+
return Number.isSafeInteger(n) ? n : { $r: String(n) };
|
|
127
|
+
}
|
|
128
|
+
/** The plain wire value of an after-value (an increment applied to nothing is its delta). */
|
|
129
|
+
function plain(v) {
|
|
130
|
+
return isIncrement(v) ? fromNumber(v.$inc) : v;
|
|
131
|
+
}
|
|
132
|
+
function asString(v) {
|
|
133
|
+
return typeof v === 'string' ? v : null;
|
|
134
|
+
}
|
|
135
|
+
function opFieldHlc(op, col) {
|
|
136
|
+
return op.fh?.[col] ?? op.h;
|
|
137
|
+
}
|
|
138
|
+
/** Validate a spec once per call site: groups never contain counters. */
|
|
139
|
+
function assertSpec(ctx) {
|
|
140
|
+
const counters = ctx.table.counters ?? {};
|
|
141
|
+
for (const g of ctx.table.groups ?? []) {
|
|
142
|
+
for (const c of g) {
|
|
143
|
+
if (c in counters) {
|
|
144
|
+
// @sync-invariant none:input-shape a merge spec is static registry data; an inconsistent one is a programming error
|
|
145
|
+
throw new MergeEngineError(`counter column ${c} cannot be part of a merge group`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/** The units of an op's columns: each group the op touches, and each loose column. */
|
|
151
|
+
function units(ctx, cols) {
|
|
152
|
+
const out = [];
|
|
153
|
+
const seen = new Set();
|
|
154
|
+
for (const c of cols) {
|
|
155
|
+
if (seen.has(c))
|
|
156
|
+
continue;
|
|
157
|
+
const g = (ctx.table.groups ?? []).find((grp) => grp.includes(c));
|
|
158
|
+
if (g) {
|
|
159
|
+
const carried = g.filter((x) => cols.includes(x));
|
|
160
|
+
for (const x of g)
|
|
161
|
+
seen.add(x);
|
|
162
|
+
out.push(carried);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
seen.add(c);
|
|
166
|
+
out.push([c]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return out;
|
|
170
|
+
}
|
|
171
|
+
function conflict(op, kind, columns, resolution, extra = {}) {
|
|
172
|
+
return {
|
|
173
|
+
kind,
|
|
174
|
+
table: op.t,
|
|
175
|
+
uid: op.u,
|
|
176
|
+
columns,
|
|
177
|
+
resolution,
|
|
178
|
+
opHlc: op.h,
|
|
179
|
+
...(extra.rule ? { rule: extra.rule } : {}),
|
|
180
|
+
...(extra.localHlc ? { localHlc: extra.localHlc } : {}),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Apply a counter column's value (§2.6 "Counters"). A `sum` column takes
|
|
185
|
+
* `{ $inc }` deltas, summed (an insert's absolute starting value goes by
|
|
186
|
+
* HLC); a `max`/`min` column takes only absolute numbers and keeps the
|
|
187
|
+
* extreme. Deltas and extremes are commutative, so counters converge in any
|
|
188
|
+
* order and never conflict; {@link malformedColumns} refuses every other
|
|
189
|
+
* shape before the merge.
|
|
190
|
+
*/
|
|
191
|
+
function mergeCounter(d, op, col, mode) {
|
|
192
|
+
const inc = op.a?.[col];
|
|
193
|
+
if (inc === undefined)
|
|
194
|
+
return;
|
|
195
|
+
const cur = d.fields[col];
|
|
196
|
+
const h = opFieldHlc(op, col);
|
|
197
|
+
const curN = asNumber(cur?.value);
|
|
198
|
+
const hlc = maxOf(cur?.hlc, h) ?? h;
|
|
199
|
+
let value;
|
|
200
|
+
if (isIncrement(inc)) {
|
|
201
|
+
value = fromNumber((curN ?? 0) + inc.$inc);
|
|
202
|
+
}
|
|
203
|
+
else if (mode === 'sum') {
|
|
204
|
+
// A concurrent insert's starting value: by HLC, like any field.
|
|
205
|
+
if (cur !== undefined && cmp(h, cur.hlc) <= 0) {
|
|
206
|
+
d.skipped.push({ column: col, reason: 'older' });
|
|
207
|
+
d.older++;
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
value = inc;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
const n = asNumber(inc);
|
|
214
|
+
value =
|
|
215
|
+
curN === null
|
|
216
|
+
? fromNumber(n)
|
|
217
|
+
: fromNumber(mode === 'max' ? Math.max(curN, n) : Math.min(curN, n));
|
|
218
|
+
}
|
|
219
|
+
d.fields[col] = { value, hlc };
|
|
220
|
+
d.written.push(col);
|
|
221
|
+
d.applied++;
|
|
222
|
+
}
|
|
223
|
+
/** The op's columns its merge cannot take: wrong counter shapes, partly carried groups. */
|
|
224
|
+
function malformedColumns(op, ctx) {
|
|
225
|
+
const bad = [];
|
|
226
|
+
const counters = ctx.table.counters ?? {};
|
|
227
|
+
for (const [col, v] of Object.entries(op.a ?? {})) {
|
|
228
|
+
const mode = counters[col];
|
|
229
|
+
if (isIncrement(v)) {
|
|
230
|
+
if (mode !== 'sum')
|
|
231
|
+
bad.push(col);
|
|
232
|
+
}
|
|
233
|
+
else if ((mode === 'sum' && op.o === 'U') ||
|
|
234
|
+
((mode === 'max' || mode === 'min') && asNumber(v) === null)) {
|
|
235
|
+
// An insert carries a sum counter's absolute starting value.
|
|
236
|
+
bad.push(col);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (op.o === 'U') {
|
|
240
|
+
const cols = Object.keys(op.a ?? {});
|
|
241
|
+
for (const g of ctx.table.groups ?? []) {
|
|
242
|
+
const known = g.filter((c) => ctx.table.columns.includes(c));
|
|
243
|
+
if (known.some((c) => cols.includes(c))) {
|
|
244
|
+
for (const c of known)
|
|
245
|
+
if (!cols.includes(c))
|
|
246
|
+
bad.push(c);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return [...new Set(bad)].sort();
|
|
251
|
+
}
|
|
252
|
+
/** Rank of a value in a rank-max order; NULL and unranked values are -1. */
|
|
253
|
+
function rankOf(rule, v) {
|
|
254
|
+
return rule.order.indexOf(asString(v) ?? '\0');
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The alive, non-dominated candidates of a rank-max column after `write`,
|
|
258
|
+
* oldest first (T13223). The current value is ALWAYS a candidate, even when
|
|
259
|
+
* a stored frontier omits it (T13232): a local write changes the row without
|
|
260
|
+
* the merge, and a frontier that dropped it would lose that write and
|
|
261
|
+
* diverge from replicas that folded it.
|
|
262
|
+
*
|
|
263
|
+
* @param rule - The column's rank-max rule.
|
|
264
|
+
* @param cur - The column's current state, or undefined.
|
|
265
|
+
* @param write - The incoming write.
|
|
266
|
+
* @param floor - The restore floor after the write, or undefined.
|
|
267
|
+
* @returns The candidates; the best by (rank, HLC) is the column's value.
|
|
268
|
+
*/
|
|
269
|
+
export function rankMaxFrontier(rule, cur, write, floor) {
|
|
270
|
+
let cands = cur ? [...(cur.frontier ?? [])] : [];
|
|
271
|
+
const add = (c) => {
|
|
272
|
+
if (!cands.some((x) => x.hlc === c.hlc && same(x.value, c.value)))
|
|
273
|
+
cands.push(c);
|
|
274
|
+
};
|
|
275
|
+
// A value a terminal status imposes is not a write (T13243).
|
|
276
|
+
if (cur && !cur.derived)
|
|
277
|
+
add({ value: cur.value, hlc: cur.hlc });
|
|
278
|
+
add(write);
|
|
279
|
+
if (floor !== undefined)
|
|
280
|
+
cands = cands.filter((c) => cmp(c.hlc, floor) >= 0);
|
|
281
|
+
return cands
|
|
282
|
+
.filter((a) => !cands.some((b) => b !== a &&
|
|
283
|
+
rankOf(rule, b.value) >= rankOf(rule, a.value) &&
|
|
284
|
+
cmp(b.hlc, a.hlc) >= 0 &&
|
|
285
|
+
(rankOf(rule, b.value) > rankOf(rule, a.value) || cmp(b.hlc, a.hlc) > 0)))
|
|
286
|
+
.sort((a, b) => cmp(a.hlc, b.hlc));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Merge a rank-max column (T13223): the best alive write by (rank, HLC). A
|
|
290
|
+
* restore raises the floor to its HLC; writes older than the floor are dead.
|
|
291
|
+
* The state keeps the alive Pareto frontier over (rank, HLC), so the result
|
|
292
|
+
* is the same in every order, HLCs included.
|
|
293
|
+
*/
|
|
294
|
+
function mergeRankMax(d, op, col, rule, ctx) {
|
|
295
|
+
const inc = op.a?.[col];
|
|
296
|
+
if (inc === undefined || isIncrement(inc))
|
|
297
|
+
return;
|
|
298
|
+
const cur = d.fields[col];
|
|
299
|
+
const h = opFieldHlc(op, col);
|
|
300
|
+
const restore = rule.restoreOps.includes(ctx.actorOp ?? '');
|
|
301
|
+
const floor = restore ? maxOf(cur?.leave, h) : cur?.leave;
|
|
302
|
+
const value = plain(inc);
|
|
303
|
+
const cands = rankMaxFrontier(rule, cur, { value, hlc: h }, floor);
|
|
304
|
+
const best = cands.reduce((m, c) => {
|
|
305
|
+
if (!m)
|
|
306
|
+
return c;
|
|
307
|
+
const rc = rankOf(rule, c.value) - rankOf(rule, m.value);
|
|
308
|
+
return rc > 0 || (rc === 0 && cmp(c.hlc, m.hlc) > 0) ? c : m;
|
|
309
|
+
}, undefined);
|
|
310
|
+
if (!best)
|
|
311
|
+
return; // unreachable: a restore keeps itself alive
|
|
312
|
+
const next = {
|
|
313
|
+
value: best.value,
|
|
314
|
+
hlc: best.hlc,
|
|
315
|
+
...(floor !== undefined ? { leave: floor } : {}),
|
|
316
|
+
...(cands.length > 1 ? { frontier: cands } : {}),
|
|
317
|
+
};
|
|
318
|
+
const changed = !cur ||
|
|
319
|
+
!same(cur.value, next.value) ||
|
|
320
|
+
cur.hlc !== next.hlc ||
|
|
321
|
+
cur.leave !== next.leave ||
|
|
322
|
+
canonicalJson(cur.frontier ?? null) !== canonicalJson(next.frontier ?? null);
|
|
323
|
+
d.fields[col] = next;
|
|
324
|
+
const won = best.hlc === h && same(best.value, value);
|
|
325
|
+
const newer = cur === undefined || cmp(h, cur.hlc) > 0;
|
|
326
|
+
if (won) {
|
|
327
|
+
d.written.push(col);
|
|
328
|
+
d.applied++;
|
|
329
|
+
if (!newer && cur !== undefined) {
|
|
330
|
+
// The rule picked an older write over a newer one.
|
|
331
|
+
d.conflicts.push(conflict(op, 'typed-rule', [col], 'incoming-applied', { rule: rule.id, localHlc: cur.hlc }));
|
|
332
|
+
}
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (changed && !same(cur?.value, next.value)) {
|
|
336
|
+
// A restore's floor killed the old best; the next best alive write wins.
|
|
337
|
+
d.written.push(col);
|
|
338
|
+
d.applied++;
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
d.skipped.push({ column: col, reason: newer ? 'rule' : 'older' });
|
|
342
|
+
d.older++;
|
|
343
|
+
if (newer && cur !== undefined) {
|
|
344
|
+
d.conflicts.push(conflict(op, 'typed-rule', [col], 'incoming-dropped', { rule: rule.id, localHlc: cur.hlc }));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function ruleVerdict(rule, col, d, base, op, ctx, incomingWins, hi) {
|
|
348
|
+
const actorOp = ctx.actorOp ?? '';
|
|
349
|
+
const cur = d.fields[col];
|
|
350
|
+
const inc = op.a?.[col];
|
|
351
|
+
if (inc === undefined || isIncrement(inc))
|
|
352
|
+
return {};
|
|
353
|
+
switch (rule.kind) {
|
|
354
|
+
case 'absorbing': {
|
|
355
|
+
const curAbs = cur !== undefined && rule.states.includes(asString(cur.value) ?? '\0');
|
|
356
|
+
const incAbs = rule.states.includes(asString(inc) ?? '\0');
|
|
357
|
+
const explicit = rule.leaveOps.includes(actorOp);
|
|
358
|
+
if (curAbs && !incAbs) {
|
|
359
|
+
if (!explicit)
|
|
360
|
+
return { refuse: rule.id };
|
|
361
|
+
return incomingWins ? { leave: hi } : {};
|
|
362
|
+
}
|
|
363
|
+
if (!curAbs && incAbs && !incomingWins) {
|
|
364
|
+
// An absorbing state overrides a newer ordinary edit, unless an
|
|
365
|
+
// explicit leave newer than it produced the current value.
|
|
366
|
+
if (cur?.leave !== undefined && cmp(cur.leave, hi) > 0)
|
|
367
|
+
return {};
|
|
368
|
+
return { force: rule.id };
|
|
369
|
+
}
|
|
370
|
+
return {};
|
|
371
|
+
}
|
|
372
|
+
case 'rank-max':
|
|
373
|
+
return {}; // merged by mergeRankMax
|
|
374
|
+
case 'frozen-while': {
|
|
375
|
+
// Judged against the row before the op: completing a task writes its
|
|
376
|
+
// verification and its status together.
|
|
377
|
+
const guard = asString(base.fields[rule.column]?.value);
|
|
378
|
+
if (guard !== null && rule.values.includes(guard) && !rule.unfreezeOps.includes(actorOp)) {
|
|
379
|
+
if (cur !== undefined && same(cur.value, inc))
|
|
380
|
+
return {};
|
|
381
|
+
return { refuse: rule.id };
|
|
382
|
+
}
|
|
383
|
+
return {};
|
|
384
|
+
}
|
|
385
|
+
case 'write-once': {
|
|
386
|
+
if (cur !== undefined && cur.value !== null && !same(cur.value, inc)) {
|
|
387
|
+
return { refuse: rule.id };
|
|
388
|
+
}
|
|
389
|
+
return {};
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/** Merge the op's after-values into a live row, unit by unit. */
|
|
394
|
+
function mergeFields(d, base, op, ctx) {
|
|
395
|
+
const after = op.a ?? {};
|
|
396
|
+
const counters = ctx.table.counters ?? {};
|
|
397
|
+
const rules = ctx.table.rules ?? {};
|
|
398
|
+
const cols = Object.keys(after).sort();
|
|
399
|
+
for (const unit of units(ctx, cols)) {
|
|
400
|
+
const first = unit[0];
|
|
401
|
+
if (unit.length === 1 && first !== undefined && first in counters) {
|
|
402
|
+
mergeCounter(d, op, first, counters[first]);
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
const only = unit.length === 1 && first !== undefined ? rules[first] : undefined;
|
|
406
|
+
if (first !== undefined && only?.kind === 'rank-max') {
|
|
407
|
+
mergeRankMax(d, op, first, only, ctx);
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
const group = (ctx.table.groups ?? []).find((g) => unit.every((c) => g.includes(c))) ?? unit;
|
|
411
|
+
let hi;
|
|
412
|
+
for (const c of unit)
|
|
413
|
+
hi = maxOf(hi, opFieldHlc(op, c));
|
|
414
|
+
let hl;
|
|
415
|
+
for (const c of group)
|
|
416
|
+
hl = maxOf(hl, d.fields[c]?.hlc);
|
|
417
|
+
const hiv = hi;
|
|
418
|
+
const incomingWins = hl === undefined || cmp(hiv, hl) > 0;
|
|
419
|
+
let refuse;
|
|
420
|
+
let force;
|
|
421
|
+
const leaves = {};
|
|
422
|
+
for (const c of unit) {
|
|
423
|
+
const rule = rules[c];
|
|
424
|
+
if (!rule)
|
|
425
|
+
continue;
|
|
426
|
+
const v = ruleVerdict(rule, c, d, base, op, ctx, incomingWins, hiv);
|
|
427
|
+
if (v.refuse)
|
|
428
|
+
refuse = refuse ?? v.refuse;
|
|
429
|
+
if (v.force)
|
|
430
|
+
force = force ?? v.force;
|
|
431
|
+
if (v.leave)
|
|
432
|
+
leaves[c] = v.leave;
|
|
433
|
+
}
|
|
434
|
+
if (refuse !== undefined) {
|
|
435
|
+
d.conflicts.push(conflict(op, 'typed-rule', unit, 'incoming-dropped', { rule: refuse, localHlc: hl }));
|
|
436
|
+
for (const c of unit)
|
|
437
|
+
d.skipped.push({ column: c, reason: 'rule' });
|
|
438
|
+
d.refused++;
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
const wins = incomingWins || force !== undefined;
|
|
442
|
+
// A concurrent divergent edit: the writer started from another value.
|
|
443
|
+
const divergent = unit.filter((c) => {
|
|
444
|
+
const before = op.b?.[c];
|
|
445
|
+
const cur = d.fields[c]?.value;
|
|
446
|
+
const inc = after[c];
|
|
447
|
+
if (before === undefined || inc === undefined || isIncrement(inc))
|
|
448
|
+
return false;
|
|
449
|
+
return !same(before, cur) && !same(plain(inc), cur);
|
|
450
|
+
});
|
|
451
|
+
if (wins) {
|
|
452
|
+
for (const c of unit) {
|
|
453
|
+
const v = after[c];
|
|
454
|
+
if (v === undefined)
|
|
455
|
+
continue;
|
|
456
|
+
const hlc = opFieldHlc(op, c);
|
|
457
|
+
const prev = d.fields[c];
|
|
458
|
+
// A forced absorbing write keeps its own HLC, so a later absorbing
|
|
459
|
+
// write still wins against it by LWW whatever the stream order.
|
|
460
|
+
const leave = leaves[c] ?? prev?.leave;
|
|
461
|
+
d.fields[c] = { value: plain(v), hlc, ...(leave !== undefined ? { leave } : {}) };
|
|
462
|
+
d.written.push(c);
|
|
463
|
+
}
|
|
464
|
+
d.applied++;
|
|
465
|
+
if (force !== undefined) {
|
|
466
|
+
d.conflicts.push(conflict(op, 'typed-rule', unit, 'incoming-applied', { rule: force, localHlc: hl }));
|
|
467
|
+
}
|
|
468
|
+
else if (divergent.length > 0) {
|
|
469
|
+
d.conflicts.push(conflict(op, 'field', divergent, 'incoming-applied', { localHlc: hl }));
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
for (const c of unit)
|
|
474
|
+
d.skipped.push({ column: c, reason: 'older' });
|
|
475
|
+
d.older++;
|
|
476
|
+
if (divergent.length > 0) {
|
|
477
|
+
d.conflicts.push(conflict(op, 'field', divergent, 'incoming-dropped', { localHlc: hl }));
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
/** The best candidate by (rank, HLC). */
|
|
483
|
+
function bestCandidate(rule, cands) {
|
|
484
|
+
return cands.reduce((m, c) => {
|
|
485
|
+
if (!m)
|
|
486
|
+
return c;
|
|
487
|
+
const rc = rankOf(rule, c.value) - rankOf(rule, m.value);
|
|
488
|
+
return rc > 0 || (rc === 0 && cmp(c.hlc, m.hlc) > 0) ? c : m;
|
|
489
|
+
}, undefined);
|
|
490
|
+
}
|
|
491
|
+
/** Mark a coupled column `derived` when the row's status imposes its value (before the merge). */
|
|
492
|
+
function markDerived(fields, ctx) {
|
|
493
|
+
for (const c of ctx.table.coupled ?? []) {
|
|
494
|
+
const s = asString(fields[c.status]?.value);
|
|
495
|
+
const cur = fields[c.column];
|
|
496
|
+
if (s !== null && c.map[s] !== undefined && cur && same(cur.value, c.map[s])) {
|
|
497
|
+
fields[c.column] = { ...cur, derived: true };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Show the columns a terminal status determines (T13243), as a function of
|
|
503
|
+
* the merged status and the column's candidates: a mapped status imposes its
|
|
504
|
+
* value at the status's HLC, with the real candidates kept in `frontier`; an
|
|
505
|
+
* unmapped status returns the column to its best candidate.
|
|
506
|
+
*/
|
|
507
|
+
function coupleToStatus(d, before, op, ctx) {
|
|
508
|
+
const rules = ctx.table.rules ?? {};
|
|
509
|
+
for (const c of ctx.table.coupled ?? []) {
|
|
510
|
+
// Only after an op that carries the status or the column (whether or not
|
|
511
|
+
// it won): an unrelated write never rewrites the row's stage, and every
|
|
512
|
+
// replica recomputes at the same ops.
|
|
513
|
+
if (!(c.status in (op.a ?? {})) && !(c.column in (op.a ?? {})))
|
|
514
|
+
continue;
|
|
515
|
+
const status = d.fields[c.status];
|
|
516
|
+
const cur = d.fields[c.column];
|
|
517
|
+
const rule = rules[c.column];
|
|
518
|
+
const order = rule?.kind === 'rank-max' ? rule : { order: [] };
|
|
519
|
+
const cands = cur
|
|
520
|
+
? cur.derived
|
|
521
|
+
? [...(cur.frontier ?? [])]
|
|
522
|
+
: [...(cur.frontier ?? [{ value: cur.value, hlc: cur.hlc }])]
|
|
523
|
+
: [];
|
|
524
|
+
const s = asString(status?.value);
|
|
525
|
+
const want = s !== null ? c.map[s] : undefined;
|
|
526
|
+
let next;
|
|
527
|
+
if (status && want !== undefined) {
|
|
528
|
+
next = {
|
|
529
|
+
value: want,
|
|
530
|
+
hlc: status.hlc,
|
|
531
|
+
...(cur?.leave !== undefined ? { leave: cur.leave } : {}),
|
|
532
|
+
...(cands.length > 0 ? { frontier: cands } : {}),
|
|
533
|
+
derived: true,
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
else if (cur?.derived) {
|
|
537
|
+
const best = bestCandidate(order, cands);
|
|
538
|
+
next = best
|
|
539
|
+
? {
|
|
540
|
+
value: best.value,
|
|
541
|
+
hlc: best.hlc,
|
|
542
|
+
...(cur.leave !== undefined ? { leave: cur.leave } : {}),
|
|
543
|
+
...(cands.length > 1 ? { frontier: cands } : {}),
|
|
544
|
+
}
|
|
545
|
+
: {
|
|
546
|
+
value: cur.value,
|
|
547
|
+
hlc: cur.hlc,
|
|
548
|
+
...(cur.leave !== undefined ? { leave: cur.leave } : {}),
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
if (!next)
|
|
552
|
+
continue;
|
|
553
|
+
d.fields[c.column] = next;
|
|
554
|
+
const was = before.fields[c.column];
|
|
555
|
+
if (!was || !same(was.value, next.value)) {
|
|
556
|
+
if (!d.written.includes(c.column))
|
|
557
|
+
d.written.push(c.column);
|
|
558
|
+
d.applied++;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function outcome(status, next, effect, d, unknownColumns) {
|
|
563
|
+
return {
|
|
564
|
+
status,
|
|
565
|
+
next,
|
|
566
|
+
effect,
|
|
567
|
+
written: d?.written ?? [],
|
|
568
|
+
skipped: d?.skipped ?? [],
|
|
569
|
+
conflicts: d?.conflicts ?? [],
|
|
570
|
+
...(unknownColumns ? { unknownColumns } : {}),
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
function newDraft(row) {
|
|
574
|
+
return {
|
|
575
|
+
fields: { ...row.fields },
|
|
576
|
+
written: [],
|
|
577
|
+
skipped: [],
|
|
578
|
+
conflicts: [],
|
|
579
|
+
refused: 0,
|
|
580
|
+
applied: 0,
|
|
581
|
+
older: 0,
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* The op with every merge group whole: an I omits NULL columns, so a group
|
|
586
|
+
* member it leaves out is NULL.
|
|
587
|
+
*/
|
|
588
|
+
function withWholeGroups(op, ctx) {
|
|
589
|
+
if (op.o !== 'I')
|
|
590
|
+
return op;
|
|
591
|
+
const a = { ...(op.a ?? {}) };
|
|
592
|
+
for (const g of ctx.table.groups ?? []) {
|
|
593
|
+
for (const c of g)
|
|
594
|
+
if (ctx.table.columns.includes(c) && !(c in a))
|
|
595
|
+
a[c] = null;
|
|
596
|
+
}
|
|
597
|
+
return { ...op, a };
|
|
598
|
+
}
|
|
599
|
+
/** A fresh row from an insert's after-values. */
|
|
600
|
+
function inserted(op) {
|
|
601
|
+
const fields = {};
|
|
602
|
+
for (const [c, v] of Object.entries(op.a ?? {})) {
|
|
603
|
+
fields[c] = { value: plain(v), hlc: opFieldHlc(op, c) };
|
|
604
|
+
}
|
|
605
|
+
return { live: true, tombstone: null, fields };
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Decide one incoming op against the stream-derived state of its row.
|
|
609
|
+
*
|
|
610
|
+
* @param row - The row's state at the op's stream position.
|
|
611
|
+
* @param op - An I, U or D op (K ops go through the re-key path).
|
|
612
|
+
* @param ctx - The table's merge spec and the transaction's `actor.op`.
|
|
613
|
+
* @returns The next state, the row-level effect, written and skipped columns,
|
|
614
|
+
* and every conflict to record.
|
|
615
|
+
* @throws {MergeEngineError} On a K op or an inconsistent spec.
|
|
616
|
+
*
|
|
617
|
+
* @example
|
|
618
|
+
* ```ts
|
|
619
|
+
* const out = applyOp(row, op, { table: spec, actorOp: txn.actor?.op });
|
|
620
|
+
* if (out.status === 'refused-schema') stage('refused-schema');
|
|
621
|
+
* ```
|
|
622
|
+
*/
|
|
623
|
+
export function applyOp(row, incoming, ctx) {
|
|
624
|
+
const op = withWholeGroups(incoming, ctx);
|
|
625
|
+
if (op.o === 'K') {
|
|
626
|
+
// @sync-invariant none:input-shape K ops are applied by the re-key path; the field merge never receives one
|
|
627
|
+
throw new MergeEngineError('K ops are applied by the re-key path, not the field merge');
|
|
628
|
+
}
|
|
629
|
+
assertSpec(ctx);
|
|
630
|
+
const known = new Set(ctx.table.columns);
|
|
631
|
+
const unknown = Object.keys(op.a ?? {}).filter((c) => !known.has(c));
|
|
632
|
+
if (unknown.length > 0)
|
|
633
|
+
return outcome('refused-schema', row, 'none', undefined, unknown);
|
|
634
|
+
const malformed = malformedColumns(op, ctx);
|
|
635
|
+
if (malformed.length > 0) {
|
|
636
|
+
return { ...outcome('refused-schema', row, 'none'), malformed };
|
|
637
|
+
}
|
|
638
|
+
if (op.o === 'D') {
|
|
639
|
+
if (row.live) {
|
|
640
|
+
const d = newDraft(row);
|
|
641
|
+
const newer = Object.entries(row.fields)
|
|
642
|
+
.filter(([, f]) => cmp(f.hlc, op.h) > 0)
|
|
643
|
+
.map(([c]) => c)
|
|
644
|
+
.sort();
|
|
645
|
+
if (newer.length > 0) {
|
|
646
|
+
let lh;
|
|
647
|
+
for (const c of newer)
|
|
648
|
+
lh = maxOf(lh, row.fields[c]?.hlc);
|
|
649
|
+
d.conflicts.push(conflict(op, 'delete-vs-edit', newer, 'row-deleted', { localHlc: lh }));
|
|
650
|
+
}
|
|
651
|
+
return outcome('applied', { live: false, tombstone: op.h, fields: {} }, 'delete', d);
|
|
652
|
+
}
|
|
653
|
+
if (row.tombstone !== null) {
|
|
654
|
+
const t = maxOf(row.tombstone, op.h) ?? op.h;
|
|
655
|
+
return outcome('skipped', { live: false, tombstone: t, fields: {} }, 'none');
|
|
656
|
+
}
|
|
657
|
+
return outcome('applied', { live: false, tombstone: op.h, fields: {} }, 'tombstone');
|
|
658
|
+
}
|
|
659
|
+
if (!row.live) {
|
|
660
|
+
if (row.tombstone !== null && cmp(op.h, row.tombstone) <= 0) {
|
|
661
|
+
// Older than the delete: never resurrect.
|
|
662
|
+
return outcome('skipped', row, 'none');
|
|
663
|
+
}
|
|
664
|
+
if (op.o === 'I') {
|
|
665
|
+
const fresh = inserted(op);
|
|
666
|
+
const d = newDraft(fresh);
|
|
667
|
+
d.written.push(...Object.keys(fresh.fields).sort());
|
|
668
|
+
// A terminal status fixes the stage on a fresh row too (a legacy repair
|
|
669
|
+
// insert of done/testing would otherwise fail T877 everywhere).
|
|
670
|
+
coupleToStatus(d, UNSEEN_ROW, op, ctx);
|
|
671
|
+
const next = { live: true, tombstone: null, fields: d.fields };
|
|
672
|
+
return outcome('applied', next, 'insert', d);
|
|
673
|
+
}
|
|
674
|
+
if (row.tombstone !== null) {
|
|
675
|
+
const d = newDraft(row);
|
|
676
|
+
d.conflicts.push(conflict(op, 'edit-vs-delete', Object.keys(op.a ?? {}).sort(), 'op-voided', {
|
|
677
|
+
localHlc: row.tombstone,
|
|
678
|
+
}));
|
|
679
|
+
return outcome('void', row, 'none', d);
|
|
680
|
+
}
|
|
681
|
+
return outcome('pending', row, 'none');
|
|
682
|
+
}
|
|
683
|
+
// A live row: I (same-uid concurrent insert) and U merge field by field.
|
|
684
|
+
const d = newDraft(row);
|
|
685
|
+
markDerived(d.fields, ctx);
|
|
686
|
+
mergeFields(d, row, op, ctx);
|
|
687
|
+
coupleToStatus(d, row, op, ctx);
|
|
688
|
+
const next = { live: true, tombstone: null, fields: d.fields };
|
|
689
|
+
const status = d.applied > 0
|
|
690
|
+
? d.refused > 0 || d.older > 0
|
|
691
|
+
? 'partial'
|
|
692
|
+
: 'applied'
|
|
693
|
+
: d.refused > 0
|
|
694
|
+
? 'void'
|
|
695
|
+
: 'skipped';
|
|
696
|
+
return outcome(status, next, d.written.length > 0 ? 'update' : 'none', d);
|
|
697
|
+
}
|
|
698
|
+
//# sourceMappingURL=engine.js.map
|