# Tessera: verified coding tasks for AI agents

> Hand-written benchmarks are slow to make and leak into training data. Tessera generates fresh tasks from real repos and proves every one valid.

- Dashboard: [/dashboard](/dashboard.md)
- Source: https://github.com/AthulRm18/Tessera

## One run, in numbers

- **5 / 9** candidate tasks accepted ([See every candidate](/dashboard/candidates.md))
- **35 / 36** planted bugs caught by the tests ([Open the mutation explorer](/dashboard/mutations.md))
- **5 / 5** pass Harbor: nop 0.0, oracle 1.0 ([Check it yourself](/dashboard/reproduce.md))
- **5 / 5** solved blind on the first try ([See the accepted tasks](/dashboard/accepted.md))
- **$0.98** for the whole run (est. $0.9832) ([See cost by model](/dashboard/cost.md))
- **44 min 33 s** wall time, start to finish ([See the run timeline](/dashboard/timeline.md))

## It fixes its own mistakes

4 of 5 accepted tasks were repaired automatically before acceptance. [Every repair in the run log](/dashboard/log.md).

## What we threw away

A filter that never rejects anything proves nothing.

- [task_004](/dashboard/tasks/task_004.md): Show available completion shells in command help. Stopped at G5 Every requirement tested. Its 2 repairs fixed the shape check, but requirement AC2 still had no test.
- [task_005](/dashboard/tasks/task_005.md): Prioritize unused commands in chain completion. Stopped at Shape precheck. Portfolio quota: remaining slots needed for multi-module tasks.
- [task_006](/dashboard/tasks/task_006.md): Bounded binary file reads. Stopped at Harbor official checks. Harbor's do-nothing run returned no score, where it must score 0.0.
- [task_008](/dashboard/tasks/task_008.md): Share confirmed answers across a command chain. Stopped at G7 Blind solve. Solver returned empty patch -- rejected instead of guessed.

## Inside one verified task

What the agent sees, how its work is graded, and the proof it ships with.

- [task_001](/dashboard/tasks/task_001.md): Aliases for choice values. 14 of 14 checks passed.
- [task_002](/dashboard/tasks/task_002.md): Limit invalid custom-type prompt attempts. 14 of 14 checks passed.
- [task_003](/dashboard/tasks/task_003.md): Mutually exclusive command-line options. 14 of 14 checks passed.
- [task_007](/dashboard/tasks/task_007.md): Context-scoped idempotent help text. 14 of 14 checks passed.
- [task_009](/dashboard/tasks/task_009.md): Identify chained commands in type validation errors. 14 of 14 checks passed.

From task_003:

Mutually exclusive command-line options. From instruction.md, the only file the agent sees:

> Add an `exclusive_options` decorator that declares a group of mutually exclusive option parameter names. A command may have multiple such groups. An invocation conflicts when at least two members of any one group were supplied on the command line, regardless of their parsed values.
>
> - **AC2**: After successful parsing and before the affected command's callback runs, reject a group if at least two of its members have source `ParameterSource.COMMANDLINE`. Report all selected members of the first conflicting group, in that group's name order.

A test tagged with this requirement (tests/feature/test_exclusive_options.py):

```python
# AC2
def test_conflict_reports_all_selected_in_group_order_after_parsing():
    events = []

    def record(ctx, param, value):
        if value:
            events.append(param.name)
        return value

    @click.command()
    @click.exclusive_options("third", "first", "second")
    @click.option("--first", is_flag=True, callback=record)
    @click.option("--second", is_flag=True, callback=record)
    @click.option("--third", is_flag=True, callback=record)
    def cmd(first, second, third):
        events.append("callback")
```

Checks: Patch precheck (passed), Shape precheck (passed), Test hygiene precheck (passed), Interface precheck (passed), G1 Applies cleanly (passed), Base fail ratio (passed), G5 Every requirement tested (passed), G2 Fail-to-pass (passed), G3 No regressions (passed), G4 Same result every time (passed), G6 Mutation testing (passed), Harbor official checks (passed), N1 Not already in Click (passed), G7 Blind solve (passed).

## Computed from evidence, not written by hand

19 of 19 headline claims match the files: [Claims audit](/dashboard/claims.md).

## How it works

### Create

- **Map the repo** -- Where can a new feature go? Reads the source of `pallets/click` 8.5.1 at a pinned commit and builds a grid of module x kind of behaviour x partner module. Each task comes from a different cell, so tasks don't repeat each other.
- **Write the task** -- What should the agent build? An AI writes `instruction.md`, the only file the agent under test ever sees. It states every function name, signature and error message, but gives no hints about how to implement them. (model: `gpt-6.1-terra`)
- **Write the answer key** -- What does a correct solution look like? The AI writes a reference solution (`reference.patch`) and feature tests, with each test tagged to a requirement (AC1, AC2, ...). (model: `gpt-6.1-terra`)

### Prove

Cheapest checks first; stops at the first failure.

- **Pre-checks** -- Is this task real, safe and shaped right? Rejects security exploit work, solutions with no real code, and tests that use the network, sleep or private names. Then it runs the tests on unchanged Click: at least 80% must fail. If fewer than 50% fail, the feature probably already exists, so the task is dropped immediately.
- **G1: Applies cleanly** -- Is the solution a valid patch? `git apply --check` plus a Python syntax check.
- **G5: Requirements tested** -- Do the instructions and tests match? Every requirement has a test, every test belongs to a requirement, and every error message the tests check appears in the instructions.
- **G2: Fail -> pass** -- Do the tests fail before the feature exists, and pass after? The tests must fail cleanly without the solution (a wrong result, not a crash) and pass with it.
- **G3: No regressions** -- Does anything that worked before break? All 2,434 existing Click tests must still pass with the solution.
- **G4: Not flaky** -- Same result every time? The feature tests run 3 times and must give identical results.
- **G6: Mutation testing** -- Would the tests catch a broken solution? Plants small deliberate bugs ("mutants") in the solution's code, for example flipping `==` to `!=` or removing a `raise`. At least 70% of them must be caught.

### Package

- **Official Harbor check** -- Does it grade correctly the way the judges grade? Builds the official Harbor 0.25 package and runs it in Docker. Doing nothing must score 0.0 (`nop`), and the reference solution must score 1.0 (`oracle`).

### Challenge

- **N1: Genuinely new** -- Has Click already built this? Fetches Click's latest code and confirms the feature isn't there and the tests still fail against it.
- **G7: Blind solve** -- Can an AI solve it from the instructions alone? A separate AI model gets only `instruction.md` and the relevant source files: no tests, no answer. It has 2 attempts. If it fails, an audit decides whether the task was unfair, and an unfair task is fixed or rejected. (model: `gpt-6.1-sol`)

### Outcome

- **Accepted** -- Packaged as a Harbor task and checked against every other accepted task so that no two test the same behaviour.
- **Rejected** -- Logged with the exact check that stopped it and why.
