Skip to content

Add human sign-off tooling - #6212

Draft
patrl wants to merge 7 commits into
linglib-community:mainfrom
patrl:human-review-status
Draft

patrl wants to merge 7 commits into
linglib-community:mainfrom
patrl:human-review-status

Conversation

@patrl

@patrl patrl commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

It is important to introduce some tooling to indicate which Lean statements have been explicitly checked by a human relative to their source (see #6209).

This PR sketches one way in which this might work: Lean statements are signed off by a human; sources are associated with a TOML inventory of their claims, together with the corresponding Lean code. A human sign-off records a hash of the declaration's statement closure while excluding proofs - the intent here is that a claim is only signed off if the lean statement has been checked relative to the source by a domain expert.

Some design principles:

  • There's a one to one relationship between files in the registry and papers; practically speaking, a domain expert is going to want to check every formalized claim from a given paper, even if the corresponding claims are spread out across lean files.
  • It should be possible to use the registry to extract a buildable, verified core of linglib.
  • Dependencies between claims are inferred, not declared: claim A depends on claim B when one of B's declarations occurs in A's statement closure. A claim can be signed while a claim it depends on is unchecked, but it only counts as fully checked once every claim it depends on has been checked (stopping at mathlib).

What's here

  • checks/<bib-key>.toml, one per source: its claims (with the source's own labels), the declarations stating each, how they relate to the claim (exact, generalizes, specializes, variant, missing), and the sign-offs. checks/README.md documents the format.
  • lake exe checkClosure: computes statement closures from the elaborated terms (types, plus the bodies of project definitions they use, never proofs), and the axioms each declaration rests on.
  • scripts/checks.py:
    • status: each claim is checked, relies (signed, but depends on an unchecked claim), stale (its statement closure has changed since the sign-off), unchecked, missing, broken (a declaration doesn't resolve) or unproved (rests on sorry or an axiom beyond propext/Classical.choice/Quot.sound, including native_decide's).
    • diff: what changed since a claim was signed.
    • sign: records a sign-off with the closure's hash; refuses to run inside an agent session.
    • core: the reviewed core, i.e. the declarations of the checked claims and the definitions their statements use. Since a claim is only checked if the claims it depends on are, nothing in the core depends for its meaning on anything outside it. (Extracting it as a buildable artifact, e.g. by exporting the full constant closure and re-checking it with an independent kernel, is left for later.)
    • status --json: every claim and its latest sign-off, for the docs pages.
  • Docs pages: under each declaration stating a checked, relying or stale claim, one line in the style of "Used by", e.g. Checked against George 2014, Definition 23 (a variant) by patrl on 3 November 2026, or that its statement has changed since the sign-off (with a link to the diff). docs.yml exports the checks before composing the site.

No source has a check file yet; the George (2014) record follows once #6211 lands.

(This is a big, and important feature, and probably warrants further discussion before settling on a design. Maybe an RFC process would be helpful.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@patrl patrl mentioned this pull request Nov 3, 2026
patrl and others added 2 commits November 3, 2026 15:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`checkClosure` reports the axioms each declaration rests on. A claim whose
declarations rest on `sorry` or a nonstandard axiom (including the one
`native_decide` adds) is `unproved`, whatever its sign-off. `checks.py core`
lists the declarations of the checked claims and the definitions their
statements use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@patrl
patrl force-pushed the human-review-status branch from 533da8b to b1784b3 Compare November 3, 2026 17:22
patrl and others added 4 commits November 3, 2026 18:28
`checks.py status --json` exports every claim with its status and newest
sign-off. `gen_docs_pages.py --checks` reads it and writes, below each
declaration stating a claim, a line saying who checked it against which
claim of the source, or that its statement has changed since, or which
unchecked claim it relies on. The docs workflow exports the checks before
composing the site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`checks.py status` now exits non-zero when a claim's declaration does not
resolve, and CI runs it after the build, so a rename or removal that leaves
a check file behind fails the PR that made it. Stale claims do not fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 0bbdd4c.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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