diff --git a/README.md b/README.md index ec5d095..6e23a42 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,147 @@ -# CodeCrew - -A lightweight framework for agent-driven software delivery: the auditability -and reproducible discipline of heavyweight frameworks, without the ceremony. -Project state lives in the tools teams already use — GitHub issues, PRs, and -CI — and the only documents the framework produces are per-milestone records -of the decisions that shaped the system and why. - -CodeCrew is three things: - -1. **A protocol** ([SPEC.md](SPEC.md)) — conventions for representing - milestones, tasks, plans, decisions, deviations, and gates in GitHub, and - how agents and humans transact over them. -2. **Role contracts** ([roles/](roles/)) — harness-neutral prompt files for - the implementer, reviewer, qa, and doc-synthesizer roles, loadable by any - agent (Claude Code, Codex, Gemini CLI, or an orchestrator's company). -3. **A CLI** — `codecrew`, a single static Go binary wrapping `gh`, providing - the workflow verbs with gates enforced as code. - -## Status - -The protocol is specified and the CLI works — released as v0.5.0: `init`, -`status`, `milestone new/evidence/close`, `task new/start/finish`, -`checkpoint`, `role`, `roles diff/show`, `identity new`, and `version` are -all implemented, with machine-readable refusals (`refused[CODE]: detail`) -when a gate blocks — `NO_CHECKS` when a PR reports no CI checks at all (the -deterministic gate cannot be satisfied by absence, and there is no -override), `GATE_UNRECORDED` when a raised gate lacks a recorded -resolution, `VERDICT_MISSING`/`VERDICT_UNSATISFIED` when a milestone tries -to close without a satisfied QA verdict on every requirement, -`NO_HOLDER_REVIEW` when the routed reviewer's approving review is missing, -`REVIEW_NOT_COUNTED` when GitHub's own required-review rule is still unmet -(with a recorded `--bypass` path), and `EVIDENCE_UNREACHABLE` when a -milestone's cited evidence links do not resolve. `task start` is -role-aware: roles whose contracts forbid commits (qa, reviewer) get no -linked development branch. - -Solo is a routing configuration, not a degraded tier: every role is always -staffed, by a GitHub App, a named human, a GitHub team (`identity: -org/team-slug` — any member holds the role), or — `~` — the operator -themselves; the qa holder's verdicts are the ones that count at close, and -the reviewer holder's approving review is the one `task finish` requires. A -solo operator therefore needs nothing but `gh auth login`; `codecrew init` -scaffolds a new project with every role routed to `~`, and the -[quickstart](docs/first-milestone.md) walks the first milestone end to end. -When a project outgrows solo, `identity new ` mints a dedicated -GitHub App identity for a seat via the manifest flow and routes it for you -— minted with `--with-approval-permission`, a reviewer App's approvals -count toward GitHub's own required-review rules, making fully agent-gated -merges possible (see [docs/identities.md](docs/identities.md)). - -Five milestones have been delivered *with* the protocol — agent-authored -PRs under GitHub App identities, non-doer review, deterministic CI gates, QA -verdicts enforced at close, and synthesized closing documents. This hub's -four seats are all App-staffed, and its PRs merge on the reviewer App's -counted approval. The first spoke is live: -[radiusred/www](https://github.com/radiusred/www) is driven -from this hub through the installed extension, and its first delivery was -[a blog post introducing CodeCrew, published by the protocol it -describes](https://www.radiusred.uk/blog/posts/2026-08-20-this-post-was-delivered-by-the-framework-it-introduces/). -The first stranger's project is public too: -[davison/numberguess](https://github.com/davison/numberguess) was taken from -`gh codecrew init` to a closed milestone by one human and a Codex session -working from the scaffold alone, transcripts included — and then through -two more milestones as the proving ground for the dedicated reviewer-App -seat. See [docs/milestones/](docs/milestones/) for the per-milestone -records. - -Not yet here: any backend other than GitHub. - -## Install and use +

+ CodeCrew +

+ +

Agent-driven software delivery, with the receipts kept in GitHub.

