Files
buzz/desktop/src-tauri
Eva 637a796658 refactor(desktop): satisfy the file-size ratchet — extract the overlay fold into one helper, move overlay tests to a sibling file
CI's Desktop Core ratchet is red at 692fdafa (Sami's finding): card.rs
1000->1015 and snapshot/tests.rs 963->1077, both pinned at the cap at the
merge base, so neither may grow by a line.

Two moves, no behavior change:

- Extract the three inline overlay folds into one helper,
  `load_effective_managed_agents` (snapshot.rs), called at all three
  resolver sites. card.rs returns to 999 (< merge-base 1000); the helper's
  doc comment carries the rationale and the lock-order contract
  (managed_agents_store_lock outer, overlay inner, released before return).

- Move the overlay_fold behavioural tests to a sibling
  snapshot/tests_overlay_fold.rs, #[path]-included per the tests_locked.rs
  convention. snapshot/tests.rs returns to 968 (< cap).

The extraction changes what Sami's source guard must pin, so
tests_export_resolver_guard.rs now asserts three legs: every resolver site
calls the helper (exact per-file counts), no resolver file reads raw
load_managed_agents outside the helper's own body (exact allowed counts),
and the helper itself still performs the resolved_records fold — plus the
vacuity self-test for every needle.

Verified at this commit: ratchet passes vs merge-base
(CHECK_FILE_SIZES_BASE=$(git merge-base origin/main HEAD)); full workspace
suite 2387 passed / 0 failed / 15 ignored; clippy --workspace --all-targets
-D warnings clean; fmt clean. Guard mutation arms all KILLED with sources
restored byte-identical (cmp vs pinned copies): card mint bypasses helper,
card precheck bypasses helper, snapshot resolver bypasses helper, helper
degrades to plain load; unmutated control green.

Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz>
Signed-off-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz>
2026-08-07 15:15:08 -04:00
..