Repository navigation
Exposition: LML extraction methodology + verified minimal files (207/238) #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
da12886
Exposition: adopt LMLExposition's extraction methodology for minimal …
Vilin97 d4e6ae4
Exposition: verified minimal files + compilation gate
Vilin97 3fed64d
Exposition: fix verify gate's LEAN_PATH and guard against a broken en…
Vilin97 8ccc49b
Exposition: minimal files 193 -> 207 of 238 headline declarations
Vilin97 21a3223
Exposition: make the minimal-file gate a ratchet at 207
Vilin97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| name: Exposition Verify | ||
|
|
||
| # Compiles a minimal Lean file for every project card's main_declarations | ||
| # (the exposition's "Minimal Lean file" feature) and fails if any does not | ||
| # elaborate. Runs weekly, on demand, and on PRs touching the exposition | ||
| # pipeline — not on every content merge (the docs.yml exposition job stays | ||
| # fast; this is the correctness gate for the builder itself). | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '40 6 * * 1' | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'python/lean_pool/exposition/**' | ||
| - 'scripts/exposition/**' | ||
| - '.github/workflows/exposition-verify.yml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
| name: Verify minimal Lean files | ||
| steps: | ||
| - name: Checkout project | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
|
|
||
| - name: Restore caches | ||
| uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae | ||
| with: | ||
| path: | | ||
| ~/.elan | ||
| .lake/packages | ||
| .lake/build | ||
| docbuild/.lake/build | ||
| key: Docs-Lake-${{ runner.os }}-${{ hashFiles('lake-manifest.json', 'docbuild/lake-manifest.json', 'LeanPool.lean') }}-${{ github.sha }} | ||
| restore-keys: | | ||
| Docs-Lake-${{ runner.os }}-${{ hashFiles('lake-manifest.json', 'docbuild/lake-manifest.json', 'LeanPool.lean') }}- | ||
| Docs-Lake-${{ runner.os }}- | ||
|
|
||
| - name: Install Lean | ||
| uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 | ||
| with: | ||
| auto-config: false | ||
| use-github-cache: false | ||
| use-mathlib-cache: false | ||
|
|
||
| - name: Install Mathlib cache | ||
| run: | | ||
| if [ ! -d ".lake/packages/mathlib" ]; then | ||
| ~/.elan/bin/lake exe cache get | ||
| else | ||
| echo "Mathlib already present from cache" | ||
| fi | ||
|
|
||
| - name: Build pool | ||
| run: ~/.elan/bin/lake build LeanPool | ||
|
|
||
| - name: Extract declarations | ||
| env: | ||
| LEAN_CMD: /home/runner/.elan/bin/lean | ||
| EXTRACT_JOBS: "2" | ||
| run: >- | ||
| ~/.elan/bin/lake env bash scripts/exposition/extract-all.sh | ||
| exposition-dump.jsonl exposition-commands.jsonl | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d0d8abe699bfb85fec6de9f7adb5ae17292296ff | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Generate site data | ||
| run: | | ||
| cd python | ||
| uv sync --locked | ||
| uv run python -m lean_pool.exposition \ | ||
| --dump ../exposition-dump.jsonl \ | ||
| --commands ../exposition-commands.jsonl \ | ||
| --repo-root .. \ | ||
| --out ../exposition-site \ | ||
| --commit ${{ github.sha }} | ||
|
|
||
| - name: Verify minimal files | ||
| run: | | ||
| # `lake env` must run from the workspace root; from python/ it | ||
| # resolves no workspace and hands `lean` an empty LEAN_PATH, which | ||
| # fails every target at `import Mathlib`. | ||
| LEAN_PATH="$(~/.elan/bin/lake env printenv LEAN_PATH)" | ||
| export LEAN_PATH | ||
| cd python | ||
| uv run python -m lean_pool.exposition.verify \ | ||
| --site ../exposition-site \ | ||
| --repo-root .. \ | ||
| --out ../exposition-verify \ | ||
| --jobs 2 \ | ||
| --lean /home/runner/.elan/bin/lean \ | ||
| --baseline 207 | ||
|
|
||
| - name: Upload verification report | ||
| if: always() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | ||
| with: | ||
| name: exposition-verify-report | ||
| path: | | ||
| exposition-verify/report.json | ||
| retention-days: 30 | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--baseline 207ensures the gate never fires when 208+ targets pass. Theverify.pyCLI already prints "raise --baseline to {passed} to lock in the gain" when the count exceeds the baseline, but there is nothing enforcing that update. Once 20 more targets are fixed in follow-up PRs, a regression of 19 passes would still not be caught. A comment in the workflow noting that this value must be manually ratcheted (or a small script that readsreport.jsonand bumps it) would prevent silent drift.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!