Skip to content

Latest commit

 

History

History

adr

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Architecture Decision Records

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.


Status legend

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.


Recommended reading order

For someone new to the project who wants to understand the design end-to-end, read in this order — not by ADR number:

1. Foundation

2. Input & parsing

3. Graph extraction (deterministic half of the pipeline)

4. LLM infrastructure (probabilistic half of the pipeline)

5. Rendering

6. Quality & testing

7. Cross-cutting

8. Deferred to v1.1 / post-v1 ⏸️

  • ADR-011 — Spring → Go mapping
  • ADR-012 — Error-handling translation
  • ADR-016 — Cost-control CLI
  • ADR-019 — Snapshot + negative tests
  • ADR-020 — LLM-judge calibration
  • ADR-021 — Determinism contract
  • ADR-024 — Prompt-injection defence

Index by ADR number (reference table)

# 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

Proposing a new ADR

Three steps. Step 1 is a precondition — a PR that adds an ADR file without a reserved number will be declined.

1. Reserve the number

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.

2. Write the ADR

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.

3. Acceptance

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.

Areas that do not accept outside proposals

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

Conventions

Numbering

  • Three digits, sequential from 001. Never reuse a number, including for a withdrawn proposal.
  • Numbers 001–021 were allocated by architectural layer (input → graph → rendering → LLM → quality → cross-cutting). That scheme is closed: from 022 onward 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.

Status lifecycle

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.

When to write a new ADR

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

When to amend vs supersede

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

File naming

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.

Template

Each ADR follows MADR 4.0.0 with these sections:

  1. YAML frontmatter — status, date (the day it was last updated), decision-makers (GitHub handles), consulted, informed
  2. Context and Problem Statement
  3. Decision Drivers
  4. Considered Options — one list per fork, with ✅ on the chosen option
  5. 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
  6. Consequences — Positive / Negative
  7. Confirmation — checklist of how to verify the decision is implemented correctly
  8. Pros and Cons of the Considered Options — per-fork tradeoff breakdown
  9. More Information — relationships to other ADRs, deferred items, references
  10. Revision history — only for a merged ADR changed while proposed: one dated line per change
  11. 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.

Why the numbers don't match the design order

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.


Cross-cutting references

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-only mode — 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.

References