Skip to content

Architecture Decision Records

One file per decision. The IDs (D6a, D18c, …) are stable: code comments, tests and commit messages cite them.

The rules:

  • An accepted ADR's decision is never rewritten. To change it, write a new ADR and mark the old one Superseded by or Amended by; an amended passage may be struck through with a pointer, never deleted. The history stays visible.
  • A slice's decisions are written as ADRs in the same commit as the code.
  • A large change starts as a PR adding an ADR with Status: Proposed, stating the alternatives it rejects and its open questions. It is accepted, whole or in parts, by the slice that builds it (D47 is the example). See ../../AGENTS.md.
  • For what is true now, read the design; it links here.
  • New ADRs start from TEMPLATE.md. Regenerate this index with uv run python scripts/adr_index.py.

Foundations

ID Decision Status
D1 SKILL.md + the three packs are the whole spec Accepted
D2 Local-first, single user, storage behind a repository interface Accepted — amended by D51 (the claude.ai path it deferred arrives as a hosted peer over HTTP)
D3 Python with uv Accepted
D27 SQLite, not a graph database Accepted
D27b ~~Multi-hop paths (kg path A B) are out of scope~~ Superseded by D40 (kg path was built in slice 13)
D47 The dataset is a log of signed bundles; SQLite is its index Accepted — in parts: D47b (slice 21), D47c–f (slice 22), D47g–k (slice 23: contributors, signing, verify, pull, review by contributor), D47l–p (slice 24: shared scopes, the sweep log, local leases, what a writer had not seen, kg log), D49e (slice 26: kg revert) and D51–D51d (slice 28: the hosted peer); amends D2; amended by D57 (a dataset that publishes states its licence: CC-BY-4.0 by default)
D47c A changeset is written out as a bundle, and a graph is rebuilt from bundles Accepted — implements D47 (part 2); scopes and the sweep log travel from slice 24 (D47l, D47m)
D47g Contributors are listed in the dataset, and bundles are signed Accepted — implements D47 (part 3); verifies D44's declared actor for signed bundles; a listed peer signs for the people it authenticated (D51d)
D47l A scope is shared by choice, as a file in the dataset Accepted — implements D47 (part 4); amends D45 (a shared scope's definition is the dataset's)
D47m Where someone looked travels with their work Accepted — implements D47 (part 4); amends D45c (sweeps, candidates and dispositions belong to a changeset)

Writes

ID Decision Status
D4 Staged rows carry a status, with automatic changesets Accepted — amended by D47b (a changeset per owner, closed when decided)
D4b Reference placeholders are identifiers Accepted — amended by D31b (a reference is only read in a reference position)
D5 Write policy: confirm by default; one global switch first, per-operation rules later Accepted — completed by D33 (per-operation rules and escalations)
D24 Pack versions: additive changes are free; breaking changes need a read-time migration Accepted
D31 An ops batch is one unit of work: all of it lands, or none of it does Accepted
D31b A reference is only read where a reference belongs Accepted — amends D4b
D31d The same claim from the same event is stored once Accepted
D33 The write policy as built: a verdict per row, and escalations that only tighten Accepted — completes D5; amended by D33g (--all is never combined with --changeset or --from)
D33d A claim moves with the entity it describes Accepted
D33g kg merge --all is the whole graph and is never narrowed Accepted — amends D33
D44 Every merge and rejection is logged, and the actor is declared Accepted — amended by D47b (a decision also names who made it); the actor on a signed bundle is verified by D47g
D46c A sweep result carries documents, and they go through check Accepted — amended by D55 (a document may come without text, fetched under fetch: record; a result also carries outcomes, leads, lessons and the report)
D47b Every changeset has an owner, and is one owner's session of work Accepted — implements D47 (part 1); amends D4 (one changeset per owner, not one global one) and D44 (a decision names who, not only the role)
D47h Only maintainers decide Accepted — implements D47's review model
D47j kg pull loads the dataset into the working graph, and keeps what is local Accepted — implements D47 (part 3); completes D47c's open question on reconciling local work
D47k Review scales with who sent the work, and agents serve probation Accepted — extends D33 (the write policy); tightens only, like its escalations
D48c A dismissed gap stays dismissed until the entity changes Accepted — its rows travel like the sweep log (D47m)
D49e Merged work is undone by a revert decision that waits for a person Accepted
D51c The peer holds the leases, for everyone Accepted — completes D47n
D51d A peer signs bundles for the people it authenticated, and holds no role Accepted — extends D47g

