You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a production partiality audit with justified exceptions #11
The ecosystem prefers total production Lean code, but a blanket ban on partial definitions is not appropriate. Pure public semantics should normally be total; terminal loops, process polling, task coordination, and other externally driven code may legitimately need operational partiality.
The current pre-commit package has no audit for this distinction.
Scope
Add a dedicated audit hook, or a clearly named extension to an existing Lean hook, that reports partial definitions in configured production targets.
Report source path and line number for every occurrence.
Distinguish pure library code, operational IO code, tests, examples, benchmarks, and spike directories through configuration.
Require an explicit rationale for retained production partial definitions.
Do not fail merely because the keyword partial appears in a benchmark or an approved operational loop.
Decide whether partial_fixpoint and equivalent declarations are covered; document the decision.
Keep the hook independent of Mathlib.
Acceptance criteria
tests/self_check.py covers single-line, private, multiline, and nested partial declarations.
Pure production partiality can be made a CI failure where the repository opts into that policy.
Approved operational partiality is reported with its rationale rather than silently ignored.
Non-production exclusions are target-specific and documented.
README and consumer configuration examples are updated.
Existing style, module, and axiom hooks remain unchanged and green.
Implemented in local signed commit 22c8fef on fix/partiality-audit: added the lean-partiality hook, explicit --allow-glob exceptions with nearby partiality: rationales, CLI entry point, and self-check coverage. PYTHONPATH=. python3 tests/self_check.py passes. The branch is not pushed yet.
Implementation status: local signed commit 22c8fef on fix/partiality-audit adds the lean-partiality hook, explicit --allow-glob exceptions with nearby partiality: rationales, the CLI entry point, and self-check coverage. PYTHONPATH=. python3 tests/self_check.py passes. Branch not pushed yet.
Activity
[-]Add a production no-partial audit hook[/-][+]Add a production partiality audit with justified exceptions[/+]jonaprieto commentedon Aug 8, 2026
Implemented in local signed commit
22c8fefonfix/partiality-audit: added thelean-partialityhook, explicit--allow-globexceptions with nearbypartiality:rationales, CLI entry point, and self-check coverage.PYTHONPATH=. python3 tests/self_check.pypasses. The branch is not pushed yet.jonaprieto commentedon Aug 8, 2026
Implementation status: local signed commit 22c8fef on fix/partiality-audit adds the lean-partiality hook, explicit --allow-glob exceptions with nearby partiality: rationales, the CLI entry point, and self-check coverage. PYTHONPATH=. python3 tests/self_check.py passes. Branch not pushed yet.