Skip to content

Add exposition site: per-project dependency graphs + declaration index - #279

Merged
Vilin97 merged 1 commit into
mainfrom
claude/lean-pool-exposition-1f7ce9
Jul 23, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
claude/lean-pool-exposition-1f7ce9

Conversation

@Vilin97

@Vilin97 Vilin97 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

A static companion site to the API docs, published at <pages-root>/exposition/ on the existing Pages deployment. Inspired by LML's exposition but rebuilt from scratch for the pool's scale: 58,431 declarations, 392,352 dependency edges, 130 projects.

What it does

  • Per-project dependency graphs — every project gets a left-to-right layered graph (dependencies flow left → results right, longest-path layering with SCC collapse + barycenter crossing reduction, precomputed at build time). Header shows #nodes / #edges / max depth / avg depth and a kind legend. Since pool projects never import each other, there is deliberately no whole-pool hairball — the landing page's project table is the global view.
  • Registry-card metadata — each graph page surfaces the projects.yml card: authors, math area, license, summary, source paper (DOI/arXiv) and upstream-repo links; main_declarations/main_results render as ★-ringed nodes and a click-to-select headline list with the card's informal statements.
  • Declaration panel + dependency cones — clicking a node shows its statement (sliced from source), docstring, GitHub/API-docs links, uses/used-by lists, and a one-click dependency cone: ancestors + descendants re-layered client-side (e.g. Gödel I's cone: 2,966 ancestors). Deep-linkable via #d<id> / #cone=<id>.
  • All-declarations viewer — all 58K declarations in one virtual-scrolled table, sortable and filterable by kind, project, and name substring; rows link into the graphs.
  • Landing page — pool-wide stats, kind breakdown, and a sortable project table (area, provenance, license, decls, edges, depths).

How it's built

  1. scripts/exposition/Extract.lean (via lake env lean --run — no lakefile changes, so no build-cache invalidation) walks the compiled environment and dumps human-written declarations with kernel-closure dependency edges (equation lemmas, match_* auxiliaries, projections, constructors tunnelled through to their parents; private declarations kept, demangled for display). 6.5 min / 7.9 GB peak locally.
  2. python -m lean_pool.exposition computes layouts + stats and emits per-project JSON shards plus the static frontend (vanilla JS, zero external dependencies, dark/light theming). 11 s for the whole pool.
  3. CI: a new exposition job in docs.yml runs in parallel with the doc-gen4 build, restores the same Docs-Lake cache (read-only), and uploads a ~30 MB artifact that the docs job merges into the Pages tree before deploy. Fail-soft: if the exposition job fails or times out, the docs deploy proceeds without it.

Verification

  • 180 pytest tests green (layout, statement slicing, end-to-end generation), ruff + actionlint clean.
  • Full-pool data audit: zero dangling/self/cross-project dependency references; shard layouts satisfy layer(node) > layer(dep) outside SCCs; stats/index/viewer cross-checks pass; byte-identical output across runs.
  • A 21-agent adversarial review (data integrity, graph frontend, generator/extractor, CI, UX) produced 14 confirmed findings — all fixed here except five stale main_declarations names in projects.yml, which need a separate content-only PR (exact replacements identified).
  • Browser-tested on the real pool including the largest project (Incompleteness: 8,225 nodes / 132K edges), light + dark, down to 800 px.

The five projects.yml main_declarations typos currently render as unlinked headline entries on their project pages; they self-heal once the content fix lands and the site rebuilds.

🤖 Generated with Claude Code

A static companion site to the API docs, published at /exposition/ on the
existing Pages deployment (inspired by leanmachinelearning.org's exposition,
rebuilt from scratch for the pool's scale: 58K declarations, 392K edges,
130 projects).

- scripts/exposition/Extract.lean (run via `lake env lean --run`, no
  lakefile changes): walks the compiled pool environment and dumps every
  human-written declaration with kernel-closure dependency edges
  (compiler-generated auxiliaries tunnelled through), docstrings, and
  source ranges as JSONL.
- python/lean_pool/exposition: generator computing per-project layered
  layouts (iterative Tarjan SCC + longest-path layering + barycenter
  crossing reduction), stats (#nodes, #edges, max/avg depth), statement
  slices from source, and registry-card metadata (authors, license, area,
  summary, source links, starred main results with informal statements);
  emits per-project JSON shards + a static frontend.
- Frontend (vanilla JS, no dependencies): canvas graph with left-to-right
  dependency layers, pan/zoom, search, declaration panel (statement,
  docstring, source/API-docs links, uses/used-by), per-declaration
  dependency cones re-layered client-side, hash deep links; an
  all-declarations viewer (virtual scrolling, sort/filter by kind and
  project); a landing page with pool-wide stats and a sortable project
  table. Full run: extraction 6.5 min + generation 11 s locally.
- docs.yml: new `exposition` job runs in parallel with the doc-gen4 build,
  restores the same cache (never writes it), and uploads a ~30 MB artifact
  the docs job merges into the Pages tree before deploy — fail-soft, so a
  broken exposition never blocks the docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🤖 LLM review (gpt-5.5)

Reviewed head: d4e0cb22621382d38b90e7b83bf3ae86aacf7632

Verdict: 🛑 request_changes

This PR adds a non-mathematical exposition site pipeline: a Lean extractor for declaration/dependency metadata, a Python static-site generator, frontend pages for project graphs and declaration search, tests, and a docs workflow job that publishes the generated site next to doc-gen4 output. It does not add or formalize a mathematical result, so under the Lean Pool project-intake criteria it is repository infrastructure rather than a mergeable formal-mathematics project.

Aspect Value
Fit 🛑 not_a_fit
Level undergraduate
Branch repository tooling
Mode mixed
Obscure problem no
Code quality 4 / 5

The contribution is documentation and visualization infrastructure, not a theorem or theory-building formalization.

Findings (1)

  • no-mathematical-project — PR-wide
    There is no headline mathematical theorem, source-anchored formalization, or project card because this is a docs/tooling PR; if the maintainer wants infrastructure changes reviewed under a different standard, this should be routed separately from Lean Pool project intake.

Tokens: 54,016 in / 1,322 out · Tier: flex · Cost: $0.1549
Automated review against .github/REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.

@Vilin97
Vilin97 marked this pull request as ready for review July 22, 2026 08:49
@Vilin97

Vilin97 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

CI timing from this PR's run (all checks green):

job time notes
Build exposition site 26m59s cache restore + pool delta build + extraction (~17 min of it) + generation + 30 MB artifact upload
Build doc-gen4 site 1m36s near-no-op here (no pool modules changed); on content merges this typically runs 15–40 min
Lean Action CI (pool build) 8m32s unchanged

Verdict on the every-commit vs daily question: every commit works. The exposition job runs in parallel with the docs build, so on real content merges (where docs itself takes 15–40 min) it adds little to nothing to the critical path; on docs-quiet runs the deploy waits at most ~25 extra minutes, bounded by the 30-min fail-soft poll. On a cold cache the job exceeds the poll window and the site deploys docs-only, healing on the next warm run.

One note: the artifact-merge step is gated to main pushes, so its first live execution happens on the merge commit — it's adversarially reviewed and fail-soft in every failure path, so the worst case is a docs-only deploy plus a warning annotation.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 22, 2026 08:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Vilin97
Vilin97 merged commit 05d54ae into main Jul 23, 2026
18 checks passed
Vilin97 added a commit that referenced this pull request Jul 29, 2026
#293)

An audit of all 148 reviews the bot has posted, against what actually
happened to those PRs, says the project review was looking in the wrong
place.

**It approved a duplicate.** #275 (de Bruijn-Erdos compactness) came back
`approve` / `good_fit` / 0 findings and was closed by hand: the headline
follows in a few lines from Mathlib's `Finsubgraph`. #225 was likewise
subsumed by the pool's own `Incompleteness`. REVIEW_RULES.md never had a
duplication check — only the challenge rules did.

**It could not see what the axiom gate misses.** #225's diagonal lemma was
postulated as an `inductive` constructor, invisible to `#print axioms`;
the review filed it as a card-wording nit. Same class: #215 (a rescaled
surrogate tableau proved in place of the real one), #240 (a card informal
that was false), #265 (a synthetic residue model presented as the geometry
it models), #199 (NP-hardness claimed for a reduction-correctness result).

