Skip to content

fix(tri): the meta-gate over the ledgers had gone stale by my own addition - #2950

Merged
gHashTag merged 2 commits into
masterfrom
loop/ledger-scope
Aug 30, 2026
Merged

fix(tri): the meta-gate over the ledgers had gone stale by my own addition#2950
gHashTag merged 2 commits into
masterfrom
loop/ledger-scope

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

The meta-gate over the ledgers had gone stale by my own addition

tri ledgers audit plants a false entry in each ledger and demands the gate
fail. Its list of ledgers was hardcoded at four.

Two passes ago I added a ledger — docs/reports/orphan_modules.json, the
orphan ceilings from #2941 — and
did not add it to the audit. A guard written as a list, gone stale by addition,
and this time the addition was mine.

Adding it needed two shapes the audit did not have

A gate that is a tri subcommand, not a python script.

A plant that leaves the file valid. Appending a line to a JSON ledger makes
the gate fail because the file no longer parses — a catch for the wrong
reason, which is a control reporting success without measuring anything. The
planted entry is a ceiling for a crate the workspace does not declare: valid
JSON, false claim.

Planting it exposed a second live defect

mods orphan --gate iterates the crates and looks up each one's ceiling, so a
ceiling for a crate that does not exist was never visited and sat in the
ledger unmentioned:

before:  "cli/planted": 0  added →  ORPHAN CEILING: CLEAN   exit 0
after:   ::error::cli/planted: has a ceiling but is not a workspace member ...  exit 1

The ledger's own _rule is "exact match, not an upper bound". A ghost entry
is slack in the other direction, and slack is where the next one hides.

Historical control

Revert only the gate fix, keep the ledger in the audit:

MISSED    docs/reports/orphan_modules.json  <- a stale entry here exits 0
stale entry MISSED 1                                                exit 1

With the fix: caught docs/reports/orphan_modules.json by tri mods orphan --gate.

Self-correction, and the bigger half

I opened this saying the audit covered four of seven ledgers. Counting from
disk says fifteen — nine tools/*baseline*.txt and six
docs/reports/*.json. My seven was a sample taken from memory while chasing
something else: this repository's own lesson about counts, applied to me.

So the audit no longer holds a list of what exists. It enumerates from the tree:

  ledger-shaped files on disk   15   planted into 5, excused 2, unclassified 8

      excused   docs/reports/suite_expectations.json
                its gate is the corpus ratchet, which compiles every spec ...
      excused   tools/withdrawn_live_baseline.txt
                entries are keyed by the sha1 of the line they excuse ...

      NOT YET CLASSIFIED -- neither planted into nor measured and
      excused. A work list, not a verdict.
          docs/reports/gen_verilog_smoke_baseline.json
          docs/reports/lean_completeness_mismatches.json
          docs/reports/type_conflicts.json
          docs/reports/type_conflicts_classified.json
          tools/devhome_baseline.txt
          tools/elab_baseline.txt
          tools/json_parse_baseline.txt
          tools/vector_data_baseline.txt

An enumeration read from the tree cannot go stale by addition — which is the
defect this meta-gate exists to catch, in the meta-gate.

The output also names the gate that caught each plant. "caught" alone says a
stale entry fails something, and which one is the next reader's question.

Tests, mutation-checked

mutation result
a ledger in both the planted and excused lists tools/seal_baseline.txt is excused and also planted into · FAIL
break the disk walk the walk found 6 ledger-shaped files, which is fewer than this repository carries · FAIL
revert the ghost-ceiling gate fix audit reports MISSED, exit 1
plant a ghost ceiling by hand gate exit 1, naming the crate

The three pre-existing tests were updated rather than dropped: one ledger no
longer has a {spec} template, so the JSON plant is asserted on the property
that matters instead — the planted file must still parse.

Checks

  • cargo test -p tri391 passed, 0 failed (was 389; two new)
  • cargo clippy --all-targets120 warnings, identical to master
  • tri ledgers audit · tri mods orphan --gate · tri census audit — all exit 0

Refs #2864

…ition

`tri ledgers audit` plants a false entry in each ledger and demands the gate
fail. Its list of ledgers was hardcoded at four.

Two passes ago I ADDED a ledger -- `docs/reports/orphan_modules.json`, the
orphan ceilings -- and did not add it to the audit. A guard written as a list,
gone stale by addition, and this time the addition was mine.

Adding it needed the audit to learn two shapes:

  * a gate that is a `tri` subcommand rather than a python script, and
  * a plant that leaves the file VALID. Appending a line to a JSON ledger makes
    the gate fail because the file no longer PARSES -- a catch for the wrong
    reason, which is a control reporting success without measuring anything.
    The planted entry is a ceiling for a crate the workspace does not declare:
    valid JSON, false claim.

Planting that exposed a second live defect. `mods orphan --gate` iterates the
crates and looks up each one's ceiling, so a ceiling for a crate that does NOT
exist was never visited and sat in the ledger unmentioned. The ledger's own rule
is "exact match, not an upper bound"; a ghost entry is slack in the other
direction, and slack is where the next one hides. The gate now fails on it.

Historical control -- revert only the gate fix, keep the ledger in the audit:

    MISSED    docs/reports/orphan_modules.json  <- a stale entry here exits 0
    stale entry MISSED 1                                            exit 1

and with the fix, `caught ... by tri mods orphan --gate`, exit 0.

SELF-CORRECTION, and the bigger half. I opened this saying the audit covered
four of seven ledgers. Counting from DISK says fifteen: nine
`tools/*baseline*.txt` and six `docs/reports/*.json`. My seven was a sample
taken from memory while chasing something else -- this repository's own lesson
about counts, applied to me.

So the audit no longer holds a list of what exists. It enumerates ledger-shaped
files from the tree:

    ledger-shaped files on disk   15   planted into 5, excused 2, unclassified 8

The two excused carry the measurement that excuses them (the corpus ratchet is
too slow to plant into before a commit; a sha1-keyed ledger cannot be given a
planted entry that is false by construction). The eight are named as a work
list, not a verdict -- a meta-gate that prints only what it covers reads as
coverage.

An enumeration read from the tree cannot go stale by addition, which is the
defect this meta-gate exists to catch, in the meta-gate.

  cargo test -p tri   391 passed, 0 failed   (was 389; 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 14:25:52 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 8
PRs with All Checks Green 1
READY 0
FAILING 8
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).

… the wrong reason; a remembered count is a sample (Refs #2864)
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 14:26:17 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 8
PRs with All Checks Green 1
READY 0
FAILING 8
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).

@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 fcf55be into master Aug 30, 2026
35 checks passed
@gHashTag
gHashTag deleted the loop/ledger-scope branch August 30, 2026 14:36
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