1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! RHH (Remove-Header-Hints) instrumentation hook.
//!
//! Per-family disablement of the rule-based header-hint scaffolding inside
//! [`crate::column`]. Reads the `RHH_DISABLE_HINTS` env var (comma-separated
//! family ids) once at first call and caches the parsed set.
//!
//! The full canonical family list is in
//! `diagnostics/rhh_family_inventory.tsv` (ac-01 output of spec
//! `spec 2026-04-24-remove-header-hints`).
//!
//! ## Compile-time behaviour
//!
//! - **Feature `rhh-instrumentation` ON** — [`is_disabled`] consults the
//! parsed env var set and returns `true` when the family id matches.
//! - **Feature `rhh-instrumentation` OFF (default)** — [`is_disabled`] is a
//! `const fn` body that always returns `false`. Optimisers eliminate the
//! call site entirely; off-feature builds carry no runtime cost.
//!
//! ## Family ids
//!
//! Family ids are the rule-family granularity the runtime
//! `disambiguation_rule` emitter uses (e.g. `header_hint_table`,
//! `substring_matcher_identity`, `header_hint_measurement`,
//! `sense_geo_rescue`). Per-arm enumeration is out of scope — see spec
//! constraint #3.
/// Return `true` when `family_id` is listed in the `RHH_DISABLE_HINTS`
/// env var (comma-separated, whitespace-trimmed, empty entries skipped).
///
/// Always `false` on default builds (feature `rhh-instrumentation` off).
/// The argument is borrowed rather than copied so call-sites can pass
/// `&'static str` literals directly.
///
/// On feature-on builds the env var is parsed on every call. ac-04
/// counterfactual runs invoke the binary fresh per family, so no caching
/// is needed; the per-call parse cost only shows up on the diagnostic
/// build and is dominated by inference cost in any realistic scenario.
/// Avoiding a static cache lets tests exercise multiple configurations
/// in the same process by mutating the env var.