Repository navigation
autoprove reserves the end of its budget for a conclusion phase: it either finishes an already-tested proof or reports a verdict on what remains, instead of spending its last cycles on low-yield search until a limit stops it (Refs #85; autoformalize's per-claim budgets are a follow-up).
Added
-
--conclude-after=N%|Nc|<duration>|0(default15%).N%(0–50) reserves from every limited budget,Ncfrom total cycles only, a duration from runtime only;0turns the phase off and keeps the previous behaviour. Per limit L the reserve is0 if L == 1 else min(max(1, ceil(L × p)), L − 1): with the defaults the conclusion is due at cycle 17 of 20, or after two consecutive stuck cycles of 3. Startup validation errors: a reserve larger than its budget, a duration with unlimited runtime,0c/0s(use0), a percentage above 50. Magnitudes are compared as decimal text in the tracker, so an over-long value is refused rather than wrapped by fixed-width arithmetic; the duration boundceil(runtime / unit)is computed asruntime / unit + (runtime % unit != 0), and a percentage reserve as(L / 100) × p + ((L % 100) × p + 99) / 100, so neither overflows even at a 64-bit budget. With--formalize=auto(per-claim budgets) the phase is off, with a warning unless the value already disables it (0or0%). Listed in the command'sargument-hintand in MIGRATION.md's autoprove-only flags. -
The conclusion cycle (cycle-engine § Conclusion Phase). Only
tickdecides it is due, so at least one proving cycle always runs, and a binding limit is an ordinary stop. The next cycle concludes:- finalization, only when exactly one sorry remains and an already-tested candidate still applies to it, verified per File Gate Scope, with no fresh deep search — never under
--repair-only, which concludes by synthesis without filling sorries; - otherwise synthesis, a verdict
ready/fixable/no-credible-pathwith the best partial patch, the blocker inventory, missing lemmas, unexplored queries, the recommended next command, and cost accounting by phase.
It ends with the final Replan and one real tick. The mapping: a successful finalization is
solved, even on the last available cycle; then a limit reached on that tick; otherwise the newstop_reason: concluded. The runtime reserve is best-effort and stated as such: with the budget already spent, no further proof attempt is started. The summary gains a**Conclusion:**line and a conclusion-cost row; with--persistthe helper'sactionis honoured during the conclusion as everywhere else, and an interrupted conclusion reports only what it produced. - finalization, only when exactly one sorry remains and an already-tested candidate still applies to it, verified per File Gate Scope, with no fresh deep search — never under
-
Cycle tracker.
init --conclude-after=…(default0, so autoformalize and other callers are unchanged);tickprintsconclude=yes|no,conclude_reason=andconcluding=yes|no, and onLIMIT_REACHEDastop_reason=that appliesmax-stuck>max-cycles>max-runtimewhen several limits bind. A newconcludesubcommand latches the phase and snapshotsconclude_at(cycles, consecutive stuck, stuck total, deep total, elapsed). It is idempotent and refused before a due tick or with the phase off.statusreports the reserves, the latch, the snapshot andruntime_exhausted.start-claimrefuses while a reserve is enabled. Both JSON backends (jq, python3).
Changed
run-contract/v1:stop_reason: concluded, a non-blocker stop with nullstop_detailand blocker fields, which reruns freely. The amendment is additive, not bidirectional: readers from plugin 4.12.0 on accept every older record, while older readers reject aconcludedhandoff (handoff-contract). The store and prior-run reuse validate through the shared validator, so they accept it unchanged.
Tests
-
Tracker suite, on both backends:
- the rounding table (
max-cycles1/2/3/20, stuck 3, runtime); - form independence (
2cnever on stuck cycles or runtime, a duration never on cycles); 0/0%, and the default off;- first crossing and the simultaneous-crossing order;
- the latch surviving a stuck reset, the snapshot and idempotence;
- a hard limit during the conclusion, and the stop-reason precedence;
- startup validation, and the
start-claimguard.
The macOS Bash 3.2 smoke test also covers reserve parsing, the due tick, the latch and a rejected
0c. - the rounding table (
-
Parser: grammar, ranges, fit within the budget, the
--formalize=autowarning, and parity withcycle-tracker initon every case, with init given the parser's resolved value (padded values such as" 15% "are rejected by both; case is folded by both), including reserves at the boundary of a9223372036854775807sruntime; the tracker suite checks the reserve values of1%,15%and50%of INT64_MAX cycle, stuck and runtime budgets. -
A protocol acceptance test (
ConclusionPhase, real tracker and real persistence helper) for theconcluded, limit-during-conclusion, finalization-on-the-last-cycle, precedence and runtime-overshoot mappings; persistence off, an unconfirmedfinish, a committed final Replan with failed bookkeeping (stored and cited, no tick, no finish) and an interrupted conclusion;--conclude-after=0. -
Contract, store and reuse tests for
concluded. -
Check 47 pins the prose; Check 14 maps the new stop condition.