Scoring

ID Decision Status
D6 Confidence is computed on read, never stored Accepted
D6a Recency must earn its place Accepted — amended by D6e (the fading rule is retired)
D6b An unverified update is a contested value, not a separate thing Accepted
D6c A value never silently disappears Accepted
D6d current is ranked by RECORD time, not valid time Accepted — amends D6a (ranking uses record time)
D6e Age is staleness, not disbelief. (Reverses the fading part of D6a.) Accepted — amends D6a
D6f Rumoured evidence never helps a value qualify Accepted
D6g The same value in two periods is two facts Accepted
D7 Four claim kinds: stated (default), projection, derived, rumoured Accepted — amended by D7b (inputs are claims), D7c (no inputs) and D7d (a derivation from its own source)
D7b A derived claim cites one event and names its inputs separately Accepted — amends D7
D7c A derived claim with no inputs stands on its own source Accepted — amends D7
D7d A derivation is not charged for its own source twice Accepted — amends D7
D8 multi: true properties hold sets and are never contested Accepted — amended by D8b (sets drop ended members)
D8b Sets drop members whose validity has ended Accepted — amends D8
D19 Values: units normalised on write, money never converted Accepted
D19b Sources may be quoted as they write Accepted
D47e The settings that change a computed value belong to the dataset Accepted — implements D47 (part 2); refines where D6's source weights live; amended by D60 (whether each run must say what it used is a dataset key)

Time

ID Decision Status
D18b An undated claim says nothing about the past Accepted — amended by D18c (static facts are excluded)
D18c Static facts are timeless Accepted — amends D18b
D18d Staleness counts from when we learned a fact, not when it became true Accepted — clarified by D33f (how it is worded) — clarifies D18
D18e Events happen on a date: temporal: event Accepted — extends D18
D31e A dated record from after its source was published is a projection Accepted — amended by D32b (so is a status read off one)
D31f An observation holds until the next observation of the same thing Accepted
D32 A value whose validity has not begun is not current Accepted
D34d A dated mention is checked against its own date Accepted
D49d A status is a dated milestone Accepted — extends D13e and D48
D52 Dates compare by the span they name, a source recounting a stage is not disputing it, and a value can end Accepted — amends D13d and D18

Schema

