agentleFS
r-irber-irbe/proof-skills/skills/lean-bisect/SKILL.md

lean-bisect

Skill3 starsChanged 24 days agoApache-2.0View on GitHub

USE FOR: bisecting Lean 4 toolchain versions or commits to find which one introduced a regression. DO NOT USE FOR: building a project (@lean-build). TRIGGERS: bisect, regression, "which commit broke".

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the lean-bisect script (in the lean4 repo at script/lean-bisect) to find which commit introduced a behavior change.

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bisecting Lean Toolchains

Toolchain bisecting contract for Lean 4 and Mathlib. Guides pinpointing introducing commits across compiler releases or nightlies using script/lean-bisect.

Routing

  • USE FOR: running script/lean-bisect on a self-contained Lean test file to identify the Lean 4 commit or nightly that introduced a behaviour change; comparing exit-code, stdout, and stderr signatures across a commit range; isolating regressions in tactic behaviour, elaborator output, panic conditions, or build success.
  • DO NOT USE FOR: building any Lake project (use @lean-build); reducing a Mathlib-dependent failure to a self-contained repro (use @lean-mwe first; bisect operates on standalone files); writing the proof or repairing the failure itself (use @lean-proof); filing the upstream bug report after the

Workflow

  1. Prepare -- confirm the test file is self-contained (no Mathlib imports). If Mathlib-dependent, hand off to @lean-mwe first to produce a standalone repro. STOP otherwise.
  2. Verify endpoints -- manually run lake env lean (or bare lean for vendored toolchains) on the failing version and the known-good version. Confirm they show different behaviour before starting the bisect.
  3. Bisect -- script/lean-bisect /tmp/test.lean <range> with the appropriate --timeout. Use --ignore-messages if only exit code matters; use #guard_msgs to capture exact diagnostics; use --nightly-only to keep cycles bounded across long ranges.

Recovery & STOP

  • Same signature on both endpoints -> STOP, the test does not discriminate; redesign before bisecting.
  • Mathlib import re-appears after minimisation -> STOP, route back to @lean-mwe; lean-bisect cannot test versions where the Mathlib toolchain pin doesn't match.
  • Timeout exhaustion (3 consecutive --timeout increases without resolution) -> STOP, the test is too slow; reduce or isolate further.

Handoffs

  • Predecessors / successors: see FM handoffs. Typical inbound: @lean-mwe (after Mathlib-free repro) or direct from @lean-proof (when the operator already has a standalone file). Typical outbound: @lean-pr (upstream report) or @lean-zettelkasten (record the pattern).
  • Sister skill: @lean-mwe -- usually chained before bisect.

Use the lean-bisect script (in the lean4 repo at script/lean-bisect) to find which commit introduced a behavior change.

Detailed reference

Full encyclopedic reference, decision trees, and lookup tables live in references/lean-bisect-handbook.md .

See also

  • ../../references/lean-bisect-handbook.md -- Complete lean-bisect Handbook
  • ../lean-gateway/SKILL.md -- Top-level skill router

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.