mirror of
https://github.com/Sea-Haven-Industries/pr-reviewer.git
synced 2026-10-06 14:42:12 +00:00
Pre-compute PR reviews so they are ready the moment a PR is opened in the queue, instead of waiting on an on-demand Fireworks call each time. A daemon worker polls the queue every POLL_INTERVAL and reviews new or changed non-draft PRs into a local SQLite cache (gitignored). Change detection is two-level: skip when the PR's updated_at is unchanged, and even when it moved, skip the model call when the diff's SHA-256 matches, so comment-only bumps do not burn tokens. Failed reviews retry up to MAX_REVIEW_ATTEMPTS with 429 backoff; departed PRs are closed with a grace window before purge. Singletons are initialized eagerly in the FastAPI lifespan before the worker thread starts to avoid an init race; all cache writes are serialized. New endpoints GET /api/reviews and POST /api/refresh back a dashboard that polls for status (reviewing/ready/error) and opens a ready review instantly. Nothing is posted automatically; the human still decides. Stdlib-only, so no new runtime or test dependencies.
15 lines
191 B
Text
15 lines
191 B
Text
# Secrets and local env
|
|
.env
|
|
|
|
# Local review cache (SQLite + WAL/SHM sidecars)
|
|
pr_cache.db
|
|
pr_cache.db-*
|
|
|
|
# Python virtualenv and caches
|
|
.venv/
|
|
__pycache__/
|
|
*.pyc
|
|
*.pyo
|
|
|
|
# OS cruft
|
|
.DS_Store
|