Repository navigation
Conversation
Strict CI never checked that an article's lean: name was compiled, so a sorry'd theorem in a file no target imports, after #exit, or inside a string passed the lexical autoform check --lean-root and showed as fully proved. The verify workflow now writes the assumption contract under both policies, and the strict branch passes it with the new --targets form. Its loader shares the open loader's validation and refuses a contract that allows open statements, marks an article open, or lets one assume an open statement. The strict probe embeds the targets as one JSON string, reports a missing name with the open probe's text, and guards its new helpers against imported shadows. The old three-argument form still runs the strict audit without targets. A lean: name outside the root package, as a Mathlib article's is, got only a sorry check (open) or none (strict). Both probes now apply the unsafe/partial check and the axiom allowlist to it; the open probe keeps its sorry message. collectAxioms trusts whatever the environment holds, and a root run_cmd can add a declaration with kernel checking off. Both probes now replay the root package's constants through the kernel with Lean.Environment.replay, on top of a fresh importModules of the other imported modules, and fail when it throws. The README documents --targets, the AUTOFORM_REF requirement now that the strict path calls work assumptions, and that build-time IO stays out of reach of the replay.
|
Two blockers before this is reviewable:
The target/audit/replay direction is otherwise distinct from #138 and worth retaining. |
The strict path now calls autoform work assumptions, which a pin such as the Cabannes example's c994d83 rejects with argparse's invalid choice error. Under the strict policy that one error now logs a warning and runs the three-argument audit the workflow ran before, without the lean: name check. Any other failure, and any failure under an opted-in roadmap, still fails the step. A stubbed run of the example's audit step covers both pins, both policies, and a failed fetch.
|
Re-review at The larger blocker is unchanged: this remains based on closed #115, not rebuilt #138. Replaying the two unique commits onto #138 conflicts in the README exactly where #138 suppresses clean-looking status for failed/reaching-failed declarations; preserve that wording. Then land/pin the new CLI, remove the legacy gap, refresh the body, and rerun CI on the valid base. The target/non-root/replay implementation itself remains sound. |
Stacked on #115: the base is
open-statements-revision, so the diff is this PR's commit only. Retarget tomainonce #115 lands.This fixes three gaps from the #115 contract audit that already exist on
main: H1, the first half of H4, and the first half of H6. They are kept out of #115 so it stops growing.What was wrong
lean:name was compiled. Asorry'd theorem in a file no target imports, after#exit, or inside a string passed the lexicalautoform check --lean-rootand showed as fully proved. Open statements and a revision contract for shared Lean declarations #115's open-statement probe checks this; the strict path did not.lean:name outside the root package, as a Mathlib article's is, got only asorrycheck (open policy) or no check (strict).collectAxiomstrusts whatever the environment holds, and a rootrun_cmdcan add a declaration with kernel checking off.Changes
autoform-verify.ymlwrites theautoform work assumptionscontract under both policies. The strict branch passes it to.github/autoform_audit.pywith the new--targetsform.NAME [ID] is not a declaration of the Lean build; fix the article's lean: name or build the module that declares it. Its new helpers are guarded against imported shadows.propext,Classical.choice,Quot.sound) to alean:name outside the root package. The open probe keeps itssorrymessage there.Lean.Environment.replay, on top of a freshimportModulesof the other imported modules. They fail withkernel replay of the root package failed: ...when it throws.--targets, theAUTOFORM_REFrequirement now that the strict path callswork assumptions, and what the replay does not cover.Tests
New in
tests/test_lake_artifact_audit.py:test_target_contract_lists_each_strict_article_declarationtest_target_contract_refuses_anything_but_the_strict_policytest_strict_probe_embeds_its_targets_and_guards_its_helperstest_strict_probe_requires_every_target_and_checks_non_root_onestest_strict_probe_refuses_a_helper_name_an_imported_module_declarestest_open_probe_checks_the_axioms_of_a_target_outside_the_root_packagetest_both_probes_replay_the_root_package_through_the_kernelLocal runs at
8958f94:ruff check autoform_cli servers tests: clean.AUTOFORM_REQUIRE_REAL_LEAN_TESTS=1),tests/test_lake_artifact_audit.py tests/test_impact.py tests/test_contract.py: 149 passed, 1 skipped. The skip istest_helper_runs_on_python_310, because python3.10 is not installed on this machine. I ran this at562cd59, which differs from8958f94only in a README reflow.tests/test_scaffold.pypin tests. They fail only because my local clone has nooriginremote, soplugin_pin()finds no pin. In a clone withoriginthey pass (63 of 63), and they pass in CI.Caveats
autoform work assumptionsfromAUTOFORM_REF. The example pinsc994d83, which predates that command, so a project that takes this workflow at that pin fails at that step. The pin can only move to amaincommit that haswork assumptions, which means after Open statements and a revision contract for shared Lean declarations #115 lands.root-package declarations failed the kernel-trust auditwhen the failure is a missing or non-rootlean:name.run_cmdduringlake build, can rewrite the audit script, the workflow's inputs, or the blueprint before the audit reads them. Closing that needs a separate audit job that runs no project code, plus CODEOWNERS onroadmap/README.mdand.github/.