PR Analysis & Triage

Oversight analyzes all open pull requests in a repository, ranks them by priority, and generates AI-powered summaries with risk/size/urgency dimensions so you can triage efficiently.

How It Works

When you trigger a PR analysis, oversight fetches every open pull request from the GitHub API, including metadata like diff stats (additions, deletions, changed_files), labels, author, merge status, and timestamps. It then passes all of this context to Claude Opus, which evaluates each PR on multiple dimensions and produces a ranked, prioritized list.

The analysis runs as an asynchronous task — you trigger it through the web UI or API, and the local runner daemon picks it up and executes it. Progress is streamed in real time via Supabase Realtime so you can watch results arrive.

Triggering an Analysis

Create a PR analysis through the API:

API Request http
POST /api/analyses
Content-Type: application/json

{
  "repoId": 1,
  "kind": "pr"
}

The server creates a pending analysis record and queues an analysis-pr task for the runner. The response includes the analysis ID and initial status:

Response json
{
  "data": {
    "id": 42,
    "status": "pending"
  }
}

Triage Dimensions

Each PR is evaluated on multiple AI-computed dimensions stored in the ai_dimensions field. These typically include:

Dimension Description
Risk How likely the change is to introduce bugs or regressions, based on diff complexity, test coverage, and affected areas.
Size Scale of the change — considers lines changed, files affected, and whether the change is additive vs. refactoring.
Urgency Time sensitivity based on staleness, merge conflicts, blockers, and engagement signals.
Priority The composite ranking that determines sort order — Critical, High, Medium, Low, or Informational.

Rank and Priority Tiers

Each analyzed PR receives a numeric rank (lower is higher priority) and a priority tier derived from the AI evaluation:

AI-Generated Summaries

For each PR, the analysis produces two fields:

Engagement Signals

PR analysis also computes engagement signals for each item, including days since last author/maintainer activity, pending review state, and whether the PR is stale. These feed into both the priority ranking and the engagement tracking system.

Merge Status

Each analyzed PR includes a merge_status field indicating whether the branch is mergeable:

Interpreting Results

Once an analysis completes, fetch the full results with items:

API Request http
GET /api/analyses/42

The response includes the analysis metadata (status, model_used, token counts) and an items array with all analyzed PRs. Items are sorted by rank. Each item includes the PR number, title, author, URL, labels, AI summary, AI details, dimension map, and engagement data.

Tip: Analyses are access-controlled. The API filters results to only show repositories the authenticated user can access via their GitHub token, so sensitive repos are never exposed to unauthorized users.

Batch Refresh

The runner supports automatic periodic analysis refresh via the last_auto_refresh_at field on each repo. Repos can be configured for auto-refresh so your triage dashboard stays current without manual triggering.