Skip to content

proof_status Lean scan: 'sorry' in a doc comment, and the domain.file citation form, deny credit to sorry-free theorems #4351

Closed as not planned

Description

@noahgift

Found while measuring #3141 (receipt: docs/audits/rust-lean-fidelity-PMAT-3141.md on branch GH-3141-lean-gen-drift). Both fail CLOSED (real proofs are denied, nothing false is granted).

  1. insert_domain_theorems (crates/aprender-contracts/src/proof_status.rs) skips any file where content.contains("sorry"). Theorems/TensorTranspose/Roundtrip.lean has no sorry tactic; line 17 is a doc comment: "compiles sorry-free". Its theorems (transpose_shape, roundtrip_preserves_element, shape_transpose_involution, swapIdx_injective) contribute nothing.
  2. Theorems.GgufExportSymmetry.Roundtrip (the domain.file form, apr-gguf-export-symmetry-v1.yaml:44) is never registered: the scan inserts Theorems.GgufExportSymmetry and Theorems.Roundtrip, not the dotted pair.

A fix needs a sorry TOKEN match outside -- and /- -/ comments, a registered Theorems.<Domain>.<Stem> form, and a case table (a comment-only sorry must ground; a real sorry and a sorry in a string or a nested comment must not). Neither fix alone flips a contract to L4: grounding is equation-level (27 self-declared, 70/181 grounded). Whether obligation-level lean.theorem citations should also ground is an ONT-2a design question, owned by ONT.

Activity

  1. added this to the 0.70.1 milestone on Sep 25, 2026
  2. noahgift commented on Sep 25, 2026

    @noahgift
    ContributorAuthor

    Implemented on branch PMAT-4351-lean-sorry-token @ 8b5bf61 (off batch/0.70.0; no PR — repo at the 10-PR cap, for the apr-fold batch). aprender-a2.

    • lean_has_sorry: the sorry token outside -- and nested /- -/ comments. Fails closed: a sorry in a string literal still counts, and EOF inside a comment or string counts. String and char literals are skipped only so "--" / '"' cannot open a fake comment.
    • insert_domain_theorems registers Theorems.<Domain>.<Stem> (the apr-gguf-export-symmetry-v1.yaml:44 form).
    • Case table: 19 rows. An in-tree test pins the 3 files whose only sorry is a doc comment (TensorTranspose/Roundtrip, Metrics/RegressionAnalytic, AbsolutePosition/Core).
    • Mutation: 5/5 killed (byte-level contains, no domain.file insert, EOF-in-string open, no nesting, no string skip).
    • Tests: aprender-contracts --lib 1775 pass; the contracts-cli proof-level targets pass (151 across 9 targets); clippy -D warnings clean.

    Obligation-level lean.theorem grounding stays with ONT-2a, as the issue says.

  3. added 10 commits that reference this issue on Sep 25, 2026
  4. modified the milestones: 0.70.1, 0.71.0 on Oct 4, 2026
  5. noahgift commented on Oct 12, 2026

    @noahgift
    ContributorAuthor

    evidence for close: checked at main 6bd89b0: lean_has_sorry in crates/aprender-contracts/src/proof_status.rs grounds the sorry scan, the Theorems.{domain}.{stem} form is registered, and lean_scan_grounds_doc_comment_sorry_and_domain_file_form in proof_status_tests.rs pins both.

  6. noahgift commented on Oct 14, 2026

    @noahgift
    ContributorAuthor

    Folded into #5308 as a checklist row (TRIAGE-100, 2026-10-14): the open-ticket cap is 100, so this ticket is now tracked on that master and closed as not planned. Nothing is lost: reopen it when its work resumes, and an open PR for it reopens it. Pushed branch: 91/4351-on-r5a, GH-4351-lean-scan-false-negatives.

    Agent: aprender-clerk

  7. noahgift commented on Oct 14, 2026

    @noahgift
    ContributorAuthor

    Row moved: #5308 was split into named masters (TRIAGE-100 master naming), so this ticket's checklist row is now on #5333.

    Agent: aprender-clerk

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions