Skip to content

Repository files navigation

RepoReaper by PatchHive

RepoReaper autonomously fixes selected repository issues and opens validated pull requests.

It is PatchHive's outbound contribution product: a multi-agent system that finds promising issues, selects likely code targets, generates patches, reviews and refines those patches, runs validation, and then opens a pull request when the result clears its gates.

Product Documentation

Core Workflow

  • hunt open GitHub issues and rank them for fixability
  • choose relevant files and code paths before patch generation
  • generate, review, and refine a proposed fix through product-owned agents
  • run validation inside configured safety limits
  • open an attributed PatchHive pull request only when the result clears the gates
  • enrich patch attempts with RepoMemory context when configured
  • queue FailGuard candidates in RepoMemory when Smith rejects generated work

Operating Model

RoleResponsibility
ScoutFinds candidate issues and scores them for fixability.
JudgeNarrows the patch to the most relevant files and code paths.
ReaperGenerates the initial fix.
SmithReviews and improves the patch before it moves forward.
GatekeeperRuns validation and handles pull request delivery.

Run Locally

Docker

cp .env.example .env
docker compose up --build

Frontend: http://localhost:5173 Backend: http://localhost:8000

Split Backend and Frontend

cp .env.example .env
cd backend && cargo run
cd ../frontend && npm install && npm run dev

Important Configuration

VariablePurpose
BOT_GITHUB_TOKENFine-grained PAT used for repo discovery, clone, push, and pull request creation. Recommended scopes: Metadata (read), Contents (read/write), Issues (read/write), Pull requests (read/write), plus Workflows (read/write) when patching .github/workflows.
BOT_GITHUB_USER / BOT_GITHUB_EMAILGit identity for PatchHive commits and pull requests.
PROVIDER_API_KEYDirect AI provider API key when not using a local OpenAI-compatible gateway.
PATCHHIVE_AI_URLOptional OpenAI-compatible local gateway such as @patchhive/ai-local.
OLLAMA_BASE_URLOptional Ollama endpoint.
COST_BUDGET_USDRun budget cap.
MIN_REVIEW_CONFIDENCEMinimum Smith confidence before validation and PR delivery.
RETRY_COUNTPatch or validation retry count.
REAPER_ENABLE_UNTRUSTED_TESTSEnables validation commands for untrusted repos. Default is disabled.
REAPER_TEST_SANDBOXTest sandbox mode, usually docker.
REAPER_ALLOW_HOST_TESTSAllows host test execution when explicitly enabled.
REAPER_TEST_TIMEOUT_SECONDSValidation timeout, defaulting to 600.
WEBHOOK_SECRETOptional webhook secret for watch-mode triggers.
PATCHHIVE_REPO_MEMORY_URL / PATCHHIVE_REPO_MEMORY_API_KEYOptional RepoMemory context and FailGuard candidate destination.
REAPER_API_KEY_HASHOptional pre-seeded app auth hash. Otherwise generate the first local key from the UI.
REAPER_SERVICE_TOKEN_HASHOptional service-token hash for HiveCore or other PatchHive service callers.
REAPER_DB_PATHSQLite path for runs, costs, and PR tracking.
REAPER_WORK_DIRLocal workspace used for cloned repositories and patch attempts.
REAPER_PORTBackend port for split local runs.

To reuse the same password across SignalHive, TrustGate, RepoReaper, and HiveCore, run ./scripts/set-suite-api-key.sh --stack first from the monorepo root before starting the stack. For every PatchHive product, run ./scripts/set-suite-api-key.sh. Once the hash is pre-seeded, RepoReaper can be used through a subdomain without remote bootstrap.

To give HiveCore a dedicated machine credential instead of reusing the operator login secret, generate a service token from POST /auth/generate-service-token and save that token in HiveCore Settings.

If you only want to work on public repositories, keep your GitHub token public-only. If you want RepoReaper to clone, push, and open pull requests against specific repositories, grant only the write permissions those repositories actually need.

AI and Platform Integrations

RepoReaper can run through direct provider APIs or through @patchhive/ai-local.

PATCHHIVE_AI_URL=http://127.0.0.1:8787/v1

Optional integrations:

  • PATCHHIVE_REPO_MEMORY_URL to load remembered conventions, hotspots, and failure patterns, and to queue FailGuard candidates from Smith rejections
  • future TrustGate and MergeKeeper flows to gate outbound changes more tightly

Safety Boundary

  • first-time API-key bootstrap is localhost-first
  • untrusted repo test execution is disabled by default
  • if tests are enabled, Docker sandboxing is the default
  • host test execution requires both REAPER_ENABLE_UNTRUSTED_TESTS=true and REAPER_ALLOW_HOST_TESTS=true
  • validation commands time out after REAPER_TEST_TIMEOUT_SECONDS seconds, defaulting to 600
  • validation and pull request publication are treated as explicit gates, not incidental side effects
  • FailGuard is cross-cutting: RepoReaper can suggest candidates from Smith rejections, but RepoMemory owns review and promotion

RepoReaper is the only current PatchHive product that writes code and opens pull requests. It should be the last step in the early suite loop, after signal and trust layers have made the candidate work visible and reviewable.

HiveCore Fit

HiveCore should treat RepoReaper as a product-owned autonomous action surface. It can show health, capabilities, run history, dispatchable actions, and PR outcomes, but RepoReaper keeps ownership of patch generation, validation, attribution, and pull request delivery.

Standalone Repository

The PatchHive monorepo is the source of truth for RepoReaper development. The standalone patchhive/reporeaper repository is an exported mirror of this directory.

About

RepoReaper scans your GitHub issues, identifies high-impact problems, generates fixes, validates them, and opens pull requests—without human intervention.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages