Commit 2269ebb
fix(server): guard against empty-ProofState false positives in verify/prove
Partial fix for the parse+export round-trip bug documented in
TEST-NEEDS.md: when the selected prover's parse_string returns an
empty ProofState for unrecognised input, the subsequent verify_proof
regenerated an empty prover source file that the real backend accepted
vacuously — producing valid=true for garbage input to Coq/Lean/Agda.
Added `is_empty_state` helper that checks goals, theorems, definitions,
axioms, and variables. If all are empty AND the request content is
non-empty, both handlers now return valid=false / success=false with
a clear message instead of round-tripping.
Verified live:
garbage @#$ to Coq → valid=false (was valid=true)
empty to Coq → valid=true (legitimately vacuous)
'Theorem t : True. ...' Coq → valid=true (unchanged — real proof)
unsat SMT to Z3 → valid=false (real Z3 result)
The deeper fix (making each prover preserve original content) still
outstanding — this guard catches the worst false-positive class and
makes /api/verify usable for training-signal collection without
bypassing it via the batch_driver's direct-binary approach.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 30b91c4 commit 2269ebb
2 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
245 | 255 | | |
246 | 256 | | |
247 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
241 | 254 | | |
242 | 255 | | |
243 | 256 | | |
| |||
270 | 283 | | |
271 | 284 | | |
272 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
273 | 295 | | |
274 | 296 | | |
275 | 297 | | |
| |||
283 | 305 | | |
284 | 306 | | |
285 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
286 | 321 | | |
287 | 322 | | |
288 | 323 | | |
| |||
0 commit comments