Skip to content

Briefing Progressivo

The Briefing Progressivo is Juca’s signature feature — a 4-phase progressive disclosure system that transforms raw legal analysis into structured, interactive deliverables. Instead of dumping all results at once, each phase reveals a deeper layer of analysis, building on the user’s input and selections.

Three principles guide the Briefing:

  1. Progressive disclosure — Reveal complexity gradually, not all at once
  2. No mandatory interaction — Each phase produces standalone value; the user can stop at any point
  3. Incremental implementation — Build one phase at a time, test until stable, then proceed
flowchart LR
P0["Phase 0<br/>Chat"] --> P1["Phase 1<br/>Diagnosis"]
P1 --> P2["Phase 2<br/>Precedents"]
P2 --> P3["Phase 3<br/>Risks"]
P3 --> P4["Phase 4<br/>Delivery"]
P4 --> PDF["PDF Export"]
PhaseNameBlock TypesValter EndpointsStatus
0Chatmessage✅ Implemented
1Diagnosisdiagnosis, action_prompt/v1/retrieve (context)🔨 In Progress
2Precedentsprecedent, precedent_picker/v1/retrieve, /v1/similar_cases📋 Planned
3Risksrisk_balance, chart/v1/graph/optimal-argument, /v1/graph/divergencias📋 Planned
4Deliverydelivery, exit_cardAggregation of all phases📋 Planned

All briefing state transitions are managed by server actions in src/actions/briefing.ts:

PhaseActionPurpose
1updateDiagnosis(sessionId, fields)Update diagnosis card fields
1chooseSituation(sessionId, situation)Select user situation → determines delivery mode
1addAdditionalContext(sessionId, text)Append context information
2evaluatePrecedent(sessionId, processoId, evaluation)Rate a precedent (useful/not)
3resolveRisk(sessionId, riskId)Mark a risk as resolved
3advanceToPhase3(sessionId)Transition from P2 → P3
4generateDelivery(sessionId)Generate the final deliverable
4choosePath(sessionId, pathId)Select a strategic path
4setFaseProcessual(sessionId, fase)Set procedural stage
4finalizeSession(sessionId)Complete the session
4handleExitAction(sessionId, action)Handle exit card actions

Briefing state is stored as JSON in the session’s metadata field. The loadBriefingState() helper loads or initializes the state:

// State is loaded per-session, not globally
const state = await loadBriefingState(sessionId);
// Returns BriefingFlowState with: phase, situation, diagnosis, precedentEvaluations, risks, etc.

The PhaseRail (src/components/shell/PhaseRail.tsx) is a vertical navigation rail showing:

  • Current active phase (highlighted)
  • Completed phases (clickable for navigation)
  • Future phases (dimmed)

It sits alongside the WorkCanvas in the AppShell layout.

The user’s situation, selected in Phase 1, determines which delivery mode Phase 4 produces:

Situation (Phase 1)Delivery Mode (Phase 4)Content
pesquisando (researching)Síntese (Synthesis)Concise summary of favorable/unfavorable precedents
avaliando (evaluating)Parecer (Opinion)Formal legal opinion with favorability percentage
atuando (acting)Estratégia (Strategy)2-3 strategic paths with actionable steps
estudando (studying)Mapa (Map)Temporal evolution + divergent currents

After Phase 4, users can export the entire briefing as a PDF. The PDF reflects selections made across all four phases. See PDF Export for details.