# Shape: settle what the milestone promises > People and agents settle the milestone's promises, decisions and invariants, how it will be built and how it will be proven, before any code exists. - Site: CanonBall. The lifecycle agents can run and people can trust. - HTML page: https://canonball.org/guide/shape/ - This file: https://canonball.org/guide/shape/agents.txt --- Guide part: One milestone, station by station. Chapter 4 of 28. Station 2 of 7 on the conveyor: Shape. - Who works here: agents: Elicitor, Planner, Verifier; people: Product manager, Architect, Verification lead, Constraint owner. - Reads: AGENTS.md, spec/canon/tenets.md, spec/canon/vocabulary.md. - Writes: roadmap/M2-…/change.md, roadmap/M2-…/diff/canon/, roadmap/M2-…/diff/blueprint/, roadmap/M2-…/tasks/, roadmap/M2-…/approvals.md. - Agreement gate: people approve the examples before anything is built. - In the example repository: https://github.com/sheshavpd/CanonBall/compare/30852bec7c2b89e8bb2474a21ae80a79cb3ea8df...a0c4938c80c7e32c76b3088b29d0941aeba2122a Key points: - The agent brings questions, examples and a recommendation, and a person makes the decision. - Promises, decisions and invariants are recorded as clause files with examples, beside the proposal. - The evidence plan is agreed before the code is written. - The station ends at the agreement gate, where people approve the examples. ## What arrives A one-page proposal arrives: refunds under $100 are approved automatically. It reads clearly and hides two decisions. ## A word nobody defined Before drafting a clause, the elicitor checks the proposal's nouns against `vocabulary.md` and finds one undefined: whether $100 means the order total or the refund. It asks the product manager, with the two readings side by side, and the answer goes into the vocabulary. ```markdown ## Refund amount The money returned by one refund. Not the order total. ``` An agent that guessed would have built one of the two readings, and nobody would have known which until a customer complained. ## An example exposes a choice One of the elicitor's examples for the proposed decision has no obvious answer. > Given an order on which a refund of $60 has already been paid, when the customer requests a second refund of $60, then what? Each refund is under $100 and together they are not, and the proposal does not say which counts. The elicitor recommends counting everything refunded on the order, and cites the first of the team's [tenets](../tenets/agents.txt): a person's review over speed, when money moves. The product manager agrees, and the decision is recorded as a clause with the examples that fix its meaning. ```markdown --- id: DEC-031 kind: decision title: Auto-approve under $100 traces: [REQ-012] cites: [tenet 1] terms: [refund, refund amount, order, review] owner: product manager tier: 2 --- A refund is approved automatically while the total refunded on the order stays under $100. The limit applies to the total refunded on the order, this refund included, and not to each refund amount on its own, so that a refund split into small pieces still goes to review. Settled by tenet 1: a person's review over speed, when money moves. Every other refund inside the window goes to review, as before. ## Examples ### satisfies/1: A $40 refund, nothing refunded before Given an order on which nothing has been refunded When the customer requests a refund of $40 Then the refund is approved without review ### satisfies/2: Two $60 refunds on one order Given an order on which a refund of $60 has already been paid When the customer requests a second refund of $60 Then the second refund goes to review ### violates/1: A $250 refund approved without review Given an order on which nothing has been refunded When the customer requests a refund of $250 Then the refund is approved without review ``` The file is proposed in the milestone's `diff/canon/`, with `cites: [tenet 1]` in its front matter. The risk team's request is now an example that a check will enforce. ## How it will be built Who leads the design is each team's choice; this team's architect keeps the architecture and leaves detailed design to agents. The architect makes two calls, both recorded in the milestone's `architecture.md`: the new rule belongs in the **decision logic**, the part of the code that decides and touches nothing outside, and the payout code is not changed. The planner agent writes the rest of the design, such as which refunds count toward the total refunded, and the milestone states a **predicted change in behavior**: > A refund moves from review to automatic approval while the total refunded on the order stays under $100. Nothing else changes. It goes in `change.md`, and at Review the reviewer compares it with what actually changed. ## How it will be proven The **evidence plan**, also in `change.md`, is written now, before the code, for the reason scientists register a hypothesis before an experiment: a test written after the code can be shaped to fit it. The verification lead and the verifier agent decide what the test must cover. The existing environment, VE-002, cannot yet set up an order that has already been partly refunded, so they add that starting state. It can already make its fake gateway lose a reply after paying, and the plan requires the automatic path to run against that failure, because a careless retry there would pay twice. ## The agreement gate A **gate** is a point where a person must act before work moves on, and this one closes the station. | Who | Approves | |---|---| | Product manager | The three examples for DEC-031 | | Constraint owner | That ENV-003, the payout limit, is untouched | | Verification lead | The evidence plan, including how the assurance case for INV-004 covers the automatic path | People approve examples here, since no code exists yet. ## What Shape settled | Kind | Clause | For M2 | |---|---|---| | Promise | REQ-012 | Checked, unchanged | | Decision | DEC-031 | New, with three examples | | Invariant | INV-004 | Unchanged. Its case now covers automatic approval. | | Constraint | ENV-003 | Confirmed untouched | | Vocabulary | Refund amount | Added | ## What leaves The milestone folder now holds whole files in their final form. ```text roadmap/M2-faster-small-refunds/ change.md the predicted change, the evidence plan; status: agreed approvals.md the three approvals of the agreement gate diff/canon/ DEC-031-auto-approve-under-100.md, vocabulary.md diff/blueprint/ architecture.md, cases/INV-004.md, environments/VE-002.md tasks/ 01-total-refunded.md, 02-auto-approve.md, 03-decision-log.md ``` Nothing in `spec/` has changed, because these files become the specification only at [Release](../release/agents.txt). First the milestone is [built](../build/agents.txt). --- ## References - Previous chapter: Collect: requests gather into a milestone: https://canonball.org/guide/collect/agents.txt - Next chapter: Build: write the code: https://canonball.org/guide/build/agents.txt - Related: The primitives: https://canonball.org/guide/primitives/agents.txt - Related: Tenets: https://canonball.org/guide/tenets/agents.txt - Related: Examples, and writing clauses agents read correctly: https://canonball.org/guide/examples/agents.txt - Related: Handing over decisions: https://canonball.org/guide/delegation/agents.txt - Glossary: https://canonball.org/glossary/agents.txt - Site overview and index of every chapter: https://canonball.org/agents.txt