Repository navigation
fix(prover,#6790): _parse_lean_errors accepts list input — kill run-4 AttributeError crash - #6846
Merged
Merged
Conversation
… AttributeError crash
BG run-4 (DEMO 62) died with exit 1 at the preserve/revert gate:
_reverify_compiles_clean falls back to the pre-parsed errors LIST when
raw_output is empty (rv.get("raw_output", "") or rv.get("errors", "")),
and _parse_lean_errors did raw_output.split("\n") unconditionally ->
AttributeError: 'list' object has no attribute 'split' (provers.py:417 ->
tools.py:127). The parse happens AFTER the gate's try/except, so the
exception escaped and killed the whole run (trace + [BG] postlude lost).
Fix: normalize input at the top of the authoritative parser — accept
str | list | tuple | None (list/tuple joined one entry per line). All call
sites covered; string behavior unchanged.
Tests: direct crash regression (list/tuple/None inputs) + end-to-end
_reverify_compiles_clean on the exact run-4 rv shape (empty raw_output +
errors list) -> returns False (revert), no crash. Cohort
parse/reverify/extract 10/10 PASS.
Unblocks BG run-5 (was gated on this crash fix). See #6790, #1453.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 16, 2026
myia-ai-01
pushed a commit
that referenced
this pull request
Jul 16, 2026
…t (delta) (#6852) Companion to #6846 (which defended `_parse_lean_errors`). ai-01 review of the superseded #6848: reduce to the delta not already on main. The two build-output parsers (`_parse_lean_errors`, `_count_sorries_from_build_output`) share the same input shape (a `raw_output` string from the verifier result). #6846 made `_parse_lean_errors` type-safe against a list `errors` fallback; this applies the identical coercion to `_count_sorries_from_build_output` so the two parsers' type-contract stays aligned and the helper is robust to any future caller that passes the `or errors` fallback. Honest scoping (firsthand): NO current call-site of `_count_sorries_from_build_output` passes the `or errors` list fallback -- the two `or errors` sites in `compile()` (L1202, L1268) feed `_parse_lean_errors` (already defended by #6846), not this helper. So this is defense-in-depth + API consistency, not a fix for an active crash. The active Run-4 crash (preserve gate) is fully closed by #6846. This delta keeps the sibling parser from regressing the same class of bug if a caller is ever refactored to pass the list fallback here. Verification (firsthand, this machine): - pytest: new regression `test_count_sorries_from_build_output_type_safe_on_list_input` PASS (list coercion, empty -> 0, string path unchanged); full crash-list + parser/guard cohort 16/16 PASS; full file 164/166 (2 pre-existing unrelated failures: OPENAI_API_KEY env + stale STALE_POST_ABSORPTION Voting.lean #4365). - LF clean; +40/-1 (15 in tools.py coercion + 26 test), atomic. Supersedes #6848 (which duplicated the `_parse_lean_errors` coercion now on main via #6846). See #6790, See #1453 Co-authored-by: Claude <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.
Summary
BG run-4 (DEMO 62, GOL nw L2904) died with exit 1 at the preserve/revert gate. Root cause (forensic ai-01 16/07, log
ai01_demo62_wt4_1784191816.log):_reverify_compiles_cleanfalls back to the pre-parsed errors LIST whenraw_outputis empty (rv.get("raw_output", "") or rv.get("errors", "")), and_parse_lean_errorsdidraw_output.split("\n")unconditionally. The parse happens after the gate's try/except, so the exception escaped and killed the whole run — trace + [BG] postlude lost.Fix
Defensive normalization at the top of the authoritative parser (single point, all call sites covered): accept
str | list | tuple | None— list/tuple joined one entry per line, None -> "". String behavior byte-identical (verified by the existing a-2 tests, untouched and passing).Tests
test_parse_lean_errors_accepts_list_input— direct crash regression: verbatim run-4 errors-list shape parses (2 errors, lines {2860, 12}), tuple parity, None -> [].test_reverify_survives_errors_list_fallback— end-to-end on the exact run-4rvshape (empty raw_output + errors list): returns False (revert), no crash.parse_lean_errors or reverify or extract_errors: 10/10 PASS local.Sequencing
Complements #6845 (grain a-2, merged): a-2 fixed what the parser catches, this fixes what input types it survives. Unblocks BG run-5 (gated on this crash fix per run-4 forensic). Residuals (b) bookkeeping + (c) success semantics stay with po-2026.
See #6790, #1453.
🤖 Generated with Claude Code