How ibrahimmian36/leanscreen works
leanscreen screens informal/Lean statement pairs through a reject-only workflow: deterministic lints and vacuity checks, optional Lean elaboration, then (in deep mode) two independent LLM reviews and an adversarial probe. The score is returned through either the one-shot CLI or MCP; file input is paired with Lean doc comments. The graph also preserves the documented Claude plugin/skill capability. Source excerpts show the scoring and service boundaries, but not every runtime construction detail, so uncertain wiring is omitted.
Main entry points: score.py Pair scorer · cli.py Check CLI · server.py MCP service · llm.py Anthropic client
Components 18
User entrypoints
- Check CLI
src/leanscreen/cli.py - MCP service
src/leanscreen/server.py - Lean file pairing
src/leanscreen/leanfile.py - Claude skill
skills/screen/SKILL.md
Screening pipeline
- Pair scorer
src/leanscreen/score.py - Structural lints
src/leanscreen/lints.py - Vacuity checks
src/leanscreen/quality.py - Back-translation judge
src/leanscreen/backtranslate.py - Counterexample probe
src/leanscreen/falsify.py
External checks
- Lean verification
src/leanscreen/verify.py - Persistent Lean REPL
src/leanscreen/lean_server.py - Anthropic client
src/leanscreen/llm.py - Anthropic API
- Lean / mathlib
Runtime support
- Settings
src/leanscreen/config.py - Typed errors
src/leanscreen/errors.py - Structured logging
src/leanscreen/logging.py
Other components
- Author / client
Connections 27
- Author / client → Check CLI: runs check
README.md - Author / client → MCP service: calls tools
README.md - Author / client → Claude skill: invokes skill
README.md - Claude skill → MCP service: uses tools
README.md - Check CLI → Lean file pairing: pairs declarations
src/leanscreen/cli.py - Check CLI → MCP service: starts runtime
src/leanscreen/server.py - MCP service → Pair scorer: scores pairs
src/leanscreen/server.py - Check CLI → Pair scorer: scores pairs
src/leanscreen/cli.py - Pair scorer → Structural lints: runs lints
src/leanscreen/score.py - Pair scorer → Vacuity checks: checks vacuity
src/leanscreen/score.py - Pair scorer → Lean verification: verifies Lean
src/leanscreen/score.py - Pair scorer → Back-translation judge: requests review
src/leanscreen/score.py - Pair scorer → Counterexample probe: probes counterexample
src/leanscreen/score.py - Pair scorer → Anthropic client: uses judges
src/leanscreen/score.py - Structural lints → Vacuity checks: reuses checks
src/leanscreen/lints.py - Back-translation judge → Anthropic client: submits prompts
src/leanscreen/backtranslate.py - Counterexample probe → Anthropic client: submits probe
src/leanscreen/falsify.py - Anthropic client → Anthropic API: sends requests
src/leanscreen/llm.py - Persistent Lean REPL → Lean / mathlib: checks statements
src/leanscreen/lean_server.py - Lean verification → Lean / mathlib: elaborates statements
README.md - MCP service → Persistent Lean REPL: warms verifier
src/leanscreen/server.py - MCP service → Settings: loads settings
src/leanscreen/server.py - Check CLI → Settings: loads settings
src/leanscreen/cli.py - Anthropic client → Typed errors: raises failures
src/leanscreen/llm.py - Anthropic client → Structured logging: records usage
src/leanscreen/llm.py - Check CLI → Structured logging: configures logs
src/leanscreen/cli.py - Lean verification → Typed errors: raises failures
src/leanscreen/lean_server.py