@cleocode/core 2026.5.133 → 2026.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binaries/README.md +49 -27
- package/dist/agents/{agent-registry.d.ts → agent-capacity-tracker.d.ts} +2 -2
- package/dist/agents/agent-capacity-tracker.d.ts.map +1 -0
- package/dist/agents/{agent-registry.js → agent-capacity-tracker.js} +2 -2
- package/dist/agents/agent-capacity-tracker.js.map +1 -0
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +4 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/seed-install.d.ts +1 -1
- package/dist/agents/seed-install.d.ts.map +1 -1
- package/dist/agents/seed-install.js +42 -36
- package/dist/agents/seed-install.js.map +1 -1
- package/dist/caamp-export.d.ts +18 -0
- package/dist/caamp-export.d.ts.map +1 -0
- package/dist/caamp-export.js +18 -0
- package/dist/caamp-export.js.map +1 -0
- package/dist/conduit/local-transport.d.ts +1 -1
- package/dist/conduit/local-transport.d.ts.map +1 -1
- package/dist/conduit/local-transport.js +69 -43
- package/dist/conduit/local-transport.js.map +1 -1
- package/dist/dispatch/mutate-projection.d.ts.map +1 -1
- package/dist/dispatch/mutate-projection.js +11 -0
- package/dist/dispatch/mutate-projection.js.map +1 -1
- package/dist/docs/docs-read-model.d.ts +7 -0
- package/dist/docs/docs-read-model.d.ts.map +1 -1
- package/dist/docs/docs-read-model.js +5 -0
- package/dist/docs/docs-read-model.js.map +1 -1
- package/dist/docs/supersede.d.ts.map +1 -1
- package/dist/docs/supersede.js +12 -7
- package/dist/docs/supersede.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +10 -9
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/git-shim-export.d.ts +18 -0
- package/dist/git-shim-export.d.ts.map +1 -0
- package/dist/git-shim-export.js +18 -0
- package/dist/git-shim-export.js.map +1 -0
- package/dist/hooks/payload-schemas.d.ts +2 -2
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +39 -32
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +11 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +14 -5
- package/dist/internal.js.map +1 -1
- package/dist/lafs-export.d.ts +18 -0
- package/dist/lafs-export.d.ts.map +1 -0
- package/dist/lafs-export.js +18 -0
- package/dist/lafs-export.js.map +1 -0
- package/dist/lifecycle/effective-stage.js +1 -1
- package/dist/lifecycle/index.js +1 -1
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/rollup.js +1 -1
- package/dist/llm/credential-pool.d.ts +17 -0
- package/dist/llm/credential-pool.d.ts.map +1 -1
- package/dist/llm/credential-pool.js +40 -1
- package/dist/llm/credential-pool.js.map +1 -1
- package/dist/llm/plugin-facade.d.ts.map +1 -1
- package/dist/llm/plugin-facade.js +11 -19
- package/dist/llm/plugin-facade.js.map +1 -1
- package/dist/llm/role-executor.d.ts +8 -0
- package/dist/llm/role-executor.d.ts.map +1 -1
- package/dist/llm/role-executor.js +96 -4
- package/dist/llm/role-executor.js.map +1 -1
- package/dist/llm/role-resolver.d.ts.map +1 -1
- package/dist/llm/role-resolver.js +56 -1
- package/dist/llm/role-resolver.js.map +1 -1
- package/dist/llm/transports/codex-oauth-headers.d.ts +51 -0
- package/dist/llm/transports/codex-oauth-headers.d.ts.map +1 -0
- package/dist/llm/transports/codex-oauth-headers.js +89 -0
- package/dist/llm/transports/codex-oauth-headers.js.map +1 -0
- package/dist/memory/claude-mem-migration.d.ts.map +1 -1
- package/dist/memory/claude-mem-migration.js +1 -3
- package/dist/memory/claude-mem-migration.js.map +1 -1
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +77 -23
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
- package/dist/memory/graph-memory-bridge.js +12 -6
- package/dist/memory/graph-memory-bridge.js.map +1 -1
- package/dist/memory/learnings.d.ts +2 -2
- package/dist/memory/nexus-plasticity.d.ts +21 -9
- package/dist/memory/nexus-plasticity.d.ts.map +1 -1
- package/dist/memory/nexus-plasticity.js +44 -22
- package/dist/memory/nexus-plasticity.js.map +1 -1
- package/dist/memory/patterns.d.ts +2 -2
- package/dist/memory/redaction.d.ts +19 -3
- package/dist/memory/redaction.d.ts.map +1 -1
- package/dist/memory/redaction.js +22 -94
- package/dist/memory/redaction.js.map +1 -1
- package/dist/metrics/token-service.d.ts +8 -2
- package/dist/metrics/token-service.d.ts.map +1 -1
- package/dist/metrics/token-service.js +1 -1
- package/dist/metrics/token-service.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +6 -8
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.js +3 -3
- package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
- package/dist/nexus/clusters.d.ts.map +1 -1
- package/dist/nexus/clusters.js +3 -2
- package/dist/nexus/clusters.js.map +1 -1
- package/dist/nexus/context.d.ts.map +1 -1
- package/dist/nexus/context.js +10 -16
- package/dist/nexus/context.js.map +1 -1
- package/dist/nexus/diff.d.ts.map +1 -1
- package/dist/nexus/diff.js +6 -4
- package/dist/nexus/diff.js.map +1 -1
- package/dist/nexus/export.d.ts.map +1 -1
- package/dist/nexus/export.js +7 -4
- package/dist/nexus/export.js.map +1 -1
- package/dist/nexus/flows.d.ts.map +1 -1
- package/dist/nexus/flows.js +3 -1
- package/dist/nexus/flows.js.map +1 -1
- package/dist/nexus/impact.d.ts +1 -1
- package/dist/nexus/impact.d.ts.map +1 -1
- package/dist/nexus/impact.js +31 -17
- package/dist/nexus/impact.js.map +1 -1
- package/dist/nexus/living-brain.d.ts.map +1 -1
- package/dist/nexus/living-brain.js +27 -15
- package/dist/nexus/living-brain.js.map +1 -1
- package/dist/nexus/nexus-bridge.d.ts.map +1 -1
- package/dist/nexus/nexus-bridge.js +28 -29
- package/dist/nexus/nexus-bridge.js.map +1 -1
- package/dist/nexus/plasticity-queries.d.ts +4 -2
- package/dist/nexus/plasticity-queries.d.ts.map +1 -1
- package/dist/nexus/plasticity-queries.js +27 -15
- package/dist/nexus/plasticity-queries.js.map +1 -1
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +6 -2
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +65 -30
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/route-analysis.d.ts +3 -2
- package/dist/nexus/route-analysis.d.ts.map +1 -1
- package/dist/nexus/route-analysis.js +11 -10
- package/dist/nexus/route-analysis.js.map +1 -1
- package/dist/nexus/sigil.d.ts.map +1 -1
- package/dist/nexus/sigil.js +60 -13
- package/dist/nexus/sigil.js.map +1 -1
- package/dist/nexus/user-profile.d.ts +2 -1
- package/dist/nexus/user-profile.d.ts.map +1 -1
- package/dist/nexus/user-profile.js +8 -4
- package/dist/nexus/user-profile.js.map +1 -1
- package/dist/orchestrate/index.d.ts +1 -1
- package/dist/orchestrate/index.d.ts.map +1 -1
- package/dist/orchestrate/index.js +1 -1
- package/dist/orchestrate/index.js.map +1 -1
- package/dist/orchestrate/plan.d.ts +3 -3
- package/dist/orchestrate/plan.d.ts.map +1 -1
- package/dist/orchestrate/plan.js +7 -7
- package/dist/orchestrate/plan.js.map +1 -1
- package/dist/orchestrate/spawn-ops.js +2 -2
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/classify.d.ts +2 -2
- package/dist/orchestration/classify.js +3 -3
- package/dist/orchestration/classify.js.map +1 -1
- package/dist/orchestration/validate-spawn.d.ts.map +1 -1
- package/dist/orchestration/validate-spawn.js +5 -5
- package/dist/orchestration/validate-spawn.js.map +1 -1
- package/dist/paths-export.d.ts +18 -0
- package/dist/paths-export.d.ts.map +1 -0
- package/dist/paths-export.js +18 -0
- package/dist/paths-export.js.map +1 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +24 -11
- package/dist/paths.js.map +1 -1
- package/dist/playbooks/index.d.ts +1 -0
- package/dist/playbooks/index.d.ts.map +1 -1
- package/dist/playbooks/index.js +4 -0
- package/dist/playbooks/index.js.map +1 -1
- package/dist/playbooks/skill-node-executor.d.ts +155 -0
- package/dist/playbooks/skill-node-executor.d.ts.map +1 -0
- package/dist/playbooks/skill-node-executor.js +156 -0
- package/dist/playbooks/skill-node-executor.js.map +1 -0
- package/dist/repair.d.ts +3 -7
- package/dist/repair.d.ts.map +1 -1
- package/dist/repair.js +5 -43
- package/dist/repair.js.map +1 -1
- package/dist/sagas/migrate-containment.js +7 -7
- package/dist/sagas/migrate-containment.js.map +1 -1
- package/dist/scaffold/ensure-dirs.d.ts +8 -2
- package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
- package/dist/scaffold/ensure-dirs.js +24 -11
- package/dist/scaffold/ensure-dirs.js.map +1 -1
- package/dist/scaffold/project-detection.d.ts +5 -1
- package/dist/scaffold/project-detection.d.ts.map +1 -1
- package/dist/scaffold/project-detection.js +9 -5
- package/dist/scaffold/project-detection.js.map +1 -1
- package/dist/sentient/hygiene-scan.js +6 -6
- package/dist/sentient/hygiene-scan.js.map +1 -1
- package/dist/sentient/proposal-dedup.js +2 -2
- package/dist/sentient/proposal-rate-limiter.js +1 -1
- package/dist/sentient/propose-tick.js +5 -5
- package/dist/sentient/propose-tick.js.map +1 -1
- package/dist/sentient/stage-drift-tick.js +3 -3
- package/dist/sentient/stage-drift-tick.js.map +1 -1
- package/dist/sequence/index.d.ts.map +1 -1
- package/dist/sequence/index.js +6 -2
- package/dist/sequence/index.js.map +1 -1
- package/dist/setup/sections/verification.js +2 -2
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/shutdown.d.ts +81 -0
- package/dist/shutdown.d.ts.map +1 -0
- package/dist/shutdown.js +105 -0
- package/dist/shutdown.js.map +1 -0
- package/dist/skills/index.d.ts +2 -0
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/skill-executor-adapter.d.ts +136 -0
- package/dist/skills/skill-executor-adapter.d.ts.map +1 -0
- package/dist/skills/skill-executor-adapter.js +137 -0
- package/dist/skills/skill-executor-adapter.js.map +1 -0
- package/dist/skills/usage-recorder.d.ts.map +1 -1
- package/dist/skills/usage-recorder.js +30 -0
- package/dist/skills/usage-recorder.js.map +1 -1
- package/dist/skills-export.d.ts +23 -0
- package/dist/skills-export.d.ts.map +1 -0
- package/dist/skills-export.js +23 -0
- package/dist/skills-export.js.map +1 -0
- package/dist/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +8 -3
- package/dist/stats/index.js.map +1 -1
- package/dist/store/agent-doctor.d.ts +3 -3
- package/dist/store/agent-doctor.d.ts.map +1 -1
- package/dist/store/agent-doctor.js +18 -13
- package/dist/store/agent-doctor.js.map +1 -1
- package/dist/store/agent-install.d.ts +6 -5
- package/dist/store/agent-install.d.ts.map +1 -1
- package/dist/store/agent-install.js +20 -16
- package/dist/store/agent-install.js.map +1 -1
- package/dist/store/agent-registry-accessor.d.ts +66 -28
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.js +248 -167
- package/dist/store/agent-registry-accessor.js.map +1 -1
- package/dist/store/agent-registry-store.d.ts +242 -0
- package/dist/store/agent-registry-store.d.ts.map +1 -0
- package/dist/store/agent-registry-store.js +501 -0
- package/dist/store/agent-registry-store.js.map +1 -0
- package/dist/store/agent-resolver.d.ts +8 -8
- package/dist/store/agent-resolver.d.ts.map +1 -1
- package/dist/store/agent-resolver.js +19 -17
- package/dist/store/agent-resolver.js.map +1 -1
- package/dist/store/backup-pack.d.ts.map +1 -1
- package/dist/store/backup-pack.js +24 -8
- package/dist/store/backup-pack.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts +181 -74
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +307 -528
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/cross-db-cleanup.d.ts +5 -5
- package/dist/store/cross-db-cleanup.d.ts.map +1 -1
- package/dist/store/cross-db-cleanup.js +12 -10
- package/dist/store/cross-db-cleanup.js.map +1 -1
- package/dist/store/data-accessor.d.ts +4 -4
- package/dist/store/data-accessor.js +5 -5
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/data-safety-central.d.ts +83 -1
- package/dist/store/data-safety-central.d.ts.map +1 -1
- package/dist/store/data-safety-central.js +257 -0
- package/dist/store/data-safety-central.js.map +1 -1
- package/dist/store/db-helpers.d.ts +8 -2
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +6 -2
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts +46 -4
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +103 -9
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts +116 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js +274 -0
- package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -0
- package/dist/store/exodus/index.d.ts +18 -0
- package/dist/store/exodus/index.d.ts.map +1 -0
- package/dist/store/exodus/index.js +18 -0
- package/dist/store/exodus/index.js.map +1 -0
- package/dist/store/exodus/migrate.d.ts +160 -0
- package/dist/store/exodus/migrate.d.ts.map +1 -0
- package/dist/store/exodus/migrate.js +1220 -0
- package/dist/store/exodus/migrate.js.map +1 -0
- package/dist/store/exodus/on-open.d.ts +189 -0
- package/dist/store/exodus/on-open.d.ts.map +1 -0
- package/dist/store/exodus/on-open.js +464 -0
- package/dist/store/exodus/on-open.js.map +1 -0
- package/dist/store/exodus/plan.d.ts +44 -0
- package/dist/store/exodus/plan.d.ts.map +1 -0
- package/dist/store/exodus/plan.js +178 -0
- package/dist/store/exodus/plan.js.map +1 -0
- package/dist/store/exodus/status.d.ts +22 -0
- package/dist/store/exodus/status.d.ts.map +1 -0
- package/dist/store/exodus/status.js +88 -0
- package/dist/store/exodus/status.js.map +1 -0
- package/dist/store/exodus/table-name-map.d.ts +173 -0
- package/dist/store/exodus/table-name-map.d.ts.map +1 -0
- package/dist/store/exodus/table-name-map.js +660 -0
- package/dist/store/exodus/table-name-map.js.map +1 -0
- package/dist/store/exodus/types.d.ts +169 -0
- package/dist/store/exodus/types.d.ts.map +1 -0
- package/dist/store/exodus/types.js +21 -0
- package/dist/store/exodus/types.js.map +1 -0
- package/dist/store/exodus/verify-migration.d.ts +72 -0
- package/dist/store/exodus/verify-migration.d.ts.map +1 -0
- package/dist/store/exodus/verify-migration.js +678 -0
- package/dist/store/exodus/verify-migration.js.map +1 -0
- package/dist/store/exodus/verify.d.ts +58 -0
- package/dist/store/exodus/verify.d.ts.map +1 -0
- package/dist/store/exodus/verify.js +74 -0
- package/dist/store/exodus/verify.js.map +1 -0
- package/dist/store/index.d.ts +2 -3
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +2 -3
- package/dist/store/index.js.map +1 -1
- package/dist/store/memory-accessor.d.ts +31 -0
- package/dist/store/memory-accessor.d.ts.map +1 -1
- package/dist/store/memory-accessor.js +38 -0
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts +86 -13
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +326 -528
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/migrate-signaldock-to-conduit.d.ts +1 -1
- package/dist/store/migrate-signaldock-to-conduit.d.ts.map +1 -1
- package/dist/store/migrate-signaldock-to-conduit.js +126 -35
- package/dist/store/migrate-signaldock-to-conduit.js.map +1 -1
- package/dist/store/migration-manager.d.ts +49 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +167 -67
- package/dist/store/migration-manager.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 +32 -3
- package/dist/store/migration-sqlite.js.map +1 -1
- package/dist/store/nexus-sqlite.d.ts +152 -29
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.js +496 -177
- package/dist/store/nexus-sqlite.js.map +1 -1
- package/dist/store/nexus-validation-schemas.d.ts +32 -32
- package/dist/store/open-cleo-db.d.ts +37 -40
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +76 -153
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/role-accessors-impl.d.ts +4 -4
- package/dist/store/role-accessors-impl.d.ts.map +1 -1
- package/dist/store/role-accessors-impl.js +18 -15
- package/dist/store/role-accessors-impl.js.map +1 -1
- package/dist/store/schema/{signaldock-schema.d.ts → agent-registry-schema.d.ts} +15 -5
- package/dist/store/schema/agent-registry-schema.d.ts.map +1 -0
- package/dist/store/schema/{signaldock-schema.js → agent-registry-schema.js} +15 -5
- package/dist/store/schema/agent-registry-schema.js.map +1 -0
- package/dist/store/schema/agent-schema.d.ts +1 -1
- package/dist/store/schema/agent-schema.js +4 -4
- package/dist/store/schema/agent-schema.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +1 -1
- package/dist/store/schema/audit.d.ts +15 -5
- package/dist/store/schema/audit.d.ts.map +1 -1
- package/dist/store/schema/audit.js +12 -2
- package/dist/store/schema/audit.js.map +1 -1
- package/dist/store/schema/background-jobs.d.ts +1 -1
- package/dist/store/schema/cleo-global/{signaldock.d.ts → agent-registry.d.ts} +277 -271
- package/dist/store/schema/cleo-global/agent-registry.d.ts.map +1 -0
- package/dist/store/schema/cleo-global/{signaldock.js → agent-registry.js} +136 -125
- package/dist/store/schema/cleo-global/agent-registry.js.map +1 -0
- package/dist/store/schema/cleo-global/index.d.ts +29 -22
- package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/index.js +29 -22
- package/dist/store/schema/cleo-global/index.js.map +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +36 -1034
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +32 -337
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +16 -0
- package/dist/store/schema/cleo-global/skills.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/skills.js +11 -0
- package/dist/store/schema/cleo-global/skills.js.map +1 -1
- package/dist/store/schema/{cleo-project → cleo-global}/telemetry.d.ts +33 -17
- package/dist/store/schema/cleo-global/telemetry.d.ts.map +1 -0
- package/dist/store/schema/{cleo-project → cleo-global}/telemetry.js +30 -18
- package/dist/store/schema/cleo-global/telemetry.js.map +1 -0
- package/dist/store/schema/cleo-project/audit.d.ts +8 -8
- package/dist/store/schema/cleo-project/audit.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/audit.js +2 -6
- package/dist/store/schema/cleo-project/audit.js.map +1 -1
- package/dist/store/schema/cleo-project/docs.d.ts +1 -1
- package/dist/store/schema/cleo-project/index.d.ts +29 -12
- package/dist/store/schema/cleo-project/index.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/index.js +29 -12
- package/dist/store/schema/cleo-project/index.js.map +1 -1
- package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
- package/dist/store/schema/cleo-project/nexus-graph.d.ts +1067 -0
- package/dist/store/schema/cleo-project/nexus-graph.d.ts.map +1 -0
- package/dist/store/schema/cleo-project/nexus-graph.js +407 -0
- package/dist/store/schema/cleo-project/nexus-graph.js.map +1 -0
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts +385 -0
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts.map +1 -0
- package/dist/store/schema/cleo-project/provenance-orphans.js +142 -0
- package/dist/store/schema/cleo-project/provenance-orphans.js.map +1 -0
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
- package/dist/store/schema/cleo-project/runtime.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +3 -3
- package/dist/store/schema/cleo-shared/brain.d.ts +711 -494
- package/dist/store/schema/cleo-shared/brain.d.ts.map +1 -1
- package/dist/store/schema/cleo-shared/brain.js +215 -134
- package/dist/store/schema/cleo-shared/brain.js.map +1 -1
- package/dist/store/schema/conduit-schema.d.ts +63 -51
- package/dist/store/schema/conduit-schema.d.ts.map +1 -1
- package/dist/store/schema/conduit-schema.js +23 -11
- package/dist/store/schema/conduit-schema.js.map +1 -1
- package/dist/store/schema/goal.d.ts +3 -2
- package/dist/store/schema/goal.d.ts.map +1 -1
- package/dist/store/schema/goal.js +3 -2
- package/dist/store/schema/goal.js.map +1 -1
- package/dist/store/schema/index.d.ts +1 -0
- package/dist/store/schema/index.d.ts.map +1 -1
- package/dist/store/schema/index.js +1 -0
- package/dist/store/schema/index.js.map +1 -1
- package/dist/store/schema/lifecycle.d.ts +2 -2
- package/dist/store/schema/memory-schema.d.ts +2 -2
- package/dist/store/schema/nexus-schema.d.ts +174 -115
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +175 -55
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/schema/provenance/releases.d.ts +1 -1
- package/dist/store/schema/schema-utils.d.ts +78 -0
- package/dist/store/schema/schema-utils.d.ts.map +1 -0
- package/dist/store/schema/schema-utils.js +49 -0
- package/dist/store/schema/schema-utils.js.map +1 -0
- package/dist/store/schema/skills-schema.d.ts +81 -44
- package/dist/store/schema/skills-schema.d.ts.map +1 -1
- package/dist/store/schema/skills-schema.js +49 -16
- package/dist/store/schema/skills-schema.js.map +1 -1
- package/dist/store/schema/tasks.d.ts +3 -3
- package/dist/store/skills-db.d.ts +90 -50
- package/dist/store/skills-db.d.ts.map +1 -1
- package/dist/store/skills-db.js +132 -146
- package/dist/store/skills-db.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +2 -2
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +11 -10
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +25 -18
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite.d.ts +72 -12
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +153 -89
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/tasks-schema.d.ts +4 -0
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +60 -0
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +2 -2
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +10 -5
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/umbrella-data-accessor.d.ts +17 -6
- package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
- package/dist/store/umbrella-data-accessor.js +8 -8
- package/dist/store/umbrella-data-accessor.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +241 -208
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +11 -6
- package/dist/system/health.js.map +1 -1
- package/dist/system/project-health.d.ts.map +1 -1
- package/dist/system/project-health.js +58 -12
- package/dist/system/project-health.js.map +1 -1
- package/dist/tasks/add.d.ts +8 -0
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +101 -0
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/cancelled-child-waiver-audit.d.ts +47 -0
- package/dist/tasks/cancelled-child-waiver-audit.d.ts.map +1 -0
- package/dist/tasks/cancelled-child-waiver-audit.js +34 -0
- package/dist/tasks/cancelled-child-waiver-audit.js.map +1 -0
- package/dist/tasks/complete.d.ts +22 -2
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +71 -6
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/compute-task-view.js +1 -1
- package/dist/tasks/session-scope.d.ts +5 -0
- package/dist/tasks/session-scope.d.ts.map +1 -1
- package/dist/tasks/session-scope.js +4 -0
- package/dist/tasks/session-scope.js.map +1 -1
- package/dist/tools/guard.d.ts +71 -1
- package/dist/tools/guard.d.ts.map +1 -1
- package/dist/tools/guard.js +73 -1
- package/dist/tools/guard.js.map +1 -1
- package/dist/tools/index.d.ts +21 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +25 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +22 -13
- package/dist/upgrade.js.map +1 -1
- package/dist/workgraph/containment.js +18 -18
- package/dist/workgraph/relations.js +2 -2
- package/dist/worktree/list.d.ts +1 -1
- package/dist/worktree/list.d.ts.map +1 -1
- package/dist/worktree/list.js +19 -21
- package/dist/worktree/list.js.map +1 -1
- package/dist/worktree-export.d.ts +18 -0
- package/dist/worktree-export.d.ts.map +1 -0
- package/dist/worktree-export.js +18 -0
- package/dist/worktree-export.js.map +1 -0
- package/migrations/drizzle-agent-registry/20260412000000_initial-global-agent-registry/migration.sql +29 -0
- package/migrations/drizzle-brain/20260601000001_t11522-brain-task-observations/migration.sql +28 -0
- package/migrations/drizzle-brain/20260601000002_t11522-inline-only-brain-tables/migration.sql +75 -0
- package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/migration.sql +49 -144
- package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/snapshot.json +8 -8
- package/migrations/drizzle-cleo-global/20260531000002_t11546-brain-usage-log/migration.sql +16 -0
- package/migrations/drizzle-cleo-global/20260601000001_t11544-skills-usage-project-id/migration.sql +12 -0
- package/migrations/drizzle-cleo-global/20260602000001_t11622-agent-registry-rename/migration.sql +80 -0
- package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/migration.sql +26 -167
- package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/snapshot.json +8 -8
- package/migrations/drizzle-cleo-project/20260531000002_t11546-brain-usage-log/migration.sql +21 -0
- package/migrations/drizzle-cleo-project/20260601000001_t11549-agent-credentials-brain-release-links/migration.sql +49 -0
- package/migrations/drizzle-cleo-project/20260601000002_t11538-project-nexus-graph/migration.sql +140 -0
- package/migrations/drizzle-cleo-project/20260602000002_t11649-token-usage-transport-mcp/migration.sql +146 -0
- package/migrations/drizzle-conduit/20260601000003_t11523-conduit-inline-schema/migration.sql +82 -0
- package/migrations/drizzle-nexus/20260421200001_t1165-baseline-reset/migration.sql +26 -8
- package/migrations/drizzle-nexus/20260601000001_t11545-nexus-relation-weights-partition/migration.sql +97 -0
- package/package.json +43 -11
- package/scripts/install-supervisor-binary.mjs +50 -201
- package/scripts/napi-binary-picker.mjs +267 -0
- package/dist/agents/agent-registry.d.ts.map +0 -1
- package/dist/agents/agent-registry.js.map +0 -1
- package/dist/store/data-safety.d.ts +0 -92
- package/dist/store/data-safety.d.ts.map +0 -1
- package/dist/store/data-safety.js +0 -274
- package/dist/store/data-safety.js.map +0 -1
- package/dist/store/schema/cleo-global/signaldock.d.ts.map +0 -1
- package/dist/store/schema/cleo-global/signaldock.js.map +0 -1
- package/dist/store/schema/cleo-project/telemetry.d.ts.map +0 -1
- package/dist/store/schema/cleo-project/telemetry.js.map +0 -1
- package/dist/store/schema/signaldock-schema.d.ts.map +0 -1
- package/dist/store/schema/signaldock-schema.js.map +0 -1
- package/dist/store/signaldock-sqlite.d.ts +0 -173
- package/dist/store/signaldock-sqlite.d.ts.map +0 -1
- package/dist/store/signaldock-sqlite.js +0 -445
- package/dist/store/signaldock-sqlite.js.map +0 -1
- package/migrations/drizzle-nexus/20260318205558_initial/migration.sql +0 -46
- package/migrations/drizzle-nexus/20260412000001_t529-nexus-graph-tables/migration.sql +0 -49
- package/migrations/drizzle-nexus/20260415000001_t622-project-registry-paths/migration.sql +0 -12
- package/migrations/drizzle-nexus/20260419000001_t998-nexus-plasticity/migration.sql +0 -13
- package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/migration.sql +0 -16
- package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/snapshot.json +0 -1531
- package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/migration.sql +0 -13
- package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/snapshot.json +0 -1652
- package/migrations/drizzle-nexus/20260504000001_t1839-fts5-nexus-symbols/migration.sql +0 -68
- package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/migration.sql +0 -20
- package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/snapshot.json +0 -1652
- package/migrations/drizzle-nexus/20260526222449_t11025-project-id-aliases/migration.sql +0 -16
- package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/migration.sql +0 -209
- package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/snapshot.json +0 -2060
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exodus pre-flight plan builder.
|
|
3
|
+
*
|
|
4
|
+
* `buildExodusPlan()` computes the full migration plan — source DB paths,
|
|
5
|
+
* combined size, free-disk availability, staging directory — BEFORE any
|
|
6
|
+
* writes occur. A `--dry-run` caller can print the plan and exit early.
|
|
7
|
+
*
|
|
8
|
+
* ## Disk pre-flight (AC8)
|
|
9
|
+
*
|
|
10
|
+
* `availableBytes >= 3 * totalSourceBytes` must hold before migration begins.
|
|
11
|
+
* The check uses `statvfs` via `node:fs.statfsSync()` (Node 18+).
|
|
12
|
+
*
|
|
13
|
+
* @task T11248 (E5 · SG-DB-SUBSTRATE-V2)
|
|
14
|
+
* @saga T11242
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync, readdirSync, statfsSync, statSync } from 'node:fs';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
import { getCleoHome, resolveCleoDir } from '../../paths.js';
|
|
19
|
+
import { resolveDualScopeDbPath } from '../dual-scope-db.js';
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Legacy DB descriptors (AC2 — 6 per-machine source DBs mapped to 2 targets)
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
/**
|
|
24
|
+
* Build the ordered list of legacy source DB descriptors for a given project.
|
|
25
|
+
*
|
|
26
|
+
* Project-scoped sources live under `<project>/.cleo/`.
|
|
27
|
+
* Global-scoped sources live under `getCleoHome()`.
|
|
28
|
+
*/
|
|
29
|
+
function buildSourceDescriptors(cwd) {
|
|
30
|
+
const cleoDir = resolveCleoDir(cwd);
|
|
31
|
+
const cleoHome = getCleoHome();
|
|
32
|
+
return [
|
|
33
|
+
// Project-tier — go into consolidated project-scope cleo.db
|
|
34
|
+
{
|
|
35
|
+
name: 'tasks',
|
|
36
|
+
path: join(cleoDir, 'tasks.db'),
|
|
37
|
+
targetScope: 'project',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'brain (project)',
|
|
41
|
+
path: join(cleoDir, 'brain.db'),
|
|
42
|
+
targetScope: 'project',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'conduit',
|
|
46
|
+
path: join(cleoDir, 'conduit.db'),
|
|
47
|
+
targetScope: 'project',
|
|
48
|
+
},
|
|
49
|
+
// Global-tier — go into consolidated global-scope cleo.db
|
|
50
|
+
{
|
|
51
|
+
name: 'nexus',
|
|
52
|
+
path: join(cleoHome, 'nexus.db'),
|
|
53
|
+
targetScope: 'global',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'signaldock',
|
|
57
|
+
path: join(cleoHome, 'signaldock.db'),
|
|
58
|
+
targetScope: 'global',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'skills',
|
|
62
|
+
path: join(cleoHome, 'skills.db'),
|
|
63
|
+
targetScope: 'global',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Safely stat a file and return its size in bytes, or 0 if it does not exist.
|
|
69
|
+
*/
|
|
70
|
+
function safeFileBytes(filePath) {
|
|
71
|
+
try {
|
|
72
|
+
return statSync(filePath).size;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Return available bytes on the filesystem that contains `dir`.
|
|
80
|
+
*
|
|
81
|
+
* Uses `statfsSync` (Node 18+). Falls back to 0 if unavailable.
|
|
82
|
+
*/
|
|
83
|
+
function getAvailableBytes(dir) {
|
|
84
|
+
try {
|
|
85
|
+
const result = statfsSync(dir);
|
|
86
|
+
// `bfree` = blocks free for privileged processes; `bavail` = unprivileged.
|
|
87
|
+
return (result.bavail ?? result.bfree ?? 0) * (result.bsize ?? 4096);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Derive the staging directory name from the current ISO-8601 timestamp.
|
|
95
|
+
*
|
|
96
|
+
* Pattern: `.cleo/exodus-staging-<YYYYMMDDTHHMMSSZ>`.
|
|
97
|
+
* Colons are replaced with empty string (NTFS + shell-safe).
|
|
98
|
+
*/
|
|
99
|
+
export function deriveStagingDirName() {
|
|
100
|
+
const iso = new Date()
|
|
101
|
+
.toISOString()
|
|
102
|
+
.replace(/[:]/g, '')
|
|
103
|
+
.replace(/\..+Z$/, 'Z');
|
|
104
|
+
return `exodus-staging-${iso}`;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Scan for an existing staging directory from a previous (possibly crashed)
|
|
108
|
+
* run inside the given `.cleo/` directory.
|
|
109
|
+
*
|
|
110
|
+
* Returns the absolute path to the most-recent staging dir, or `null` if none
|
|
111
|
+
* exists.
|
|
112
|
+
*/
|
|
113
|
+
function findExistingStaging(cleoDir) {
|
|
114
|
+
try {
|
|
115
|
+
const entries = readdirSync(cleoDir, { withFileTypes: true });
|
|
116
|
+
const stagingDirs = entries
|
|
117
|
+
.filter((e) => e.isDirectory() && e.name.startsWith('exodus-staging-'))
|
|
118
|
+
.map((e) => e.name)
|
|
119
|
+
.sort()
|
|
120
|
+
.reverse(); // most recent first
|
|
121
|
+
if (stagingDirs.length > 0) {
|
|
122
|
+
return join(cleoDir, stagingDirs[0]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
// .cleo/ may not exist yet
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Build the complete exodus plan.
|
|
132
|
+
*
|
|
133
|
+
* This is a pure read operation — no files are created or modified.
|
|
134
|
+
* Pass the result to `runExodusMigrate()` to execute the migration.
|
|
135
|
+
*
|
|
136
|
+
* @param cwd - Working directory used to resolve the project root. Defaults to
|
|
137
|
+
* `process.cwd()`.
|
|
138
|
+
* @returns {@link ExodusPlan} describing sources, disk availability, and paths.
|
|
139
|
+
*
|
|
140
|
+
* @task T11248 (AC8 — 3× disk pre-flight)
|
|
141
|
+
*/
|
|
142
|
+
export function buildExodusPlan(cwd) {
|
|
143
|
+
const cleoDir = resolveCleoDir(cwd);
|
|
144
|
+
const sources = buildSourceDescriptors(cwd);
|
|
145
|
+
// Compute total source size (only existing files count toward the check)
|
|
146
|
+
const totalSourceBytes = sources.reduce((sum, s) => sum + safeFileBytes(s.path), 0);
|
|
147
|
+
// Disk pre-flight: check against the directory that will hold the staging data
|
|
148
|
+
// (the .cleo/ dir, which is where both the backup and staging live).
|
|
149
|
+
const availableBytes = getAvailableBytes(cleoDir);
|
|
150
|
+
const diskPreflight = totalSourceBytes === 0 || availableBytes >= 3 * totalSourceBytes;
|
|
151
|
+
// Staging directory — resume if a previous one exists
|
|
152
|
+
const existingStaging = findExistingStaging(cleoDir);
|
|
153
|
+
const stagingDir = existingStaging ?? join(cleoDir, deriveStagingDirName());
|
|
154
|
+
const resumeFromStaging = existingStaging !== null;
|
|
155
|
+
// Target paths (consolidated cleo.db)
|
|
156
|
+
const projectDbPath = resolveDualScopeDbPath('project', cwd);
|
|
157
|
+
const globalDbPath = resolveDualScopeDbPath('global');
|
|
158
|
+
return {
|
|
159
|
+
sources,
|
|
160
|
+
totalSourceBytes,
|
|
161
|
+
availableBytes,
|
|
162
|
+
diskPreflight,
|
|
163
|
+
stagingDir,
|
|
164
|
+
resumeFromStaging,
|
|
165
|
+
projectDbPath,
|
|
166
|
+
globalDbPath,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Check whether all required source DBs exist.
|
|
171
|
+
*
|
|
172
|
+
* Returns `true` if at least one source file is present (partial sets are
|
|
173
|
+
* acceptable — empty tables simply copy zero rows).
|
|
174
|
+
*/
|
|
175
|
+
export function sourcesPresent(sources) {
|
|
176
|
+
return sources.some((s) => existsSync(s.path));
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/store/exodus/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAE9E;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,GAAY;IAC1C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5C,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAEpF,+EAA+E;IAC/E,qEAAqE;IACrE,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,gBAAgB,KAAK,CAAC,IAAI,cAAc,IAAI,CAAC,GAAG,gBAAgB,CAAC;IAEvF,sDAAsD;IACtD,MAAM,eAAe,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,UAAU,GAAG,eAAe,IAAI,IAAI,CAAC,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC5E,MAAM,iBAAiB,GAAG,eAAe,KAAK,IAAI,CAAC;IAEnD,sCAAsC;IACtC,MAAM,aAAa,GAAG,sBAAsB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAEtD,OAAO;QACL,OAAO;QACP,gBAAgB;QAChB,cAAc;QACd,aAAa;QACb,UAAU;QACV,iBAAiB;QACjB,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAA6B;IAC1D,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exodus status reporter.
|
|
3
|
+
*
|
|
4
|
+
* `runExodusStatus()` returns a structured view of the current exodus state
|
|
5
|
+
* without performing any reads or writes beyond stat() calls.
|
|
6
|
+
*
|
|
7
|
+
* @task T11248 (E5 · AC3 · SG-DB-SUBSTRATE-V2)
|
|
8
|
+
* @saga T11242
|
|
9
|
+
*/
|
|
10
|
+
import type { ExodusStatusResult } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Return a structured status report for the exodus subsystem.
|
|
13
|
+
*
|
|
14
|
+
* This is a read-only operation — no mutations occur.
|
|
15
|
+
*
|
|
16
|
+
* @param cwd - Working directory used to resolve the project root.
|
|
17
|
+
* @returns {@link ExodusStatusResult}
|
|
18
|
+
*
|
|
19
|
+
* @task T11248 (AC3)
|
|
20
|
+
*/
|
|
21
|
+
export declare function runExodusStatus(cwd?: string): ExodusStatusResult;
|
|
22
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/store/exodus/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAiB,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA0CpE;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,kBAAkB,CA4BhE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exodus status reporter.
|
|
3
|
+
*
|
|
4
|
+
* `runExodusStatus()` returns a structured view of the current exodus state
|
|
5
|
+
* without performing any reads or writes beyond stat() calls.
|
|
6
|
+
*
|
|
7
|
+
* @task T11248 (E5 · AC3 · SG-DB-SUBSTRATE-V2)
|
|
8
|
+
* @saga T11242
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { resolveCleoDir } from '../../paths.js';
|
|
13
|
+
import { resolveDualScopeDbPath } from '../dual-scope-db.js';
|
|
14
|
+
import { buildExodusPlan } from './plan.js';
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Journal reader (mirrors logic in migrate.ts — kept local for zero coupling)
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
const JOURNAL_FILENAME = 'exodus-journal.json';
|
|
19
|
+
function readJournal(stagingDir) {
|
|
20
|
+
const p = join(stagingDir, JOURNAL_FILENAME);
|
|
21
|
+
if (!existsSync(p))
|
|
22
|
+
return null;
|
|
23
|
+
try {
|
|
24
|
+
return JSON.parse(readFileSync(p, 'utf8'));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function findStagingDirs(cleoDir) {
|
|
31
|
+
try {
|
|
32
|
+
return readdirSync(cleoDir, { withFileTypes: true })
|
|
33
|
+
.filter((e) => e.isDirectory() && e.name.startsWith('exodus-staging-'))
|
|
34
|
+
.map((e) => join(cleoDir, e.name))
|
|
35
|
+
.sort()
|
|
36
|
+
.reverse(); // most-recent first
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function safeBytes(p) {
|
|
43
|
+
try {
|
|
44
|
+
return statSync(p).size;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Main status runner
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
/**
|
|
54
|
+
* Return a structured status report for the exodus subsystem.
|
|
55
|
+
*
|
|
56
|
+
* This is a read-only operation — no mutations occur.
|
|
57
|
+
*
|
|
58
|
+
* @param cwd - Working directory used to resolve the project root.
|
|
59
|
+
* @returns {@link ExodusStatusResult}
|
|
60
|
+
*
|
|
61
|
+
* @task T11248 (AC3)
|
|
62
|
+
*/
|
|
63
|
+
export function runExodusStatus(cwd) {
|
|
64
|
+
const plan = buildExodusPlan(cwd);
|
|
65
|
+
const cleoDir = resolveCleoDir(cwd);
|
|
66
|
+
// Find staging directories
|
|
67
|
+
const stagingDirs = findStagingDirs(cleoDir);
|
|
68
|
+
const latestStaging = stagingDirs[0] ?? null;
|
|
69
|
+
const journal = latestStaging ? readJournal(latestStaging) : null;
|
|
70
|
+
const projectDbPath = resolveDualScopeDbPath('project', cwd);
|
|
71
|
+
const globalDbPath = resolveDualScopeDbPath('global');
|
|
72
|
+
const sourcesInfo = plan.sources.map((s) => ({
|
|
73
|
+
name: s.name,
|
|
74
|
+
path: s.path,
|
|
75
|
+
exists: existsSync(s.path),
|
|
76
|
+
bytes: safeBytes(s.path),
|
|
77
|
+
}));
|
|
78
|
+
return {
|
|
79
|
+
hasStaging: latestStaging !== null,
|
|
80
|
+
stagingDir: latestStaging,
|
|
81
|
+
journal,
|
|
82
|
+
projectDbExists: existsSync(projectDbPath),
|
|
83
|
+
globalDbExists: existsSync(globalDbPath),
|
|
84
|
+
sourcesPresent: sourcesInfo.some((s) => s.exists),
|
|
85
|
+
sources: sourcesInfo,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/store/exodus/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAE9E,MAAM,gBAAgB,GAAG,qBAA8B,CAAC;AAExD,SAAS,WAAW,CAAC,UAAkB;IACrC,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,gB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,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC7C,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAElE,MAAM,aAAa,GAAG,sBAAsB,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAEtD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3C,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1B,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;KACzB,CAAC,CAAC,CAAC;IAEJ,OAAO;QACL,UAAU,EAAE,aAAa,KAAK,IAAI;QAClC,UAAU,EAAE,aAAa;QACzB,OAAO;QACP,eAAe,EAAE,UAAU,CAAC,aAAa,CAAC;QAC1C,cAAc,EAAE,UAAU,CAAC,YAAY,CAAC;QACxC,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QACjD,OAAO,EAAE,WAAW;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic legacy-to-consolidated table-name resolver for exodus migration.
|
|
3
|
+
*
|
|
4
|
+
* ## Problem (ROOT CAUSE 1 — T11532)
|
|
5
|
+
*
|
|
6
|
+
* Legacy source DBs use UNPREFIXED table names (`tasks`, `messages`, `skills`, …)
|
|
7
|
+
* while the consolidated dual-scope `cleo.db` uses DOMAIN-PREFIXED names
|
|
8
|
+
* (`tasks_tasks`, `conduit_messages`, `skills_skills`, …). Without a mapping,
|
|
9
|
+
* every `INSERT OR IGNORE INTO main."<name>"` silently copies 0 rows because the
|
|
10
|
+
* target table is absent under the legacy name.
|
|
11
|
+
*
|
|
12
|
+
* ## Design
|
|
13
|
+
*
|
|
14
|
+
* The mapping is a static lookup table derived from reading every
|
|
15
|
+
* `cleo-project/` and `cleo-global/` schema file and matching the physical
|
|
16
|
+
* `sqliteTable('<consolidated-name>', …)` names against each legacy DB's schema.
|
|
17
|
+
*
|
|
18
|
+
* Rules:
|
|
19
|
+
* - If a legacy table is already domain-prefixed in the consolidated schema
|
|
20
|
+
* (e.g. `brain_observations`, `nexus_audit_log`, `tasks_goal`), map identity.
|
|
21
|
+
* - If a legacy table has NO consolidated counterpart (virtual tables, orphan
|
|
22
|
+
* telemetry tables, …), return `null` so the caller can log + skip explicitly
|
|
23
|
+
* rather than silently discarding rows.
|
|
24
|
+
*
|
|
25
|
+
* ## Source-DB scope
|
|
26
|
+
*
|
|
27
|
+
* The resolver takes a `sourceName` (the `LegacyDbDescriptor.name` value, e.g.
|
|
28
|
+
* `"tasks"`, `"brain (project)"`, `"conduit"`) to disambiguate tables that
|
|
29
|
+
* share the same legacy name across multiple DBs (e.g. `"attachments"` lives in
|
|
30
|
+
* both conduit.db and attachments.ts/tasks.db; `"sessions"` lives in both
|
|
31
|
+
* tasks.db and signaldock.db).
|
|
32
|
+
*
|
|
33
|
+
* ## Nexus code-graph residency move (ADR-090 · T11539)
|
|
34
|
+
*
|
|
35
|
+
* The four nexus code-graph tables — `nexus_nodes`, `nexus_relations`,
|
|
36
|
+
* `nexus_contracts`, `nexus_code_index` (ADR-090 "Category A") — were removed
|
|
37
|
+
* from the GLOBAL schema (`../schema/cleo-global/nexus.ts`) and now reside in
|
|
38
|
+
* PROJECT scope (`../schema/cleo-project/nexus-graph.ts`). They are still
|
|
39
|
+
* extracted from the legacy GLOBAL `nexus.db` source, but exodus MUST route them
|
|
40
|
+
* into the PROJECT-scope consolidated `cleo.db`, not the global one. The source
|
|
41
|
+
* descriptor `nexus` carries `targetScope: 'global'`, so a per-table scope
|
|
42
|
+
* override is required for these four tables — see
|
|
43
|
+
* {@link NEXUS_GRAPH_PROJECT_TABLES} and {@link resolveTableTargetScope}. The
|
|
44
|
+
* six registry/identity tables (`nexus_project_registry`,
|
|
45
|
+
* `nexus_project_id_aliases`, `nexus_audit_log`, `nexus_schema_meta`,
|
|
46
|
+
* `nexus_user_profile`, `nexus_sigils`) stay GLOBAL.
|
|
47
|
+
*
|
|
48
|
+
* @task T11532 (ROOT CAUSE 1 — name-mapping gap)
|
|
49
|
+
* @task T11533 (ROOT CAUSE 3 — signaldock skills mapping + brain_release_links skip +
|
|
50
|
+
* brain_session_narrative mapping)
|
|
51
|
+
* @task T11546 (no-home-table fixes — schema_meta→tasks_schema_meta, brain_usage_log mapping,
|
|
52
|
+
* brain_schema_meta mapping)
|
|
53
|
+
* @task T11539 (nexus code-graph residency — route the 4 graph tables to PROJECT scope)
|
|
54
|
+
* @epic T11248
|
|
55
|
+
* @saga T11242
|
|
56
|
+
*/
|
|
57
|
+
import type { ExodusScope } from './types.js';
|
|
58
|
+
/**
|
|
59
|
+
* Legacy table names of the four nexus code-graph tables that moved from GLOBAL
|
|
60
|
+
* to PROJECT scope (ADR-090 · T11538/T11539).
|
|
61
|
+
*
|
|
62
|
+
* Keyed by the LEGACY physical name as it appears in `nexus.db`:
|
|
63
|
+
* - `nexus_nodes`, `nexus_relations`, `nexus_contracts` — already prefixed.
|
|
64
|
+
* - `code_index` — bare in legacy `nexus.db`; → `nexus_code_index` consolidated.
|
|
65
|
+
*
|
|
66
|
+
* Membership drives {@link resolveTableTargetScope}: exodus copies/verifies
|
|
67
|
+
* these against the PROJECT consolidated `cleo.db`, NOT the GLOBAL one, even
|
|
68
|
+
* though the `nexus` source descriptor's `targetScope` is `'global'`.
|
|
69
|
+
*
|
|
70
|
+
* @task T11539
|
|
71
|
+
* @epic T11248
|
|
72
|
+
* @saga T11242
|
|
73
|
+
* @see cleo docs fetch adr-090-nexus-graph-residency-split
|
|
74
|
+
*/
|
|
75
|
+
export declare const NEXUS_GRAPH_PROJECT_TABLES: ReadonlySet<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the consolidated TARGET SCOPE for a legacy source table.
|
|
78
|
+
*
|
|
79
|
+
* Most tables share the scope of their source DB descriptor (`sourceScope`).
|
|
80
|
+
* The exception is the four nexus code-graph tables — they are extracted from
|
|
81
|
+
* the GLOBAL legacy `nexus.db` but land in PROJECT scope per ADR-090 (T11539).
|
|
82
|
+
*
|
|
83
|
+
* This is the SSoT consumed by BOTH the exodus migrate runner (insert target DB)
|
|
84
|
+
* and the exodus verifier (verify target DB) so the two never disagree.
|
|
85
|
+
*
|
|
86
|
+
* @param sourceName - `LegacyDbDescriptor.name` (e.g. `"nexus"`, `"tasks"`).
|
|
87
|
+
* @param legacyTable - Physical table name in the legacy source DB.
|
|
88
|
+
* @param sourceScope - The source descriptor's `targetScope`.
|
|
89
|
+
* @returns The scope of the consolidated `cleo.db` this table copies into.
|
|
90
|
+
*
|
|
91
|
+
* @task T11539
|
|
92
|
+
* @epic T11248
|
|
93
|
+
* @saga T11242
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveTableTargetScope(sourceName: string, legacyTable: string, sourceScope: ExodusScope): ExodusScope;
|
|
96
|
+
/**
|
|
97
|
+
* Return `true` if `tableName` is a DERIVED or INTERNAL table that must be
|
|
98
|
+
* EXCLUDED from the exodus row-count-parity gate (and from the copy path).
|
|
99
|
+
*
|
|
100
|
+
* This is the single, named, documented classification consumed by BOTH the
|
|
101
|
+
* migrate copy loop and the `verifyMigration` parity check, so the two never
|
|
102
|
+
* disagree about which tables carry migratable user data. It recognises:
|
|
103
|
+
*
|
|
104
|
+
* 1. **FTS5 virtual tables** — a bare `*_fts` name (e.g. `brain_decisions_fts`,
|
|
105
|
+
* `messages_fts`). The virtual table itself cannot be `INSERT … SELECT`-ed
|
|
106
|
+
* and is rebuilt from its content table after migration.
|
|
107
|
+
* 2. **FTS5 shadow/backing tables** — `*_fts_data`, `*_fts_idx`,
|
|
108
|
+
* `*_fts_docsize`, `*_fts_config`, `*_fts_content` (see
|
|
109
|
+
* {@link FTS5_SHADOW_SUFFIXES}). Derived; rebuilt post-migration.
|
|
110
|
+
* 3. **Internal bookkeeping** — any per-source schema-version / migration
|
|
111
|
+
* ledger: `_conduit_meta`, `_conduit_migrations`, `_signaldock_meta`,
|
|
112
|
+
* `_signaldock_migrations`, `_skills_meta`, and — generalised via
|
|
113
|
+
* {@link INTERNAL_LEDGER_PATTERN} — ANY `_<domain>_meta` /
|
|
114
|
+
* `_<domain>_migrations` ledger from a future source DB (see
|
|
115
|
+
* {@link INTERNAL_BOOKKEEPING_TABLES}). Schema-version ledgers with no
|
|
116
|
+
* consolidated home.
|
|
117
|
+
*
|
|
118
|
+
* A migration is "safe" iff every BASE-DATA row survives; these derived/internal
|
|
119
|
+
* tables are NOT base data, so a 0-row consolidated counterpart for them is
|
|
120
|
+
* expected and correct — not data loss.
|
|
121
|
+
*
|
|
122
|
+
* @param tableName - Physical table name from a legacy source DB.
|
|
123
|
+
* @returns `true` when the table is derived/internal and must be skipped.
|
|
124
|
+
*
|
|
125
|
+
* @task T11572 (exodus parity gate: exclude FTS5 + internal/meta shadow tables)
|
|
126
|
+
* @task T11577 (generalise internal-ledger skip to signaldock/skills + any per-source ledger)
|
|
127
|
+
* @epic T11249 (E6)
|
|
128
|
+
* @saga T11242
|
|
129
|
+
*/
|
|
130
|
+
export declare function isDerivedOrInternalTable(tableName: string): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Result of resolving a legacy table name to its consolidated target.
|
|
133
|
+
*
|
|
134
|
+
* `kind === 'mapped'` — `targetName` holds the consolidated physical name.
|
|
135
|
+
* `kind === 'skip'` — table is intentionally excluded (virtual, orphan, etc.);
|
|
136
|
+
* `reason` holds a human-readable explanation.
|
|
137
|
+
* `kind === 'unknown'` — source DB is unrecognized; falls back to identity copy
|
|
138
|
+
* (best-effort for forward-compatibility with future DBs).
|
|
139
|
+
*/
|
|
140
|
+
export type TableNameResolution = {
|
|
141
|
+
readonly kind: 'mapped';
|
|
142
|
+
readonly targetName: string;
|
|
143
|
+
} | {
|
|
144
|
+
readonly kind: 'skip';
|
|
145
|
+
readonly reason: string;
|
|
146
|
+
} | {
|
|
147
|
+
readonly kind: 'unknown';
|
|
148
|
+
readonly targetName: string;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Resolve the consolidated target table name for a legacy source table.
|
|
152
|
+
*
|
|
153
|
+
* @param sourceName - `LegacyDbDescriptor.name` (e.g. `"tasks"`, `"brain (project)"`).
|
|
154
|
+
* @param legacyTable - Physical table name from the legacy source DB.
|
|
155
|
+
* @returns A `TableNameResolution` describing how to copy (or skip) the table.
|
|
156
|
+
*/
|
|
157
|
+
export declare function resolveConsolidatedTableName(sourceName: string, legacyTable: string): TableNameResolution;
|
|
158
|
+
/**
|
|
159
|
+
* Reverse-lookup: given a consolidated target table name, return the set of
|
|
160
|
+
* legacy (sourceName, legacyTableName) pairs that map to it.
|
|
161
|
+
*
|
|
162
|
+
* Used by `runExodusVerify()` to compare legacy source counts against the
|
|
163
|
+
* correct consolidated target table rather than the legacy table name.
|
|
164
|
+
*
|
|
165
|
+
* Returns an empty array if no legacy table maps to the given consolidated name.
|
|
166
|
+
*/
|
|
167
|
+
export declare function reverseLookup(consolidatedTable: string, sources: ReadonlyArray<{
|
|
168
|
+
readonly name: string;
|
|
169
|
+
}>): Array<{
|
|
170
|
+
sourceName: string;
|
|
171
|
+
legacyTable: string;
|
|
172
|
+
}>;
|
|
173
|
+
//# sourceMappingURL=table-name-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-name-map.d.ts","sourceRoot":"","sources":["../../../src/store/exodus/table-name-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,KAAK,EAAE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