Skip to content

fix(tri): every ledger is now audited or excused with a measurement - #2956

Merged
gHashTag merged 7 commits into
masterfrom
loop/ledger-classify
Aug 30, 2026
Merged

fix(tri): every ledger is now audited or excused with a measurement#2956
gHashTag merged 7 commits into
masterfrom
loop/ledger-classify

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Every ledger-shaped file is now audited or excused with a measurement

Last pass the meta-gate covered 5 of 15 and printed eight as
NOT YET CLASSIFIED. All eight now carry a measurement, and four entered the
audit:

ledger-shaped files on disk   15   planted into 9, excused 6, unclassified 0

Extending it found a live defect

check_json_parses.py only ever subtracted its baseline from the current
bad set:

new_bad = [(r, w) for r, w in bad if r not in known]

so an entry naming a file that now parses was never looked at.
tri ledgers audit planted a line naming a file it had just parsed, and the
gate stayed green.

Fixed with the idiom check_specs_generate.py already uses, and for the same
stated reason — two classes, both failing:

class meaning
DEPARTED the file left the tracked set. It did not start parsing, and reading its removal as progress is how a count improves by subtraction.
FIXED still tracked, no longer bad. The line must go.

And that turned the gate red on a clean tree

Six entries named files in neither git nor the working tree — five under
.trinity/icarus-baselines/specs/scratch/, plus research/toda_derivation.json.
The scan finds zero unparseable and zero empty tracked JSON files today,
so the whole ledger was debt about things that had already left.

Emptied, with the measurement written into the file. The gate now holds the line
at zero: any unparseable JSON fails, with no slack to hide in.

OK: 2077 tracked JSON files, none newly unparseable (0 known, ...)

Four new ledgers, each proven to catch before being added

caught  tools/devhome_baseline.txt      by tools/check_devhome_paths.py
caught  tools/elab_baseline.txt         by tools/check_elab_ratchet.py
caught  tools/json_parse_baseline.txt   by tools/check_json_parses.py
caught  tools/vector_data_baseline.txt  by tools/check_vector_data.py

Their plants are false by construction in two different ways — a runtime
lookup ({spec}, and a new {json} resolved to a tracked file that parses
today), or a synthetic name that cannot exist. A test asserts the synthetic
name occurs nowhere else in the tree; without it a hardcoded plant rots into a
line that is true and the audit quietly stops testing that ledger.

Six exclusions, each carrying what was measured

  • type_conflicts.json carries generated_by and is regenerated by
    tri types dup — an observation, not a ledger of claims. A planted line
    survives only until the next regeneration erases it.
  • type_conflicts_classified.json catches: a cloned row renamed
    PlantedByAudit gives tri types classified exit 1,
    STALE PlantedByAudit: classified, but no longer conflicting. Not planted
    into because the plant must clone a row's field shape, which Plant cannot
    express — and an ill-shaped plant would fail the gate on its shape, a
    catch for the wrong reason.
  • lean_completeness_mismatches.json: a planted entry leaves
    tri lean vacuous at exit 0 both ways. It reports and does not gate.
  • gen_verilog_smoke_baseline.json and suite_expectations.json are
    read by the corpus suite — minutes per run, and a meta-gate nobody runs before
    committing is not a meta-gate.
  • withdrawn_live_baseline.txt is keyed by the sha1 of the line it excuses.

Also mine

The first version of the synthetic-name test ran git grep from the crate
directory
while excluding a repository-root path, so the exclusion matched
nothing and the test failed on its own source. A pathspec resolves against the
current directory.

Checks

  • cargo test -p tri392 passed, 0 failed (was 391; two new, two rewritten)
  • cargo clippy --all-targets120 warnings, identical to master
  • tri ledgers audit — 9 caught, 0 missed, exit 0
  • python3 tools/check_json_parses.py — exit 0; planting a parsing file → FAIL; planting an absent name → DEPARTED

Refs #2864

