# Examples, Test sets and the Sandbox

Worked Examples explain intent, Test sets are the evidence, and the Sandbox tries one input at a time.

## Three ways to try a Decision

- **Examples** explain the Decision to people: worked inputs with the answers you intend.
- **Test sets** hold the cases a version is checked against: the evidence.
- **The Sandbox** runs one input you choose, right now, against the draft or a version.

Examples are never sent to the model and never change its answers. Only cases in a Test set count
as evidence in an [Evaluation](https://typefuse.dev/guides/evaluations).

## Examples

Open **Examples** in a Decision to add them. Each Example is an input that fits the state schema
plus the answer you expect to each question: `true` or `false` for a `noul` question, the option key
for a `choice`, and the level's position (counting from 0) for a `score`.

Three to five Examples that cover the ordinary case, the edge cases and the cases people disagree
about make a Decision easy to review. **Generate examples** suggests more from the Definition;
suggestions are marked **Suggested** until you approve them.

When an Example should count as evidence, choose **Add to Test sets**. It becomes a confirmed case in
each set you pick. If a case with the same input already exists, it is reused rather than copied.

## Test sets

Open **Test sets** to manage them. A Test set is a named group of cases with a purpose, such as
"Core" or "Edge cases", and a case can belong to several sets without being copied. Every Decision
has a **Core** set, the baseline used when no other set is chosen; it can't be deleted.

A case is either **Confirmed** or a proposal. Cases you write or promote from an Example are
confirmed. Generated cases start as proposals, so a person decides what the right answer is before
they count. When you run tests you choose whether to include proposals.

Good Test sets:

- cover each answer every question can give, not only the common ones
- include the inputs that caused trouble, so a fixed problem stays fixed
- keep the expected answer to what the policy says, not what the model said last time

A case records only the questions it has an expectation for; the others are not checked.

## The Sandbox

Open **Sandbox** to run the draft, or any published version, with the exact JSON your software will
send. Start from an input built from the state schema, or from one of your Examples, then edit it and
choose **Run**. The input is checked against the state schema first.

The Sandbox shows each answer with its probabilities and confidence. **Open the run record** shows
everything that was sent and returned. When a run is a good test of the Decision, **Save as a test
case** keeps it: its answers become the expected answers, and you can correct them.

Sandbox runs are kept under **Recent Sandbox runs**, apart from production calls.
