Skip to content

Count actual Lean axiom queries outside comments and strings - #2523

Merged
Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
ywz65:ywz65/r030-lean-axiom-audit-parser
Oct 16, 2026
Merged

Mister-Meeseeks merged 1 commit into
CrocSwap:mainfrom
ywz65:ywz65/r030-lean-axiom-audit-parser

Conversation

@ywz65

@ywz65 ywz65 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants