site

site — audit issues

Audited 2026-06-20. Repo: software/site. Criteria: completeness · tests · separation of concerns · verb-named functions · file size (<1000 lines) · organization.

Health summary

kinogaki-site is a tight, readable ~285-line builder that does one thing well: compose an ordered page list (template.prisma) with per-page /document docs and derive the chrome. The code is clean, well-commented, and the function names mostly read as verbs. The two real concerns are an HTML-injection surface (the rawHtml escape hatch and link/image hrefs flow to disk unsanitized) and a complete absence of tests for logic — slugify, groupCodeTabs, escaping, and heading derivation — that is pure and trivially testable. A couple of derivations (heading-id derivation and the TOC) only scan top-level blocks, so headings nested in notes/quotes/figures silently lose their anchors.

Issues

[HIGH] tests — no tests exist for highly testable pure logic

[MEDIUM] completeness — heading-id derivation and TOC only scan top-level blocks

[MEDIUM] completeness — partial writes leave a half-built site on first error; some failures unreported

[LOW] separation — render, templating, and file I/O share one translation unit

[LOW] naming — clean

[LOW] filesize — clean

[LOW] organization — committed build/ dir present in tree, thin README build section