Knowledge base: overdue-review workflow + log-study.mjs YAML bug
Date: 2026-08-28 Project: astro-starter-template (second-brain knowledge graph)
What happened
Processed the 12 overdue reviews in one session. Found and fixed a bug in
scripts/log-study.mjs that corrupted every node it touched.
The bug
log-study.mjs wrote the closing --- glued to the last frontmatter line
(writeFileSync(path, \---{body}`)). Any node whose frontmatter ended with a YAML list (open_questions: items) or scalar ([], dates) got invalid YAML: - item?---or[]---. Build failed. Older reviewed` dates in
git predate this script, so it had never actually run on a list-ending file.
The fix (scripts/log-study.mjs)
fm = raw.slice(3, fmEnd).replace(/\n+$/, "")body = raw.slice(fmEnd + 5)(skip newline after closing---)- write
---${fm}\n---\n${body}so the delimiter is always on its own line - Verified with a round-trip re-log on the same file.
Also: package.json was missing the node:log alias that README documents;
restored it ("node:log": "node scripts/log-study.mjs").
Workflow for future review sessions (no questions, straight through)
npm run build→ check “REVIEW DUE” list fromdist/graph.json(next_review <= today).- For each node:
npm run node:log -- <slug> 10— bumps hours, setsreviewed=today, reschedulesnext_reviewby level (1d/3d/7d/16d/35d/90d for L0–L5). - Keep
open_questionsas-is — they are part of the review strategy, not to-do items to resolve during review. - No status changes unless the user says so.
Statuses after the 2026-08-28 session
All 12 reviewed nodes kept status; next reviews: L3 → 09-13, L2 → 09-04, L1 → 08-31. 2726h logged, build green, 21 debt/open-question items.