Skip to content

feat(tri): census audit says what it does not check, and why - #2947

Merged
gHashTag merged 2 commits into
masterfrom
loop/census-coverage
Aug 30, 2026
Merged

feat(tri): census audit says what it does not check, and why#2947
gHashTag merged 2 commits into
masterfrom
loop/census-coverage

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

One row added, two refused — and the refusals are the more useful half

Added: lean vacuous

The census prints 250 models, counted as def NAME : Module := {. The
counter counts theorem lines in Completeness.lean instead — a different
marker for the same population, and a real invariant (one theorem per model)
that a hand-transcribed file of 250 entries can break in either direction.

lean vacuous                 250           250   `theorem` lines in Completeness.lean

Mutation: comment out one theorem → 250 vs 249, exit 1.

Refused: types dup

The census prints 1180 struct definitions. A counter loose enough to be
independent reads 1182, and the two extra are:

specs/lsp/schema.t27:155   struct = 21,
specs/lsp/schema.t27:204   struct = 22,

Enum members named struct, which the census correctly rejects by requiring
the name to start with an ascii letter. The census is right. Any counter
accurate enough to agree with it is a copy of its matcher — the same reason
seals hollow was removed last pass.

Refused: discard classify

Its population is parser events produced at run time, not artefacts on disk.
Counting them a second way means running the same parser, which is not a second
opinion.

The pattern behind both refusals

A census whose population is defined by a matcher cannot have an
independent counter, because any counter precise enough to agree is that
matcher. Only a population defined by something external — files on disk,
workspace members, a marker in a different file — can honestly be counted
twice.

That is why the three original rows work: .t27 on disk, .rs under workspace
members, and the bare letters of a keyword.

The audit now states its own coverage

Its coverage was the same class it exists to catch — a page of green rows looks
like the whole story until somebody asks what is missing from it:

  Not checked here, and why -- because a page of green rows looks
  like coverage until somebody asks what is missing from it:

      seals hollow
          built and removed. Its counter tested json text for `"spec_path"`
          while the census parses that same field, so planting one more seal
          moved BOTH numbers to 1314 and the row stayed green. No input makes
          them disagree.

      types dup
          measured: a counter loose enough to be independent reads 1182 where
          the census reads 1180, and the two extra are `struct = 21,` -- enum
          members named `struct`, which the census correctly rejects. ...

Each exclusion carries the measurement that produced it, because otherwise a
reader cannot tell "looked and could not" from "never looked".

Tests

nothing_is_both_checked_and_excused refuses a census in both lists, and
refuses an exclusion under 60 characters — an exclusion is a measurement, not
a shrug
. Mutation-checked both ways:

mutation result
rename an exclusion to mods orphan mods orphan is listed as unchecked and also has a row · FAIL
shorten a reason to "too hard" an exclusion is a measurement, not a shrug · FAIL
comment out one theorem audit 250 vs 249 · exit 1

Checks

  • cargo test -p tri389 passed, 0 failed (was 387; two new)
  • cargo clippy --all-targets120 warnings, identical to master
  • one file changed

Refs #2864

One row added and two refused, which is the more useful half.

ADDED -- `lean vacuous` prints 250 models, counted as `def NAME : Module := {`.
The counter counts `theorem` lines in Completeness.lean instead: a different
marker for the same population, and a real invariant -- one theorem per model --
that a hand-transcribed file of 250 entries can break in either direction.
Mutation: comment out one theorem and the row reads 250 against 249, exit 1.

REFUSED -- `types dup` prints 1180 struct definitions. A counter loose enough to
be independent reads 1182, and the two extra are

    specs/lsp/schema.t27:155   struct = 21,
    specs/lsp/schema.t27:204   struct = 22,

enum members named `struct`, which the census correctly rejects by requiring the
name to start with an ascii letter. The census is right. Any counter accurate
enough to agree with it is a copy of its matcher, which is the same reason
`seals hollow` was removed last pass.

REFUSED -- `discard classify` counts parser events produced at run time, not
artefacts on disk. Counting them a second way means running the same parser.

The pattern behind both refusals is worth naming: a census whose population is
defined by a MATCHER cannot have an independent counter, because any counter
precise enough to agree IS that matcher. Only a population defined by something
external -- files on disk, workspace members, a marker in a different file --
can honestly be counted twice.

So the audit now prints what it does not check and why. Its own coverage was the
same class it exists to catch: a page of green rows looks like the whole story
until somebody asks what is missing from it. Each exclusion carries the
measurement that produced it, because otherwise a reader cannot tell "looked and
could not" from "never looked".

    lean vacuous                 250           250   `theorem` lines in Completeness.lean

    Not checked here, and why:
      seals hollow       built and removed; planting a seal moved BOTH numbers
      types dup          1182 vs 1180, and the census is right
      discard classify   run-time events, not artefacts

A test refuses a census that appears in both lists, and refuses an exclusion
shorter than 60 characters -- an exclusion is a measurement, not a shrug. Both
mutation-checked.

  cargo test -p tri   389 passed, 0 failed   (was 387; two new)
  cargo clippy        120 warnings, same as master

Refs #2864
@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-30 13:40:06 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)=4d74b20cbd04 != 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).

…ed twice; an exclusion is a measurement (Refs #2864)
@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-30 13:40:45 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)=4d74b20cbd04 != 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).

@gHashTag
gHashTag merged commit 20335e0 into master Aug 30, 2026
35 checks passed
@gHashTag
gHashTag deleted the loop/census-coverage branch August 30, 2026 13:51
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