ADRs & evidence: record decisions, verify docs
Write down why, and check your sources before you rely on them
Architecture Decision Records
Six months from now someone will ask “why didn’t we use Astro?” or “why is there no JSON key for deploys?”. An ADR is a short file that answers that question permanently.
# ADR-0003: Secrets management
- **Status:** Accepted
- **Date:** 2026-09-26
## Context (what forced a decision; constraints)
## Decision (what we chose, specifically)
## Alternatives (what we rejected, and why)
## Consequences (what gets easier or harder, and what to watch)Rules that keep ADRs useful:
- One decision per file, numbered:
docs/adr/0001-stack-and-hosting.md. - Immutable once accepted. To change your mind, write a new ADR that supersedes the old one, and mark the old one Superseded by ADR-00NN. The history of your thinking is the point.
- Short. One page. Link out for detail.
- Reviewed in a PR like code, so the decision has an approver and a date.
Our website started with five: stack and hosting, visual direction (pending), secrets, handoffs, and identity isolation.
The R / GxP angle
Validation packages already contain design rationale, but it’s usually written once, at the end. ADRs capture it when the decision is made, next to the code, with the review trail. They map to:
| Validation artefact | ADR equivalent |
|---|---|
| Design specification rationale | Decision + Alternatives |
| Risk assessment inputs | Context + Consequences |
| Change control record | The PR that added or superseded the ADR |
Where to put them in an R package: not in docs/. That’s where pkgdown writes the site by default, so the two collide. Use adr/ (or design/adr/) at the root with a README index, and usethis::use_build_ignore("adr") so they stay out of the tarball.
Evidence: verify documentation before you trust it
Decisions are only as good as the facts under them. Setting up this project, we hit several cases where the obvious source was wrong or incomplete:
| Claim | What we found |
|---|---|
| “Firebase App Hosting supports Next.js up to 15.2” (support table) | The table was stale. Firebase’s blog and the Next.js docs showed 16.2+ supported via the adapter API |
| “Blank issues disabled means nobody can open one” | GitHub’s own page says both things; the detailed note says maintainers still see a blank option |
“~/.Renviron and a project .Renviron combine” |
Tested with two files: the project one replaces the home one |
“gh uses GITHUB_PAT” |
Tested: GITHUB_PAT_GITHUB_COM wins over GITHUB_PAT, which wins over the credential helper |
“usethis::git_vaccinate() protects .Renviron” |
Read the list it writes: it doesn’t |
“Setting .Last <- function() NULL stops history saving” |
A draft claim that was wrong. Caught in review and removed |
Habits:
- Prefer running it to reading about it. Ten seconds with
Rscript -ebeats any blog post. - Primary sources over summaries. Official docs, source code,
NEWS.md, and the package’s own help. - When sources disagree, record both and what you did about it, in the ADR’s Context.
- Date your evidence. “Checked 2026-09-26” tells a future reader when to re-check.
- Treat AI-written claims like any other secondary source, including your own assistant’s. Verify, or mark them unverified.
Sources
- Architecture Decision Records: adr.github.io
- pkgdown (the reason ADRs shouldn’t live in
docs/in an R package): pkgdown.r-lib.org - usethis (
use_build_ignore()): usethis.r-lib.org - “Blank issues disabled” still lets write-access users open a blank issue: GitHub Docs: Configuring issue templates for your repository
gh/usethisGitHub token lookup order (GITHUB_PAT_GITHUB_COMbeforeGITHUB_PATbefore the credential helper): gh.r-lib.org
- 2026-09-26: Removed the end-of-post checklist.
- 2026-09-27: Added a Sources section.