Task 372: Automated Stats Refresh Script
完了 ← タスク一覧
Task 372: Automated Stats Refresh Script
Status: DONE
Motivation
The tech-overview.md report contains statistics (test counts, task counts, total counts) that must be manually synchronized whenever tests are added or tasks are completed. This has been a recurring pain point — 27 separate "stats refresh" tasks have been created just to update these numbers. Each time a new task adds tests, the stats go stale and tests fail.
Implementation
Created npm run stats-refresh that automatically:
- Runs
npm testand extracts TS test count from output - Runs
cargo test --workspaceand sums Rust test counts - Runs
npx playwright test --listto count E2E tests - Runs
bash cross_validation/run.shand counts [PASS]/✓/OK lines (all formats) - Counts
.mdfiles incurrent_tasks/ - Runs
git rev-list --count HEADfor commit count - Updates both the stats table AND body text in
tech-overview.md
Supports --dry-run flag to preview changes without writing.
Files
ts/src/stats-refresh.ts— main script withcollectStats(),updateStatsTable(),updateBodyText()ts/src/stats-refresh.test.ts— 14 TDD tests (formatNumber, updateStatsTable, updateBodyText)ts/package.json— addedstats-refreshscript entry
Results
- 14 new tests, all passing
- Total TS tests: 2,476 (was 2,462)
- Tech-overview.md automatically updated to: 3,117 total tests, 372 tasks, 513+ commits
- Future sessions can run
npm run stats-refreshinstead of creating a new stats refresh task