Files
buzz/crates/buzz-db/src
9e2959e32d test(buzz-db): pin communities_of_channels missing-channel-absent contract
The relay-side read-row emitter relies on a load-bearing contract from
`Db::communities_of_channels`: a channel id with no row in the DB MUST
be absent from the returned map, never mapped to a default. The relay's
`MissingLookup → ImplBug{row_community_lookup_missing} → CoverageBreach`
fail-closed guard-rail goes blind if this helper ever started returning
a default/zero entry for unknown channels — and the relay-side
mutate-bite for that guard-rail wouldn't catch it (different layer).

This adds a PG-ignored test that pins both directions:
- (1) Existing channel → present with its true community.
- (2) Missing channel → ABSENT from the result map (load-bearing).
- (3) Map size equals the number of existing channels.

Mutate → red → restore verified against live Postgres:
  Mutant: post-loop `for ch in channel_ids { entry().or_insert(nil) }`
  Result: assertion (2) bites with explicit message
          "missing channel must be absent from the result map,
           got Some(CommunityId(00000000-…))"
  Restored: green.

Closes the read-seam fail-closed chain end-to-end (DB layer through
checker), making it non-vacuous across both layers.

Co-authored-by: Tyler Longwell <tlongwell@block.xyz>
Signed-off-by: Tyler Longwell <tlongwell@block.xyz>
2026-06-27 00:40:17 -04:00
..
…
…
…