Charlie Roffe

Principal Architect & Engineering Director · Cloud & AI

Madrid, Spain · LinkedIn · GitHub

ADR-041: ADR Explainers for Different Readers

Context

The Architecture Decision Records are written for engineers. The site's readers are wider: executives and hiring managers who want the "so what", engineers who want the mechanism, and people new to cloud who want the idea. Writing three versions of every record by hand would triple the maintenance and drift from the originals.

Decision

Add "Explain this decision for: an executive, an engineer, a newcomer" to every ADR; choosing a reader shows the record retold for them above the full record.
1. The record is the only source: POST /api/ai/adr-explain sends Gemini that one record and a short brief for the reader (executive: what and why it matters, at most 120 words; engineer: the mechanism and failure modes, 160; newcomer: plain language and one analogy, 140). It must not add facts or judge the decision.
2. Cached: the answer depends only on record, reader, language and model, so it uses the demo-result cache (memory, then Firestore with its TTL); a prompt version in the key retires old answers.
3. Labelled as written by Gemini from the record, which stays on the page below as the source.
4. Same guards as the demos (rate limit, App Check, daily budget), only known ids and the three readers accepted, and an adrExplainers flag, on by default (ADR-016).

Consequences

Benefits:
* Every record reads well for three audiences without maintaining three versions.
* After the first request per record, reader and language, explanations are free and instant.

Trade-offs:
* A retelling can lose nuance, so the full record stays directly below it.
* A cached explanation can outlive an edit to its record until the entry expires or the prompt version changes.

Alternatives considered

1. Hand-written summaries per audience: Rejected — three versions of 40-odd records to keep in step with every amendment.
2. Generating on every request without a cache: Rejected — the same answer would cost a model call each time.
3. Asking the concierge: it can explain a record in chat, but a one-click switch on the record is quicker and keeps the reader on the page.

Architecture Decision Records