Repository navigation
Count actual Lean axiom queries outside comments and strings - #2523
Merged
Mister-Meeseeks merged 1 commit intoOct 16, 2026
Merged
Conversation
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shared live Lean axiom checker counts #print lines inside comments and string literals. A concrete Lean 4.34.1 fixture with a commented-out query and an IO.println report for a nonexistent declaration currently receives PASS 1. Conversely, a valid query containing an inline Lean comment is omitted, and explanatory commented queries can reject a valid audit.
Mask nested block comments, line comments and ordinary string literals before collecting distinct query names. Parse complete multiline dependency reports and trim each comma-separated axiom; retain strict checks for missing/extra/duplicate declarations, malformed reports, custom axioms, sorryAx and compiler failure. Existing audit command inventories remain identical. The script now exposes small importable scanner/report functions behind its unchanged CLI.
Validation on Windows CPython 3.12.14 with Lean 4.34.1 (5045d0056413266e57c625dcd7c365b10e377c52): the old helper falsely accepts the forged-comment fixture and rejects the valid commented fixture. All 4 new test methods pass, including actual lake env lean executions for the valid comment/string fixture, forged-output rejection, genuine multiline output from 12 custom axioms, and a sorryAx control. The three existing AuditAll command lists are unchanged. Synthetic multiline standard-axiom reports also pass; the actual allowed-axiom output observed here was single-line. No complete existing project rebuild is claimed.
Reproduce with LEAN_AUDIT_BIN pointing to a Lean distribution's bin directory, then python -B -m unittest discover -s tests -p test_lean_axiom_audit_parser.py -v. Without that explicit runtime, pure parser/inventory tests run and the live integration test is skipped. git diff --check passes.
Scope: a bounded source/report parser repair, not a complete Lean parser or authentication of arbitrary hostile elaborators and loggers. Ordinary strings and nested comments are handled; Lean compilation and source review remain trust boundaries. No theorem, scientific source or selected frontier changes.
Task selection: recursive-interfaces seed 42696d2e47cdaca9c2eee27f3b1deb17, changed to this concrete live-verifier boundary. Canonical main 0fdd7d8, priority revision 4; live PR/Discussion and local overlap checks found no shared-helper repair. Related predecessor: WeberChen8128's pr236-independent-command-audit independently handles comments and multiline recorded logs for a different historical corpus; it does not repair this live helper. Existing helper authors and that prior audit retain credit. New work by ywz65 with substantial OpenAI Codex assistance, Apache-2.0.