---
title: Architecture decision records
description: Every weft ADR at v0.20.2 — the decision in a sentence or two, whether it shipped, what amended or superseded it, and a link to the record.
url: https://weftgo.dev/docs/explanation/decisions/
type: reference
sources:
  - 'weft v0.20.2: docs/adr/0012-manifest-format.md:149 (Amendment 2026-10-26), 0015-mcp-interop.md:211 (Amendment 2026-09-27), 270 (Amendment 2026-10-26), 0016-observability.md (eleven ## Amendment sections, the last 2026-10-26), 0018-studio-ui-stack.md (§7 amended 2026-10-26: 800 KiB), 0028-the-request-record.md:791 (Amendment 2026-10-26); the other ADRs unchanged since v0.18.3 (byte-identical files)'
  - weft/docs/adr/ (every file, Status lines and Decision sections)
  - weft/AGENTS.md:688-692 (rule 5, model-visible behaviour needs an ADR), 701-706 (rule 10, a third seam needs an ADR)
  - weft/docs/adr/0024-observability-data.md:17 (0009 was never used, two files share 0017)
  - weft/docs/adr/0026-thread-storage-backends.md:15 (0025 is reserved for the flow tier)
  - weft/docs/adr/0023-thread-sandbox.md:3-21 (abandoned, never decided, nothing built)
  - weft/docs/adr/0026-thread-storage-backends.md:3-5, 77-92 (D1, the Postgres backend), 116-271 (D3-D10)
  - weft/thread/errors.go:52 (ErrStale); weft/thread/open.go:136-214 (Leaser, Releaser); weft/thread/sqlite/sqlite.go:690 (List in SQL); weft/CHANGELOG.md:3593, 3749 (thread 0.9.0)
  - weft/thread/ (no postgres or sandbox directory at v0.20.2), weft/thread/sqlite/migrations/0001-0003 (no weft_thread_ table rename)
  - 'weft/thread/open.go:136-214 (Releaser, Leaser: the lease and its release, ADR 0011 amendment B)'
  - weft/docs/adr/0011-thread-sessions.md:348-434 (amendment B, the lease), 505-521 (the freeze deferred)
  - weft/docs/adr/0027-framework-module-and-core.md:3-5, 26-58
  - weft/go.mod, weft/core/go.mod, weft/go.work (two modules; obsdb/clickhouse and cmd/weft are packages of the framework module)
  - weft/docs/adr/0003-tool-contract.md:199-205, weft/docs/adr/0006-seams.md:139-149 (Replay retracted)
  - 'weft/core/tool.go:720-756 (ReplayPolicy, Replay), weft/CHANGELOG.md:4276-4279 (0.7.0: weft.ReplayPolicy)'
  - weft/core/manifest.go:28-30, 52, 120 (weft.json version 1, replay_policy)
  - weft/core/output.go:45 (Output), weft/core/subagent.go:305 (Subagent), weft/core/steer.go:53 (Steering), weft/core/run.go:405 (ParkSource)
  - weft/mcp/client.go:111 (Tools), weft/mcp/server.go:31, 144 (AddTools, Serve)
  - weft/core/wefttest/replay.go:46, 62 (Record, Replay), 205 (%05d fixture names)
  - weft/core/fuzz_test.go (fuzz targets)
  - weft/studio/web/package.json:18-20 (TanStack)
  - weft/thread/pool/pool.go:292, weft/thread/pool/wrap.go:135, 226 (pool.New, Wrap, MustWrap)
  - weft/thread/signing.go:78 (NewKeyring), weft/thread/compactopts.go:43 (ContextWindow), weft/thread/steer.go:145 (Session.Steer)
  - weft/LICENSE (MIT)
  - weft/CHANGELOG.md:1450-1453 (0.13.0, ADR 0029), 5936-5940 and 5821-5826 (0.3.0, ADRs 0007, 0013, 0014, 0016, 0017), 6473-6475 (0.2.0, ADR 0013)
---

# Architecture decision records

An architecture decision record (ADR) in `docs/adr/` records one decision that shaped weft: the context, what was decided, what was rejected, and dated amendments when the decision changed. AGENTS.md makes two of them mandatory: changing model-visible behaviour needs an ADR (rule 5), and so does a third seam (rule 10). This page lists every ADR at v0.20.2 with its decision in a sentence or two and its status, checked against the code.

The records live at [`docs/adr/`](https://github.com/weftgo/weft/tree/v0.20.2/docs/adr). Where an ADR's text and the code disagree, the code is what v0.20.2 does; the [open differences](#where-the-text-and-the-code-differ) are listed at the end.

## Status at v0.20.2

| ADR | Decision, short | Status at v0.20.2 |
|---|---|---|
| [0001](#0001-message-model) | A message is a role plus typed parts; no system role | Decided, shipped; amended |
| [0002](#0002-error-model) | Tool error is data, run error is a Go error | Decided, shipped; amended |
| [0003](#0003-tool-contract) | Tools generic over input/output structs; schema from tags | Decided, shipped; amended |
| [0004](#0004-event-ordering) | One `Seq` counter, assigned and emitted under one lock | Decided, shipped; amended |
| [0005](#0005-naming-license-release) | Module path, option names, MIT licence | Decided; module layout superseded by 0027 |
| [0006](#0006-seams) | Two middleware seams, chi-style | Decided, shipped; amended |
| [0007](#0007-approval-boundary) | Approval ends the run; a later run resumes | Decided, shipped; amended |
| [0008](#0008-structured-output) | Structured output is a `submit_output` tool | Decided, shipped |
| 0009 | — | Number never used |
| [0010](#0010-record-format) | Run records in `weft/store` | Superseded by 0024; `weft/store` deleted |
| [0011](#0011-thread-sessions) | Sessions as an append-only entry tree | Decided, shipped; format not frozen |
| [0012](#0012-manifest-format) | `weft.json`, generated and committed | Decided, shipped; amended |
| [0013](#0013-adapter-contract) | Adapter contract and conformance suite | Decided, shipped; amended |
| [0014](#0014-subagents-as-tools) | A subagent is a tool | Decided, shipped |
| [0015](#0015-mcp-interop) | MCP both ways, from shape-compatible tools | Decided, shipped; amended |
| [0016](#0016-observability) | The loop reports spans and log lines through the OTel API | Decided, shipped; amended |
| [0017](#0017-testing-conventions) | Model-event replay, scripting helpers, fuzz gate | Decided, shipped; amended |
| [0017 (fixture names)](#0017-record-replay) | Replay fixture names pad to five digits | Amendment, shipped |
| [0018](#0018-studio-ui-stack) | Studio UI: a TanStack Start SPA, embedded | Decided, shipped; amended |
| [0019](#0019-steering-hook) | Steering: one pull hook, two drain points | Decided, shipped; amended |
| [0020](#0020-thread-compaction) | Compaction keeps everything, summarizes the old | Decided, shipped; amended |
| [0021](#0021-thread-approvals) | Durable, signed, granted, audited approvals | Decided, shipped; amended |
| [0022](#0022-thread-pool) | `thread/pool`: bounded child runs with receipts | Decided, shipped; amended |
| [0023](#0023-thread-sandbox) | `thread/sandbox`: a file firewall | **Abandoned; not shipped** |
| [0024](#0024-observability-data) | OpenTelemetry out; `obsdb`; the store deleted | Decided, shipped; module layout amended by 0027 |
| 0025 | — | Reserved for a flow tier; no file |
| [0026](#0026-thread-storage-backends) | Postgres backend, writer rule, listing, write hook | Decided; **partly shipped**: D4 `ErrStale`, D5 release on `Close`, D6 `List` in SQL on sqlite (thread 0.9.0); D1 `thread/postgres`, D3, D7, D8 and the D10 rename not shipped |
| [0027](#0027-framework-module-and-core) | One framework module, plus `core` for the loop | Accepted, shipped |
| [0028](#0028-the-request-record) | Record each model request as content | Decided, shipped; amended |
| [0029](#0029-replay-input) | A replay's input is what the model saw | Decided, shipped |
| [0030](#0030-a-dynamic-park-source) | `ParkSource`: a park set read once per run | Decided, shipped |

## The loop's contracts

### 0001 Message model

A message is a role plus an ordered list of typed parts, and the roles are `user`, `assistant` and `tool`: there is no system role, the instructions travel beside the transcript. Amendments added reasoning round-trips, `FilePart` with `ErrUnsupported`, and the transcript invariants that `weft.Repair` restores.

Status: decided 2026-09-09, shipped, amended four times. [Read ADR 0001](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0001-message-model.md).

### 0002 Error model

A tool error is data the model sees; a run error is a Go error the caller sees, always a `*RunError` carrying the partial transcript. The amendments added error codes on tool results, the truncation rule, `ErrLoopDetected`, `RETRY` and `ErrModelRetriesExceeded`, budgets checked at the continuation point, and the subagent codes.

Status: decided 2026-09-09, shipped, amended nine times. AGENTS.md rules 1 and 13 state it. [Read ADR 0002](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0002-error-model.md).

### 0003 Tool contract

Tools are generic over their input and output structs, and the schema is reflected from the input struct and its tags, the same shape as the official Go MCP SDK's `AddTool`. Amendments added `RawTool` and `ToolSource`, per-tool policy, schema-shaped decode errors and the schema derivation rules.

Status: decided 2026-09-09, shipped. A 2026-09-18 amendment retracted the `Replay` option; it is back in the code (see [the differences](#where-the-text-and-the-code-differ)). [Read ADR 0003](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0003-tool-contract.md).

### 0004 Event ordering

Every tool event carries a per-run `Seq` from one counter, and assignment and emission happen under one lock, so the order events are observed in is the order of their `Seq` values. Amendments added the observation tap, the event wire format, `tool_args_delta`, `RunFinish.Pending`, `run_id` on every event and `Nested` events.

Status: decided 2026-09-09, shipped. AGENTS.md rule 3 states it. [Read ADR 0004](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0004-event-ordering.md).

### 0005 Naming, license, release

The module path is `github.com/weftgo/weft`, the option vocabulary is the code's (`Parallelism(n)`, `Sequential()`, `StopWhen`), and the licence is MIT. Its layout of one module per adapter, tagged independently, is replaced by ADR 0027.

Status: decided 2026-09-09; path, names and licence stand; module layout superseded by 0027. [Read ADR 0005](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0005-naming-license-release.md).

### 0006 Seams

Everything that changes a run attaches at two composable seams, `func(next Model) Model` and `func(next ToolCaller) ToolCaller`, first listed outermost; observation is a tap, not a seam, and a third seam needs an ADR. Later notes place `PrepareStep` (the one loop knob, not a seam), `OnRunEnd` and `OnMessages` (observers).

Status: decided 2026-09-14, shipped. AGENTS.md rule 10 states it. [Read ADR 0006](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0006-seams.md).

### 0007 Approval boundary

Pending approvals end the run successfully with the calls on `RunResult.Pending`, and a later run resumes with the transcript plus `Approve` or `Deny` per call; an undecided call is `DENIED: no decision`. It is a policy seam, not a security boundary; the 2026-09-22 amendment added `Resolve` for results computed outside the process.

Status: decided 2026-09-14, shipped, amended once. AGENTS.md rule 12 states it. [Read ADR 0007](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0007-approval-boundary.md).

### 0008 Structured output

Structured output is a tool: [`weft.Output`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Output) registers `submit_output` with a schema reflected from the type, and the run ends after the step in which that call produced a non-error result. It works on every adapter with no provider-specific mode.

Status: decided 2026-09-12, shipped. [Read ADR 0008](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0008-structured-output.md).

### 0012 Manifest format

[`weft.Manifest`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Manifest) renders version 1 of `weft.json`, a description of every agent and tool generated from the code, committed and diffed; nothing is ever configured from it. Amendments added the `subagent` field and ruled out an MCP field; a 2026-10-26 amendment lists each agent's model and tool middleware and its hooks ([The onion in the record](https://weftgo.dev/docs/guides/middleware/#the-onion-in-the-record)).

Status: decided 2026-09-10, shipped; amended 2026-10-26 (0.20.0). [Read ADR 0012](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0012-manifest-format.md).

### 0013 Adapter contract

Every provider adapter passes one executable contract, `wefttest/conformance`, with wire-level fixtures and live runs behind `-tags live`, plus cross-cutting rules every adapter keeps. Amendments added thinking pass-through, argument-delta progress, enforced cancellation, tool choice, request params, `ExtraBody`/`ExtraHeaders`, prompt-cache markers and, on 2026-10-17, the optional `ThinkingWire` method.

Status: decided 2026-09-10, shipped, amended six times. [Read ADR 0013](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0013-adapter-contract.md).

### 0014 Subagents as tools

One agent delegates to another through a tool whose handler runs it: [`weft.Subagent`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Subagent). The child's events arrive as `Nested`, its usage rolls into the parent's, and its failure is data the parent's model reads.

Status: decided 2026-09-19, shipped; a 2026-09-22 note keeps handoff isolation. [Read ADR 0014](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0014-subagents-as-tools.md).

### 0015 MCP interop

Because the tool contract mirrors the Go MCP SDK's, the bridge is a conversion: [`mcp.Tools`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/mcp#Tools) consumes a server's tools as weft tools, and `mcp.AddTools` and `mcp.Serve` expose weft tools and agents as an MCP server. A 2026-09-27 amendment makes a tool that cannot be imported fail that tool, not the listing.

A 2026-10-26 amendment records each import's server: `mcp.Server(name)` makes the tools' origin `mcp:<name>`, the tools record carries `source_detail` and the skipped tools, and a JSON-RPC error answer reads `mcp_rpc_error` ([MCP identity](https://weftgo.dev/docs/guides/mcp/#mcp-identity)).

Status: decided 2026-09-19, shipped; amended 2026-09-27 and 2026-10-26 (0.20.0). [Read ADR 0015](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0015-mcp-interop.md).

### 0016 Observability

Spans and log lines are the loop's own reporting at its phases (run, model call, tool call), through the OpenTelemetry API, the core's one dependency, a no-op until an SDK registers. Its amendments added `OnRunEnd`, the observation accessors, the Logs API (from ADR 0024), the reporting hook for attempts, and the stop, cancel, failure-kind and approval-link attributes.

Status: decided 2026-09-19, shipped, amended eleven times, the last on 2026-10-26 (0.20.0): the middleware onion recorded, at three levels and reporting only. AGENTS.md rule 6 states its dependency rule. [Read ADR 0016](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0016-observability.md).

### 0017 Testing conventions

Application tests replay model events at the `weft.Model` seam with [`wefttest.Record`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Record) and [`wefttest.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Replay), with no HTTP cassettes; adapters keep their wire fixtures. It also fixes the scripting helpers and the fuzz gate; a 2026-09-22 amendment adds `ToolChoice` to the replay key, not `Params`.

Status: decided 2026-09-19, shipped. [Read ADR 0017](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0017-testing-conventions.md).

### 0017 Record replay

A second file numbered 0017 holds one amendment with no ADR around it: replay fixture names pad their sequence to five digits (`<seq:05d>`), so recordings of 1,000 requests or more sort in order; replay matches on the key inside the file, so old names still replay.

Status: amendment of 2026-09-26, shipped (`core/wefttest/replay.go` writes `%05d`). [Read the file](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0017-record-replay.md).

### 0019 Steering hook

Steering is one pull source the loop drains at two fixed points, after a step's tool batch and at what would be the final step, set per run with [`weft.Steering`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Steering); delivered messages are ordinary transcript and the `Steered` event reports them. Policy (queue, reject, interrupt) lives above it, in `weft/thread`.

Status: decided 2026-09-28, shipped; amended 2026-10-01 (a steer's receipt) and 2026-10-11 (a steer from a caller that does not own the turn). [Read ADR 0019](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0019-steering-hook.md).

### 0030 A dynamic park source

[`weft.ParkSource`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#ParkSource) is an agent option holding a function the loop reads once per run, at its start, and merges into the run's park set as `ParkOn` would. It lets debugger breakpoints park the app's own runs while the agent stays immutable; it is neither a seam nor a hook.

Status: decided 2026-10-11, shipped. [Read ADR 0030](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0030-a-dynamic-park-source.md).

## Modules

### 0027 Framework module and core

`github.com/weftgo/weft` is the framework, one module with every layer as a package, one version and one tag; `github.com/weftgo/weft/core` is the loop alone, whose only dependency is the OpenTelemetry API. The root package is a generated facade over `core`, and the layers import `core`.

Status: accepted 2026-10-07, shipped; it supersedes ADR 0005's module layout. [Read ADR 0027](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0027-framework-module-and-core.md).

## Sessions

### 0011 Thread sessions

`weft/thread` stores a session as an append-only tree of entries, with branching, turns and a pluggable `Storage`; one `Session` writes a session at a time. The 2026-10-01 amendment, which wins where it disagrees with the text, adds the session core rules, the writer lease and its release on `Close`, the turn's durable shapes, and defers the format freeze.

Status: decided 2026-09-28, shipped; the format and API are **not frozen** (pre-1.0). [Read ADR 0011](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0011-thread-sessions.md).

### 0020 Thread compaction

Compaction summarizes the older part of a session and keeps every entry: the model sees the summary plus the recent part, and the defaults work with no configuration. Five configuration layers sit over it, `thread.ContextWindow` arms it, an overflow re-runs once, and provider-native compaction has a seam.

Status: decided 2026-09-28, shipped; amended 2026-09-29 and 2026-10-01 (the context shape, the trim record, the hook rules, what is not built). [Read ADR 0020](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0020-thread-compaction.md).

### 0021 Thread approvals

The core's approval boundary becomes durable in a session: pending calls survive a restart, decisions go through a chain, can be signed (`thread.NewKeyring`), granted ahead of time, and audited. It is still a policy seam, not a security boundary.

Status: decided 2026-09-28, shipped; amended three times. [Read ADR 0021](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0021-thread-approvals.md).

### 0022 Thread pool

`thread/pool` bounds child runs with one FIFO semaphore per `Pool` value (`pool.New(max)`), runs each child as its own session with a receipt, and carries nested approvals up to the parent. The 2026-10-01 amendment replaces the slot rule (slots bound work, not waiting), the depth guard, the nested-approval bridge and `Decide`'s shape.

Status: decided 2026-09-29, shipped. [Read ADR 0022](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0022-thread-pool.md).

### 0023 Thread sandbox

A proposal for `thread/sandbox`, a file firewall every file tool would go through. It was abandoned on 2026-09-29 before any decision or code; approvals remain a policy seam, not a security boundary.

Status: **abandoned, never decided, not shipped.** v0.20.2 has no `thread/sandbox` package. [Read ADR 0023](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0023-thread-sandbox.md).

### 0026 Thread storage backends

D1 decides a `thread/postgres` backend on pgx; the rest fixes the writer rule with a fence, `Session.Close` releasing the writer's hold, `List` answered by the database, a write hook joining the app's writes to the transaction, opt-in search, and a `weft_thread_` table prefix for `thread/sqlite`.

Status: decided 2026-10-02, **partly shipped**. Three decisions shipped in thread 0.9.0, recorded there under ADR 0011's amendment B: D4, the fence, is `thread.ErrStale`; D5, `Session.Close` releasing the writer's hold, is `thread.Releaser` and `thread.Leaser`; D6, `List` answered by the database, is `thread/sqlite`'s SQL listing (migration `0003_leases_keyset.sql`). Not shipped: D1 (no `thread/postgres`), D3's lease modes, D7's write hook, D8's search helper, and D10's `weft_thread_` table rename. [Read ADR 0026](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0026-thread-storage-backends.md).

## Recording and Studio

### 0010 Record format

Run records as events plus a result, versioned and append-safe, in a `weft/store` module.

Status: **superseded by ADR 0024** on 2026-09-30; `weft/store` was deleted with no migration. Its survey stays the reference for `obsdb`'s versioning and loud-on-unknown rules. [Read ADR 0010](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0010-record-format.md).

### 0018 Studio UI stack

Studio's UI is React and TypeScript on TanStack Start in SPA mode, built ahead of time and embedded, with Go as the only server: every piece of data comes from the Go handler's JSON API.

Status: decided 2026-09-28, shipped (`studio/web`); §7's gzip budget amended to 800 KiB on 2026-10-26 (0.19.0). [Read ADR 0018](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0018-studio-ui-stack.md).

### 0024 Observability data

OpenTelemetry is the only way observability data leaves the process: the core emits spans and, through the Logs API, the run's events and transcript, and `weft/otel` sends them to several destinations at once, each with its own content policy. `weft/obsdb` is the observability database Studio reads; `weft/store` is deleted.

Status: decided 2026-09-30, shipped. Its separate `obsdb/clickhouse` module and `studio/cmd` binary are, at v0.20.2, packages of the framework module (ADR 0027) and `cmd/weft`. [Read ADR 0024](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0024-observability-data.md).

### 0028 The request record

What each model call was sent is recorded, under the same content policy as messages: three record kinds (`request`, `prompt`, `tools`), attempts and timing, the step index on transcript batches with the compaction view, the badge table for holes, and the dev-only `raw` record of provider wire bodies. It reverses the earlier rule that no record carries the instructions text.

Status: decided 2026-10-07, shipped; amended 2026-10-17 (`prepared[]`, `thinking.wire`, the tools record's `output`) and 2026-10-26 (the tools record's `source_detail` and `skipped`, 0.20.0). [Read ADR 0028](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0028-the-request-record.md).

### 0029 Replay input

A playground replay from step N is fed step N's recorded request messages, the compaction view applied only to the request that names it, so a replay across a compaction reproduces the model's exact input. Decision 8 adds the edited request.

Status: decided 2026-10-09, shipped. [Read ADR 0029](https://github.com/weftgo/weft/blob/v0.20.2/docs/adr/0029-replay-input.md).

## Amendments

ADRs change by dated amendment at the end of the record, never by rewriting the decision; where an amendment disagrees with the text above it, the amendment is the decision. The CHANGELOG names the amendments a release carried:

- **0.2.0** (`CHANGELOG.md:6746-6748`): ADR 0013 amended with per-run thinking mappings, argument-delta progress, enforced cancellation, and empty-content and refusal handling; the adapter package docs were updated to match.
- **0.3.0** (`CHANGELOG.md:6085-6089`): ADR 0013 amended (tool choice, request params and the escape hatch, cache markers, the provider-executed-tools stance), ADR 0007 amended (`Resolve`), ADR 0014 noted (handoff isolation stands), ADR 0016 noted (usage split attributes), and ADR 0017 amended (the replay key gains `ToolChoice`, not `Params`).
- **0.3.0, review round** (`CHANGELOG.md:6094-6099`): ADR 0013's capability matrix gained the tool choice column, with all three adapters supporting it and each provider's wire tokens listed.
- **0.13.0** (`CHANGELOG.md:1450-1453`): ADR 0029 added: the prefix rule, the transcript route's `step`, the refusal of an edit inside a compacted range, the child-as-source rule and `weft.forked_from` as the link back.

## Where the text and the code differ

v0.20.2's code is the authority. These ADR passages describe something else:

- **`Replay` is back.** ADR 0003 (lines 199-205) and ADR 0006 (lines 139-149) delete the `Replay(ReplaySafe|ReplayNever)` option until a checkpoint store ships, to return "in one change" with its ADR. [`weft.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Replay) and `weft.ReplayPolicy` exist since 0.7.0 as the playground's side-effect class (`core/tool.go:720-756`, `CHANGELOG.md:4276`), and the manifest records `replay_policy` (`core/manifest.go:120`); no ADR records its return (ADR 0024 uses `ReplaySafe` in passing).
- **Compaction's input.** ADR 0020 (lines 70-73) says the range is serialized "as a plain transcript". The code sends the summarizer role-bearing messages (`thread/compaction.go:1165-1200`), with tool results capped at 2,000 characters (`thread/compaction.go:31`).
- **A failed turn's leaf entry.** ADR 0011 §7 (lines 232-236) says a failed turn rewrites its tail on a fresh line with a leaf entry. The code attaches the batch after the last matching entry and writes a leaf entry only for an overflow re-run (`thread/turn.go:1592-1619`, `thread/perstep.go:283-302`).
- **What `Audit` returns.** ADR 0021 §5 (lines 168-170) includes "the turn entry of each resume". `Session.Audit` returns no turn entries (`thread/approval.go:1104-1125`).

## See also

- [Design principles: the rules weft keeps](https://weftgo.dev/docs/explanation/design-principles/)
- [How weft is put together](https://weftgo.dev/docs/explanation/architecture/)
- [The agent loop, from first principles](https://weftgo.dev/docs/explanation/agent-loop/)
- [How the weft repository is organised and checked](https://weftgo.dev/docs/explanation/repository/)
- [Roadmap](https://weftgo.dev/docs/explanation/roadmap/)

Symbols used: [`weft.Output`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Output) · [`weft.Manifest`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Manifest) · [`weft.Subagent`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Subagent) · [`weft.Steering`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Steering) · [`weft.ParkSource`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#ParkSource) · [`weft.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2#Replay) · [`mcp.Tools`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/mcp#Tools) · [`wefttest.Record`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Record) · [`wefttest.Replay`](https://pkg.go.dev/github.com/weftgo/weft@v0.20.2/wefttest#Replay)
