Summary
When a project reaches COMPLETE status, archon-loop.sh exits immediately without checking actual code state. If a user later modifies .lean files — changing a proof back to sorry, editing a theorem statement, or adding new theorems — Archon has no way to detect the mismatch and will refuse to run.
This is a design gap: there is no watchdog, hook, or pre-flight check that compares live sorry count against the recorded stage in PROGRESS.md.
Reproduction
- Initialize a minimal Lean project and run Archon to completion:
namespace MinimalArchonExample
theorem addZeroRight (n : Nat) : n + 0 = n := by
sorry
theorem zeroAddLeft (n : Nat) : 0 + n = n := by
simp
end MinimalArchonExample
cd /path/to/Archon
./init.sh /path/to/project
./archon-loop.sh /path/to/project --max-iterations 3
Archon proves addZeroRight, marks project COMPLETE. .archon/PROGRESS.md now reads:
## Current Stage
COMPLETE
- Manually revert the proof back to sorry:
theorem addZeroRight (n : Nat) : n + 0 = n := by
sorry
- Re-run Archon:
./archon-loop.sh /path/to/project --max-iterations 1
- Observed behavior:
[ARCHON] Project 'project' is COMPLETE. Nothing to do.
Archon exits immediately. The plan agent never runs, so the new sorry is never detected.
Expected behavior
Archon should detect that .lean files contain sorries despite the project being marked COMPLETE, and either:
- Automatically revert the stage and re-enter the proving loop, or
- Warn the user about the mismatch and suggest how to proceed
Suggestion
A lightweight pre-flight sorry check before the COMPLETE early-exit in archon-loop.sh could address this. For example, running sorry_analyzer.py and comparing the result against the recorded stage — if sorries exist but the stage is COMPLETE, either auto-revert or warn.
Summary
When a project reaches
COMPLETEstatus,archon-loop.shexits immediately without checking actual code state. If a user later modifies.leanfiles — changing a proof back tosorry, editing a theorem statement, or adding new theorems — Archon has no way to detect the mismatch and will refuse to run.This is a design gap: there is no watchdog, hook, or pre-flight check that compares live sorry count against the recorded stage in
PROGRESS.md.Reproduction
cd /path/to/Archon ./init.sh /path/to/project ./archon-loop.sh /path/to/project --max-iterations 3Archon proves
addZeroRight, marks project COMPLETE..archon/PROGRESS.mdnow reads:Archon exits immediately. The plan agent never runs, so the new sorry is never detected.
Expected behavior
Archon should detect that
.leanfiles contain sorries despite the project being marked COMPLETE, and either:Suggestion
A lightweight pre-flight sorry check before the COMPLETE early-exit in
archon-loop.shcould address this. For example, runningsorry_analyzer.pyand comparing the result against the recorded stage — if sorries exist but the stage is COMPLETE, either auto-revert or warn.