This directory holds Codeograph's architecture decisions, one ADR per file, following MADR 4.0.0 with the differences listed under Template. ADRs record decisions, not code. Earlier ADRs include implementation snippets; where they differ, the code and schemas are authoritative. The rules an ADR decides still govern.
ADR numbers reflect architectural layer (input → graph → rendering → LLM → quality → cross-cutting), not the order they were designed or the runtime execution sequence. If you read them in strict number order, you'll hit forward references between layers — the recommended reading order below is grouped by topic and orders concerns the way the runtime pipeline actually flows.
| Symbol | status: |
Meaning |
|---|---|---|
| ✅ | accepted |
Decision committed; changes require a new ADR or a formal amendment, except a reference fix — see below |
| 📝 | proposed |
File is in this directory, decision not yet accepted — open for review |
| ⬜ | — | Number reserved; no file yet |
| ⏸️ | — | Number reserved, deferred to v1.1 or later; design not started |
The symbol in the index below and the status: field in each ADR's frontmatter describe the same
state. ⬜ and ⏸️ have no file, so they have no frontmatter — the reservation row is the whole record.
For someone new to the project who wants to understand the design end-to-end, read in this order — not by ADR number:
ADR-001 — Project skeleton— repo layout, language choice, CI baseline
ADR-002 — Input-agnostic design— module discovery, multi-module Maven, gitignore-driven exclusionADR-003 — Parsing strategy— JavaParser, Lombok synthesis, annotation scopeADR-033 — Extraction environment and parser failures— proposed — third-party resolution from the build's own classpath, parser-process retry, the extraction report; on acceptance, supersedes ADR-003's classpath fork
ADR-004 — Complexity model— six metrics, cited thresholdsADR-006 — Knowledge graph schema— node/edge taxonomy, canonical-form sha256 amendmentADR-007 — Golden-graph pattern— byte-equal regression testing, multi-corpus, reproducibility envelope
ADR-005 — Token utilization— prompt-cache strategy, concurrency, oversized-input handling, single-Sonnet v1ADR-013 — LLM provider abstraction—LlmProviderinterface, middleware pattern, LangChain wrappingADR-014 — Prompt versioning— Markdown prompts with frontmatter, Jinja2 custom delimiters, content-hash pinningADR-015 — Telemetry + response cache— JSONL records, SQLite content-addressed cache, cross-run reporting
ADR-008 — Pluggable renderer interfaceADR-009 — Rendering budget capADR-010 — Spring Boot to NestJS/TypeScript idiom mappingADR-034 — Placeholders for unrendered classes— proposed — a typed skeleton for every refused or failed class; on acceptance, supersedes ADR-008 D-008-2 and ADR-010 Fork 9's refuse behaviour
ADR-017 — Evaluation frameworkADR-018 — Test strategy with pytestADR-032 — Evaluation check semantics— proposed — what each graph check measures and reads; on acceptance, supersedes ADR-017's four check definitions and its coverage inputs
ADR-022 — Run manifest and structured logging— manifest schema forks (1/2/7) superseded by ADR-025; logging forks remain in forceADR-025 — Manifest schema 2.0.0 (flat layout)— supersedes ADR-022's manifest forks + ADR-015'scache_statsshapeADR-023 — Secret scanning with gitleaksADR-026 — Release & version management— SemVer scheme,0.x→1.0.0at the stability gate, version sourced from package metadataADR-035 — Artefact schema versions— proposed — every indexed artefact carries its schema version, copied on its manifest pointer; a version the reader does not read is refused; one published schema per major, strict on write and tolerant on read; on acceptance, supersedes ADR-006 Fork 6 (d) and ADR-025 Fork 4's version-authority statementsADR-027 — Temporary v1 cost-safety floor— pre-flight estimate + confirmation gate + optional hard call/token ceiling, for every command that calls an LLM; the permanent base of the spend bounds, extended by ADR-016 (2026-11-11 amendment)ADR-029 — Output layout and ownership— proposed — where each output lives and which command writes it; on acceptance, supersedes ADR-022 Fork 5 and ADR-001 Bundle D's configuration-file locationADR-028 — What a command may overwrite, delete or refuse— proposed — archive, re-render modes, earlier-version folders, concurrencyADR-030 — Invocation identity and history— proposed — per-invocation identifier,runs.jsonl, per-invocation logsADR-031 — Command outcomes and consent— proposed — exit statuses and when a command asks
ADR-011 — Spring → Go mappingADR-012 — Error-handling translationADR-016 — Cost-control CLIADR-019 — Snapshot + negative testsADR-020 — LLM-judge calibrationADR-021 — Determinism contractADR-024 — Prompt-injection defence
| # | Title | Status | Reading-order group |
|---|---|---|---|
| 001 | Project skeleton | ✅ | Foundation |
| 002 | Input-agnostic design | ✅ | Input & parsing |
| 003 | Parsing strategy | ✅ | Input & parsing |
| 004 | Complexity model | ✅ | Graph extraction |
| 005 | Token utilization | ✅ | LLM infrastructure |
| 006 | Knowledge graph schema | ✅ | Graph extraction |
| 007 | Golden-graph pattern | ✅ | Graph extraction |
| 008 | Pluggable renderer interface | ✅ | Rendering |
| 009 | Rendering budget cap | ✅ | Rendering |
| 010 | Spring Boot → NestJS/TypeScript idiom mapping | ✅ | Rendering |
| 011 | Spring → Go mapping | ⏸️ | Deferred (v1.1) |
| 012 | Error-handling translation | ⏸️ | Deferred (v1.1) |
| 013 | LLM provider abstraction | ✅ | LLM infrastructure |
| 014 | Prompt versioning | ✅ | LLM infrastructure |
| 015 | Telemetry + response cache | ✅ | LLM infrastructure |
| 016 | Cost-control CLI | ⏸️ | Deferred (v1.1) |
| 017 | Evaluation framework | ✅ | Quality & testing |
| 018 | Test strategy with pytest | ✅ | Quality & testing |
| 019 | Snapshot + negative tests | ⏸️ | Deferred (v1.1) |
| 020 | LLM-judge calibration | ⏸️ | Deferred (v1.1) |
| 021 | Determinism contract | ⏸️ | Deferred (v1.1) |
| 022 | Run manifest and structured logging | ✅ (manifest forks superseded by 025) | Cross-cutting |
| 023 | Secret scanning with gitleaks | ✅ | Cross-cutting |
| 024 | Prompt-injection defence | ⏸️ | Deferred (v1.1) |
| 025 | Manifest schema 2.0.0 (flat layout) | ✅ | Cross-cutting |
| 026 | Release & version management | ✅ | Cross-cutting |
| 027 | Temporary v1 cost-safety floor | ✅ | Cross-cutting |
| 028 | What a command may overwrite, delete or refuse | 📝 | Cross-cutting |
| 029 | Output layout and ownership | 📝 | Cross-cutting |
| 030 | Invocation identity and history | 📝 | Cross-cutting |
| 031 | Command outcomes and consent | 📝 | Cross-cutting |
| 032 | Evaluation check semantics | 📝 | Quality & testing |
| 033 | Extraction environment and parser failures | 📝 | Input & parsing |
| 034 | Placeholders for unrendered classes | 📝 | Rendering |
| 035 | Artefact schema versions | 📝 | Cross-cutting |
Three steps. Step 1 is a precondition — a PR that adds an ADR file without a reserved number will be declined.
Open a PR that adds a single row to the Index by ADR number table above: the next free number,
the title, ⬜, and your GitHub handle as owner. Nothing else — no ADR file yet.
The index is one file with one row per number, so two people claiming the same number produce a merge conflict. That is the mechanism: reservation is serialised by merge, not by convention.
A reservation with no PR activity for six months may be released and the number reassigned.
Once the reservation is merged, add ADR-<NNN>-<slug>.md to this directory with
status: proposed, on a branch, via PR. Use the number you reserved. Follow the template and
conventions below; an ADR that doesn't meet them will be sent back rather than declined.
Discussion happens in the PR. If the problem needs exploring before a decision is defensible, open an issue first — that's the cheaper place for option debates than a PR thread.
Merge to main with status: proposed or status: accepted. An ADR merged as proposed is
accepted later, once the code that implements it has passed review — see
Status lifecycle. Before either merge, a reviewer checks that the decision is genuinely
architectural (see "When to write a new ADR"), that at least two options were considered with real
tradeoffs, that the Confirmation section states how the decision can be verified in code, and that
no forward reference contradicts a locked ADR.
These are maintainer-owned by design. Issues and discussion are welcome; ADR PRs will be declined.
| Area | Why |
|---|---|
| ADR-003 — parsing strategy | Tool-selection call reserved to the maintainer |
| ADR-004 — complexity model | Every threshold must cite a published source |
| ADR-011 — Spring → Go idiom mapping | The mapping design is the project's core exercise |
| README "Point of view" section | Author's personal voice |
- Three digits, sequential from
001. Never reuse a number, including for a withdrawn proposal. - Numbers
001–021were allocated by architectural layer (input → graph → rendering → LLM → quality → cross-cutting). That scheme is closed: from022onward numbers are allocated in reservation order. The recommended reading order above carries the layer grouping instead. - One topic per file. An ADR may group closely related decisions — its forks — each with its own options and outcome; a decision on a different topic gets its own number.
reserved (index row only) → proposed (file, status: proposed) → accepted
↘ withdrawn (number retired, not reused)
accepted → deprecated
→ superseded by ADR-NNN
A proposed ADR may be merged and implemented against. It stays proposed while the code that
implements it is built and reviewed, and is accepted only once that code has passed its development
review and reconciliation — so a design problem the implementation exposes is fixed while the decision
is still open, not by a later amendment or supersession. Until then, a design change is edited into the
ADR directly and listed, with its date and reason, in a ## Revision history section at the end.
Accepting it is its own change: the status: field moves to accepted. The amendments it needs in
accepted ADRs are written when it is accepted, not before — an accepted ADR's amendments are
immutable, so they wait until the proposal is final; meanwhile each one is listed in the proposed ADR's
Constraint flagged subsections.
An accepted ADR is immutable, with three exceptions: its status: field; append-only ## Amendments
sections; and reference fixes. Never edit the original decision text to reflect a later change — that
destroys the record of what was decided when, which is the entire point of an ADR. Its revision history,
if it has one, stays as the record of how the proposal evolved.
A reference fix corrects a citation, link, path or label that names something outside the ADR, or
replaces it with a plain description of what it named — when what was decided, why, and how it is worded
otherwise stay exactly as they were. Each one gets a dated line in the ADR's ## Revision history (added
if the ADR has none). A change that rewords a rationale or alters a decision is not a reference fix; it is
an amendment.
Write a new ADR when:
- A decision has lasting architectural consequences (call shape, data model, dependency, deployment topology)
- Reasonable people could disagree on the answer; the rationale needs to be recorded
- The decision constrains future ADRs
Do not write an ADR for:
- Routine library version bumps
- Coding-style choices (those live in
CONTRIBUTING.md) - Tactical refactors that don't change the architecture
| Situation | Action |
|---|---|
| Small additive clarification (a new field, a new option) | Amend the existing ADR; add an "Amendment" section dated and signed |
| Material change to the decision (different option chosen, scope expanded) | Supersede with a new ADR; mark the old one status: superseded by ADR-NNN and add a link |
| Decision proved wrong in practice | Supersede + write a "Lessons" section in the new ADR explaining what didn't work |
ADR-NNN-kebab-case-slug.md
NNN is the three-digit ADR number. The slug is a short kebab-case identifier — keep it under ~40 characters.
Each ADR follows MADR 4.0.0 with these sections:
- YAML frontmatter —
status,date(the day it was last updated),decision-makers(GitHub handles),consulted,informed - Context and Problem Statement
- Decision Drivers
- Considered Options — one list per fork, with ✅ on the chosen option
- Decision Outcome — per fork: the chosen option and the rules it makes, with a table where the table is itself the decision. No implementation code, copied configuration or line references; a short snippet only for an interface or format the decision fixes
- Consequences — Positive / Negative
- Confirmation — checklist of how to verify the decision is implemented correctly
- Pros and Cons of the Considered Options — per-fork tradeoff breakdown
- More Information — relationships to other ADRs, deferred items, references
- Revision history — only for a merged ADR changed while
proposed: one dated line per change - Amendments — only after acceptance, append-only
Differences from MADR 4.0.0, kept on purpose so new ADRs read like the accepted ones:
- Several closely related decisions (forks) in one ADR, where MADR has one decision per ADR.
- Consequences and Confirmation as top-level sections; Confirmation is required, as numbered checks a test can show.
- Revision history and Amendments: a proposed ADR is edited with a dated history line; an accepted one changes only by amendment or supersession.
- Constraint flagged for ADR-NNN subsections in Decision Outcome, for an obligation one ADR places on another — what the other ADR must honour, not how.
- Third-person voice; the headings Pros and Cons of the Considered Options and
# ADR-NNN — Title.
ADRs 001–021 were designed in batches, grouped by which decisions had to lock together, and numbered by architectural layer rather than by the order they were written. So the number sequence is neither the design sequence nor the runtime sequence — which is why the reading order above is grouped by topic instead.
The design-time ordering is operational metadata, not architectural metadata, so it isn't recorded in the ADRs themselves. Each ADR carries only what's needed to understand and confirm its decision.
Some ADRs introduce concepts referenced across many others:
- Canonical-form sha256 — defined in ADR-006 amendment; consumed by ADR-007 (goldens), ADR-015 (cache key), ADR-022 (manifest integrity).
--ast-onlymode — declared in ADR-007 §"Pipeline orchestration constraint"; honored by ADR-013 §"Decision Outcome".CallContext(purpose, prompt_id, prompt_version, prompt_content_hash, corpus_id) — defined in ADR-013 Fork 3; consumed by ADR-015 cache key and telemetry record.- Banned terms — a maintainer-side review discipline, not a repo-enforced rule and not owned by any ADR.
- MADR template — the format used by every ADR here
- ADR GitHub Organization — broader resources on the pattern
- Michael Nygard's original ADR essay — the seminal write-up