tech-debt(tradein/estimator): collapse won estimate_* flags into defaults (#1970) #2475

Merged
bot-backend merged 1 commit from tech-debt/1970-collapse-estimate-flags into main 2026-07-12 12:46:18 +00:00
Collaborator

Collapses 14 Class-A boolean estimate_* gates (all default True, never overridden in prod) into their unconditional ON behavior: inline the ON-path, drop the guard + any OFF branch, delete the config field, remove/adjust OFF-path tests.

Collapsed (14)

estimate_imv_blend_enabled, estimate_same_building_anchor_enabled, estimate_calibrated_pi_enabled, estimate_corridor_clamp_enabled, estimate_radius_floor_enabled, estimate_sb_low_conf_gate_enabled, estimate_price_trend_dedup_enabled, estimate_confidence_floor_no_analogs, estimate_manual_review_enabled, estimate_radius_dedup_enabled, estimate_wide_corridor_disclosure_enabled, estimate_sb_clip_after_weight, estimate_quarter_index_enabled, estimate_sb_tier_a_allow_primary_if_secondary_present

Kept as flags (2 of the requested set) — reported, not collapsed

estimate_hedonic_correction_enabled and estimate_expected_sold_le_asking. These two are the OFF-baseline toggle for the dedicated A/B magnitude suite test_estimator_hedonic.py (which asserts ON shifts by exactly factor vs the flag-OFF baseline) and are used as isolation helpers across ~6 other estimator test files. Collapsing them would force rewriting numeric assertions across all of those files — a wrong-number regression risk the task's escape hatch explicitly covers. Their estimator inlines are otherwise clean; can be done as a focused follow-up.

Untouched (per task)

estimate_dedup_analogs_enabled (regression gate depends on its False branch), estimate_kitchen_area_signal_enabled, estimate_ceiling_height_signal_enabled, estimate_is_apartments_filter_enabled, estimate_segment_multiplier_enabled.

Notes

  • Removed the now-unconditional enabled param from _apply_corridor_clamp (+ its call site and OFF-path unit test).
  • Collapsed the same-building-anchor pre-fetch gate in scripts/backtest_estimator.py.
  • No numeric/dict tuning constants touched.

Regression gate: GREEN

All collapsed flags defaulted True, so unconditional == prior prod behavior. test_backtest_regression_gate.py replays the frozen 277-DKP fixture byte-identical to the committed baseline. Local run: 458 passed (gate + test_estimator* suite) + 93 passed (same_building / 781 / tier_a / segment_guard).

Collapses 14 Class-A boolean `estimate_*` gates (all default `True`, never overridden in prod) into their unconditional ON behavior: inline the ON-path, drop the guard + any OFF branch, delete the config field, remove/adjust OFF-path tests. ### Collapsed (14) `estimate_imv_blend_enabled`, `estimate_same_building_anchor_enabled`, `estimate_calibrated_pi_enabled`, `estimate_corridor_clamp_enabled`, `estimate_radius_floor_enabled`, `estimate_sb_low_conf_gate_enabled`, `estimate_price_trend_dedup_enabled`, `estimate_confidence_floor_no_analogs`, `estimate_manual_review_enabled`, `estimate_radius_dedup_enabled`, `estimate_wide_corridor_disclosure_enabled`, `estimate_sb_clip_after_weight`, `estimate_quarter_index_enabled`, `estimate_sb_tier_a_allow_primary_if_secondary_present` ### Kept as flags (2 of the requested set) — reported, not collapsed `estimate_hedonic_correction_enabled` and `estimate_expected_sold_le_asking`. These two are the OFF-baseline toggle for the dedicated A/B magnitude suite `test_estimator_hedonic.py` (which asserts ON shifts by exactly `factor` vs the flag-OFF baseline) and are used as isolation helpers across ~6 other estimator test files. Collapsing them would force rewriting numeric assertions across all of those files — a wrong-number regression risk the task's escape hatch explicitly covers. Their estimator inlines are otherwise clean; can be done as a focused follow-up. ### Untouched (per task) `estimate_dedup_analogs_enabled` (regression gate depends on its `False` branch), `estimate_kitchen_area_signal_enabled`, `estimate_ceiling_height_signal_enabled`, `estimate_is_apartments_filter_enabled`, `estimate_segment_multiplier_enabled`. ### Notes - Removed the now-unconditional `enabled` param from `_apply_corridor_clamp` (+ its call site and OFF-path unit test). - Collapsed the same-building-anchor pre-fetch gate in `scripts/backtest_estimator.py`. - No numeric/dict tuning constants touched. ### Regression gate: GREEN All collapsed flags defaulted `True`, so unconditional == prior prod behavior. `test_backtest_regression_gate.py` replays the frozen 277-DKP fixture byte-identical to the committed baseline. Local run: **458 passed** (gate + `test_estimator*` suite) + **93 passed** (same_building / 781 / tier_a / segment_guard).
bot-backend added 1 commit 2026-07-12 12:42:35 +00:00
tech-debt(tradein/estimator): collapse won estimate_* flags into defaults (#1970)
All checks were successful
CI Trade-In / frontend-checks (pull_request) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
CI Trade-In / backend-tests (pull_request) Successful in 53s
CI Trade-In / changes (pull_request) Successful in 9s
CI / changes (pull_request) Successful in 8s
d5df5fdb9c
Collapse 14 Class-A boolean feature gates (all default True, never overridden in
prod) into their unconditional ON behavior: inline the ON-path, drop the guard +
any OFF branch, delete the config field, and remove/adjust OFF-path tests.

Collapsed (14):
  estimate_imv_blend_enabled, estimate_same_building_anchor_enabled,
  estimate_calibrated_pi_enabled, estimate_corridor_clamp_enabled,
  estimate_radius_floor_enabled, estimate_sb_low_conf_gate_enabled,
  estimate_price_trend_dedup_enabled, estimate_confidence_floor_no_analogs,
  estimate_manual_review_enabled, estimate_radius_dedup_enabled,
  estimate_wide_corridor_disclosure_enabled, estimate_sb_clip_after_weight,
  estimate_quarter_index_enabled,
  estimate_sb_tier_a_allow_primary_if_secondary_present

Kept as flags (2 of the requested set) — they are the OFF-baseline toggle for the
dedicated A/B magnitude suite test_estimator_hedonic.py and isolation helpers
across ~6 other estimator test files; collapsing them would force rewriting numeric
assertions everywhere (risk of a wrong-number regression):
  estimate_hedonic_correction_enabled, estimate_expected_sold_le_asking

Untouched per task: estimate_dedup_analogs_enabled (gate depends on its False
branch), estimate_kitchen_area_signal_enabled, estimate_ceiling_height_signal_enabled,
estimate_is_apartments_filter_enabled, estimate_segment_multiplier_enabled.

Also removed the now-unconditional `enabled` param from _apply_corridor_clamp and
collapsed the same-building-anchor pre-fetch gate in scripts/backtest_estimator.py.

Regression gate (test_backtest_regression_gate.py) stays byte-green: all collapsed
flags defaulted True, so unconditional == prior prod behavior; the frozen 277-DKP
replay is byte-identical to the committed baseline. Full run: 458 passed (gate +
estimator suite) + 93 passed (same_building / 781 / tier_a / segment_guard).
bot-backend merged commit d22e0e00ae into main 2026-07-12 12:46:18 +00:00
bot-backend deleted branch tech-debt/1970-collapse-estimate-flags 2026-07-12 12:46:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#2475
No description provided.