Repository navigation
fix(loop): name the exit code for a failing gate with no recognised summary - #3605
Merged
Merged
Conversation
…ummary Closes #3603. A gate that exits non-zero without a pass/fail summary the driver recognises (an oracle printing `RED: ...` lines, say) got the NO VERDICT note, which says the shown lines "may be unrelated to the failure". `extract_failure_excerpt` keeps keyword lines only; the note matches ("pass/fail") and the command's own lines do not, so the excerpt carried the note and the gate header and none of the output. `select_gate_report_lines` now takes the command's return code. When it is non-zero and no verdict line is found, the report ends in "exit code N: ... the lines above are the last lines of its own output" instead, and `extract_failure_excerpt` keeps the lines above that note up to the command echo. The NO VERDICT note is unchanged for a zero exit and for callers that pass no return code (prerun capture). Pass/fail, failure_class and failure_signature are unchanged: the new note carries no failure keyword, so the signature still keys off the command's output. Tests: - tests/test_nonzero_exit_no_verdict.py — report names the exit code, excerpt carries the command's own lines, class/signature unchanged, zero-exit and no-return-code paths keep the NO VERDICT note, a recognised verdict gets no exit note. Verification: - scripts/smoke-test.sh: 5108 tests OK, lint/security/coverage green. 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.
Closes #3603.
Root cause
A gate that exits non-zero without a pass/fail summary the driver recognises (an oracle printing
RED: <file> lacks: <text>lines, for example) got the NO VERDICT note, which says the shown lines "may be unrelated to the failure. Run the command directly."extract_failure_excerptkeeps only lines matching FAIL/Error/Exception/Traceback. The note matches ("pass/fail") and the command's own lines do not, sofailure_excerptcarried the note and the### <gate>: FAILheader and none of the output.Fix
select_gate_report_linestakes an optionalreturncode. Non-zero with no verdict line: the report ends inexit code N: the command exited non-zero without a recognisable pass/fail summary — the lines above are the last lines of its own output._run_gate_setpasses the return code.extract_failure_excerptkeeps the lines above that note, back to the command echo.failure_class;failure_signature(the new note carries no failure keyword, so the signature still keys off the command's own output).Tests
tests/test_nonzero_exit_no_verdict.py(red onmain, 3 of 7 failing with the issue's exact excerpt): report names the exit code; excerpt carries the command's own lines and not the command echo; class and signature unchanged; other exit codes named; zero exit and no-return-code callers keep the NO VERDICT note; a recognised verdict gets no exit note.Verification
scripts/smoke-test.sh: 5108 tests OK, lint, security and coverage green.🤖 Generated with Claude Code