feat(tradein/backtest): hermetic estimator regression gate — frozen fixture + baseline (#1966 PR 3/3) #1997
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1997
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/1966-backtest-fixture-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PR 3/3 of #1966 (accuracy-loop → CI regression gate). Ships the hermetic, DB-free regression gate that measures the full estimator spine against frozen ground-truth.
scripts/backtest_estimator.py):--dump-fixture(capture) +replay_fixture(hermetic, ZERO DB) +--from-fixture/--update-baselineCLI (gzip-transparent). Two prod-parity fixes in_predict_full_spine: anchor pre-fetch now gated exactly likeestimate_quality(estimate_same_building_anchor_enabled+ area/address); then_analogs < MIN_CANDIDATESskip dropped (prod surfaces any positive estimate at low confidence).tests/fixtures/):backtest_full_fixture.json.gz(277 prod deals; frozen_price_from_inputsinputs incl. the 3 DB callables' recorded outputs) +backtest_baseline.json(the diff-visible metrics).tests/test_backtest_regression_gate.py): replays the fixture through the live spine, recomputes metrics, asserts== baselinewithin float tolerance. Auto-collected by the existing tradein pytest run.What it measures (the audit hypothesis, now quantified)
overall MAPE 18.63% / bias −1.2% (centred), but per-segment:
range-coverage 55.2% → this is a relative regression gate, not the absolute ≥80% SLA (that stays deferred per the #1966 re-scope: ground-truth is data-blocked until ~Q4'26).
Design notes
KeyError.--from-fixture <gz> --update-baseline, NO DB) and justify the per-segment deltas — the accuracy delta shows up right in the PR diff..pre-commit-config.yamllarge-file hook narrowly excludes the fixture (not a CI/merge-gate rule).Test plan
pytest tests/test_backtest_{estimator,fixture_roundtrip,regression_gate}.py→ 63 passedFollow-up (separate PR — pipeline rule → human review)
The tradein pytest gate currently runs post-merge (
deploy-tradein.yml, deploy-gating). A true pre-merge hard gate needs a newpull_requestjob inci.yml(extend thechangesfilter + abackend-tests-tradeinjob) + a Required check in branch protection. That edits pipeline rules → opened separately for human review.Refs #1966