# Implementation Sequence

## Phase 1 — Contracts and compiler
- Add `DrillAuthoringV2`, `ConceptLibrary`, and `CompiledDrillV2`.
- Add JSON schema validation in CI.
- Implement content gate and benchmark runner.
- Produce one compiled drill from one authored drill.

## Phase 2 — Server analyzer
- Implement text segmentation with offset preservation.
- Implement entity, role, amount, date, and proceeding detection.
- Implement lexical candidate retrieval.
- Implement dense prototype retrieval.
- Implement slot evidence collection and scoring.
- Implement proposition adjudication and hysteresis.

## Phase 3 — Client integration
- Load client-safe runtime aliases.
- Add `hinted` state in the Building Blocks UI.
- Add authoritative server update loop.
- Add submit pass and explanation rendering.

## Phase 4 — LLM ambiguity resolution
- Add proposition-span scoped LLM prompt.
- Add strict JSON validation for model output.
- Add call-budget and memoization rules.
- Reject uncited or invalid outputs.

## Phase 5 — Evaluation and migration
- Run shadow evaluation on historical answers.
- Tune policy thresholds only through benchmarked config changes.
- Migrate doctrine libraries incrementally.
- Remove legacy `match.groups` after parity is exceeded.