ID Decision Status
D9 Edges are stored once, in a canonical direction; the mirror name is an alias declared with inverse_of Accepted
D9b An edge is a claim whose value is an entity Accepted
D9c Incoming relations group by the other entity Accepted
D9d Incoming edges are always a set Accepted
D10 Creation rules are structured (identity.create_requires), covering both properties and edges Accepted — softened by D13b; creation check as built in D13g; the promised name derivation delivered by D35 (for comparison only)
D10b External ids are implicit properties Accepted
D11 Resolver: four layers Accepted — amended by D11b
D12 Fixtures are partial records, not name strings Accepted — amended by D12d
D12b Entities are named by their pack's name_fields Accepted
D12c Labels are looked up when read, from the first name field Accepted
D12d Fixtures execute, and must pass for the reason they give Accepted — amends D12
D13 Illegal status transitions are flagged, never rejected Accepted — amended by D13b, D13d and D13e
D13b The engine has six hard rules; everything else in a pack is an optional hint that warns rather than refuses Accepted — amended by D33b (completeness hints are read at review) — amends D10 and D13; rule 5 amended by D13g
D13c status_dwell may name its own property Accepted
D13d A transition is not a dispute Accepted — amended by D52 (dates compare by their span; an undated stage a source recounts is history) — amends D13
D13e Timelines take a step only from firm evidence Accepted — amends D13; extended by D49d (status as dated milestones)
D13f Staleness rules as built Accepted — implements D13; extended by D48 (expectations, and freshness by status)
D18 Two timelines Accepted — clarified by D18d (staleness counts from the source date) — amended by D52 (a partial date compares as the span it names; a value can end)
D31i A name is only split where the source's own convention says how Accepted — extended by D35 (storing a split is not comparing with one)
D33b Pack completeness is checked at review, over the whole changeset Accepted — amends D13b
D46 A channel's playbook belongs to the pack, and may apply only somewhere Accepted — amended by D55 (what runs learn about a channel is kept with it, after the pack's playbook)
D48 A pack says what every entity of a type should have Accepted — extends D13f (staleness rules) with expectations; the same selection of built-in rules, not an expression language (D13b); extended by D49d (status_dated)
D50b A pack ships named questions; a graph may save its own Accepted
D68 A graph records the packs it is built on, and what it is about Accepted — amends D54 (where the title comes from), D47e (what a dataset pins) and D65 (which packs load); amended by D68b (a dataset is checked with the packs it pins)
D68b A new pack starts from a working one, beside the packs kg ships Accepted — amends D65 (a project's packs/ adds to the shipped packs); amended by D68d (what kg schema test loads)
D68d kg schema test checks a project's own packs, with what they import Accepted — amends D68b (what kg schema test loads once a project has its own packs)

Identity

ID Decision Status
D11b The resolver as built Accepted — amended by D32f (a value most of a type shares is not evidence) and D53 (separators: a different place counts against a match) — amends D11; amended by D56 (an exact name is an alias match even when stripping empties it)
D13g Hard rule 5, as built: creating an entity runs the resolver Accepted — amended by D53 (a named rejection is recorded as a not-same) — amends D13b (rule 5) and D10
D20 merge-entities A B stages a same-as record; always confirmed; undoable Accepted — amended by D20b and D20c
D20b Entity merges wait for a human; afterwards every read follows them Accepted — amends D20
D20c A merged-away entity's name becomes an alias Accepted — amends D20b
D21 Duplicates are hunted, not just fixed when noticed Accepted — implemented by D21b
D21b Duplicates as built Accepted — amended by D53 (a rejection named at creation is kept) — implements D21
D31g An importer defers what it cannot decide, and a person's answer closes it Accepted — extends D22
D31j A name an import matched by is an alias, not a rival for the primary name Accepted
D32f A value most of a type shares is not evidence that two records match Accepted — amends D11b
D34b An entity proposed from a document carries only its name Accepted
D35 A name is split to compare it, never to store it Accepted — completes D10; extends D31i rather than reopening it
D36b Two names numbered differently are two things Accepted — extends D11b
D37b A shared registered office is not a relationship Accepted — applies D32f to a new field
D53 A rejection named at creation is kept, a different place counts against a match, and a renamed candidate is pointed out Accepted — amends D11b, D13g and D21b
D67e A subset name is not a proposal on its own Accepted — amends D11b and D53

Evidence

ID Decision Status
D15 Source and event are separate Accepted
D15b A source's text snapshot backfills Accepted
D25a Bulk machine-readable records get one event per batch, not per row Accepted — clarified by D31c (a batch is a record: a CSV row, an API object) and by D35c (a member's line in a division list is itself a record)
D31c A machine-readable source is snapshotted canonically, and a record quotes itself Accepted
D32b A status read off a forecast is itself a forecast Accepted — amends D31e
D34c A second page from one publisher is not a second source Accepted
D39 Fetching is off until the user says otherwise, and there is one gate Accepted — amended by D55 (fetch: record: fetching only while a research run is recorded)
D39b A fetch gives you a page, not an article Accepted — amended by D58 (a PDF is read for its text layer; a scanned one is refused)
D41 Every reading of a source is kept, and an event is bound to the one it was checked against Accepted — completes D15
D41b The graph can be asked to prove itself Accepted
D42 A quote has to point at a passage Accepted — strengthens hard rule 6
D44c A value its own quote does not contain is flagged, not refused Accepted
D45b Coverage: "the set is N" is a cited statement Accepted
D47d Page texts travel only for official and open sources; one not shared is "not held here", not missing Accepted — implements D47 (its open question on captures)
D47f A row can be kept local, and a private term stops an export Accepted — extends D45c (local-only channels) to graph rows
D49b Whether a quote supports its value is sorted by rules, then a checker, and never merges Accepted — amended by D49g (a value an authority's page shows as it stands is dated by its reading)
D49g A value an authority's page shows as it stands is dated by its reading Accepted — amends D49b

Reading

ID Decision Status
D14 Brief layout Accepted — amended by D14d, D14e and D14f
D14a Open questions are first-class Accepted
D14b Compiled truth is versioned, staged like any other write Accepted
D14c Deferred items have a lifecycle Accepted
D14d Entity pages render in the pack's declared property order Accepted
D14e "Required but missing" means never stored Accepted
D14f The brief: compact by default, attention only Accepted — amends D14
D14g Notes are staged, and closed by new rows Accepted — implements D14a, D14b, D14c
D14h What needs verifying Accepted — implements D14
D23 Both research modes are first-class: deep (one entity) and wide (a field or set) Accepted — implemented by D23b
D23b Wide mode as built Accepted — amended by D32d (what is true of the set is not a ranking) — implements D23
D31h An edge with nothing confirmed still shows its name Accepted
D32c Thin sourcing is one fact about an entity, not one per property Accepted — amends D14
D32d What is true of a whole set is not a reason to rank within it Accepted — amends D23b
D32e Identical forecasts print once Accepted
D33c Review groups by entity, counts evidence, and asks once per change Accepted
D33f "Stale" says the source is old, not that you neglected it Accepted — clarifies D18d
D35d A value we worked out says so on the page Accepted
D38b A name is cut when it labels somebody else's line Accepted
D40 A path is a chain of claims, and it is as strong as its weakest hop Accepted — supersedes D27b
D40b A path walks what the graph currently believes Accepted
D40c "No path" is an answer, and it says how hard it looked Accepted
D40d A path through a crowded node is shared participation, not a connection Accepted
D44b kg trace is the audit view Accepted
D45 A scope is a population with written rules Accepted — amended by D47l (a shared scope's definition is a dataset file)
D45c Channels, sweeps and candidates: where we looked, and what it pointed at Accepted — amended by D47m (the sweep log belongs to a changeset and travels in its bundle) D57 (a scope's own rule selects its channels) and D59 (an outside list is a channel, and how much of it is held is counted), and D64 (a finder may exclude a candidate by a rule the scope declares)
D47o A reader is told what a writer had not seen Accepted — implements D47 (part 4); extends D14b (compiled truth) and D47i (staleness)
D48b kg gaps reports a whole set by rule, with peers and coverage Accepted
D50 What we believe is a table, read with read-only SQL Accepted
D50c "Related to X" is computed from current relations, and never stored Accepted
D64c A reader reads as a person's browser would, and no further Accepted — amends D64b, extends D39 and D55

Surfaces

ID Decision Status
D16 kg check takes structured mentions from the agent, and is otherwise deterministic Accepted — completed by D34 (the verdicts, and the order they run in); amended by D56 (--report checks a research run's report, still without a model)
D17 MCP mapping Accepted
D17b The MCP SDK is a core dependency, on v2 Accepted
D28 SKILL.md is updated in the slice that changes it and documents only commands that exist Accepted — amended by D71 (its options are read from the CLI)
D34 kg check as built: seven verdicts, and the quote first Accepted — completes D16; amended by D56 (kg check --report)
D45d The sweep plan is data, for whatever does the research Accepted
D46b The brief is the prompt, generated Accepted — amended by D55 (without --channel, one prompt for a research run over the scope; nothing local in any brief)
D47n A claim on a channel is local until there is a server to hold it Accepted — implements D47 (part 4); leases across people are held by the hosted peer (D51c)
D47p kg log says who contributed what, and where Accepted — implements D47 (part 4)
D49 A set's gaps become research tasks, and what comes back is one batch Accepted — amended by D55 (a research run's searches are logged as a refresh's are; tasks also carry a plain question) and D56 (a confirmed gap is held back too)
D49c The review queue decides one proposal at a time, or many by filter Accepted — amended by D49f (the page shows each quote in its capture, both support reasons, a header per entity, and an agent's advice)
D49f The review page shows each quote in its capture, and an agent's advice beside it Accepted — amends D49c
D51 A hosted server is a peer, serving the same tools over HTTP Accepted — implements D47 (part 9); amends D2
D51b People sign in with GitHub, and the token is the identity Accepted — verifies D47b's declared owner on a hosted peer
D51e A peer shows what it holds in Datasette, at /data, behind the same sign-in Accepted — amended by D54 (a front page, readable views, ids as links) — extends D51 and D50
D54 The data pages say what they show: a front page, readable views, ids as links, one page per entity Accepted — amends D51e and D50
D55 A research run starts from one prompt and leaves what it learnt for the next Accepted — amends D46, D46b, D46c, D49 and D39; amended by D56 (a report is checked before it is recorded, and every URL it cites is accounted for) and D60 (the prompt asks what the run used)
D56 A report is checked before it is recorded, and every URL it cites is accounted for Accepted — amends D55, D49, D16, D34 and D11b
D57 Scottish planning is read from the councils' own pages, never who wrote in, and a scope can be published as a public site Accepted — amends D36c, D47 and D45c; amended by D58 (a page read recently is not read again; PlanIt places each application) and D59 (region is derived from the council by the pack's place list), and D62 (an elected representative is named for what they did in office; the site's titled-person check steps over the office holders it holds), and D64 (one planning importer reads every nation's portals and casework; scottish-planning is its old name), and D57b (an application with no known status is open for comment while its deadline lasts)
D57b An application with no known status is open while its deadline lasts Accepted — amends D57
D58 Read a page once, place each site on a map, and quote what the developer says it will build Accepted — amends D57 and D39b; amended by D63 (one polite reader, Visit.read, for every web importer) and D64 (an application's own easting and northing places it too)
D59 An outside list is a channel, and how much of it we hold is a count Accepted — amends D45c and D57; amended by D64 (England's and Wales's councils and postcodes are in the place lists)
D60 A run's usage is disclosed by whoever ran it, and its footprint is a cited range Accepted — amends D55 and D47e
D62 An elected representative is named for what they did in office, from the official record; nobody else is Accepted — amends D57
D64 One planning importer reads every portal product and casework service, and a search finds applications as candidates Accepted — amends D57, D58, D59 and D45c
D66 The data products publish nothing kept local, and a site tells what its scope holds Accepted
D66e A site links a source as it was written, and an application to its site Accepted — extends D66
D66f A site is sectioned as its pack says, each section speaking of its own government Accepted — extends D64 and D66
D66g A site shows forecasts, who accepted each value, and where to send a correction Accepted — extends D57, D58 and D66
D66h A value partly kept local is shown as its public claims say it Accepted — extends D66
D66i A site no application places is pinned by its own status Accepted — amends D58 and D66
D67 A brief names what kg accepts, and a property named for a relation is that relation Accepted — amends D46b
D67b A later report settles an open candidate Accepted — amends D45c and D59
D67c An outside list is imported from a file, matched, and compared Accepted — extends D59
D67d A channel's brief carries only the decisions that bear on it Accepted — amends D46b
D68c The front page is /, grouped by pack; the database page is its tables Accepted — amends D54 (where the front page is shown, and how it is laid out)

Build

ID Decision Status
D22 Importers are packs of code, not engine features Accepted — extended by D31g (what an importer defers), D31 (batches are atomic) and D33e (what it reports instead of asking)
D25 The politician pack is split in two Superseded in part by D25b (politicians now run through every slice); Popolo stays parked
D25b Both packs run through every slice Accepted — supersedes the postponement in D25
D26 Repo layout, install and test strategy Accepted — amended by D26b–D26f; amended by D69 (the config is ~/.analects/analects.yaml)
D26b The skill is guarded by a drift test Accepted
D26c A golden session is not enough on its own Accepted
D26d A golden session pins its own date Accepted — amended by D26f (the clock is pinned too)
D26e Golden runners must open their read connection after the writes Accepted
D26f Golden sessions pin the clock, not just the read date Accepted — amends D26d; amended by D26g
D26g A pinned clock pins the date too Accepted — amends D26f
D29 ~~Test data about people uses fictional people~~ Superseded by D29b
D29b Real people, only through real sources Accepted — supersedes D29
D30 Decisions are ADRs; DESIGN.md is the current design Accepted
D33e An import merges itself, and reports what a stricter policy would have asked Accepted — extends D22
D35b A record may look an entity up without being allowed to create it Accepted — extends D22
D35c An entity one record created can be used by the next Accepted — extends D22; clarifies D25a
D43 A demo is an investigation, run through the real CLI, and tested Accepted — amended by D65 (the demos are examples/, one investigation per data product)
D47i kg bundle verify is the gate a contribution passes before a person looks Accepted — implements D47 (part 3); amended by D65 (CI installs kg from the public code, KG_SOURCE)
D63 One polite reader for every web importer, and current values from the engine Accepted — amends D58 and D61
D65 kg is published as an installable tool with public docs, and nothing private goes with it Accepted — amends D43 (the demos are examples) and D47i (a dataset's CI installs kg from the public code); amended by D69 (kg is renamed Analects) D70 (it is published to PyPI from a GitHub release) and D71 (the public repository is named)
D69 kg is renamed Analects, and the old names keep working Accepted — amends D26 (where the config lives) and D65 (the package, the command and the layout)
D70 A GitHub release publishes analects to PyPI by trusted publishing Accepted — amends D65 (how the tool is installed)
D71 Before the public repository: the agent surface is read from the CLI, and fixtures keep only what is read Accepted — amends D28 (what help --agent lists)

Findings

Decisions forced by one real source rather than by the engine. Each pack's FINDINGS.md summarises the ones about its sources.

ID Decision Status
D36 A register with no category for the thing you are looking for is still the best evidence about it Accepted
D36c The national planning dataset cannot answer this question, so we do not pretend it can Accepted — replaces the uk-planning bullet in the slice-9 plan; amended by D57 (Scottish applications are read from the councils' own portals)
D37 The company register is what turns a name into a node Accepted — amended by D61 (the API now reads who controls each company; individuals are counted, never named)
D38 An utterance is not always a statement, and a skip is reported Accepted — extends D22
D38c Two offices in one department are told apart by the source's own id Accepted — closes a slice-8 gap
D39c An aggregator's citation is parked, not dropped Accepted — closes the slice-5 gap
D40e The register is imported first Accepted
D61 Who is behind a company is its chain of controlling companies, from the register; people are counted, never named Accepted — amends D37; amended by D63 (the company pages read what the graph believes, as of the day the site is built)
D62b Holyrood publishes every member's vote as data; a council publishes its committee's vote only in a minute Accepted
D64b England and Wales publish planning on a handful of portal products, and their casework on three services Accepted
D66b Placing Scotland, the councils' own lists, and the US product: what the sources gave Accepted
D66c An answer to a screening or scoping request grants nothing Accepted
D66d A withdrawn application is withdrawn, a decision is dated by its decided date, and a neighbour's consultation names no authority Accepted — extends D66c