Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Architecture Decision Records

afm records load-bearing design decisions as MADR-formatted ADRs under docs/adr/. The rationale, alternatives considered, and concrete consequences live there in full — the table below is a map.

#TitleStatus
0001Fork comrak in-tree, 0-line diff budgetAccepted (budget collapsed in v0.2.4)
0002Docker-only execution for development and CIAccepted
0003Initial afm-parser architectureSuperseded by ADR-0010 (v0.2.0 split)
0004Accent decomposition inside 〔…〕Moved to sibling aozora repo
0005Paired block annotation container hookSuperseded by ADR-0008
0006Lint profile policy and scope disciplineMirrored in sibling aozora repo
000717 k-work corpus sweep strategyMoved to sibling aozora repo
0008Zero-parser-hook Aozora-first pipelineMoved to sibling aozora repo
0009Authoring tools live in sibling repositoriesAccepted
0010Extract aozora-* core into a sibling repoAccepted (executed v0.2.0, 2026-04-25)
0011Brand boundary — aozora-*afm-* HTML rewriteAccepted (2026-05-04)

ADRs marked Moved kept their number on this side as redirect stubs (e.g. 0008-MOVED.md); the canonical text now lives in the sibling P4suta/aozora repo.

What’s load-bearing today

If you change anything in these areas, read the cited ADR first:

  • upstream/comrak/ — ADR-0001. 0-line diff means any change here is a fork divergence and needs its own ADR.
  • CI / dev environment — ADR-0002. Host toolchain is forbidden; every command runs through just + Docker.
  • Adding a new Aozora notation — ADR-0010 + the sibling aozora repo’s CLAUDE.md. The lexer, AST, and per-node renderer all live there now.
  • Splicing aozora output into HTML — ADR-0008 (zero parser hooks) + ADR-0011 (brand boundary). afm’s only afm-side rewrite of upstream HTML is the aozora-*afm-* class pass.
  • Authoring tools (formatter / LSP / VS Code extension) — ADR-0009 routes them to the sibling P4suta/aozora-tools repo.

New decisions follow the same MADR format. Scaffold one with:

cargo xtask new-adr '<title>'

Why ADRs live in-repo

ADRs are part of the diff budget for upstream comrak: when a PR touches upstream/comrak/, the ADR is the contract that says why. Keeping them next to the code — and reviewable in the same PR — means the contract evolves with the implementation.