@cleocode/core 2026.8.3 → 2026.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/changesets/writer.js +4 -4
- package/dist/changesets/writer.js.map +1 -1
- package/dist/docs/slug-allocator.d.ts +3 -3
- package/dist/docs/slug-allocator.d.ts.map +1 -1
- package/dist/docs/slug-allocator.js +46 -8
- package/dist/docs/slug-allocator.js.map +1 -1
- package/dist/doctor/index.d.ts +2 -0
- package/dist/doctor/index.d.ts.map +1 -1
- package/dist/doctor/index.js +1 -0
- package/dist/doctor/index.js.map +1 -1
- package/dist/doctor/superseded-store.d.ts +101 -0
- package/dist/doctor/superseded-store.d.ts.map +1 -0
- package/dist/doctor/superseded-store.js +156 -0
- package/dist/doctor/superseded-store.js.map +1 -0
- package/dist/llm/conversation.d.ts.map +1 -1
- package/dist/llm/conversation.js +12 -1
- package/dist/llm/conversation.js.map +1 -1
- package/dist/resources/memory-guard.d.ts +130 -0
- package/dist/resources/memory-guard.d.ts.map +1 -0
- package/dist/resources/memory-guard.js +231 -0
- package/dist/resources/memory-guard.js.map +1 -0
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +6 -2
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/tasks/heavy-tool-env.d.ts +112 -0
- package/dist/tasks/heavy-tool-env.d.ts.map +1 -0
- package/dist/tasks/heavy-tool-env.js +133 -0
- package/dist/tasks/heavy-tool-env.js.map +1 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +1 -0
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/tool-cache.d.ts.map +1 -1
- package/dist/tasks/tool-cache.js +9 -3
- package/dist/tasks/tool-cache.js.map +1 -1
- package/package.json +13 -13
- package/templates/CLEO-INJECTION.md +18 -0
- package/templates/workflows/release-prepare.yml.tmpl +23 -0
|
@@ -142,7 +142,7 @@ export async function writeChangesetEntry(entry, opts) {
|
|
|
142
142
|
//
|
|
143
143
|
// The reservation is consumed by `attachmentStore.put` on success (writer
|
|
144
144
|
// contract). On any subsequent failure path we explicitly release with
|
|
145
|
-
// `releaseReservedSlug(validated.id)` so retries do not see a stale claim.
|
|
145
|
+
// `releaseReservedSlug(validated.id, opts.projectRoot)` so retries do not see a stale claim.
|
|
146
146
|
//
|
|
147
147
|
// This ELIMINATES the rollback path that previously deleted
|
|
148
148
|
// `.changeset/<slug>.md` after a late-bound `SlugCollisionError`. The
|
|
@@ -184,7 +184,7 @@ export async function writeChangesetEntry(entry, opts) {
|
|
|
184
184
|
/* Already gone or unwritable — ignore. */
|
|
185
185
|
}
|
|
186
186
|
// Release the slug reservation so retries do not see a stale claim.
|
|
187
|
-
releaseReservedSlug(validated.id);
|
|
187
|
+
releaseReservedSlug(validated.id, opts.projectRoot);
|
|
188
188
|
return {
|
|
189
189
|
ok: false,
|
|
190
190
|
error: {
|
|
@@ -201,7 +201,7 @@ export async function writeChangesetEntry(entry, opts) {
|
|
|
201
201
|
if (ownerId === undefined) {
|
|
202
202
|
// Schema guarantees `tasks.length >= 1` so this is unreachable; included
|
|
203
203
|
// for type narrowing.
|
|
204
|
-
releaseReservedSlug(validated.id);
|
|
204
|
+
releaseReservedSlug(validated.id, opts.projectRoot);
|
|
205
205
|
try {
|
|
206
206
|
rmSync(filePath, { force: true });
|
|
207
207
|
}
|
|
@@ -251,7 +251,7 @@ export async function writeChangesetEntry(entry, opts) {
|
|
|
251
251
|
// Safe regardless of whether the chokepoint reserved it or
|
|
252
252
|
// attachmentStore.put already consumed it (releaseReservedSlug is a
|
|
253
253
|
// no-op on an unreserved slug).
|
|
254
|
-
releaseReservedSlug(validated.id);
|
|
254
|
+
releaseReservedSlug(validated.id, opts.projectRoot);
|
|
255
255
|
// T10388 — defence-in-depth: if the SSoT write throws SlugCollisionError
|
|
256
256
|
// it means another process took the slug between our reserveSlug() and
|
|
257
257
|
// attachmentStore.put() (cross-process race).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ACtE,sEAAsE;QACtE,IAAI,CAAC;YACH,MAAM,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACP,+BAA+B;QACjC,CAAC;QACD,oEAAoE;QACpE,2DAA2D;QAC3D,oEAAoE;QACpE,gCAAgC;QAChC,mBAAmB,CAAC,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAEpD,yEAAyE;QACzE,uEAAuE;QACvE,+DAA+D;QAC/D,qEAAqE;QACrE,0EAA0E;QAC1E,gEAAgE;QAChE,IAAI,GAAG,YAAY,kBAAkB,EAAE,CAAC;YACtC,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE;oBACL,IAAI,EAAE,iBAAiB;oBACvB,OAAO,EAAE,SAAS,GAAG,CAAC,IAAI,qCAAqC;oBAC/D,WAAW,EAAE,GAAG,CAAC,WAAW;oBAC5B,OAAO,EAAE,CAAC,qBAAqB,CAAC;iBACjC;aACF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,qBAAqB;gBAC3B,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aAC1D;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -158,14 +158,14 @@ export interface ReserveSlugOptions {
|
|
|
158
158
|
*
|
|
159
159
|
* @internal
|
|
160
160
|
*/
|
|
161
|
-
export declare function isSlugReserved(slug: string): boolean;
|
|
161
|
+
export declare function isSlugReserved(slug: string, cwd?: string): boolean;
|
|
162
162
|
/**
|
|
163
163
|
* Mark a slug as consumed — typically called by `attachmentStore.put` after
|
|
164
164
|
* a successful write so the reserved set does not grow unbounded.
|
|
165
165
|
*
|
|
166
166
|
* @internal
|
|
167
167
|
*/
|
|
168
|
-
export declare function consumeReservedSlug(slug: string): void;
|
|
168
|
+
export declare function consumeReservedSlug(slug: string, cwd?: string): void;
|
|
169
169
|
/**
|
|
170
170
|
* Test-only escape hatch — clears the in-process reserved set + lock map.
|
|
171
171
|
*
|
|
@@ -221,7 +221,7 @@ export declare function reserveSlug(kind: BuiltinDocKind | string, slug: string,
|
|
|
221
221
|
*
|
|
222
222
|
* @param slug - The slug as passed to `reserveSlug` (will be re-normalised).
|
|
223
223
|
*/
|
|
224
|
-
export declare function releaseReservedSlug(slug: string): void;
|
|
224
|
+
export declare function releaseReservedSlug(slug: string, cwd?: string): void;
|
|
225
225
|
/**
|
|
226
226
|
* Params for {@link reserveSlugForDispatch} — ADR-057 uniform signature.
|
|
227
227
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slug-allocator.d.ts","sourceRoot":"","sources":["../../src/docs/slug-allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"slug-allocator.d.ts","sourceRoot":"","sources":["../../src/docs/slug-allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,wDAAwD;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;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;AAED;;;;;;GAMG;AACH,MAAM,MAAM,4BAA4B,GAAG,iBAAiB,CAAC;AAE7D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CAEvC"}
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
* @saga T10288
|
|
117
117
|
* @adr ADR-076 §6 (slug namespace policy), ADR-083 (Cleo persona)
|
|
118
118
|
*/
|
|
119
|
+
import { getProjectRoot } from '../paths.js';
|
|
119
120
|
import { deriveSlugSuggestionsForAllocator } from '../store/attachment-store.js';
|
|
120
121
|
import { getDb } from '../store/sqlite.js';
|
|
121
122
|
import { normalizeSlug } from './slug-normalize.js';
|
|
@@ -173,6 +174,43 @@ async function acquireSlugLock(normalizedSlug) {
|
|
|
173
174
|
* @internal
|
|
174
175
|
*/
|
|
175
176
|
const reservedSlugs = new Set();
|
|
177
|
+
/**
|
|
178
|
+
* Compose the reservation key for a slug within a project.
|
|
179
|
+
*
|
|
180
|
+
* T12090: the set used to be keyed by slug ALONE, which made it
|
|
181
|
+
* process-global. That is fine in production — one process serves one project —
|
|
182
|
+
* but it silently defeats test isolation: vitest reuses a worker across files,
|
|
183
|
+
* so a file that reserved `t123-foo` and never consumed it left that slug
|
|
184
|
+
* reserved for every later file in the same worker, no matter how carefully
|
|
185
|
+
* each set its own `CLEO_DIR`. The module even shipped a
|
|
186
|
+
* `_resetSlugAllocatorState_TESTING_ONLY` hook to paper over it, which only
|
|
187
|
+
* helps files that remember to call it.
|
|
188
|
+
*
|
|
189
|
+
* It surfaced as a macOS-ONLY failure because shard composition differs per
|
|
190
|
+
* platform: on `macos-latest` shard 1, `docs-memory-observation.test.ts` landed
|
|
191
|
+
* in a worker that had already run a file leaving a reservation behind, and it
|
|
192
|
+
* failed with `E_SLUG_RESERVED` against a slug it had never used. Nothing was
|
|
193
|
+
* wrong with the test or with macOS — the state was simply not partitioned.
|
|
194
|
+
*
|
|
195
|
+
* Keying by resolved project root makes `CLEO_DIR` isolation real, so the
|
|
196
|
+
* reset hook becomes a convenience rather than a correctness requirement.
|
|
197
|
+
*
|
|
198
|
+
* @param slug - already-normalised slug.
|
|
199
|
+
* @param cwd - caller cwd; resolved to a project root for the key.
|
|
200
|
+
* @task T12090
|
|
201
|
+
*/
|
|
202
|
+
function reservationKey(slug, cwd) {
|
|
203
|
+
let root;
|
|
204
|
+
try {
|
|
205
|
+
root = getProjectRoot(cwd);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// An unresolvable root must not make two projects collide, and must not
|
|
209
|
+
// throw out of a bookkeeping helper. Fall back to the literal cwd.
|
|
210
|
+
root = cwd ?? '<unresolved>';
|
|
211
|
+
}
|
|
212
|
+
return `${root}\u0000${slug}`;
|
|
213
|
+
}
|
|
176
214
|
/**
|
|
177
215
|
* Check whether the allocator has reserved `slug` in this process.
|
|
178
216
|
*
|
|
@@ -180,8 +218,8 @@ const reservedSlugs = new Set();
|
|
|
180
218
|
*
|
|
181
219
|
* @internal
|
|
182
220
|
*/
|
|
183
|
-
export function isSlugReserved(slug) {
|
|
184
|
-
return reservedSlugs.has(normalizeSlug(slug));
|
|
221
|
+
export function isSlugReserved(slug, cwd) {
|
|
222
|
+
return reservedSlugs.has(reservationKey(normalizeSlug(slug), cwd));
|
|
185
223
|
}
|
|
186
224
|
/**
|
|
187
225
|
* Mark a slug as consumed — typically called by `attachmentStore.put` after
|
|
@@ -189,8 +227,8 @@ export function isSlugReserved(slug) {
|
|
|
189
227
|
*
|
|
190
228
|
* @internal
|
|
191
229
|
*/
|
|
192
|
-
export function consumeReservedSlug(slug) {
|
|
193
|
-
reservedSlugs.delete(normalizeSlug(slug));
|
|
230
|
+
export function consumeReservedSlug(slug, cwd) {
|
|
231
|
+
reservedSlugs.delete(reservationKey(normalizeSlug(slug), cwd));
|
|
194
232
|
}
|
|
195
233
|
/**
|
|
196
234
|
* Test-only escape hatch — clears the in-process reserved set + lock map.
|
|
@@ -252,7 +290,7 @@ export async function reserveSlug(kind, slug, opts) {
|
|
|
252
290
|
try {
|
|
253
291
|
// Same-process check first — another in-flight reservation already
|
|
254
292
|
// claimed this slug.
|
|
255
|
-
if (reservedSlugs.has(normalizedSlug)) {
|
|
293
|
+
if (reservedSlugs.has(reservationKey(normalizedSlug, opts?.cwd))) {
|
|
256
294
|
const db = await getDb(opts?.cwd);
|
|
257
295
|
const suggestions = await deriveSlugSuggestionsForAllocator(db, normalizedSlug);
|
|
258
296
|
return { ok: false, code: 'E_SLUG_RESERVED', suggestions };
|
|
@@ -271,7 +309,7 @@ export async function reserveSlug(kind, slug, opts) {
|
|
|
271
309
|
return { ok: false, code: 'E_SLUG_RESERVED', suggestions };
|
|
272
310
|
}
|
|
273
311
|
// Free — reserve it for the imminent `put`.
|
|
274
|
-
reservedSlugs.add(normalizedSlug);
|
|
312
|
+
reservedSlugs.add(reservationKey(normalizedSlug, opts?.cwd));
|
|
275
313
|
return { ok: true, normalizedSlug };
|
|
276
314
|
}
|
|
277
315
|
finally {
|
|
@@ -286,8 +324,8 @@ export async function reserveSlug(kind, slug, opts) {
|
|
|
286
324
|
*
|
|
287
325
|
* @param slug - The slug as passed to `reserveSlug` (will be re-normalised).
|
|
288
326
|
*/
|
|
289
|
-
export function releaseReservedSlug(slug) {
|
|
290
|
-
reservedSlugs.delete(normalizeSlug(slug));
|
|
327
|
+
export function releaseReservedSlug(slug, cwd) {
|
|
328
|
+
reservedSlugs.delete(reservationKey(normalizeSlug(slug), cwd));
|
|
291
329
|
}
|
|
292
330
|
/**
|
|
293
331
|
* Dispatch entry-point wrapper around {@link reserveSlug} conforming to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slug-allocator.js","sourceRoot":"","sources":["../../src/docs/slug-allocator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAE,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAE,GAAY;IAC5D,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AACjE,CAAC;AAyBD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,WAAmB,EACnB,MAAoC;IAEpC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/doctor/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export { classifyLegacyBackup, DEFAULT_HARD_RETENTION_DAYS, DEFAULT_SOFT_RETENTI
|
|
|
25
25
|
export type { PragmaSsot, PragmaSsotEntry } from './pragma-ssot.js';
|
|
26
26
|
export { loadPragmaSsot, normalisePragmaValue, PRAGMA_VALUE_NORMALISERS, } from './pragma-ssot.js';
|
|
27
27
|
export { auditSagaHierarchy } from './saga-audit.js';
|
|
28
|
+
export type { SupersededStoreEntry, SupersededStoreScanResult } from './superseded-store.js';
|
|
29
|
+
export { LIVE_STORE_FILENAME, scanSupersededStores } from './superseded-store.js';
|
|
28
30
|
export type { PruneOptions, ScanOptions } from './worktree-orphans.js';
|
|
29
31
|
export { auditWorktreeOrphansComprehensive, pruneWorktreeOrphans, scanWorktreeOrphans, } from './worktree-orphans.js';
|
|
30
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/doctor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EACh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EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,YAAY,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClF,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EACL,iCAAiC,EACjC,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
|
package/dist/doctor/index.js
CHANGED
|
@@ -28,5 +28,6 @@ export { renderInvariantAuditLines } from './invariant-audit-render.js';
|
|
|
28
28
|
export { classifyLegacyBackup, DEFAULT_HARD_RETENTION_DAYS, DEFAULT_SOFT_RETENTION_DAYS, isLegacyBackupFilename, legacyBackupSearchRoots, pruneLegacyBackups, recommendForBackup, scanLegacyBackups, } from './legacy-backups.js';
|
|
29
29
|
export { loadPragmaSsot, normalisePragmaValue, PRAGMA_VALUE_NORMALISERS, } from './pragma-ssot.js';
|
|
30
30
|
export { auditSagaHierarchy } from './saga-audit.js';
|
|
31
|
+
export { LIVE_STORE_FILENAME, scanSupersededStores } from './superseded-store.js';
|
|
31
32
|
export { auditWorktreeOrphansComprehensive, pruneWorktreeOrphans, scanWorktreeOrphans, } from './worktree-orphans.js';
|
|
32
33
|
//# sourceMappingURL=index.js.map
|
package/dist/doctor/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/doctor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,kFAAkF;AAClF,kFAAkF;AAClF,kEAAkE;AAClE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,EAC9B,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,+EAA+E;AAC/E,8CAA8C;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/doctor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,kFAAkF;AAClF,kFAAkF;AAClF,kEAAkE;AAClE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,EAC9B,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,+EAA+E;AAC/E,8CAA8C;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElF,OAAO,EACL,iCAAiC,EACjC,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect pre-dual-scope store files left on disk under their old LIVE names.
|
|
3
|
+
*
|
|
4
|
+
* ## The failure this exists to stop (T12095)
|
|
5
|
+
*
|
|
6
|
+
* Before the E6 dual-scope migration (ADR-068), a project's task database was
|
|
7
|
+
* `.cleo/tasks.db`. Afterwards it is `.cleo/cleo.db`, and task rows live in
|
|
8
|
+
* PREFIXED tables (`tasks_tasks`, `tasks_sessions`, …) rather than bare `tasks`.
|
|
9
|
+
* The migration does not delete the old file, so a migrated project has
|
|
10
|
+
*
|
|
11
|
+
* .cleo/cleo.db 60 MB modified today ← the real store
|
|
12
|
+
* .cleo/tasks.db 408 KB modified in June ← superseded, still named
|
|
13
|
+
* as though it were live
|
|
14
|
+
*
|
|
15
|
+
* Three separate things then point an agent at the wrong file:
|
|
16
|
+
*
|
|
17
|
+
* 1. The old name is the one every doc, ADR-013 §9 note and `cleo restore
|
|
18
|
+
* backup --file tasks.db` invocation still says out loud.
|
|
19
|
+
* 2. Snapshots are written as `.cleo/backups/sqlite/tasks-<ts>.db` even though
|
|
20
|
+
* they are snapshots of `cleo.db`. So the superseded 408 KB file sits beside
|
|
21
|
+
* 58 MB files bearing its own name — which reads unmistakably as truncation.
|
|
22
|
+
* 3. `cleo.db` ALSO contains a bare, empty `tasks` table next to the populated
|
|
23
|
+
* `tasks_tasks`. Any direct SQL probe finds the empty decoy.
|
|
24
|
+
*
|
|
25
|
+
* Measured on 2026-08-09: an agent in a healthy project with 1,123 tasks looped
|
|
26
|
+
* on "the current tasks.db is 417KB which is much smaller than the backups
|
|
27
|
+
* (58MB) — maybe it was rotated/rebuilt", then began theorising that the real
|
|
28
|
+
* store might be `llmtxt.db`. Nothing was wrong with the data. The layout
|
|
29
|
+
* manufactured a corruption signal, and the agent believed it over the CLI.
|
|
30
|
+
*
|
|
31
|
+
* This check names the file, proves which store is authoritative by counting
|
|
32
|
+
* rows in both, and says what to do — so the question is answered in one call
|
|
33
|
+
* instead of becoming an investigation.
|
|
34
|
+
*
|
|
35
|
+
* @task T12095
|
|
36
|
+
* @see ADR-068 — dual-scope DB chokepoint
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* A store file that has been superseded by `cleo.db` but still exists under the
|
|
40
|
+
* name that used to mean "the live database".
|
|
41
|
+
*/
|
|
42
|
+
export interface SupersededStoreEntry {
|
|
43
|
+
/** Absolute path of the superseded file. */
|
|
44
|
+
readonly path: string;
|
|
45
|
+
/** Bare filename, e.g. `tasks.db`. */
|
|
46
|
+
readonly name: string;
|
|
47
|
+
/** Size in bytes. */
|
|
48
|
+
readonly sizeBytes: number;
|
|
49
|
+
/** Last modification time, ISO 8601. */
|
|
50
|
+
readonly modifiedAt: string;
|
|
51
|
+
/**
|
|
52
|
+
* Rows found in the superseded file's own task table, if it has one.
|
|
53
|
+
* `null` when the file has no such table or could not be read.
|
|
54
|
+
*/
|
|
55
|
+
readonly rowsInSuperseded: number | null;
|
|
56
|
+
/** Rows found in the LIVE store's prefixed table. */
|
|
57
|
+
readonly rowsInLive: number | null;
|
|
58
|
+
/**
|
|
59
|
+
* True when the live store demonstrably holds the data and this file does
|
|
60
|
+
* not — i.e. it is safe to archive. False keeps the entry but withholds the
|
|
61
|
+
* recommendation, because "delete the other database" must never be advised
|
|
62
|
+
* on a guess.
|
|
63
|
+
*/
|
|
64
|
+
readonly safeToArchive: boolean;
|
|
65
|
+
/** Human-readable justification, suitable for printing verbatim. */
|
|
66
|
+
readonly reason: string;
|
|
67
|
+
}
|
|
68
|
+
/** Result of {@link scanSupersededStores}. */
|
|
69
|
+
export interface SupersededStoreScanResult {
|
|
70
|
+
/** Absolute project root that was scanned. */
|
|
71
|
+
readonly projectRoot: string;
|
|
72
|
+
/** Absolute path of the live dual-scope store. */
|
|
73
|
+
readonly liveStorePath: string;
|
|
74
|
+
/** Whether the live store exists — when false, nothing is superseded. */
|
|
75
|
+
readonly liveStoreExists: boolean;
|
|
76
|
+
/** Superseded files found, newest-modified first. */
|
|
77
|
+
readonly entries: readonly SupersededStoreEntry[];
|
|
78
|
+
}
|
|
79
|
+
/** The dual-scope store filename (ADR-068). */
|
|
80
|
+
export declare const LIVE_STORE_FILENAME = "cleo.db";
|
|
81
|
+
/**
|
|
82
|
+
* Scan a project for store files superseded by `cleo.db`.
|
|
83
|
+
*
|
|
84
|
+
* Read-only — deletes nothing and opens nothing for write. The caller decides
|
|
85
|
+
* what to do with the recommendation.
|
|
86
|
+
*
|
|
87
|
+
* @param projectRoot - absolute path to the project root.
|
|
88
|
+
* @returns the survey; `entries` is empty for a project that never migrated or
|
|
89
|
+
* that has already been tidied.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const scan = scanSupersededStores('/mnt/projects/PepsVida');
|
|
94
|
+
* for (const e of scan.entries) console.log(e.name, e.reason);
|
|
95
|
+
* // tasks.db superseded by cleo.db: 0 rows here vs 1123 in cleo.db#tasks_tasks …
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @task T12095
|
|
99
|
+
*/
|
|
100
|
+
export declare function scanSupersededStores(projectRoot: string): SupersededStoreScanResult;
|
|
101
|
+
//# sourceMappingURL=superseded-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superseded-store.d.ts","sourceRoot":"","sources":["../../src/doctor/superseded-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAMH;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,8CAA8C;IAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACnD;AAgBD,+CAA+C;AAC/C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAiC7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,yBAAyB,CAyDnF"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect pre-dual-scope store files left on disk under their old LIVE names.
|
|
3
|
+
*
|
|
4
|
+
* ## The failure this exists to stop (T12095)
|
|
5
|
+
*
|
|
6
|
+
* Before the E6 dual-scope migration (ADR-068), a project's task database was
|
|
7
|
+
* `.cleo/tasks.db`. Afterwards it is `.cleo/cleo.db`, and task rows live in
|
|
8
|
+
* PREFIXED tables (`tasks_tasks`, `tasks_sessions`, …) rather than bare `tasks`.
|
|
9
|
+
* The migration does not delete the old file, so a migrated project has
|
|
10
|
+
*
|
|
11
|
+
* .cleo/cleo.db 60 MB modified today ← the real store
|
|
12
|
+
* .cleo/tasks.db 408 KB modified in June ← superseded, still named
|
|
13
|
+
* as though it were live
|
|
14
|
+
*
|
|
15
|
+
* Three separate things then point an agent at the wrong file:
|
|
16
|
+
*
|
|
17
|
+
* 1. The old name is the one every doc, ADR-013 §9 note and `cleo restore
|
|
18
|
+
* backup --file tasks.db` invocation still says out loud.
|
|
19
|
+
* 2. Snapshots are written as `.cleo/backups/sqlite/tasks-<ts>.db` even though
|
|
20
|
+
* they are snapshots of `cleo.db`. So the superseded 408 KB file sits beside
|
|
21
|
+
* 58 MB files bearing its own name — which reads unmistakably as truncation.
|
|
22
|
+
* 3. `cleo.db` ALSO contains a bare, empty `tasks` table next to the populated
|
|
23
|
+
* `tasks_tasks`. Any direct SQL probe finds the empty decoy.
|
|
24
|
+
*
|
|
25
|
+
* Measured on 2026-08-09: an agent in a healthy project with 1,123 tasks looped
|
|
26
|
+
* on "the current tasks.db is 417KB which is much smaller than the backups
|
|
27
|
+
* (58MB) — maybe it was rotated/rebuilt", then began theorising that the real
|
|
28
|
+
* store might be `llmtxt.db`. Nothing was wrong with the data. The layout
|
|
29
|
+
* manufactured a corruption signal, and the agent believed it over the CLI.
|
|
30
|
+
*
|
|
31
|
+
* This check names the file, proves which store is authoritative by counting
|
|
32
|
+
* rows in both, and says what to do — so the question is answered in one call
|
|
33
|
+
* instead of becoming an investigation.
|
|
34
|
+
*
|
|
35
|
+
* @task T12095
|
|
36
|
+
* @see ADR-068 — dual-scope DB chokepoint
|
|
37
|
+
*/
|
|
38
|
+
import { existsSync, statSync } from 'node:fs';
|
|
39
|
+
import { join } from 'node:path';
|
|
40
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
41
|
+
/**
|
|
42
|
+
* Legacy store filenames paired with the live table that replaced their
|
|
43
|
+
* contents. The bare table name is the pre-migration one; the prefixed name is
|
|
44
|
+
* where the rows live now.
|
|
45
|
+
*/
|
|
46
|
+
const SUPERSEDED_STORES = [
|
|
47
|
+
{ file: 'tasks.db', bareTable: 'tasks', liveTable: 'tasks_tasks' },
|
|
48
|
+
{ file: 'brain.db', bareTable: 'brain_observations', liveTable: 'brain_observations' },
|
|
49
|
+
];
|
|
50
|
+
/** The dual-scope store filename (ADR-068). */
|
|
51
|
+
export const LIVE_STORE_FILENAME = 'cleo.db';
|
|
52
|
+
/**
|
|
53
|
+
* Count rows in a table, or `null` when the table or file is unreadable.
|
|
54
|
+
*
|
|
55
|
+
* Read-only and never throws: a superseded file may be truncated, locked, or
|
|
56
|
+
* not even SQLite, and none of that should break the survey.
|
|
57
|
+
*/
|
|
58
|
+
function countRows(dbPath, table) {
|
|
59
|
+
if (!existsSync(dbPath))
|
|
60
|
+
return null;
|
|
61
|
+
let db = null;
|
|
62
|
+
try {
|
|
63
|
+
// db-open-allowed: read-only forensic probe of a SUPERSEDED file no accessor owns — routing it through the chokepoint would register a live handle for the very store we are proving is dead
|
|
64
|
+
db = new DatabaseSync(dbPath, { readOnly: true }); // db-open-allowed: read-only probe of a superseded, unowned file
|
|
65
|
+
const exists = db
|
|
66
|
+
.prepare("SELECT 1 AS ok FROM sqlite_master WHERE type='table' AND name = ?")
|
|
67
|
+
.get(table);
|
|
68
|
+
if (exists === undefined)
|
|
69
|
+
return null;
|
|
70
|
+
const row = db.prepare(`SELECT COUNT(*) AS c FROM "${table}"`).get();
|
|
71
|
+
return row?.c ?? null;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
db?.close();
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
/* already closed or never opened */
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Scan a project for store files superseded by `cleo.db`.
|
|
87
|
+
*
|
|
88
|
+
* Read-only — deletes nothing and opens nothing for write. The caller decides
|
|
89
|
+
* what to do with the recommendation.
|
|
90
|
+
*
|
|
91
|
+
* @param projectRoot - absolute path to the project root.
|
|
92
|
+
* @returns the survey; `entries` is empty for a project that never migrated or
|
|
93
|
+
* that has already been tidied.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* const scan = scanSupersededStores('/mnt/projects/PepsVida');
|
|
98
|
+
* for (const e of scan.entries) console.log(e.name, e.reason);
|
|
99
|
+
* // tasks.db superseded by cleo.db: 0 rows here vs 1123 in cleo.db#tasks_tasks …
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @task T12095
|
|
103
|
+
*/
|
|
104
|
+
export function scanSupersededStores(projectRoot) {
|
|
105
|
+
const liveStorePath = join(projectRoot, '.cleo', LIVE_STORE_FILENAME);
|
|
106
|
+
const liveStoreExists = existsSync(liveStorePath);
|
|
107
|
+
if (!liveStoreExists) {
|
|
108
|
+
// No dual-scope store means nothing has been superseded — a pre-migration
|
|
109
|
+
// project's `tasks.db` IS its live database and must not be flagged.
|
|
110
|
+
return { projectRoot, liveStorePath, liveStoreExists: false, entries: [] };
|
|
111
|
+
}
|
|
112
|
+
const liveMtimeMs = statSync(liveStorePath).mtimeMs;
|
|
113
|
+
const entries = [];
|
|
114
|
+
for (const { file, bareTable, liveTable } of SUPERSEDED_STORES) {
|
|
115
|
+
const path = join(projectRoot, '.cleo', file);
|
|
116
|
+
if (!existsSync(path))
|
|
117
|
+
continue;
|
|
118
|
+
const stat = statSync(path);
|
|
119
|
+
// A file NEWER than cleo.db is not obviously dead — say nothing rather than
|
|
120
|
+
// risk advising removal of something still being written.
|
|
121
|
+
if (stat.mtimeMs >= liveMtimeMs)
|
|
122
|
+
continue;
|
|
123
|
+
const rowsInSuperseded = countRows(path, bareTable);
|
|
124
|
+
const rowsInLive = countRows(liveStorePath, liveTable);
|
|
125
|
+
// `rowsInSuperseded === 0` must be EXPLICIT, never `?? 0`. `null` means the
|
|
126
|
+
// file could not be read — corrupt, locked, truncated, or not SQLite — and
|
|
127
|
+
// "I could not read it" is not "it is empty". Coalescing the two would
|
|
128
|
+
// recommend archiving precisely the file whose contents are unknown, which
|
|
129
|
+
// is the one case where being wrong loses data.
|
|
130
|
+
const safeToArchive = (rowsInLive ?? 0) > 0 && rowsInSuperseded === 0;
|
|
131
|
+
const reason = safeToArchive
|
|
132
|
+
? `superseded by ${LIVE_STORE_FILENAME}: ${rowsInSuperseded ?? 0} rows in ${file}#${bareTable} ` +
|
|
133
|
+
`vs ${rowsInLive} in ${LIVE_STORE_FILENAME}#${liveTable}. Last written ` +
|
|
134
|
+
`${stat.mtime.toISOString().slice(0, 10)}, while ${LIVE_STORE_FILENAME} was written ` +
|
|
135
|
+
`${new Date(liveMtimeMs).toISOString().slice(0, 10)}. Its name is the one the docs and ` +
|
|
136
|
+
`\`cleo restore backup --file tasks.db\` still say, and snapshots are named ` +
|
|
137
|
+
`\`tasks-<ts>.db\` even though they snapshot ${LIVE_STORE_FILENAME} — so this file reads ` +
|
|
138
|
+
`as a truncated live DB when it is simply the pre-migration one.`
|
|
139
|
+
: `predates ${LIVE_STORE_FILENAME} but still holds ${rowsInSuperseded ?? 'an unknown number of'} ` +
|
|
140
|
+
`rows in ${bareTable} (live ${liveTable}: ${rowsInLive ?? 'unreadable'}). NOT recommended for ` +
|
|
141
|
+
`removal — reconcile the contents first.`;
|
|
142
|
+
entries.push({
|
|
143
|
+
path,
|
|
144
|
+
name: file,
|
|
145
|
+
sizeBytes: stat.size,
|
|
146
|
+
modifiedAt: stat.mtime.toISOString(),
|
|
147
|
+
rowsInSuperseded,
|
|
148
|
+
rowsInLive,
|
|
149
|
+
safeToArchive,
|
|
150
|
+
reason,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
entries.sort((a, b) => Date.parse(b.modifiedAt) - Date.parse(a.modifiedAt));
|
|
154
|
+
return { projectRoot, liveStorePath, liveStoreExists: true, entries };
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=superseded-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superseded-store.js","sourceRoot":"","sources":["../../src/doctor/superseded-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6C3C;;;;GAIG;AACH,MAAM,iBAAiB,GAIjB;IACJ,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE;IAClE,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,oBAAoB,EAAE,SAAS,EAAE,oBAAoB,EAAE;CAC9E,CAAC;AAEX,+CAA+C;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,SAAS,SAAS,CAAC,MAAc,EAAE,KAAa;IAC9C,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,EAAE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,IAAI,CAAC;YACX,IAAI;YACJ,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,IAAI,CAAC,IAAI;YACpB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACpC,gBAAgB;YAChB,UAAU;YACV,aAAa;YACb,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/llm/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/llm/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwBH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAkBnF;AAiFD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,SAAS,EAAE,MAAM,EACjB,cAAc,UAAO,GACpB,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAkChC"}
|
package/dist/llm/conversation.js
CHANGED
|
@@ -8,11 +8,22 @@
|
|
|
8
8
|
* @epic T1386
|
|
9
9
|
*/
|
|
10
10
|
import { getEncoding } from 'js-tiktoken';
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Lazily-built cl100k_base encoder.
|
|
13
|
+
*
|
|
14
|
+
* T12076: this was `const _enc = getEncoding('cl100k_base')` at MODULE SCOPE.
|
|
15
|
+
* `getEncoding` parses the BPE vocabulary, measured at 156 ms, and this module is
|
|
16
|
+
* reachable from the `@cleocode/core` barrel — so every `cleo` invocation built a
|
|
17
|
+
* tokenizer table before doing anything, including commands that never count a
|
|
18
|
+
* token. Deferring to first use keeps the surrounding API synchronous (the static
|
|
19
|
+
* import stays; only the table build moves) while removing the cost from startup.
|
|
20
|
+
*/
|
|
21
|
+
let _enc = null;
|
|
12
22
|
/**
|
|
13
23
|
* Estimate token count for a string using tiktoken cl100k_base.
|
|
14
24
|
*/
|
|
15
25
|
function estimateTokens(text) {
|
|
26
|
+
_enc ??= getEncoding('cl100k_base');
|
|
16
27
|
return _enc.encode(text).length;
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/llm/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/llm/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;GASG;AACH,IAAI,IAAI,GAA0C,IAAI,CAAC;AAEvD;;GAEG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,IAAI,KAAK,WAAW,CAAC,aAAa,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAwC;IACzE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,GAAG,IAAI,Q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