No description
Find a file
DJP c9be450614 Stage 3: TROWLS qualification scorecard + Stage 2 diagnosis tests
Stage 3 backend:
- POST /opportunities/{id}/qualification — saves a TROWLS scorecard
  (timing/relationship/opportunity_size/what_we_know/location/sector,
  each 0-10) as a stage_artifact (type='qualification_scorecard'),
  computes total/60 → percentage, derives recommendation
  (proceed >=60% / slt_review >=50% / no_go <50%) and stamps
  qualification_score on the opportunity.
- GET /opportunities/{id}/qualification — returns the latest scorecard
  or null. Smoke-tested: scores 7+8+6+7+9+7=44 → 73% → "proceed".

Stage 3 frontend (Stage3Qualify component):
- Live total + percentage card, three-band progress bar with markers
  at 50% (SLT review) and 60% (proceed), live recommendation badge.
- One slider + one note input per TROWLS dimension, plus an overall
  notes textarea.
- Save scorecard, with success indicator. Re-loads existing score on
  mount so re-edit is non-destructive.
- StageApprovals embedded below — qualification gate uses the same
  approval workflow the rest of the gated stages use.

Stage 2 diagnosis backend tests (10 new, +1 skipped real-Claude):
- /diagnose: no-files → 400, empty extracted_text → 400.
- /clarifications: empty list, priority ordering (red→amber→green
  verified by seeding out-of-order via psycopg2), 404 for non-existent
  opp, cross-opportunity 404 on PUT.
- PUT clarification: client_answer flips status→answered + stamps
  answered_at; status=dismissed doesn't stamp answered_at; bad status
  → 400.

Suite total: 58 collected, 55 passed, 3 skipped (real-Anthropic +
owner-notification path that needs OpportunityCreate to accept
owner_user_id). 0 failures, no app-code bugs found.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 13:48:44 -04:00
backend Stage 3: TROWLS qualification scorecard + Stage 2 diagnosis tests 2026-04-27 13:48:44 -04:00
frontend Stage 3: TROWLS qualification scorecard + Stage 2 diagnosis tests 2026-04-27 13:48:44 -04:00
.env.example Approval workflow backend: notifications + Mailgun email 2026-04-27 13:28:22 -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 Approval workflow backend: notifications + Mailgun email 2026-04-27 13:28:22 -04:00