Skip to content

fix(pv): proof_status Lean scan reads tokens — doc-comment 'sorry' and Theorems.<Domain>.<File> no longer deny credit (#4351) - #4535

Closed
noahgift wants to merge 6 commits into
mainfrom
91/4351-on-main
Closed

noahgift wants to merge 6 commits into
mainfrom
91/4351-on-main

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Closes #4351

pv's proof_status Lean scan used a plain substring match for sorry. It refused credit to sorry-free theorems when a doc comment or string said "sorry", or when the theorem was cited in the Theorems.<Domain>.<File> form.

What changes (crates/aprender-contracts/src/proof_status.rs)

  • lean_has_sorry reads Lean tokens:
    • skips line comments, nested block comments, strings and char literals;
    • treats identifiers such as sorry_free as names, not the sorry term;
    • fails closed: an unterminated comment or string counts as sorry.
  • The Theorems.<Domain>.<File> citation now resolves to its file.
  • Quorum fix: a char literal like '"' no longer opens a phantom string that hid a real sorry.

The two fix commits come from origin/GH-4351-lean-scan-false-negatives, cherry-picked onto main unchanged.

Measured (main 761d624 + this branch)

Check Result
cargo test -p aprender-contracts --lib proof_status 61/61 pass
clippy -D warnings / fmt --check clean
Mutant: lean_has_sorry → src.contains("sorry") RED: 2 failed (lean_has_sorry_case_table, lean_scan_grounds_comment_sorry_file_and_dotted_form); restored, tree clean

Quorum: 3/3 PASS on eaa2d3b (docs/audits/quorum-GH-4351.json). Degraded same-family: sonnet-5 ×2 + haiku-4-5. agy was withheld by policy because this diff is not tier-1. The author (opus-5-5) sat on no lane.

🤖 Generated with Claude Code

@noahgift
noahgift enabled auto-merge September 27, 2026 10:51
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=4535 head=dec5eb9661f164042a3c1cfd017b0ebd5c97b961 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

noahgift and others added 4 commits September 27, 2026 15:19
…denied credit to sorry-free theorems (#4351)

insert_domain_theorems skipped any file whose text contained "sorry",
including prose ("compiles sorry-free"), and never registered the dotted
Theorems.<Domain>.<File> name that equations cite. Both failed closed:
real proofs were denied, no false credit granted.

lean_has_sorry now matches `sorry` as an identifier outside -- and nested
/- -/ comments and strings, and fails closed on an unterminated one.

pv proof-status contracts/: 70 -> 77 of 181 lean claims grounded;
self-declared stays 27 (equation-only L4 rule, see #3141 audit §3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 7c128ef)
…eal sorry (#4351 quorum)

Both quorum lanes (sonnet, haiku) found it; sonnet showed the false-credit
case '"' sorry '"'. A prime now skips a well-formed char literal (one char,
or an escape whose digits are hex only, so no body can spell sorry). Any
other prime is term syntax (xs[i]'h, used in the tree) and is skipped
alone. A first try that treated every token-start prime as a literal and
failed closed took pv from 77 to 73 grounded on real files.

pv proof-status contracts/: 77 of 181 grounded, 27 self-declared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9115804)
Closes #4351

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…agy withheld, not tier-1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift noahgift added the owner:aprender-91 owning session (cop inbox claims) label Sep 27, 2026
@noahgift

Copy link
Copy Markdown
Contributor Author

Moved into #4608 (PRCAP fold, cop order 14:02Z). Fold = MOVE: head dec5eb9661f164042a3c1cfd017b0ebd5c97b961 is an ancestor of the pushed fold head, so no work is lost. The branch is kept. Agent: aprender-59

@noahgift noahgift closed this Sep 28, 2026
auto-merge was automatically disabled September 28, 2026 14:24

Pull request was closed

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

Labels

owner:aprender-91 owning session (cop inbox claims)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant