# Coding agent benchmark task spec, part of AutoRouter's open scorecard.
# Guide: https://autorouter.com/blog/coding-agent-benchmark-scorecard
# Schema: https://autorouter.com/scorecard/task-spec.schema.json
#
# One entry per task. Copy the template below for each merged pull request you
# turn into a task, then delete the illustrative task. Check the file with:
#   uv run check.py
#
# Template (every field is required unless marked optional):
#
#   - id: <short-stable-id>            # used as task_id in runs.csv
#     illustrative: false              # true only for made-up example tasks
#     source_pr_url: <merged PR URL>
#     workflow: <bug-fix | feature | refactor | test-writing | migration | code-review | ...>
#     repo: <owner/name or clone URL>
#     parent_commit: <sha of the PR's base commit>   # the agent starts here
#     prompt: |
#       <the original request, as the engineer gave it to the agent or wrote it in the issue>
#     setup:                           # commands run before the agent starts, in order
#       - <install dependencies>
#       - <seed data, start services>
#     grading:
#       method: <tests | rubric | llm-judge>
#       command: <exact grading command; exit code 0 is a pass>   # required for tests
#       fail_to_pass: [<tests that must go from failing to passing>]   # optional
#       pass_to_pass: [<tests that must keep passing>]                 # optional
#       rubric:                        # required for rubric and llm-judge
#         - <criterion written before any run, met or not met>
#       judge_model: <model and setting>   # required for llm-judge
#     pass_criteria: <what counts as a pass, in a sentence>
#     time_limit_minutes: <number, or null for none>
#     validation:                      # optional, but check.py warns until it's complete
#       fails_before_fix: <true once the grader fails at parent_commit>
#       passes_after_fix: <true once the grader passes with the merged change>
#       gold_patch_hidden: <true once the agent's copy has no later commits, branches or test changes>
#       checked_on: <YYYY-MM-DD>

scorecard_version: "1.0"

tasks:
  # Illustrative: a made-up task for a made-up team. Not a real repository or result.
  - id: bill-1482
    illustrative: true
    source_pr_url: https://git.example.com/example-co/billing/pull/1482
    workflow: bug-fix
    repo: example-co/billing
    parent_commit: 3f9c2a7e1b4d6c8a0e2f4b6d8c0a1e3f5b7d9c2e
    prompt: |
      Partial refunds are off by a cent on some invoices. Refunding $10.00 of a
      $33.33 charge split across three line items gives $9.99. Refunds should
      round once, at the end, the way charges do.
    setup:
      - pnpm install --frozen-lockfile
      - pnpm db:seed --fixture refunds
    grading:
      method: tests
      command: pnpm vitest run src/refunds
      fail_to_pass:
        - src/refunds/partial.test.ts > rounds once across line items
      pass_to_pass:
        - src/refunds/full.test.ts
        - src/charges/rounding.test.ts
    pass_criteria: The grading command exits 0 and no test file was edited by the agent.
    time_limit_minutes: 20
    validation:
      fails_before_fix: true
      passes_after_fix: true
      gold_patch_hidden: true
      checked_on: "2026-11-25"
