Repository navigation
Long proofs (LP1 to LP5, DP1 to DP6) and the chain of Lean (CL0 to CL6) - #8
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Every problem gets a row: Lean lines and characters of its certified or last failed file, aux_ lemmas, M12 holes and verdicts, checks, check time against size, stop reasons, and the reference length from --reference. A table buckets success by reference length; length.json carries the records for pooling. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…LP4) Under RunConfig.longProof, an accepted informal proof over the short limits whose facts are found is triaged long, not skip, when the allowance is at least triageUsd; the gate then counts frontier growth as progress and stops a long problem after dryChecks finished sessions that closed no hole. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
…s 65 to 67 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…ce (LP5) A too_hard hole verdict carries a reason (turns, budget, model_said), counted by the report's Loop section and shown in harness audit. Under RunConfig.longProof, M12's new option holeContinuation gives a hole cut by its turns one more session before a refinement round splits it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…ush, library, informal step (DP4) hole-session.ts passes runSession the run's sorryBattery (on the hole's own proof), the lean.search push, and M3's Library section and library_search tool searched by the hole's statement (ProblemLines.openHole). holePrompt shows the informal note above the hole's lemma, quoted and said to be unchecked. sessionSorryBattery is shared with prover.ts; run.ts builds the battery settings once. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
liftHaves in @seshat/scheduler closes the steps the sorry battery closes, prints the rest with Mathlib's extract_goal in one Lean check, renames each statement to an aux_ lemma and rewrites the step to apply it. The simulated Lean prints extract_goal's statements for the tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…P2, DP1) With longProof, before the first outer session one planner call answers the target's proof as have steps; it is checked once, lifted by liftHaves with the battery given to M12 as ProblemContext.closeSorries, checked again and journaled as an m12_sketch with planner, fromInformal and lifted. The draft shares askPlanner with the refinement rounds and is not a round; a draft Lean refuses is revised in round 1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
The drafts option and the ranking came with the draft loop: this commit tests them with three drafts of 3, 2 and 2 holes, a refused draft, a failed call and a gate that skips, and documents the discarded records and the option. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
A hole session quotes the comment directly above the hole's lemma as the informal step it formalizes, so liftHaves keeps the draft's step comment there. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
cutFailures cuts a failing named have at any depth to sorry and lifts it with the one lifter, so a statement that mentions a bound name or a have inside a cases branch is lifted instead of refused. The conservative text parser of repair.ts is deleted. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…(Tasks 65, 66) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… prefix (LP3) Under longProof (key freeze, default true) M12 locks a proved hole, or an aux_ lemma of the outer file that a check accepted, into a prefix of the problem's file. Lean checks and the certifier replays the whole file; the models read the prefix by statement only; an edit to it is refused as an edit outside the regions. The record is the accepted_lemmas node (optional lemmas field, DP5): a resumed run locks the prefix again from it. Replaces the WIP m12_frozen node. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Under longProof, M3's option fromFrozen takes its candidates from the lemmas M12 locked into the file, recorded in the accepted_lemmas nodes, failed attempts included, and judges them at afterProblem. recordCandidates and the new recordFrozenCandidates share one function for turning lemmas into candidates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…lly closed draft through validate A have draft whose battery closes every step has no hole to lift: it goes through validate (Lean decides) instead of being recorded as not healthy only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… lock, journal late lemmas, escape the hole name Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…tion (DP6) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…e-v2-long Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…), Ruling 45, Tasks 68 to 71 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… transcripts harness audit gains one table, "Output tokens by role and kind": per role, calls and output tokens, then thinking, text outside tool calls and tool-call arguments (tokens and shares) and the prose share. A session's usage.output is split across its message parts by characters; a one-shot call's text is min(outputTokens, chars / 4) and the rest is thinking not stored (CHARS_PER_TOKEN, one named constant). The computation is in output-kinds.ts (one function, read-only, called by audit.ts) so that audit.ts, already long, gets no second concern; the table is markdown only because length.json holds per-problem records. Hole sessions saved no transcript. HoleSessionDeps gains an optional transcript writer (the prover's signature); run.ts's one writer is now defined once at run level and passed to the lines, so there is no second writer. The hole's request blob carries its sessionId so the audit finds the transcript; older journals read "not recorded". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… bucket.ts, with no change of behaviour The prior of w pseudo-sessions at a mean, the per-value means of a keyed setting, and the effect of one value against the others (with its deactivation, never of every value) are now shared; drawCard and cardEffect call them and draw and decide exactly as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…on bucketPrior, off by default) A value's posterior on the claim starts from familyPriorWeight pseudo-sessions at its mean in the bucket, and a value M5's rule turns off in the bucket is not drawn while another is left. The bucket is computed once and shared with the cards; the attempt records heuristicBucket even with no cards. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…d the arm solve-v2-fleet-modes After M6's repeat rule stops a prover's attempt, or the claim stagnates, the next draw leaves out the mode and thinking level that attempt had, while another is left; the allocation records what was left out. The arm solve-v2-fleet-modes sets the fleet line with two modes, three cheap thinking levels, bucketPrior and switchOnStall against solve-v2. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
A prompt file next to the prover's, lean-draft.system.txt, with its own version record: write only Lean 4 as a have-sketch (the form of DP1, so that liftHaves and the sorry battery read it unchanged), at most one comment of five words, no prose, and three worked examples. Loaded and versioned as prover.system.txt is (prompt.ts), screened by the same strict screen (LEAN_DRAFT_TARGET); not listed in PROMPT_TARGETS, because the optimizer measures a candidate through RunConfig.prompts.proverSystem, which does not reach the draft. Documented in prompts.md. Nothing calls it yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… (CL2) lean-draft.ts, one module and one function: one completion with no tools at thinking off, capped, charged to the probe's ledger (made before the draft and shared with the probe's session, so no new budget path); Lean checks the whole draft through Workbench.check; a clean draft is a candidate through validate and the certifier; an error cuts the draft at its first break, the cut file is checked to read the sorry's goal, and one continuation is asked (resumes); the run's sorry battery runs once on what is left. RunConfig.leanDraft is its own entry (status experimental), checked, recorded in run.started and read back by resume. run.ts adds one line at the fresh probe, for a problem that is neither resumed nor triaged long (BudgetGate.long). The attempt's lifecycle is journaled by the module itself with the same events and helpers the prover uses (attempt.started with settings.mode lean_draft, attempt.charged, attempt.finished through outcomeOf, chargedTotals, the transcript), not through runSession: a session is a tool loop with a wrap-up request and per-check hooks, and this is two completions and some checks, which is the smaller and clearer code. The gate's price of a session leaves the draft out, and the workbench notes the attempt only when it found the candidate, so the gate's numbers are what they were. Small exports: dedent (core), textOf (llm.ts), outcomeOf (prover.ts). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…CL2, CL6 b) scheduler.md: when the draft runs, what it is shown, how it is cut and resumed, what it records, its budget (the probe's ledger), the order battery, draft, sampled session, and what has not run. trust.md lists no path to a candidate by name, so it is unchanged: the draft adds none, its candidate is the workbench's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… the experimental Lean draft (CL4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
The draft attempt belongs to no task, so the problem's spend (joined through tasks) missed it: a resumed problem's ledger was seeded without it, and the probe's slice-resume and extension counted only the probe's own task. Chosen: the spend readers count the attempts of the problem's claim that no task owns (Projection.attemptsOfNoTask, used by problemSpend and by BudgetGate.probeSpentUsd), not a taskId on the draft, because a task id would make proverResumeOf and the session count read the draft as session 1 and skip the probe after a resume. With no draft there is no such attempt, so every number is as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…he research-flow diagram Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…raft left out by one predicate Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…et.md) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… continues its step, no extractProof wrapper Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
… against a baseline, the fleet's options absent Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…imit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
…on a timeout On LP6's real run no draft was lifted: Mathlib prints an extracted statement as `theorem _example.extracted_1 ... := sorry`, which the lifter did not read (it wanted `:= by sorry`), and the extractions of one draft together ran out of the declaration's heartbeats. Both forms are read now, and when the probe of every step gives no statement for each, one probe per step follows. The simulated Lean prints the real form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
On LP6's real run a problem with frozen links was skipped at the wave by one Thompson draw (0.002) from a posterior of one attempt. Long proofs follow the frontier: under RunConfig.longProof a probe with Lean progress widens by progress, within the allowance. The journal accepts a wave widened by progress with progress true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
The bound of 30 s failed on unchanged code on a workstation with a slow disk (58 s; 13 s on a cloud machine). It guards against a cost that grows with the run's age, which would take minutes: 120 s keeps that guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is version 1.0.0-beta.2 (
CHANGELOG.md). It builds three plan changes the owner approved on 2026-11-19:plans/plan-change-long-proofs.md, LP1 to LP6 (Ruling 43);plans/plan-change-decomposition-provers.md, DP1 to DP7 (Ruling 44), which amends it;plans/plan-change-chain-of-lean.md, CL0 to CL6 (Ruling 45). Its part A, CL1 to CL4, is experimental and never on by default.It covers Tasks 64 to 66, the arm of Task 67, and Tasks 68 to 71. Every new behaviour sits behind an option that is off by default (
RunConfig.longProof,RunConfig.leanDraft, the fleet'sbucketPriorandswitchOnStall).v1,v2and the existing arms are byte-identical.Long proofs (Tasks 64 to 67)
The principle: a long proof is a chain of short proofs that Lean checks one at a time.
harness auditwrites a "Length" section and alength.jsonfile. Per problem it gives the Lean lines,aux_lemmas, holes and their verdicts, checks, check time against size, and stop reasons. With--reference DIRit also gives the reference proof's length and success grouped by that length.havesketch. From an accepted informal proof, the planner writes a sketch ofhave ... := by sorrysteps.liftHaveslifts the rest withextract_goalintoaux_holes.accepted_lemmas, which M3 reads.longtriage class, and a gate that follows the frontier's growth.lean.search, M3's library and its informal step.solve-v2-long.The chain of Lean (Tasks 68 to 71)
harness auditgains a table of output tokens by role and kind: thinking, text, and tool-call arguments. Hole sessions now save their transcripts.bucket.ts, shared with the sampled settings. WithbucketPrioron,mode,thinkinganddirectivelearn from the bucket as cards do.switchOnStallon, after M6's repeat rule or a stagnating claim, the next session leaves out the stalled mode and thinking level. The armsolve-v2-fleet-modesmeasures this.lean-draft.system.txt, andRunConfig.leanDraft. Before a fresh probe, one completion is written in Lean only, at thinkingoff.longproblems.solve-v2-long-draft.Review
Agents that did not write the code reviewed the long-proofs work and the chain of Lean, trust rules first. They found no trust violation, and the off-by-default behaviour holds.
Their findings are fixed, among them:
Workbench.lockrefuses holes;What was recorded rather than fixed is in the ledger.
Interface changes (additive)
RunConfig.longProofandRunConfig.leanDraft, both recorded inrun.startedbudget.gatedacceptsby: "progress"reasonon hole verdictsHoleSessionRequest.nameProblemContext.closeSorriesaccepted_lemmasgainslemmasandproblemIdm12_sketchgainsfromInformal,liftedanddiscardedexcludedProjection.attemptsOfNoTasksessionIdTests
pnpm checkgreen (tsc clean, 3434 tests pass, 1 skipped).marathon.test.ts:182exceeds its 30 s wall-clock bound on a slow disk, as it already did onmainbefore this PR.server-routes.test.tsfails under load and passes alone.harness auditon the journals of three earlier runs.solve-v2-long, three long problems, $0.73): two of three certified, with statements identical to the source, a validkernel_replayand standard axioms only. Every session ran Lean.extract_goaltimed out on every draft, soliftHaveslifted no hole yet. Also found: the gate is too strict after frontier progress with one attempt, every hole verdict wasturns, and someaccepted_lemmasnodes are empty. These go to a follow-up. Numbers are in the ledger; n = 3, so they are indicative.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q6fEz5iDpWkPAMxFAudQKD