CanonBall

Guide / How it is organized

The repository layout

CanonBall organizes a repository so that each folder answers one question and is written at a known station.

One question per folder

Each folder answers one question and has one kind of writer.

Because each folder answers one question, “where does this go?” has a single answer: the folder whose question the file answers. So does “may I change this?”, and AGENTS.md gives that answer for each role.

The layout

refunds/
├── AGENTS.md                  what an agent reads first
├── CANONBALLS.md              one entry per release
├── canonball.toml             settings for tools/canonball
├── spec/                      what is true today
│   ├── canon/                 what the system promises
│   │   ├── purpose.md  vocabulary.md  tenets.md
│   │   ├── REQ-012-refund-window.md
│   │   ├── INV-004-no-double-payout.md
│   │   ├── ENV-003-no-payout-above-10k.md
│   │   ├── ASM-011-gateway-request-keys.md
│   │   └── policy/            evidence.md  review.md  automation.md
│   └── blueprint/             how the clauses are kept
│       ├── architecture.md
│       ├── cases/             INV-004.md
│       └── environments/      VE-002.md
├── roadmap/                   what is proposed
│   ├── index.md               the order of work
│   ├── notes/                 requests as they arrive
│   ├── M2-faster-small-refunds/
│   │   ├── change.md          what changes in the system?
│   │   ├── approvals.md       who approved the examples
│   │   ├── diff/
│   │   │   ├── canon/         DEC-031-auto-approve-under-100.md  vocabulary.md
│   │   │   └── blueprint/     architecture.md  cases/  environments/
│   │   └── tasks/             the agents' breakdown
│   ├── unplanned/             repairs and upkeep
│   └── archive/               released milestones
├── src/refunds/               what runs
├── verify/                    how we know
│   └── envs/  checks/  checks/red/  faults/  monitors/
├── observe/                   how agents see inside
│   ├── signals.md             what the system emits
│   └── tools/                 the commands that read it
├── incidents/                 what went wrong
├── templates/                 starting points for new files
└── tools/canonball            the orchestrator

The tree shows the refunds service while milestone M2 is being built. Clause files sit directly in canon/, one per file, with no folder per kind. DEC-031 is agreed but not yet released, so its file sits under the milestone’s diff/canon/ rather than in spec/.

The spec, a change and a release

  • The spec, in spec/, is what is true of the system today.
  • A change, a folder in roadmap/, is a proposal: what should become true, the files that would make it so, and the tasks to build them.
  • A release is an event, the moment the change becomes true, and nothing else writes to spec/.

Who writes what

A change moves through seven stations, and each station writes to its own paths.

Station Writes
Collect roadmap/notes/, roadmap/index.md, and the milestone’s change.md
Shape The milestone’s diff/ and tasks/
Build src/ and observe/signals.md
Verify verify/ and observe/tools/
Review The milestone’s review.md
Release spec/ and CANONBALLS.md, by tools/canonball release only
Operate incidents/ and roadmap/unplanned/

spec/ and the milestone folder

spec/ holds only clauses that have been released with evidence. Accepted means supported by the evidence so far, not proven.

A clause that is agreed but not yet built stays in its milestone’s diff/ until the milestone is released, when the orchestrator copies it into spec/. No person and no agent edits spec/ by hand, so an agent starting a task and a person joining the team can both rely on it without asking which parts are aspirational.

Each planned change is a milestone, and its folder holds:

  • change.md, the change proposal: one page that answers “what changes in the system?”, with the predicted change in behavior and the evidence plan;
  • approvals.md, one line for each approval of the agreement gate;
  • diff/, which holds whole files in their final form, with the clauses the change adds under diff/canon/ and the design under diff/blueprint/, and which at release replace the files of the same name in spec/;
  • tasks/, the agents’ breakdown of the work.

index.md lists the milestones in the order the product manager ranks them. unplanned/ holds unplanned work: incident repairs, bug fixes, refactorings and upkeep. Each piece has the shape of a small milestone and is released on its own. Collect covers the ranking and the criteria for work that may go to unplanned/.

The other folders

  • src/ is the code, written at Build. CanonBall requires no particular layout inside it.
  • verify/ holds the environments, one check per example, a kept failing run of each check in checks/red/, the injected faults and the monitors, as Verify shows.
  • observe/ lists what the system emits and holds the commands that read it, as Observability describes.
  • incidents/ keeps one file per incident permanently, such as the INC-007 that Operate follows.
  • AGENTS.md is the first file an agent reads, and has its own chapter.

verify/ can be expected to grow larger than src/, because showing that a clause holds usually takes more engineering than writing the code.

Conventions

  • One clause per file, named with its ID.
  • Markdown with front matter. Machine-readable fields go in the front matter, and reasoning goes in the body.
  • Stable IDs with a prefix for the kind: REQ promise, INV invariant, DEC decision, ENV constraint, ASM assumption, VE verification environment, INC incident.
  • Start with one repository. Split a part out only when it gets its own team or release schedule. The chapter on larger systems covers what changes then.

What the layout gives an agent

Besides context about the product, the layout gives an agent the state of the work: at any moment it can read what is true now, what is being changed and why, what the evidence says, and which files it may write.