Skip to content

fix: validate proof state before accepting level completion#455

Open
Ocean-Moist wants to merge 1 commit intoleanprover-community:mainfrom
Ocean-Moist:fix/false-editor-completion
Open

fix: validate proof state before accepting level completion#455
Ocean-Moist wants to merge 1 commit intoleanprover-community:mainfrom
Ocean-Moist:fix/false-editor-completion

Conversation

@Ocean-Moist
Copy link

Summary

  • The server sets completed based on absence of diagnostics, not goal state. During fast typing, diagnostics are transiently empty while the server is still processing, causing false completion.
  • Validate that the last proof step has actual tactic info (column != null) and that the initial step has goals before accepting completion client-side.

Fixes #453, fixes #402

Test plan

  • Open any game in editor mode
  • Type a multi-tactic proof quickly — level should no longer falsely flash "Level Complete"
  • Complete a proof normally — level completion still triggers correctly

The server sets `completed` based on absence of diagnostics, not goal
state. During fast typing, diagnostics are transiently empty while the
server is still processing, causing false completion. Validate that the
last proof step has actual tactic info (column != null) and that the
initial step has goals before accepting completion client-side.

Fixes leanprover-community#453
@khwilson
Copy link

khwilson commented Mar 8, 2026

I also had this problem locally, and I think you need to add a guard at line 450 of client/src/components/infoview/info.tsx

khwilson added a commit to khwilson/lean4game that referenced this pull request Mar 9, 2026
Basically this commit on `main`

leanprover-community#455

With one extra guard added in info.tsx
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.

Repeated spurious level completes in editor mode nonsense input leads to undefined state

2 participants