buzz icon indicating copy to clipboard operation
buzz copied to clipboard

test(relay): pin req/search tracer gate coverage

Open VaibhavJain2609 opened this issue 4 months ago • 2 comments

What

Adds causal regression coverage for the tracer enabled() gates around conformance row-community lookup in the REQ handler.

  • Extracts shared helper paths for read-seam emission in crates/buzz-relay/src/handlers/req.rs:
    • maybe_emit_read_message_rows_with_lookup (historical REQ lane)
    • maybe_emit_read_by_id_rows_with_lookup (NIP-50 search hydration lane)
  • Keeps behavior identical while making the gates directly testable.
  • Defers row-channel projection work until after tracer.enabled() so disabled tracers skip all read-seam prep work.
  • Adds tests that pin both call sites and multi-filter behavior.

Why

Issue #4758 identified that removing a call-site gate could still pass existing tests, leaving the regression unpinned.

Repro + Mutation Proof

Local repro before this change:

  • cargo test -p buzz-relay counting_tracer_delegates_enabled_to_inner passed
  • deleting a call-site enabled() gate in req.rs still passed

With this change:

  • deleting the historical helper gate causes historical_req_multi_filter_disabled_tracer_skips_lookup to fail
  • deleting the search helper gate causes search_hydration_disabled_tracer_skips_lookup to fail

Tests

  • cargo test -p buzz-relay historical_req_multi_filter
  • cargo test -p buzz-relay search_hydration_
  • cargo test -p buzz-relay

Closes #4758.

VaibhavJain2609 avatar Aug 05 '26 10:08 VaibhavJain2609

@claude review

VaibhavJain2609 avatar Aug 06 '26 06:08 VaibhavJain2609