+ +## Why you'd want a crew + +You've probably run a coding agent on a real codebase by now. It went well, +mostly — and then three weeks later somebody asked *why* the retry logic +looks like that, and the answer was in a chat transcript nobody saved. The +heavyweight fix is a process framework: planning documents, phase gates, a +directory of state files that drift from the code the moment you stop +looking. The lightweight fix is vibes. Neither hands your colleague an +audit trail. + +CodeCrew is a third option, and a small one: **the record is the work.** +Milestones are GitHub issues. Tasks are issues with a plan in them. +Decisions and deviations are comments written at the moment they happen, +in a fixed shape a machine can find later. The gates — CI green, an +independent approval, a human sign-off wherever one was asked for — are +enforced by a CLI that *refuses* rather than reminds. At milestone close, +one role compiles the comments into a document that explains why the +system is the way it is, and that document's PR goes through the same +review as code. + +There is no server, no dashboard, no new place to look. It is `gh`, +issues, PRs, and four short role contracts any agent harness can read. + +## How it works, in four beats + +### 1. A hub, and spokes + +One hub repo holds the four role contracts, the routing table and the milestone issues; each spoke repo holds tasks, PRs and CI, with a two-line pointer back to the hub. For a single project the hub is its own spoke. + +One repo is the hub: it holds the role contracts, the routing table (who +holds which seat) and the milestone issues. Every other repo in the project +is a spoke with a two-line pointer file. For a single project, the hub is +the spoke — `hub: self`. State never leaves GitHub, and there is no other +message bus, so any two harnesses interoperate by construction. + +### 2. Four seats, always staffed + +The four seats — implementer, reviewer, qa, doc-synthesizer — each a contract file, each held by exactly one of: you, a colleague by username, a GitHub team, or an App identity. + +Implementer, reviewer, qa, doc-synthesizer. Each is a contract — a short +markdown file — not an account. A seat is held by you (`~`), a colleague +by username, a GitHub team, or a GitHub App identity minted for the job. +Solo is not a degraded mode; it is the routing table with every seat +pointing at you. When a project outgrows that, `identity new ` mints +a dedicated App through GitHub's manifest flow and reroutes the seat. The +protocol does not change — only the table does. + +### 3. A milestone, from open to record + +milestone new, then task new with a plan, task start, PR and review, task finish, qa verdicts, milestone close, and the synthesized document in docs/milestones. + +`milestone new` opens the tracking issue with its requirements. `task new` +hangs tasks off it; the implementer writes a plan into the task before the +first commit; `task start` cuts the branch; a PR closes the task; `task +finish` is the one merge point. The qa seat posts a verdict per +requirement. `milestone close` gathers the recorded decisions and +deviations for the doc-synthesizer, and refuses to close until the +milestone document exists on the default branch. + +### 4. Gates that refuse + +task finish checking CI, an open human gate and the routed reviewer's approval; the approval is missing, so it exits 1 with refused[NO_HOLDER_REVIEW] and a one-line explanation. + +A blocked gate exits non-zero with a machine-readable reason: +`refused[NO_CHECKS]` when a PR reports no CI at all (absence does not +satisfy a gate, and there is no override), `refused[NO_HOLDER_REVIEW]` +when the routed reviewer has not approved, `refused[VERDICT_MISSING]` when +a milestone tries to close without a verdict on every requirement, +`refused[EVIDENCE_UNREACHABLE]` when a link the record cites no longer +resolves. An agent acts on the code; a human reads the detail. Those are +four of twenty; the [introduction](docs/introduction.md) shows the ones +you will meet first, and every code is grep-able in the source as +`refuse("CODE"` — a proper catalogue is on the docs-polish list, not yet +written. + +## Start solo in five minutes ```sh -gh extension install radiusred/gh-codecrew # precompiled, all platforms -gh codecrew version # confirm what you installed (gh never auto-updates extensions) -gh codecrew init # scaffold a new project (see docs/first-milestone.md) -gh codecrew status # open milestones, inferred task states, raised gates -gh codecrew role reviewer # who holds a role: an App, a username, or ~ (you) -gh codecrew help # the full verb list - -# or build from source (single static binary; requires gh on PATH): -go build ./cmd/codecrew +gh extension install radiusred/gh-codecrew +gh codecrew version # gh never auto-updates extensions; know what you have +gh codecrew init # scaffold: .codecrew.yml, roles/, AGENTS.md, ROADMAP.md +gh codecrew status # open milestones, task states, raised gates +gh codecrew help # the full verb list ``` -Every repo in a CodeCrew project carries a `.codecrew.yml` pointing at the -hub — a spoke's is a two-line pointer (`init --hub owner/repo`); this repo -is its own hub (`hub: self`; see SPEC §3 for choosing yours). The hub's -config also routes the four roles, and `init` writes that table for you. -Agents dispatched into a CodeCrew repo start at [AGENTS.md](AGENTS.md). -Agent identities are GitHub Apps; short-lived tokens come from -`scripts/codecrew-token` (see SPEC §5 and -[docs/identities.md](docs/identities.md) for the identity tiers — a solo -operator needs nothing but `gh auth login`, self-confirmation recorded). - -## Documents - -- [SPEC.md](SPEC.md) — the protocol -- [docs/first-milestone.md](docs/first-milestone.md) — the quickstart: a - stranger's first milestone, end to end -- [docs/identities.md](docs/identities.md) — running solo, and minting - per-role GitHub App identities -- [docs/founding-decisions.md](docs/founding-decisions.md) — design decisions - and their trade-offs -- [docs/milestones/](docs/milestones/) — the per-milestone "why" records -- [docs/gsd-vs-frontier-orchestration.md](docs/gsd-vs-frontier-orchestration.md) - — the analysis that motivated the project +That is a working hub with every seat routed to you. The +[quickstart](docs/first-milestone.md) walks a first milestone end to end — +open it, plan a task, do the work, verdict it, close it, read the document +the close produced. From there the +[ladder](docs/first-milestone.md#what-next) is: split the seats across +sessions, give crew members their own identities, hand dispatch to an +orchestrator. Same commands at every rung. + +## The receipts + +We would rather show you than tell you, so here is what the protocol has +actually done so far. + +- **Five milestones of this framework were delivered *with* it** — + agent-authored PRs under GitHub App identities, independent review, + deterministic CI gates, QA verdicts enforced at close, and a synthesized + document for each: [docs/milestones/](docs/milestones/). +- **This repository is agent-staffed, and you can check.** Four App + identities hold the four seats: cody implements, checky reviews, testy + verdicts, wordy writes — this page included. PRs here merge on checky's + approval; a reviewer App minted with write access satisfies GitHub's own + required-review rule, which is what makes a fully agent-gated merge + possible ([identities.md](docs/identities.md)). +- **A stranger ran it from the scaffold alone.** + [davison/numberguess](https://github.com/davison/numberguess) went from + `gh codecrew init` to three closed milestones with one human and a Codex + session, transcripts committed, and then served as the proving ground + for the dedicated reviewer seat. +- **The first spoke published its own announcement.** + [radiusred/www](https://github.com/radiusred/www) is driven from this + hub through the installed extension; its first delivery was + [a blog post introducing CodeCrew, delivered by the protocol it + describes](https://www.radiusred.uk/blog/posts/2026-08-20-this-post-was-delivered-by-the-framework-it-introduces/). + +Things we have not done yet, in the interest of not overselling: any +backend other than GitHub; a full orchestration-platform run end to end; +a gatherer that catches every record variant (the M5 close missed three +of one issue's four Decisions because they were labelled `**Decision +(…):**` — the fix is on the open milestone, and the M5 document says so); +a 1.0. The [roadmap](ROADMAP.md) says which milestone is open and what it +is for. + +## Read next + +- [Introduction](docs/introduction.md) — what CodeCrew is, precisely: the + protocol, the contracts, the CLI and its refusal codes +- [Your first milestone](docs/first-milestone.md) — the quickstart +- [Identities](docs/identities.md) — running solo, minting App identities, + dispatching a role session +- [SPEC.md](SPEC.md) — the protocol itself +- [Founding decisions](docs/founding-decisions.md) — the trade-offs, and + [the essay that started it](docs/gsd-vs-frontier-orchestration.md) — one + person's experience with GSD across several projects; the motivation, + not a verdict on GSD Licensed under [Apache 2.0](LICENSE). diff --git a/assets/svg/four-seats.svg b/assets/svg/four-seats.svg new file mode 100644 index 0000000..61fe410 --- /dev/null +++ b/assets/svg/four-seats.svg @@ -0,0 +1,39 @@ + + Four seats — implementer, reviewer, qa, doc-synthesizer — each a contract file, each held by you, a username, a team, or a GitHub App identity. + + + + implementer + plans in the issue,commits, opens the PR + implementer.md + + + + reviewer + reads the diff cold,approves or refuses + reviewer.md + + + + qa + verdicts eachrequirement at close + qa.md + + + + doc-synthesizer + turns the record intothe milestone doc + doc-synthesizer.md + + Contracts live in roles/. Each seat is held by exactly one of: + ~you + @usernamea colleague + org/teamany member + an Appa crew identity + Solo is the table with every seat pointing at you — the same commands at every size. + diff --git a/assets/svg/gate-refusing.svg b/assets/svg/gate-refusing.svg new file mode 100644 index 0000000..ab0bddd --- /dev/null +++ b/assets/svg/gate-refusing.svg @@ -0,0 +1,24 @@ + + task finish checks CI, the routed reviewer's approval and any open human gate; when one is unmet it exits non-zero with a machine-readable refusal code. + + + $ gh codecrew task finish 42 + ✓CI required checks green + ✓no cc:needs-decision open + ✗routed reviewer's approval + exit 1 + + stderr + refused[NO_HOLDER_REVIEW]: PR #57 has + no approving review from the reviewer + role's holder (radiusred-checky) — the + role defines whose review counts; + dispatch the reviewer + (docs/identities.md) + A code an agent can act on; a detail a human can read. + diff --git a/assets/svg/hub-and-spokes.svg b/assets/svg/hub-and-spokes.svg new file mode 100644 index 0000000..da60062 --- /dev/null +++ b/assets/svg/hub-and-spokes.svg @@ -0,0 +1,31 @@ + + One hub repo holds the contracts, routing table and milestones; spoke repos hold tasks, PRs and CI, each with a two-line pointer back to the hub. + + + hub + roles/ — the four contracts + .codecrew.yml — the routing table + milestone issues and their records + hub: self + + + + + + + spoke — tasks, PRs, CI required checks + hub: owner/hub-repo + + spoke — another repo, same pointer + hub: owner/hub-repo + + spoke — or the hub itself, solo + hub: self + State lives in issues and PRs. There is no other message bus. + diff --git a/assets/svg/milestone-lifecycle.svg b/assets/svg/milestone-lifecycle.svg new file mode 100644 index 0000000..654876a --- /dev/null +++ b/assets/svg/milestone-lifecycle.svg @@ -0,0 +1,25 @@ + + A milestone from open to record: milestone new, task new with a plan, task start, PR, review, task finish, qa verdicts, milestone close, the synthesized document. + + + + milestone new + task new + plan + task start + PR + review + + + task finish + qa verdicts + milestone close + milestones/N.md + + + Decisions and deviations are comments written when they happen; close gathers them into the document. + diff --git a/docs/introduction.md b/docs/introduction.md new file mode 100644 index 0000000..ca51adb --- /dev/null +++ b/docs/introduction.md @@ -0,0 +1,108 @@ +# CodeCrew + +A lightweight framework for agent-driven software delivery: the auditability +and reproducible discipline of heavyweight frameworks, without the ceremony. +Project state lives in the tools teams already use — GitHub issues, PRs, and +CI — and the only documents the framework produces are per-milestone records +of the decisions that shaped the system and why. + +CodeCrew is three things: + +1. **A protocol** ([SPEC.md](../SPEC.md)) — conventions for representing + milestones, tasks, plans, decisions, deviations, and gates in GitHub, and + how agents and humans transact over them. +2. **Role contracts** ([roles/](../roles/)) — harness-neutral prompt files for + the implementer, reviewer, qa, and doc-synthesizer roles, loadable by any + agent (Claude Code, Codex, Gemini CLI, or an orchestrator's company). +3. **A CLI** — `codecrew`, a single static Go binary wrapping `gh`, providing + the workflow verbs with gates enforced as code. + +## Status + +The protocol is specified and the CLI works — released as v0.5.0: `init`, +`status`, `milestone new/evidence/close`, `task new/start/finish`, +`checkpoint`, `role`, `roles diff/show`, `identity new`, and `version` are +all implemented, with machine-readable refusals (`refused[CODE]: detail`) +when a gate blocks — `NO_CHECKS` when a PR reports no CI checks at all (the +deterministic gate cannot be satisfied by absence, and there is no +override), `GATE_UNRECORDED` when a raised gate lacks a recorded +resolution, `VERDICT_MISSING`/`VERDICT_UNSATISFIED` when a milestone tries +to close without a satisfied QA verdict on every requirement, +`NO_HOLDER_REVIEW` when the routed reviewer's approving review is missing, +`REVIEW_NOT_COUNTED` when GitHub's own required-review rule is still unmet +(with a recorded `--bypass` path), and `EVIDENCE_UNREACHABLE` when a +milestone's cited evidence links do not resolve. `task start` is +role-aware: roles whose contracts forbid commits (qa, reviewer) get no +linked development branch. + +Solo is a routing configuration, not a degraded tier: every role is always +staffed, by a GitHub App, a named human, a GitHub team (`identity: +org/team-slug` — any member holds the role), or — `~` — the operator +themselves; the qa holder's verdicts are the ones that count at close, and +the reviewer holder's approving review is the one `task finish` requires. A +solo operator therefore needs nothing but `gh auth login`; `codecrew init` +scaffolds a new project with every role routed to `~`, and the +[quickstart](first-milestone.md) walks the first milestone end to end. +When a project outgrows solo, `identity new ` mints a dedicated +GitHub App identity for a seat via the manifest flow and routes it for you +— minted with `--with-approval-permission`, a reviewer App's approvals +count toward GitHub's own required-review rules, making fully agent-gated +merges possible (see [docs/identities.md](identities.md)). + +Five milestones have been delivered *with* the protocol — agent-authored +PRs under GitHub App identities, non-doer review, deterministic CI gates, QA +verdicts enforced at close, and synthesized closing documents. This hub's +four seats are all App-staffed, and its PRs merge on the reviewer App's +counted approval. The first spoke is live: +[radiusred/www](https://github.com/radiusred/www) is driven +from this hub through the installed extension, and its first delivery was +[a blog post introducing CodeCrew, published by the protocol it +describes](https://www.radiusred.uk/blog/posts/2026-08-20-this-post-was-delivered-by-the-framework-it-introduces/). +The first stranger's project is public too: +[davison/numberguess](https://github.com/davison/numberguess) was taken from +`gh codecrew init` to a closed milestone by one human and a Codex session +working from the scaffold alone, transcripts included — and then through +two more milestones as the proving ground for the dedicated reviewer-App +seat. See [docs/milestones/](milestones/) for the per-milestone +records. + +Not yet here: any backend other than GitHub. + +## Install and use + +```sh +gh extension install radiusred/gh-codecrew # precompiled, all platforms +gh codecrew version # confirm what you installed (gh never auto-updates extensions) +gh codecrew init # scaffold a new project (see docs/first-milestone.md) +gh codecrew status # open milestones, inferred task states, raised gates +gh codecrew role reviewer # who holds a role: an App, a username, or ~ (you) +gh codecrew help # the full verb list + +# or build from source (single static binary; requires gh on PATH): +go build ./cmd/codecrew +``` + +Every repo in a CodeCrew project carries a `.codecrew.yml` pointing at the +hub — a spoke's is a two-line pointer (`init --hub owner/repo`); this repo +is its own hub (`hub: self`; see SPEC §3 for choosing yours). The hub's +config also routes the four roles, and `init` writes that table for you. +Agents dispatched into a CodeCrew repo start at [AGENTS.md](../AGENTS.md). +Agent identities are GitHub Apps; short-lived tokens come from +`scripts/codecrew-token` (see SPEC §5 and +[docs/identities.md](identities.md) for the identity tiers — a solo +operator needs nothing but `gh auth login`, self-confirmation recorded). + +## Documents + +- [SPEC.md](../SPEC.md) — the protocol +- [docs/first-milestone.md](first-milestone.md) — the quickstart: a + stranger's first milestone, end to end +- [docs/identities.md](identities.md) — running solo, and minting + per-role GitHub App identities +- [docs/founding-decisions.md](founding-decisions.md) — design decisions + and their trade-offs +- [docs/milestones/](milestones/) — the per-milestone "why" records +- [docs/gsd-vs-frontier-orchestration.md](gsd-vs-frontier-orchestration.md) + — the analysis that motivated the project + +Licensed under [Apache 2.0](../LICENSE). diff --git a/roles/doc-synthesizer.md b/roles/doc-synthesizer.md index b32ecd3..9746d62 100644 --- a/roles/doc-synthesizer.md +++ b/roles/doc-synthesizer.md @@ -31,9 +31,11 @@ Resolve credentials as in `roles/implementer.md`, using discipline. - **Requirement outcomes:** a short table of requirement IDs with their final status, drawn from QA verdicts and task closure. -- **Refresh the README** in the same PR: update it so it reflects what the - milestone delivered. The README's claims about what exists and works must - be true at every milestone boundary — stale claims are defects, and this +- **Refresh the README and the introduction** (`docs/introduction.md`) in + the same PR: update them so they reflect what the milestone delivered. + Their claims about what exists and works — the landing page's proof + points, the introduction's release, verbs and refusal codes — must be + true at every milestone boundary. Stale claims are defects, and this obligation is the mechanism that keeps them fixed. - **Deliver via PR** — the document passes the same non-doer review gate as code.