getprismo 0.1.48 → 0.1.50
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
|
@@ -6,3 +6,5 @@ Paper cuts, observations, and metric notes from the measurement window. Fix bugs
|
|
|
6
6
|
- 2026-06-12: SaaS frontend test harness still emits two warnings during dogfooding: Supabase auth-js probes Node localStorage without a localstorage file, and useWorkspaceData has an existing exhaustive-deps warning. Left as paper cuts during freeze; Recharts mock hoisting warning was fixed in the SaaS repo.
|
|
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
|
+
- 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.
|
|
@@ -394,20 +394,39 @@ function renderOptimizeReport(ctx, generatedFiles) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
function normalizeOptimizeReportForCompare(contents) {
|
|
397
|
-
return contents
|
|
397
|
+
return contents
|
|
398
|
+
.replace(/^- Generated at: .+$/m, "- Generated at: <timestamp>")
|
|
399
|
+
.replace(/## Generated Files\n\n(?:- `[^`]+`\n?)+/m, "## Generated Files\n\n- <generated-files>\n");
|
|
398
400
|
}
|
|
399
401
|
|
|
400
402
|
function writeOptimizeReport(root, relPath, contents) {
|
|
401
403
|
const fullPath = path.join(root, relPath);
|
|
402
404
|
try {
|
|
403
|
-
if (
|
|
404
|
-
fs.
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
if (fs.existsSync(fullPath)) {
|
|
406
|
+
const existing = fs.readFileSync(fullPath, "utf8");
|
|
407
|
+
if (existing === contents) {
|
|
408
|
+
return { path: relPath, backupPath: null, unchanged: true };
|
|
409
|
+
}
|
|
410
|
+
if (normalizeOptimizeReportForCompare(existing) === normalizeOptimizeReportForCompare(contents)) {
|
|
411
|
+
fs.writeFileSync(fullPath, contents, "utf8");
|
|
412
|
+
return { path: relPath, backupPath: null, metadataOnly: true };
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
} catch {}
|
|
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) {
|
|
407
425
|
return { path: relPath, backupPath: null, unchanged: true };
|
|
408
426
|
}
|
|
409
427
|
} catch {}
|
|
410
|
-
|
|
428
|
+
fs.writeFileSync(fullPath, contents, "utf8");
|
|
429
|
+
return { path: relPath, backupPath: null, replaced: existed };
|
|
411
430
|
}
|
|
412
431
|
|
|
413
432
|
function renderScopedContext(ctx, scope) {
|
|
@@ -543,7 +562,7 @@ function runOptimize(rootDir = process.cwd(), options = {}) {
|
|
|
543
562
|
}
|
|
544
563
|
|
|
545
564
|
for (const [name, contents] of pending) {
|
|
546
|
-
const written =
|
|
565
|
+
const written = writeOptimizeGeneratedFile(ctx.root, path.join(".prismo", name), contents);
|
|
547
566
|
generated.push(written.path);
|
|
548
567
|
}
|
|
549
568
|
const report = renderOptimizeReport(ctx, [...generated, ".prismo/optimize-report.md"]);
|
package/package.json
CHANGED