Last pass the meta-gate covered 5 of 15 ledger-shaped files and printed eight as
"NOT YET CLASSIFIED". All eight now carry a measurement, and four entered the
audit.

    ledger-shaped files on disk   15   planted into 9, excused 6, unclassified 0

EXTENDING IT FOUND A LIVE DEFECT. `check_json_parses.py` only ever SUBTRACTED
its baseline from the current bad set:

    new_bad = [(r, w) for r, w in bad if r not in known]

so an entry naming a file that now PARSES was never looked at. `tri ledgers
audit` planted a line naming a file it had just parsed, and the gate stayed
green. Fixed with the idiom `check_specs_generate.py` already uses, and for the
same stated reason -- two classes, both failing:

  * DEPARTED -- the file left the tracked set. It did not start parsing, and
    reading its removal as progress is how a count improves by subtraction.
  * FIXED    -- still tracked, no longer bad. The line must go.

That turned the gate red on a clean tree: SIX entries naming files in neither
git nor the working tree, five under `.trinity/icarus-baselines/specs/scratch/`
and `research/toda_derivation.json`. The scan finds ZERO unparseable and ZERO
empty tracked JSON files today, so the whole ledger was debt about things that
had already left. Emptied, with the measurement written into the file: the gate
now holds the line at zero and any unparseable JSON fails, with no slack.

FOUR NEW LEDGERS, each proven to catch before being added:

    caught  tools/devhome_baseline.txt      by tools/check_devhome_paths.py
    caught  tools/elab_baseline.txt         by tools/check_elab_ratchet.py
    caught  tools/json_parse_baseline.txt   by tools/check_json_parses.py
    caught  tools/vector_data_baseline.txt  by tools/check_vector_data.py

Their plants are false by construction in two different ways: a RUNTIME lookup
(`{spec}`, and a new `{json}` resolved to a tracked file that parses today), or
a SYNTHETIC name that cannot exist. A test asserts the synthetic name occurs
nowhere else in the tree -- without that, a hardcoded plant rots into a line
that is TRUE and the audit quietly stops testing that ledger.

SIX EXCLUSIONS, each carrying what was measured rather than a shrug:

  * type_conflicts.json carries `generated_by` and is regenerated by `tri types
    dup` -- an observation, not a ledger of claims. A planted line survives
    until the next regeneration erases it.
  * type_conflicts_classified.json CATCHES: a cloned row renamed PlantedByAudit
    gives `tri types classified` exit 1, `STALE PlantedByAudit: classified, but
    no longer conflicting`. Not planted into because the plant must clone a
    row's field shape, which `Plant` cannot express -- and an ill-shaped plant
    would fail the gate on its SHAPE, a catch for the wrong reason.
  * lean_completeness_mismatches.json: a planted entry leaves `tri lean vacuous`
    at exit 0 both ways. It reports and does not gate.
  * gen_verilog_smoke_baseline.json and suite_expectations.json are read by the
    corpus suite -- minutes per run, and a meta-gate nobody runs before
    committing is not a meta-gate.
  * withdrawn_live_baseline.txt is keyed by sha1 of the line it excuses.

Also mine: the first version of the synthetic-name test ran `git grep` from the
crate directory while excluding a repository-root path, so the exclusion matched
nothing and the test failed on its own source. A pathspec resolves against the
current directory.

  cargo test -p tri   392 passed, 0 failed   (was 391; two new, two rewritten)
  cargo clippy        120 warnings, same as master
  tri ledgers audit   9 caught, 0 missed, exit 0

Refs #2864
… ways to be false by construction; a pathspec resolves against cwd (Refs #2864)
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 15:04: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)=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.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 15:04:28 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)=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.

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-30 15:09:33 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)=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.

@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 15:36:11 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)=4d82ec850541 != 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-30 15:36:31 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)=4d82ec850541 != 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-30 15:47:14 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)=4d82ec850541 != 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 25255e2 into master Aug 30, 2026
36 checks passed
@gHashTag
gHashTag deleted the loop/ledger-classify branch August 30, 2026 15:56
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