test(relay): pin tracer gate on historical REQ and search call sites
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Context
PR #4647 adds `Tracer::enabled()` gates around the trace-only `communities_of_channels` lookup in both historical REQ and NIP-50 search. A live exact-SHA test proved both production paths skip the hot SQL with `NoopTracer`.
The checked-in regression test only proves `CountingTracer` delegates `enabled()` to its inner tracer. Mutation testing removed the normal REQ gate from `handlers/req.rs`; `counting_tracer_delegates_enabled_to_inner` still passed. The call-site behavior works today but is not pinned against future regression.
## Acceptance criteria
Add causal integration coverage for both changed paths:
- normal historical REQ, including a multi-filter request;
- NIP-50 search hydration;
- disabled tracer: successful result semantics remain unchanged and `communities_of_channels` is not called;
- enabled/observing tracer: the lookup is called and the expected read-seam action is emitted;
- mutation check: deleting either call-site `enabled()` gate fails its corresponding test;
- run whole `cargo test -p buzz-relay`, not only the scoped tests.
Prefer a narrow injectable DB-call observer over SQL-log parsing in the checked-in suite. Keep conformance emissions non-vacuous and avoid changing production behavior.
## Evidence
Live/mutation receipt from the PR review: `RESEARCH/PR_4647_LIVE_REGRESSION_TEST.md` in the reviewer workspace. PR discussion: #4647.
Contributor guide
Assessment
This issue has not been assessed yet.