Skip to main content
rio v0.3

ARCHITECTURE · EXECUTION BOUNDARY & EVIDENCE CONTRACT

What runs where, and what the exit code means.

Which stages execute locally on your machine, which ones run in your Cloudflare account, how evidence tiers and blind multi-agent verification cut false positives, and how Rio gates CI builds with SARIF 2.1.0.

Where every stage executes.

No endpoint configured? Steps 1–3 and 7 run fully offline; 4–6 show as deferred.

On your machine

STEPS 01, 02, 03, 07
  • 01 Prepare

    Computes diff against working tree, staged index, or merge-base.

  • 02 Checks

    Runs tsc, ESLint, Pyright, Ruff, Clippy, tests, coverage, secrets, and audit.

  • 03 Graph

    Builds bounded caller/import/test graph around every changed symbol.

  • 07 Report

    Renders interactive ratatui TUI or exports SARIF, JSON, and Markdown.

Cache & offline mode →

In your Cloudflare account

STEPS 04, 05, 06
  • 04 Triage

    Selects risk-weighted hunks and bounded graph slices under your token budget.

  • 05 Agents

    Runs specialist reviewers (correctness, security, performance, tests, contracts).

  • 06 Verify

    Blind multi-voter quorum checks every proposed issue independently before surfacing.

  • Memory & PRs

    D1/R2 stores finding lineage, dismissals, and suppression proposals for your team.

Self-hosting & cost guide →

CUTTING AI FALSE POSITIVES

Blast-radius impact analysis plus blind quorum verification.

AI code review tools generate noisy comments for two reasons: they inspect diff hunks without caller context, and they post every hypothesis straight to the pull request. Rio fixes both before surfacing a single comment.

01 · BOUNDED IMPACT GRAPH

Real callers, not whole-repo noise

Stage 03 runs locally in milliseconds for TypeScript, Python, and Rust to map imports, callers, and affected test files around each modified symbol. Specialist agents receive exact downstream contracts instead of guessing from an isolated diff.

02 · EVIDENCE TIERS

Facts separated from hypotheses

Compiler errors, failing tests, and secret matches receive reproduced or static_proven tiers. Unverified model proposals stay plausible and never silently fail a build unless your YAML profile opts in.

03 · BLIND QUORUM

Independent voters filter guesses

In stage 06, separate verifier models evaluate each AI finding without seeing peer votes. Claims backed by a counterexample or missing context are marked refuted and dropped before they reach your PR.

Exit codes that don't hide skipped checks.

Read check outcomes before reading findings. Zero findings with skipped or failed checks means the review is incomplete.

Full Results & Exit Codes docs →
0 No policy failure (optional checks may still be skipped)
1 One or more findings matched the repository failure policy
2 Usage, configuration, or profile validation error
3 Repository, internal, or persistence failure
4 Incomplete or cancelled analysis, or a required check was skipped
5 PR publication failed after an otherwise passing review
130 Interrupted twice (second Ctrl-C / SIGTERM)

Version-controlled review policy in YAML.

Commit .rio/profiles/default.yaml to extend a built-in profile (rio/base, rio/openrouter, rio/security, rio/critical, rio/qa). Maps merge, lists replace. Check it with rio profile validate.

Profiles & Recipes docs →
.rio/profiles/default.yaml
rio profile show rio/base
version: 1
name: strict
extends: rio/openrouter
publish: ask
fail_on:
  required_checks: [typecheck, lint]
  min_evidence: static_proven

# Inspect and validate before running:
$ rio profile init
$ rio profile validate

CI & GITHUB CODE SCANNING

Export SARIF 2.1.0 without swallowing build failures.

In CI environments, Rio disables the TUI automatically and exports SARIF 2.1.0, JSON, or Markdown. Capture the exit status before uploading rio.sarif to GitHub Code Scanning so security alerts appear inline on the PR while preserving your merge gate.

Read full CI & SARIF documentation →
.github/workflows/rio.yml
name: Rio Code Review
on: [pull_request]

permissions:
  contents: read
  security-events: write

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Rio
        run: curl -fsSL https://getrio.dev/install.sh | sh
      - name: Run Rio and preserve exit code
        id: rio
        run: |
          status=0
          rio review --base origin/main --format sarif > rio.sarif || status=$?
          echo "status=$status" >> "$GITHUB_OUTPUT"
      - name: Upload SARIF to GitHub Code Scanning
        if: always() && hashFiles('rio.sarif') != ''
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: rio.sarif
      - name: Enforce Rio policy gate
        run: exit "${{ steps.rio.outputs.status }}"

ARCHITECTURE FAQ

Questions about Rio's pipeline and verification.

Why does Rio separate findings into four evidence tiers?

Most AI code review tools mix compiler facts with model guesses in the same comment stream. Rio tags every finding as reproduced, static_proven, plausible, or refuted so CI policies can fail builds strictly on static_proven or reproduced findings while keeping plausible AI hypotheses advisory.

How does the bounded impact graph improve review quality and lower token cost?

Instead of uploading an entire repository or relying solely on isolated diff hunks, stage 03 walks local AST and import references for TypeScript, Python, and Rust to identify direct callers and affected tests. Only that bounded blast-radius slice is sent to AI reviewers, improving accuracy and cutting token consumption.

What happens if a required tool like tsc, Ruff, or Clippy is missing in CI?

Rio never treats a skipped required check as a clean pass. If a check listed in fail_on.required_checks cannot execute or a budget cancels an analysis stage, Rio exits with code 4 so CI pipelines distinguish incomplete runs from passing reviews.

Does Rio send source code to third-party servers when running locally?

No. Stages 01, 02, 03, and 07 execute entirely on your machine. Without a configured Cloudflare endpoint, stages 04 to 06 are marked deferred and no code leaves your laptop. Adding --offline disables Rio network requests such as dependency audits.