docs: one design document, written against the code - #232
Merged
Conversation
ARCHITECTURE.md, INTERNALS.md and COORDINATION-PLANE.md overlap by roughly half and disagree with each other and with the code in several places. This adds docs/DESIGN.md: how the harness works and why it is shaped that way, current design only. Status, phasing and what has been proven belong to docs/STATUS.md and are not duplicated here. Structured around what a reader needs rather than around how the code grew: the one idea, the pipeline and what each stage guarantees, the invariants each paired with the failure that produced it, model routing, the dependency graph, state and durability, project isolation, the API, and the extension points that make "add a vendor without editing core" true rather than aspirational. Written against the modules, not the documents. Where they disagreed the code won, and the disagreement is named rather than smoothed over: - The implementer is asked for edit blocks and the harness computes the line numbers (D10, reopened 2026-08-05). Neither older document mentions edits.py at all; both still describe the change protocol as a diff. - outcomes.py carries six dispositions and nineteen reason kinds. The older documents say five and twelve. - The message ledger, rooms, command service and oversight actor are built and tested, not "proposed, not built" — but they are unwired, which is the fact worth recording. - A worktree per item is the session executor; the direct executor branches inside one checkout. - Claim paging is keyset over (attempts, item_id), not a single LIMIT. - The live event table shares the queue's file; the audit table is the one in its own database. Adds only this file. The older documents are left for the deprecation and link pass that owns them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates the design documentation into one file,
docs/DESIGN.md.ARCHITECTURE.md,INTERNALS.mdandCOORDINATION-PLANE.mdtotal ~1,480 lines, overlap by roughly half, and disagree with each other and with the code in several places. This adds a single document that says how the harness works and why it is shaped that way, current design only. Status, phasing, what is built and what has been proven belong todocs/STATUS.md, which is being written in parallel; nothing here duplicates it.Shape
Organised around what a reader needs, not around how the code grew:
Where a document and the code disagreed, the code won
Each of these is named in the text rather than quietly corrected:
edits.pyunmentionedLIMIT 200on the claim scan(attempts, item_id); the scan walks pagesrandom() * min(base * 2**attempt, cap)(endpoint, role), with the reviewer and planner ringfenced from endpoint-wide parksDeliberately dropped
Phase orders, stage histories, "what is not built yet" lists, acceptance criteria, implementation programmes, the coordination plane's issue cross-references, and
AUDIT-PLAN.md's metric catalogue — all of it is either status (STATUS.md) or process, and none of it is design. The audit rules that keep the numbers defensible are kept; the list of metrics to compute is not.Adds only this file. The older documents are untouched — the deprecation banners and link fixes belong to the pass that owns them.
uv run ruff check .,uv run ruff format --check .anduv run mypy .all pass.🤖 Generated with Claude Code