alpha 0.1.1 target MIT core synthetic benchmark: 986+ trials
Lattice Commit

Git checkpoints for test-gated AI code repair.

Lattice Commit wraps a one-file-at-a-time LLM repair loop with a simple boundary: commit when tests improve, reset when they do not. The goal is to preserve partial progress across multi-file fixes.

Install Read the evidence

The Scoped Claim

In a synthetic Python benchmark, the bare edit/test/revert loop solved one-file bug sets and failed when required fixes crossed file boundaries. Commit-on-improvement preserved useful intermediate fixes in that tested loop.

Benchmark setupBare loopWith checkpoints
Fixes contained in one fileSolvedSolved
Fixes required across 2+ filesFailedSolved

This is not yet a production guarantee. It is an alpha mechanism with synthetic evidence. Real-repo validation and a public reproducibility bundle are the next development milestones.

The Mechanism

best_passing = count_passing_tests()
for cycle in range(max_cycles):
    fix = llm.propose_fix(test_output)
    apply(fix)
    current = count_passing_tests()
    if current > best_passing:
        git_commit("lattice-commit: checkpoint")
        best_passing = current
    else:
        git_reset_hard_head()

Install

pip install lattice-commit

CLI usage with a local Ollama-backed fixer:

lattice-commit --workspace ./your_repo --test-cmd "python -m pytest -q"

Python API:

from lattice_commit import incremental_repair

result = incremental_repair(
    workspace="./your_repo",
    test_cmd=["python", "-m", "pytest", "-q"],
    llm_fix=your_fix_function,
    max_cycles=20,
)
print(result)
print(result.run_log)

Safety Defaults

Clean repo required

By default, the workspace must be a clean git repository root.

Real checkpoints

Improving selected-file changes become git commits with `lattice-commit:` messages.

Hard reset rollback

Non-improving edits are rolled back with `git reset --hard HEAD` plus `git clean -fd`.

Run logs

JSONL events are written under `.git/lattice-commit/runs/`.

Roadmap

Design Partner Hypothesis

Hosted dashboards, alerts, SSO, and team policies are not shipped yet. They become worth building only if real teams see the mechanism catching repeated regressions in their own repair loops.

Contact the project