Repository navigation
Pass the audit's module list and the remaining probe lists as JSON - #292
Conversation
#209 stopped compiling the requested roots into one Lean list literal: past about 1,500 entries, Lean's code generator fails with "maximum recursion depth reached in the code generator". #280 did the same for the impact probe's project modules and the unused-hypotheses roots. Three lists were still literals: - the kernel-trust audit's module list, in the strict and the open probe. It holds every module of the root package, so a project with more modules than that could not be audited at all; - the skeleton probe's library roots; - the impact probe's glob walks, added by #277. Each now reaches Lean as one JSON string that the probe decodes. The skeleton probe's core roots stay a literal: they are the four fixed names Init, Lean, Std and Lake. Real-Lean tests read 3,000 modules in each audit probe and 3,000 library roots in the skeleton probe, and an absent root whose quoted component holds a newline, a backspace and DEL comes back unchanged.
Lean's JSON printer escapes only the control characters below U+0020, so U+0085 (NEL), U+2028 and U+2029 reach a record unescaped. `str.splitlines` breaks a line at each of them, which split the record and failed the run with "emitted invalid JSON"; a docstring or source slice holding U+2028 was enough. The skeleton, impact (constants and module evidence) and unused-hypotheses readers now split at "\n" only, and the skeleton probe's round-trip test adds NEL and U+2028 to its quoted component.
|
Verdict: ready to merge once it is out of draft. This is an adversarial review of head 306ccc3. Two reviewers covered the Lean side and the Python, test and completeness side, and a verifier then tried to refute every finding. No blocker or should-fix survived. Six optional nits did. What was checked
Optional nits. None of these blocks merge.
Overlap with the #213 stack. I rechecked against #213 at 7d32fe5 and #284 at c897e96. Merging either with this PR conflicts in four files, and one assertion breaks without a conflict. Whichever lands second can resolve it like this:
A merge of this PR into #213 with exactly that resolution passes the full CI, real Lean included: https://github.com/facebookresearch/autoform-bot/actions/runs/38499643799 Posted by PR swarm: PR Swarm Lead |
Closes #241. #209 and #280 stopped compiling the probes' long name lists into Lean list literals: past about 1,500 entries, Lean's code generator stops with "maximum recursion depth reached in the code generator". Three lists were still literals:
autoform_cli/templates/github/autoform_audit.py. Pass the remaining Lean probe lists as JSON, as #209 did for requested roots #241 missed this one. It holds every module of the root package, so the audit a project's own CI runs could not run at all on a root package of more than about 1,500 modules. On main's template, a scratch CI run compiles both probes with 1,000 and 1,500 modules and stops with the code generator's error at 2,000 and 3,000. With this branch's template, all four sizes compile and run to their first check: https://github.com/facebookresearch/autoform-bot/actions/runs/38497826590project_roots), which Pass the impact and unused-hypotheses probe name lists as JSON #280 left for after the Extract Lean skeletons one probe per root module #213 stack.glob_directories), which Refuse root modules the inventory skips in work impact too #277 added after Pass the remaining Lean probe lists as JSON, as #209 did for requested roots #241 was filed.Each now reaches Lean as one JSON string that the probe decodes when it runs, as the requested roots do:
[request, components]format, read with the skeleton probe'srequestedRoots.[directory, components, glob]triples. Their names go through the impact probe's existing component rule, now shared asnameOf.autoformAuditNameOfandautoformOpenAuditNameOf.The Cabannes example's copy of the template is updated to match, since
test_example_and_template_helpers_are_identicalrequires an identical copy.The skeleton probe's
core_rootsstays a literal: it is the four fixed names Init, Lean, Std and Lake.Line breaks inside records (second commit)
#241 also asked for a test that a quoted name component holding a newline, a backspace, DEL or NEL survives the round trip. The input side does. The output side did not:
str.splitlines, which breaks a line at each of those three characters.The skeleton, impact (constants and module evidence) and unused-hypotheses readers now split at "\n" only, as the library probe's reader already does. This change is its own commit, so it can be split out.
Tests
test_both_probes_read_more_modules_than_lean_compiles_in_a_list(real Lean): both audit probes get 3,000 modules. Each compiles, reads its list, and stops at its first check outside the audit step.test_probe_reads_more_roots_than_lean_compiles_in_a_listintest_skeleton.py(real Lean): now also passes 3,001 library roots. An absent root whose quoted component holds a newline, a backspace, DEL, NEL and U+2028 comes back unchanged.test_import_impact_refuses_a_glob_module_the_inventory_lacks, whose refusal names the glob and the module it found.Overlap
The #213 stack rewrites the skeleton probe's
run_cmdblock andrender_probe. Whichever lands second resolves one hunk in each, plus_requestedintest_skeleton.py: #213'sAutoformSkeleton.mainwould take the library roots as a JSON string too. I'll recheck against #213's new head once it is pushed.This machine is over the agreed load limit for local Lean and pytest runs, so CI on this PR is the test run.