ktg-plugin-marketplace/plugins/ms-ai-architect/scripts/kb-update
Kjell Tore Guttormsen aefe9ef5b4 feat(ms-ai-architect): add lib/log-rotate for bounded log disk use [skip-docs]
Foundation lib for v1.12.0 cron rewrite — closes brief deliverable
"log-rotate" that was missing from the original plan (Phase 9 scope
revision). Standard logrotate idiom, zero dependencies.

- rotateLog(logPath, opts) returns {rotated, dropped, kept}
- Defaults: maxSizeBytes 10 MB, maxGenerations 5 (1 active + 4 rotated)
- No-op when log missing or under threshold
- Over-size: drop oldest, shift .N..1 down by one, move active → .1
- maxGenerations=1 keeps only the active slot (no rotated copies)
- Pure stdlib fs.renameSync chain with silent try/catch on missing gens

8/8 tests pass: missing/under-size/over-size paths, chained 6 rotations
capped at maxGenerations, oldest dropped, two-step content shift.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-05 10:54:50 +02:00
..
lib feat(ms-ai-architect): add lib/log-rotate for bounded log disk use [skip-docs] 2026-05-05 10:54:50 +02:00
build-registry.mjs feat(ms-ai-architect): sitemap-based KB change detection system 2026-04-09 21:19:51 +02:00
discover-new-urls.mjs feat(ms-ai-architect): sitemap-based KB change detection system 2026-04-09 21:19:51 +02:00
poll-sitemaps.mjs feat(ms-ai-architect): sitemap-based KB change detection system 2026-04-09 21:19:51 +02:00
report-changes.mjs feat(ms-ai-architect): sitemap-based KB change detection system 2026-04-09 21:19:51 +02:00
run-weekly-update.mjs feat(ms-ai-architect): sitemap-based KB change detection system 2026-04-09 21:19:51 +02:00
weekly-kb-cron.mjs feat(ms-ai-architect): tune weekly KB cron and update README 2026-04-10 11:47:05 +02:00