@cleocode/core 2026.10.4 → 2026.10.5
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 @@
|
|
|
1
|
+
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../../src/store/sync/repair.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAwB,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAA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one.
|
|
20
20
|
*
|
|
21
|
+
* A replica this device retired at the same path (a replaced or rolled-back
|
|
22
|
+
* file; a copy retires nothing) keeps its entry with `retiredAt`, `successor`,
|
|
23
|
+
* the rebind reason and its hwm: those entries are the retire candidates the
|
|
24
|
+
* signed `retire` transaction of S4 announces (§1.5 "Retirement"; T13109).
|
|
25
|
+
*
|
|
21
26
|
* @task T12342
|
|
27
|
+
* @task T13109
|
|
22
28
|
* @module store/sync/replica-registry
|
|
23
29
|
*/
|
|
24
30
|
/** One replica this device has bound. */
|
|
@@ -35,8 +41,29 @@ export interface ReplicaRegistryEntry {
|
|
|
35
41
|
readonly retiredAt?: string;
|
|
36
42
|
/** The replica that replaced it. */
|
|
37
43
|
readonly successor?: string;
|
|
44
|
+
/** Why it was retired: the rebind reason(s), e.g. `vault-restore` or `file-identity`. */
|
|
45
|
+
readonly retireReason?: string;
|
|
46
|
+
/** When S4's signed `retire` transaction announced it; unset while it is still a candidate. */
|
|
47
|
+
readonly retireAnnouncedAt?: string;
|
|
38
48
|
readonly updatedAt: string;
|
|
39
49
|
}
|
|
50
|
+
/** A replica this device retired, as the registry records it. */
|
|
51
|
+
export interface RetiredReplica {
|
|
52
|
+
readonly replicaId: string;
|
|
53
|
+
/** `project` or `global`. */
|
|
54
|
+
readonly scope: string;
|
|
55
|
+
/** Real path of the store file it named. */
|
|
56
|
+
readonly dbRealpath: string;
|
|
57
|
+
/** The replica that replaced it. */
|
|
58
|
+
readonly successor: string;
|
|
59
|
+
readonly retiredAt: string;
|
|
60
|
+
/** The rebind reason(s), or `null` for an entry retired before reasons were recorded. */
|
|
61
|
+
readonly reason: string | null;
|
|
62
|
+
/** Its last persisted `replicaSeq` per stream: what a `retire` transaction names. */
|
|
63
|
+
readonly lastReplicaSeq: Readonly<Record<string, number>>;
|
|
64
|
+
/** When S4 announced it, or `null` while it is a candidate. */
|
|
65
|
+
readonly announcedAt: string | null;
|
|
66
|
+
}
|
|
40
67
|
/** The registry file. */
|
|
41
68
|
export interface ReplicaRegistryFile {
|
|
42
69
|
readonly version: 1;
|
|
@@ -81,5 +108,32 @@ export declare class ReplicaRegistry {
|
|
|
81
108
|
* @returns Whether the file changed.
|
|
82
109
|
*/
|
|
83
110
|
advanceHwm(replicaId: string, stream: string, seq: number, now?: Date): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* The replicas this device retired, newest first, optionally only those of
|
|
113
|
+
* one store file or scope.
|
|
114
|
+
*
|
|
115
|
+
* @param filter - Store real path and/or scope to keep.
|
|
116
|
+
* @returns The retired entries.
|
|
117
|
+
*/
|
|
118
|
+
retired(filter?: {
|
|
119
|
+
dbRealpath?: string;
|
|
120
|
+
scope?: string;
|
|
121
|
+
}): RetiredReplica[];
|
|
122
|
+
/**
|
|
123
|
+
* The retire candidates: retired replicas no `retire` transaction has
|
|
124
|
+
* announced yet. S4's emitter announces each (retired id, successor, last
|
|
125
|
+
* `replicaSeq`) and records `retireAnnouncedAt` (§1.5 "Retirement").
|
|
126
|
+
*
|
|
127
|
+
* @returns The candidates, newest first.
|
|
128
|
+
*/
|
|
129
|
+
retireCandidates(): RetiredReplica[];
|
|
84
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* This device's registry for reading only: `null` when the machine has no
|
|
133
|
+
* stable device id yet. Unlike `getStableDeviceId`, it never mints one, so a
|
|
134
|
+
* read-only command writes nothing.
|
|
135
|
+
*
|
|
136
|
+
* @returns The registry, or `null`.
|
|
137
|
+
*/
|
|
138
|
+
export declare function readDeviceRegistry(): ReplicaRegistry | null;
|
|
85
139
|
//# sourceMappingURL=replica-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica-registry.d.ts","sourceRoot":"","sources":["../../../src/store/sync/replica-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"replica-registry.d.ts","sourceRoot":"","sources":["../../../src/store/sync/replica-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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H,gBAAgB,IAAI,cAAc,EAAE;CAGrC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAQ3D"}
|
|
@@ -18,13 +18,19 @@
|
|
|
18
18
|
* Writes use the file-then-rename pattern, so a crash leaves the old or the
|
|
19
19
|
* new file, never a torn one.
|
|
20
20
|
*
|
|
21
|
+
* A replica this device retired at the same path (a replaced or rolled-back
|
|
22
|
+
* file; a copy retires nothing) keeps its entry with `retiredAt`, `successor`,
|
|
23
|
+
* the rebind reason and its hwm: those entries are the retire candidates the
|
|
24
|
+
* signed `retire` transaction of S4 announces (§1.5 "Retirement"; T13109).
|
|
25
|
+
*
|
|
21
26
|
* @task T12342
|
|
27
|
+
* @task T13109
|
|
22
28
|
* @module store/sync/replica-registry
|
|
23
29
|
*/
|
|
24
30
|
import { randomBytes } from 'node:crypto';
|
|
25
31
|
import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
26
32
|
import { dirname } from 'node:path';
|
|
27
|
-
import { resolveSyncReplicaRegistryPath } from '@cleocode/paths';
|
|
33
|
+
import { resolveStableDeviceIdPath, resolveSyncReplicaRegistryPath } from '@cleocode/paths';
|
|
28
34
|
/** Reads and writes one device's registry file. */
|
|
29
35
|
export class ReplicaRegistry {
|
|
30
36
|
path;
|
|
@@ -85,6 +91,7 @@ export class ReplicaRegistry {
|
|
|
85
91
|
}
|
|
86
92
|
catch (err) {
|
|
87
93
|
rmSync(tmp, { force: true });
|
|
94
|
+
// @sync-invariant none:local-only a device-registry write failure is rethrown; the registry file is machine-local
|
|
88
95
|
throw err;
|
|
89
96
|
}
|
|
90
97
|
}
|
|
@@ -107,6 +114,10 @@ export class ReplicaRegistry {
|
|
|
107
114
|
hwm,
|
|
108
115
|
...(patch.retiredAt !== undefined ? { retiredAt: patch.retiredAt } : {}),
|
|
109
116
|
...(patch.successor !== undefined ? { successor: patch.successor } : {}),
|
|
117
|
+
...(patch.retireReason !== undefined ? { retireReason: patch.retireReason } : {}),
|
|
118
|
+
...(patch.retireAnnouncedAt !== undefined
|
|
119
|
+
? { retireAnnouncedAt: patch.retireAnnouncedAt }
|
|
120
|
+
: {}),
|
|
110
121
|
updatedAt: prev?.updatedAt ?? now.toISOString(),
|
|
111
122
|
};
|
|
112
123
|
if (prev && sameEntry(prev, next))
|
|
@@ -128,10 +139,67 @@ export class ReplicaRegistry {
|
|
|
128
139
|
advanceHwm(replicaId, stream, seq, now = new Date()) {
|
|
129
140
|
const prev = this.get(replicaId);
|
|
130
141
|
if (!prev) {
|
|
142
|
+
// @sync-invariant none:local-only the device registry has no entry for this replica; machine-local bookkeeping
|
|
131
143
|
throw new Error(`replica ${replicaId} is not registered on device ${this.deviceId}`);
|
|
132
144
|
}
|
|
133
145
|
return this.upsert(replicaId, { ...prev, hwm: { [stream]: seq } }, now);
|
|
134
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* The replicas this device retired, newest first, optionally only those of
|
|
149
|
+
* one store file or scope.
|
|
150
|
+
*
|
|
151
|
+
* @param filter - Store real path and/or scope to keep.
|
|
152
|
+
* @returns The retired entries.
|
|
153
|
+
*/
|
|
154
|
+
retired(filter = {}) {
|
|
155
|
+
const out = [];
|
|
156
|
+
for (const [replicaId, e] of Object.entries(this.read().replicas)) {
|
|
157
|
+
if (!e.retiredAt || !e.successor)
|
|
158
|
+
continue;
|
|
159
|
+
if (filter.dbRealpath !== undefined && e.dbRealpath !== filter.dbRealpath)
|
|
160
|
+
continue;
|
|
161
|
+
if (filter.scope !== undefined && e.scope !== filter.scope)
|
|
162
|
+
continue;
|
|
163
|
+
out.push({
|
|
164
|
+
replicaId,
|
|
165
|
+
scope: e.scope,
|
|
166
|
+
dbRealpath: e.dbRealpath,
|
|
167
|
+
successor: e.successor,
|
|
168
|
+
retiredAt: e.retiredAt,
|
|
169
|
+
reason: e.retireReason ?? null,
|
|
170
|
+
lastReplicaSeq: e.hwm,
|
|
171
|
+
announcedAt: e.retireAnnouncedAt ?? null,
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return out.sort((a, b) => (a.retiredAt < b.retiredAt ? 1 : a.retiredAt > b.retiredAt ? -1 : 0));
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The retire candidates: retired replicas no `retire` transaction has
|
|
178
|
+
* announced yet. S4's emitter announces each (retired id, successor, last
|
|
179
|
+
* `replicaSeq`) and records `retireAnnouncedAt` (§1.5 "Retirement").
|
|
180
|
+
*
|
|
181
|
+
* @returns The candidates, newest first.
|
|
182
|
+
*/
|
|
183
|
+
retireCandidates() {
|
|
184
|
+
return this.retired().filter((r) => r.announcedAt === null);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* This device's registry for reading only: `null` when the machine has no
|
|
189
|
+
* stable device id yet. Unlike `getStableDeviceId`, it never mints one, so a
|
|
190
|
+
* read-only command writes nothing.
|
|
191
|
+
*
|
|
192
|
+
* @returns The registry, or `null`.
|
|
193
|
+
*/
|
|
194
|
+
export function readDeviceRegistry() {
|
|
195
|
+
let deviceId;
|
|
196
|
+
try {
|
|
197
|
+
deviceId = readFileSync(resolveStableDeviceIdPath(), 'utf8').trim();
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
return deviceId.length > 0 ? ReplicaRegistry.forDevice(deviceId) : null;
|
|
135
203
|
}
|
|
136
204
|
function sameEntry(a, b) {
|
|
137
205
|
const keys = new Set([...Object.keys(a.hwm), ...Object.keys(b.hwm)]);
|
|
@@ -142,6 +210,8 @@ function sameEntry(a, b) {
|
|
|
142
210
|
a.scope === b.scope &&
|
|
143
211
|
a.dbRealpath === b.dbRealpath &&
|
|
144
212
|
a.retiredAt === b.retiredAt &&
|
|
145
|
-
a.successor === b.successor
|
|
213
|
+
a.successor === b.successor &&
|
|
214
|
+
a.retireReason === b.retireReason &&
|
|
215
|
+
a.retireAnnouncedAt === b.retireAnnouncedAt);
|
|
146
216
|
}
|
|
147
217
|
//# sourceMappingURL=replica-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica-registry.js","sourceRoot":"","sources":["../../../src/store/sync/replica-registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"replica-registry.js","sourceRoot":"","sources":["../../../src/store/sync/replica-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAgD5F,mDAAmD;AACnD,MAAM,OAAO,eAAe;IAMf;IACA;IANX;;;OAGG;IACH,YACW,IAAY,EACZ,QAAgB;QADhB,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAQ;IACxB,CAAC;IAEJ,yDAAyD;IACzD,MAAM,CAAC,SAAS,CAAC,QAAgB;QAC/B,OAAO,IAAI,eAAe,CAAC,8BAA8B,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;IACjF,CAAC;IAEO,KAAK;QACX,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACH,IAAI;QACF,IAAI,GAAW,CAAC;QAChB,IAAI,CAAC;YACH,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;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BAAiB,KAAK,CAAC,CAAC,iBAAiB,CAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
* behind that; S4 reports it through {@link rebindReplica}.
|
|
26
26
|
*
|
|
27
27
|
* A rebind retires the old row, mints a new replica id and nonce, carries the
|
|
28
|
-
* clock forward,
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* clock forward, marks the old replica's live captures and sealed
|
|
29
|
+
* transactions `inherited` (T12753, {@link markInheritedRows}), and runs the
|
|
30
|
+
* registered {@link RebindHook}s in the same transaction. Discarding the pull
|
|
31
|
+
* cursor, pausing push, the reconcile and the signed retire transaction
|
|
32
|
+
* arrive with those tables (S4); they plug in as hooks.
|
|
32
33
|
*
|
|
33
34
|
* {@link syncOpenPass} is behind the store-level `sync.*` flags: with every
|
|
34
35
|
* flag off it reads and writes nothing. The one exception is
|
|
@@ -57,7 +58,14 @@ export type RebindReason = 'file-identity' | 'foreign-device' | 'nonce-mismatch'
|
|
|
57
58
|
* re-enrolled this machine: the server never re-pins a replica, so the
|
|
58
59
|
* store takes a new id (device contract §3.7, R6).
|
|
59
60
|
*/
|
|
60
|
-
| 'device-reenrolled'
|
|
61
|
+
| 'device-reenrolled'
|
|
62
|
+
/**
|
|
63
|
+
* A vault restore or pull placed a snapshot at this store's path: a new
|
|
64
|
+
* file holding another device's data, or this store rolled back (§1.5
|
|
65
|
+
* rules 1 and 3). The old replica is retired at the same path, so it is a
|
|
66
|
+
* retire candidate for S4, unlike a copy (T13109).
|
|
67
|
+
*/
|
|
68
|
+
| 'vault-restore';
|
|
61
69
|
/** What `stat` reports about a store file, in nanoseconds. */
|
|
62
70
|
export interface FileStat {
|
|
63
71
|
readonly ino: bigint;
|
|
@@ -92,9 +100,10 @@ export interface RebindContext {
|
|
|
92
100
|
readonly reasons: readonly RebindReason[];
|
|
93
101
|
}
|
|
94
102
|
/**
|
|
95
|
-
* Runs inside the rebind transaction, after the new replica is bound
|
|
96
|
-
*
|
|
97
|
-
* push. A throw rolls the
|
|
103
|
+
* Runs inside the rebind transaction, after the new replica is bound and the
|
|
104
|
+
* old replica's outbox rows are marked inherited. S4 registers the hooks that
|
|
105
|
+
* mark unpushed segments, discard the cursor and pause push. A throw rolls the
|
|
106
|
+
* whole rebind back.
|
|
98
107
|
*/
|
|
99
108
|
export type RebindHook = (db: DatabaseSync, ctx: RebindContext) => void;
|
|
100
109
|
/**
|
|
@@ -222,16 +231,69 @@ export declare function ensureGlobalReplica(db: DatabaseSync, opts: Omit<SyncOpe
|
|
|
222
231
|
replicaId: string;
|
|
223
232
|
reboundFrom?: string;
|
|
224
233
|
};
|
|
234
|
+
/** Options of {@link rebindReplica}. */
|
|
235
|
+
export interface RebindReplicaOptions {
|
|
236
|
+
/**
|
|
237
|
+
* Record the retired replica as a retire candidate in the device registry
|
|
238
|
+
* (default `true`). Even then it is recorded only when it was this device's
|
|
239
|
+
* own replica of this file: registered here at this path with this nonce,
|
|
240
|
+
* or, when the registry lost it, bound by this device (T13109 review MED-1).
|
|
241
|
+
*/
|
|
242
|
+
readonly recordRetirement?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* The caller proved the store file is the one this replica was bound to
|
|
245
|
+
* (the vault compares the replaced file's identity), so a registry entry
|
|
246
|
+
* at another path is this file after a rename: the nonce must still match,
|
|
247
|
+
* the path need not, and the entry moves to this path (review LOW-A).
|
|
248
|
+
*/
|
|
249
|
+
readonly identityProven?: boolean;
|
|
250
|
+
}
|
|
225
251
|
/**
|
|
226
252
|
* Force a rebind of a bound store: the hook S4 uses when the server answers a
|
|
227
253
|
* push with "seq exists, hash differs" (N6: the server hwm is authoritative).
|
|
228
254
|
*
|
|
229
255
|
* @throws {Error} When the store has no active replica.
|
|
230
256
|
*/
|
|
231
|
-
export declare function rebindReplica(db: DatabaseSync, opts: SyncOpenOptions, reason?: RebindReason): {
|
|
257
|
+
export declare function rebindReplica(db: DatabaseSync, opts: SyncOpenOptions, reason?: RebindReason, rebindOpts?: RebindReplicaOptions): {
|
|
232
258
|
replicaId: string;
|
|
233
259
|
previousReplicaId: string;
|
|
234
260
|
};
|
|
261
|
+
/** What {@link rebindAfterVaultRestore} did. */
|
|
262
|
+
export interface VaultRestoreRebind {
|
|
263
|
+
readonly replicaId: string;
|
|
264
|
+
readonly previousReplicaId: string;
|
|
265
|
+
/**
|
|
266
|
+
* `vault-restore` when the retired replica was this device's replica of the
|
|
267
|
+
* file the snapshot replaced (a retire candidate); otherwise the open-pass
|
|
268
|
+
* reason the store carried anyway: `foreign-device` (another device bound
|
|
269
|
+
* it) or `file-identity` (a copy, bound to another file).
|
|
270
|
+
*/
|
|
271
|
+
readonly reason: Extract<RebindReason, 'vault-restore' | 'foreign-device' | 'file-identity'>;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* After a vault restore or pull placed a snapshot at `dbPath`, retire the
|
|
275
|
+
* store's replica and bind a new one. The placed file is a new store instance
|
|
276
|
+
* (another device's data, or this store rolled back), so it may not continue
|
|
277
|
+
* the old replica's `replicaSeq` stream (§1.5 rules 1 and 3, N6). Rebinding
|
|
278
|
+
* here, before any open pass sees the new inode, records why; the server keeps
|
|
279
|
+
* the retired replica as history until S4 announces its retirement (T13109).
|
|
280
|
+
*
|
|
281
|
+
* The retired replica is recorded as `vault-restore` (a retire candidate) only
|
|
282
|
+
* when it was bound to the file the snapshot replaced (`before`) by this
|
|
283
|
+
* device. A store that was itself a copy (bound to another file) or came from
|
|
284
|
+
* another device is rebound for that reason, `file-identity` or
|
|
285
|
+
* `foreign-device`, and retires nothing (review MED-1).
|
|
286
|
+
*
|
|
287
|
+
* A store with no bound replica (a project restored onto this machine for the
|
|
288
|
+
* first time) is left alone: its first link binds it.
|
|
289
|
+
*
|
|
290
|
+
* @param dbPath - The placed `cleo.db`.
|
|
291
|
+
* @param scope - Which store it is.
|
|
292
|
+
* @param before - The identity of the file at `dbPath` before the placement, or `null` when there was none.
|
|
293
|
+
* @param opts - Device id, registry, stat and clock overrides (tests).
|
|
294
|
+
* @returns What was rebound, or `null` when the store had no replica.
|
|
295
|
+
*/
|
|
296
|
+
export declare function rebindAfterVaultRestore(dbPath: string, scope: ReplicaScope, before: FileIdentity | null, opts?: Pick<SyncOpenOptions, 'deviceId' | 'registry' | 'stat' | 'now'>): Promise<VaultRestoreRebind | null>;
|
|
235
297
|
/** The current clock of the store's active replica, for diagnostics. Read-only. */
|
|
236
298
|
export declare function currentClock(db: DatabaseSync, scope: ReplicaScope): string | undefined;
|
|
237
299
|
//# sourceMappingURL=replica.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replica.d.ts","sourceRoot":"","sources":["../../../src/store/sync/replica.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"replica.d.ts","sourceRoot":"","sources":["../../../src/store/sync/replica.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhD,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGnF,gCAAgC;AAChC,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEnD,+BAA+B;AAC/B,MAAM,MAAM,YAAY,GACpB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,UAAU,GACV,qBAAqB;AACvB;;;;GAIG;GACD,mBAAmB;AACrB;;;;;GAKG;GACD,eAAe,CAAC;AAEpB,8DAA8D;AAC9D,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;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G;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,YAAY,EAChB,IAAI,EAAE,eAAe,EACrB,MAAM,GAAE,YAAoC,EAC5C,UAAU,GAAE,oBAAyB,GACpC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAwClD;AAED,gDAAgD;AAChD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,eAAe,GAAG,gBAAgB,GAAG,eAAe,CAAC,CAAC;CAC9F;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,IAAI,GAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,CAAM,GACzE,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAwBpC;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAItF"}
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
* behind that; S4 reports it through {@link rebindReplica}.
|
|
26
26
|
*
|
|
27
27
|
* A rebind retires the old row, mints a new replica id and nonce, carries the
|
|
28
|
-
* clock forward,
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* clock forward, marks the old replica's live captures and sealed
|
|
29
|
+
* transactions `inherited` (T12753, {@link markInheritedRows}), and runs the
|
|
30
|
+
* registered {@link RebindHook}s in the same transaction. Discarding the pull
|
|
31
|
+
* cursor, pausing push, the reconcile and the signed retire transaction
|
|
32
|
+
* arrive with those tables (S4); they plug in as hooks.
|
|
32
33
|
*
|
|
33
34
|
* {@link syncOpenPass} is behind the store-level `sync.*` flags: with every
|
|
34
35
|
* flag off it reads and writes nothing. The one exception is
|
|
@@ -45,6 +46,7 @@ import { getStableDeviceId } from '../../llm/stable-device-id.js';
|
|
|
45
46
|
import { healClock, loadClock, storeClock, withImmediateTransaction } from './clock-store.js';
|
|
46
47
|
import { anySyncFlagOn } from './flags.js';
|
|
47
48
|
import { encodeHlc } from './hlc.js';
|
|
49
|
+
import { markInheritedRows } from './inherit.js';
|
|
48
50
|
import { ReplicaRegistry } from './replica-registry.js';
|
|
49
51
|
import { ensureSyncSchema, hasTable } from './schema.js';
|
|
50
52
|
const rebindHooks = [];
|
|
@@ -148,8 +150,10 @@ export function storeHwm(db, replicaId) {
|
|
|
148
150
|
* moves up.
|
|
149
151
|
*/
|
|
150
152
|
export function persistStoreSeq(db, replicaId, stream, seq, now = new Date()) {
|
|
153
|
+
// @sync-invariant none:local-only programming-error guard on this store's replica sequence
|
|
151
154
|
if (!db.isTransaction)
|
|
152
155
|
throw new Error('persistStoreSeq must run inside a transaction');
|
|
156
|
+
// @sync-invariant none:local-only a malformed local replica sequence is refused; machine-local bookkeeping
|
|
153
157
|
if (!Number.isSafeInteger(seq) || seq < 0)
|
|
154
158
|
throw new Error(`invalid replicaSeq ${seq}`);
|
|
155
159
|
db.prepare('INSERT INTO _sync_meta (key, value, updated_at) VALUES (?, ?, ?) ' +
|
|
@@ -200,7 +204,9 @@ function mintRow(scope, identity, deviceId, why, now) {
|
|
|
200
204
|
/**
|
|
201
205
|
* Retire `previous` and bind a new replica in its place, in the caller's
|
|
202
206
|
* transaction. The new replica's clock starts from the old one, so HLCs
|
|
203
|
-
* issued by this store keep increasing.
|
|
207
|
+
* issued by this store keep increasing. The old replica's live captures and
|
|
208
|
+
* sealed transactions become `inherited`, so the new replica never seals or
|
|
209
|
+
* sends them (§1.5 H3). Runs the rebind hooks.
|
|
204
210
|
*/
|
|
205
211
|
function rebindInTransaction(db, previous, identity, deviceId, reasons, now) {
|
|
206
212
|
const current = mintRow(previous.scope, identity, deviceId, `rebind:${reasons.join(',')}`, now);
|
|
@@ -208,8 +214,9 @@ function rebindInTransaction(db, previous, identity, deviceId, reasons, now) {
|
|
|
208
214
|
insertReplica(db, current);
|
|
209
215
|
const old = healClock(db, previous.replicaId);
|
|
210
216
|
storeClock(db, { phys: old.phys, ctr: old.ctr, replica: current.replicaId });
|
|
217
|
+
const inherited = markInheritedRows(db);
|
|
211
218
|
db.prepare('INSERT INTO _sync_meta (key, value, updated_at) VALUES (?, ?, ?) ' +
|
|
212
|
-
'ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at').run('rebind:last', JSON.stringify({ from: previous.replicaId, to: current.replicaId, reasons }), now.toISOString());
|
|
219
|
+
'ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at').run('rebind:last', JSON.stringify({ from: previous.replicaId, to: current.replicaId, reasons, inherited }), now.toISOString());
|
|
213
220
|
const retired = {
|
|
214
221
|
...previous,
|
|
215
222
|
retiredAt: now.toISOString(),
|
|
@@ -221,11 +228,13 @@ function rebindInTransaction(db, previous, identity, deviceId, reasons, now) {
|
|
|
221
228
|
}
|
|
222
229
|
function resolveContext(opts) {
|
|
223
230
|
if (opts.mode === 'test' && !opts.registry) {
|
|
231
|
+
// @sync-invariant none:local-only test-mode guard: a test open never touches the device registry
|
|
224
232
|
throw new Error("sync open mode 'test' needs an explicit registry; it never uses the device's");
|
|
225
233
|
}
|
|
226
234
|
const deviceId = opts.deviceId ?? opts.registry?.deviceId ?? getStableDeviceId();
|
|
227
235
|
const registry = opts.registry ?? ReplicaRegistry.forDevice(deviceId);
|
|
228
236
|
if (registry.deviceId !== deviceId) {
|
|
237
|
+
// @sync-invariant none:local-only the registry passed in is another device's; machine-local bookkeeping
|
|
229
238
|
throw new Error(`registry belongs to device ${registry.deviceId}, not ${deviceId}`);
|
|
230
239
|
}
|
|
231
240
|
return { deviceId, registry };
|
|
@@ -271,10 +280,12 @@ export function syncOpenPass(db, opts) {
|
|
|
271
280
|
* @throws {Error} With `mode: 'off'`.
|
|
272
281
|
*/
|
|
273
282
|
export function ensureProjectReplica(db, opts) {
|
|
283
|
+
// @sync-invariant none:local-only programming-error guard on binding this store's replica
|
|
274
284
|
if (opts.mode === 'off')
|
|
275
285
|
throw new Error('ensureProjectReplica needs a live or test open');
|
|
276
286
|
const result = bindPass(db, { ...opts, scope: 'project' });
|
|
277
287
|
if (result.status !== 'bound' && result.status !== 'rebound') {
|
|
288
|
+
// @sync-invariant none:local-only the bind pass returned an unexpected status; machine-local bookkeeping
|
|
278
289
|
throw new Error(`ensureProjectReplica: unexpected status ${result.status}`);
|
|
279
290
|
}
|
|
280
291
|
return {
|
|
@@ -294,10 +305,12 @@ export function ensureProjectReplica(db, opts) {
|
|
|
294
305
|
* @throws {Error} With `mode: 'off'`.
|
|
295
306
|
*/
|
|
296
307
|
export function ensureGlobalReplica(db, opts) {
|
|
308
|
+
// @sync-invariant none:local-only programming-error guard on binding this store's replica
|
|
297
309
|
if (opts.mode === 'off')
|
|
298
310
|
throw new Error('ensureGlobalReplica needs a live or test open');
|
|
299
311
|
const result = bindPass(db, { ...opts, scope: 'global' });
|
|
300
312
|
if (result.status !== 'bound' && result.status !== 'rebound') {
|
|
313
|
+
// @sync-invariant none:local-only the bind pass returned an unexpected status; machine-local bookkeeping
|
|
301
314
|
throw new Error(`ensureGlobalReplica: unexpected status ${result.status}`);
|
|
302
315
|
}
|
|
303
316
|
return {
|
|
@@ -337,7 +350,12 @@ function bindPass(db, opts) {
|
|
|
337
350
|
// copy's original keeps its entry untouched when it lives elsewhere.
|
|
338
351
|
if (prev.dbRealpath === realpath) {
|
|
339
352
|
registryWritten =
|
|
340
|
-
registry.upsert(outcome.previous.replicaId, {
|
|
353
|
+
registry.upsert(outcome.previous.replicaId, {
|
|
354
|
+
...prev,
|
|
355
|
+
retiredAt: now.toISOString(),
|
|
356
|
+
successor: outcome.row.replicaId,
|
|
357
|
+
retireReason: outcome.reasons.join(','),
|
|
358
|
+
}, now) || registryWritten;
|
|
341
359
|
}
|
|
342
360
|
}
|
|
343
361
|
registryWritten = register(registry, db, outcome.row, realpath, now) || registryWritten;
|
|
@@ -355,27 +373,93 @@ function bindPass(db, opts) {
|
|
|
355
373
|
*
|
|
356
374
|
* @throws {Error} When the store has no active replica.
|
|
357
375
|
*/
|
|
358
|
-
export function rebindReplica(db, opts, reason = 'server-seq-conflict') {
|
|
376
|
+
export function rebindReplica(db, opts, reason = 'server-seq-conflict', rebindOpts = {}) {
|
|
359
377
|
const now = opts.now?.() ?? new Date();
|
|
360
378
|
const { deviceId, registry } = resolveContext(opts);
|
|
361
379
|
const identity = fileIdentity(opts.dbPath, opts.stat);
|
|
362
380
|
const realpath = realpathSync(opts.dbPath);
|
|
363
|
-
const { previous, current } = withImmediateTransaction(db, () => {
|
|
381
|
+
const { previous, current, hwm } = withImmediateTransaction(db, () => {
|
|
364
382
|
const row = activeReplica(db, opts.scope);
|
|
383
|
+
// @sync-invariant none:local-only no active replica to rebind; machine-local bookkeeping
|
|
365
384
|
if (!row)
|
|
366
385
|
throw new Error(`no active ${opts.scope} replica to rebind`);
|
|
386
|
+
const persisted = storeHwm(db, row.replicaId);
|
|
367
387
|
return {
|
|
368
388
|
previous: row,
|
|
389
|
+
hwm: persisted,
|
|
369
390
|
current: rebindInTransaction(db, row, identity, deviceId, [reason], now),
|
|
370
391
|
};
|
|
371
392
|
});
|
|
393
|
+
// The retired replica is a retire candidate (§1.5 "Retirement"; T13109) only
|
|
394
|
+
// when it was this device's own replica of this file: registered here at
|
|
395
|
+
// this path with this nonce, or, when the registry lost it, bound by this
|
|
396
|
+
// device. A copy (another path) or another device's store retires nothing.
|
|
372
397
|
const prev = registry.get(previous.replicaId);
|
|
373
|
-
|
|
374
|
-
|
|
398
|
+
const own = prev
|
|
399
|
+
? (rebindOpts.identityProven === true || prev.dbRealpath === realpath) &&
|
|
400
|
+
prev.nonce === previous.nonce
|
|
401
|
+
: previous.deviceId === deviceId;
|
|
402
|
+
if (own && rebindOpts.recordRetirement !== false) {
|
|
403
|
+
registry.upsert(previous.replicaId, {
|
|
404
|
+
...(prev ?? { nonce: previous.nonce, scope: previous.scope, hwm }),
|
|
405
|
+
dbRealpath: realpath,
|
|
406
|
+
retiredAt: now.toISOString(),
|
|
407
|
+
successor: current.replicaId,
|
|
408
|
+
retireReason: reason,
|
|
409
|
+
}, now);
|
|
375
410
|
}
|
|
376
411
|
register(registry, db, current, realpath, now);
|
|
377
412
|
return { replicaId: current.replicaId, previousReplicaId: previous.replicaId };
|
|
378
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* After a vault restore or pull placed a snapshot at `dbPath`, retire the
|
|
416
|
+
* store's replica and bind a new one. The placed file is a new store instance
|
|
417
|
+
* (another device's data, or this store rolled back), so it may not continue
|
|
418
|
+
* the old replica's `replicaSeq` stream (§1.5 rules 1 and 3, N6). Rebinding
|
|
419
|
+
* here, before any open pass sees the new inode, records why; the server keeps
|
|
420
|
+
* the retired replica as history until S4 announces its retirement (T13109).
|
|
421
|
+
*
|
|
422
|
+
* The retired replica is recorded as `vault-restore` (a retire candidate) only
|
|
423
|
+
* when it was bound to the file the snapshot replaced (`before`) by this
|
|
424
|
+
* device. A store that was itself a copy (bound to another file) or came from
|
|
425
|
+
* another device is rebound for that reason, `file-identity` or
|
|
426
|
+
* `foreign-device`, and retires nothing (review MED-1).
|
|
427
|
+
*
|
|
428
|
+
* A store with no bound replica (a project restored onto this machine for the
|
|
429
|
+
* first time) is left alone: its first link binds it.
|
|
430
|
+
*
|
|
431
|
+
* @param dbPath - The placed `cleo.db`.
|
|
432
|
+
* @param scope - Which store it is.
|
|
433
|
+
* @param before - The identity of the file at `dbPath` before the placement, or `null` when there was none.
|
|
434
|
+
* @param opts - Device id, registry, stat and clock overrides (tests).
|
|
435
|
+
* @returns What was rebound, or `null` when the store had no replica.
|
|
436
|
+
*/
|
|
437
|
+
export async function rebindAfterVaultRestore(dbPath, scope, before, opts = {}) {
|
|
438
|
+
if (!existsSync(dbPath))
|
|
439
|
+
return null;
|
|
440
|
+
const { openNativeDatabase } = await import('../sqlite-native.js');
|
|
441
|
+
const { installSchemaWriteGuard } = await import('../worktree-build-guard.js');
|
|
442
|
+
const db = openNativeDatabase(dbPath);
|
|
443
|
+
try {
|
|
444
|
+
installSchemaWriteGuard(db); // T12687: the rebind is DML only
|
|
445
|
+
const row = activeReplica(db, scope);
|
|
446
|
+
if (!row)
|
|
447
|
+
return null;
|
|
448
|
+
const deviceId = opts.deviceId ?? opts.registry?.deviceId ?? getStableDeviceId();
|
|
449
|
+
const boundHere = before !== null &&
|
|
450
|
+
row.fileIno === before.ino &&
|
|
451
|
+
(row.fileBirth === null || before.birth === null || row.fileBirth === before.birth);
|
|
452
|
+
const reason = row.deviceId !== deviceId ? 'foreign-device' : boundHere ? 'vault-restore' : 'file-identity';
|
|
453
|
+
const out = rebindReplica(db, { ...opts, deviceId, dbPath, scope, mode: 'live' }, reason, {
|
|
454
|
+
recordRetirement: reason === 'vault-restore',
|
|
455
|
+
identityProven: reason === 'vault-restore',
|
|
456
|
+
});
|
|
457
|
+
return { ...out, reason };
|
|
458
|
+
}
|
|
459
|
+
finally {
|
|
460
|
+
db.close();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
379
463
|
/** The current clock of the store's active replica, for diagnostics. Read-only. */
|
|
380
464
|
export function currentClock(db, scope) {
|
|
381
465
|
const row = activeReplica(db, scope);
|