Skip to main content

tri doctor — Pipeline Health System

Enforces pipeline-first development. Scans, classifies, and heals the codebase to ensure generated code stays in sync with .tri specs.

Subcommands

CommandArgumentsDescription
tri doctorOne-line health status
tri doctor initScan + mark + report (all-in-one)
tri doctor scanClassify all .zig files to .doctor/scan_results.json
tri doctor markAdd @origin/@regen markers (reverts if build fails)
tri doctor reportHealth score dashboard with emoji grades
tri doctor planCreate migration queue to .doctor/migration_queue.json
tri doctor healRegenerate manual files through pipeline
tri doctor enforceShow hook setup instructions
tri doctor enforce-checkHook binary: reads JSON stdin, outputs permit/deny

Health Formula

health = 100 * (0.4 * generated_ratio + 0.3 * compliance_rate
+ 0.2 * specs_coverage + 0.1 * tests_passing)
ScoreGrade
90+HEALTHY
70-89RECOVERING
50-69INFECTED
0-49CRITICAL

State Directory

All doctor state lives in .doctor/:

  • scan_results.json — last scan output
  • violations.jsonl — blocked writes
  • migration_queue.json — pending regeneration
  • mark_history.jsonl — mark operations

Examples

tri doctor                         # Quick health check
tri doctor init # Full scan + mark + report
tri doctor report # Detailed health dashboard
tri doctor heal # Auto-fix via pipeline
tri doctor plan # Show migration queue

Handler

File: src/tri/tri_commands.zig:1706