Repository navigation
feat(run): name the criteria a task failed in the summary, and fail CI with --fail-under - #206
Draft
earakely-scale wants to merge 4 commits into
Draft
earakely-scale wants to merge 4 commits into
earakely-scale wants to merge 4 commits into
Conversation
…I with --fail-under Under each task that scored below 1, the summary lists the criteria its verifications recorded as failed, each with the reason the verifier gave, cut to one line, five at most. --fail-under SCORE exits 1 when a task scored below SCORE or recorded no score; without it the exit status is as before. A run whose stdout reader leaves, as when piped into head, now finishes and tears down quietly instead of warning that progress stopped and exiting 1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…r cuts a block short Every line agent-env run prints goes through _echo, which drops the line once its stream's reader has gone and leaves the other stream alone. A block no longer stops at its first broken write, so --keep still waits and tears down after the reader leaves, and --verbose tracebacks still print when only stdout is piped away. The "Still up" warning goes to stderr, which still reaches the user when stdout is piped away. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d read verifications in one loop
agent-env run without a BUNDLE names the flags it was given ("--fail-under needs a BUNDLE to run") instead
of a hand-kept list of every flag. recorded_scores and failed_criteria share one loop over the recorded
verifications, so both name a step the same way, and the failure rule and the text lookups are stated once.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
earakely-scale
marked this pull request as draft
October 14, 2026 19:56
This branch has not been deployed
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.
Summary
Two changes make
agent-env run's results useful without opening the store, and one makes it pipe quietly.1. The summary says why a task scored below 1. Under each such task, one line per failed criterion: the step, the criterion, and the reason its verifier recorded (its justification, message or description), cut to one line. At most five per task, then "and N more".
Before, the summary stopped at
scored below 1 (hello: 0), and the reasons were only in the stored instance.2.
--fail-under SCORElets CI fail on a miss. It takes a score from 0 to 1 and exits 1 when a task scored below it or recorded no score, which can't show it passed:Without the flag the exit status is unchanged: only a run that raised, or a failed step, exits 1. That keeps a large eval tolerant by default.
3. A reader that leaves no longer breaks the run. With
agent-env run … | head, the run used to logprogress stopped: on_progress raised BrokenPipeError(32, 'Broken pipe')and exit 1. With--keep | teeand Ctrl-C, which stopsteetoo, it exited 1 and left the kept sandboxes up. Now, once a stream's reader has gone, the rest of that stream's lines go to/dev/null, and the run finishes and tears down as usual. The "Still up" warning goes to stderr, so it still reaches the user when stdout is piped away.How
task.failed_criteria(steps, context)sits besiderecorded_scoresand shares its loop over the recorded verifications (_verifications), so a criterion's step is named as its score is. It reads each verification scoring below 1. A result fails when itsresultis false, or, when it records noresult, when itsscoreis below 1; skipped results never fail. The criterion is named bycriterion,idorname, else<type> #<index>. The reason is the first ofjustification,message,reasonanddescription. That covers the shapesverify_sandbox, the env-outcome, prompt-response, unit-test and rubrics verifiers write.TaskRun.failed_criteriaandBundleRun.below(threshold)give library callers the same information the CLI prints.cli/run.py:_criteria_linesformats the summary lines and_report_belowthe closing line._echo, which catchesBrokenPipeErrorper line and redirects only the stream that broke, so no block stops at its first failed write:--keepstill waits and tears down, and--verbosetracebacks still print when only stdout is piped away.--fail-underneeds a BUNDLE, and changes nothing a--dry-runshows. Without a BUNDLE, the usage error now names the flags that were given (--fail-under needs a BUNDLE to run) instead of a hand-kept list of every flag.Tests
failed_criteria_test.pycovers naming by step or key, verifications at or above 1, results withoutresult, skipped results, and the reason's precedence.run_test.pycovers the summary lines across result shapes, with truncation and the five-line cap, and--fail-underbelow, at and with no threshold. It also covers a task with no score failing the gate, and the usage and dry-run cases.installed_test.pygets the new usage text.run_teardown_test.pychecks the "Still up" warning is on stderr.test_trajectory_followercase and a gateway time-trigger case.run_bundle_test.py):--fail-under 1run that exits 1 with the "Below" line.headdoes. The run must exit 0 with noBrokenPipeErroron stderr, and the fixture checks no sandbox was left behind. On main the same run exits 1 with the warning.--keeprun closes the pipe at "Holding", then gets Ctrl-C, and must exit 0 and tear its sandbox down. Before the per-line guard it exited 1 and left the sandbox folder.statcase on a Mac).Limits
resultsget lines. A verification scoring below 1 with no failed result recorded shows its score alone, as before.--fail-undergates each task's lowest score. An eval-level gate, such as a pass rate, is still the "tolerant eval runs" item.Not hot path (the CLI, plus a new reader beside
recorded_scores), so no release of its own.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issue remains.Summary
The PR names failed criteria in task summaries, adds
--fail-underfor CI, and lets runs finish when a pipe reader leaves.agent-env runcan fail when a task misses a score cutoff.Reviews (3) · Last reviewed commit: "refactor(run): derive the BUNDLE usage e..." · Reviewed by Greptile