Skip to content

fix(prover,#6790): parser lake-prefix hole — kill false-negative (grain a-2) - #6845

Merged
jsboige merged 1 commit into
mainfrom
fix/prover-parser-lakeprefix
Jul 16, 2026
Merged

jsboige merged 1 commit into
mainfrom
fix/prover-parser-lakeprefix

Conversation

@jsboige

@jsboige jsboige commented Jul 16, 2026

Copy link
Copy Markdown
Owner

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:

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 → _parse_lean_errors returned [] even though a real compile error existed. Meanwhile 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.

Firsthand proof of the hole (before fix):

_parse_lean_errors("error: Conway/Life/HashlifeCorrectness.lean:2940:79: Application type mismatch")
# -> []   (SKIPPED)
": error:" in line  # -> False

Fix

Go regex-first in _parse_lean_errors: 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 (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)

  • Empirical, after fix: _parse_lean_errors(lake_prefix_line) → [{'line': 2940, 'message': 'Application type mismatch'}]; mixed stream (lake-prefix + standard line:col + module-level substring) → 3/3 caught; _extract_errors parity 1/1.
  • pytest (python3.14 -m pytest tests/test_prover_guards.py):
    • New regression tests PASS: test_parse_lean_errors_catches_lake_prefix_format, test_extract_errors_catches_lake_prefix_format_authority.
    • Parser/guard cohort (8 tests incl. existing reverify_compiles_clean_*, matches_authoritative_substring_contract, catches_module_level_no_linecol): 8/8 PASS.
    • Full file: 161/163 PASS. The 2 failures are pre-existing + unrelated to this change:

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

…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>
@jsboige
jsboige merged commit 989faba into main Jul 16, 2026
9 checks passed
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>
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.

1 participant