# Checks

> Every kind of check an exercise can have, what each one looks at, and where it runs.

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

For agents: Check kinds: cases-check (the Cases check passes on the branch); case {id?|exists|has: failures|where|status, failure: <Name>} (a case in the map matches); design-check (Sypnia Design check passes, optionally only codes[]); tests {command, case?} (a command exits 0 in the sandbox, e.g. npm test -- place-order); telemetry {case, outcome: <Outcome>|failure: <Name>, env: preview} (a trace of the case with that ending arrives from the branch's preview within 5 min); question <id> (answered right by the person, in App or the CLI — never by an agent token); file {path, contains?} (a file exists). Run in a sandbox on the branch's last commit (Agent's hosted sandbox in Cloud; the configured runner self-hosted), no secrets, no production access, 10 minutes max per exercise; results: pass|fail|error (error = could not run, not the learner's fault, retried). Custom checks: tests with any command.

Each check looks at one thing on your exercise branch and says **pass** or **fail**, with what to fix. A lesson is done when every check passes.

| Check          | Passes when                                                                                 | Example                                                 |
| -------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| `cases-check`  | the [Cases check](https://cases.docs.sypnia.com/) passes on the branch                      | the map has no broken references                        |
| `case`         | a case of the map matches what the lesson asks                                              | `case: { id: cancel-order, failure: TooLate }`          |
| `design-check` | [`design check`](https://design.docs.sypnia.com/) reports nothing, or nothing of some codes | the cancel screen uses only the guide's pieces          |
| `tests`        | a command exits with 0 in the sandbox                                                       | `tests: { command: "npm test -- place-order" }`         |
| `telemetry`    | a trace of the case with that ending arrives from the branch's preview                      | `telemetry: { case: place-order, failure: OutOfStock }` |
| `question`     | the learner answers the lesson's question right                                             | `question: why-name-it`                                 |
| `file`         | a file exists, and contains a text if given                                                 | `file: { path: tests/cancel-order.test.ts }`            |

## Where checks run

- **Sypnia Cloud**: in a hosted sandbox of [Sypnia Agent](https://agent.docs.sypnia.com/), on the last commit of your exercise branch. The `telemetry` check waits for the branch's preview on Run.
- **Self-hosted**: in the runner you configure: the open-source Agent sandbox, or a Docker runner ([Configuration](https://learn.docs.sypnia.com/self-hosting/configuration)).

The sandbox has your branch and nothing else: no secrets, no production data, no network beyond what installing dependencies needs.

## Results

| Result  | Meaning                                                                                                               |
| ------- | --------------------------------------------------------------------------------------------------------------------- |
| `pass`  | done                                                                                                                  |
| `fail`  | something to change; the check says what, at your level                                                               |
| `error` | the check could not run (a timeout, a preview that did not start). It is never your fault: Learn retries, and says so |

## Questions are for people

A `question` check is answered by you, in App or in the terminal. An agent can explain the question, but an agent's token cannot answer it: the API refuses with `403 person_required`.