**Infra PRs were graded for mathematical fit.** A .lean file under scripts/
clears the workflow's "touches Lean?" filter, so the exposition PRs landed
on the project rules: #279 and #282 came back `not_a_fit`/`undergraduate`,
#283 came back `good_fit`/`graduate`/`approve` over a summary opening "This
is not a mathematics contribution." All three merged.

So the project rules gain the four checks the challenge rules already had,
adapted for finished proofs — claim-vs-Lean faithfulness, what is assumed
rather than proved, prior art, and source fidelity — plus the generated-bulk
criterion #278 was closed on after a 0-finding approval, and an AI-slop list.
Tau Ceti and ArkLib converge on the same shape.

Calibration fixes from the same audit: `obscure_problem` was `no` in all 147
project reviews and is gone; card metadata moves to out-of-scope (#216 and
#243 were rejected on nothing else, then merged unchanged); a partial review
may no longer `approve`, since code_quality cannot be scored on elided files;
and the comment now says `request_changes` is an ask, not a close — 39% of
those verdicts were merged after a human looked. Two of the four approve
examples (sphere packing, Erdos 124) were not in the pool at all.

The reviewer also now receives the PR title and description, which the rules
have always allowed to carry the source anchor. Both are contributor-written,
as is the diff, so they are fenced with a per-request random token and framed
as claims to verify rather than instructions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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