Skip to content

feat(computer): snapshot a multi env's computer, for a judge to grade its files - #772

Merged
earakely-scale merged 22 commits into
mainfrom
wloo/cua-verifier
Nov 24, 2026
Merged

earakely-scale merged 22 commits into
mainfrom
wloo/cua-verifier

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Grading a computer-use task's files, built from steps that already exist: deploy a judge, snapshot the computer, load the snapshot and the golden files into the judge, then grade with rubrics_verifier's agent judge. The one missing piece was snapshotting chosen paths from a multi env's computer, and this PR adds it.

What changes

snapshot_computer_env takes a multi env and the computer to snapshot:

  • computer_name names the computer in the multi env by its environment name there: its key in the deploy's child_envs, not its env id. When it's left out, the env's only computer is used. Preflight refuses a name the env doesn't have, and an unnamed computer when the env has several. A computer env takes no name.
  • file_paths go to that computer's data/get alone. They're relative to the session user's home, so a file outside Desktop, Documents and Downloads (the home root, .config, ...) can be snapshotted.
  • The multi env's other environments (MCP servers, websites, other computers) are kept beside the computer, as snapshot_env keeps them, each with its default export.

find_computer and computer_problem move from computer_exec to task_steps/computer/lookup.py, which both steps use. child_computer resolves the computer within the deployment the step picked, so env_step_id and env_instance_id are honoured.

computer_exec's computer field is renamed computer_name to match, since a bare computer read like the computer env's id. Its run record uses the new name too. A stored step that still says computer loads as before.

The grading pattern

{"id": "judge", "type": "deploy_agent", "agent_name": "judge", "a2a_agent_id": "...", "env_ids": []},
{"id": "snapshot", "type": "snapshot_computer_env", "env_id": "office", "computer_name": "desk",
 "file_paths": ["Desktop/budget.csv", "notes.txt"]},
{"id": "result", "type": "load_artifact", "artifact_from_step_id": "snapshot", "agent_name": "judge",
 "destination_path": "/tmp/grading/result"},
{"id": "golden", "type": "load_artifact", "artifact_id": "golden", "agent_name": "judge",
 "destination_path": "/tmp/grading/golden"},
{"id": "grade", "type": "rubrics_verifier", "prompt_id": "ask", "agent_name": "judge", "use_agent_judge": true,
 "criteria": [{"id": "budget", "description": "~/Desktop/budget.csv matches the golden budget.csv."}]}

The judge works with the real files in its own sandbox. rubrics_verifier lists each staged location in the judge's prompt under "Files Available For Inspection". The judge can be given anything else the same way, such as reference files or skills.

Removed

  • computer_verifier, its file renderer (verifiers/computer/files.py) and the cua extra (openpyxl, python-docx, python-pptx, pypdf), with their registry, episode-rule and explorer entries.
  • The protocol client's max_bytes on get_data: nothing else uses it.
  • Mapping a CUA rubric (must-pass, negative, visual annotations) onto rubrics_verifier criteria and gates now belongs to the CUA task importer.

