Skip to content

feat(tri): lean reach -- proof files the build root does not reach - #2899

Merged
gHashTag merged 5 commits into
masterfrom
w740
Aug 29, 2026
Merged

feat(tri): lean reach -- proof files the build root does not reach#2899
gHashTag merged 5 commits into
masterfrom
w740

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

A build graph is a claim about coverage that nothing prints.

lake build prints what it compiled. It never prints what it skipped, so a file
outside the graph produces no output at all — not an error, not a warning, not a
line. The only way to see the omission is to ask the root what it reaches and
compare with what exists.

$ tri lean reach
BUILD-GRAPH REACHABILITY  (proofs/lean4/Trinity.lean)

                       files    lines    sorry
  reached by the root     11     7355        1
  NOT reached             12    15553        4

Stranded -- present, shaped like proofs, compiled by nothing:
    Trinity.GoldenFloatRoundTrip                   105 lines   3 sorry
    Trinity.IcarusLowerable.Ast                     90 lines
    Trinity.IcarusLowerable.AstInduction           130 lines
    Trinity.IcarusLowerable.Completeness          4986 lines
    Trinity.IcarusLowerable.Emitter                221 lines
    Trinity.IcarusLowerable.Equivalence           2875 lines   1 sorry
    Trinity.IcarusLowerable.Lemmas                3444 lines
    Trinity.IcarusLowerable.Predicate             1005 lines
    Trinity.IcarusLowerable.Semantics              389 lines
    Trinity.IcarusLowerable.SemanticsTotal         546 lines
    Trinity.IcarusLowerable.Soundness             1641 lines
    Trinity.IcarusLowerable.Verilog                121 lines

Two corrections to #2895

Eleven was twelve. Trinity/GoldenFloatRoundTrip.lean is stranded and is not
under IcarusLowerable/. Describing the defect as "that subtree" was a narrative
that happened to fit eleven of the twelve. The general question — what does the
root reach — finds the one the description lost.

7447 was 7355. The reachable line count reported when this was found was
wrong by 93.

What it changes downstream

lean-proofs.yml counts admitted proofs by grepping the directory. The build
compiles the closure. Four of the five sorry it counts are in files nothing
opens, so the ceiling reads as "five admitted in a tree that builds" when it is
"one admitted in the part that builds, four in the part that does not" (#2898).

Refusals

The command answers 0 stranded only when that is the tree. It bails on: no
lean_lib in the lakefile, a lakefile that sets globs (the closure is then the
wrong question), a root file that does not exist, and a root that reaches only
itself — which is far more likely to mean import lines are not being read than
that the library is one file.

Mutation-checked

mutation test that fails
edges undirected — importing a reached module counts as reached a_file_nothing_imports_is_not_in_the_closure
import read at any indentation imports_are_read_only_at_column_zero
sorry matched without word boundaries sorry_is_counted_per_line_and_delimited

The first mutation is the defect's own invitation: eleven of the twelve stranded
files import each other busily, and that traffic is what makes the subtree look
connected to something.

Refs #2895
Refs #2898

Lake builds a `lean_lib` from its root module and that module's transitive
imports. `proofs/lean4/lakefile.lean` names no `globs`, so the closure is the
whole build, and `Trinity.lean` -- twelve lines, nine imports -- is the whole
specification of what compiles.

Twelve files are outside it:

                         files    lines    sorry
    reached by the root     11     7355        1
    NOT reached             12    15553        4

`lake build` prints what it compiled and never what it skipped, so a stranded
file produces no output at all: not an error, not a warning, not a line. The
omission is invisible to the only instrument pointed at it.

Two corrections to how this was described when it was found (#2895):

- It is twelve files, not eleven. `Trinity/GoldenFloatRoundTrip.lean` is
  stranded too and is not under `IcarusLowerable/`. Describing the defect as
  "that subtree" was a narrative that fit the first eleven; asking the root what
  it reaches finds the twelfth.
- The reachable half is 7355 lines, not the 7447 reported then.

It also re-populates a ratchet (#2898): `lean-proofs.yml` counts `sorry` by
grepping the directory while the build compiles the closure, and four of the
five it counts are in files nothing opens.

The command refuses rather than answering when it cannot: no `lean_lib` in the
lakefile, a lakefile that sets `globs` (which would make the closure the wrong
question), a missing root file, or a root that reaches only itself. A report of
zero stranded files has to mean the tree, never the parser.

Tests are mutation-checked. Undirecting the edges -- so that a file importing a
reached module counts as reached -- fails `a_file_nothing_imports_is_not_in_the_closure`,
which is the exact confusion the defect invites.

Refs #2895
Refs #2898
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 22:16:03 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=472b902a8cef != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 22:26:07 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 7
PRs with All Checks Green 2
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=472b902a8cef != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 22:32:03 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 7
PRs with All Checks Green 3
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=eec367a5997f != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag enabled auto-merge (squash) August 29, 2026 22:47
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 22:48:26 UTC

Summary

Status Count
Total Open PRs 11
PRs with Failing Checks 7
PRs with All Checks Green 4
READY 0
FAILING 7
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=82e020cf95b2 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 22:59:32 UTC

Summary

Status Count
Total Open PRs 10
PRs with Failing Checks 8
PRs with All Checks Green 2
READY 0
FAILING 8
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=82e020cf95b2 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag merged commit 50e4b7b into master Aug 29, 2026
28 checks passed
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