Phase 3: Risks & Opportunities
Phase 3: Risks & Opportunities
Section titled “Phase 3: Risks & Opportunities”Phase 3 synthesizes the diagnosis (Phase 1) and selected precedents (Phase 2) into a visual risk-opportunity balance. It uses Valter’s graph analysis endpoints for adversarial argument generation and divergence analysis.
What Happens
Section titled “What Happens”- Diagnosis + selected precedents sent to Valter graph endpoints
- Valter returns adversarial analysis (arguments for and against)
- A
risk_balanceblock renders the visual balance - A
chartblock provides data visualization - Progressive reveal: risks shown first, then opportunities
- User can explore details of each risk/opportunity
- Phase 4 delivery options become available
Block Types Produced
Section titled “Block Types Produced”| Block Type | Purpose |
|---|---|
risk_balance | Visual balance showing weighted risks vs. opportunities |
chart | Data visualization of risk analysis results |
Server Actions
Section titled “Server Actions”// Advance from Phase 2 to Phase 3advanceToPhase3(sessionId: string) → Returns: { state: BriefingFlowState, phase3Blocks: Block[] }
// Mark a specific risk as resolved/acknowledgedresolveRisk(sessionId: string, riskId: string) → Returns: BriefingFlowStateValter API Integration
Section titled “Valter API Integration”| Endpoint | Purpose |
|---|---|
/v1/graph/optimal-argument | Adversarial analysis — generates strongest arguments both for and against |
/v1/graph/divergencias | Analyzes divergences between ministers and court divisions |
/v1/graph/temporal-evolution | Temporal trends in how decisions on this topic have evolved |
Risk Weight System
Section titled “Risk Weight System”The risk balance uses a weighted scoring model defined in the Block Factory:
// Severity × Probability → Weighted Score (0-100)const weights = { alta: { provavel: 90, possivel: 75, improvavel: 60 }, media: { provavel: 60, possivel: 45, improvavel: 30 }, baixa: { provavel: 40, possivel: 25, improvavel: 15 }};Each risk is scored, and the aggregate determines the overall balance visualization.
Innovation: Contradição Estratégica
Section titled “Innovation: Contradição Estratégica”Phase 3 is designed to support an adversarial dual-view feature (“Contradição Estratégica”):
- Call Valter
/v1/graph/optimal-argumenttwice — once for the “for” side, once for “against” - Call
/v1/graph/divergenciasfor minister-level disagreements - Render a 3-zone strategic balance visualization
This provides lawyers with both sides of the argument in a single view — a capability no commercial legal AI currently offers.
🚧 Planned Feature — Phase 3 is planned for v0.4 milestone.