// Local review harness — entry point. // // Subcommands per PROMPT.md: // repo /path — full-repo review (Phase B MVP) // diff /path — diff/PR-style review (Phase E) // scrum /path — scrum-test report bundle (Phase B MVP) // rules /path — rules audit (Phase E) // model doctor — Ollama probe + JSON shape (Phase A stub, Phase C real) // // PROMPT.md hard rules apply: no cloud deps, no auto-commit, no // destructive changes to the target repo, no fake success. package main import ( "flag" "fmt" "os" "local-review-harness/internal/cli" ) func main() { if len(os.Args) < 2 { usage() os.Exit(2) } // Per-subcommand flag sets. Common flags (--review-profile, // --model-profile, --output-dir) live on each FlagSet rather than // a global pre-parser; the CLI library would be overkill for 5 // subcommands. sub := os.Args[1] args := os.Args[2:] switch sub { case "repo": os.Exit(cli.Repo(args)) case "diff": os.Exit(cli.Diff(args)) case "scrum": os.Exit(cli.Scrum(args)) case "rules": fmt.Fprintln(os.Stderr, "rules: not implemented in MVP (Phase E)") os.Exit(64) case "model": // Two-token verb: "model doctor" if len(args) < 1 { fmt.Fprintln(os.Stderr, "model: missing verb (try: model doctor)") os.Exit(2) } switch args[0] { case "doctor": os.Exit(cli.ModelDoctor(args[1:])) default: fmt.Fprintf(os.Stderr, "model: unknown verb %q\n", args[0]) os.Exit(2) } case "-h", "--help", "help": usage() os.Exit(0) case "version": fmt.Println("review-harness 0.1.0 (Phase A skeleton)") os.Exit(0) default: fmt.Fprintf(os.Stderr, "unknown subcommand: %q\n", sub) usage() os.Exit(2) } _ = flag.CommandLine // keep import stable across phases } func usage() { fmt.Fprint(os.Stderr, `review-harness — local-first code review Usage: review-harness repo full-repo review (MVP) review-harness scrum scrum-test report bundle (MVP) review-harness model doctor probe Ollama / configured models review-harness diff diff review (Phase E, not yet) review-harness rules rules audit (Phase E, not yet) review-harness version print version review-harness help this message Common flags (per subcommand): --review-profile YAML; defaults applied if omitted --model-profile YAML; defaults applied if omitted --output-dir override review-profile output dir --enable-llm also run local-Ollama LLM review (Phase C) `) }