@cleocode/core 2026.9.16 → 2026.9.17
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/changesets/parser.d.ts.map +1 -1
- package/dist/changesets/parser.js +67 -0
- package/dist/changesets/parser.js.map +1 -1
- package/dist/crypto/credentials.d.ts +128 -26
- package/dist/crypto/credentials.d.ts.map +1 -1
- package/dist/crypto/credentials.js +183 -142
- package/dist/crypto/credentials.js.map +1 -1
- package/dist/docs/export-document.js +14705 -12949
- package/dist/docs/export-document.js.map +3 -3
- package/dist/doctor/index.d.ts +1 -1
- package/dist/doctor/index.d.ts.map +1 -1
- package/dist/doctor/index.js +1 -1
- package/dist/doctor/index.js.map +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts +1 -1
- package/dist/doctor/nexus-schema-residency.d.ts.map +1 -1
- package/dist/doctor/nexus-schema-residency.js +1 -0
- package/dist/doctor/nexus-schema-residency.js.map +1 -1
- package/dist/doctor/project-identity.d.ts +124 -0
- package/dist/doctor/project-identity.d.ts.map +1 -0
- package/dist/doctor/project-identity.js +307 -0
- package/dist/doctor/project-identity.js.map +1 -0
- package/dist/doctor/superseded-store.d.ts +8 -0
- package/dist/doctor/superseded-store.d.ts.map +1 -1
- package/dist/doctor/superseded-store.js +48 -3
- package/dist/doctor/superseded-store.js.map +1 -1
- package/dist/init.d.ts +7 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +17 -2
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +4 -2
- package/dist/internal.js.map +1 -1
- package/dist/llm/credentials-store.d.ts +10 -0
- package/dist/llm/credentials-store.d.ts.map +1 -1
- package/dist/llm/credentials-store.js +7 -1
- package/dist/llm/credentials-store.js.map +1 -1
- package/dist/llm/plugin-facade.js +13368 -1550
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/nexus/analyze-orchestrator.d.ts +20 -3
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +159 -10
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/assessment-store.d.ts +57 -0
- package/dist/nexus/assessment-store.d.ts.map +1 -0
- package/dist/nexus/assessment-store.js +73 -0
- package/dist/nexus/assessment-store.js.map +1 -0
- package/dist/nexus/freshness.d.ts +131 -0
- package/dist/nexus/freshness.d.ts.map +1 -0
- package/dist/nexus/freshness.js +391 -0
- package/dist/nexus/freshness.js.map +1 -0
- package/dist/nexus/graph-manifest.d.ts +88 -0
- package/dist/nexus/graph-manifest.d.ts.map +1 -0
- package/dist/nexus/graph-manifest.js +114 -0
- package/dist/nexus/graph-manifest.js.map +1 -0
- package/dist/nexus/knowledge.d.ts +21 -1
- package/dist/nexus/knowledge.d.ts.map +1 -1
- package/dist/nexus/knowledge.js +76 -37
- package/dist/nexus/knowledge.js.map +1 -1
- package/dist/nexus/path-map.d.ts +55 -0
- package/dist/nexus/path-map.d.ts.map +1 -0
- package/dist/nexus/path-map.js +87 -0
- package/dist/nexus/path-map.js.map +1 -0
- package/dist/nexus/projects-clean.d.ts +21 -28
- package/dist/nexus/projects-clean.d.ts.map +1 -1
- package/dist/nexus/projects-clean.js +168 -85
- package/dist/nexus/projects-clean.js.map +1 -1
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +3 -2
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry-hygiene.d.ts +70 -0
- package/dist/nexus/registry-hygiene.d.ts.map +1 -0
- package/dist/nexus/registry-hygiene.js +113 -0
- package/dist/nexus/registry-hygiene.js.map +1 -0
- package/dist/nexus/registry.d.ts +2 -2
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +48 -12
- package/dist/nexus/registry.js.map +1 -1
- package/dist/paths.d.ts +26 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +99 -6
- package/dist/paths.js.map +1 -1
- package/dist/render/nexus/graph/index.d.ts.map +1 -1
- package/dist/render/nexus/graph/index.js +8 -0
- package/dist/render/nexus/graph/index.js.map +1 -1
- package/dist/scaffold/ensure-config.d.ts +12 -3
- package/dist/scaffold/ensure-config.d.ts.map +1 -1
- package/dist/scaffold/ensure-config.js +61 -38
- package/dist/scaffold/ensure-config.js.map +1 -1
- package/dist/scaffold/project-identity.d.ts +136 -0
- package/dist/scaffold/project-identity.d.ts.map +1 -0
- package/dist/scaffold/project-identity.js +225 -0
- package/dist/scaffold/project-identity.js.map +1 -0
- package/dist/selfimprove/fix-gen.js +13319 -1556
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/store/agent-api-key.d.ts +114 -0
- package/dist/store/agent-api-key.d.ts.map +1 -0
- package/dist/store/agent-api-key.js +136 -0
- package/dist/store/agent-api-key.js.map +1 -0
- package/dist/store/agent-registry-accessor.d.ts +4 -2
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.js +39 -89
- package/dist/store/agent-registry-accessor.js.map +1 -1
- package/dist/store/api-key-kdf.d.ts +7 -0
- package/dist/store/api-key-kdf.d.ts.map +1 -1
- package/dist/store/api-key-kdf.js +7 -0
- package/dist/store/api-key-kdf.js.map +1 -1
- package/dist/store/backup-crypto.d.ts +49 -0
- package/dist/store/backup-crypto.d.ts.map +1 -1
- package/dist/store/backup-crypto.js +154 -0
- package/dist/store/backup-crypto.js.map +1 -1
- package/dist/store/credential-transfer.d.ts +303 -0
- package/dist/store/credential-transfer.d.ts.map +1 -0
- package/dist/store/credential-transfer.js +774 -0
- package/dist/store/credential-transfer.js.map +1 -0
- package/dist/store/exodus/column-transforms.d.ts +79 -4
- package/dist/store/exodus/column-transforms.d.ts.map +1 -1
- package/dist/store/exodus/column-transforms.js +121 -4
- package/dist/store/exodus/column-transforms.js.map +1 -1
- package/dist/store/exodus/index.d.ts +1 -0
- package/dist/store/exodus/index.d.ts.map +1 -1
- package/dist/store/exodus/index.js +1 -0
- package/dist/store/exodus/index.js.map +1 -1
- package/dist/store/exodus/migrate.d.ts +17 -1
- package/dist/store/exodus/migrate.d.ts.map +1 -1
- package/dist/store/exodus/migrate.js +155 -33
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/on-open.d.ts +14 -0
- package/dist/store/exodus/on-open.d.ts.map +1 -1
- package/dist/store/exodus/on-open.js +115 -6
- package/dist/store/exodus/on-open.js.map +1 -1
- package/dist/store/exodus/reconcile.d.ts +103 -0
- package/dist/store/exodus/reconcile.d.ts.map +1 -0
- package/dist/store/exodus/reconcile.js +728 -0
- package/dist/store/exodus/reconcile.js.map +1 -0
- package/dist/store/exodus/recovery.d.ts.map +1 -1
- package/dist/store/exodus/recovery.js +14 -2
- package/dist/store/exodus/recovery.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +39 -0
- package/dist/store/exodus/runtime-targets.d.ts.map +1 -0
- package/dist/store/exodus/runtime-targets.js +63 -0
- package/dist/store/exodus/runtime-targets.js.map +1 -0
- package/dist/store/exodus/table-name-map.d.ts.map +1 -1
- package/dist/store/exodus/table-name-map.js +5 -0
- package/dist/store/exodus/table-name-map.js.map +1 -1
- package/dist/store/exodus/table-order.d.ts +35 -0
- package/dist/store/exodus/table-order.d.ts.map +1 -0
- package/dist/store/exodus/table-order.js +62 -0
- package/dist/store/exodus/table-order.js.map +1 -0
- package/dist/store/exodus/verify-migration.d.ts +4 -1
- package/dist/store/exodus/verify-migration.d.ts.map +1 -1
- package/dist/store/exodus/verify-migration.js +142 -10
- package/dist/store/exodus/verify-migration.js.map +1 -1
- package/dist/store/global-salt.d.ts +16 -0
- package/dist/store/global-salt.d.ts.map +1 -1
- package/dist/store/global-salt.js +22 -7
- package/dist/store/global-salt.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.d.ts +86 -0
- package/dist/store/legacy-tasks-lineage.d.ts.map +1 -0
- package/dist/store/legacy-tasks-lineage.js +285 -0
- package/dist/store/legacy-tasks-lineage.js.map +1 -0
- package/dist/store/migration-manager.d.ts +27 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +63 -0
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/portable-bundle-import.d.ts +117 -0
- package/dist/store/portable-bundle-import.d.ts.map +1 -0
- package/dist/store/portable-bundle-import.js +589 -0
- package/dist/store/portable-bundle-import.js.map +1 -0
- package/dist/store/portable-bundle-relocate.d.ts +66 -0
- package/dist/store/portable-bundle-relocate.d.ts.map +1 -0
- package/dist/store/portable-bundle-relocate.js +304 -0
- package/dist/store/portable-bundle-relocate.js.map +1 -0
- package/dist/store/portable-bundle-scan.d.ts +167 -0
- package/dist/store/portable-bundle-scan.d.ts.map +1 -0
- package/dist/store/portable-bundle-scan.js +569 -0
- package/dist/store/portable-bundle-scan.js.map +1 -0
- package/dist/store/portable-bundle.d.ts +146 -0
- package/dist/store/portable-bundle.d.ts.map +1 -0
- package/dist/store/portable-bundle.js +674 -0
- package/dist/store/portable-bundle.js.map +1 -0
- package/dist/store/regenerators.d.ts +3 -1
- package/dist/store/regenerators.d.ts.map +1 -1
- package/dist/store/regenerators.js +6 -2
- package/dist/store/regenerators.js.map +1 -1
- package/dist/store/schema/cleo-global/nexus.d.ts +98 -0
- package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +19 -0
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/nexus-schema.d.ts +102 -0
- package/dist/store/schema/nexus-schema.d.ts.map +1 -1
- package/dist/store/schema/nexus-schema.js +24 -0
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/split-brain-import.d.ts +176 -0
- package/dist/store/split-brain-import.d.ts.map +1 -0
- package/dist/store/split-brain-import.js +680 -0
- package/dist/store/split-brain-import.js.map +1 -0
- package/dist/store/sqlite.d.ts +29 -0
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +57 -5
- package/dist/store/sqlite.js.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +30 -5
- package/dist/system/health.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +60 -0
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +14 -0
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +33 -0
- package/dist/validation/doctor/checks.js.map +1 -1
- package/migrations/drizzle-cleo-global/20260924000000_t12354-project-paths/migration.sql +40 -0
- package/migrations/drizzle-nexus/20260924000000_t12315-nexus-parse-cache/migration.sql +21 -0
- package/package.json +13 -13
- package/templates/CLEO-INJECTION.md +3 -3
- package/templates/cleo-gitignore +7 -0
|
@@ -62,8 +62,9 @@
|
|
|
62
62
|
* @see packages/core/src/store/exodus/verify-migration.ts — verifyMigration parity gate (T11551)
|
|
63
63
|
* @see packages/core/src/store/dual-scope-db.ts — the open chokepoint that calls this
|
|
64
64
|
*/
|
|
65
|
-
import { existsSync } from 'node:fs';
|
|
66
|
-
import {
|
|
65
|
+
import { existsSync, mkdtempSync, rmSync } from 'node:fs';
|
|
66
|
+
import { tmpdir } from 'node:os';
|
|
67
|
+
import { join, resolve } from 'node:path';
|
|
67
68
|
import { getLogger } from '../../logger.js';
|
|
68
69
|
import { withLock } from '../lock.js';
|
|
69
70
|
import { archiveMigratedSources, hasExodusCompleteMarker } from './archive.js';
|
|
@@ -77,6 +78,43 @@ const log = getLogger('exodus-on-open');
|
|
|
77
78
|
* migration is already in flight.
|
|
78
79
|
*/
|
|
79
80
|
let _exodusInProgress = false;
|
|
81
|
+
/**
|
|
82
|
+
* Stores an explicit `cleo doctor superseded-store --reconcile` is working on
|
|
83
|
+
* in this process, by resolved path (T12355). exodus-on-open must never fire
|
|
84
|
+
* for such a store mid-reconcile: it would migrate and ARCHIVE the very legacy
|
|
85
|
+
* files the reconcile already planned to read ("unable to open database
|
|
86
|
+
* …/.cleo/tasks.db", found by the v2026.9.17 Stage A gate with
|
|
87
|
+
* CLEO_DISABLE_EXODUS_ON_OPEN unset). Scoped to the store and the reconcile's
|
|
88
|
+
* lifetime — never the env var, never other stores.
|
|
89
|
+
*/
|
|
90
|
+
const _reconcileInProgress = new Map();
|
|
91
|
+
/**
|
|
92
|
+
* Run `fn` with exodus-on-open suppressed for the store at `dbPath`.
|
|
93
|
+
*
|
|
94
|
+
* Whichever runs first, the two converge: if on-open already migrated (and
|
|
95
|
+
* archived) the legacy files, the reconcile finds no legacy source and reports
|
|
96
|
+
* nothing to do; if the reconcile ran first, the store is populated and on-open
|
|
97
|
+
* skips it. Both place every row in the table the runtime reads.
|
|
98
|
+
*
|
|
99
|
+
* @param dbPath - The project `cleo.db` being reconciled.
|
|
100
|
+
* @param fn - The reconcile.
|
|
101
|
+
* @returns `fn`'s result.
|
|
102
|
+
* @task T12355
|
|
103
|
+
*/
|
|
104
|
+
export async function withExodusOnOpenSuppressed(dbPath, fn) {
|
|
105
|
+
const key = resolve(dbPath);
|
|
106
|
+
_reconcileInProgress.set(key, (_reconcileInProgress.get(key) ?? 0) + 1);
|
|
107
|
+
try {
|
|
108
|
+
return await fn();
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
const left = (_reconcileInProgress.get(key) ?? 1) - 1;
|
|
112
|
+
if (left <= 0)
|
|
113
|
+
_reconcileInProgress.delete(key);
|
|
114
|
+
else
|
|
115
|
+
_reconcileInProgress.set(key, left);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
80
118
|
/**
|
|
81
119
|
* Opt-out env flag. Set `CLEO_DISABLE_EXODUS_ON_OPEN=1` to skip the lazy
|
|
82
120
|
* auto-migration entirely (e.g. for tooling that intentionally inspects an
|
|
@@ -115,6 +153,32 @@ function safeRowCount(nativeDb, table) {
|
|
|
115
153
|
function consolidatedIsEmpty(nativeDb, scope) {
|
|
116
154
|
return safeRowCount(nativeDb, baseTableForScope(scope)) === 0;
|
|
117
155
|
}
|
|
156
|
+
/** Stranding warnings already emitted this process, keyed by target path. */
|
|
157
|
+
const _strandedWarned = new Set();
|
|
158
|
+
/** Log a stranded-data warning once per target per process (every open would repeat it). */
|
|
159
|
+
function warnStrandedOnce(dbPath, reason) {
|
|
160
|
+
if (_strandedWarned.has(dbPath))
|
|
161
|
+
return;
|
|
162
|
+
_strandedWarned.add(dbPath);
|
|
163
|
+
log.warn({ dbPath }, `exodus-on-open: STRANDED LEGACY DATA — ${reason}`);
|
|
164
|
+
}
|
|
165
|
+
/** The supported remedy for a stranded scope. */
|
|
166
|
+
function remedyFor(scope) {
|
|
167
|
+
return scope === 'project'
|
|
168
|
+
? 'Run `cleo doctor superseded-store --reconcile --dry-run`, then `--reconcile`, to copy it in.'
|
|
169
|
+
: 'Run `cleo doctor exodus-health` and `cleo exodus migrate` to consolidate it.';
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Names of this scope's legacy sources that still hold copyable rows. Only
|
|
173
|
+
* called once the consolidated store is known to be empty.
|
|
174
|
+
*/
|
|
175
|
+
async function strandedLegacySources(scope, cwd) {
|
|
176
|
+
const { buildExodusPlan, legacySourcesHoldRows } = await import('./index.js');
|
|
177
|
+
return buildExodusPlan(cwd)
|
|
178
|
+
.sources.filter((s) => s.targetScope === scope && existsSync(s.path))
|
|
179
|
+
.filter((s) => legacySourcesHoldRows([s]))
|
|
180
|
+
.map((s) => s.name);
|
|
181
|
+
}
|
|
118
182
|
/** Recover only the inserted resources recorded by this staging operation. */
|
|
119
183
|
async function rollbackBothScopes(plan) {
|
|
120
184
|
const { getDualScopeNativeDb, openDualScopeDbAtPath } = await import('../dual-scope-db.js');
|
|
@@ -293,20 +357,50 @@ async function runExodusOnOpen(scope, dbPath, nativeDb, cwd) {
|
|
|
293
357
|
if (_exodusInProgress) {
|
|
294
358
|
return { outcome: 'skipped', reason: 're-entrant open during active migration' };
|
|
295
359
|
}
|
|
296
|
-
if (
|
|
297
|
-
return {
|
|
360
|
+
if (_reconcileInProgress.has(resolve(dbPath))) {
|
|
361
|
+
return {
|
|
362
|
+
outcome: 'skipped',
|
|
363
|
+
reason: 'an explicit superseded-store reconcile of this store is in progress',
|
|
364
|
+
};
|
|
298
365
|
}
|
|
299
366
|
// Fast path (unlocked): if the consolidated DB already has data, nothing to do.
|
|
300
367
|
// This makes the second-open case a cheap COUNT(*) with no lock acquisition.
|
|
301
368
|
if (!consolidatedIsEmpty(nativeDb, scope)) {
|
|
302
369
|
return { outcome: 'skipped', reason: 'consolidated cleo.db already populated' };
|
|
303
370
|
}
|
|
371
|
+
// Kill-switch (T12319): honoured, but never SILENTLY. Exported machine-wide
|
|
372
|
+
// as an incident stopgap on 2026-06-04, it left ~21 projects running on an
|
|
373
|
+
// empty cleo.db while their legacy stores held every task — and nothing said
|
|
374
|
+
// so. Skip as asked, but when the skip strands real rows, say so loudly.
|
|
375
|
+
if (isDisabledByEnv()) {
|
|
376
|
+
const stranded = await strandedLegacySources(scope, cwd);
|
|
377
|
+
if (stranded.length === 0) {
|
|
378
|
+
return { outcome: 'skipped', reason: 'CLEO_DISABLE_EXODUS_ON_OPEN set' };
|
|
379
|
+
}
|
|
380
|
+
const reason = `CLEO_DISABLE_EXODUS_ON_OPEN set while the consolidated ${scope} cleo.db is EMPTY and ` +
|
|
381
|
+
`legacy ${stranded.join(', ')} still hold rows — CLEO is running WITHOUT that data. ` +
|
|
382
|
+
remedyFor(scope);
|
|
383
|
+
warnStrandedOnce(dbPath, reason);
|
|
384
|
+
return { outcome: 'skipped', reason };
|
|
385
|
+
}
|
|
304
386
|
// Completion-marker gate (T11777): once this scope's cutover is recorded, the
|
|
305
387
|
// migration has already happened and the legacy sources have been archived.
|
|
306
388
|
// Gate on the committed MARKER rather than (only) the source-file existsSync,
|
|
307
389
|
// so a re-appearing or stranded legacy DB can NEVER re-arm exodus-on-open even
|
|
308
390
|
// if the consolidated base table momentarily reads empty (DHQ-052 · T11662).
|
|
391
|
+
//
|
|
392
|
+
// T12319: the marker must never HIDE data, though. An empty consolidated
|
|
393
|
+
// store beside legacy files that still hold rows contradicts the marker's own
|
|
394
|
+
// claim, so this is an abort (writes refuse via `assertWriteDurable`), not a
|
|
395
|
+
// skip — re-arming stays forbidden, and the operator gets the explicit remedy.
|
|
309
396
|
if (hasExodusCompleteMarker(scope, cwd, dbPath, nativeDb)) {
|
|
397
|
+
const stranded = await strandedLegacySources(scope, cwd);
|
|
398
|
+
if (stranded.length > 0) {
|
|
399
|
+
const reason = `exodus completion marker claims the ${scope} scope migrated, but its cleo.db is EMPTY ` +
|
|
400
|
+
`while legacy ${stranded.join(', ')} still hold rows. ${remedyFor(scope)}`;
|
|
401
|
+
warnStrandedOnce(dbPath, reason);
|
|
402
|
+
return { outcome: 'aborted', reason };
|
|
403
|
+
}
|
|
310
404
|
return {
|
|
311
405
|
outcome: 'skipped',
|
|
312
406
|
reason: 'exodus completion marker present — scope already migrated (cutover sealed)',
|
|
@@ -352,9 +446,23 @@ async function runExodusOnOpen(scope, dbPath, nativeDb, cwd) {
|
|
|
352
446
|
sources: plan.sources.filter((s) => existsSync(s.path)).map((s) => s.name),
|
|
353
447
|
}, 'exodus-on-open: consolidated cleo.db is empty and legacy data present — auto-migrating');
|
|
354
448
|
_exodusInProgress = true;
|
|
449
|
+
const bareScratch = mkdtempSync(join(tmpdir(), 'cleo-exodus-bare-'));
|
|
355
450
|
try {
|
|
356
451
|
// 1. Run the migration engine (copies BOTH scopes; idempotent + journaled).
|
|
357
|
-
|
|
452
|
+
// T12355: land every row where the RUNTIME reads it — the same targets
|
|
453
|
+
// `cleo doctor superseded-store --reconcile` uses — creating the
|
|
454
|
+
// runtime-bound tables first, since several exist only once the
|
|
455
|
+
// tasks-domain lineage has run.
|
|
456
|
+
const { buildRuntimeTargetResolver } = await import('./runtime-targets.js');
|
|
457
|
+
const resolveTarget = await buildRuntimeTargetResolver();
|
|
458
|
+
// The same unmigrated-bare-family source the reconcile reads, so the two
|
|
459
|
+
// converge whichever runs first. Never archived: it is not a legacy file.
|
|
460
|
+
const { unmigratedBareSources } = await import('./reconcile.js');
|
|
461
|
+
const bare = scope === 'project'
|
|
462
|
+
? await unmigratedBareSources(dbPath, resolveTarget, plan.sources.find((s) => s.name === 'tasks' && existsSync(s.path))?.path, bareScratch)
|
|
463
|
+
: { first: [], last: [] };
|
|
464
|
+
const migratePlan = { ...plan, sources: [...bare.first, ...plan.sources, ...bare.last] };
|
|
465
|
+
const migrateResult = await runExodusMigrate(migratePlan, false, (msg) => log.debug({ scope }, `exodus-on-open: ${msg}`), { resolveTarget, ensureRuntimeTables: true });
|
|
358
466
|
if (!migrateResult.ok) {
|
|
359
467
|
// Revert only migration-owned rows; retain conflicts and their evidence.
|
|
360
468
|
const recovery = await rollbackBothScopes(plan);
|
|
@@ -374,7 +482,7 @@ async function runExodusOnOpen(scope, dbPath, nativeDb, cwd) {
|
|
|
374
482
|
}
|
|
375
483
|
// 2. PARITY GATE (AC2): verifyMigration (T11551) — row-count + content
|
|
376
484
|
// digest + FK integrity + enum-drift equivalence legacy↔consolidated.
|
|
377
|
-
const verifyResult = verifyMigration(
|
|
485
|
+
const verifyResult = verifyMigration(migratePlan.sources, plan.projectDbPath, plan.globalDbPath, (msg) => log.debug({ scope }, `exodus-on-open verify: ${msg}`), resolveTarget);
|
|
378
486
|
// Surface diagnostics (hash mismatch / source enum-drift) but do NOT
|
|
379
487
|
// abort on them — see isDataContinuityOk(). A correct normalising
|
|
380
488
|
// migration legitimately produces both; only a row-count deficit or an
|
|
@@ -459,6 +567,7 @@ async function runExodusOnOpen(scope, dbPath, nativeDb, cwd) {
|
|
|
459
567
|
}
|
|
460
568
|
finally {
|
|
461
569
|
_exodusInProgress = false;
|
|
570
|
+
rmSync(bareScratch, { recursive: true, force: true });
|
|
462
571
|
}
|
|
463
572
|
},
|
|
464
573
|
// Tolerate a slow migration: a large fleet copy can take a while, so allow a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on-open.js","sourceRoot":"","sources":["../../../src/store/exodus/on-open.ts"],"names":[],"mappings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EAA2E;IAC3E,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAChC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explicit, verified reconcile of stranded legacy project stores into `cleo.db`.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists (T12319)
|
|
5
|
+
*
|
|
6
|
+
* Measured 2026-09-24: ~21 projects ran on an EMPTY consolidated `cleo.db`
|
|
7
|
+
* while their legacy `.cleo/tasks.db` / `.cleo/brain.db` still held everything
|
|
8
|
+
* (llmtxt: 849 tasks + 1,696 observations; claude-todo: 5,330 + 5,148). Two
|
|
9
|
+
* things kept exodus-on-open from ever copying them: a machine-wide
|
|
10
|
+
* `CLEO_DISABLE_EXODUS_ON_OPEN=1` incident kill-switch (skip, silently), and —
|
|
11
|
+
* with the switch off — a copy engine that aborted on real legacy data (FK
|
|
12
|
+
* order, pre-T1408 archive reasons, pre-T877 stages, grandfathered hierarchy
|
|
13
|
+
* rows, NULL `valid_at`). `cleo doctor superseded-store` saw the rows but
|
|
14
|
+
* could only say "reconcile the contents first", with no command to do it.
|
|
15
|
+
*
|
|
16
|
+
* This module is that command's engine. It does NOT write a second copier: the
|
|
17
|
+
* copy is {@link runExodusMigrate} (same transforms, receipts and recovery),
|
|
18
|
+
* restricted to the project target. What it adds is the envelope:
|
|
19
|
+
*
|
|
20
|
+
* - **Assessment by key, not count.** For every legacy table the number of
|
|
21
|
+
* source rows whose primary key is ABSENT from the live table. A count can
|
|
22
|
+
* look complete while unrelated rows written into the empty shell mask real
|
|
23
|
+
* gaps; a key cannot.
|
|
24
|
+
* - **Additive only.** `INSERT OR IGNORE` never overwrites or duplicates a row
|
|
25
|
+
* already in `cleo.db`; the legacy files are read-only inputs and are never
|
|
26
|
+
* moved, archived or deleted.
|
|
27
|
+
* - **Verified or reverted.** After the copy the assessment is re-run; any
|
|
28
|
+
* missing key (or a live table that shrank) reverts exactly the rows this run
|
|
29
|
+
* inserted, via their receipts, and the outcome is `refused`.
|
|
30
|
+
* - **Idempotent.** A fully reconciled project is a no-op: nothing is written.
|
|
31
|
+
*
|
|
32
|
+
* @module
|
|
33
|
+
* @task T12319
|
|
34
|
+
* @see ./migrate.ts — the single copy engine
|
|
35
|
+
* @see ../../doctor/superseded-store.ts — the survey that points here
|
|
36
|
+
*/
|
|
37
|
+
import type { SupersededStoreReconcileResult, SupersededStoreTableCount } from '@cleocode/contracts';
|
|
38
|
+
import { type TargetResolver } from './runtime-targets.js';
|
|
39
|
+
import type { LegacyDbDescriptor } from './types.js';
|
|
40
|
+
/**
|
|
41
|
+
* Account for every data-bearing legacy project table against the live store.
|
|
42
|
+
*
|
|
43
|
+
* Read-only on both sides: the live store is opened `readOnly` and each legacy
|
|
44
|
+
* file is ATTACHed to that connection, which SQLite opens read-only too.
|
|
45
|
+
*
|
|
46
|
+
* @param liveStorePath - Absolute path of the live project `cleo.db`.
|
|
47
|
+
* @param sources - Existing project-scope legacy sources.
|
|
48
|
+
* @param resolveTarget - Where each legacy table lands; a reconcile passes the
|
|
49
|
+
* runtime-read targets ({@link buildRuntimeTargetResolver}).
|
|
50
|
+
* @returns One entry per legacy table holding rows, in copy order.
|
|
51
|
+
* @task T12319
|
|
52
|
+
*/
|
|
53
|
+
export declare function assessSupersededProjectStores(liveStorePath: string, sources: readonly LegacyDbDescriptor[], resolveTarget?: TargetResolver): SupersededStoreTableCount[];
|
|
54
|
+
/**
|
|
55
|
+
* Whether any of `sources` holds at least one row in a table exodus would copy.
|
|
56
|
+
*
|
|
57
|
+
* Cheap by construction — stops at the first non-empty table — because it runs
|
|
58
|
+
* on the open path whenever a consolidated store is empty and its migration is
|
|
59
|
+
* being skipped, to decide whether that skip is stranding real data.
|
|
60
|
+
*
|
|
61
|
+
* @param sources - Legacy source descriptors of ONE scope.
|
|
62
|
+
* @returns `true` when a legacy file still holds copyable rows.
|
|
63
|
+
* @task T12319
|
|
64
|
+
*/
|
|
65
|
+
export declare function legacySourcesHoldRows(sources: readonly LegacyDbDescriptor[]): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The unmigrated `cleo.db`'s own dead bare task-core family as exodus sources,
|
|
68
|
+
* for exodus-on-open (T12355): the same source the reconcile reads, so the two
|
|
69
|
+
* converge whichever runs first — without it, on-open left e.g. llmtxt's 1,972
|
|
70
|
+
* bare-only `task_labels` behind while a reconcile recovered them.
|
|
71
|
+
*
|
|
72
|
+
* @param liveStorePath - The project `cleo.db` being migrated.
|
|
73
|
+
* @param resolveTarget - The runtime target resolver.
|
|
74
|
+
* @param legacyTasksPath - The legacy `tasks.db`, if present (its fresher-row comparison).
|
|
75
|
+
* @param outDir - Scratch directory the materialised sources are written to.
|
|
76
|
+
* @returns Sources to copy BEFORE the legacy files (bare rows newer than their
|
|
77
|
+
* legacy copy) and AFTER them (the rest of the bare family); both empty when
|
|
78
|
+
* the bare family is not a source.
|
|
79
|
+
* @task T12355
|
|
80
|
+
*/
|
|
81
|
+
export declare function unmigratedBareSources(liveStorePath: string, resolveTarget: TargetResolver, legacyTasksPath: string | undefined, outDir: string): Promise<{
|
|
82
|
+
first: LegacyDbDescriptor[];
|
|
83
|
+
last: LegacyDbDescriptor[];
|
|
84
|
+
}>;
|
|
85
|
+
/**
|
|
86
|
+
* Reconcile a project's stranded legacy stores into its live `cleo.db`.
|
|
87
|
+
*
|
|
88
|
+
* @param projectRoot - Absolute project root.
|
|
89
|
+
* @param options - `dryRun` assesses and reports without writing anything.
|
|
90
|
+
* @returns The receipt; `outcome: 'refused'` means the copy did not verify and
|
|
91
|
+
* every row it inserted was reverted.
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const plan = await reconcileSupersededStores('/mnt/projects/llmtxt', { dryRun: true });
|
|
95
|
+
* for (const t of plan.before) console.log(t.targetTable, t.missingInLive);
|
|
96
|
+
* ```
|
|
97
|
+
* @task T12319
|
|
98
|
+
*/
|
|
99
|
+
export declare function reconcileSupersededStores(projectRoot: string, options?: {
|
|
100
|
+
readonly dryRun?: boolean;
|
|
101
|
+
readonly additive?: boolean;
|
|
102
|
+
}): Promise<SupersededStoreReconcileResult>;
|
|
103
|
+
//# sourceMappingURL=reconcile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../../src/store/exodus/reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAMH,OAAO,KAAK,EAEV,8BAA8B,EAC9B,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAA8B,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA8ErD;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,kBAAkB,EAAE,EACtC,aAAa,GAAE,cAA6C,GAC3D,yBAAyB,EAAE,CAwC7B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GAAG,OAAO,CAerF;AAuXD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,qBAAqB,CACzC,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,cAAc,EAC7B,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAAC,IAAI,EAAE,kBAAkB,EAAE,CAAA;CAAE,CAAC,CAWtE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACvE,OAAO,CAAC,8BAA8B,CAAC,CASzC"}
|