fix(forecasting): deal_count confidence note carries «за N мес» window (#1637) #1684

Merged
lekss361 merged 2 commits from fix/confidence-deal-count-window-1637 into main 2026-06-17 17:57:41 +00:00
Owner

Проблема (#1637, P3)

confidence_engine.py _factor_from_count для deal_count не получал suffix → нота теряла окно «за N мес».

Решение

compute_report_confidence принимает deal_count_months: int | None = None; при наличии формирует suffix="за {N} мес". Default None — backward-compatible.

Verify

ruff clean; pytest (confidence) → 136 passed (+2 теста).

Follow-up (не в PR)

report_assembler._build_confidence может передавать deal_count_months для live-отчётов — однострочник в другом файле, отдельным PR при желании.

Closes #1637

## Проблема (#1637, P3) `confidence_engine.py` `_factor_from_count` для `deal_count` не получал suffix → нота теряла окно «за N мес». ## Решение `compute_report_confidence` принимает `deal_count_months: int | None = None`; при наличии формирует `suffix="за {N} мес"`. Default None — backward-compatible. ## Verify `ruff` clean; `pytest` (confidence) → **136 passed** (+2 теста). ## Follow-up (не в PR) `report_assembler._build_confidence` может передавать `deal_count_months` для live-отчётов — однострочник в другом файле, отдельным PR при желании. Closes #1637
lekss361 added 1 commit 2026-06-17 17:45:42 +00:00
fix(forecasting): deal_count confidence note carries «за N мес» window (#1637)
Some checks failed
CI / changes (push) Waiting to run
CI / backend-tests (push) Blocked by required conditions
CI / frontend-tests (push) Blocked by required conditions
CI / openapi-codegen-check (push) Blocked by required conditions
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m53s
CI / backend-tests (pull_request) Failing after 8m54s
afa7d80ecf
Add `deal_count_months: int | None = None` to `compute_report_confidence`.
When provided, threads it as suffix into `_factor_from_count` so the
deal_count ConfidenceFactor note reads «7 сделок за 6 мес — мало» instead
of the windowless «7 сделок — мало». Existing callers unaffected (default None).

Tests: two new cases in TestComputeReportConfidence — with/without window.
bot-backend added 1 commit 2026-06-17 17:57:16 +00:00
fix(forecasting): wire deal_count_months from market window into confidence note (#1637)
Some checks failed
CI / changes (push) Successful in 9s
CI / changes (pull_request) Successful in 8s
CI / backend-tests (push) Has been skipped
CI / frontend-tests (push) Has been skipped
CI / openapi-codegen-check (push) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m39s
CI / backend-tests (pull_request) Has been cancelled
ac47cd73a6
`_build_confidence` was calling `compute_report_confidence` without
`deal_count_months`, so the «за N мес» suffix never appeared in
production. Add `_deal_count_months(market_metrics)` extractor
(reads `window_months`, same key as `_history_months`) and pass it.
Also fix pre-existing UP038 violations (isinstance tuple → X | Y).
lekss361 merged commit 86d0475f45 into main 2026-06-17 17:57:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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#1684
No description provided.