No description
Find a file
DJP 033bc106fe Stage 2 backend: Diagnosis Agent + clarification questions
Stage 2 reads the same files Stage 1 ingested and produces a structured
brief diagnosis (deliverables, channels, markets, capabilities, KPIs/SLAs,
tech asks, timelines, ambiguities, contradictions) plus a list of
clarifications to send the client. Diagnosis is saved as a stage_artifact
(type='brief_diagnosis'); clarifications land in a new
ClarificationQuestion table that Stage 4 will package into a Q&A pack
and Stage 5 will mark answered.

New table (migration 0003): clarification_questions with priority enum
(red/amber/green) and status enum (pending/answered/dismissed),
indexed by opportunity_id and (opportunity_id, status). source_stage
distinguishes Stage-2-seeded questions from Stage-5/manual additions so
re-running the Diagnosis Agent only wipes its own seeded rows, not
client answers already on file.

API: POST /diagnose (run agent), GET /clarifications (list, ordered by
priority), PUT /clarifications/{id} (used by Stage 5 to record answers).

Smoke-tested against the Versuni sample brief: 6 deliverables, 4
channels, 15 clarifications seeded, $0.0107 per call.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 13:22:13 -04:00
backend Stage 2 backend: Diagnosis Agent + clarification questions 2026-04-27 13:22:13 -04:00
frontend Stage 1 part 2: file upload + Intake Agent 2026-04-27 13:02:26 -04:00
.env.example Scaffold V2: 17-stage state machine, Alembic, MSAL, Mermaid stage map 2026-04-27 12:35:03 -04:00
.gitignore Scaffold V2: 17-stage state machine, Alembic, MSAL, Mermaid stage map 2026-04-27 12:35:03 -04:00
docker-compose.yml Scaffold V2: 17-stage state machine, Alembic, MSAL, Mermaid stage map 2026-04-27 12:35:03 -04:00