Skip to content

Support complete public project-root indexes - #558

Merged
Vilin97 merged 1 commit into
mainfrom
codex/project-root-index
Oct 1, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
codex/project-root-index

Conversation

@Vilin97

@Vilin97 Vilin97 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

The flat pool index adds one import for every source file and now reaches the 10,000-code-line limit. Add a local lake exe mk_all generator for one public aggregate per project, shared by the quality linter, mechanical rebase helper and rebase build fast path. Project aggregates publicly import the original entry module and every nested source; the pool index imports only these aggregates.

This infrastructure PR preserves flat indexes during rollout. A separate content PR generates the project roots, followed by mandatory enforcement for module-system packages. The generator refuses to overwrite mathematical code, and mechanical rebases also stage regenerated aggregates. Challenge and Solution retain their existing indexes. Existing size, proof, option and branch checks remain intact.

Validation: 561 Python tests passed (2 unrelated optional tests skipped), including a real Lean consumer compiled through both public aggregation layers; Ruff and formatting pass; the local lake exe mk_all --module --check and whole-tree static quality checks pass. No formalization sources changed.

@Vilin97
Vilin97 merged commit e38523f into main Oct 1, 2026
26 checks passed
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

Retrigger

[High risk] Adds project-level index generation and validation to the build system.

The PR appears safe to merge, with non-blocking generator-cleanup and rollout-documentation corrections needed.

Findings

  1. P2 Obsolete aggregates remain unchecked ▶
  2. P2 Instructions describe future behavior ▶

Summary

The PR adds a Python-backed Lake index generator, project-aggregate validation, and rebase support while retaining flat indexes until a separate migration. The generator does not handle obsolete aggregates, and the contribution instructions describe the future layout as though it were already active.

Reviews (1) · Last reviewed commit: "Support complete public project-root ind..."

Comment on lines +108 to +110
def _write_indexes(contents: dict[Path, str], *, check: bool) -> int:
"""Check indexes or update them without overwriting a mathematical source."""
for path in contents:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Obsolete aggregates remain unchecked

When a project's last source file is removed, the expected output no longer includes its Imports.lean. This loop only visits expected files, so regeneration leaves the old aggregate in place and mk_all --check passes, even though the quality gate rejects it. Handling obsolete generated aggregates in both modes would keep the generator and its check consistent.

Knowledge Base Used: Python maintenance tooling

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!

Comment thread CONTRIBUTING.md

- **Propose a repo.** Open an issue with the GitHub URL and a maintainer can import it. Repos that Reservoir does not index can be added to [`candidates/manual.txt`](candidates/manual.txt).
- **Open a content PR.** Add your project under `LeanPool/<YourProject>/`, register it in [`LeanPool/projects.yml`](LeanPool/projects.yml) — the card must declare `provenance` (`human`, `AI`, or `mix`; see below) — and regenerate the index with `lake exe mk_all`.
- **Open a content PR.** Add your project under `LeanPool/<YourProject>/`, register it in [`LeanPool/projects.yml`](LeanPool/projects.yml) — the card must declare `provenance` (`human`, `AI`, or `mix`; see below) — and regenerate the indexes with `lake exe mk_all`. Commit `LeanPool/<YourProject>/Imports.lean`, which publicly imports every project source, and the single project import added to `LeanPool.lean`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Instructions describe future behavior

This tells contributors that ordinary lake exe mk_all generates a new project's Imports.lean, but the generator still defaults to flat indexes until a project aggregate already exists. Contributors following these steps cannot produce the requested file; adding just one aggregate manually makes validation require aggregates for every project. Please describe the staged rollout and the explicit migration command instead.

Knowledge Base Used: Python maintenance tooling

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.

1 participant