Here’s a simple, high‑leverage north‑star for AI‑coding work: merged PRs per agent‑hour — how many pull requests successfully land on main per hour of agent runtime.


Why this metric

  • Outcome‑centric: measures shipped code, not tokens, prompts, or “attempts.”
  • Comparable: normalizes across models, repos, and workflows with a single denominator (agent hours).
  • Anti‑vanity: ignores drafts, abandoned PRs, and reverts so the number reflects real value.

Exact definition

  • Numerator: Count of PRs merged to main in the window, excluding drafts, auto‑reverts, and PRs that are reverted within 7 days.
  • Denominator: Sum of wall‑clock runtime hours for all agents involved in those PRs (planning + coding + refactor + test + review assistance).
  • Metric: Merged PRs per agent‑hour = valid_merged_prs / agent_runtime_hours

Guardrails (make it hard to game)

  • Only count PRs with: green CI, at least 1 human approval, and non‑trivial diff (e.g., ≥ 15 changed LOC or at least 2 files).
  • Exclude PRs labeled chore/deps unless they include passing tests written/updated by the agent.
  • Track a 7‑day revert rate alongside the metric. If revert rate > 5%, pause experiments.

Minimal implementation (7 steps)

  1. Tag agent runs: log run_id, start/stop timestamps, repo, branch, PR number.
  2. Join with VCS: from GitHub/GitLab API pull merged_at, is_draft, labels, CI status, approvals, reverts.
  3. Filter valid PRs: apply the rules above.
  4. Aggregate runtime: sum agent run hours per PR (if multiple runs touch one PR, sum them).
  5. Compute core metric daily + weekly; add p50/p90 time‑to‑merge and tests‑added per PR as secondary.
  6. Slice: by repo, model, prompt pack, retrieval config, and reviewer to find winners.
  7. Alerting: if metric drops >20% WoW or revert rate spikes, notify in Slack.

Example SQL (BigQuery‑style, adapt as needed)

WITH agent_runs AS (
  SELECT pr_number, SUM(TIMESTAMP_DIFF(ended_at, started_at, MINUTE))/60.0 AS agent_hours
  FROM runs
  WHERE started_at >= @from AND ended_at < @to
  GROUP BY pr_number
),
valid_prs AS (
  SELECT p.pr_number
  FROM prs p
  LEFT JOIN reverts r ON r.reverted_pr = p.pr_number AND r.created_at BETWEEN p.merged_at AND TIMESTAMP_ADD(p.merged_at, INTERVAL 7 DAY)
  WHERE p.base_branch = 'main'
    AND p.is_draft = FALSE
    AND p.merged_at BETWEEN @from AND @to
    AND p.ci_status = 'success'
    AND p.approvals_count >= 1
    AND p.changed_loc >= 15
    AND (r.reverted_pr IS NULL)
    AND NOT ARRAY_TO_STRING(p.labels, ',') LIKE '%chore/deps%'
)
SELECT
  COUNT(v.pr_number) / NULLIF(SUM(a.agent_hours), 0) AS merged_prs_per_agent_hour,
  COUNT(v.pr_number) AS merged_prs,
  SUM(a.agent_hours) AS agent_hours
FROM valid_prs v
JOIN agent_runs a USING (pr_number);

Dashboard (keep it tiny)

  • Top‑line: Merged PRs / agent‑hour (7d, 28d)
  • Quality rails: Revert rate (7d), CI pass‑on‑first‑try %
  • Speed: p50/p90 time‑to‑merge
  • Breakdowns: by model → by repo → by task type
  • Leaderboard: prompt pack / tool config by uplift vs. baseline

How to use it weekly

  • Ship two changes at a time (model + prompt = too many confounders).
  • Hold a 20‑minute review: if a variant improves the metric and keeps revert rate low, promote it; otherwise roll back.

If you want, I can generate a ready‑to‑run metrics notebook and a lightweight Grafana/Looker spec around this.

KINGBOLEN Ediag Link OBD2 Scanner Bluetooth, Bidirectional Scan Tool
  • Latest Bluetooth 5.2 Technology: Faster, stable diagnostics with full compatibility
  • Supports All System Diagnostics: Includes bidirectional control and full OBD2 functions
  • Universal Vehicle Compatibility: Works with US, European, Asian vehicles since 1996

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Git and GitHub for Beginners: Learn Version Control, Branching, Commits, Pull Requests, and Real Developer Workflow Step by Step (Computer Programming Made Easy)

Git and GitHub for Beginners: Learn Version Control, Branching, Commits, Pull Requests, and Real Developer Workflow Step by Step (Computer Programming Made Easy)

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Automating DevOps with GitLab CI/CD Pipelines: Build efficient CI/CD pipelines to verify, secure, and deploy your code using real-life examples

Automating DevOps with GitLab CI/CD Pipelines: Build efficient CI/CD pipelines to verify, secure, and deploy your code using real-life examples

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Weekly Productivity Dashboard - 8.5" x 11" Dashboard Desk Notepad Has 6 Focus Areas to List Tasks for Goals, Projects, Clients, Academic or Meal-Organize Your Daily Work Efficiently, 54 Weeks, Green

Weekly Productivity Dashboard – 8.5" x 11" Dashboard Desk Notepad Has 6 Focus Areas to List Tasks for Goals, Projects, Clients, Academic or Meal-Organize Your Daily Work Efficiently, 54 Weeks, Green

  • Boosts Productivity: Focuses on important work and organization
  • Undated Weekly Planner: Start any week, 54-week span
  • Versatile Scheduling: Plan for work, goals, or personal use

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

You May Also Like

Market, Economic and Customer Impact of the EU Code of Practice on Labelling AI‑generated Content

Background In 2024–25 the European Union adopted the AI Act, a horizontal…

The Myth of AI Consciousness: What Current AI Can and Cannot Do

Diving into AI’s capabilities reveals misconceptions about consciousness, but understanding what current AI truly can and cannot do is essential.

AI and Inequality: Sorting Myth From Fact

Gaining clarity on AI’s role in inequality reveals complex realities that could reshape our understanding—discover the facts behind this crucial issue.

Five Industries Everyone Thinks Are Safe From AI—and Why They’re Not

Just when you think certain industries are safe from AI, surprising innovations reveal they’re more vulnerable than you realize.