No description
  • Python 89.8%
  • HTML 7%
  • CSS 2.9%
  • Dockerfile 0.3%
Find a file
2026-07-14 20:34:35 -04:00
.github/workflows Update .github/workflows/publish-docker-image.yml 2026-07-06 07:10:22 -04:00
alembic Add Forgejo OAuth connection flow 2026-07-06 02:03:32 +00:00
docs/adr Add Forgejo OAuth connection flow 2026-07-06 02:03:32 +00:00
temper Merge pull request 'Add targeted hygiene findings to Temper reviews' (#7) from t3code/hygiene-review into dev 2026-07-14 20:34:35 -04:00
tests Merge pull request 'Add targeted hygiene findings to Temper reviews' (#7) from t3code/hygiene-review into dev 2026-07-14 20:34:35 -04:00
.env.example Configure LLM timeout and local port 2026-07-09 01:31:31 +00:00
.gitignore Initial Temper implementation 2026-07-05 18:14:16 +00:00
alembic.ini Initial Temper implementation 2026-07-05 18:14:16 +00:00
CONTEXT.md Add Forgejo OAuth connection flow 2026-07-06 02:03:32 +00:00
docker-compose.yml Configure LLM timeout and local port 2026-07-09 01:31:31 +00:00
Dockerfile Initial Temper implementation 2026-07-05 18:14:16 +00:00
LICENSE Initial commit 2026-07-05 14:03:08 -04:00
pyproject.toml Initial Temper implementation 2026-07-05 18:14:16 +00:00
README.md Configure LLM timeout and local port 2026-07-09 01:31:31 +00:00

Temper

Code, tempered.

Temper is a self-hosted AI pull request reviewer for Forgejo-first teams. It receives Forgejo webhooks, reviews pull request diffs with an OpenAI-compatible model, and posts one managed PR summary plus high-confidence inline findings.

MVP Features

  • Forgejo webhook ingestion with HMAC signature validation and delivery de-duplication.
  • Forgejo OAuth app connection flow for statuses, PR summaries, and inline review comments.
  • Global OpenAI-compatible provider configuration.
  • Editable reviewer profiles with rule-based selection.
  • Local admin login, Jinja/HTMX-style admin UI, Postgres persistence, Redis/Celery worker.
  • Secret redaction before prompting and encrypted credential storage.
  • Advisory temper/review commit status.
  • Untrusted fork PRs require maintainer-triggered labels or slash commands.

Run With Docker Compose

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

Open http://localhost:61055, log in with TEMPER_ADMIN_EMAIL and TEMPER_ADMIN_PASSWORD, configure the LLM provider, then connect a Forgejo OAuth app and repository.

Forgejo OAuth App

Create a Forgejo OAuth application on the Forgejo instance and set its redirect URI to:

{TEMPER_PUBLIC_BASE_URL}/admin/forgejo/oauth/callback

Use a dedicated Forgejo user, commonly named temper, to authorize the OAuth app. Temper stores OAuth access and refresh tokens encrypted at rest and uses them to:

  • read repository pull request data,
  • create statuses,
  • create/edit issue comments,
  • create pull reviews and inline review comments,
  • create repository webhooks when API-assisted onboarding is enabled.

Forgejo OAuth scopes are not currently implemented, so OAuth is an onboarding convenience rather than a least-privilege security improvement over scoped Forgejo access tokens. Grant the dedicated Forgejo account access only to repositories Temper should review.

Webhook Events

Temper expects Forgejo JSON webhooks for pull request open/reopen/sync, labels, and PR comments. The endpoint is:

POST /webhooks/forgejo/{installation_id}

Slash commands:

  • /temper review
  • /temper review <profile-slug>
  • /temper rerun

Labels:

  • temper:review
  • temper:skip
  • temper:profile/<profile-slug>

Development

python3 -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'
.venv/bin/python -m pytest
.venv/bin/python -m ruff check .
.venv/bin/python -m mypy temper