Repository navigation
--allow-empty writes an empty file only for a genuine empty result - #9
Merged
Merged
Conversation
A finished run whose answer was nothing writes [], a header-only CSV and a sidecar with status "empty" (was "failed"), and exits 4. A blocked, never-obtained or parser-failure run keeps its exit code and no longer replaces an earlier output with an empty file; that output and its sidecar are kept byte for byte. With nothing earlier at --out, such a run writes only a sidecar with status "blocked" or "failed". diff_runs.py compares an "empty" run like a complete one. Co-Authored-By: Claude Opus 5.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.
Problem
The 2026-10-14 audit left this as an owner question (L6).
finish_runtreated--allow-emptyas "write whatever happened":--allow-empty. It wrote an empty JSON and CSV over the previous good output, plus a sidecar sayingfailed. The exit code stayed 3 or 5, but the data the flag's own docstring says it protects was gone.status: failed, sodiff_runs.pyrefused to compare it.Contract (owner decision 2026-10-15)
--allow-emptyonly permits writing an empty output for a genuine empty result. It never turns a blocked, failed or parser-failure run into success.Resulting behaviour
--allow-empty[]and a header-only CSVstatus: emptyplus itsstop_reason--allow-empty, earlier output exists--allow-empty, earlier output exists--allow-empty, nothing earlier at--outstatus: blockedorfailedpartial(unchanged)diff_runs.pycompares anemptyrun like a complete one. The README and CHANGELOG[Unreleased]describe the contract.Evidence
New offline check.
allow_empty_writes_only_a_genuine_empty_resultcallsfinish_runfor every row in the table and compares file bytes before and after.Core-only venv. The suite passes (540 checks) with
PYTHONDONTWRITEBYTECODE=1and caches cleared, andci_checks.py --help-check --sample-check --secret-checkis OK.Planted faults. Each one turned the new check red on the named lines:
genuine_empty = not rows(blocked or failed treated as empty). Result: "kept byte for byte" failed, and "blocked, nothing earlier" got(3, True, True, 'empty').emptychanged back tofailed. Result: "the sidecar says empty" failed, and so did "diff_runs compares…".diff_runsback to!= "complete". Result: "diff_runs compares a complete run with an empty one" failed.output_writer.pyanddiff_runs.pyfrommain. Result: red.After restore the suite was green.
Not changed
finish_run.🤖 Generated with Claude Code