@cleocode/core 2026.9.26 → 2026.10.2
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/build-provenance.json +2 -2
- package/dist/cloud/journal.d.ts +9 -5
- package/dist/cloud/journal.d.ts.map +1 -1
- package/dist/cloud/journal.js +29 -8
- package/dist/cloud/journal.js.map +1 -1
- package/dist/cloud/manifest-check.d.ts +140 -4
- package/dist/cloud/manifest-check.d.ts.map +1 -1
- package/dist/cloud/manifest-check.js +309 -10
- package/dist/cloud/manifest-check.js.map +1 -1
- package/dist/cloud/nexus-attach.d.ts +119 -0
- package/dist/cloud/nexus-attach.d.ts.map +1 -0
- package/dist/cloud/nexus-attach.js +267 -0
- package/dist/cloud/nexus-attach.js.map +1 -0
- package/dist/cloud/nexus-auth.d.ts +15 -3
- package/dist/cloud/nexus-auth.d.ts.map +1 -1
- package/dist/cloud/nexus-auth.js +90 -6
- package/dist/cloud/nexus-auth.js.map +1 -1
- package/dist/cloud/nexus-cloud-activity.d.ts +37 -0
- package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud-activity.js +79 -0
- package/dist/cloud/nexus-cloud-activity.js.map +1 -0
- package/dist/cloud/nexus-cloud-status.d.ts +132 -0
- package/dist/cloud/nexus-cloud-status.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud-status.js +476 -0
- package/dist/cloud/nexus-cloud-status.js.map +1 -0
- package/dist/cloud/nexus-cloud.d.ts +179 -0
- package/dist/cloud/nexus-cloud.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud.js +296 -0
- package/dist/cloud/nexus-cloud.js.map +1 -0
- package/dist/cloud/nexus-device.d.ts +32 -7
- package/dist/cloud/nexus-device.d.ts.map +1 -1
- package/dist/cloud/nexus-device.js +54 -7
- package/dist/cloud/nexus-device.js.map +1 -1
- package/dist/cloud/nexus-enrol.d.ts +35 -4
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +192 -47
- package/dist/cloud/nexus-enrol.js.map +1 -1
- package/dist/cloud/nexus-home.d.ts +74 -0
- package/dist/cloud/nexus-home.d.ts.map +1 -0
- package/dist/cloud/nexus-home.js +97 -0
- package/dist/cloud/nexus-home.js.map +1 -0
- package/dist/cloud/nexus-link.d.ts +8 -1
- package/dist/cloud/nexus-link.d.ts.map +1 -1
- package/dist/cloud/nexus-link.js +138 -11
- package/dist/cloud/nexus-link.js.map +1 -1
- package/dist/cloud/nexus-logout.d.ts +114 -0
- package/dist/cloud/nexus-logout.d.ts.map +1 -0
- package/dist/cloud/nexus-logout.js +429 -0
- package/dist/cloud/nexus-logout.js.map +1 -0
- package/dist/cloud/nexus-vault-keys.d.ts +129 -0
- package/dist/cloud/nexus-vault-keys.d.ts.map +1 -0
- package/dist/cloud/nexus-vault-keys.js +277 -0
- package/dist/cloud/nexus-vault-keys.js.map +1 -0
- package/dist/cloud/nexus-vault-state.d.ts +121 -0
- package/dist/cloud/nexus-vault-state.d.ts.map +1 -0
- package/dist/cloud/nexus-vault-state.js +274 -0
- package/dist/cloud/nexus-vault-state.js.map +1 -0
- package/dist/cloud/nexus-vault.d.ts +160 -0
- package/dist/cloud/nexus-vault.d.ts.map +1 -0
- package/dist/cloud/nexus-vault.js +1733 -0
- package/dist/cloud/nexus-vault.js.map +1 -0
- package/dist/cloud/signing.d.ts +24 -8
- package/dist/cloud/signing.d.ts.map +1 -1
- package/dist/cloud/signing.js +61 -15
- package/dist/cloud/signing.js.map +1 -1
- package/dist/docs/export-document.js +8341 -3317
- package/dist/docs/export-document.js.map +3 -3
- package/dist/doctor/migrations.d.ts +75 -0
- package/dist/doctor/migrations.d.ts.map +1 -0
- package/dist/doctor/migrations.js +136 -0
- package/dist/doctor/migrations.js.map +1 -0
- package/dist/doctor/sync-sealer.d.ts +48 -0
- package/dist/doctor/sync-sealer.d.ts.map +1 -0
- package/dist/doctor/sync-sealer.js +109 -0
- package/dist/doctor/sync-sealer.js.map +1 -0
- package/dist/doctor/sync-triggers.d.ts +53 -0
- package/dist/doctor/sync-triggers.d.ts.map +1 -0
- package/dist/doctor/sync-triggers.js +157 -0
- package/dist/doctor/sync-triggers.js.map +1 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +5 -1
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/llm/plugin-facade.js +8668 -3644
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/nexus/projects-clean.d.ts +3 -0
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +9 -3
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/registry-roots.d.ts +3 -1
- package/dist/nexus/registry-roots.d.ts.map +1 -1
- package/dist/nexus/registry-roots.js +5 -2
- package/dist/nexus/registry-roots.js.map +1 -1
- package/dist/nexus/registry.d.ts +8 -1
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +24 -10
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/workspace.d.ts +4 -1
- package/dist/nexus/workspace.d.ts.map +1 -1
- package/dist/nexus/workspace.js +10 -4
- package/dist/nexus/workspace.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +7 -2
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestrate/worker-verify.d.ts +121 -12
- package/dist/orchestrate/worker-verify.d.ts.map +1 -1
- package/dist/orchestrate/worker-verify.js +172 -21
- package/dist/orchestrate/worker-verify.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +15 -9
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +9 -0
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +9 -2
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/resources/backend.d.ts +15 -3
- package/dist/resources/backend.d.ts.map +1 -1
- package/dist/resources/backend.js +7 -3
- package/dist/resources/backend.js.map +1 -1
- package/dist/resources/darwin-backend.d.ts +142 -0
- package/dist/resources/darwin-backend.d.ts.map +1 -0
- package/dist/resources/darwin-backend.js +288 -0
- package/dist/resources/darwin-backend.js.map +1 -0
- package/dist/resources/governor.d.ts +44 -1
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +100 -36
- package/dist/resources/governor.js.map +1 -1
- package/dist/resources/heavy-command.d.ts +132 -0
- package/dist/resources/heavy-command.d.ts.map +1 -0
- package/dist/resources/heavy-command.js +768 -0
- package/dist/resources/heavy-command.js.map +1 -0
- package/dist/resources/monitor.d.ts +50 -1
- package/dist/resources/monitor.d.ts.map +1 -1
- package/dist/resources/monitor.js +83 -1
- package/dist/resources/monitor.js.map +1 -1
- package/dist/resources/run-admission.d.ts +303 -0
- package/dist/resources/run-admission.d.ts.map +1 -0
- package/dist/resources/run-admission.js +648 -0
- package/dist/resources/run-admission.js.map +1 -0
- package/dist/resources/run-class.d.ts +111 -0
- package/dist/resources/run-class.d.ts.map +1 -0
- package/dist/resources/run-class.js +658 -0
- package/dist/resources/run-class.js.map +1 -0
- package/dist/resources/run-governed.d.ts +158 -0
- package/dist/resources/run-governed.d.ts.map +1 -0
- package/dist/resources/run-governed.js +406 -0
- package/dist/resources/run-governed.js.map +1 -0
- package/dist/resources/slot-holder.d.ts +267 -0
- package/dist/resources/slot-holder.d.ts.map +1 -0
- package/dist/resources/slot-holder.js +505 -0
- package/dist/resources/slot-holder.js.map +1 -0
- package/dist/resources/tool-groups.d.ts +74 -0
- package/dist/resources/tool-groups.d.ts.map +1 -0
- package/dist/resources/tool-groups.js +118 -0
- package/dist/resources/tool-groups.js.map +1 -0
- package/dist/routing/build-command-groups.d.ts.map +1 -1
- package/dist/routing/build-command-groups.js +1 -0
- package/dist/routing/build-command-groups.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +8676 -3652
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/cross-project-hygiene.d.ts +3 -2
- package/dist/sentient/cross-project-hygiene.d.ts.map +1 -1
- package/dist/sentient/cross-project-hygiene.js +5 -2
- package/dist/sentient/cross-project-hygiene.js.map +1 -1
- package/dist/sentient/state.d.ts +7 -0
- package/dist/sentient/state.d.ts.map +1 -1
- package/dist/sentient/state.js.map +1 -1
- package/dist/sentient/tick.d.ts +14 -2
- package/dist/sentient/tick.d.ts.map +1 -1
- package/dist/sentient/tick.js +63 -4
- package/dist/sentient/tick.js.map +1 -1
- package/dist/setup/sections/nexus-account.d.ts +8 -6
- package/dist/setup/sections/nexus-account.d.ts.map +1 -1
- package/dist/setup/sections/nexus-account.js +53 -9
- package/dist/setup/sections/nexus-account.js.map +1 -1
- package/dist/store/backup-recover.d.ts.map +1 -1
- package/dist/store/backup-recover.js +5 -0
- package/dist/store/backup-recover.js.map +1 -1
- package/dist/store/data-accessor.d.ts +1 -0
- package/dist/store/data-accessor.d.ts.map +1 -1
- package/dist/store/data-accessor.js +7 -0
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts +23 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +126 -36
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/recovery.d.ts.map +1 -1
- package/dist/store/exodus/recovery.js +15 -0
- package/dist/store/exodus/recovery.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +5 -0
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +8 -1
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +10 -2
- package/dist/store/lock.js.map +1 -1
- package/dist/store/migration-manager.d.ts +5 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +11 -0
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/migration-runner.d.ts +158 -0
- package/dist/store/migration-runner.d.ts.map +1 -0
- package/dist/store/migration-runner.js +493 -0
- package/dist/store/migration-runner.js.map +1 -0
- package/dist/store/portable-bundle-import.d.ts +15 -1
- package/dist/store/portable-bundle-import.d.ts.map +1 -1
- package/dist/store/portable-bundle-import.js +24 -4
- package/dist/store/portable-bundle-import.js.map +1 -1
- package/dist/store/portable-bundle-relocate.d.ts +43 -0
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -1
- package/dist/store/portable-bundle-relocate.js +79 -5
- package/dist/store/portable-bundle-relocate.js.map +1 -1
- package/dist/store/portable-bundle-scan.d.ts +20 -0
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +38 -3
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts +33 -0
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +34 -7
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/row-identity-registry.d.ts +137 -7
- package/dist/store/row-identity-registry.d.ts.map +1 -1
- package/dist/store/row-identity-registry.js +364 -9
- package/dist/store/row-identity-registry.js.map +1 -1
- package/dist/store/row-identity.d.ts.map +1 -1
- package/dist/store/row-identity.js +9 -10
- package/dist/store/row-identity.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +10 -0
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +31 -0
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +5 -1
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/sync/capture.d.ts +203 -0
- package/dist/store/sync/capture.d.ts.map +1 -0
- package/dist/store/sync/capture.js +562 -0
- package/dist/store/sync/capture.js.map +1 -0
- package/dist/store/sync/clock-store.d.ts.map +1 -1
- package/dist/store/sync/clock-store.js +2 -0
- package/dist/store/sync/clock-store.js.map +1 -1
- package/dist/store/sync/fk-orphans.d.ts +133 -0
- package/dist/store/sync/fk-orphans.d.ts.map +1 -0
- package/dist/store/sync/fk-orphans.js +265 -0
- package/dist/store/sync/fk-orphans.js.map +1 -0
- package/dist/store/sync/flags.d.ts +7 -0
- package/dist/store/sync/flags.d.ts.map +1 -1
- package/dist/store/sync/flags.js +16 -0
- package/dist/store/sync/flags.js.map +1 -1
- package/dist/store/sync/hlc.d.ts.map +1 -1
- package/dist/store/sync/hlc.js +4 -0
- package/dist/store/sync/hlc.js.map +1 -1
- package/dist/store/sync/identity-fill.d.ts +45 -0
- package/dist/store/sync/identity-fill.d.ts.map +1 -0
- package/dist/store/sync/identity-fill.js +85 -0
- package/dist/store/sync/identity-fill.js.map +1 -0
- package/dist/store/sync/machinery.d.ts +27 -0
- package/dist/store/sync/machinery.d.ts.map +1 -0
- package/dist/store/sync/machinery.js +44 -0
- package/dist/store/sync/machinery.js.map +1 -0
- package/dist/store/sync/netting.d.ts +120 -0
- package/dist/store/sync/netting.d.ts.map +1 -0
- package/dist/store/sync/netting.js +336 -0
- package/dist/store/sync/netting.js.map +1 -0
- package/dist/store/sync/replica.d.ts +59 -3
- package/dist/store/sync/replica.d.ts.map +1 -1
- package/dist/store/sync/replica.js +84 -3
- package/dist/store/sync/replica.js.map +1 -1
- package/dist/store/sync/schema.d.ts +18 -3
- package/dist/store/sync/schema.d.ts.map +1 -1
- package/dist/store/sync/schema.js +27 -3
- package/dist/store/sync/schema.js.map +1 -1
- package/dist/store/sync/seal-backlog.d.ts +21 -0
- package/dist/store/sync/seal-backlog.d.ts.map +1 -0
- package/dist/store/sync/seal-backlog.js +24 -0
- package/dist/store/sync/seal-backlog.js.map +1 -0
- package/dist/store/sync/sealer-values.d.ts +34 -0
- package/dist/store/sync/sealer-values.d.ts.map +1 -0
- package/dist/store/sync/sealer-values.js +53 -0
- package/dist/store/sync/sealer-values.js.map +1 -0
- package/dist/store/sync/sealer.d.ts +145 -0
- package/dist/store/sync/sealer.d.ts.map +1 -0
- package/dist/store/sync/sealer.js +906 -0
- package/dist/store/sync/sealer.js.map +1 -0
- package/dist/store/sync/structural.d.ts +63 -0
- package/dist/store/sync/structural.d.ts.map +1 -0
- package/dist/store/sync/structural.js +180 -0
- package/dist/store/sync/structural.js.map +1 -0
- package/dist/store/sync/timestamps.d.ts +92 -0
- package/dist/store/sync/timestamps.d.ts.map +1 -0
- package/dist/store/sync/timestamps.js +228 -0
- package/dist/store/sync/timestamps.js.map +1 -0
- package/dist/store/sync/tombstones.d.ts +75 -0
- package/dist/store/sync/tombstones.d.ts.map +1 -0
- package/dist/store/sync/tombstones.js +103 -0
- package/dist/store/sync/tombstones.js.map +1 -0
- package/dist/store/sync/trigger-classes.d.ts +221 -0
- package/dist/store/sync/trigger-classes.d.ts.map +1 -0
- package/dist/store/sync/trigger-classes.js +441 -0
- package/dist/store/sync/trigger-classes.js.map +1 -0
- package/dist/store/sync/trigger-suspend-at-path.d.ts +23 -0
- package/dist/store/sync/trigger-suspend-at-path.d.ts.map +1 -0
- package/dist/store/sync/trigger-suspend-at-path.js +44 -0
- package/dist/store/sync/trigger-suspend-at-path.js.map +1 -0
- package/dist/store/sync/writer-version.d.ts +43 -0
- package/dist/store/sync/writer-version.d.ts.map +1 -0
- package/dist/store/sync/writer-version.js +90 -0
- package/dist/store/sync/writer-version.js.map +1 -0
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +102 -0
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/trigger-suspend-schema.d.ts +44 -0
- package/dist/store/trigger-suspend-schema.d.ts.map +1 -0
- package/dist/store/trigger-suspend-schema.js +25 -0
- package/dist/store/trigger-suspend-schema.js.map +1 -0
- package/dist/store/vault-manifest.d.ts +365 -0
- package/dist/store/vault-manifest.d.ts.map +1 -0
- package/dist/store/vault-manifest.js +812 -0
- package/dist/store/vault-manifest.js.map +1 -0
- package/dist/store/writer-lease.d.ts +31 -0
- package/dist/store/writer-lease.d.ts.map +1 -1
- package/dist/store/writer-lease.js +65 -2
- package/dist/store/writer-lease.js.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +21 -0
- package/dist/system/health.js.map +1 -1
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +3 -1
- package/dist/system/project-health.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +58 -0
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +75 -6
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/affected-scope.d.ts +150 -23
- package/dist/tasks/affected-scope.d.ts.map +1 -1
- package/dist/tasks/affected-scope.js +320 -32
- package/dist/tasks/affected-scope.js.map +1 -1
- package/dist/tasks/change-set.d.ts +96 -0
- package/dist/tasks/change-set.d.ts.map +1 -1
- package/dist/tasks/change-set.js +169 -4
- package/dist/tasks/change-set.js.map +1 -1
- package/dist/tasks/complete-ci.d.ts +115 -0
- package/dist/tasks/complete-ci.d.ts.map +1 -0
- package/dist/tasks/complete-ci.js +171 -0
- package/dist/tasks/complete-ci.js.map +1 -0
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +50 -17
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/compute-task-view.d.ts.map +1 -1
- package/dist/tasks/compute-task-view.js +7 -0
- package/dist/tasks/compute-task-view.js.map +1 -1
- package/dist/tasks/done-plan.d.ts.map +1 -1
- package/dist/tasks/done-plan.js +51 -30
- package/dist/tasks/done-plan.js.map +1 -1
- package/dist/tasks/done-record.d.ts +6 -0
- package/dist/tasks/done-record.d.ts.map +1 -1
- package/dist/tasks/done-record.js +9 -3
- package/dist/tasks/done-record.js.map +1 -1
- package/dist/tasks/evidence.d.ts +3 -2
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +143 -12
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-notes.d.ts +22 -0
- package/dist/tasks/gate-notes.d.ts.map +1 -0
- package/dist/tasks/gate-notes.js +33 -0
- package/dist/tasks/gate-notes.js.map +1 -0
- package/dist/tasks/index.d.ts +2 -1
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +2 -1
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/test-run-binding.d.ts +117 -0
- package/dist/tasks/test-run-binding.d.ts.map +1 -0
- package/dist/tasks/test-run-binding.js +365 -0
- package/dist/tasks/test-run-binding.js.map +1 -0
- package/dist/tasks/tool-cache-env.d.ts +123 -0
- package/dist/tasks/tool-cache-env.d.ts.map +1 -0
- package/dist/tasks/tool-cache-env.js +287 -0
- package/dist/tasks/tool-cache-env.js.map +1 -0
- package/dist/tasks/tool-cache-failed-first.d.ts +155 -0
- package/dist/tasks/tool-cache-failed-first.d.ts.map +1 -0
- package/dist/tasks/tool-cache-failed-first.js +285 -0
- package/dist/tasks/tool-cache-failed-first.js.map +1 -0
- package/dist/tasks/tool-cache.d.ts +375 -55
- package/dist/tasks/tool-cache.d.ts.map +1 -1
- package/dist/tasks/tool-cache.js +912 -303
- package/dist/tasks/tool-cache.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +4 -3
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +15 -4
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-semaphore.d.ts +67 -7
- package/dist/tasks/tool-semaphore.d.ts.map +1 -1
- package/dist/tasks/tool-semaphore.js +134 -56
- package/dist/tasks/tool-semaphore.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +4 -0
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/engine-ops.d.ts +6 -0
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +8 -0
- package/dist/validation/engine-ops.js.map +1 -1
- package/migrations/drizzle-cleo-project/20260930170000_t12819-trigger-suspend-clause/migration.sql +367 -0
- package/migrations/sync-journal/20260930120000_t12343-capture/migration.sql +47 -0
- package/migrations/sync-journal/20261001170000_t12984-sealer/migration.sql +101 -0
- package/package.json +13 -13
- package/templates/CLEO-INJECTION.md +5 -5
- package/templates/CLEO-REFERENCE.md +8 -4
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture: persistent pure-SQL triggers that record every change to a
|
|
3
|
+
* sync-set row into `_sync_capture`, in the writing statement (journal spec
|
|
4
|
+
* §2.3; S2, `sync.capture`; T12343 AC1 / R4).
|
|
5
|
+
*
|
|
6
|
+
* Per sync-set table the generator emits up to five AFTER triggers, all
|
|
7
|
+
* carrying the `capture` suspension clause (§3.5 Rule 4):
|
|
8
|
+
*
|
|
9
|
+
* | Trigger | Fires on | Records |
|
|
10
|
+
* |---|---|---|
|
|
11
|
+
* | `_sync_cap_<t>_i` | INSERT | full image; identity read from the LIVE row (N4) |
|
|
12
|
+
* | `_sync_cap_<t>_u` | UPDATE OF captured columns, when one changed | changed columns `[old, new]` |
|
|
13
|
+
* | `_sync_cap_<t>_d` | DELETE | full before-image |
|
|
14
|
+
* | `_sync_cap_<t>_k` | UPDATE OF uid / birth_fp of a keyed row | the re-key (H5) |
|
|
15
|
+
* | `_sync_cap_<t>_f` | UPDATE OF uid / birth_fp from NULL | patches the latest live I capture (N4, N11) |
|
|
16
|
+
*
|
|
17
|
+
* - Values are `enc()`-encoded before any JSON function sees them (`quote()`,
|
|
18
|
+
* and `'r' || printf('%!.17g')` for REAL: `-0.0` becomes `0.0`, ±Inf is
|
|
19
|
+
* `Inf` / `-Inf`, L4).
|
|
20
|
+
* - A reference column records `[enc(local key), target uid]`, the uid read at
|
|
21
|
+
* write time (H5). JSON-array references are translated at seal time.
|
|
22
|
+
* - A secret column records only the `<changed>` marker, never its value
|
|
23
|
+
* (§2.7); before-images never hold secret values. `strip` columns are
|
|
24
|
+
* captured whole and stripped at seal. Local-only columns (claim leases)
|
|
25
|
+
* and identity columns never fire an update capture.
|
|
26
|
+
* - Full images are chunked `json_patch(json_object(≤60 pairs), …)` (L3); the
|
|
27
|
+
* update image uses a `UNION ALL` of per-column terms (no argument limit).
|
|
28
|
+
* - Each trigger also writes `_sync_undo` for the same seq, but only while
|
|
29
|
+
* `_sync_meta.undo_enabled` exists (push on, §3.5 Rule 2); S2 runs with it
|
|
30
|
+
* off (shadow mode). Append-only tables keep only `rk` and `uid` there.
|
|
31
|
+
* An update's undo holds only the changed columns, old and new (D5
|
|
32
|
+
* amendment); a delete's holds the full row.
|
|
33
|
+
* - I and D images omit NULL columns: the sender's column set is pinned by
|
|
34
|
+
* its trigger set, so an absent column is NULL.
|
|
35
|
+
*
|
|
36
|
+
* The open pass installs the triggers only to match the persisted
|
|
37
|
+
* `sync.capture` flag ({@link syncCaptureOpenPass}); the kill switch
|
|
38
|
+
* `CLEO_SYNC_CAPTURE=0` never touches them (M3). `accessor.transaction()`
|
|
39
|
+
* opens a frame ({@link openCaptureFrame}); finishing it labels the frame's
|
|
40
|
+
* captures with the connection, frame and kind in one UPDATE
|
|
41
|
+
* ({@link finishCaptureFrame}).
|
|
42
|
+
*
|
|
43
|
+
* @task T12343
|
|
44
|
+
* @module store/sync/capture
|
|
45
|
+
*/
|
|
46
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
47
|
+
import type { TableScope } from '@cleocode/contracts';
|
|
48
|
+
/** How one table is captured. Built from the registries, or by tests. */
|
|
49
|
+
export interface CaptureTableDef {
|
|
50
|
+
readonly table: string;
|
|
51
|
+
/** Local key columns (the table's single-row identity on this device). */
|
|
52
|
+
readonly key: readonly string[];
|
|
53
|
+
/** Captured columns, in table order: every column except local-only ones. */
|
|
54
|
+
readonly columns: readonly string[];
|
|
55
|
+
/** Identity columns (recorded, read from the live row on insert; never fire U). */
|
|
56
|
+
readonly identity: readonly string[];
|
|
57
|
+
/** Secret columns: recorded as `<changed>` only. */
|
|
58
|
+
readonly secret: ReadonlySet<string>;
|
|
59
|
+
/** Reference columns: target table and its local key column. */
|
|
60
|
+
readonly refs: ReadonlyMap<string, {
|
|
61
|
+
table: string;
|
|
62
|
+
key: string;
|
|
63
|
+
}>;
|
|
64
|
+
/** Rows never change: undo keeps only `rk` and `uid`. */
|
|
65
|
+
readonly appendOnly: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** One generated trigger. */
|
|
68
|
+
export interface CaptureTrigger {
|
|
69
|
+
readonly name: string;
|
|
70
|
+
readonly table: string;
|
|
71
|
+
readonly sql: string;
|
|
72
|
+
/** Every table the trigger's text references (SYNC_TRIGGER_REFS, N3). */
|
|
73
|
+
readonly refs: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
/** Largest number of key/value pairs per `json_object` call (L3). */
|
|
76
|
+
export declare const JSON_OBJECT_CHUNK = 60;
|
|
77
|
+
/** The marker a secret column records instead of its value (§2.7). */
|
|
78
|
+
export declare const SECRET_MARKER = "<changed>";
|
|
79
|
+
/** `enc(v)`: lossless text for any SQLite value (§2.3). */
|
|
80
|
+
export declare function enc(expr: string): string;
|
|
81
|
+
/** Wall milliseconds from SQLite's clock, valid on every shipped SQLite (§1.2). */
|
|
82
|
+
export declare const AT_MS_SQL = "CAST((julianday('now') - 2440587.5) * 86400000 AS INTEGER)";
|
|
83
|
+
/** The sync set: portable, not frozen-legacy, declared in ROW_IDENTITY (§2.1). */
|
|
84
|
+
export declare function syncSetTables(scope: TableScope): string[];
|
|
85
|
+
/**
|
|
86
|
+
* The capture definition of a sync-set table in this store, or `undefined`
|
|
87
|
+
* when the table is absent or not in the sync set.
|
|
88
|
+
*/
|
|
89
|
+
export declare function captureTableDef(db: DatabaseSync, scope: TableScope, table: string): CaptureTableDef | undefined;
|
|
90
|
+
/** `json_patch(json_object(≤60 pairs), …)` over `pairs` (L3). */
|
|
91
|
+
export declare function chunkedObject(pairs: ReadonlyArray<readonly [string, string]>): string;
|
|
92
|
+
/**
|
|
93
|
+
* Generate every capture trigger for one table. Pure: the same definition
|
|
94
|
+
* always yields the same text, so the open pass can compare live text.
|
|
95
|
+
*/
|
|
96
|
+
export declare function captureTriggers(def: CaptureTableDef): CaptureTrigger[];
|
|
97
|
+
/**
|
|
98
|
+
* Re-mint captures (T12806 × S2): a captured write that CLEARED a row's
|
|
99
|
+
* identity (a snapshot-overwrite import: K old → NULL) is followed by a fill
|
|
100
|
+
* that mints the new uid outside capture (the open-time fill runs with the
|
|
101
|
+
* capture triggers dropped). For every such row, write the K that journals
|
|
102
|
+
* the new identity (NULL → new uid, and birth_fp), so the pair nets to
|
|
103
|
+
* old → new. Call inside the fill's bracket, after the fill.
|
|
104
|
+
*
|
|
105
|
+
* A row qualifies when its latest live K capture set the uid to NULL and the
|
|
106
|
+
* row now has a uid. Undo is written only while `undo_enabled` (Rule 2).
|
|
107
|
+
*
|
|
108
|
+
* @returns K captures written, per table.
|
|
109
|
+
*/
|
|
110
|
+
export declare function captureRemints(db: DatabaseSync, scope: TableScope): Record<string, number>;
|
|
111
|
+
/** Every capture trigger for the store's sync set. */
|
|
112
|
+
export declare function generateCaptureTriggers(db: DatabaseSync, scope: TableScope): CaptureTrigger[];
|
|
113
|
+
/** SYNC_TRIGGER_REFS: trigger → every table its text references (N3). */
|
|
114
|
+
export declare function syncTriggerRefs(db: DatabaseSync, scope: TableScope): Map<string, readonly string[]>;
|
|
115
|
+
/** What {@link installCaptureTriggers} changed. */
|
|
116
|
+
export interface CaptureInstallReport {
|
|
117
|
+
readonly installed: string[];
|
|
118
|
+
readonly replaced: string[];
|
|
119
|
+
readonly dropped: string[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Make the live capture triggers exactly the generated set: create the
|
|
123
|
+
* missing, replace the differing, drop the orphaned. Writes nothing when
|
|
124
|
+
* they already match. Requires the sync schema.
|
|
125
|
+
*/
|
|
126
|
+
export declare function installCaptureTriggers(db: DatabaseSync, scope: TableScope): CaptureInstallReport;
|
|
127
|
+
/** Drop every capture trigger. Returns their names. */
|
|
128
|
+
export declare function dropCaptureTriggers(db: DatabaseSync): string[];
|
|
129
|
+
/**
|
|
130
|
+
* Install the provenance stamp on a chokepoint connection (§2.3). A
|
|
131
|
+
* persistent trigger cannot read a TEMP table, so the capture triggers write
|
|
132
|
+
* rows unlabelled; the labels (connection, frame, kind) are written ONCE per
|
|
133
|
+
* frame by {@link finishCaptureFrame}, over the frame's seq range. Writes are
|
|
134
|
+
* serialized by the write lock, so every capture from the frame's
|
|
135
|
+
* `first_seq` on belongs to it. This replaces a TEMP trigger that ran one
|
|
136
|
+
* UPDATE per capture (S2 insert-path ruling (a)). Also turns
|
|
137
|
+
* `recursive_triggers` on for this connection (M1; the REPLACE audit is
|
|
138
|
+
* T12787's zero-tolerance ban plus `recursive-triggers-audit.test.ts`).
|
|
139
|
+
*
|
|
140
|
+
* @returns This connection's id.
|
|
141
|
+
*/
|
|
142
|
+
export declare function installCaptureStamp(db: DatabaseSync): string;
|
|
143
|
+
/** Remove the stamp (capture turned off, or the sync tables dropped). */
|
|
144
|
+
export declare function removeCaptureStamp(db: DatabaseSync): void;
|
|
145
|
+
/** Whether this connection carries the capture stamp. */
|
|
146
|
+
export declare function hasCaptureStamp(db: DatabaseSync): boolean;
|
|
147
|
+
/** The kinds a frame can have (§2.3). */
|
|
148
|
+
export type FrameKind = 'write' | 'apply' | 'rebase' | 'repair' | 'exodus' | 'import' | 'remint' | 'rekey';
|
|
149
|
+
/**
|
|
150
|
+
* Open a frame for the caller's transaction, right after its
|
|
151
|
+
* `BEGIN IMMEDIATE`: insert the `_sync_frame` row with the first seq its
|
|
152
|
+
* captures can take. A connection without the stamp (capture off) gets
|
|
153
|
+
* `null` and nothing is written.
|
|
154
|
+
*/
|
|
155
|
+
export declare function openCaptureFrame(db: DatabaseSync, kind?: FrameKind, actor?: string | null): string | null;
|
|
156
|
+
/**
|
|
157
|
+
* Before COMMIT: label the frame's captures and undo rows (one UPDATE each
|
|
158
|
+
* over its seq range), drop the undo of an `apply` / `rebase` frame (D1), and
|
|
159
|
+
* delete the frame's row when no capture carries it, so a read-only
|
|
160
|
+
* transaction leaves nothing (N10). A transaction that commits without this
|
|
161
|
+
* call leaves its captures unframed, never mislabelled.
|
|
162
|
+
*/
|
|
163
|
+
export declare function finishCaptureFrame(db: DatabaseSync, frame: string | null): void;
|
|
164
|
+
/**
|
|
165
|
+
* In `finally`: nothing is left to clear (the labels are written by
|
|
166
|
+
* {@link finishCaptureFrame}); kept so callers need not change.
|
|
167
|
+
*/
|
|
168
|
+
export declare function clearCaptureFrame(_db: DatabaseSync, _frame: string | null): void;
|
|
169
|
+
/**
|
|
170
|
+
* `cleo sync capture on|off` (the storage primitive): persist the flag and
|
|
171
|
+
* install or drop the triggers, in one transaction.
|
|
172
|
+
*/
|
|
173
|
+
export declare function setCaptureEnabled(db: DatabaseSync, scope: TableScope, on: boolean, options?: {
|
|
174
|
+
schemaRoot?: string;
|
|
175
|
+
}): CaptureInstallReport | {
|
|
176
|
+
dropped: string[];
|
|
177
|
+
};
|
|
178
|
+
/** What the capture open pass did. */
|
|
179
|
+
export type CaptureOpenResult = {
|
|
180
|
+
readonly capture: 'off';
|
|
181
|
+
readonly dropped: string[];
|
|
182
|
+
} | {
|
|
183
|
+
readonly capture: 'on';
|
|
184
|
+
readonly report: CaptureInstallReport;
|
|
185
|
+
readonly conn: string;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* The capture step of the open pass, after migrations: triggers match the
|
|
189
|
+
* persisted flag. With the flag off and no trigger present it only reads.
|
|
190
|
+
*/
|
|
191
|
+
export declare function syncCaptureOpenPass(db: DatabaseSync, scope: TableScope, options?: {
|
|
192
|
+
schemaRoot?: string;
|
|
193
|
+
}): CaptureOpenResult;
|
|
194
|
+
/**
|
|
195
|
+
* Migration-runner hooks (§2.3a rules 1 and 5): drop every capture trigger
|
|
196
|
+
* inside the bracket before a migration's statements, and regenerate them for
|
|
197
|
+
* the new schema before its COMMIT. Only when capture is on.
|
|
198
|
+
*/
|
|
199
|
+
export declare function captureBracketHooks(db: DatabaseSync, scope: TableScope): {
|
|
200
|
+
suspendCapture?(db: DatabaseSync): void;
|
|
201
|
+
reinstallCapture?(db: DatabaseSync): void;
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/store/sync/capture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAoBtE,yEAAyE;AACzE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B;AAED,6BAA6B;AAC7B,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,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