Under the instrument.

How Vernier reads your diffs, reuses its work, and fits into your workflow.

Pipeline

  1. Parse a GitHub pull request URL or a unified diff into file hunks.
  2. Run heuristic detectors on added lines (injection, pickle, XSS, N+1, secrets, and more).
  3. Hash each hunk with the prompt version and model name.
  4. Skip Redis hits. Pack misses into character-bounded batches and call the LLM once per batch.
  5. Merge overlapping findings, attach a fix and a test stub, store the review in PostgreSQL.

Environment

Copy .env.example to .env. Default LLM endpoint is SpaceXAI at https://api.x.ai/v1 using the OpenAI-compatible SDK. Set LLM_BASE_URL to https://api.openai.com/v1 if you want OpenAI itself.

Webhooks

Send GitHub pull_request events to POST /api/webhooks/github. When GITHUB_WEBHOOK_SECRET is set, the handler requires X-Hub-Signature-256.

CI

pytest covers diff parsing, detectors, batching, Redis-style cache keys, and the review workflow. The GitHub Actions workflow also typechecks and builds the Next.js app.