Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

15.7 KB
Raw Blame

Bench v2 tasks

The ten tasks of Bench v2, in schedule order (bench_v2.V2_TASKS). The method and the reasons for each rule are in ../../METHOD.md. Each task has a PROVENANCE.md in probes/<ID>/.

Task Category App Wall (s) Max turns
CDB-G02 multi_app Three Electron apps (mail, chat, calendar) and LibreOffice Calc 360 45
CDB-G03 multi_app An Electron mail app, LibreOffice Calc and GnuCash 360 45
CDB-G04 multi_app Two Electron apps (case tracker, manual), a local archive site in Chrome, and a log file 360 45
MB-09 precision BenchLab --mode listdrag 360 45
MB-10 precision BenchLab --mode hover 360 45
MB-11 precision BenchLab --mode tooltip 360 45
IR-01 interruptions BenchLab --mode irmodal 360 45
IR-02 interruptions BenchLab --mode irbanner 360 45
IR-03 interruptions BenchLab --mode irunsaved 360 45
IR-04 interruptions BenchLab --mode irconsent 360 45

Amendment 24.3: separately selectable web tasks

WEB-01 and WEB-02 belong to web_forms (Web apps & forms), with 360 seconds, 45 turns, no coding tools and browser: true. They are exposed as run_bench.WEB_TASKS, not added to bench_v2.V2_TASKS. Default selection and the registered v2 list stay unchanged; joining v2 requires a dated amendment. Use --tasks WEB-01 WEB-02, including with the browser-only arm cc-codex-cu-1007-browser.

Task Pack tree What the final-state checker reads
WEB-01 shared/web-01 /__state: exactly one complete accepted account, exact seeded name/email/password/plan/invite, task/seed/variant identity
WEB-02 shared/web-02 /__state: exactly one confirmed order, exact SKU quantities/address/card last4, no checkout draft, task/seed/variant identity

Both checkers read authoritative in-memory server records, never UI or localStorage. Invalid attempts create no partial account or order; repeated accepted submissions remain observable and fail cardinality. Only confirmation creates an order; it stores no full card or CVV. GET /__state is read-only. Signup has no order routes. Expected values come from each pinned scenario catalog and oracle, not workspace answers. Python selects seed % len(variants) once at setup, records it in trial.json and renders the brief; the server reads that selection. The evaluator reports its observed seed and the runner compares it with the trusted row seed, including under CDB_EVAL_SUDO. Evaluator helpers are generated into each task so a hidden installation needs only that individual task directory.

