@cleocode/core 2026.10.1 → 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 +25 -0
- package/dist/cloud/nexus-attach.d.ts.map +1 -1
- package/dist/cloud/nexus-attach.js +81 -6
- package/dist/cloud/nexus-attach.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.map +1 -1
- package/dist/cloud/nexus-cloud-status.js +36 -0
- package/dist/cloud/nexus-cloud-status.js.map +1 -1
- package/dist/cloud/nexus-device.d.ts +1 -1
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +5 -0
- 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-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 +8137 -3318
- 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 +8442 -3623
- 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 +8446 -3627
- 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/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 +27 -2
- package/dist/store/sync/replica.d.ts.map +1 -1
- package/dist/store/sync/replica.js +47 -3
- package/dist/store/sync/replica.js.map +1 -1
- package/dist/store/sync/schema.d.ts +12 -0
- package/dist/store/sync/schema.d.ts.map +1 -1
- package/dist/store/sync/schema.js +21 -0
- 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,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo doctor migrations`: the migration journal of each store, read-only
|
|
3
|
+
* (journal spec §2.3a rule 2, "journal safety check"; R5-3 T12796).
|
|
4
|
+
*
|
|
5
|
+
* Every S2+ acceptance run reads the live journal count through this report,
|
|
6
|
+
* never through a literal: per scope, the journal's row count and head row,
|
|
7
|
+
* and per lineage sharing that journal, how many of its migration files are
|
|
8
|
+
* applied, which are pending, and any drift (a journal row with a local
|
|
9
|
+
* migration's name but a different hash, the #1719 condition). Rows no known
|
|
10
|
+
* lineage explains are listed too.
|
|
11
|
+
*
|
|
12
|
+
* The store is opened as a read-only snapshot; nothing is written.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
* @task T12796
|
|
16
|
+
*/
|
|
17
|
+
import { type DualScope } from '../store/dual-scope-db.js';
|
|
18
|
+
/** Lineages the project store's journal runs (the consolidated one first). */
|
|
19
|
+
export declare const PROJECT_LINEAGES: readonly string[];
|
|
20
|
+
/** Lineages the global store's journal runs. */
|
|
21
|
+
export declare const GLOBAL_LINEAGES: readonly string[];
|
|
22
|
+
/** One lineage's standing in a journal. */
|
|
23
|
+
export interface LineageMigrationReport {
|
|
24
|
+
readonly lineage: string;
|
|
25
|
+
/** Migration files in the installed folder. */
|
|
26
|
+
readonly local: number;
|
|
27
|
+
/** Local files whose hash is in the journal. */
|
|
28
|
+
readonly applied: number;
|
|
29
|
+
/** Local files whose name is not in the journal. */
|
|
30
|
+
readonly pending: string[];
|
|
31
|
+
}
|
|
32
|
+
/** One journal row, as the report shows it. */
|
|
33
|
+
export interface JournalRowReport {
|
|
34
|
+
readonly id: number;
|
|
35
|
+
readonly name: string | null;
|
|
36
|
+
readonly hash: string;
|
|
37
|
+
}
|
|
38
|
+
/** A store's migration journal. */
|
|
39
|
+
export interface ScopeMigrationReport {
|
|
40
|
+
readonly scope: DualScope;
|
|
41
|
+
readonly dbPath: string;
|
|
42
|
+
readonly exists: boolean;
|
|
43
|
+
/** Rows in `__drizzle_migrations`. */
|
|
44
|
+
readonly journalRows: number;
|
|
45
|
+
/** The row with the largest id. */
|
|
46
|
+
readonly head: JournalRowReport | null;
|
|
47
|
+
readonly lineages: LineageMigrationReport[];
|
|
48
|
+
/** Rows named like a local migration whose hash differs (#1719 drift). */
|
|
49
|
+
readonly drift: Array<JournalRowReport & {
|
|
50
|
+
fileHash: string;
|
|
51
|
+
lineage: string;
|
|
52
|
+
}>;
|
|
53
|
+
/** Rows no installed lineage knows (a newer build, or a foreign lineage). */
|
|
54
|
+
readonly unknown: JournalRowReport[];
|
|
55
|
+
}
|
|
56
|
+
/** The report of every scope. */
|
|
57
|
+
export interface MigrationsReport {
|
|
58
|
+
readonly scopes: ScopeMigrationReport[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Inspect one store's journal. Read-only.
|
|
62
|
+
*
|
|
63
|
+
* @param scope - Which store.
|
|
64
|
+
* @param dbPath - The store file.
|
|
65
|
+
* @param lineages - Lineages to report (installed folders). Every consolidated
|
|
66
|
+
* lineage still counts as known for drift and unknown rows.
|
|
67
|
+
* @param folderOf - Folder resolver (tests pass their own).
|
|
68
|
+
*/
|
|
69
|
+
export declare function inspectJournal(scope: DualScope, dbPath: string, lineages?: readonly string[], folderOf?: (lineage: string) => string): ScopeMigrationReport;
|
|
70
|
+
/**
|
|
71
|
+
* The migration journals of the project store (at `projectRoot`) and the
|
|
72
|
+
* global store. Read-only.
|
|
73
|
+
*/
|
|
74
|
+
export declare function inspectMigrations(projectRoot: string): MigrationsReport;
|
|
75
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/doctor/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAE,KAAK,SAAS,EAA0B,MAAM,2BAA2B,CAAC;AAOnF,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAM7C,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAK5C,CAAC;AAEF,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IAC5C,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChF,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,gBAAgB,EAAE,CAAC;CACtC;AAED,iCAAiC;AACjC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC;CACzC;AAqBD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,SAAS,MAAM,EAAkC,EAC3D,QAAQ,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAA2C,GACzE,oBAAoB,CA8DtB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,CAOvE"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo doctor migrations`: the migration journal of each store, read-only
|
|
3
|
+
* (journal spec §2.3a rule 2, "journal safety check"; R5-3 T12796).
|
|
4
|
+
*
|
|
5
|
+
* Every S2+ acceptance run reads the live journal count through this report,
|
|
6
|
+
* never through a literal: per scope, the journal's row count and head row,
|
|
7
|
+
* and per lineage sharing that journal, how many of its migration files are
|
|
8
|
+
* applied, which are pending, and any drift (a journal row with a local
|
|
9
|
+
* migration's name but a different hash, the #1719 condition). Rows no known
|
|
10
|
+
* lineage explains are listed too.
|
|
11
|
+
*
|
|
12
|
+
* The store is opened as a read-only snapshot; nothing is written.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
* @task T12796
|
|
16
|
+
*/
|
|
17
|
+
import { createHash } from 'node:crypto';
|
|
18
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { resolveDualScopeDbPath } from '../store/dual-scope-db.js';
|
|
21
|
+
import { openCleoDbSnapshot } from '../store/open-cleo-db.js';
|
|
22
|
+
import { CONSOLIDATED_JOURNAL_LINEAGES, resolveCorePackageMigrationsFolder, } from '../store/resolve-migrations-folder.js';
|
|
23
|
+
/** Lineages the project store's journal runs (the consolidated one first). */
|
|
24
|
+
export const PROJECT_LINEAGES = [
|
|
25
|
+
'drizzle-cleo-project',
|
|
26
|
+
'drizzle-tasks',
|
|
27
|
+
'drizzle-brain',
|
|
28
|
+
'drizzle-nexus',
|
|
29
|
+
'drizzle-conduit',
|
|
30
|
+
];
|
|
31
|
+
/** Lineages the global store's journal runs. */
|
|
32
|
+
export const GLOBAL_LINEAGES = [
|
|
33
|
+
'drizzle-cleo-global',
|
|
34
|
+
'drizzle-agent-registry',
|
|
35
|
+
'drizzle-skills',
|
|
36
|
+
'drizzle-telemetry',
|
|
37
|
+
];
|
|
38
|
+
/** The lineage's migration files, hashed as drizzle's readMigrationFiles hashes them. */
|
|
39
|
+
function localMigrations(folder) {
|
|
40
|
+
if (!existsSync(folder))
|
|
41
|
+
return [];
|
|
42
|
+
return readdirSync(folder)
|
|
43
|
+
.filter((d) => existsSync(join(folder, d, 'migration.sql')))
|
|
44
|
+
.sort((a, b) => a.localeCompare(b))
|
|
45
|
+
.map((name) => ({
|
|
46
|
+
name,
|
|
47
|
+
hash: createHash('sha256')
|
|
48
|
+
.update(readFileSync(join(folder, name, 'migration.sql')).toString())
|
|
49
|
+
.digest('hex'),
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Inspect one store's journal. Read-only.
|
|
54
|
+
*
|
|
55
|
+
* @param scope - Which store.
|
|
56
|
+
* @param dbPath - The store file.
|
|
57
|
+
* @param lineages - Lineages to report (installed folders). Every consolidated
|
|
58
|
+
* lineage still counts as known for drift and unknown rows.
|
|
59
|
+
* @param folderOf - Folder resolver (tests pass their own).
|
|
60
|
+
*/
|
|
61
|
+
export function inspectJournal(scope, dbPath, lineages = CONSOLIDATED_JOURNAL_LINEAGES, folderOf = resolveCorePackageMigrationsFolder) {
|
|
62
|
+
const base = { scope, dbPath, journalRows: 0, head: null, lineages: [], drift: [], unknown: [] };
|
|
63
|
+
if (!existsSync(dbPath))
|
|
64
|
+
return { ...base, exists: false };
|
|
65
|
+
const snap = openCleoDbSnapshot(dbPath, { readOnly: true });
|
|
66
|
+
try {
|
|
67
|
+
const db = snap.db;
|
|
68
|
+
const hasJournal = db
|
|
69
|
+
.prepare("SELECT 1 FROM main.sqlite_master WHERE type = 'table' AND name = '__drizzle_migrations'")
|
|
70
|
+
.get() !== undefined;
|
|
71
|
+
if (!hasJournal)
|
|
72
|
+
return { ...base, exists: true };
|
|
73
|
+
const hasName = db.prepare('PRAGMA main.table_info("__drizzle_migrations")').all().some((c) => c.name === 'name');
|
|
74
|
+
const rows = db
|
|
75
|
+
.prepare(`SELECT id, ${hasName ? 'name' : 'NULL AS name'}, hash FROM main."__drizzle_migrations" ORDER BY id`)
|
|
76
|
+
.all();
|
|
77
|
+
const byHash = new Set(rows.map((r) => r.hash));
|
|
78
|
+
const byName = new Map(rows.filter((r) => r.name).map((r) => [r.name, r]));
|
|
79
|
+
// Every hash any installed lineage defines: a row whose hash is here is
|
|
80
|
+
// accounted for, even when another lineage has a file of the same name
|
|
81
|
+
// (drizzle-cleo-project and drizzle-cleo-global share some names).
|
|
82
|
+
const known = new Set();
|
|
83
|
+
const locals = new Map();
|
|
84
|
+
for (const lineage of new Set([...lineages, ...CONSOLIDATED_JOURNAL_LINEAGES])) {
|
|
85
|
+
const local = localMigrations(folderOf(lineage));
|
|
86
|
+
if (lineages.includes(lineage))
|
|
87
|
+
locals.set(lineage, local);
|
|
88
|
+
for (const m of local)
|
|
89
|
+
known.add(m.hash);
|
|
90
|
+
}
|
|
91
|
+
const reports = [];
|
|
92
|
+
const drift = [];
|
|
93
|
+
for (const [lineage, local] of locals) {
|
|
94
|
+
const applied = local.filter((m) => byHash.has(m.hash)).length;
|
|
95
|
+
if (applied === 0)
|
|
96
|
+
continue; // a lineage this journal never ran
|
|
97
|
+
reports.push({
|
|
98
|
+
lineage,
|
|
99
|
+
local: local.length,
|
|
100
|
+
applied,
|
|
101
|
+
pending: local.filter((m) => !byName.has(m.name) && !byHash.has(m.hash)).map((m) => m.name),
|
|
102
|
+
});
|
|
103
|
+
for (const m of local) {
|
|
104
|
+
const row = byName.get(m.name);
|
|
105
|
+
if (row && !known.has(row.hash))
|
|
106
|
+
drift.push({ ...row, fileHash: m.hash, lineage });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
scope,
|
|
111
|
+
dbPath,
|
|
112
|
+
exists: true,
|
|
113
|
+
journalRows: rows.length,
|
|
114
|
+
head: rows.at(-1) ?? null,
|
|
115
|
+
lineages: reports,
|
|
116
|
+
drift,
|
|
117
|
+
unknown: rows.filter((r) => !known.has(r.hash) && !drift.some((d) => d.id === r.id)),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
snap.close();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The migration journals of the project store (at `projectRoot`) and the
|
|
126
|
+
* global store. Read-only.
|
|
127
|
+
*/
|
|
128
|
+
export function inspectMigrations(projectRoot) {
|
|
129
|
+
return {
|
|
130
|
+
scopes: [
|
|
131
|
+
inspectJournal('project', resolveDualScopeDbPath('project', projectRoot), PROJECT_LINEAGES),
|
|
132
|
+
inspectJournal('global', resolveDualScopeDbPath('global'), GLOBAL_LINEAGES),
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../../src/doctor/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAkB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,uCAAuC,CAAC;AAE/C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,eAAe;IACf,iBAAiB;CAClB,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,qBAAqB;IACrB,wBAAwB;IACxB,gBAAgB;IAChB,mBAAmB;CACpB,CAAC;AA8CF,yFAAyF;AACzF,SAAS,eAAe,CAAC,MAAc;IACrC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,WAAW,CAAC,MAAM,CAAC;SACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,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AAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACrF,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO;QACL,MAAM,EAAE;YACN,cAAc,CAAC,SAAS,EAAE,sBAAsB,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC;YAC3F,cAAc,CAAC,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;SAC5E;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo doctor` row `sync_sealer` (journal spec §2.5, §4.4; T13036).
|
|
3
|
+
*
|
|
4
|
+
* Read-only. It opens the project `cleo.db` as a snapshot and reports:
|
|
5
|
+
* - the capture backlog head: live captures, the oldest one's seq and age
|
|
6
|
+
* (a head that stays put across seals is stuck, and `sealPending` names
|
|
7
|
+
* the reason in `pending`);
|
|
8
|
+
* - quarantined captures per table (`_sync_quarantine`): those tables are
|
|
9
|
+
* suspect until the repair diff re-derives them (S3d);
|
|
10
|
+
* - a persisted sync flag that is still unreleased: the sealer refuses it,
|
|
11
|
+
* but its presence means something wrote it outside `setSyncFlag`.
|
|
12
|
+
*
|
|
13
|
+
* A store without the sealer tables reports `ok`: nothing to seal.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
* @task T13036
|
|
17
|
+
*/
|
|
18
|
+
/** The `sync_sealer` row of `cleo doctor`. */
|
|
19
|
+
export interface SyncSealerDoctorCheck {
|
|
20
|
+
readonly check: 'sync_sealer';
|
|
21
|
+
readonly status: 'ok' | 'warning' | 'error';
|
|
22
|
+
readonly message: string;
|
|
23
|
+
readonly details?: Record<string, unknown>;
|
|
24
|
+
readonly fix?: string;
|
|
25
|
+
}
|
|
26
|
+
/** What {@link inspectSyncSealer} found. */
|
|
27
|
+
export interface SyncSealerReport {
|
|
28
|
+
readonly dbPath: string;
|
|
29
|
+
readonly storeExists: boolean;
|
|
30
|
+
/** The sealer tables exist. */
|
|
31
|
+
readonly sealerInstalled: boolean;
|
|
32
|
+
readonly backlog: {
|
|
33
|
+
readonly live: number;
|
|
34
|
+
readonly oldestSeq: number | null;
|
|
35
|
+
readonly oldestAtMs: number | null;
|
|
36
|
+
};
|
|
37
|
+
/** Quarantined captures per table: those tables are suspect. */
|
|
38
|
+
readonly quarantined: Readonly<Record<string, number>>;
|
|
39
|
+
/** Unreleased sync flags that are persisted on. */
|
|
40
|
+
readonly unreleasedOn: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
/** A backlog head older than this is reported as a warning. */
|
|
43
|
+
export declare const SEAL_BACKLOG_STALE_MS: number;
|
|
44
|
+
/** Inspect the project store's sealer state. Read-only. */
|
|
45
|
+
export declare function inspectSyncSealer(projectRoot: string): SyncSealerReport;
|
|
46
|
+
/** The `sync_sealer` row of the default `cleo doctor` report. */
|
|
47
|
+
export declare function syncSealerDoctorCheck(projectRoot: string, now?: () => number): SyncSealerDoctorCheck;
|
|
48
|
+
//# sourceMappingURL=sync-sealer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-sealer.d.ts","sourceRoot":"","sources":["../../src/doctor/sync-sealer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,8CAA8C;AAC9C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,4CAA4C;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,+BAA+B;IAC/B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;KACpC,CAAC;IACF,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACvD,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,+DAA+D;AAC/D,eAAO,MAAM,qBAAqB,QAAsB,CAAC;AAEzD,2DAA2D;AAC3D,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB,CAmCvE;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,GAAG,GAAE,MAAM,MAAiB,GAC3B,qBAAqB,CA8CvB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo doctor` row `sync_sealer` (journal spec §2.5, §4.4; T13036).
|
|
3
|
+
*
|
|
4
|
+
* Read-only. It opens the project `cleo.db` as a snapshot and reports:
|
|
5
|
+
* - the capture backlog head: live captures, the oldest one's seq and age
|
|
6
|
+
* (a head that stays put across seals is stuck, and `sealPending` names
|
|
7
|
+
* the reason in `pending`);
|
|
8
|
+
* - quarantined captures per table (`_sync_quarantine`): those tables are
|
|
9
|
+
* suspect until the repair diff re-derives them (S3d);
|
|
10
|
+
* - a persisted sync flag that is still unreleased: the sealer refuses it,
|
|
11
|
+
* but its presence means something wrote it outside `setSyncFlag`.
|
|
12
|
+
*
|
|
13
|
+
* A store without the sealer tables reports `ok`: nothing to seal.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
* @task T13036
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync } from 'node:fs';
|
|
19
|
+
import { resolveDualScopeDbPath } from '../store/dual-scope-db.js';
|
|
20
|
+
import { openCleoDbSnapshot } from '../store/open-cleo-db.js';
|
|
21
|
+
import { readSyncFlags, UNRELEASED_FLAGS } from '../store/sync/flags.js';
|
|
22
|
+
import { hasTable } from '../store/sync/schema.js';
|
|
23
|
+
import { sealBacklog } from '../store/sync/seal-backlog.js';
|
|
24
|
+
/** A backlog head older than this is reported as a warning. */
|
|
25
|
+
export const SEAL_BACKLOG_STALE_MS = 24 * 60 * 60 * 1000;
|
|
26
|
+
/** Inspect the project store's sealer state. Read-only. */
|
|
27
|
+
export function inspectSyncSealer(projectRoot) {
|
|
28
|
+
const dbPath = resolveDualScopeDbPath('project', projectRoot);
|
|
29
|
+
const empty = {
|
|
30
|
+
dbPath,
|
|
31
|
+
storeExists: false,
|
|
32
|
+
sealerInstalled: false,
|
|
33
|
+
backlog: { live: 0, oldestSeq: null, oldestAtMs: null },
|
|
34
|
+
quarantined: {},
|
|
35
|
+
unreleasedOn: [],
|
|
36
|
+
};
|
|
37
|
+
if (!existsSync(dbPath))
|
|
38
|
+
return empty;
|
|
39
|
+
const snap = openCleoDbSnapshot(dbPath, { readOnly: true });
|
|
40
|
+
try {
|
|
41
|
+
const db = snap.db;
|
|
42
|
+
const installed = hasTable(db, '_sync_txn') && hasTable(db, '_sync_quarantine');
|
|
43
|
+
const quarantined = {};
|
|
44
|
+
if (installed) {
|
|
45
|
+
for (const r of db
|
|
46
|
+
.prepare('SELECT tbl, count(*) AS n FROM _sync_quarantine GROUP BY tbl ORDER BY tbl')
|
|
47
|
+
.all()) {
|
|
48
|
+
quarantined[r.tbl] = r.n;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const flags = hasTable(db, '_sync_meta') ? readSyncFlags(db) : null;
|
|
52
|
+
return {
|
|
53
|
+
dbPath,
|
|
54
|
+
storeExists: true,
|
|
55
|
+
sealerInstalled: installed,
|
|
56
|
+
backlog: sealBacklog(db),
|
|
57
|
+
quarantined,
|
|
58
|
+
unreleasedOn: flags ? [...UNRELEASED_FLAGS].filter((f) => flags[f] === true).sort() : [],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
snap.close();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** The `sync_sealer` row of the default `cleo doctor` report. */
|
|
66
|
+
export function syncSealerDoctorCheck(projectRoot, now = Date.now) {
|
|
67
|
+
let r;
|
|
68
|
+
try {
|
|
69
|
+
r = inspectSyncSealer(projectRoot);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return {
|
|
73
|
+
check: 'sync_sealer',
|
|
74
|
+
status: 'warning',
|
|
75
|
+
message: `sealer state unreadable: ${error instanceof Error ? error.message : String(error)}`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (!r.storeExists)
|
|
79
|
+
return { check: 'sync_sealer', status: 'ok', message: 'no project store yet' };
|
|
80
|
+
const details = { ...r };
|
|
81
|
+
const head = r.backlog.live === 0
|
|
82
|
+
? 'no captures waiting'
|
|
83
|
+
: `${r.backlog.live} capture(s) waiting, head seq ${r.backlog.oldestSeq}` +
|
|
84
|
+
(r.backlog.oldestAtMs !== null
|
|
85
|
+
? `, ${Math.round((now() - r.backlog.oldestAtMs) / 60_000)} min old`
|
|
86
|
+
: '');
|
|
87
|
+
const problems = [];
|
|
88
|
+
const suspect = Object.entries(r.quarantined);
|
|
89
|
+
if (suspect.length > 0) {
|
|
90
|
+
problems.push(`quarantined capture(s), table(s) suspect: ${suspect.map(([t, n]) => `${t} (${n})`).join(', ')}`);
|
|
91
|
+
}
|
|
92
|
+
if (r.unreleasedOn.length > 0) {
|
|
93
|
+
problems.push(`unreleased sync flag(s) persisted on: ${r.unreleasedOn.join(', ')} (the sealer refuses them)`);
|
|
94
|
+
}
|
|
95
|
+
if (r.backlog.oldestAtMs !== null && now() - r.backlog.oldestAtMs > SEAL_BACKLOG_STALE_MS) {
|
|
96
|
+
problems.push(`the backlog head has waited over a day (${head})`);
|
|
97
|
+
}
|
|
98
|
+
if (problems.length > 0) {
|
|
99
|
+
return {
|
|
100
|
+
check: 'sync_sealer',
|
|
101
|
+
status: 'warning',
|
|
102
|
+
message: `${problems.join('; ')}; ${head}`,
|
|
103
|
+
details,
|
|
104
|
+
fix: "Quarantined tables are re-derived by the repair diff; a stuck head is named in 'pending' by the next seal",
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return { check: 'sync_sealer', status: 'ok', message: head, details };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=sync-sealer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-sealer.js","sourceRoot":"","sources":["../../src/doctor/sync-sealer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AA4B5D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CA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AAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo doctor` row `sync_triggers` (journal spec §2.3a rule 9, §3.5 Rule 4;
|
|
3
|
+
* C2(b), T12819).
|
|
4
|
+
*
|
|
5
|
+
* Read-only. It opens the project `cleo.db` as a snapshot and reports:
|
|
6
|
+
* - `cleo_trigger_suspend` missing (every write to tasks, sessions and
|
|
7
|
+
* acceptance criteria then fails, and a 9.24 binary fails closed) or
|
|
8
|
+
* holding a committed row;
|
|
9
|
+
* - a trigger no class rule covers;
|
|
10
|
+
* - an owned guard or side-effect trigger missing, or whose live text
|
|
11
|
+
* differs from its owned DDL (for example without its suspension clause);
|
|
12
|
+
* - a capture trigger (`_sync_cap_*`) while `_sync_capture` is missing.
|
|
13
|
+
*
|
|
14
|
+
* The repair is the next open (the open pass itself): any `cleo` command against the project
|
|
15
|
+
* recreates the table (step 0) and re-runs the owned DDL of every differing
|
|
16
|
+
* trigger. A store whose journal has not reached the C2 migration yet is
|
|
17
|
+
* reported as pending, not broken.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
* @task T12819
|
|
21
|
+
*/
|
|
22
|
+
import { type OwnedTriggerFinding } from '../store/sync/trigger-classes.js';
|
|
23
|
+
/** The `sync_triggers` row of `cleo doctor`. */
|
|
24
|
+
export interface SyncTriggersDoctorCheck {
|
|
25
|
+
readonly check: 'sync_triggers';
|
|
26
|
+
readonly status: 'ok' | 'warning' | 'error';
|
|
27
|
+
readonly message: string;
|
|
28
|
+
readonly details?: Record<string, unknown>;
|
|
29
|
+
readonly fix?: string;
|
|
30
|
+
}
|
|
31
|
+
/** What {@link inspectSyncTriggers} found. */
|
|
32
|
+
export interface SyncTriggersReport {
|
|
33
|
+
readonly dbPath: string;
|
|
34
|
+
readonly storeExists: boolean;
|
|
35
|
+
/** The C2 migration is journaled. */
|
|
36
|
+
readonly clauseMigrationApplied: boolean;
|
|
37
|
+
readonly suspendTable: 'present' | 'missing';
|
|
38
|
+
readonly suspendRows: number;
|
|
39
|
+
readonly unclassified: string[];
|
|
40
|
+
readonly owned: OwnedTriggerFinding[];
|
|
41
|
+
readonly orphanedCaptureTriggers: string[];
|
|
42
|
+
/** With `sync.capture` on: capture triggers missing, differing from the generated text, or extra (rule 9). */
|
|
43
|
+
readonly captureDrift: {
|
|
44
|
+
missing: string[];
|
|
45
|
+
differing: string[];
|
|
46
|
+
extra: string[];
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Inspect the project store's triggers. Read-only. */
|
|
50
|
+
export declare function inspectSyncTriggers(projectRoot: string): SyncTriggersReport;
|
|
51
|
+
/** The `sync_triggers` row of the default `cleo doctor` report. */
|
|
52
|
+
export declare function syncTriggersDoctorCheck(projectRoot: string): SyncTriggersDoctorCheck;
|
|
53
|
+
//# sourceMappingURL=sync-triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-triggers.d.ts","sourceRoot":"","sources":["../../src/doctor/sync-triggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,OAAO,EAKL,KAAK,mBAAmB,EAGzB,MAAM,kCAAkC,CAAC;AAE1C,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,8CAA8C;AAC9C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,qCAAqC;IACrC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACtC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAC3C,8GAA8G;IAC9G,QAAQ,CAAC,YAAY,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CACpF;AAKD,uDAAuD;AACvD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,kBAAkB,CAyD3E;AA6BD,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,CAmEpF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo doctor` row `sync_triggers` (journal spec §2.3a rule 9, §3.5 Rule 4;
|
|
3
|
+
* C2(b), T12819).
|
|
4
|
+
*
|
|
5
|
+
* Read-only. It opens the project `cleo.db` as a snapshot and reports:
|
|
6
|
+
* - `cleo_trigger_suspend` missing (every write to tasks, sessions and
|
|
7
|
+
* acceptance criteria then fails, and a 9.24 binary fails closed) or
|
|
8
|
+
* holding a committed row;
|
|
9
|
+
* - a trigger no class rule covers;
|
|
10
|
+
* - an owned guard or side-effect trigger missing, or whose live text
|
|
11
|
+
* differs from its owned DDL (for example without its suspension clause);
|
|
12
|
+
* - a capture trigger (`_sync_cap_*`) while `_sync_capture` is missing.
|
|
13
|
+
*
|
|
14
|
+
* The repair is the next open (the open pass itself): any `cleo` command against the project
|
|
15
|
+
* recreates the table (step 0) and re-runs the owned DDL of every differing
|
|
16
|
+
* trigger. A store whose journal has not reached the C2 migration yet is
|
|
17
|
+
* reported as pending, not broken.
|
|
18
|
+
*
|
|
19
|
+
* @module
|
|
20
|
+
* @task T12819
|
|
21
|
+
*/
|
|
22
|
+
import { existsSync } from 'node:fs';
|
|
23
|
+
import { resolveDualScopeDbPath } from '../store/dual-scope-db.js';
|
|
24
|
+
import { openCleoDbSnapshot } from '../store/open-cleo-db.js';
|
|
25
|
+
import { generateCaptureTriggers } from '../store/sync/capture.js';
|
|
26
|
+
import { readSyncFlags } from '../store/sync/flags.js';
|
|
27
|
+
import { CAPTURE_TRIGGER_PREFIX, classifyStoreTriggers, hasTriggerSuspendTable, normalizeSql, TRIGGER_CLAUSE_MIGRATION, verifyOwnedTriggers, } from '../store/sync/trigger-classes.js';
|
|
28
|
+
const FIX = "The next open repairs it: run any 'cleo' command in this project, and the open pass recreates cleo_trigger_suspend (before migrations) and re-runs the owned DDL of every differing trigger";
|
|
29
|
+
/** Inspect the project store's triggers. Read-only. */
|
|
30
|
+
export function inspectSyncTriggers(projectRoot) {
|
|
31
|
+
const dbPath = resolveDualScopeDbPath('project', projectRoot);
|
|
32
|
+
const empty = {
|
|
33
|
+
dbPath,
|
|
34
|
+
storeExists: false,
|
|
35
|
+
clauseMigrationApplied: false,
|
|
36
|
+
suspendTable: 'missing',
|
|
37
|
+
suspendRows: 0,
|
|
38
|
+
unclassified: [],
|
|
39
|
+
owned: [],
|
|
40
|
+
orphanedCaptureTriggers: [],
|
|
41
|
+
captureDrift: { missing: [], differing: [], extra: [] },
|
|
42
|
+
};
|
|
43
|
+
if (!existsSync(dbPath))
|
|
44
|
+
return empty;
|
|
45
|
+
const snap = openCleoDbSnapshot(dbPath, { readOnly: true });
|
|
46
|
+
try {
|
|
47
|
+
const db = snap.db;
|
|
48
|
+
const journaled = db
|
|
49
|
+
.prepare("SELECT 1 FROM main.sqlite_master WHERE type = 'table' AND name = '__drizzle_migrations'")
|
|
50
|
+
.get() !== undefined &&
|
|
51
|
+
db
|
|
52
|
+
.prepare('SELECT 1 FROM main."__drizzle_migrations" WHERE name = ?')
|
|
53
|
+
.get(TRIGGER_CLAUSE_MIGRATION) !== undefined;
|
|
54
|
+
const present = hasTriggerSuspendTable(db);
|
|
55
|
+
const rows = present
|
|
56
|
+
? db.prepare('SELECT count(*) AS n FROM cleo_trigger_suspend').get().n
|
|
57
|
+
: 0;
|
|
58
|
+
const captureTriggers = db
|
|
59
|
+
.prepare("SELECT name FROM sqlite_master WHERE type = 'trigger' AND substr(name, 1, length(?)) = ?")
|
|
60
|
+
.all(CAPTURE_TRIGGER_PREFIX, CAPTURE_TRIGGER_PREFIX).map((r) => r.name);
|
|
61
|
+
const hasCapture = db
|
|
62
|
+
.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = '_sync_capture'")
|
|
63
|
+
.get() !== undefined;
|
|
64
|
+
return {
|
|
65
|
+
dbPath,
|
|
66
|
+
storeExists: true,
|
|
67
|
+
clauseMigrationApplied: journaled,
|
|
68
|
+
suspendTable: present ? 'present' : 'missing',
|
|
69
|
+
suspendRows: rows,
|
|
70
|
+
unclassified: classifyStoreTriggers(db, 'project').unclassified,
|
|
71
|
+
owned: journaled ? verifyOwnedTriggers(db) : [],
|
|
72
|
+
orphanedCaptureTriggers: hasCapture ? [] : captureTriggers,
|
|
73
|
+
captureDrift: readSyncFlags(db)['sync.capture']
|
|
74
|
+
? captureDrift(db)
|
|
75
|
+
: { missing: [], differing: [], extra: [] },
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
snap.close();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Live capture triggers against the text generated for the current schema. */
|
|
83
|
+
function captureDrift(db) {
|
|
84
|
+
const want = new Map(generateCaptureTriggers(db, 'project').map((t) => [t.name, t.sql]));
|
|
85
|
+
const live = new Map(db
|
|
86
|
+
.prepare("SELECT name, sql FROM sqlite_master WHERE type = 'trigger' AND substr(name, 1, length(?)) = ?")
|
|
87
|
+
.all(CAPTURE_TRIGGER_PREFIX, CAPTURE_TRIGGER_PREFIX).map((r) => [r.name, r.sql]));
|
|
88
|
+
return {
|
|
89
|
+
missing: [...want.keys()].filter((n) => !live.has(n)),
|
|
90
|
+
differing: [...want]
|
|
91
|
+
.filter(([n, sql]) => live.has(n) && normalizeSql(live.get(n)) !== normalizeSql(sql))
|
|
92
|
+
.map(([n]) => n),
|
|
93
|
+
extra: [...live.keys()].filter((n) => !want.has(n)),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** The `sync_triggers` row of the default `cleo doctor` report. */
|
|
97
|
+
export function syncTriggersDoctorCheck(projectRoot) {
|
|
98
|
+
let r;
|
|
99
|
+
try {
|
|
100
|
+
r = inspectSyncTriggers(projectRoot);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
return {
|
|
104
|
+
check: 'sync_triggers',
|
|
105
|
+
status: 'warning',
|
|
106
|
+
message: `trigger state unreadable: ${error instanceof Error ? error.message : String(error)}`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
if (!r.storeExists) {
|
|
110
|
+
return { check: 'sync_triggers', status: 'ok', message: 'no project store yet' };
|
|
111
|
+
}
|
|
112
|
+
const details = { ...r };
|
|
113
|
+
const problems = [];
|
|
114
|
+
if (r.clauseMigrationApplied && r.suspendTable === 'missing') {
|
|
115
|
+
problems.push('cleo_trigger_suspend is missing: writes to tasks, sessions and acceptance criteria fail until the next open recreates it');
|
|
116
|
+
}
|
|
117
|
+
if (r.suspendRows > 0)
|
|
118
|
+
problems.push(`cleo_trigger_suspend holds ${r.suspendRows} committed row(s)`);
|
|
119
|
+
if (r.owned.length > 0) {
|
|
120
|
+
problems.push(`owned trigger(s) differ from their DDL: ${r.owned.map((f) => `${f.name} (${f.problem})`).join(', ')}`);
|
|
121
|
+
}
|
|
122
|
+
if (r.orphanedCaptureTriggers.length > 0) {
|
|
123
|
+
problems.push(`capture trigger(s) without _sync_capture: ${r.orphanedCaptureTriggers.join(', ')}`);
|
|
124
|
+
}
|
|
125
|
+
const drift = r.captureDrift;
|
|
126
|
+
if (drift.missing.length + drift.differing.length + drift.extra.length > 0) {
|
|
127
|
+
problems.push(`capture triggers differ from the generated set (missing ${drift.missing.length}, differing ${drift.differing.length}, extra ${drift.extra.length})`);
|
|
128
|
+
}
|
|
129
|
+
if (r.unclassified.length > 0)
|
|
130
|
+
problems.push(`unclassified trigger(s): ${r.unclassified.join(', ')}`);
|
|
131
|
+
if (problems.length > 0) {
|
|
132
|
+
const blocking = (r.clauseMigrationApplied && r.suspendTable === 'missing') ||
|
|
133
|
+
r.orphanedCaptureTriggers.length > 0;
|
|
134
|
+
return {
|
|
135
|
+
check: 'sync_triggers',
|
|
136
|
+
status: blocking ? 'error' : 'warning',
|
|
137
|
+
message: problems.join('; '),
|
|
138
|
+
details,
|
|
139
|
+
fix: FIX,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (!r.clauseMigrationApplied) {
|
|
143
|
+
return {
|
|
144
|
+
check: 'sync_triggers',
|
|
145
|
+
status: 'ok',
|
|
146
|
+
message: `trigger-suspension migration ${TRIGGER_CLAUSE_MIGRATION} pending; the next open applies it`,
|
|
147
|
+
details,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
check: 'sync_triggers',
|
|
152
|
+
status: 'ok',
|
|
153
|
+
message: 'every trigger is classified; owned triggers match their DDL',
|
|
154
|
+
details,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=sync-triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-triggers.js","sourceRoot":"","sources":["../../src/doctor/sync-triggers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;A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