Repository navigation
fix(repo): a budget stop that kept its results exits 3 in repo run and repo hits judge - #1463
Conversation
…cells were not started (intel#1372) `repo run --max-usd` counted the cells its batch budget left unstarted in `budget_stopped` and kept the finished cells' results, but `_exit_of_batch` exited 1 for it, while the exit-code table gives exit 3 to a run that stopped short on a budget and kept its partial output. `_exit_of_batch` now orders the reasons: a cell that crashed of the machinery is 5, then an error or a failed probe is 1, then a budget stop alone is 3 (`EXIT_INCONCLUSIVE`). A batch with a budget stop and an error exits 1: a defect outranks an inconclusive result. The no-result case stays 1. The quickstart exit-code table, the text after it and the repo evaluation contract say so, and `test_timed_out_cell_counts_toward_batch_budget` pins 3. New `tests/test_repo_run_batch_exit.py` covers the order from summaries. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
… stops it (intel#1373) `repo hits judge --max-usd` stopped by the cap or by a call with no price writes the cells it judged and emits status `budget_stopped`, but exited 1, while the exit-code table gives exit 3 to a run that stopped short on a budget and kept its partial output. A `done.stopped` run now exits 3 (`EXIT_INCONCLUSIVE`); a failed judge call (`JudgeFailing`, an input or infrastructure error) keeps its exit code. The quickstart exit-code table, the text after it and the repo evaluation contract say so, and the four tests that pinned exit 1 on a budget stop pin 3. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
There was a problem hiding this comment.
🟡 Changes recommended
CLI help and documentation still misstate budget-stop exit codes, infrastructure-error precedence, and the requirement for three consecutive judge failures of the same kind before exit 1.
3 open issues
What changed in this PR
3 new findings. This PR aligns budget-stop exits in repo run and repo hits judge with the CLI’s inconclusive-result contract, addressing #1372 and #1373.
Changes:
- Returns exit 3 for budget-only stops while preserving error and infrastructure-failure precedence.
- Updates budget-stop regression tests and adds batch exit-precedence coverage.
- Documents the revised behavior in the quickstart, evaluation contract, and changelog.
| File | Description |
|---|---|
dokimi/tests/test_repo_run.py |
Expects exit 3 when the batch budget stops further cells. |
dokimi/tests/test_repo_run_batch_exit.py |
Adds coverage for batch exit-code precedence. |
dokimi/tests/test_repo_hits_judge.py |
Updates capped and unpriced judge-stop expectations. |
dokimi/tests/test_repo_hits_judge_cost.py |
Expects exit 3 alongside budget-stop JSON output. |
dokimi/dokimi/commands/repo_run.py |
Classifies budget-only stops as inconclusive. |
dokimi/dokimi/commands/repo_hits.py |
Returns exit 3 when budget limits leave judging unfinished. |
dokimi/docs/repo-evaluation-contract.md |
Documents budget-stop exits for both commands. |
dokimi/docs/quickstart.md |
Revises the exit-code table and explanatory text. |
dokimi/changelog.d/20261201_120100_repo-hits-judge-budget-stop-exit-3.md |
Records the judge budget-stop exit change. |
dokimi/changelog.d/20261201_120000_repo-run-budget-stop-exit-3.md |
Records the batch budget-stop exit change. |
Review effort: Balanced
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 10 selected item(s). CI at `4d2bfc1`: 1 failing, 25 passing, 4 skipped
Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1463 +/- ##
==========================================
- Coverage 96.30% 96.30% -0.01%
==========================================
Files 515 515
Lines 68905 68910 +5
Branches 11932 11933 +1
==========================================
+ Hits 66360 66364 +4
+ Misses 1568 1567 -1
- Partials 977 979 +2
🚀 New features to boost your workflow:
|
vchamarthi
left a comment
There was a problem hiding this comment.
@antonwolfy, could you fix the problem I found (in the line comments) and fix what the bot's thread on dokimi/docs/quickstart.md:277, the bot's thread on dokimi/docs/quickstart.md:278, the bot's thread on dokimi/dokimi/commands/repo_run.py:511 and the bot's thread on dokimi/docs/quickstart.md:277 still point out? Then push and I'll take another look.
What I checked on fe97824: the 177 changed tests pass, and fail on main as expected; the full test suite passes with main merged in (35,588 tests), apart from failures main has too; it merges cleanly onto main; when I changed the code on purpose, the tests caught all 5 changes.
A rerun after earlier invocations spent --max-usd starts no cell and keeps nothing, so it is the no-result exit 1 (docs/quickstart.md exit 3 needs a kept partial output); it exited 3. Suggested in review. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
… return repo run --help and repo hits judge --max-usd help still said exit 1 for a budget stop; the quickstart said a crashed cell exits 1 (an infrastructure crash exits 5) and that any failed judge call exits 1 (only 3 in a row with one error stop the run; a single one leaves its pair unjudged). Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
Mutation of changed linesAt 4d2bfc1: 17 caught · 1 missed Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put
Not checked:
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
xaleryb
left a comment
There was a problem hiding this comment.
Approved on 4d2bfc1. A budget stop that kept results exits 3 in repo run and repo hits judge; our commits make a batch whose budget started no cell exit 1 (the repo_run.py:510 thread) and bring the help, quickstart and contract in line with the codes returned. Full suite, gates and CLI snapshot are green. Windows smoke had not started (the hosted Windows queue was stuck); every other check passed.

Summary
The exit-code table in
docs/quickstart.mdgives exit 3 to a run that stopped short because a budget ran out and kept its partial output.repo run --max-usdandrepo hits judge --max-usddid that and exited 1.mainmainrepo run --reps 2 --max-usd 0.01 --max-usd-per-cell 0.5result.json; the second is1 not started (batch budget)repo hits judge --max-usd 0.5 --jsonwith an unpriced judgebudget_stopped, the judged cells keep theirhits_judged.jsonrepo hits judge --max-usd 1with $0.40 callsOrder of precedence for a
repo runbatch, which the table did not give: a cell that crashed of the machinery is 5, then an error or a failed probe is 1, then a budget stop alone is 3. A batch with both a budget stop and an error exits 1, because a defect outranks an inconclusive result. Arepo hits judgerun whose judge call failed still exits 1 (or 2 for an output that cannot be written).Closes #1372
Closes #1373
Changes
_exit_of_batchindokimi/dokimi/commands/repo_run.pychecks infra crash (5), then error or failed probe (1), thenbudget_stopped(3,EXIT_INCONCLUSIVE); its docstring says so. A batch with no budget stop exits as before, and so does the no-result case (1)._judgeindokimi/dokimi/commands/repo_hits.pyexits 3 ondone.stopped; a failed judge call still goes through_stopped/_failed_after_calls.docs/quickstart.md(row 3 and the text after the table) anddocs/repo-evaluation-contract.md(--max-usdofrepo runand ofrepo hits judge, §4.5) say exit 3 and name the 1 for an error or a failed judge call.test_repo_run.py::test_timed_out_cell_counts_toward_batch_budget, and intest_repo_hits_judge.pyandtest_repo_hits_judge_cost.pythe four tests of an unpriced stop and a cap stop. The failed-call tests intest_repo_hits_judge.py(exit 1) are unchanged. Newtests/test_repo_run_batch_exit.pycovers the order of precedence from summaries.Risk
A script that treats any non-zero exit of
repo run --max-usdorrepo hits judge --max-usdalike sees no change; one that tests for exactly 1 on a budget stop now gets 3. Exit 1 is kept for an error, a failed probe, a failed judge call and a batch with no result.Merges with open PRs: #1184 edits row 4 of the exit-code table, next to the row 3 this PR rewrites, so the two conflict in
docs/quickstart.mdand the later one to merge rebases. #1190 and #1416 change thefrom dokimi.utils import InputErrorimport ofrepo_hits.py, next to theexit_codesimport this PR changes, so they conflict there by a line. #1413, #1420, #1458 and #1197 merge cleanly with this branch and touch none of the lines changed here.Testing
On Linux, at
fe97824f(onmaine1f77404):make ci-local: 38 passed, 0 failed, 16 skipped (docker external-catalog smoke, mutation-diff comment package, pinned Claude Code install, jobs that do not run on a PR, matrix jobs, conda-forge, fuzz, semgrep). 32011 tests passed, 27 skipped; changed-line coverage 100%.main's code, the new and changed tests fail:test_repo_run_batch_exit.py1 failed, 8 passed (assert 1 == 3);test_repo_run.py::test_timed_out_cell_counts_toward_batch_budgetfails (assert 1 == 3);test_repo_hits_judge.pyandtest_repo_hits_judge_cost.py4 failed, 70 passed (assert (1, 1, 1) == (3, 1, 1)among them).budget_stoppedbefore an error or a failed probe fails the two budget-plus-error and budget-plus-probe cases; checking it before the infra crash fails the budget-plus-infra case; exiting 3 only under--jsonfails the two text-moderepo hits judgetests.repo run(the tests use the fake runner); a real judge model.Open questions
None.
Revert
A plain revert restores exit 1 for both budget stops. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)