Skip to main content
A scene file defines one test case for ancha run: which tools exist, what data they start with, who else is in the world, what the agent is asked to do, and the checks that decide whether it succeeded. ancha.yaml lists scene files with globs, usually scenes/**/scene.yaml. The same file starts a world for your own harness with ancha world up --scene.
scenes/support-reply/scene.yaml
Validate with ancha scene validate <file>. ancha scene schema or ancha schema scene prints the JSON Schema for editor completion.

Top-level fields

Durations are strings with units: 500ms, 30s, 5m, 1h, 1m30s.

Tests that name their world

The tests ancha test new and ancha init --intent write are version 2 tests. A version 2 test names its world, such as world: acme-support for the file ancha/worlds/acme-support.yaml that ancha world gen writes, or writes the world inline, and runs as one scene of the two. Its deadline is simulated time and its timeout the real time each attempt may take, whichever ends first. A test whose world file is missing says where it looked and how to generate one. ancha schema test and ancha schema world print both formats.

Tool keys

slack, github, datadog, pagerduty, hubspot, salesforce, gong, ga4, google-ads, linkedin-ads, chatgpt-ads, open-meteo, google-drive, gmail, amazon-s3, linear, okta, stripe, clerk, better-stack, notion, attio, dropbox, resend, microsoft-word, shopify, lob, paypal, jira and kalshi. Each key in twins needs a seed under the same key. See Tools.

Refs

Records in the seed can declare a ref with ref: support. Other fields, checks and rules point at them with $support, or $channel.support to also check the kind. People declare a ref too and are written as laura, $laura or $person.laura. Refs are unique across the whole scene, not per tool. Validation reports unknown refs, refs of the wrong kind and references that cross tools incorrectly.

Seeds

Each tool’s seed describes its starting state. History is written as offsets from start_time and must be at or before zero, for example at: -35m. Seeds are silent: they never trigger events or webhooks. The fastest way to get realistic data is to copy a starter dataset. ancha sandbox configuration --tools <tool> --json prints the starter datasets; copy each datasets[].seed into your scene’s seed.<tool>. The refs in the starter data, such as $slack_support, then work in your checks. Each tool page describes its starter data.

Slack

GitHub

A label named on an issue or pull that the repository does not declare is created, as GitHub does.

Datadog

An empty datadog: {} is valid.

PagerDuty

Other tools

The other tools’ seeds use the same shape as their starter datasets. Start from ancha sandbox configuration --tools <tool> --json and edit; ancha scene validate reports any field that does not fit.

World rules

In a living world, world_rules makes things happen without the agent. All rules are optional. When a command agent exits on its own before the last timed actor, the world plays out to that actor, never past the timeout, before the checks are graded. People stop acting at the exit.

Predicates

Rules, people and milestones use predicates with exactly one form: Predicates work in world_rules.actors[].when, faults[].starts_when and resolved_when, people[].knows[].when, people[].acts.works[].when, and as milestones in before and within checks. A predicate used as a milestone is recorded from the start of the attempt, after every change, so it carries the time it first held. ancha scene simulate <file> runs a living world without an agent so you can watch the rules play out. ancha init --template incidents writes five complete living-world scenes to learn from. See ancha scene and ancha init.

People

People are the other side of a conversation: a customer who holds back details until asked, a developer who knows the workaround, a manager who decides the priority. They live in the scene next to the tools, act through those tools as their own accounts, and take simulated time to answer. A model writes what a person says. The engine owns everything that decides a verdict: who receives a message, which facts a person may share, what they decide, and when they answer. Checks read the engine’s records, never the model’s text, and nothing a person writes can end an attempt. See Process checks.

Facts

Decisions

Acts

How people run

  • The people model runs in the world server. For local runs, export OPENROUTER_API_KEY in the shell that runs ancha run; a hosted workspace brings its own model access. The agent under test never receives the key. Without a model, people stay silent and the trace says so once.
  • A message that reaches a person schedules their next step replies_after later. While a person thinks, the world’s time stands still, so the reply lands exactly replies_after after the message.
  • A person answers when a new message asks them something, asks them to confirm or choose, or needs their answer for their goal. A person who needs a fact before they can help always asks for it.
  • Exact facts are matched in the message text when it arrives; semantic facts get one recorded classification. What reaches a person is matched even after their budget is spent, so a fact the agent relays still counts.
  • In a world with people, when nothing is in flight, the clock jumps to the next scheduled job. A two-hour wait takes about a second of real time.
  • Every model call is one line in the attempt’s people.jsonl: the kind of call, what triggered it, the model that answered, a hash of the prompt, tokens and cost.
Agents that wait for people set agent.input: per_event in ancha.yaml: the command runs once per event addressed to the agent, with the event in ANCHA_EVENT_JSON and a one-line summary in ANCHA_TASK, one conversation at a time. The attempt ends when the world is quiet with nothing scheduled before the scene’s timeout. See ancha.yaml.

Reference companions

Next to a scene, oracle.mjs (or oracle.ts) is a scripted agent that should pass and null.mjs one that should fail. ancha scene simulate <file> --oracle and --null run them. Keep them, the scene and the checks away from the agent under test.