Skip to content

Reuse validated project builds after mechanical PR rebases - #545

Merged
Vilin97 merged 1 commit into
mainfrom
codex/rebase-fastpath
Sep 28, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
codex/rebase-fastpath

Conversation

@Vilin97

@Vilin97 Vilin97 commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

When the auto-rebase bot merges a newly accepted project into an already green import PR, the PR currently recompiles and revalidates its unchanged project. This adds a verified rebase path: it confirms the prior successful run and unchanged PR-owned sources and project card, restores the PR's compiled modules, overlays the current main build (or the newly merged project's artifact while that cache warms), builds the combined LeanPool root, and runs static repository checks. If eligibility or artifact restoration fails, normal CI runs. Documentation preflight can likewise check the regenerated root without downloading Mathlib after a verified rebase. Merges to main keep the full validation path.

PR builds now retain a small project-scoped artifact for later rebases; existing open PRs need one normal run to seed it.

Validation: 500 Python tests; Ruff lint and format; actionlint; generated-index check; static repository quality check; local Lean artifact-restore/root-build smoke test; eligibility checked against a real rebased PR history.

@greptile-apps

greptile-apps Bot commented Sep 28, 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] CI workflow adds GitHub API calls and reuses cached builds.

The PR should not merge until its changes to required checks and gates satisfy the repository instruction.

Findings

  1. P1 Required checks are skipped ▶
  2. P2 Nested artifacts lack coverage ▶

Summary

The PR adds a conditional rebase job that reuses a previously validated PR project build, overlays available main-build artifacts, and builds the combined Lean root. It also adds artifact packaging, a documentation-preflight shortcut, and static-only quality checking.

Reviews (1) · Last reviewed commit: "ci: reuse validated PR builds after mech..."

Comment on lines +1977 to +1981
errors = run_checks(
root,
skip_lean_axioms=args.skip_lean_axioms or args.static_only,
skip_project_declarations=args.static_only,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Required checks are skipped

When artifact restoration succeeds, the rebase workflow runs --static-only instead of its ordinary lint and quality sequence. This flag skips project-declaration and axiom checks, so the rebase gate can pass without running checks required by the normal path. The repository instruction says not to change checks or gates unless explicitly asked. Preserve those checks or obtain an explicit exception before merging.

Context Used: CLAUDE.md (source)

Comment on lines +271 to +288
def test_project_archive_contains_only_pr_module(
rebased: tuple[Path, str, str, str, str], tmp_path: Path
) -> None:
"""The reusable artifact excludes the rest of the large pool build."""
root, _, _, base, head = rebased
for project in ("A", "B", "C"):
path = root / ".lake/build/lib/lean/LeanPool" / f"{project}.olean"
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(project)
archive_path = tmp_path / "build.tar.gz"
rebase_fastpath.pack(root, base, head, archive_path)
with tarfile.open(archive_path, "r:gz") as archive:
names = archive.getnames()
manifest = json.load(archive.extractfile(rebase_fastpath.MANIFEST))
assert manifest["projects"] == ["B"]
assert ".lake/build/lib/lean/LeanPool/B.olean" in names
assert ".lake/build/lib/lean/LeanPool/A.olean" not in names
assert ".lake/build/lib/lean/LeanPool/C.olean" not in names

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 Nested artifacts lack coverage

This archive test uses only a single-file project, but the packer also collects compiled files from projects with nested modules. Without a nested-project pack-and-restore test covering its library and IR outputs, a regression that omits those files could go unnoticed and force expensive recompilation after rebases.

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!

@Vilin97
Vilin97 merged commit 18c1bab into main Sep 28, 2026
21 of 22 checks passed
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