agi4-schema
JSON schema and serialization types for AGI/4 verdict outputs.
Defines the canonical JSON structure for verdicts, with automatic schema generation and validation.
Features
- VerdictOutput: Top-level envelope with metadata, conjuncts, consistency check, verdict, reasons
- Conjunct Reports: Per-conjunct evaluation results with evidence tables, margins, provenance
- Evidence Reporting: Source, measurement ID, value, threshold, pass/fail indicators
- Margin Analysis: Min/max margin values for variance-bound consistency checks
- Provenance Links: Upstream source metadata (endpoint, refresh cadence, version)
- JSON Schema Generation: Automatic schema generation via schemars for external validation
- Schema Drift Detection: CI test that fails if generated schema drifts from committed version
JSON Structure
Usage
use ;
use serde_json;
// Serialize a verdict to JSON
let json = to_string_pretty?;
// Parse JSON into VerdictOutput
let verdict: VerdictOutput = from_str?;
// Generate schema
let schema = generate_schema;
let schema_str = schema_json_string?;
See Also
- agi4-core — Verdict logic
- agi4-report — Markdown rendering
- SPEC.md — Specification