# Rio (v0.3.0)

> Own your AI code review pipeline. Open-source, Apache-2.0, terminal-first.

Review changes before you push. Deterministic checks run locally with no setup. AI reviewers, GitHub PR comments, and Browser QA are opt-in and run on your own Cloudflare account.

- Website: https://getrio.dev
- Source: https://github.com/pixelinfinito/rio
- Wiki: https://github.com/pixelinfinito/rio/wiki
- License: Apache-2.0 (made by [Pixel Infinito](https://pixel.ao))

## Quick install

```sh
curl -fsSL https://getrio.dev/install.sh | sh
```

Supports Linux, macOS, and Windows (x64 and arm64) with SHA-256 verification. Full instructions: https://getrio.dev/install.md

## Three opt-in layers

1. **Local review (default, zero cloud)**: Type checks, lint, changed-line coverage, secret scanning, dependency audit, and an impact graph using the tools already in your repo. Run `rio review`.
2. **Hosted AI & PR review (optional, your Cloudflare)**: AI reviewers, blind multi-voter verification, security catalogs, automated GitHub PR comments, and finding memory across rounds. Needs a Cloudflare endpoint and model provider keys. Run `rio init`.
3. **Browser QA (optional, Docker runner)**: Scripted journeys in an isolated browser across mobile and desktop viewports in light and dark themes. Produces masked screenshots, DOM snapshots, traces, accessibility checks, and UX findings. Run `rio qa --full`.

## Seven-step pipeline

The first three steps and the final report step run on your machine:

1. **01 Prepare (local)**: Diff working tree, staged index, branch, or PR.
2. **02 Checks (local)**: Run repo-local typecheck, lint, tests, coverage, secrets.
3. **03 Graph (local)**: Map bounded callers, imports, and affected tests around every changed symbol.
4. **04 Triage (cloud)**: Route high-risk hunks to specialist AI agents under your token budget.
5. **05 Agents (cloud)**: Specialist reviewers for correctness, security, performance, tests, and contracts.
6. **06 Verify (cloud)**: Independent blind quorum votes before surfacing.
7. **07 Report (local)**: Interactive ratatui TUI, SARIF, JSON, Markdown, or PR comment.

## Built-in language and repository adapters

Rio uses the tools already installed in your repository. Run `rio doctor` to verify.

- **TypeScript**: tsc, ESLint, Vitest / Jest (changed-line coverage)
- **Python**: Pyright / mypy, Ruff, pytest + coverage.py
- **Rust**: cargo, Clippy, rustfmt, cargo-llvm-cov
- **All repos**: Secret scanning, dependency audit, bounded impact graph

## Evidence tiers and blind verification

Zero findings combined with skipped checks means the review is incomplete, not clean. Every finding carries an evidence tier:

- `reproduced`: Execution proof backed by a failing test, reproduction trace, or runtime check.
- `static_proven`: Compiler or static proof from tsc, Clippy, Pyright, Ruff, or AST analysis.
- `plausible`: Verified hypothesis cross-checked by blind AI verifiers; requires human judgment.
- `refuted`: Disproved by independent voters and filtered out of your PR.

Blind verifiers vote independently on each AI finding without seeing each other's answers. Unsupported findings are dropped. `--since-last` tracks findings across rounds, and `rio feedback` turns repeated dismissals into team suppression proposals.

## Impact graph

Before any token goes to a model, Rio maps callers, imports, and affected tests locally in milliseconds for TypeScript, Python, and Rust. Press `g` in the TUI to inspect the impact graph.

## Self-hosting on Cloudflare

`rio init` provisions the Worker, Workflows, D1, R2, Queue, AI Gateway, and a Cloudflare Sandbox or Docker runner. No Wrangler and no source checkout are required. Works with OpenRouter, Anthropic, or any OpenAI- or Anthropic-compatible endpoint.

- Connect a team endpoint: `rio init --endpoint URL --token-stdin`
- Install GitHub App: `rio init --github-app`
- Trigger from PR comments: `/rio review` or `/rio dismiss <id>`

## CI and SARIF

Define repository policy in `.rio/profiles/default.yaml` extending `rio/base`, `rio/openrouter`, `rio/security`, or `rio/critical`. In CI, the TUI disables automatically and exports SARIF, JSON, or Markdown:

```sh
status=0
rio review --base origin/main --format sarif > rio.sarif || status=$?
# Upload rio.sarif to GitHub Code Scanning, then fail on policy:
exit "$status"
```

## Offline docs for coding agents

```sh
rio docs
rio docs search "profiles"
rio docs profiles --section inheritance
rio docs review --format json
```