Testing

  • Unit (tst/unit/task_step/snapshot_computer_env_test.py):
    • The named computer, and a multi env's only one, are kept beside the multi env's MCP server, and file_paths reach that computer alone.
    • A missing name, or an unnamed computer among two, is refused at run time and in preflight.
    • computer_name round-trips, and computer_exec still loads a stored step's computer.
  • E2E (tst/integration/computer/computer_grading_test.py, CI's slow tier, no model credentials):
    • A multi env with one ubuntu-24.04 computer runs on the reference driver. computer_exec leaves a CSV on the Desktop and a note in the home root.
    • snapshot_computer_env keeps both, and load_artifact stages the snapshot and the bundle's golden files in a judge deployed from the echo agent.
    • rubrics_verifier grades with that judge, faked at its call boundary (_invoke_judge_a2a). The fake runs cmp on each file against its golden file in the judge's own sandbox.
    • The CSV matches and the note doesn't, so the grade scores 0.5.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no new actionable issues were found.

Summary

Adds snapshots of a chosen computer inside a multi env, keeping the other environments beside it for later loading or grading.

  • Multi-environment snapshots can include a chosen computer’s files.
  • Computer steps use computer_name to select a computer in a multi environment.

Earlier verifier findings concern code that is no longer present. Historical deferrals: williamloo-scale deferred native Windows reads in the removed verifier; earakely-scale deferred driver-side inline size limits to FD-6914 because that work requires protocol changes and rebuilt computer images.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Multi["Deployed multi env"] --> Select["Choose computer"]
  Select --> Snapshot["Snapshot chosen paths"]
  Multi --> Others["Export other environments"]
  Snapshot --> Artifact["Environment universe"]
  Others --> Artifact
  Artifact --> Load["Stage files in judge sandbox"]
  Golden["Golden files"] --> Load
  Load --> Grade["rubrics_verifier"]
Loading

Reviews (26) · Last reviewed commit: "refactor(computer): name a multi env's c..." · Reviewed by Greptile

williamloo-scale and others added 2 commits November 18, 2026 16:10
…ugh its driver

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… what the agent left in the computer

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@williamloo-scale williamloo-scale changed the title feat(verifiers): cua_verifier, a CUA task's rubric graded as the in-house CUA judge grades it (FD-5492) feat(verifiers): cua_verifier, a computer-use task's rubric graded on what the agent left in the computer Nov 19, 2026
@williamloo-scale

Copy link
Copy Markdown
Contributor Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P1 Windows files cannot be graded src/agent_env/task_step/task_steps/verifiers/cua_verifier.py:305 ▶

    Windows files cannot be graded. _run always launches sh, and its file reads require wc, tail, head, and base64. The supported windows-11 computer and cua-driver install do not provide those programs. The driver starts the requested program directly, so the first file read fails with cannot run 'sh' instead of reaching the judge. Use a read command available on each supported platform, such as the installed Python.

…output, and refuses Windows computers

- An Office file is measured as it decompresses and named as not rendered when
  it expands past 128 MiB; a PDF is read up to 200 pages (pypdf>=6 bounds each
  stream); rendering runs off the event loop under a 60 s limit.
- State output over the limit, or cut by the driver, is marked incomplete in
  the prompt and the record.
- A Windows computer is refused at preflight and before any read: files and
  state are read through sh and POSIX tools.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
williamloo-scale and others added 2 commits November 18, 2026 17:36
…limited process, and names a damaged one

A file is rendered in a child process with its address space capped at 2 GiB
and killed after 60 s, so a crafted document can't exhaust or block the worker.
The Office packages' expansion check runs inside render's error handling, so a
document with damaged compressed data is named as unreadable, not raised.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Base automatically changed from wloo/computer-exec-step to main November 19, 2026 19:29
Brings the PR onto main after #749's squash merge and #790's VerifierTaskStep. rubrics_verifier keeps main's
verify/_judged/_gated with this PR's graded_response, score_rows and _rubrics_fields hooks, and cua_verifier
adds its gate fields to its verdict's output in _judged, since main has no _write_entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 2 commits November 20, 2026 08:10
…s pooling its rows would drop

aggregate_verifiers pools the rows of the entries it names and scores them again, so a cua_verifier entry's must-pass
gates and its criteria counted met or not would not reach the combined score: a failed weight-0 gate beside a met
regular criterion scores 0 alone and 1 pooled. An entry with gate_passed is now refused, naming it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iers/computer/

The step is computer_verifier (ComputerVerifierTaskStep, recording under metadata["computer_verifier"]), in
verifiers/computer/computer_verifier.py beside the files it renders, verifiers/computer/files.py (was
judge_utils/cua_files.py), as computer_exec sits in task_steps/computer/. Its tests and e2e bundle follow; the
cua extra keeps its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale earakely-scale changed the title feat(verifiers): cua_verifier, a computer-use task's rubric graded on what the agent left in the computer feat(verifiers): computer_verifier, a computer-use task's rubric graded on what the agent left in the computer Nov 20, 2026
earakely-scale and others added 6 commits November 20, 2026 08:56
The dev extra takes main's tinker beside this PR's cua; uv.lock is main's, locked again with CI's uv 0.13.1, which
adds the cua extra's packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's #851 combines aggregates by named grades (sources with a pooled or weighted_mean combine, and gates) beside
the older verifier_ids. A pooled aggregate now refuses a computer_verifier either way, by its grade's verifier_type
or its legacy entry's gate_passed, since pooling its rows drops its must-pass gates, and names weighted_mean and
gates, which keep its score. The failed-gate test checks all four.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s; must-pass criteria gate through an aggregate

computer_verifier scored with a rule of its own (must-pass gates, each criterion met or not), which anything that
scores its rows again, such as a pooled aggregate, couldn't see, so aggregate_verifiers had to refuse it. It now scores
with rubrics_verifier's score_aggregator, a weighted average by default, and refuses a MUST-PASS criterion: must-pass
criteria are a computer_verifier of their own, with score_aggregator all_pass, that an aggregate_verifiers names in its
gates. rubrics_verifier loses the score_rows hook, aggregate_verifiers is main's again, and the unit tests and the e2e
show the gate as an aggregate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th its files; rubrics_verifier is main's

computer_verifier takes a prompt_id, as every rubric verifier does, so the judge sees the agent's response beside the
files and state; the default guidance says that response is no evidence on its own. The files-alone stand-in and its
graded_response hook go, and the step builds itself from a stored dict through _base_from_dict, as
always_on_agent_verifier does, so rubrics_verifier needs no _rubrics_fields: it is main's again. The e2e prompts the
echo agent for the response it grades.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…data/get, the env protocol

It read each result file by running sh in the computer (test, wc, tail, head and base64 through computer-exec's run,
512 KiB a call to stay under the driver's output cap), refused Windows for it, and ran state_commands there. It now asks
the computer's data plane once for the result files, as paths under its home, and reads the state of each of
state_envs, an environment by its name (the computer, an app on it, or a multi env's website or MCP server), as its
data/get export, resolved through the cards (child_env and base_url). Nothing runs in the computer, so there's no OS
check, no chunking, no read racing a writer and no output cap to stay under; result_files are home-relative paths, and
a part given only by a link fails the step. The unit tests' computer answers data/get for folders and with no paths,
as the driver does; the e2e's mailbox is in the computer's export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 2 commits November 23, 2026 10:38
…t files under the home

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ads an app's files through the app

data/get answered every file inline, read whole by the driver and decoded by the worker before MAX_READ_BYTES was
checked, so a file the agent left could exhaust either. An env that takes the data-objects form now exports under a
grant of the step's within EXPORT_LIMITS: each file is uploaded, its size read from the store, and its bytes only when
under the limit; one over it is named as too large. An env without the form, or whose network can't reach the store,
still answers inline. Parts in the data-objects form are read by the protocol's part_bytes.

The computer's own data/get leaves out what its apps keep, so a result file under a path an app's card claims
(computer-app/v1 paths) was named as not produced; it's now read from that app's export.

find_computer and computer_problem move from computer_exec to task_steps/computer/lookup, which both steps import, and
the verifier's prompt is built a section per source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 2 commits November 23, 2026 11:00
…ed is kept

An export under the step's grant uploads its files to a fresh namespace in the object store, which keeps them, as it
keeps a run's trajectories; the step recorded nothing of where. Each uploaded file's url is now in the step's record,
so what the judge was shown stays reachable from the run, as its evidence. The object store has no delete to clean
them up with.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… cap

An env that can't export under the step's grant (no data-objects form, or a network that can't reach the object
store) answers data/get inline, which the worker read whole before any size was checked. The protocol client's
get_data takes max_bytes: it streams the answer and, past that many bytes, raises ResponseTooLarge without reading the
rest. computer_verifier asks with MAX_INLINE_BYTES and fails the step on an answer over it, naming how to export under
its grant instead. The test computer answers data/get within the cap it is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale and others added 2 commits November 24, 2026 08:41
…rom composed steps

Replace computer_verifier with the steps a grading already composes from:

- snapshot_computer_env takes a multi env and the computer to snapshot
  (`computer`, its only one when unnamed), sending `file_paths` to that
  computer's data/get alone and keeping the multi env's other environments
  beside it, as snapshot_env keeps them.
- An e2e deploys a judge, snapshots a computer's files (one in its home
  root, outside the default folders), loads the snapshot and golden files
  into the judge with load_artifact, and grades with rubrics_verifier's
  agent judge.

computer_verifier, its file renderer, the cua extra and the protocol
client's max_bytes go; nothing else uses them. CUA rubric mapping moves to
the importer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale earakely-scale changed the title feat(verifiers): computer_verifier, a computer-use task's rubric graded on what the agent left in the computer feat(computer): snapshot a multi env's computer, for a judge to grade its files Nov 24, 2026
@earakely-scale

Copy link
Copy Markdown
Collaborator

@williamloo-scale I pushed a reshape of this PR to your branch (3b9cf1c, plus a merge of main in cd12948). The title and description are updated to match.

Why: working through what computer_verifier does, nearly all of it can already be built from existing steps: deploy a judge agent, load the computer's files and the golden files into it, and grade with rubrics_verifier's agent judge. The judge then inspects the real files in its own sandbox instead of a text rendering. The one gap was snapshotting chosen paths from a multi env's computer: snapshot_computer_env refused multi envs.

What the PR does now:

  • snapshot_computer_env takes a multi env plus computer (its only computer when left out).
    • file_paths go to that computer's data/get alone, so home-root or .config files can be snapshotted.
    • The multi env's other environments are kept alongside, as snapshot_env keeps them.
  • A new e2e, tst/integration/computer/computer_grading_test.py, runs the whole pattern: computer_exec → snapshot_computer_env → load_artifact of the snapshot and the golden files into the judge (agent_name: judge) → rubrics_verifier. The judge is faked at _invoke_judge_a2a and compares the files with cmp in its own sandbox.
  • Removed: computer_verifier, verifiers/computer/files.py, the cua extra, and the protocol client's max_bytes, which nothing else uses.

For the importer: mapping a CUA rubric (must-pass, negative, visual) onto rubrics_verifier criteria and aggregate_verifiers gates fits better there, where the format is known. Must-pass per criterion is still FD-6893.

Your earlier commits are still in the branch history. Happy to talk it through if you'd rather take it another way.

earakely-scale and others added 2 commits November 24, 2026 08:55
The local sandbox runs exec on its host, where load_artifact staged nothing:
read each file with docker exec in the judge's container, as staging wrote
it, and compare there instead of with cmp on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
computer_exec and snapshot_computer_env name a multi env's computer by its
environment name there, the key of the deploy's child_envs, which a bare
`computer` didn't say: it read as the computer env's id. Both steps take
`computer_name` now; computer_exec still reads a stored step's `computer`,
and its record names the field the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit 2d748a9 into main Nov 24, 2026
35 of 36 checks passed
@earakely-scale
earakely-scale deleted the wloo/cua-verifier branch November 24, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants