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

Significant technical decisions in Margin are recorded here, with the context and alternatives at the time they were made. The code says what; ADRs say why — so future contributors (and future us) don’t relitigate settled questions or, worse, silently unsettle them.

Process

  1. A decision is significant if reversing it later would cost more than a day, or if a reviewer could reasonably ask “why is it done this way?” Dependency choices, crate boundaries, file formats, user-facing contracts, and policies (errors, MSRV, releases) all qualify. Naming a variable does not.
  2. Copy template.md to NNNN-short-slug.md (next number), open a PR. The PR discussion is the decision review.
  3. Statuses: Proposed → Accepted → (Deprecated | Superseded by ADR-NNNN). Never edit an accepted ADR’s decision — write a new one that supersedes it. History is the point.
  4. PRs that contradict an accepted ADR must include the superseding ADR.

Index

Relationships (amended/superseded clauses) are noted here so no one trusts a stale sentence: the linked ADRs themselves are never rewritten.

ADRTitleStatusNotes
0001Implementation language: RustAccepted
0002TUI stack: ratatui + crosstermAccepted
0003App pattern: Elm architecture with a pure coreAccepted
0004Four-crate workspace with one I/O seamAcceptedI/O seam widened by 0019
0005Git access via git2, quarantined behind DiffSourceAcceptedDiffSource is the read-only seam; writes joined it via 0019
0006Highlighting via syntect; intra-line diff via similarAcceptedWarming clause superseded by 0026
0007CLI mirrors Git verbs; pager passthrough guaranteeAcceptedExit-code wording superseded by 0022
0008Configuration: TOML, XDG + repo-localAcceptedParity rule exempted for safety hatches by 0017
0009Errors: thiserror in libs, anyhow at the edge, no panicsAccepted
0010Testing: snapshots, temp repos, corpus, fuzz, benchesAccepted
0011Releases: cargo-dist, Conventional Commits, MSRV policyAcceptedPackage identity amended by 0025
0012License: MIT OR Apache-2.0Accepted
0013Hunk staging: index-only, dry-run first, exact bytesAccepted
0014Discard: trash before destroy, worktree-only, typed confirmAcceptedPersistent opt-out superseded by 0017
0015Forge access through the user’s gh CLI, quarantined in margin-vcsAccepted
0016Completions and the man page generate at runtime from the binaryAccepted
0017Unbacked discard is an explicit, per-invocation escape hatchAccepted
0018No implicit network access or telemetryAccepted
0019Explicit read, write, and runtime effect seamsAccepted
0020Persist review state as one versioned, atomic recordAccepted
0021Selective user-facing compatibility before 1.0Accepted
0022Distinguish clean, operational, and invocation outcomesAccepted
0023Tool-neutral human review boundary through 1.0Accepted
0024SHA-pinned, least-privilege CI supply chainAccepted
0025Publish the Margin binary as the margin-review packageAccepted
0026Highlight warming is per-frame budgeted fill-in, not a background threadAccepted
0027Refuse invocations that would review something other than what was givenProposedApplies 0007’s “refuse loudly” to piped stdin and misplaced root flags