# Tasks and use cases

> The unit of work is a use case; what is not on the map becomes a proposal first.

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

For agents: A task = a request + the case(s) it works on + a budget. Before working it reads the case: starts, place and path (navigation map; answers «where do I edit X?»), declared outcomes and failures (every run ends in one), listeners in the event graph (new version instead of breaking them); new starts/outcomes/listeners are map proposals. States: planning, waiting (question/approval/proposal), working, done, stopped (budget/time/cancel), failed. Request classification: existing case(s) → work; new case → propose to the map and wait; outside the plan → propose a contract change. Output: a branch, a pull request with `Case:` trailers, tests, a summary, the cost. Without a map (plain repository), the agent writes the case it is about to build into the task summary.

A **task** is your request, the use case (or cases) it works on, and a budget.

## What happens with your request

| The request is…                            | What the agent does                                           |
| ------------------------------------------ | ------------------------------------------------------------- |
| an existing case («fix pick-up codes»)     | works on it                                                   |
| a new case («cancel an order»)             | proposes the case to the map and waits for approval           |
| outside the plan («add a loyalty program») | proposes a change to the plan and the landing page, and waits |
| unclear                                    | asks, at your level, before spending anything                 |

## Reading the case before working

Before it writes code, the agent reads the case at the technical level, from [Sypnia Cases](https://cases.docs.sypnia.com/map/):

- **How it starts and where it lives.** Its `starts`, and for a case in the app its place and path, «Shop › Order for tomorrow», so it knows which screen to touch. «Where do I edit the price of a product?» is answered from the [navigation map](https://cases.docs.sypnia.com/map/navigation/), with the place, its route and its files.
- **How it ends.** Every declared outcome and failure. It writes the code so each run ends in one of them, never in silence.
- **Who listens.** The [event graph](https://cases.docs.sypnia.com/map/outcomes-and-events/#the-event-graph): before changing an outcome it checks which cases listen to it, and proposes a new version instead of breaking them.

When the work needs a new start, a new outcome or a new listener, that is a change to the map: the agent proposes it first, like a new case.

## The states of a task

`planning` → `working` → `done`, with `waiting` whenever it needs you (a question, an approval, a proposal), and `stopped` when it reaches the budget or you cancel it.

## What you get

- **A branch and a pull request**, every commit marked `Case: <id>`.
- **The tests it ran**, and their results.
- **A summary at your level**: what changed for your customers, or the diff and its trade-offs.
- **The cost**, step by step.

Without a map (a plain repository), the agent still writes down the case it is about to build, so you can check it before it starts.
