Follow-up from #474 item 1 (PR #477).
test_minimum_bars_never_exceeds_what_any_legal_window_can_actually_return (dashboard/backend/tests/infrastructure/market_data/test_ifind_ashare.py:511-539) sweeps all seven start weekdays and asserts floor <= weekdays * 4. Its docstring claims it "fails loudly if someone raises _MINIMUM_BAR_COMPLETENESS above 1.0 or restores a flat constant".
It does the first. It does not do the second:
floor = max(4, int(weekdays * 4 * completeness)), so the assertion reduces to completeness <= 1.0 — true for any value at or below 1.
- A restored flat
40 passes every case in the sweep. A 14-day window holds at most 10 weekdays, 10 × 4 = 40, and 40 <= 40 holds. That is exactly the constant the change was made to remove, and it comes back green.
Fix shape: assert against a window the flat constant would break rather than against the widest one. A short legal window (say 3 weekdays → 12 reachable bars) separates a proportional floor from any flat value above 12. Mutation-check the new test by restoring return 40.
Follow-up from #474 item 1 (PR #477).
test_minimum_bars_never_exceeds_what_any_legal_window_can_actually_return(dashboard/backend/tests/infrastructure/market_data/test_ifind_ashare.py:511-539) sweeps all seven start weekdays and assertsfloor <= weekdays * 4. Its docstring claims it "fails loudly if someone raises_MINIMUM_BAR_COMPLETENESSabove 1.0 or restores a flat constant".It does the first. It does not do the second:
floor = max(4, int(weekdays * 4 * completeness)), so the assertion reduces tocompleteness <= 1.0— true for any value at or below 1.40passes every case in the sweep. A 14-day window holds at most 10 weekdays,10 × 4 = 40, and40 <= 40holds. That is exactly the constant the change was made to remove, and it comes back green.Fix shape: assert against a window the flat constant would break rather than against the widest one. A short legal window (say 3 weekdays → 12 reachable bars) separates a proportional floor from any flat value above 12. Mutation-check the new test by restoring
return 40.