Skip to content
Reality Graph

FeatureMission Contract

Done is defined before the first edit. Not remembered after it.

What should happenGoalBoundariesDone whenproposed, you confirm
A mission contract for AI coding agents fixes four things before the run: the goal, the paths that may change, the paths that stay off limits, and what has to be true for the work to count as done. You do not write it and you are not asked to approve it. Type the task as one sentence; the prompt-submit hook derives the contract and records it before the first edit.

Last updated:

How it starts

One sentence in, a contract back

Most people expect to fill in a file first. You do not: you describe the change the way you would in a standup, and the contract is derived and recorded before the first edit.

the contract Reality Graph recorded

Example – illustrative record, not a real run
> Fix the checkout validation bug without touching payments

  recorded at prompt submit, before the first edit

  goal        Fix the checkout validation bug without touching payments
  intent      bugfix
  requires    the checkout validation bug is fixed
              the payment integration stays untouched
  allowed     src/checkout/validation.py, tests/
  protected   .env, .git/, **/secrets/**
  tests       pytest -q

Read the approved paths closely, because that is where the derivation is thinnest. A path named in your sentence is carried over. If none is named, at most one source file is added from the Git file list, and only above a relevance threshold. If the change really touches four files, you add three of them yourself.

The contract is recorded before the work starts, which is the whole reason it is worth anything: a yardstick written afterwards is a memory, and memories are generous. What you decide is the outcome, at the other end of the run.

The file

Six fields, and every one is measured against something real

Whether it came from a corrected proposal or you wrote it by hand, the contract is the same file: mission.yaml, in the repository, next to the code it governs.
FieldWhat you declareWhat it is measured against
goalThe one outcome this run exists for.Presence and shape. Reality Graph does not judge how well the goal is written.
intentOne of eleven declared values, chosen by you.Membership of that vocabulary. Anything else is rejected rather than bent to the nearest value.
non_goalsThe adjacent work this run explicitly does not do.Nothing automatic. It goes into the run history so a later while-I-am-here becomes visible.
allowed_filesThe paths that may change in this run.The changed-file list read from Git after the run.
forbidden_filesThe paths that stay off limits, whatever else happens.The same list. A hit forces a blocking result that a green test suite cannot clear.
acceptance_criteriaWhat has to be true for this run to count as done.Required. An empty list fails validation.
The fields of a mission contract and what each one is checked against. Presence and shape are validated before the run; scope is checked afterwards against the changed-file list Reality Graph reads from Git.

Two limits belong next to that table. The changed-file list comes from Git, and capture stops above 500 KB of scrubbed diff rather than reporting half a picture. And scope is checked after the fact: Reality Graph detects the change, it does not intercept a write. Why writing them down pays off at all is argued in machine-checkable specifications.

By design

What the contract binds, and what it deliberately leaves alone

It governs the judgement, not the agent. That line is drawn on purpose, and knowing exactly where it runs is what makes the rest dependable.

What you get

  • Derive goal, requirements, approved paths and the test command from one sentence, and record them before the first edit.
  • Add a fixed floor of protected paths to every contract, whether or not you thought of them.
  • Fail a contract whose acceptance criteria are empty.
  • Return a pre-run recommendation from Target Guard: proceed, proceed with warnings, or do not proceed.
  • Record a mission reconstructed from an observed prompt as advisory, and mark that run limited.

What it is not

  • Understand your intent. The derivation is keyword and path matching over your own words, with no model involved.
  • Search your repository. At most one source file is added from the Git file list, above a relevance threshold.
  • Judge whether your acceptance criteria are strong enough.
  • Block, patch, veto, edit, commit or push. Target Guard has no authority at all.
  • Limit what your coding agent can touch. The contract binds the judgement, not the agent.

Validation stays advisory throughout: Reality Graph reports, you decide, and your decision is recorded beside the run.

That boundary is why Reality Graph sits beside Claude Code, Cursor, Copilot or the Codex CLI rather than in their place. Those tools write the change; the contract states what the change was supposed to be. What context they get is covered on the context packs page.

Questions people actually ask

Do I have to write the contract myself?
No. You type one sentence in your coding tool and the hook derives the contract from it: goal, requirements, expected paths, a fixed floor of protected paths, and the test command. It is recorded before any work happens, without a prompt to approve it. Writing one by hand stays available, and the automation form does ask for an explicit confirmation.
Does Reality Graph understand what I mean?
No. The contract comes from deterministic keyword and path matching over your own sentence plus the Git file list. No model is involved and nothing is interpreted. That is why it is a yardstick for the run rather than a plan you should trust: it records what you asked for, in your words, before anyone could remember it differently.
What happens if the acceptance criteria are empty?
The contract fails validation, and you find out while you are still writing rather than after the run. If nobody wrote down what done means, there is no yardstick left for the result. The check stays advisory either way: Reality Graph reports, you decide.
Does the contract stop my agent from touching a file?
No. It binds how the run is judged, not what the agent may do. If a protected path changes, Reality Graph finds it afterwards in the repository and forces a blocking result that green tests cannot clear. Preventing and detecting are different promises, and only the second one is made here.

Take the change you would rather not leave unattended

Describe it in one sentence, read the contract that comes back, and see how much of it you would otherwise have typed yourself.