How iokuru/brio works
Brio is a command-line grader for AI-agent trajectories: users provide a YAML ruleset and one or more JSONL traces, and Brio evaluates the recorded steps and reports pass/fail results. The main path runs through CLI input handling, specification parsing and rule construction, trace parsing, rule evaluation, and formatted reporting. The README also documents starter-spec generation and text, JSON, and GitHub output. The sampled source shows the CLI orchestration and core rule/trace behavior; report-format details are represented from documented capabilities.
Main entry points: main.go Brio CLI · spec.go Rule construction · trace.go Trace parsing · required_calls.go Required calls
Components 15
CLI workflow
- Brio CLI
cmd/brio/main.go
Specification and traces
- Spec parsing
internal/spec/spec.go - Trace parsing
internal/trace/trace.go
Trajectory grading
- Rule construction
internal/spec/spec.go - Required calls
internal/rules/required_calls.go - Forbidden calls
internal/rules/forbidden_calls.go - Call ordering
internal/rules/order.go - Call subsequence
internal/rules/subsequence.go - Argument matching
internal/rules/arg_match.go - Execution limits
internal/rules/limits.go
Results
- Report formatting
internal/report
Other components
- CLI user
- YAML specification
- JSONL trace
- Grade output
Connections 28
- CLI user → Brio CLI: runs commands
README.md - Brio CLI → YAML specification: writes starter spec
cmd/brio/main.go - Brio CLI → Spec parsing: loads spec
cmd/brio/main.go - YAML specification → Spec parsing: provides YAML
README.md - Brio CLI → Trace parsing: parses traces
cmd/brio/main.go - JSONL trace → Trace parsing: provides JSONL
README.md - Spec parsing → Rule construction: builds rules
internal/spec/spec.go - Brio CLI → Rule construction: requests rules
cmd/brio/main.go - Rule construction → Required calls: constructs
internal/spec/spec.go - Rule construction → Forbidden calls: constructs
internal/spec/spec.go - Rule construction → Call ordering: constructs
internal/spec/spec.go - Rule construction → Call subsequence: constructs
internal/spec/spec.go - Rule construction → Argument matching: constructs
internal/spec/spec.go - Rule construction → Execution limits: constructs
internal/spec/spec.go - Brio CLI → Required calls: checks trace
cmd/brio/main.go - Brio CLI → Forbidden calls: checks trace
cmd/brio/main.go - Brio CLI → Call ordering: checks trace
cmd/brio/main.go - Brio CLI → Call subsequence: checks trace
cmd/brio/main.go - Brio CLI → Argument matching: checks trace
cmd/brio/main.go - Brio CLI → Execution limits: checks trace
cmd/brio/main.go - Required calls → Trace parsing: reads tool calls
internal/rules/required_calls.go - Forbidden calls → Trace parsing: reads tool calls
internal/rules/forbidden_calls.go - Call ordering → Trace parsing: reads tool calls
internal/rules/order.go - Call subsequence → Trace parsing: reads tool calls
internal/rules/subsequence.go - Argument matching → Trace parsing: reads arguments
internal/rules/arg_match.go - Execution limits → Trace parsing: reads steps
internal/rules/limits.go - Brio CLI → Report formatting: creates reports
cmd/brio/main.go - Report formatting → Grade output: renders results
README.md