Skip to content

fix(loop): name the exit code for a failing gate with no recognised summary - #3605

Merged
clabonte merged 2 commits into
mainfrom
fix/issue-3603-oracle-exit-excerpt
Nov 26, 2026
Merged

clabonte merged 2 commits into
mainfrom
fix/issue-3603-oracle-exit-excerpt

Conversation

@clabonte

Copy link
Copy Markdown
Contributor

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_excerpt keeps only lines matching FAIL/Error/Exception/Traceback. The note matches ("pass/fail") and the command's own lines do not, so failure_excerpt carried the note and the ### <gate>: FAIL header and none of the output.

Fix

  • select_gate_report_lines takes an optional returncode. Non-zero with no verdict line: the report ends in exit 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_set passes the return code.
  • extract_failure_excerpt keeps the lines above that note, back to the command echo.
  • Unchanged: the NO VERDICT note for a zero exit and for callers passing no return code (prerun capture, the timeout path); pass/fail; 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 on main, 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

Test and others added 2 commits November 25, 2026 18:22
…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>
@clabonte
clabonte merged commit d263085 into main Nov 26, 2026
6 checks passed
@clabonte
clabonte deleted the fix/issue-3603-oracle-exit-excerpt branch November 26, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A failing gate with no recognised summary is reported as "NO VERDICT FOUND ... may be unrelated", and its own output is left out of failure_excerpt

1 participant