Skip to content

Move the inline tests out of seven pinned tally/ files - #451

Merged
lamemustafa merged 1 commit into
masterfrom
refactor/extract-tests-batch-d
Sep 16, 2026
Merged

lamemustafa merged 1 commit into
masterfrom
refactor/extract-tests-batch-d

Conversation

@lamemustafa

Copy link
Copy Markdown
Owner

Next batch of smaller pinned files, all in src-tauri/src/tally/. Editing any of their inline tests re-hashed a production file, so each test module moves to a sibling <stem>_tests.rs loaded with #[cfg(test)] #[path = "..."] mod tests;. The new files stay unpinned (#416).

file moved #[test]s compiled when
standard_ledger_catalog.rs 4 default
serial_queue.rs 4 default
outstandings_runtime.rs 8 7 with voucher-scan, all 8 with live-calibration-harness
capability_packs.rs 5 default
validators.rs 5 default
agent_read_request.rs 1 default
approved_import.rs 1 default

What was checked

  • No code change. Re-indenting each new file and putting it back rebuilds the old file byte for byte. rustfmt then re-wrapped lines in standard_ledger_catalog_tests.rs and agent_read_request_tests.rs. String literals and non-whitespace tokens are unchanged, and none of the parents changed.
  • Same tests. cargo test -p bridge --lib -- --list output is identical under default, voucher-scan, live-calibration-harness and lab-writes (968, 986, 988 and 1068). The moved tests pass by exact name: 20 under default and lab-writes, 27 under voucher-scan, 28 under live-calibration-harness.
  • Tree-reading gates, run after the reseal: cargo test -p bridge-tally-compatibility and cargo test -p bridge --test admission_and_egress_files_stay_pinned (approved_import.rs is still pinned there). Both pass.
  • Clippy as CI runs it: bridge --lib --tests, the portable crates, and the protocol feature set.
  • Scripts: request-builder hazards (pinned 10), live-read boundary (capability_packs.rs is one of its production surfaces and still passes), workflow consistency, unbounded reads, parser-test symmetry, PII regex coverage, fixture byte integrity.
  • corepack pnpm test passes (239 node, 113 vitest, 10 Playwright). On the first run, the known trial-balance-screen.test.tsx export flake failed again; the rerun was clean.
  • scripts/reseal.sh --verify passes. The surface diff changes exactly the 7 parents' hashes, and the coverage report shows exactly 7 newly unsealed test-only modules.
  • Text readers: scripts/ux1-shell.test.mjs reads agent_read_request.rs, but only to compare its bytes with the surface hash, which the reseal updates. The pnpm run above covers it.

Left out: tally/tdl_engine.rs

Once its tests are extracted, check-tally-request-builder-hazards.mjs scans tdl_engine_tests.rs as production and reports two new entries: the $$NumItems:BRIDGE Group/Ledger Collection V1 strings that exact_report_collection_is_shared_by_count_and_rows asserts on. This is the latent false alarm #443 was closed over. Moving these tests needs either a pinned-set entry for a test function or a scanner change, and both change the gate, so the file stays as it is.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

tally/standard_ledger_catalog.rs, serial_queue.rs, outstandings_runtime.rs,
capability_packs.rs, validators.rs, agent_read_request.rs and
approved_import.rs are pinned on the compatibility surface, so editing
one of their tests re-hashed a production file. Each test module now
lives in a sibling <stem>_tests.rs loaded with

The move changes no code: re-indenting each new file and substituting it
back reproduces the old file byte for byte. rustfmt then re-wrapped lines
in standard_ledger_catalog_tests.rs and agent_read_request_tests.rs;
string literals and non-whitespace tokens are unchanged, and it left the
parents alone. The lib's test list is identical under default,
voucher-scan, live-calibration-harness and lab-writes (968, 986, 988 and
1068). The moved tests pass by exact name: 20 under default and
lab-writes, 27 under voucher-scan, 28 under live-calibration-harness
(outstandings_runtime's tests are feature-gated).

tally/tdl_engine.rs was left out: once its tests are in a separate file,
check-tally-request-builder-hazards.mjs scans them as production and
reports two $$NumItems strings that a test asserts on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lamemustafa
lamemustafa force-pushed the refactor/extract-tests-batch-d branch from 7b71c53 to d79ec74 Compare September 16, 2026 15:40
@lamemustafa
lamemustafa merged commit 7939823 into master Sep 16, 2026
13 checks passed
@lamemustafa
lamemustafa deleted the refactor/extract-tests-batch-d branch September 16, 2026 15: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