Skip to content

AI Evals

CaseSolo launch AI workflows now have deterministic offline evals for the highest-risk legal work product. These evals do not call an external model. They grade candidate outputs against required legal concepts, structured fields, citations, approval checkpoints, client-safe language, and forbidden outcome promises.

Covered Suites

Runbook

Run the focused eval suite:

npm run ai:evals

Run it through the shared test runner:

npm run test:run -- ai-evals

The suite is intentionally deterministic so failures mean one of three things:

Deposition Grounding Pipeline (2026-09-12)

POST /api/depositions/[depositionId]/analysis grounds pressure points in case context without any model call:

  1. Sibling depositions in the same case (firm-scoped, transcript-bearing) are
  2. parsed into Q&A pairs with the shared parseTranscriptQA helper.

  3. detectPriorStatementConflicts flags yes/no flips and affirm/deny
  4. negation conflicts on overlapping topics. No LLM, no prompts — transcript text never enters a prompt, so PII cannot leak through prompt logging.

  5. gatePriorStatementConflicts keeps only conflicts with complete
  6. line+source cites whose assembled point text passes ethicsGate and Truth Guard (runTruthGuard with [S1]/[S2] spans over the cited lines). Anything else is dropped fail-closed.

  7. Kept conflicts merge into contradictions, impeachment opportunities,
  8. cross-exam questions, and pressure points with prior-statement cites (deponent, deposition id, line).

  9. Task drafts stay drafts: analysis persists suggestedTasks as data only
  10. and writes zero Task rows (pinned by test).

Implementation Notes

Next Improvements

Source: docs/dev/ai-evals.md