write build_harness_run(spec, inputs, tools, fake_model, max_iters)
end-to-end with the fake_model:
- prep: build
messagesfrom spec + inputs — includename,trigger, theinputsdict,decisions, andwritebackin the user turn. - loop up to
max_iters:- call
fake_model(messages) - parse text vs tool_use blocks
- on
end_turn: return{text, iters, tool_calls, gate} - dispatch only names on
spec["allowlist"]. skip the rest. tracktool_callsfor names you actually ran.
- call
- on cap:
textis"capped",itersismax_iters. - gate:
"fail"if the allowlist was violated (the model named a tool that is not onspec["allowlist"]) or the run hitmax_iters(text == "capped"oriters > spec["eval_gate"]["max_iters"]). otherwise"pass"iffspec["eval_gate"]["must_call"]was dispatched andspec["eval_gate"]["must_include"]is intext.
two cases run. the spec is a inbox / queue triage. expected output:
text='ROUTE night.' iters=2 tool_calls=1 gate=pass
text='done.' iters=2 tool_calls=0 gate=fail