# Decide, then build

**A choice that holds up several pieces of work is written once, as a decision beside the work it holds, and the answer is what starts all of it.**

An engineering PRD is really two things: a choice somebody has to make, and the implementation that follows from it — here two pieces, a job and a screen, that cannot start until the choice is made. A choice that holds one task is that task waiting on whoever decides; one that holds two is a decision of its own, held by the person who decides, that blocks each of them. The pieces stay active, because they are committed work: what holds them is the open decision, and readiness already says so. Nothing is offered to an agent while the question is open — the answer is a person's — and closing the decision with its answer is the whole of what makes both pieces ready. The answer stays where it was given: a change of mind later is a new decision that supersedes it.

Driven by a person and an agent. Every step below is a step in
`packages/server/tests/e2e`, run against a listening server on every pull
request; the calls under each one are what that run executed.

The same flow is playable at https://flow.ttoss.dev/docs/examples/decide-then-build.

## 1. Ana points her agent at the repository she works in

- `POST /api/v1/projects` → `201`

## 2. Her agent files the PRD as a decision and the two pieces it holds up, in one call

- `POST /api/v1/tasks/batch` → `200`

## 3. While the question is open, both pieces stay active and nothing is offered

- `GET /api/v1/next?project=proj_nhs65aas9e&limit=10` → `200`
- `GET /api/v1/tasks/task_a5yp12rbn2` → `200`
- `GET /api/v1/tasks/task_ygdkzveqnd` → `200`

## 4. Ana answers, and the decision closes with the answer as its outcome

- `PATCH /api/v1/tasks/task_k6k0caz4yv` → `200`

## 5. Both pieces it held are now ready to start

- `GET /api/v1/next?project=proj_nhs65aas9e&limit=10` → `200`
