feat(chat): deterministic §22 chat foundation /api/v1/chat/ask (#957 Step1) #1172
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#1172
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/chat-957-foundation"
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
Step 1 of #957 (chat over the engine) — the deterministic foundation, NO LLM.
POST /api/v1/chat/askanswers parcel questions by reading the already-persisted §22SiteFinderReport(latest_run_for, schema "1.0", read-only — no recompute) and returning templated Russian answers with the engine's numbers verbatim (§16 traceability; never fabricated).summary→exec_summary,what_to_build→product_tz,why_forecast→future_market+reasons+confidence,risks→§25 special_indices+confidence,scenarios→scenarios,unknown→menu.report_status="pending"(200, no 500, no recompute); missing/partial sections → honest "нет данных", never KeyError; uncomputed §25 indices skipped (not fabricated).llm_enabled=False(prod default) —llm_usedalways False. LLM prose composition is Step 2 (this PR doesn't importservices/llm)./api/v1/chat→rbac_guardauto-requires an authenticated known user (401 no-header, 403 unknown-user tested).Test plan
uv run pytest tests/api/v1/test_chat.py tests/services/chat/ -q→ 44 passedruff check+mypy→ cleanPOST /chat/askfor a cad with a real §22 run (each intent) + one without (pending)Scope
New chat files + 2-line main.py router only.
parcels.py/special_indices.py/own_portfolio.py/services/llm/untouched; no pyproject/uv.lock changes.Next
Step 2: LLM tool-loop (section dict-slicer tools + composition, gated by
llm_enabled, fallback to this deterministic path). Step 3: §19 redaction wiring. Frontend chat UI: separate track.Refs #957