Phase 4: Contextual Delivery
Phase 4: Contextual Delivery
Section titled “Phase 4: Contextual Delivery”Phase 4 is the culmination of the Briefing — it aggregates all previous phases into a tailored deliverable. The delivery mode is determined by the user’s situation selected in Phase 1.
Delivery Modes
Section titled “Delivery Modes”| Mode | Situation | Content | Generator Function |
|---|---|---|---|
| Síntese (Synthesis) | pesquisando | Concise summary of favorable and unfavorable precedents | buildSinteseContent() |
| Parecer (Opinion) | avaliando | Formal legal opinion with favorability percentage | buildParecerContent() |
| Estratégia (Strategy) | atuando | 2-3 strategic paths with actionable steps | buildEstrategiaContent() |
| Mapa (Map) | estudando | Temporal evolution map + divergent current analysis | buildMapaContent() |
What Happens
Section titled “What Happens”- All phase data aggregated (diagnosis + precedents + risks)
- Delivery mode automatically selected based on Phase 1 situation
- AI generates the tailored deliverable
- A
deliveryblock renders the output - An
exit_cardblock appears with session summary + PDF export option
Block Types Produced
Section titled “Block Types Produced”| Block Type | Purpose |
|---|---|
delivery | Final analysis output in one of the 4 adaptive modes |
exit_card | Session completion card with summary and export options |
Server Actions
Section titled “Server Actions”// Generate the delivery based on accumulated briefing stategenerateDelivery(sessionId: string) → Returns: { state: BriefingFlowState, phase4Blocks: Block[] }
// Select a strategic path (Strategy mode)choosePath(sessionId: string, pathId: string) → Returns: BriefingFlowState
// Set the procedural stagesetFaseProcessual(sessionId: string, fase: string) → Returns: BriefingFlowState
// Finalize the sessionfinalizeSession(sessionId: string) → Returns: BriefingFlowState
// Handle exit card actions (export, new session, etc.)handleExitAction(sessionId: string, action: string) → Returns: { state: BriefingFlowState, action: string }PDF Export
Section titled “PDF Export”After delivery, the exit_card offers PDF export. The generated PDF reflects the user’s journey through all four phases:
- Phase 1 diagnosis summary
- Phase 2 selected precedents
- Phase 3 risk balance visualization
- Phase 4 delivery content in the chosen mode
See PDF Export for technical details.
🚧 Planned Feature — Phase 4 is planned for v0.4 milestone. Briefing PDF with phase selections is tracked in #289.