# The repository layout > CanonBall organizes a repository so that each folder answers one question and is written at a known station. - Site: CanonBall. The lifecycle agents can run and people can trust. - HTML page: https://canonball.org/guide/repository/ - This file: https://canonball.org/guide/repository/agents.txt --- Guide part: How it is organized. Chapter 16 of 28. Key points: - spec/ holds only clauses that have been released with evidence, and only a release writes to it. - Every other folder is written at a known station, and observe/, the agents' view inside the system, is part of the layout. - verify/ can be expected to grow larger than src/. ## One question per folder [Figure: Each folder answers one question and has one kind of writer.] Six folders. spec/canon: what does the system promise? People approve. spec/blueprint: how do we keep those promises? Agents write. roadmap: what is proposed? People rank it. src: what runs? The builder agent. verify: how do we know? The verifier agent. incidents: what went wrong? Kept permanently. Outside the repository: the Verification Record, computed, and the held-out scenarios, which building agents cannot read. 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](../people-and-agents/agents.txt). ## The layout ```text 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](../workflow/agents.txt), and each station writes to its own paths. | Station | Writes | |---|---| | [Collect](../collect/agents.txt) | `roadmap/notes/`, `roadmap/index.md`, and the milestone's `change.md` | | [Shape](../shape/agents.txt) | The milestone's `diff/` and `tasks/` | | [Build](../build/agents.txt) | `src/` and `observe/signals.md` | | [Verify](../verify/agents.txt) | `verify/` and `observe/tools/` | | [Review](../review/agents.txt) | The milestone's `review.md` | | [Release](../release/agents.txt) | `spec/` and `CANONBALLS.md`, by `tools/canonball release` only | | [Operate](../operate/agents.txt) | `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](../collect/agents.txt) covers the ranking and the criteria for work that may go to `unplanned/`. ## The other folders - `src/` is the code, written at [Build](../build/agents.txt). 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](../verify/agents.txt) shows. - `observe/` lists what the system emits and holds the commands that read it, as [Observability](../observability/agents.txt) describes. - `incidents/` keeps one file per incident permanently, such as the `INC-007` that [Operate](../operate/agents.txt) follows. - `AGENTS.md` is the first file an agent reads, and has [its own chapter](../agents-md/agents.txt). `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](../composition/agents.txt) 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. --- ## References - Previous chapter: Four layers: canon, blueprint, build, Verification Record: https://canonball.org/guide/layers/agents.txt - Next chapter: What a CanonBall is: https://canonball.org/guide/canonball/agents.txt - Related: How work moves: https://canonball.org/guide/workflow/agents.txt - Related: Four layers: canon, blueprint, build, Verification Record: https://canonball.org/guide/layers/agents.txt - Related: People and agents: https://canonball.org/guide/people-and-agents/agents.txt - Related: Observability: letting agents see: https://canonball.org/guide/observability/agents.txt - Glossary: https://canonball.org/glossary/agents.txt - Site overview and index of every chapter: https://canonball.org/agents.txt