Guide / Building with it
Start in a week
The minimum fits on one existing system in about a week, and everything else is adopted when a real need appears.
Start from the starter repository
The starter repository already holds the layout, the templates, the policy pages, an AGENTS.md whose appendix teaches an agent the method, and tools/canonball, the orchestrator: a small program that checks the canon, records evidence and red proofs, computes the Verification Record and performs releases. Create the new repository from it, or copy its folders into an existing one. The rest of this week fills it in.
The worked example shows the same repository after a refunds service has been built with it, one commit per station.
What the starter’s tool does, and what it leaves to you
tools/canonball covers the core of the method and nothing more:
- It checks the canon. Clause files are well formed, every word they use is in the vocabulary, every trace and cited tenet exists, and every example has a check.
- It records evidence. It runs the checks, keeps a line of evidence for each, and keeps a red proof for each check that fails against an injected fault.
- It computes the Verification Record, for
spec/or for a milestone’s release candidate. - It computes the state of each milestone from its approvals, its review and the release rule.
- It performs the release and records the CanonBall.
Several parts of the method described in this guide are left to the team, to adopt when a real need appears:
- staleness by content hash;
- held-out scenarios, and the separate accounts that keep each agent to its own paths;
- task states;
- the Pending and Unknown statuses;
- a trace through every adapter.
Pick the system
Choose one system you already run. A good candidate has the following traits.
- It is logic-heavy. It has rules that matter, about money, eligibility or state transitions.
- It is long-lived. You expect to be changing it for years.
- It is small enough to hold. One service with one database is ideal.
A prototype or a user-interface project is a poor first choice, because neither has much decision logic for the method to work on.
The week
Days 1 and 2: write down what is true
Write the vocabulary. Then write ten clauses describing what the system does today: a few promises, a few invariants, one constraint, and one assumption with a one-line treatment. Give each clause examples, both satisfying and violating. The work will raise questions about words, and the answers belong in the vocabulary.
Alongside the clauses, write two short files for the agents.
spec/canon/tenets.mdholds three or four tenets, in priority order. A tenet says which good thing wins when two conflict, as in “a slow refund over a wrongly refused one”.AGENTS.md, at the repository root, is the first file an agent reads. Its top part describes this repository: what the system does, where things are, and which commands to run. Its appendix, a 2 to 3 KB summary of CanonBall, is given in AGENTS.md.
Extend the top part of AGENTS.md as the week goes on, so that by Friday it names the commands that start the environment and read the decision log.
Put the clauses, the vocabulary and the tenets in a first change folder and release it. The first release is the one exception to the release rule: it writes spec/ with every clause unsupported, and the Verification Record fills in as checks arrive. From then on, only a release changes spec/.
Day 2: say what counts as evidence
Write two short policy files.
- Acceptance says which clauses are critical and when a clause is accepted. To begin with, a clause is accepted when every example has a check, every check passed at this commit, and every check has a recorded failure.
- Gates has three lines. An agent reviews every change. A person reviews as well when the change touches a critical clause or adapter code, or when the reviewer rates its blast radius as large. A named person approves when an owner is away.
Add the traceability check to continuous integration. It is a script that reads front matter and fails the build when something traces to no clause.
Days 3 to 5: build one environment
The environment is the largest piece of the week, and it is built in the following steps.
- One command to start, one to destroy. The service, its real local database, and a fake for each outside dependency.
- A short declaration, ending with what the environment cannot show.
- Four verbs as a small library: set up state, drive the system, make a dependency misbehave, observe.
- One check per example, each naming the example it encodes.
- A recorded failure for every check. Break the build with a small patch, which is an injected fault and is kept in
verify/faults/, run the check, and keep the failing output. - A hook in the test runner that writes one line of evidence per check per run.
If the service cannot be started with its outside dependencies pointed elsewhere, creating that seam comes first, and the week grows by however long that takes.
Alongside the environment, build the minimum of observability that lets the agents see what the system did.
- Log every decision with its clause. Wherever the code applies one of the ten clauses, it writes one line with the clause, the inputs it used and the outcome. List what is logged in
observe/signals.md. - Provide one command to read the log. Put it in
observe/tools/. Given one order, it prints the decisions made about that order. An agent runs it in the environment now and, read-only, in production later, and people run the same command.
Day 5: compute the Verification Record
Run tools/canonball run, then tools/canonball record. The orchestrator joins the examples, the lines of evidence and the red proofs, and prints one row per clause, naming the weakest link of every clause it cannot accept.
INV-004 unsupported checks 3/3 seen to fail 2/3
weakest link: INV-004#violates/1: verify.checks.test_inv004_no_double_payout.NoDoublePayout.test_two_concurrent_copies_pay_once never seen to fail
That row is from the refunds example at CanonBall 12, with the recorded failure of its concurrency check removed.
Publish the table as a page rather than committing it, so that nobody can edit a status.
Throughout: separate the identities
Create four agent identities, each a separate account, and configure the repository to reject a commit outside that account’s paths. One drafts clauses and plans, one writes src/, and one writes verify/. The fourth is the reviewer, which reads everything and writes only its review. Keep a handful of held-out scenarios, written by people, in a repository that none of the four can read; for now a person runs them and reports only pass or fail.
What to do now and what to leave
| Do this now | Leave for later |
|---|---|
| Ten clauses with examples and IDs. A vocabulary. A purpose page. | Sentence conventions, precedents as files |
A tenets.md of three or four lines |
More tenets, each added when a real conflict shows it is missing |
An AGENTS.md: a top part about this repository, and the appendix |
Anything longer. Detail belongs in the canon and the blueprint. |
| A policy with two files | The other policy files. Conservative defaults apply meanwhile. |
| One-line cases for ordinary clauses. Hand-reviewed cases for critical ones. | Generated cases, a written evidence plan, fidelity claims |
| The traceability check, as a script | Tracing changes in behavior to clauses |
| The Record as one generated table | The five statuses, signed evidence |
| One verification environment | The rest of the environment machinery |
| Decisions logged with their clause, and one command to read them | Traces, metrics, replaying a request, the rest of observe/tools/ |
| Four agent identities | Separate elicitor and planner agents, an on-call agent, a holdout keeper |
| A roadmap page and a board in the tracker you already use | A purpose-built orchestrator |
Everything in the right-hand column remains part of the method, and each item is adopted when a pilot shows that it is needed.
The first surprise
Some clause will stay unsupported because the environment cannot yet check one of its examples, typically a race between two requests, which needs a way to hold a timing gap open that has not yet been built.
Leave the clause unsupported and name the missing example. A check that cannot really fail would turn the row green without evidence, and a Record that contains such rows can no longer be trusted.
What comes next
Make the first piece of work one small milestone and take it through all seven stations, which how work moves describes. Choose two or three related requests that together change at least one clause, deliver something a customer can use end to end, and read in a minute as a proposal. In the refunds example, “Faster small refunds” is a milestone of that size, with three requests and one new decision. At Operate, a person can do the on-call agent’s work for now with the same one command. Even a milestone this small passes every station once and shows which is weakest.
After that, a few more milestones can be expected to teach more than further setup would. Send a refactoring and a bug fix through as unplanned work, and include one failed release.
Measure the following from the first day.
| Measure | What it tells you |
|---|---|
| A person’s time per release, by gate | Whether review actually shrank |
| Escaped defects | What the checks and environments cannot see |
| How often evidence went stale | Whether the assurance cases are maintainable |
| Where the effort went | Whether verification really is most of the work |
These numbers decide which levels of automation move, what the policy lists as critical, and which of the deferred pieces are needed.