The canonical run contract, and the gate that executes it
run_contractRead the canonical twelve-step run contract, or check a run bundle against it. Call it with no files to get the contract itself: every step's id, the artifacts it must produce, the exact condition that closes it, the terminal word to report when it does not, the instruction-precedence order, the retention rule and the two legal ends of step 12. Call it with files — a map of run-folder paths to their text — to get the machine verdict: which step blocked, which predicate refused and why. This is the identical implementation the offline tools/run-gate.mjs in every edition is bundled from, so a connected run and an offline run cannot disagree about whether a run is finished. Free, unmetered, read-only, stateless. Never infer a step, reorder one, or declare a run finished on your own reading — run the gate and report its word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | The run bundle as `path: text`, relative to the run folder (for example `STEP-LEDGER.json`). Send the canonical outputs you have; the gate says what is missing. Bounded: at most 400 entries and 8 MB of text in one call, and identical diagnostics are collapsed to one line with a count rather than repeated per entry. Omit this to read the contract without evaluating anything. | |
| through_step | No | Evaluate gates through this step only. Defaults to 12. |