{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "juriscan/output_schema_v3.json", "title": "ForensicLegalAnalysis v3", "description": "Schema v3 — superset of v2. Adds fields emitted by the agents pipeline (subagents + dialectic layer). v2 outputs remain valid against output_schema_v2.json and can be migrated with scripts/migrate_v2_to_v3.py. Fields marked 'agents-only' are optional so that legacy outputs continue to validate as-is when this schema is used to validate both (backwards compat during transition).", "type": "object", "required": ["schema_version"], "properties": { "schema_version": { "type": "string", "const": "3.0" }, "analysis_version": { "type": "string" }, "run_id": { "type": ["string", "null"], "description": "UUID generated by agent_io.py new-run. Threads the audit trail together." }, "pipeline_mode": { "type": "string", "enum": ["legacy", "agents"], "description": "Which pipeline produced this document." }, "model_pinning": { "type": "object", "description": "Map of subagent name to model id at execution time.", "additionalProperties": { "type": "string" } }, "processo_number": { "type": ["string", "null"] }, "generated_at": { "type": "string" }, "pdf_info": { "type": "object" }, "processo_metadata": { "type": "object" }, "chunks": { "type": "array", "items": { "type": "object", "description": "Chunk entries, with new optional fields from Phase 2 segmenter/parser.", "additionalProperties": true, "properties": { "index": { "type": "integer" }, "id": { "type": "string", "description": "Sequential id from segmenter (e.g. c00)." }, "label": { "type": "string" }, "char_count": { "type": "integer" }, "chunk_file": { "type": "string" }, "start_char": { "type": "integer" }, "end_char": { "type": "integer" }, "confianca": { "type": "number" }, "_enriched": { "type": "object" } } } }, "process_state": { "type": "string", "enum": ["ativo", "transito_em_julgado", "suspenso", "arquivado", "desconhecido"] }, "process_state_confidence": { "type": "number", "minimum": 0.0, "maximum": 1.0 }, "perspectives": { "type": "object", "description": "Two-polo risk view — replaces v2 single risk score.", "properties": { "autor": { "oneOf": [{ "$ref": "#/definitions/perspective" }, { "type": "null" }] }, "reu": { "oneOf": [{ "$ref": "#/definitions/perspective" }, { "type": "null" }] } } }, "auditor_findings": { "type": "array", "items": { "type": "object", "required": ["tipo", "fundamento", "impacto", "descricao", "acao_sugerida"], "additionalProperties": true, "properties": { "tipo": { "type": "string", "enum": [ "NULIDADE", "OMISSAO", "TEMPESTIVIDADE", "RECALCULO_NECESSARIO", "PRECLUSAO", "INCOMPETENCIA", "CITACAO_IRREGULAR", "OUTRO" ] }, "fundamento": { "type": "string" }, "impacto": { "type": "string", "enum": ["ALTO", "MÉDIO", "BAIXO"] }, "peca_ref": { "type": "string" }, "pecas_relacionadas": { "type": "array", "items": { "type": "string" } }, "descricao": { "type": "string" }, "acao_sugerida": { "type": "string" } } } }, "verifications": { "type": "array", "items": { "type": "object", "required": ["tipo", "citacao_original", "status", "source_url", "access_date"], "additionalProperties": true, "properties": { "tipo": { "type": "string" }, "citacao_original": { "type": "string" }, "status": { "type": "string", "enum": ["CONFIRMADO", "DIVERGENTE", "NAO_ENCONTRADO"] }, "source_url": { "type": "string" }, "access_date": { "type": "string" }, "trecho_oficial": { "type": "string" }, "divergencia": { "type": ["string", "null"] } } } }, "verification_summary": { "type": "object", "description": "Aggregated by confidence_rules.py.", "additionalProperties": true }, "monetary_recalculations": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "dissensos": { "type": "array", "items": { "type": "object" } }, "resumo_executivo": { "type": "string" }, "audit_trail_uri": { "type": "string", "description": "file:// URL pointing to .juriscan/audit/.jsonl" } }, "definitions": { "perspective": { "type": "object", "required": ["risk_level", "risk_score"], "properties": { "risk_level": { "type": "string", "enum": ["MUITO_BAIXO", "BAIXO", "MÉDIO", "ALTO", "MUITO_ALTO"] }, "risk_score": { "type": "number", "minimum": 0.0, "maximum": 10.0 }, "forcas": { "type": "array", "items": { "type": "object" } }, "fraquezas": { "type": "array", "items": { "type": "object" } }, "recursos_cabiveis": { "type": "array", "items": { "type": "object" } } } } } }