# Verify a tool-recovery trajectory


Use the [task-package specification](/data/task-packages) to choose the package layout and record evidence for the exact revision.

Start with an original tool-use scenario in which a missing prerequisite causes an observable failure. A recovery trajectory records the attempt, the repair and the checkpoint. The worked example uses a new temporary directory and a deliberately missing file.

## Author and verify

Define the observable state before and after recovery. Capture ordered tool events and actual exit statuses. A Tier 1 verifier should require the failed attempt and a successful final checkpoint in the same run. A solver's claim of recovery alone carries no result. A judge can separately evaluate the explanation.

## Calibrate and correct

Replay the failed start and recovery with the same inputs and then remove the failure event as a negative control. Pin the environment, capture format, verifier revision and trial identity. A dropped event is incomplete capture. Save the verifier outcome separately from any cause or repair notes, and keep raw terminal output private.

## Worked example

Use Python 3.12. The script runs three real subprocesses in a temporary directory. It checks that the final read succeeds only after the recorded failure and repair.

```bash
python3.12 - <<'PY'
from pathlib import Path
from subprocess import run
from sys import executable
from tempfile import TemporaryDirectory

with TemporaryDirectory() as directory:
    root = Path(directory)
    read = "print(open('ready.txt').read(), end='')"
    commands = [read, "open('ready.txt', 'w').write('ready')", read]
    events = [run([executable, "-c", command], cwd=root, capture_output=True, text=True)
              for command in commands]

def passes(trace):
    return [event.returncode for event in trace] == [1, 0, 0] and trace[-1].stdout == "ready"

assert passes(events)
assert not passes(events[1:])
print("ordered recovery pass, missing failure event fails")
PY
```

When packaging a trajectory set, retain verifier outcomes and stable evidence references for each run. Label this fixture as scripted. It establishes the checkpoint behavior for one controlled scenario.
