lean-agent
github.com/savarin/lean-agent- Category
- Developer Tools
- Rank
- No. 4173Tools index
Previous survey · No. 3941 ·
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Software Testing & Quality · Coding
- Interfaces
- CLI
- GitHub
- 2 stars
- Date
About
lean-agent is a CLI tool that scans a codebase for assumptions the code makes but doesn't enforce, then automatically adds type constraints and validation to close the gaps, scoring progress with an Invariant Enforcement Score (IES) that iterates until it plateaus. It runs the project's tests every iteration, discards failing attempts, and leaves a branch for review, with a score-gate command usable in CI.
At a glance
lean-agent looks for assumptions that code relies on without enforcing and proposes changes on a branch. It is worth evaluating if a module repeatedly accepts invalid inputs or leaves important conditions implicit.
Good fit
Developers who can review proposed invariants and run meaningful tests.
Consider something else when
Use manual review first when the business rule is disputed or the existing tests give little evidence.
Start here
Choose one scratch module with a known invalid input. Compare the proposed guard with the intended behavior and add a test that would fail without it.
Cost and requirements
MIT-licensed Python project. Check the documented agent and model setup before running an enforcement pass.
Limits to know
The score reflects the tool’s assessment and the tests it sees. A higher score does not establish that the added rule is correct or that compatible inputs still work.
Sources checked 2026-11-05. Source-based assessment.
Why it made the leaderboard
Gives teams a measurable, CI-enforceable signal for whether an agent actually removed hidden assumptions from code instead of just claiming to have fixed something.
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.