intents.py: _render_why_forecast объявляет future_market источником provenance даже когда из него не выведено ни строки #1630

Closed
opened 2026-06-16 18:44:22 +00:00 by bot-backend · 0 comments
Collaborator

Severity: low · Категория: provenance/honesty · Файл: backend/app/services/chat/intents.py:267-298

Файл: gendesign/backend/app/services/chat/intents.py:267-298 (_render_why_forecast). Импакт: на стр.269 sections_used.append('future_market') выполняется всякий раз, когда future — dict, ещё до проверки forecasts_by_horizon/future_supply/summary. Если future_market — непустой dict без этих трёх ключей (например {'unrelated':1}), а product_tz.reasons и confidence.rationale пусты, то итоговый ответ состоит только из fallback-строки (стр.296) «Детали обоснования прогноза в отчёте пока не заполнены.», однако grounded_in.sections = ['future_market'] — ложное заявление о provenance (тот же класс, что candidate [0], но мягче: dict секции присутствует). Фикс: переносить append('future_market') внутрь блоков, реально выводящих строку (или ставить флаг future_emitted и добавлять секцию в sections_used только если флаг True), чтобы grounded_in.sections отражал лишь фактически использованные данные.

Почему баг: grounded_in.sections is documented as explainability provenance — what the answer was actually built from. Reporting future_market as a source when the answer body contains zero data from it is a (mild) false-provenance claim, same defect class as the what_to_build issue but lower impact because the section dict is at least present. The append should be conditional on actually emitting a future_market-derived line.

Как чинить: Append "future_market" to sections_used only when at least one future_market-derived line was actually added (guard the append behind the sub-field checks, or set a flag and append after).


deep-audit backend v2 (2-й проход, после PR #1543) · verify+harden, confidence 0.88 · unit B18

**Severity:** low · **Категория:** provenance/honesty · **Файл:** `backend/app/services/chat/intents.py:267-298` Файл: gendesign/backend/app/services/chat/intents.py:267-298 (_render_why_forecast). Импакт: на стр.269 sections_used.append('future_market') выполняется всякий раз, когда future — dict, ещё до проверки forecasts_by_horizon/future_supply/summary. Если future_market — непустой dict без этих трёх ключей (например {'unrelated':1}), а product_tz.reasons и confidence.rationale пусты, то итоговый ответ состоит только из fallback-строки (стр.296) «Детали обоснования прогноза в отчёте пока не заполнены.», однако grounded_in.sections = ['future_market'] — ложное заявление о provenance (тот же класс, что candidate [0], но мягче: dict секции присутствует). Фикс: переносить append('future_market') внутрь блоков, реально выводящих строку (или ставить флаг future_emitted и добавлять секцию в sections_used только если флаг True), чтобы grounded_in.sections отражал лишь фактически использованные данные. **Почему баг:** grounded_in.sections is documented as explainability provenance — what the answer was actually built from. Reporting future_market as a source when the answer body contains zero data from it is a (mild) false-provenance claim, same defect class as the what_to_build issue but lower impact because the section dict is at least present. The append should be conditional on actually emitting a future_market-derived line. **Как чинить:** Append "future_market" to sections_used only when at least one future_market-derived line was actually added (guard the append behind the sub-field checks, or set a flag and append after). --- <sub>deep-audit backend v2 (2-й проход, после PR #1543) · verify+harden, confidence 0.88 · unit B18</sub>
bot-backend added the
week ревью 1
label 2026-06-16 18:44:22 +00:00
Sign in to join this conversation.
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#1630
No description provided.