Architecture decisions
Which architecture decisions must a plan cite before a change proceeds?
Architecture decision records are the decisions an agent must consult before it plans a change. This set walks that loop on a synthetic repository. The decisions owner is a deterministic rules engine with two optional model lanes, in notebooks 03 and 06. Nothing in the set is labelled an agent except notebook 03, where the model chooses which read tool to call from observed state.
What question this set answers, and who needs it
An architecture decision record is a record of a constraint or choice the team already agreed to. A later proposed change needs to honor those decisions rather than treating the repository as an empty design problem.
The question is whether code can parse the records, match them to a diff, refuse a plan that never read the decisions that apply, route the pull request by risk, and hold supersession and drafting to a human confirmation.
An engineering lead uses notebooks 01 and 03, where a record missing its status, reconsider trigger, or supersession target is refused, and a plan without a consultation receipt is refused. A reviewer uses notebooks 02 and 04, where an uncovered path is unmatched, decision fields are checked, and a conflict needs a superseding record first. An architect uses notebooks 05 and 06, where a fired trigger is reported with its evidence, the old record stays in the index, and a meeting-note draft stays a draft until a person confirms it.
The README says the set was re-executed in the 2026-10-20 production-hardening pass. All six notebooks executed in order with 0 error cells. Notebook 2 was run twice after a source-only assertion and structure change; the others once. Notebooks 3 and 6 made live Codex-credit calls (gpt-6-luna). The other four make no model call. The README names a verification ledger for the results and the remaining boundary.
How to run it
From the kit root (recohut-kit):
uv venv .venv-architecture-decisions
uv pip install --python .venv-architecture-decisions/bin/python -e '.[codex,openai]' pandas nbconvert ipykernel ruff
.venv-architecture-decisions/bin/python -m ipykernel install --user --name architecture-decisionsThe environment is .venv-architecture-decisions and the kernel name is architecture-decisions. The codex extra supplies the Codex route for notebooks 03 and 06. Notebook 03 also needs the openai extra, because the Codex tools client builds an OpenAI SDK transport. ruff is installed because the checker runs python -m ruff from the set interpreter. This set changes no existing dependency pin, extra, or pyproject.toml value.
Execute each notebook once, in the README order that scripts/check_architecture_decisions_notebooks.py enforces. Timeout is 900 seconds. The command passes --allow-errors. The browser-checkpoint column is None on every row, so no browser handoff is requested.
.venv-architecture-decisions/bin/jupyter nbconvert --to notebook --execute --inplace --allow-errors \
--ExecutePreprocessor.timeout=900 --ExecutePreprocessor.kernel_name=architecture-decisions \
examples/architecture-decisions/<notebook>.ipynbThen, from the kit root:
.venv-architecture-decisions/bin/python scripts/check_architecture_decisions_notebooks.py
.venv-architecture-decisions/bin/python scripts/check_architecture_decisions_notebooks.py --executedThe checker loads tests/check_notebooks.py unchanged for the per-cell rules. The README says the --executed checker passes for all six.
Notebooks write under examples/architecture-decisions/.runtime/<notebook-stem>/, ignored by this set's .gitignore, and notebooks 03 and 06 also copy Codex usage to docs/architecture-decisions/codex-usage.jsonl. The decision ledger is SQLite under .runtime/. No cloud resource is planned, so no ledger cleanup cell applies.
The fixture is synthetic: seven records (ADR-001 to ADR-006 well-formed, ADR-007 broken for lint), three diffs (routine, material, conflict), synthetic observations, synthetic meeting notes, and three scripted drafts. They were frozen before the first run. support.py is host glue. Paths may refer to the read-only tree examples/saas-codebase-review/fixtures/orbit-web/. No real repository, account, or credential is read. The Codex-credit route in notebooks 03 and 06 reads the shared codex auth directory in place and records usage per call.
Notebooks in order
| Notebook | What it does | Recorded output |
|---|---|---|
01-decision-records-parse-lint-and-index.ipynb | Parse, lint, and index seven records. Malformed text is refused with a named reason. Scripted, 0 model calls. | yes |
02-applicability-from-changed-paths.ipynb | Match three diffs to accepted decisions by path glob, and report an uncovered path as unmatched. Scripted, 0 model calls. | yes |
03-consultation-receipts-model-planning-loop.ipynb | Codex loop with only list_applicable_decisions and read_decision. A plan must have a consultation receipt. No call quota; usage recorded per call. | yes |
04-pr-template-guards-and-risk-routing.ipynb | Check pull-request decision fields, scan guards, and route routine, material, or conflict. Nothing is auto-approved. Scripted, 0 model calls. | yes |
05-reconsider-triggers-and-superseding-adr.ipynb | Report a fired trigger, propose a superseding record, and accept it only after a recorded human decision. Scripted, 0 model calls. | yes |
06-drafting-decisions-from-meeting-notes.ipynb | One Codex text call drafts a record from synthetic notes and leaves it Proposed. No call quota; usage recorded per call. | yes |
The digest marks each file RECORDED OUTPUTS, with counts 15, 10, 16, 18, 17, and 13.
What the recorded outputs show
Every transcribed setup prints glue loaded; 6 usable records, refused ('ADR-007',) and checks fixture digest 631bcf2fb5da657a2992e17b6f92fc7885b9e7ddcd55f54710f4e0a80cccd0b5.
Notebook 01 prints parsed 7 records; parse refusals 0. Visible rows show ADR-001 through ADR-004 accepted and ADR-005 superseded. The digest cuts the ADR-006 row off after a date beginning 20. The notebook text under the table says ADR-007 has date -, applies_to count 0, and supersedes ADR-099, and that ADR-005 is superseded by ADR-006. Four edits of ADR-004 are refused with missing_heading, missing_status, status, and guard_grammar. The line is refused 4 of 4 malformed records.
Notebook 02 prints routine: 2 paths -> ['ADR-001']; unmatched ['src/components/StatusBadge.tsx'], with ADR-001 on src/data/customers.ts through src/data/**. Material prints material: 1 paths -> ['ADR-003']; unmatched [] on src/lib/cache.ts. Conflict prints conflict: 3 paths -> ['ADR-001', 'ADR-002', 'ADR-004', 'ADR-006']; unmatched []. The table shows ADR-006 with via ADR-005 on src/jobs/send-digest.ts.
Notebook 03 prints 4 decisions apply to 2 paths: ['ADR-001', 'ADR-002', 'ADR-004', 'ADR-006'] for src/data/comments.ts and src/jobs/send-digest.ts, with ADR-006 via ADR-005. Next it prints bound the Codex route with model gpt-6-luna; no call quota, usage recorded per call and tool palette: ['list_applicable_decisions', 'read_decision']. The configuration cell sets 8 steps, 12 tool calls, token budget 30000, and 240 wall-clock seconds.
Notebook 04 prints declared answers: {'routine': 'no', 'material': 'uncertain', 'conflict': 'no'} with relevant ids (ADR-001,), (ADR-003,), and (ADR-001, ADR-004). Guard hits print {'routine': 0, 'material': 0, 'conflict': 3} while the conflict description declared no: ADR-001 forbid_pattern at src/data/comments.ts line 14, ADR-002 forbid_path on src/workers/digest-gpu-worker.ts, and ADR-004 forbid_pattern at src/jobs/send-digest.ts line 2. The unread line in the digest ends at {'routine': [], 'material': [], 'conflict': ['ADR-002', 'ADR-006'.
Notebook 05 prints ADR-004 due: ['metric:p95_latency_ms > 800: p95 background job latency exceeds 800 ms']. The notebook text reads that cell with observed 950.0, and says ADR-003 lists cache_hit_ratio as unobserved. The proposal print is ADR-008 is proposed, supersedes ['ADR-004'], digest 3593ca94b85a. The request print ends at request accept-ADR-008-3593ca94b is pend. The configuration date is 2026-10-20. The notebook text says approval goes through decide, standing in for a person.
Notebook 06 prints notes loaded: 147 words, 13 lines. Notes and draft body are Markdown display objects, so the digest has neither text. The prints are ADR-009 drafted by gpt-6-luna: Skip Duplicate Billing Events, status proposed; digest 9c92d14665d4, and unsupported tokens (); lint findings for ADR-009: 0. The notebook text says a reply that is not Proposed is refused, and that the token check can miss a paraphrase that reuses the notes' words.
What is not shown or not run
No notebook is marked without recorded output. The digest text still ends inside each notebook, short of the header count, so later cells have no transcribed output.
Missing from the transcript: notebook 01's lint print; notebook 03's planning-loop plan, tool log, and consultation result; notebook 05's decide result, acceptance, and ledger. Notebook 02 starts "A superseded decision resolves to its successor" and the digest cuts that section off before any output. Notebook 04's configuration assigns EXPECTED_OUTCOME as proceed, developer_review, and superseding_adr_required, and the digest shows neither an assert nor a classify_change or route print. The names good, invented-number, and claims-accepted are in notebook 06's configuration; the scripted-draft section has no transcribed output.
The README states the run was once, on 2026-10-20, on an entirely synthetic setup. The rules are proven only against this set's synthetic ADRs and diffs. The digest records notebook 06's title Skip Duplicate Billing Events and does not record notebook 03's plan or notebook 06's draft body. The README says the model lanes do not show that the choice is correct beyond the fixtures. Nothing here is a client outcome. Notebooks 01, 02, 04, and 05 record no cloud call; notebooks 03 and 06 record live Codex calls and their printed results.
Where it fits in the kit
Imported kit modules are recohut_kit.adr.parse, recohut_kit.adr.contracts, recohut_kit.adr.applicability, recohut_kit.adr.review, recohut_kit.adr.consultation, recohut_kit.adr.triggers, and recohut_kit.adr.lifecycle. Notebook 03 also imports recohut_kit.function_calling, recohut_kit.agents_tools.policies, recohut_kit.integrations.function_calling_services.clients, recohut_kit.integrations.function_calling_services.loop, and recohut_kit.providers.codex_auth. Notebook 06 imports recohut_kit.providers.codex, recohut_kit.providers.codex_auth, and recohut_kit.walkthrough.narration. Notebook 05 imports recohut_kit.human.checkpoints and recohut_kit.learning.access. Display uses pandas and IPython.display. support.py is loaded with importlib as host glue. Notebook 01 calls the decisions package a deterministic rules engine.
How is this page?
Last updated on