Skip to main content

Bounded AI review, remediation, and re-review automation for local repositories.

Project description

revrem

CI PyPI Python License: Apache-2.0

Run a bounded AI review → fix → verify loop on your local branch — before you push.

RevRem asks Codex to review your branch against a base, applies valid actionable findings through a bounded remediation pass, reruns your own verification commands, and leaves an inspectable artifact trail — all locally, before you open a pull request.

Early but functional (v0.3.x, alpha). RevRem is used daily on its own development. It works end to end today, but interfaces may still shift.

revrem running a review then fix then verify loop: a P1 finding is remediated, pytest passes, and the re-review comes back clear.

Text version of the demo
$ revrem --base main --max-iterations 2 --check "pytest -q"
12:08:23|rev|1   |start: codex review --base main
12:10:14|rev|1   |[P1] Preserve failure artifacts when review startup fails
12:10:15|rem|1   |start: codex exec --full-auto --sandbox workspace-write ...
12:13:41|rem|1   |done
12:13:42|chk|1.1 |start: pytest -q
12:14:18|chk|1.1 |passed
12:14:19|rev|2   |clear

Review-remediation loop: clear (review_clear)
Artifacts: .revrem/runs/20260509T120823Z
JSON summary: .revrem/runs/20260509T120823Z/summary.json

The demo above is a scripted reconstruction of RevRem's real output format, not a live model-backed capture. Source: docs/assets/.

Why revrem

  • Entirely local. No hosted service, no telemetry — RevRem runs on your machine against your checkout.
  • Bounded and watched. Iterations are capped by default, and the run exits with a clear pass/fail status code you can gate CI or hooks on.
  • Inspectable. Every run writes review, remediation, check, and summary artifacts you can read before committing or merging.
  • Works at any stage. Use it pre-commit, pre-merge, or post-merge — wherever a fast, automated review-and-fix pass adds confidence.

Install

Install from PyPI with pipx (recommended):

pipx install revrem
revrem --version

If you do not use pipx, install into a managed virtual environment:

python -m pip install revrem
revrem --version

To work on RevRem itself, see Development.

The repository and Python package use the public name revrem. The legacy code-review-loop command remains available as a compatibility alias.

Quick Start

From the repository you want to review:

revrem --base main --max-iterations 2 --check "pytest -q"

Add checks that match the target repository:

revrem \
  --base main \
  --max-iterations 2 \
  --check "pytest -q" \
  --check "git diff --check"

Expected behavior:

  • exit 0 when the final loop status is clear;
  • exit 2 when findings or check failures remain after the bounded loop;
  • write artifacts to .revrem/runs/<timestamp>/;
  • append run metadata to ~/.local/share/revrem/runs.jsonl unless --no-run-history is used.

Use repository-native checks. Python repositories can use pytest; TypeScript repositories usually use commands such as pnpm test, pnpm run typecheck, and pnpm run lint.

Before a live, model-backed loop, run setup diagnostics (no model is invoked):

revrem doctor --base main --check "pytest -q"

revrem doctor validates the Git base, a writable artifact path, the Codex executable, routed remediation harnesses, and configured checks. Use --format json for automation. See the operator guide for the full diagnostics contract.

How It Works

RevRem is intentionally local, watched, and bounded:

  1. Runs codex review against a chosen base branch.
  2. Detects whether the review is clear or has findings.
  3. Runs a bounded Codex remediation pass for valid actionable findings.
  4. Runs your configured verification commands.
  5. Repeats until the review is clear or --max-iterations is reached.
  6. Writes review, remediation, check, and summary artifacts for inspection.

Key Features

  • Profiles keep long commands repeatable, with per-phase model, effort, and timeout control.
  • Interactive wizard builds a run command in a plain terminal and previews the exact provider calls before anything runs.
  • Finding triage and routing (optional) turn review prose into ordered, schema-validated actions and route them to the right harness/model.
  • Auto-commit (optional) commits each verified remediation pass after your checks pass.
  • Bug-report bundles package a failed run into a redacted, shareable archive.
  • Git hooks install bounded pre-push/pre-commit example hooks into a target repo.
  • Rich progress and an optional Textual TUI for richer watched-terminal runs.

Each of these is documented in depth in the operator guide. Machine-readable artifact contracts live under docs/52-api/.

Profiles and the Wizard

Profiles keep long commands repeatable:

