Files
buzz/desktop/src-tauri
Sami 2719088822 test(desktop): guard that every export resolver folds the 30179 overlay
The behavioural tests added with the export/card overlay fold model the
resolution by calling `resolved_records` / `resolve_from_lists` directly.
They cannot reach the production call sites: all three live inside
`#[tauri::command]` bodies needing a live `AppHandle` + `State<AppState>`.

Measured on the parent commit, one full-workspace run per mutant:

  delete the snapshot.rs fold      -> SURVIVED (2283 passed, 0 failed)
  delete the card precheck fold    -> SURVIVED (2283 passed, 0 failed)
  delete the card mint fold        -> SURVIVED (2283 passed, 0 failed)
  revert the respond_to fallback   -> killed (3 tests)
  mix definition mode + inst. list -> killed (1 test)

So all three production folds were deletable with a green suite. The
fallback and the mode/list-atomicity invariant were genuinely covered;
only the wiring was not.

Add an `include_str!` source guard with EXACT per-file call counts
(snapshot.rs: 1, card.rs: 2) — same remedy as `write_site_resolve_guard`
in private_config_overlay.rs. Exact rather than a lower bound: `>= 1` per
file would not notice one card site losing its fold while the other
gained a second one. A second test strips the searched string and asserts
zero matches remain, so a typo in the pattern cannot make the guard pass
vacuously.

Re-ran all three mutants against the guard, deleting each fold statement
outright so the mutant compiles: all three fail, each naming its own
file, with the unmutated control passing and both sources restored
byte-identical after each arm.

The guard lives in a sibling `tests_export_resolver_guard.rs` rather than
in `snapshot/tests.rs`, following the convention `tests_locked.rs`
documents: `snapshot/tests.rs` is already over the 1000-line desktop
ratchet, so a file already above the limit may not grow. This commit adds
3 lines to snapshot.rs (528 total) and one new 67-line file, so it clears
the ratchet on its own; the two pre-existing ratchet rows on this branch
are unchanged by it.

Verified: cargo test --workspace in desktop/src-tauri — 2285 passed,
0 failed, 14 ignored; cargo clippy --workspace --all-targets -D warnings
clean; cargo fmt --all --check clean. All at parent 692fdafa with
`git rev-parse HEAD` checked in the same shell.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
2026-08-07 14:35:21 -04:00
..