Skip to content

ci: cache per-project validation and defer full docs - #534

Merged
Vilin97 merged 1 commit into
mainfrom
fix/ci-project-validation-cache
Sep 26, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
fix/ci-project-validation-cache

Conversation

@Vilin97

@Vilin97 Vilin97 commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep the required Documentation preflight on pull requests while running full exposition and doc-gen only on main or an explicit dispatch preview
  • cache successful lint, declaration, axiom, and option-backdoor validation per owned project unit using source, transitive import, dependency, and checker fingerprints
  • keep global static checks, text style checks, and Challenge/Solution validation unconditional
  • avoid packaging the large documentation artifact on ordinary pull requests

Validation

  • uv sync --locked --group dev --group test
  • ruff check .
  • ruff format --check .
  • pytest — 476 passed
  • Actionlint 1.7.7 on all three edited workflows
  • prior post-rebase macOS validation: real Lean CramerWold and Basic builds; cold/warm cache smoke; negative lint, axiom, and backdoor tests

This is an infrastructure-only change. The exact tested head is efd08b6064b0b82908f18c559c6bc4936722cb6c.

@Vilin97
Vilin97 merged commit 6a77eb9 into main Sep 26, 2026
8 of 10 checks passed
@greptile-apps

greptile-apps Bot commented Sep 26, 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 validation caching to CI and changes documentation job scheduling.

The PR should not merge until the workflow-condition test stops evaluating PR-controlled text as Python code.

Findings

  1. P1 Security PR-controlled condition reaches eval ▶
  2. P2 Replacement linter lacks integration coverage ▶

Summary

The PR defers full documentation generation on ordinary pull requests and adds per-unit cached Lean validation while retaining static, style, and Challenge/Solution checks.

  • Full documentation can be requested through a dispatch preview; PRs retain documentation preflight.
  • Successful lint and quality receipts are fingerprinted and reused after compilation.
  • The new workflow-condition test evaluates PR-controlled text as Python code.

Reviews (1) · Last reviewed commit: "Reuse project validation and generate fu..."

Comment on lines +55 to +59
return eval(
expression.replace("&&", " and ").replace("||", " or "),
{"__builtins__": {}},
{},
)

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 security PR-controlled condition reaches eval
A pull request that edits docs.yml triggers Python CI, where this test reads the PR's job condition and passes it to eval. Replacing four names and clearing __builtins__ does not make that expression safe: a crafted condition can execute code on the test runner before an assertion fails. Parse the limited condition syntax instead.

How this was verified: The test passes if: text from the checked-out docs.yml to eval, and edits to that workflow trigger the pytest job.

Comment on lines +142 to +151
"""Cold and warm checks preserve complete axiom/backdoor coverage."""
cache = ValidationCache(repository, repository / ".lake/validation-cache/v1")
with (
patch("lean_pool.quality._audit_axioms", return_value=[]) as axioms,
patch("lean_pool.quality._run_option_audit", return_value=[]) as backdoors,
):
assert _cached_pool_audits(repository, cache) == []
assert [call.args[2] for call in axioms.call_args_list] == pool_units(
repository
)

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 Replacement linter lacks integration coverage
These cache tests mock the axiom and backdoor audits but never run the new Lean declaration linter, which CI now uses instead of runLinter LeanPool. A regression in declaration selection or linter invocation could leave lint coverage missing while the Python tests stay green. Add a small compiled Lean fixture that exercises both a passing declaration and a rejected finding through the new command.

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!

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