Skip to content

Bind formalized Lean targets to built artifacts in CI #119

Description

@Deicyde

Problem

Autoform resolves lean: names lexically across every .lean file, including declarations after #exit and modules outside the default Lake target. Generated verification CI builds and kernel-audits only the default target's artifact closure. A formalized article can therefore name an orphan, unbuilt, stale, or unsafe declaration and still pass CI.

This is G6 + G8 from #92's adversarial review. Formalize's instruction to import new modules mitigates accidents but does not establish machine-checked authority.

Existing work

Acceptance criteria

  • Generated CI passes every formalized local target and expected declaration kind to a post-clean, kernel-backed audit.
  • Verification rejects a lean: target absent from the built root package, outside the trusted/default artifact closure, of the wrong kind, or backed by stale artifacts.
  • The lexical index stops recognizing declarations after top-level #exit.
  • An orphan module containing sorry or a new axiom fails Autoform verification even when the default lake build succeeds.
  • Existing Mathlib/external targets retain an explicit, tested policy.
  • Templates, bundled example, CLI diagnostics, and real-Lean CI exercise the same contract.

Carry-forward from #145

The refreshed implementation must preserve canonical root-module artifact lookup; exact packed/live .ilean, .olean, and .trace binding; complete retained project inputs including arbitrary non-Lean payloads and package overrides; root/dependency module-shadow defense; and primary-versus-supporting target semantics. It must also reject committed/prebuilt artifacts before rebuilding, bind .olean.private and .olean.server companions, preserve current open/retracted-statement semantics, and run real-Lake CI. Land #156 first and rebuild this gate as smaller current-main PRs. #167 owns isolation from project-controlled probe code; #160 is the downstream Mathlib-provenance layer.

Activity

  1. Deicyde commented on Oct 6, 2026

    @Deicyde
    ContributorAuthor

    Refreshed implementation note from draft #145: the replacement gate must preserve its unique useful layer—canonical root-module artifact lookup, exact packed/live .ilean/.olean/.trace binding, complete retained project inputs (including arbitrary non-Lean payloads and package overrides), root/dependency module-shadow defense, and primary-versus-supporting target semantics. It must additionally reject committed/prebuilt artifacts before rebuilding, bind .olean.private/.olean.server companions, preserve current open/retracted-statement semantics, and run real-Lake CI. Land #156 first; rebuild this gate in smaller current-main PRs rather than conflict-resolving #145. Probe isolation from project-controlled code is the separate #167 boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions