This was generated by AI during triage.*
Problem
Capability matching currently allows CountMinSketchWithHeap to satisfy ordinary Statistic::Count requirements without checking its count_events weighting. A heap configured with count_events: false is value-weighted (SUM semantics), but can therefore be selected for COUNT and return summed values.
Expected behavior
Ordinary COUNT matching must reject heap sketches with count_events: false and accept sketches whose count_events is true or omitted (the existing default). Existing Top-k weighting behavior must remain unchanged.
Acceptance criteria
- Add behavioral capability-matching tests covering both heap weighting variants.
- Ensure a SUM-weighted heap cannot serve ordinary COUNT.
- Preserve existing Top-k matching semantics.
- Implement test-first (TDD).
Found during review of #665, Roborev job #124 finding 4.
Problem
Capability matching currently allows
CountMinSketchWithHeapto satisfy ordinaryStatistic::Countrequirements without checking itscount_eventsweighting. A heap configured withcount_events: falseis value-weighted (SUM semantics), but can therefore be selected for COUNT and return summed values.Expected behavior
Ordinary COUNT matching must reject heap sketches with
count_events: falseand accept sketches whosecount_eventsistrueor omitted (the existing default). Existing Top-k weighting behavior must remain unchanged.Acceptance criteria
Found during review of #665, Roborev job #124 finding 4.