Skip to content
mentoor

Benchmark your coding agent on your own repo

For engineers

Scenario lesson and practice set combining Evaluating AI agents, Agent-sized tasks and Testing new models yourself. Completing it counts as evidence for every listed skill.

The one-sentence idea: choose a coding agent by testing it on your own closed issues, in a clean sandbox, with tasks sized so each result means something.

Why it matters

Public leaderboards such as SWE-bench measure agents on other people's repositories. Your repo has its own build, conventions and flaky tests. A leaderboard score cannot tell you whether an agent will fix a bug in your billing code. A benchmark built from your own work can. It costs a few days, and it replaces a debate about taste with numbers you can repeat.

This scenario follows Priya, a staff engineer at Harbor Logistics. Her team maintains parcel-api, a TypeScript service. Two coding agents, Cedar and Birch, are on the shortlist. The lead wants a decision in two weeks.

How to do it

  1. Collect tasks. Pick 20 closed issues from the last year, each with a merged fix and a test that failed before it. Mix easy, medium and hard. Prefer fixes newer than the models' training data, and keep the list private.
  2. Size every task. An agent-sized task has bounded scope, a known starting point, a check the agent can run and a diff a person can review in one sitting. If the cause is unknown, run a throwaway spike first, then write the task. If the work is large, slice it into vertical steps that each build and pass tests.
  3. Write checkable criteria. Replace "make it work" with a command and an observable result: the test command, the exact response for a known input, the files allowed to change.
  4. Build the harness. Each trial starts from a clean checkout at the commit before the fix, in a fresh container, with no network access and no copy of the real remote. The grading tests are copied in after the agent finishes, so the agent never sees them.
  5. Run it fairly. Give both agents the same instructions file, the same time limit and the same tasks. Run each task several times. A single run tells you little, because agents vary from run to run.
  6. Grade the end state and the path. The main score is whether the hidden tests pass. Also record tool calls, out-of-scope edits and destructive commands. Read the trajectory of suspicious runs: an agent that deletes a failing test is not a pass.
  7. Compare blind. Strip agent names from diffs before a reviewer scores them against a written rubric. Score correctness separately from style, so longer output does not win on volume.
  8. Decide in writing. Weigh pass rate, cost per resolved task, time including human help, scope and data terms. Then record adopt, trial or wait.

Before and after

Before: "Run both agents on a few issues and see which feels better." One run each, different instructions, the agent's own summary as proof, and a verdict of "Birch won 14 to 11, adopt it everywhere."

After: 20 tasks, three runs each, identical setup, hidden tests as the pass rule and a results sheet with pass^3, cost per passing run, human minutes and out-of-scope edits. The call says: trial Birch on one more repository for two weeks, because its terms need checking and three tasks of difference is within noise.

What goes wrong

  • The agent games the grader. If it can read or edit the tests, it can pass without fixing the bug.
  • State leaks between trials. A reused working copy carries files and packages from one run into the next, so runs are not independent.
  • Contamination. An agent with internet access and the real remote can find the commit that closed the issue.
  • Oversized tasks. Many failed attempts, a growing diff and a nearly full context mean the task was too big, not that the agent is weak.
  • Averages hide reliability. pass@k asks whether any run worked. Unattended use needs pass^k, where every run works.
  • Unfair setups. Different model tiers or instructions files measure the setup, not the agents.

Treat the benchmark as a small, repeatable experiment. Rerun it when a new agent or model arrives, and keep the task list private so it stays useful.

Steps

  1. Build the task list from closed issues

    Skill: current-experiments

    Pick 20 closed issues from the last year, each with a merged fix and a failing-then-passing test. Mix easy, medium and hard, keep the list private, and write each task's pass rule before any agent runs. Prefer fixes newer than the models' training data so the answer cannot be memorised.

    Task list excerpt
    First rows of the benchmark sheet
    TaskIssueSizePass rule
    PA-101Reject negative weightSmalltest/weight.test.ts passes
    PA-157Wrong zone lookupMediumtest/zone.test.ts passes
    PA-212Delivery-window ruleMediumtest/windows.test.ts passes
  2. Size and specify each task

    Skill: code-task-sizing

    Check each task is bounded, has a known starting point, a command the agent can run and a diff a reviewer can read in one sitting. Spike unclear reports, slice big ones, and turn vague wishes into acceptance criteria with a command and an expected result.

  3. Make the harness reproducible

    Skill: evals-agents

    Start every trial from a fresh container at the commit before the fix. Turn off network access and remove the real remote. Copy the hidden tests in only after the agent finishes, and reset all state between trials.

    Sandbox settings

    sandbox.yaml

    image: node:20-slimnetwork: nonecheckout: base_commithidden_tests: copied_after_runreset_between_trials: truetimeout_minutes: 30
  4. Run both agents with matched settings

    Skill: current-experiments

    Give Cedar and Birch the same instructions file, time limit and tasks, and run each task three times. Record every output, the cost, the time and each human intervention in one sheet.

  5. Grade outcomes, paths and side effects

    Skill: evals-agents

    Score hidden-test passes as the main metric and report pass^k for reliability. Add assertions on recorded tool calls, a diff check for edits outside allowed paths, and a flag for destructive commands. Read the trajectory of every run that passed suspiciously fast.

  6. Compare blind and decide

    Skill: current-experiments

    Remove agent names, shuffle diffs and score them against a written rubric with correctness separate from style. Compute cost per passing run, add human minutes, check data terms and write the call as adopt, trial or wait with the evidence.

Skills this scenario uses

Where to study