getprismo 0.1.49 → 0.1.51
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/docs/validation-week.md
CHANGED
|
@@ -7,3 +7,4 @@ Paper cuts, observations, and metric notes from the measurement window. Fix bugs
|
|
|
7
7
|
- 2026-06-12: follow-up dogfood found optimize-report.md still churned backups because the report timestamp changed every auto-detect. Fixed by comparing optimize reports with the generated-at line normalized and added a repeated-run regression test.
|
|
8
8
|
- 2026-06-12: follow-up dogfood found backend-summary.md could churn backups because generated .prismo context files influenced load-bearing text-reference counts. Excluded .prismo generated context from the reference corpus and added a regression test; repeated optimize on the SaaS repo now produces 0 new .bak files after the one-time old-report replacement.
|
|
9
9
|
- 2026-06-12: connector dogfood found scoped `optimize frontend` and unscoped `optimize` could alternate optimize-report.md's Generated Files list and create metadata-only backups. Changed optimize-report metadata-only changes to update without backups and added a scoped/unscoped regression test.
|
|
10
|
+
- 2026-06-12: connector dogfood found legitimate generated-context changes still left timestamped `.prismo/*.bak` files, which made the repo look dirty during validation. Changed `prismo optimize` context files to update in place because they are reproducible generated artifacts; user-authored files still keep backups.
|
|
@@ -413,7 +413,20 @@ function writeOptimizeReport(root, relPath, contents) {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
} catch {}
|
|
416
|
-
return
|
|
416
|
+
return writeOptimizeGeneratedFile(root, relPath, contents);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function writeOptimizeGeneratedFile(root, relPath, contents) {
|
|
420
|
+
const fullPath = path.join(root, relPath);
|
|
421
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
422
|
+
const existed = fs.existsSync(fullPath);
|
|
423
|
+
try {
|
|
424
|
+
if (existed && fs.readFileSync(fullPath, "utf8") === contents) {
|
|
425
|
+
return { path: relPath, backupPath: null, unchanged: true };
|
|
426
|
+
}
|
|
427
|
+
} catch {}
|
|
428
|
+
fs.writeFileSync(fullPath, contents, "utf8");
|
|
429
|
+
return { path: relPath, backupPath: null, replaced: existed };
|
|
417
430
|
}
|
|
418
431
|
|
|
419
432
|
function renderScopedContext(ctx, scope) {
|
|
@@ -549,7 +562,7 @@ function runOptimize(rootDir = process.cwd(), options = {}) {
|
|
|
549
562
|
}
|
|
550
563
|
|
|
551
564
|
for (const [name, contents] of pending) {
|
|
552
|
-
const written =
|
|
565
|
+
const written = writeOptimizeGeneratedFile(ctx.root, path.join(".prismo", name), contents);
|
|
553
566
|
generated.push(written.path);
|
|
554
567
|
}
|
|
555
568
|
const report = renderOptimizeReport(ctx, [...generated, ".prismo/optimize-report.md"]);
|
|
@@ -228,9 +228,18 @@ function getClaudeSessionFiles(cwd = process.cwd()) {
|
|
|
228
228
|
}
|
|
229
229
|
const files = [];
|
|
230
230
|
for (const candidate of Array.from(new Set(candidates))) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
// Claude Code names a project folder by replacing every path separator,
|
|
232
|
+
// whitespace, and dot in the cwd with "-" (e.g. "/Users/me/Code Projects/app"
|
|
233
|
+
// -> "-Users-me-Code-Projects-app"). Matching only "/\:" missed any path
|
|
234
|
+
// containing a space or dot, silently dropping all Claude Code telemetry.
|
|
235
|
+
const encodings = new Set([
|
|
236
|
+
candidate.replace(/[\/\\:.\s]/g, "-"),
|
|
237
|
+
candidate.replace(/[\/\\:]/g, "-"), // legacy fallback for older folders
|
|
238
|
+
]);
|
|
239
|
+
for (const safeProject of encodings) {
|
|
240
|
+
const projectDir = path.join(claudeHome, "projects", safeProject);
|
|
241
|
+
files.push(...listFilesRecursive(projectDir, (file) => file.endsWith(".jsonl"), 200));
|
|
242
|
+
}
|
|
234
243
|
}
|
|
235
244
|
return Array.from(new Set(files));
|
|
236
245
|
}
|
package/package.json
CHANGED