# The contract

> The landing page, the plan and the map form one contract, and must agree.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://cases.docs.sypnia.com/contract/the-contract/

For agents: Contract documents: landing (public promise, every promise maps to at least one case via `promises` in map.yaml), plan (cases/plan.md: every `##` heading is a milestone; its cases in the heading `(cases: a, b)` or on a `Cases: a, b` line under it; delivered when the heading says `delivered` or ✓, or a line under it says `Delivered: <date>` or `Status: delivered`), map (approved version). Rules: every landing promise has cases; every case in a milestone exists in the map; the map's approved version is the scope. `cases check` reports `unbuilt` (an approved case of a delivered milestone with no code; status idea or retired skipped) and `invalid` for a milestone naming a case with no file; `--contract` also reports `broken-promise` for a landing promise or a milestone that names no case. The Cases server runs the check on every proposal, without the plan, which stays in the repository.

In a Sypnia project, three documents say what is being built:

| Document             | What it says                                                | Who reads it                              |
| -------------------- | ----------------------------------------------------------- | ----------------------------------------- |
| **The landing page** | What the app promises to the people who will use it         | everyone, in public                       |
| **The plan**         | In what order things are built, and what each step delivers | the team and the client                   |
| **The map**          | Every flow, as use cases                                    | the team, the client, the code, the agent |

They are one contract because they must agree:

- **Every promise on the landing has cases.** The map lists the landing's promises and the cases behind each one. A promise without cases is a promise nobody will build.
- **Every step of the plan names cases.** A milestone delivers a list of case ids. A milestone that names no case delivers nothing anyone can check.
- **The approved map is the scope.** What the code does must be in it.

`cases/map.yaml (promises)`

```yaml
promises:
  - text: Order today, pick up warm
    cases: [place-order, pick-up-order]
  - text: Know when your order is ready
    cases: [order-ready-notice]
```

## The plan

`cases/plan.md`

```markdown
## Milestone 1 — Orders (cases: see-today-menu, place-order, see-my-orders) ✓
Delivered: 2026-11-10

## Milestone 2 — Pick-up
Cases: pick-up-order, mark-picked-up, order-ready-notice
```

Every `##` heading of `cases/plan.md` is a milestone. Its cases go in the heading, `(cases: a, b)`, or on a `Cases: a, b` line under it. A milestone is delivered when its heading says `delivered` or ✓, or a line under it says `Delivered: <date>` or `Status: delivered`.

`npx @sypnia/cases check` reads the plan with the map and the code. An approved case of a delivered milestone that has no code is `unbuilt` (a case whose `status` is `idea` or `retired` is skipped), and a milestone that names a case with no file is `invalid`. With `--contract`, it also reports `broken-promise`: a landing promise with no cases, or a milestone that names no case ([The check](https://cases.docs.sypnia.com/contract/the-check)). The Cases server runs the check on every proposal; the plan stays in your repository, and `cases pull` never overwrites it.
