Skip to content

Bounds

A bound limits what a run can spend. The registrar counts each bound during the run, and stops the run at the limit.

bounds:
iterations: 40
cost: $2.50
wall_clock: 20m
edits: { max_files: 5, max_changed_lines: 200 }

The bounds field is optional. If you write no bound, the registrar applies the default values.

Bound Unit Default value
iterations One turn of the loop 25
cost Dollars $1.00
wall_clock Time 15m
edits.max_files Files that the run changes No limit
edits.max_changed_lines Lines that the run changes No limit

One iteration is one turn of the loop: the model gets the messages, and the model answers. The value must be a whole number of 1 or more.

bounds:
iterations: 40

This bound replaces the retry code that you write by hand. A run that cannot finish the work in 40 turns stops at 40 turns.

The cost bound is a dollar amount. Write the amount with a $, and with a maximum of six decimal places.

bounds:
cost: $2.50

The registrar counts the cost from the token counts of the run and the pricing values in the engagement configuration. The registrar does not ask the provider for a price.

If a judge does the work of a judgment clause, the judge spends part of this same amount. The budget_share value of the judge gives that part.

The wall_clock bound is a period of time. Write a Go duration, such as 90s, 20m, or 2h.

bounds:
wall_clock: 20m

The edits bounds limit the size of the change.

bounds:
edits: { max_files: 5, max_changed_lines: 200 }
Field Limit
max_files The number of files that the run can change.
max_changed_lines The number of lines that the run can change.

These two bounds make the instruction “make a small change” into a limit that a machine can count. A model cannot agree with a vague instruction and then change 40 files.

Each field is optional. If you write no edits bound, the registrar counts no limit on the size of the change.

A bound breach starts the on_bound_breach remedy. The default remedy is halt, so the run stops and Writ exits with code 1.

To select a different response, write a remedy:

remedies:
on_bound_breach: { do: halt, inform: issuer }

Do not edit a bound by hand while you compare runs. Use the writ amend command:

Terminal window
writ amend bug-fixer.yaml --cost $5.00 --iterations 60

The command narrows a bound immediately. The command asks for confirmation before it widens a bound.