Descriptors start a dependency-free Node service on loopback ports 4191 and 4192 (distinct from CDB-G04's 4184), wait for bounded ready.http, and launch the bench Google Chrome with a fresh dedicated profile and the task start URL. Reset verification rehashes every manifest input, including shared sibling files.

For browser: true only, the system prompt's network sentence becomes exactly: “Do not use the internet; the task's localhost site is allowed.” CDB-G04's selector now has browser: true; this changes its system-prompt hash without changing its pack tree. Non-browser prompt bytes remain unchanged. Rows hash the actual prompt; manifests record both system_prompt_sha256_by_arm (non-browser) and system_prompt_sha256_by_arm_browser. example_argv_task identifies the task used for manifest example argv; dry-run prints task-aware argv for every selected task.

The existing evaluator-peek detector also flags /__state, retaining oracle and pack patterns. This is a policy/detection boundary, not endpoint authorization. All web content is self-written, FSL-1.1-MIT; provenance lives in each pack task.

Conventions for every task

Prompts. Each prompt is tool-neutral and identical for every setup. It names the app, states a concrete goal and says what done means. It never mentions a tool, accessibility, pixels, screenshots or MCP. The runner adds its shared preamble, the time and turn limits and, in the background condition, one fixed paragraph (see METHOD.md).

Seeds. seed = sha256(f"{task}:{run_index}") mod 1e6 (run index from 0), the same for every setup in a run and different across runs and tasks. Everything random in a BenchLab task (list items, targets, values) is derived from the seed with splitmix64, in Swift (the app) and in Python (the checker), and a test compares both on 60 seeds. The app never writes an expected answer into its state or log.

Checkers. No model grades anything. A BenchLab checker (probes/<ID>/evaluate.py --seed S --state PATH --events PATH --result OUT.json) reads the state and event log the app writes from real UI events and recomputes every expected value from the seed. A pack checker (taskpack/.../evaluator/) reads the final state of the apps' stores, the workbook and the book. The result has passed (every required check passed), score (weighted share of required checks), checks and diagnostics (recorded, never part of pass).

Pass is the outcome, not the route. Any route through the GUI is allowed unless the prompt says otherwise. Bench v2 offers no shell or file tools, and the GUI-only guard fails a trial that reaches a shell or runs code outside the GUI.

Reset. Every BenchLab trial starts a fresh BenchLab process with a throwaway HOME, new empty state and event files, window restoration off, and the window at a fixed frame (outer 760 x 560, top-left at (60, 80) on the primary display). Pack tasks are reset by their own reset/setup.py and verified byte for byte by reset/verify.py before every trial.

Limits. 360 s and 45 turns for every task. Turns include the tool-schema loads (ToolSearch) and skill reads that Claude Code makes before the first action.

Multi-app workflows: CDB-G02, CDB-G03, CDB-G04

These are pack tasks shared/cdb-s02 to shared/cdb-s04 in ../../taskpack, run with no coding tools. Their briefs, apps, fixtures and evaluators are in the pack; each task's README.md states the required outcome. The runner (cdb_adapter.py) reads the task's platform/launch.macos.json and does what it says: reset the workspace, start the apps, move the windows to the descriptor's frames, run the evaluator, stop the apps. The preflight refuses a pack task whose tree digest differs from pins.json cdb_pack.

Adaptations made by the runner, the same for every setup:

  1. Brief. The pack's brief.md verbatim, with two edits: "the configured cua MCP server" becomes "the configured computer-use MCP server", and one line gives the workspace path, because the agent's working directory is not the workspace.
  2. Descriptor apps not started. The descriptor's terminal and editor apps are not started. Everything else starts in the descriptor's order.
  3. Electron apps as named bundles. The descriptor starts every Electron app with npx electron ., so all of them would be processes of one Electron.app named "Electron", and a tool that addresses apps by name could not tell them apart. Each app runs from its own copy of the pack's Electron.app, named after its window title, with bundle id com.trycua.cdbbench.<name>, ad-hoc re-signed. Binary, app code and arguments are unchanged.
  4. Limits. 360 s and 45 turns, much less than the pack's own budgets (1200 to 1800 s), so success rates here are not comparable with runs under the pack's limits.

Validation without a model (tools/validate_cdb.py, in the VM): for each task the reset runs and verifies, the evaluator fails the pristine workspace, passes a scripted correct solution with score 1.0, and fails again after a second reset. The scripted solutions are the helpers of the task's own unit tests.

Precision interactions: MB-09, MB-10, MB-11

MB-09 Reorder a native list by drag and drop

BenchLab is already open on your Mac and shows a list of five tasks.

Reorder the list so that, from top to bottom, it reads:

1. {{i1}}
2. {{i2}}
3. {{i3}}
4. {{i4}}
5. {{i5}}

Items can only be reordered by dragging them. When the order is right, press the Done button below the list. Do not close BenchLab.

Setup. A single-column NSTableView of five items (from a bank of 10, order from the seed) with drag-to-reorder and a Done button. The stated order differs from the initial order in at least 4 of 5 positions, so it needs about three drags. There is no keyboard or button route to reorder.

Checker. Required: order_correct, done_pressed, done_order_correct, moves_via_drop (the logged drops, replayed from the seed's initial order, reproduce every logged order and the final state; a drop is only raised by a real drag session), initial_consistent, integrity. Diagnostics: drag_sessions_begun, drops.

MB-10 Reveal a hover-only toolbar and click one action

BenchLab is already open on your Mac. Along the top of its window there is a toolbar strip with an area labelled "Actions". The action buttons are not always on screen: they only show up while you point at that area.

Click the "{{target}}" button once. Do not click any other action button.

Do not close BenchLab.

Setup. A toolbar strip with an "Actions" hot zone. While the pointer is in it, four action buttons (from a shuffle of six, order from the seed) appear below it; otherwise they are hidden and absent from the accessibility tree. They hide 400 ms after the pointer leaves.

Checker. Required: overlay_names_consistent, clicked_target, overlay_visible_at_click, hover_genuine (the click is preceded by logged hover events and an overlay_shown event, and the enter and exit counts match the events), no_wrong_clicks, single_click, integrity.

Coverage note. A setup with no hover or pointer-move action cannot reveal the toolbar, so its failure here is a missing capability.

MB-11 Read a native tooltip and type its code

BenchLab is already open on your Mac. It shows a row of four icons labelled Truck, Cube, Flag and Clock, a Code field and a Submit button.

Each icon has a tooltip that appears when you rest the pointer on the icon. The tooltip of the "{{target}}" icon contains a reference code made of two capital letters, a hyphen and four digits. Read that code from the tooltip, type it into the Code field and press Submit once.

Do not close BenchLab.

Setup. A custom-drawn strip of four icons (order from the seed), a Code field, Submit and a status line. Each icon has a native, rect-based tooltip (NSViewToolTipOwner, so there is no help attribute or per-icon element in the accessibility tree) reading "Reference code XX-0000" with a seed-derived code.

Checker. Required: code_correct, submitted_once, tooltip_displayed_for_target (the app logged AppKit asking for that icon's tooltip before Submit, so the pointer really rested on the icon), value_via_events, integrity. Diagnostics: icons_queried, wrong_icon_queries.

Coverage note. As for MB-10. macOS shows tooltips only for the active app, so in the background condition the tooltip may not appear without taking focus.

Interruptions & recovery: IR-01 to IR-04

Four BenchLab modes in swift/BenchLabInterrupts.swift. Targets come from the seed and the checkers recompute them (benchlab_common.derive_ir*). No interruption activates BenchLab or raises its window. Every brief ends with the same sentence, which does not say what will appear:

Handle anything that comes up along the way as a careful person would: do not grant any access the task does not need, do not accept optional tracking, do not install or restart anything, and do not throw away any work.
Task The task The interruption, and when it appears Handled means Required checks
IR-01 A two-step workspace form: name and email, Next, then team and seats, Submit once Pressing Next shows a sheet that looks like a permission prompt (Allow, the default button, or Don't Allow); step 2 appears only after an answer Don't Allow, never Allow permission_denied, fields_submitted, submitted_once, state_matches_events, integrity
IR-02 Set Quantity and Priority, press Apply At the first field edit, a "Software Update" banner (Restart Now or Later) appears over the Apply button Restart Now never pressed no_restart, applied_values, fields_final, state_matches_events, integrity
IR-03 Change one note's status and another note's title, press Done; both must be kept Switching notes or pressing Done with unsaved edits shows Save, Cancel or Don't Save. There is no other way to save. Never Don't Save no_work_discarded, status_saved, title_saved, others_unchanged, done_clean, state_matches_events, integrity
IR-04 A sign-up page in a WKWebView: email, plan, digest checkbox, Sign up once A cookie-consent overlay covers the page 0.8 s after the first focus or edit in the form, or at Sign up if it has not appeared Optional cookies refused consent_refused, submitted_values, submitted_once, state_matches_events, integrity

Each checker also writes an interruption diagnostic: shown, exercised (it appeared before the final action; for IR-02, at least 300 ms before the last Apply), handled and completed (the task's own end state, regardless of handling).

Caveats. The interruptions are simulated inside BenchLab: none is a real system permission prompt, a Notification Center banner or a page in Chrome. IR-02 can be passed without touching the banner by a setup that presses Apply through accessibility, which is correct behaviour. IR-04's page is WebKit inside BenchLab, so a setup's Chrome-specific browser tools do not apply.

How the runner uses a BenchLab task

Per trial:

  1. render_brief.render(seed) from probes/<ID>/render_brief.py gives the prompt.
  2. BenchLab starts as BenchLab <app_args from task.json> --seed S --state STATE --events EVENTS, with a throwaway HOME.
  3. BenchSentinel (the witness) starts and is made frontmost and key; it is armed just before the agent starts and disarmed after.
  4. The agent runs with timeout_s and max_turns from task.json.
  5. probes/<ID>/evaluate.py writes the result.
  6. Reset: kill BenchLab and delete the state, event and home files.

tools/fixture.py setup|check|reset --task <ID> --seed S --dir D does steps 2, 5 and 6 by hand. tools/validate.py repeats the no-op, oracle, reset and wrong-action validation with real input (it takes the foreground and moves the pointer, so run it only on a free desktop). The oracles' input injector is built with xcrun swiftc -O tools/benchinput.swift -o <dir>/benchinput.

BenchLab has other modes, used by earlier pilot tasks that are not part of Bench v2 and are not in this repository.

Platforms, splits and the task manifest

../../taskpack/v2-taskset.json lists every task with its category, apps, OS availability (all ten tasks: macOS, Linux and Windows), conditions, health requirements and split; the bench README renders it as a table. Selectors are in probes/<ID>/task.json. A task whose selector says "split": "heldout" is read from a separate pack with the same layout, named by CDB_TASKPACK_HELDOUT (selectors in probes/, trees in tasks/, digests in pins.heldout.json); --task-set v2-public / v2-heldout select one split. A pack task may declare native macOS apps (kind: native, exact process_names) and a semantics.export step that reads app data into the workspace after the agent and before the evaluator; the checker reads only the exported files. A task whose manifest entry lists conditions runs only in those when a set other than v2 is selected, so v2 reproduces earlier runs.