Repository navigation
feat(computer): snapshot a multi env's computer, for a judge to grade its files - #772
Conversation
…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>
323de44 to
6bae0c0
Compare
c1759be to
3d3ffd8
Compare
|
@greptileai review |
Comments Outside DiffThese findings could not be posted inline.
|
…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>
…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>
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>
…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>
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>
…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>
…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>
…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>
|
@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 What the PR does now:
For the importer: mapping a CUA rubric (must-pass, negative, visual) onto Your earlier commits are still in the branch history. Happy to talk it through if you'd rather take it another way. |
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>
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_envtakes a multi env and the computer to snapshot:computer_namenames the computer in the multi env by its environment name there: its key in the deploy'schild_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_pathsgo to that computer'sdata/getalone. They're relative to the session user's home, so a file outside Desktop, Documents and Downloads (the home root,.config, ...) can be snapshotted.snapshot_envkeeps them, each with its default export.find_computerandcomputer_problemmove fromcomputer_exectotask_steps/computer/lookup.py, which both steps use.child_computerresolves the computer within the deployment the step picked, soenv_step_idandenv_instance_idare honoured.computer_exec'scomputerfield is renamedcomputer_nameto match, since a barecomputerread like the computer env's id. Its run record uses the new name too. A stored step that still sayscomputerloads 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_verifierlists 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 thecuaextra (openpyxl, python-docx, python-pptx, pypdf), with their registry, episode-rule and explorer entries.max_bytesonget_data: nothing else uses it.rubrics_verifiercriteria and gates now belongs to the CUA task importer.Testing
tst/unit/task_step/snapshot_computer_env_test.py):file_pathsreach that computer alone.computer_nameround-trips, andcomputer_execstill loads a stored step'scomputer.tst/integration/computer/computer_grading_test.py, CI's slow tier, no model credentials):ubuntu-24.04computer runs on the reference driver.computer_execleaves a CSV on the Desktop and a note in the home root.snapshot_computer_envkeeps both, andload_artifactstages the snapshot and the bundle's golden files in a judge deployed from the echo agent.rubrics_verifiergrades with that judge, faked at its call boundary (_invoke_judge_a2a). The fake runscmpon each file against its golden file in the judge's own sandbox.🤖 Generated with Claude Code


Confidence 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.
computer_nameto 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"]Reviews (26) · Last reviewed commit: "refactor(computer): name a multi env's c..." · Reviewed by Greptile