CI: Palomar structure check per project + palomar-prepare skill - #23
Open
jleder3 wants to merge 3 commits into
Open
CI: Palomar structure check per project + palomar-prepare skill#23jleder3 wants to merge 3 commits into
jleder3 wants to merge 3 commits into
Conversation
Add .github/scripts/palomar-structure-check.sh, a toolchain-free check of the layout the Palomar registry requires of a project directory (lakefile + manifest, release/rc toolchain pin, small Mathlib-only Challenge module, sorry-free Solution module, comparator.json naming the compared declarations, required formalization.yaml fields, root LICENSE), run as the first step of the per-project verify job; document it in the README and add a palomar-prepare skill with the full preparation checklist.
rfurman
approved these changes
Aug 28, 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.
Adds a fast, toolchain-free Palomar structure check as the first step of the per-project
verifyjob inlean-projects.yml, so a project folder that does not have the layout the Palomar registry requires fails within seconds, before elan, the Mathlib cache or Comparator are touched. Also adds apalomar-prepareskill with the full preparation checklist, and documents both in the README. The detect/select logic, caches, runner variable and the comparator step are unchanged.What
.github/scripts/palomar-structure-check.sh <project>checksThe registry's rules for "the selected project directory" (How to submit; PalomarTemplate; PalomarPolicy
CONTRIBUTING.md§2–3). Violations fail the job, warnings are printed (as::warning::annotations in CI).lakefile.toml/lakefile.lean;lake-manifest.jsoncommitted (violation if missing forlakefile.lean, warning forlakefile.toml); every git package in the manifest is a publichttps://github.com/owner/repoURL pinned to a full 40-character commit SHA.lean-toolchain(project-local, else the repository-root file; the report says which) matchesleanprover/lean4:vX.Y.ZorvX.Y.Z-rcN; nightlies / custom toolchains are violations.Challenge.lean; dotted modules such asChallenge.XiPrimeare resolved through the lakefile's source dirs) — exists; ≤ 1000 lines and ≤ 100 KiB (violation), > 300 lines or > 32 KiB (warning: "should be small and readable"); itsimports are only Lean core / Mathlib and its dependency closure / TauCeti — importing a project module is a violation; declares at least onetheorem/def; containssorryplaceholders (warning if none); noaxiom.Solution.lean) — exists; after stripping comments: nosorry, nonative_decide/ofReduceBool, noaxiomdeclaration (violations).comparator.json;comparator*.json/comparator/config*.jsonand paths named informalization.yamlare also picked up, as incomparator-check.sh) — valid JSON object in leanprover/comparator's schema with only the keyschallenge_module,solution_module,theorem_names,definition_names(optional),permitted_axioms,enable_nanoda; names ≥ 1 declaration;permitted_axioms⊆ {propext,Quot.sound,Classical.choice}; challenge ≠ solution module; every named declaration occurs (final name component, comments stripped) in the Challenge source (violation if not) and in the Solution source (warning; violation if none does).formalization.yamlat the project root (violation if absent). Parsed with PyYAML when available (textual key scan otherwise). Violations: missing/emptyproject.name,project.description(the registry abstract, ≤ 10000 chars),project.authors,project.license,project.responsible_maintainers,classification.arxiv,automation.methods[].method,review.status; a thin wrapper withoutrepository.substantive_formalization.{id,revision}; leftoverTEMPLATE:values. Warnings:version≠v0.4, licence other than Apache-2.0,sources[]missing or an entry without title / a relationship informalizes|adapts|independently-proves|background|other, > 2 arXiv categories, missing/oddclassification.msc2020, missingstatus.{scope,sorry_count,axioms}, non-zerosorry_count, missingfidelity.divergences, neitherstatus.main_resultsnoralignment.statements.LICENSE,LICENCE,COPYING, … optionally.md/.txt) at the repository root, non-empty.axiomdeclarations andnative_decide/ofReduceBoolin any other.leanfile of the project (comments stripped) — Comparator remains the real gate; compiled artefacts (.olean,.ilean,.trace, …) outside.lakeare a violation.No network, no Lean; needs bash and python3. Run locally from the repository root:
bash .github/scripts/palomar-structure-check.sh <project>.Skill
.claude/skills/palomar-prepare/SKILL.md(/palomar-prepare): when to use; the layout checklist above and the script; toolchain/Mathlib pinning; how to writeChallenge.lean(Mathlib-only, statements with deliberatesorry, size limits),Solution.lean(same names, no sorry/native_decide/axiom; conditional results take hypotheses as explicit arguments or a[LiteratureHypotheses]instance, neveraxiom) andcomparator.json(schema used in this repo); the fullformalization.yamlfield checklist (name, authors, licence, maintainers, original vs source-based, substantive vs thin wrapper, arXiv/MSC2020, automation methods incl. the role of AI and human review, review status, per-theorem plain-language account, fidelity gaps, sources withformalizes/adapts/independently-proves/background, prior formalizations, acknowledgements); local verification (lake build,#print axioms,comparator-check.sh→Your solution is okay!); hygiene; PR checklist; and a final "Submitting to Palomar (human step)" section (merge → full commit SHA frommain→ submission form with project path = folder name → GitHub sign-in proves write access → keep the status page URL; machines should not drive the form).Local test results
zeta23/(currentmainlayout): passes, 0 warnings.percolation/as proposed in wip: scaffold #22: passes, 0 warnings (report below). wip: scaffold #22 is open; once this PR is merged, pushes to wip: scaffold #22 run the structure check onpercolation/automatically.zeta23/):Solution.leandeleted → fails (comparator.json: Solution module 'Solution' has no source file);lean-toolchain=leanprover/lean4:nightly-2026-08-01→ fails; a copy withlakefile.leanand no manifest, noformalization.yaml, a project import in the Challenge,sorry+native_decide+axiomin the Solution, an extra permitted axiom and a name missing from the Challenge → 8 violations, each reported; pre-Lay out zeta23 as a Palomar template project #20formalization.yaml(noproject.description) with aTEMPLATE:value and an unknown key incomparator.json→ fails on exactly those three points.bash -nandshellcheck -S warningclean; workflow YAML parses (yaml.safe_load); the new step runs withworking-directory: .right after checkout.Report for
percolation/(tree of #22)Report for
zeta23/