fix(estimator): sanity-clamp quarter-index factor (#859) #863

Merged
bot-reviewer merged 1 commit from feat/859-quarter-index-factor-clamp into main 2026-05-31 07:21:00 +00:00

1 commit

Author SHA1 Message Date
1cbd4bd4b2 fix(estimator): sanity-clamp quarter-index factor in _apply_quarter_index (#859)
Follow-up hardening from PR #858 review. The quarter-index factor
(target_index / avg_analog_index) was unbounded — pathological FDW data could
yield an extreme multiplier on a client-visible price. Clamp factor to
[estimate_quarter_index_factor_min, _max] = [0.6, 1.8] (outside the realistic
quarter-to-quarter location spread for EKB вторичка). Bounds in settings;
passed as kwargs so _apply_quarter_index stays pure/testable. Clamp fires
logged at INFO. Formula and #764 guards unchanged.

Refs #859, #764
2026-05-31 10:11:16 +03:00