revrem config new final-pr --description "Full PR readiness check"
revrem config edit final-pr
revrem --profile final-pr

In an interactive terminal, bare revrem (or revrem --wizard) opens a guided setup. It offers your last compatible settings or the recommended defaults, then shows a run-shape preview listing the exact provider CLI commands for each phase before any model is called. Model, reasoning effort, and timeout are selectable per phase (review, triage, remediation, commit-message drafting).

Project-local profiles can be saved to .revrem.toml without running the loop:

revrem --base main --max-iterations 2 --check "git diff --check" --save-profile final-pr

For triage, routing, multi-harness setups, and the full wizard reference, see the operator guide.

Safety Model

RevRem is a pre-merge confidence tool, not a substitute for review or tests. Its safety posture is built around local operator control:

  • iteration count is bounded by default;
  • generated run artifacts are kept out of normal commits;
  • auto-commit requires a clean worktree before the loop starts, and commits only after configured checks pass;
  • machine-readable output is opt-in (--summary-format json);
  • local run history can be disabled with --no-run-history;
  • no hosted service or telemetry is part of RevRem itself.

Use --commit-after-remediation only when each verified remediation pass should become a git commit. Commit-hook failure handling, --no-redact bundle risks, and the full auto-commit contract are documented in the operator guide.

Optional Progress and TUI

Optional extras must be installed into the same environment as revrem, so revrem can import them at launch. If you installed with pipx, add the extra with pipx too (use pip install "revrem[...]" only for a plain pip install).

For richer watched-terminal output:

pipx install --force "revrem[progress]"
revrem --profile final-pr --progress-style rich

The optional TUI is dependency-gated so the default CLI stays lightweight:

pipx install --force "revrem[tui]"
revrem ui --profile final-pr

The TUI renders Home, Profiles, Pipeline, Run Monitor, and Controls views, and shells through the same CLI command plans as normal terminal usage.

Limitations

  • Codex must be installed and authenticated locally.
  • The current directory must be the repository under review.
  • The selected --base branch must share history with the current branch.
  • Review/remediation quality depends on the model and the checks you provide.
  • Human review, security review, and release approval still matter.
  • Avoid dirty worktrees unless the local edits are intentional and understood.
  • Do not use unbounded iteration counts for unattended automation.
  • Do not paste raw model transcripts or local run artifacts into public issues; use the redacted bug-report workflow instead.

Development

git clone https://github.com/GitCmurf/revrem.git
cd revrem
./scripts/install-dev
./.venv/bin/revrem --version

Run the local gates:

pre-commit install
./scripts/dev-check
pre-commit run --all-files

Ruff, mypy, pytest, DocOps checks, and git diff --check are required local and CI gates. For a stable revrem command usable from other repositories, promote a snapshot with ./scripts/promote-stable — see the operator guide.

See CONTRIBUTING.md for contribution expectations, governed documentation, and release process details.

License

This project is licensed under the Apache License 2.0; see LICENSE for details. NOTICE contains project attribution and must be preserved where Apache-2.0 notice requirements apply.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revrem-0.4.0.tar.gz (401.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revrem-0.4.0-py3-none-any.whl (258.8 kB view details)

Uploaded Python 3

File details

Details for the file revrem-0.4.0.tar.gz.

File metadata

  • Download URL: revrem-0.4.0.tar.gz
  • Upload date:
  • Size: 401.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for revrem-0.4.0.tar.gz
Algorithm Hash digest
SHA256 359cd2ad864bbcf542657919e2b525c43528f1774351a500e2ac25a7d839f17e
MD5 d8d83c5fb9692536c00b7d6944d0345c
BLAKE2b-256 16def51fde4c7353ef758d2f651236116e4add32a17c44f3ca28a32af5e2a8d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for revrem-0.4.0.tar.gz:

Publisher: release.yml on GitCmurf/revrem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file revrem-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: revrem-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 258.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for revrem-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9749f68a2d540721319d6a0bd01ad91d070eabc9c78e7f183f381313875c0e51
MD5 81c1667def1709e51e045bc0d948cf56
BLAKE2b-256 55b2b1f44d1dc7d48537e2e07a38f466271b705dfe01b073cbe8574e9674a48b

See more details on using hashes here.

Provenance

The following attestation bundles were made for revrem-0.4.0-py3-none-any.whl:

Publisher: release.yml on GitCmurf/revrem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page