feat(run): drive every dispatch from the runner - #282
Merged
Conversation
Only tasks declaring scripted `turns` were runner-driven; every one-shot task and every judge was dispatched by a human or an agent pasting a generated `jq`/`xargs` pipeline out of RUNBOOK.md. #244 needs real tasks with a dynamic number of turns, repeated enough times to be statistically meaningful, which is not drivable by hand — and nothing bounded a dispatch, so one hung task hung the campaign. `eval-magic dispatch` now runs the whole plan: eval-magic dispatch [--jobs 4] [--timeout 1800] [--task-index N]… [--overwrite] [--judges] It owns what `xargs` was doing badly. `--jobs` is a bounded thread pool over the plan's private per-task environments. `--timeout` gives each task a deadline and records an overrun as a `timed_out` conversation rather than letting it stall the batch. A failed task is recorded and named while the rest continues, and because a failure writes no `conversation.json`, rerunning the same command retries exactly the failures and skips what finished. `dispatch-task` is removed, folded into `--task-index`. Judges dispatch the same way. A judge is a one-shot task whose prompt happens to be a rubric, so it reuses the harness's own `exec_template` with its placeholders bound differently — the iteration directory, the judge prompt, and a capture directory derived from the response path so several assertions in one condition cannot overwrite each other's transcript. That removes the whole recipe surface: `render_parallel_dispatch_recipe`, `render_judge_dispatch_recipe`, the `parallel_command_template` and `judge_command_template` descriptor fields, their validation, the probe's render-only checks, `POSIX_RECIPE_TOOLS`, and `require_posix_toolchain`. `jq` stops being a requirement anywhere, so `POSIX_TOOLING_REQUIREMENT` and AFTER_HELP now ask only for a POSIX shell. Notable decisions: - Dispatched children get null stdout/stderr rather than inheriting them. Killing the shell at a deadline leaves the harness grandchild holding an inherited pipe, which kept the caller blocked ~5s past a 1s timeout. Every shipped exec_template already redirects both into the outputs directory. - Every task now carries `conversation_path`, so `record_runs` keys its "incomplete conversation" skip on `turns` instead. The flat one-shot transcript path stays as a fallback; #266 records what removing it involves. - One-shot transcripts move to `outputs/turn-1/`, the layout ingest already read for scripted rounds. Schema: `conversation.schema.json` gains `timed_out` and `timed_out_in_round`, and relaxes `events.minItems` to 1 for a task that timed out before its first answer. `harness-descriptor.schema.json` drops the two removed template fields. Verified with cargo fmt --check, cargo build, cargo clippy --all-targets --all-features -D warnings, and cargo test --all-targets (1202 passed) run under EVAL_MAGIC_REQUIRE_POSIX_TOOLS=1 so no test skips, plus a manual run → dispatch → ingest → dispatch --judges → finalize → teardown against a stub harness. Closes #256 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #256. Part of #244.
What changes for a user
runstill prepares a campaign, but it is no longer the last step before youstart pasting commands.
eval-magic dispatchruns the whole plan — one-shottasks, scripted conversations, and judges alike.
Before — RUNBOOK.md handed you a pipeline per plan shape, and a third one
for judges:
After:
Rerun it and finished work is left alone:
The command
--jobs(default 4, matching the recipes'JOBS=${JOBS:-4}) is a boundedstd::thread::scopepool — no new dependency. Each task already owns a privateenvironment, so they are independent.
--timeout(default 1800s,0disables) gives each task a deadlinespanning all its rounds. An overrun is killed and recorded as a
timed_outconversation, not a crash.
what failed, and the command exits nonzero. A gate stop (
agent_did_not_ask)is valid eval data and exits zero.
conversation.jsonisskipped; a failure writes none, so a plain rerun retries exactly the failures.
--overwriteredispatches regardless.--judgesruns the judge tasksingestemitted, skipping verdicts alreadyon disk, printing
N/M verdicts present, and exiting nonzero while any aremissing.
dispatch-taskis removed —dispatch --task-index Ncovers it.Judges need no judge template
A judge is a one-shot task whose prompt happens to be a rubric, so it reuses the
harness's
exec_templatewith its placeholders bound differently:<eval-root><dispatch_prompt_path><outputs_dir>outputs/turn-1<response_path>minus.json, as a directory{guard_args}{model_arg}agent_modelmodelThe per-task capture directory matters: several assertions share one
judge-responses/directory, so binding captures there would have each judgeoverwrite the previous one's transcript.
What this deletes
render_parallel_dispatch_recipe,render_judge_dispatch_recipe, theparallel_command_templateandjudge_command_templatedescriptor fields,check_judge_command_template, the probe's render-only checks,POSIX_RECIPE_TOOLS,and
require_posix_toolchain.jqis no longer a requirement anywhere, soPOSIX_TOOLING_REQUIREMENTandAFTER_HELPnow ask only for a POSIX shell.Net: +2762 / −2740 across 85 files — a net deletion despite adding the driver,
the judge dispatcher, and 12 tests.
Schema changes
schema/conversation.schema.json—statusgainstimed_out; newtimed_out_in_round;events.minItemsrelaxed to 1 (a round-1 timeout hasonly the seeded user message), with the two-event floor moved into a
conditional for
completed/stopped.schema/harness-descriptor.schema.json— drops the two removed template fields.CLI changes
dispatchsubcommand;dispatch-taskremoved.run,ingest,--agent-model,--judge-model, and--harnesshelprewritten around runner-driven dispatch.
Documentation
profiles/shared/runbook.md,dispatch-manifest.md, all four harnessdescriptors'
next_steps_template/manifest_template,harnesses/template.toml,README, AGENTS.md,
docs/developer_overview.md,docs/progressive-enhancements.md,docs/guides/byoh.md,docs/guides/isolation.md, and the per-harness notes.Goldens: runbook, manifest, and next-steps re-blessed; the five
judge-recipe*goldens deleted, along with
manifest-noguard/manifest-nomodel(the manifestno longer renders a conditional recipe, so guard state and model cannot change it)
and the
next-steps-model/next-steps-nomodelpair (collapsed to one perharness, with the test now asserting model-invariance).
Decisions worth a reviewer's attention
Dispatched children get null stdout/stderr rather than inheriting them.
Killing the shell at a deadline leaves the harness grandchild holding the
inherited pipe, which kept the caller blocked ~5s past a 1s timeout (measured:
5.18s → 1.16s). Every shipped
exec_templatealready redirects both into theoutputs directory, so nothing is lost — but a BYOH template that does not
redirect now discards its output instead of leaking it to the terminal.
The flat one-shot transcript path stays. Every task now carries a
conversation_path, so it no longer distinguishes a scripted task;record_runskeys its "incomplete conversation" skip on
turnsinstead. Routing every taskthrough the conversation path would also move
tool_invocationsfrom thetranscript to
conversation.json, which 16 ingest tests do not fabricate.#266 now records
what removing it involves.
One-shot transcripts move to
outputs/turn-1/— the layout ingest alreadyread for scripted rounds, so the two-shape branching collapses.
Windows
This is the last PR that has to keep the
windows-latestleg green; #275 removesit.
.github/workflows/ci.ymlis untouched — thechoco install jqstep is nowunnecessary but harmless, and removing CI legs is #275's job. No Windows-native
accommodation was added, and the accommodations this rewrite deletes were not
ported forward. Per the #256 comment,
posix_shell()stays: harnessexec_templates are still POSIX command lines.docs/developer_overview.md's Platform-support section now points the remainingremoval at #275 rather than gating it on this ticket.
Verification
Run under the flag CI sets on both runners, so no test skips.
New tests, each written first and confirmed failing:
the_driver_runs_a_task_that_declares_no_scripted_turns— a task with noturnsleaves a turn-1 transcript and a zero-follow-up completion artifact.dispatch_drives_every_task_in_the_planrerunning_dispatch_skips_completed_tasks_and_retries_the_rest— proven with acounter the stub appends to per invocation.
a_failing_task_is_recorded_and_the_rest_of_the_batch_still_runsa_task_that_outruns_the_timeout_is_recorded_and_the_batch_finishesjobs_runs_tasks_concurrently— four 1s dispatches finish in ~1.3s against a4s serial floor.
revision_mode_dispatches_through_the_same_command— Mode B parity.dispatch_judges_runs_missing_verdicts_and_skips_present_ones,each_judge_task_captures_its_transcript_separately,dispatch_judges_exits_nonzero_while_a_verdict_is_missing,a_judge_dispatch_carries_no_guard_argumentsthe_runbook_names_exactly_one_task_dispatch_commanda_shell_command_*(4) covering the shared timeout-aware spawn helper.FixtureArgsgains--sleep-msso a timeout is testable identically on bothrunners without a
sleepbinary.Also driven end to end by hand against a stub harness:
run → dispatch → ingest → dispatch --judges → finalize → teardown, confirmingcodebase/skill_sourceprovenance still reachesrun.jsonandbenchmark.json.🤖 Generated with Claude Code