Skip to content

No automatic re-scan when sorries are added back after project is marked COMPLETE #17

@TengshunYang

Description

@TengshunYang

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

  1. 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
  1. Manually revert the proof back to sorry:
theorem addZeroRight (n : Nat) : n + 0 = n := by
  sorry
  1. Re-run Archon:
./archon-loop.sh /path/to/project --max-iterations 1
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions