Repository navigation
fix(prover,#6790): parser lake-prefix hole — kill false-negative (grain a-2) - #6845
Merged
Merged
Conversation
…in a-2) The authoritative error parser `_parse_lean_errors` (#6831, bug a) still missed a whole class of real Lake errors, leaving the false-negative `level_1_build == False AND errors == []` alive. Root cause (grain a-2, #6790 forensic BG run-2, ai-01 msg-myaddh): Lake emits errors in a **lake-prefix** format with `error:` at the START of the line — error: Conway/Life/HashlifeCorrectness.lean:2940:79: Application type mismatch That line carries NO `": error:"` substring, so the bare gate `if ": error:" not in line: continue` SKIPPED it -> the parser returned `[]` even though a real compile error existed. Meanwhile the authority `LeanVerifier` still set `success=False` via the non-zero exit code, so the two disagreed (incoherent signature), and the false-negative verify pattern that lets a non-compiling snapshot be PRESERVED persisted. Fix — go **regex-first**: try the two positional regexes (standard `<f>:<l>:<c>: error:` and lake-prefix `error: <f>:<l>:<c>:`) on every line regardless of substring, then fall back to substring / line-start detection for non-positional errors (module-level `<file>: error:`, message-only `error: <msg>`). Apply the SAME gate widening to the authority `LeanVerifier._extract_errors` to keep alignment. Also drop a dead import (`resolve_lake_module`) from `_reverify_compiles_clean` noted in ai-01 msg-6mu0ze (#6835 review). Verification (firsthand, this machine): - Empirical proof of the hole, before: `_parse_lean_errors(lake_prefix_line)` returned `[]`; `": error:" in line` -> False. - After: returns `[{'line': 2940, 'message': 'Application type mismatch'}]`; mixed stream (lake-prefix + standard line:col + module-level) -> 3/3 caught; `_extract_errors` parity 1/1. - pytest: new regression tests `test_parse_lean_errors_catches_lake_prefix_format` and `test_extract_errors_catches_lake_prefix_format_authority` PASS; full parser/guard cohort 8/8 PASS; full file 161/163 (the 2 failures are pre-existing + unrelated — `test_coordinator_agent_has_set_attack_plan_tool` needs OPENAI_API_KEY env, `test_path_constants_resolve_to_active_workspace` is a stale STALE_POST_ABSORPTION assertion after Voting.lean #4365 absorption; both confirmed failing identically on stashed baseline). See #6790, See #1453 Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Jul 16, 2026
myia-ai-01
pushed a commit
that referenced
this pull request
Jul 16, 2026
…6940) TacticAgent emits text without calling submit_tactic/submit_decomposition across consecutive turns; tactic_history does not grow, VerifyExecutor gets msg.tactic=None and routes back to 'tactic' indefinitely — a freeze-loop with no memory in the orchestrator. The existing _consecutive_sorry_rejections counter (workflow.py:784) only covers the bare-sorry giveup pattern, NOT this 'agent responded but did not invoke a productive tool' pathology. Fix: add _consecutive_no_tool_call counter on AgentExecutor. Increments when agent.name == 'TacticAgent' AND tactic_history did not grow during this run. Resets on any productive TacticAgent turn or any other agent (Coordinator/Critic/Search text-only replies are legitimate). At threshold (default 3, configurable via PROVER_NO_TOOL_CALL_THRESHOLD) forces next_agent=coordinator with error_type='tactic_freeze_loop' so the attack plan can be revised (or yield if Coordinator cannot unstick). Not routed to Director because F12 (workflow.py:334) already forces Director at iter 4. The Coordinator channel surfaces freeze in the plan-revision loop where it can be addressed (alternative plan, decompose, abandon). Tests (po-2026 firsthand, L510): 6 new in test_prover_freeze_loop_guard.py, all PASS. Full suite 215 passed, 2 failed (pre-existing baseline L510: OPENAI creds + stale Voting.lean #4365). No regressions. See #6790 (partial: pathology 2/9 covered. Pathologies 1a/1b/2/4 covered by #6811/#6814/#6824/#6831/#6835/#6845/#6854/#6907.) Co-authored-by: Claude (po-2026 worker) <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.
Follow-up to #6831 (bug a). The authoritative error parser still missed a whole class of real Lake errors, leaving the
level_1_build == False AND errors == []false-negative alive.Root cause (grain a-2, #6790 forensic BG run-2, ai-01 msg-myaddh)
Lake emits errors in a lake-prefix format with
error:at the START of the line:That line carries NO
": error:"substring, so the bare gateif ": error:" not in line: continueSKIPPED it →_parse_lean_errorsreturned[]even though a real compile error existed. MeanwhileLeanVerifierstill setsuccess=Falsevia the non-zero exit code, so the two disagreed (incoherent signature), and the false-negative verify pattern that lets a non-compiling snapshot be PRESERVED persisted.Firsthand proof of the hole (before fix):
Fix
Go regex-first in
_parse_lean_errors: try the two positional regexes (standard<f>:<l>:<c>: error:and lake-prefixerror: <f>:<l>:<c>:) on every line regardless of substring, then fall back to substring / line-start detection for non-positional errors (module-level<file>: error:, message-onlyerror: <msg>).Apply the SAME gate widening to the authority
LeanVerifier._extract_errorsto keep alignment (explicit ai-01 ask).Also drop a dead import (
resolve_lake_module) from_reverify_compiles_clean— noted in ai-01 msg-6mu0ze (#6835 review).Verification (firsthand, this machine —
myia-po-2026:CoursIA-2)_parse_lean_errors(lake_prefix_line)→[{'line': 2940, 'message': 'Application type mismatch'}]; mixed stream (lake-prefix + standardline:col+ module-level substring) → 3/3 caught;_extract_errorsparity 1/1.python3.14 -m pytest tests/test_prover_guards.py):test_parse_lean_errors_catches_lake_prefix_format,test_extract_errors_catches_lake_prefix_format_authority.reverify_compiles_clean_*,matches_authoritative_substring_contract,catches_module_level_no_linecol): 8/8 PASS.test_coordinator_agent_has_set_attack_plan_tool— needsOPENAI_API_KEYenv (credentials).test_path_constants_resolve_to_active_workspace— staleSTALE_POST_ABSORPTIONassertion after Voting.lean [Lean][infra] Regrouper les lakes cohesifs post-convergence (GameTheory 6->2, modele multi-module) #4365 absorption.git stashof my 4 files → same 2 fail, sameVoting.lean existsassertion).Scope
4 files, +89/−11, atomic (single subject: lake-prefix parser hole + dead-import cleanup + regression tests).
See #6790, See #1453
Co-Authored-By: Claude noreply@anthropic.com