Skip to content

fix(test): 18 compute-ring invariants were never run (undeclared test target) - #376

Merged
gHashTag merged 1 commit into
mainfrom
fix/dead-test-target-compute-ring
Aug 9, 2026
Merged

fix(test): 18 compute-ring invariants were never run (undeclared test target)#376
gHashTag merged 1 commit into
mainfrom
fix/dead-test-target-compute-ring

Conversation

@gHashTag

@gHashTag gHashTag commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Continuing the negative audit — cargo test was the last unproven gate. Injecting a failing test into tests/ did not redden it: the file was never compiled.

Root cause

Cargo.toml sets autotests = false, so a test file runs only with an explicit [[test]] block. tests/compute_ring_invariants.rs had none. Its own header explains why it exists:

The specs' own test blocks are only PARSED + TYPECHECKED by t27c … This file re-runs the load-bearing invariants under cargo test, so a regression that silently reverts a hardened gate … is caught by committed CI.

The file written to close a verification gap was itself never executed. 18 tests covering burn conservation, slash/finalize ordering, verifier accountability and width binding looked like CI coverage and were dead.

What it took to enable

The test includes ten gen/rust modules by #[path]; every spec existed but no gen was committed. Generated all ten (rustfmt-normalized, byte-exact vs t27c). They auto-join the dynamic rust drift leg (#366); its floor moves 86 → 96.

The mod attributes used #[allow(dead_code, unused_parens)], which does not cover clippy::double_parens, so clippy --all-targets -D warnings failed on the generated parens. Switched to #[allow(clippy::all, unused)] — the incantation src/lib.rs already uses for the same gens.

Structural guard

Every tests/*.rs must be declared in Cargo.toml, or the gate fails and names the file. With autotests = false this is the only thing standing between a new test file and silent death.

Verified

  • 18/18 invariants pass; full cargo test exits 0
  • cargo fmt --all --check and clippy --all-targets -D warnings both clean
  • zero drift on the ten new gens
  • the guard catches an undeclared probe file (and passes on the clean tree)

🤖 Generated with Claude Code

… target)

Continuing the negative audit: cargo test was the last unproven gate.
Injecting a failing test into tests/ did NOT redden it -- the file was
never compiled.

Cargo.toml sets 'autotests = false', so a test file runs ONLY with an
explicit [[test]] block. tests/compute_ring_invariants.rs had none. Its
own header explains why it exists:

  'The specs' own test blocks are only PARSED + TYPECHECKED by t27c ...
   This file re-runs the load-bearing invariants under cargo test, so a
   regression that silently reverts a hardened gate ... is caught by
   committed CI.'

The file written to close a verification gap was itself never executed:
18 tests covering burn conservation, slash/finalize ordering, verifier
accountability and width binding looked like CI coverage and were dead.

Enabling it needed the ten gen/rust modules it includes by #[path];
every spec existed but no gen was committed. Generated all ten
(rustfmt-normalized, byte-exact vs t27c). They auto-join the dynamic
rust drift leg (#366); its floor moves 86 -> 96.

The mod attributes used '#[allow(dead_code, unused_parens)]', which does
not cover clippy::double_parens, so 'clippy --all-targets -D warnings'
failed on the generated parens. Switched to '#[allow(clippy::all,
unused)]' -- the incantation src/lib.rs already uses for the same gens.

Adds a structural guard: every tests/*.rs must be declared in Cargo.toml,
or the gate fails and names the file. With autotests = false this is the
only thing standing between a new test file and silent death.

Verified: 18/18 pass, full cargo test exits 0, cargo fmt --all --check
and clippy --all-targets -D warnings both clean, zero drift on the ten
new gens, and the guard catches an undeclared probe file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@gHashTag
gHashTag merged commit 353f10b into main Aug 9, 2026
4 checks passed
@gHashTag
gHashTag deleted the fix/dead-test-target-compute-ring branch August 9, 2026 05:07
gHashTag pushed a commit that referenced this pull request Aug 9, 2026
…stop the bleed

Same trap as the dead test target (#376), one directory over. Cargo.toml
sets 'autobins = false', so a file in src/bin/ is compiled ONLY with an
explicit [[bin]] block. There is exactly ONE such block for 29 files:
28 binaries are never built, never type-checked, free to rot silently.

Among the dead: trinet_compute_lifecycle.rs -- the end-to-end proof that
tests/compute_ring_invariants.rs cites as living outside cargo -- and
trinet_ledger_head.rs, the binary the tri_sha256 spec credited with
proving two-block bit-exactness before #371 moved that proof in-spec.

Triaged all 28 with cargo check, one target at a time:

  24 compile once the gen/rust modules they include by #[path] exist.
     Ten of those gens were simply never committed even though every
     spec is present (the same omission #376 hit). NOT revived here:
     those #[path] mods lack #[allow(clippy::all, unused)], so
     'clippy --all-targets -D warnings' reports 349 errors from the
     GENERATED code and would redden the required build+test gate.
     Reviving them is attribute surgery across 24 files -- its own change.

   3 are genuinely rotted, and this records why:
     tri_rti          unresolved import trios_mesh::rti
     trinet_a2a_node  needs gen/rust/router_ttl.rs -- no such spec exists
     trios_meshd      method 'send' is not a member of trait 'Transport'

The guard makes the debt visible and bounded: every src/bin/*.rs must be
declared or named in KNOWN_DEAD, so a NEW binary can never join them
silently. Shrink the list; never grow it.

Verified: clean tree exits 0 and prints '29 files, 1 declared, 28
known-dead'; a new undeclared bin is caught; the test-side guard still
catches an undeclared test file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
gHashTag added a commit that referenced this pull request Aug 9, 2026
…stop the bleed (#377)

Same trap as the dead test target (#376), one directory over. Cargo.toml
sets 'autobins = false', so a file in src/bin/ is compiled ONLY with an
explicit [[bin]] block. There is exactly ONE such block for 29 files:
28 binaries are never built, never type-checked, free to rot silently.

Among the dead: trinet_compute_lifecycle.rs -- the end-to-end proof that
tests/compute_ring_invariants.rs cites as living outside cargo -- and
trinet_ledger_head.rs, the binary the tri_sha256 spec credited with
proving two-block bit-exactness before #371 moved that proof in-spec.

Triaged all 28 with cargo check, one target at a time:

  24 compile once the gen/rust modules they include by #[path] exist.
     Ten of those gens were simply never committed even though every
     spec is present (the same omission #376 hit). NOT revived here:
     those #[path] mods lack #[allow(clippy::all, unused)], so
     'clippy --all-targets -D warnings' reports 349 errors from the
     GENERATED code and would redden the required build+test gate.
     Reviving them is attribute surgery across 24 files -- its own change.

   3 are genuinely rotted, and this records why:
     tri_rti          unresolved import trios_mesh::rti
     trinet_a2a_node  needs gen/rust/router_ttl.rs -- no such spec exists
     trios_meshd      method 'send' is not a member of trait 'Transport'

The guard makes the debt visible and bounded: every src/bin/*.rs must be
declared or named in KNOWN_DEAD, so a NEW binary can never join them
silently. Shrink the list; never grow it.

Verified: clean tree exits 0 and prints '29 files, 1 declared, 28
known-dead'; a new undeclared bin is caught; the test-side guard still
catches an undeclared test file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: SSD DDD <ssdm4@MacBook-Pro.local>
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