ktg-plugin-marketplace/plugins/ms-ai-architect/scripts
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
..
kb-update feat(ms-ai-architect): add lib/log-rotate for bounded log disk use [skip-docs] 2026-05-05 10:54:50 +02:00
skill-gen chore(ms-ai-architect): sanitize all private references for open-source 2026-04-07 17:27:10 +02:00
build-demo-state.mjs feat(ms-ai-architect): release v1.11.0 — design-system 100%-adoption + visual upgrade 2026-05-04 17:41:36 +02:00
export-pdf.py feat(ms-ai-architect): add plugin to open marketplace (v1.5.0 baseline) 2026-04-07 17:17:17 +02:00
kb-staleness-check.sh feat(ms-ai-architect): add plugin to open marketplace (v1.5.0 baseline) 2026-04-07 17:17:17 +02:00