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.

feat(cua-driver): measure jev-use native accuracy at larger candidate sets (#4330)

Francesco Bonaccic3941497a554
diff --git a/.github/workflows/ci-jev-use.yml b/.github/workflows/ci-jev-use.yml
index 3602991ed0..4ec4465711 100644
--- a/.github/workflows/ci-jev-use.yml
+++ b/.github/workflows/ci-jev-use.yml
@@ -540,6 +540,21 @@ jobs:
text = path.read_text().lower()
assert not any(value in text for value in forbidden), (path, [v for v in forbidden if v in text])
PY
+ # #4312: the opt-in distractor density fills the set past the 24-action
+ # cap; the relevance cap must still offer every declared task step.
+ - name: Run the native tasks at distractor density 24 with the mock agent
+ run: |
+ uv run --frozen python verify_native.py --density 24 --output-dir "$RUNNER_TEMP/jev-use-native-density"
+ uv run --frozen python - "$RUNNER_TEMP/jev-use-native-density" <<'PY'
+ import json, pathlib, sys
+ summary = json.loads((pathlib.Path(sys.argv[1]) / "summary.json").read_text())
+ assert summary["complete"] is True and summary["density"] == 24
+ assert {c["task"] for c in summary["checks"]} == {"appkit-counter", "appkit-save-note", "appkit-choose-size"}
+ for check in summary["checks"]:
+ assert check["verified"] is True and check["runner_outcome"] == "verified", check
+ assert check["density"] == 24 and check["distractor_actions"] == 0, check
+ assert check["max_candidates"] == 26, check # 24 actions + reobserve + abstain
+ PY
- name: Stop the Driver daemon
if: always()
run: '"$CUA_DRIVER_BIN" stop || true'
@@ -551,6 +566,8 @@ jobs:
path: |
${{ runner.temp }}/jev-use-native-proof/summary.json
${{ runner.temp }}/jev-use-native-proof/*.jsonl
+ ${{ runner.temp }}/jev-use-native-density/summary.json
+ ${{ runner.temp }}/jev-use-native-density/*.jsonl
if-no-files-found: error
retention-days: 14
@@ -1040,6 +1057,35 @@ jobs:
text = path.read_text().lower()
assert not any(value in text for value in forbidden), (path, [v for v in forbidden if v in text])
PY
+ # #4312: the opt-in distractor density fills the set past the 24-action
+ # cap; the relevance cap must still offer every declared task step.
+ - name: Run the native tasks at distractor density 24 with the mock agent on X11
+ working-directory: ${{ github.workspace }}
+ run: |
+ session_script="$RUNNER_TEMP/jev-use-native-density-session.sh"
+ cat > "$session_script" <<'SH'
+ set -euo pipefail
+ openbox >/tmp/jev-use-native-density-openbox.log 2>&1 &
+ sleep 2
+ cd libs/cua-driver/examples/jev-use
+ .venv/bin/python verify_native.py --harness gtk3 --density 24 "$@" \
+ --output-dir "$RUNNER_TEMP/jev-use-native-density"
+ SH
+ tasks=()
+ for task in ${EXPECTED_GTK3_TASKS//,/ }; do tasks+=(--task "${task#gtk3-}"); done
+ xvfb-run -a --server-args="-screen 0 1920x1080x24" \
+ dbus-run-session -- bash "$session_script" "${tasks[@]}"
+ cd libs/cua-driver/examples/jev-use
+ .venv/bin/python - "$RUNNER_TEMP/jev-use-native-density" <<'PY'
+ import json, os, pathlib, sys
+ summary = json.loads((pathlib.Path(sys.argv[1]) / "summary.json").read_text())
+ assert summary["complete"] is True and summary["density"] == 24
+ assert {c["task"] for c in summary["checks"]} == set(os.environ["EXPECTED_GTK3_TASKS"].split(","))
+ for check in summary["checks"]:
+ assert check["verified"] is True and check["runner_outcome"] == "verified", check
+ assert check["density"] == 24 and check["distractor_actions"] == 0, check
+ assert check["max_candidates"] == 26, check # 24 actions + reobserve + abstain
+ PY
- name: Upload redacted native evidence
if: always()
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
@@ -1048,6 +1094,8 @@ jobs:
path: |
${{ runner.temp }}/jev-use-native-proof/summary.json
${{ runner.temp }}/jev-use-native-proof/*.jsonl
+ ${{ runner.temp }}/jev-use-native-density/summary.json
+ ${{ runner.temp }}/jev-use-native-density/*.jsonl
${{ runner.temp }}/jev-use-native-window-state/*.json
if-no-files-found: error
retention-days: 14
diff --git a/docs/content/docs/how-to-guides/driver/use-jev-use-with-native-apps.mdx b/docs/content/docs/how-to-guides/driver/use-jev-use-with-native-apps.mdx
index 8d56b9563b..ab4f7b609f 100644
--- a/docs/content/docs/how-to-guides/driver/use-jev-use-with-native-apps.mdx
+++ b/docs/content/docs/how-to-guides/driver/use-jev-use-with-native-apps.mdx
@@ -33,7 +33,9 @@ builds a closed list of candidates:
path of actionable ancestors, not from element indexes that change between
observations.
- **Bounded and safe.** At most 24 actions are offered, plus `reobserve` and
- `abstain`. Controls whose labels suggest deleting, sending, purchasing, or
+ `abstain`. In a window with more controls, the ones that perform the task's
+ declared steps are kept first, and the offered actions keep their accessibility-tree
+ order. Controls whose labels suggest deleting, sending, purchasing, or
closing are left out unless the task allows that risk. Typed text comes
only from the task's parameters.
diff --git a/libs/cua-driver/examples/jev-use/README.md b/libs/cua-driver/examples/jev-use/README.md
index e5c6c39615..162c7ade57 100644
--- a/libs/cua-driver/examples/jev-use/README.md
+++ b/libs/cua-driver/examples/jev-use/README.md
@@ -86,7 +86,10 @@ Only enabled, on-screen, labeled, native (not `in_web_content`) elements
become candidates; a label equal to the element's value counts as unlabeled.
Candidate IDs come from the role class, label, and actionable-ancestor path,
never `element_index`. At most 24 action candidates are offered, plus
-`reobserve` and `abstain`. Labels that suggest deleting, sending, purchasing,
+`reobserve` and `abstain`. When more are eligible, the candidates that perform
+the task's declared steps are kept first, then controls whose label shares a
+word with the goal, then the rest in element order; the kept candidates are
+still presented in element order, and the number dropped is logged. Labels that suggest deleting, sending, purchasing,
or closing are excluded unless the task allows that risk. Text comes only from
task parameters. Actions are element-bound `click`, `set_value`, or
`type_text` with background delivery first; a stale token leads to a fresh
@@ -163,6 +166,31 @@ no `value` for a named text field
`gtk3-save-note` cannot observe its own write, so it keeps offering the write
until the step budget runs out.
+#### Measure accuracy at larger candidate sets
+
+The task-mode harnesses show only a few controls, so each step offers 4 to 7
+candidates. `CUA_APPKIT_TASK_DENSITY` or `CUA_GTK3_TASK_DENSITY` set to `12` or
+`24`, together with the task-state variable, adds benign distractor controls
+(toolbar-style buttons, labeled text fields, checkboxes, and radio groups, some
+close to a task control such as "Save draft" or "Note title") before the task
+controls, which fills the set to about 12 or to the 24-candidate cap.
+`verify_native.py --density 12` or `--density 24` launches the harness that
+way and checks that the harness reports the density. Each runner step logs
+`candidate_count`, `expected_ids` (the declared steps that are due), and
+`expected_offered`, next to the choice, confidence, and `decide_ms`.
+`measure_native.py` turns those logs, or an offline replay of captured
+fixtures through any provider, into an accuracy table by set size:
+
+```bash
+# Score the runner logs of live runs
+uv run --frozen python measure_native.py logs /tmp/jev-native-proof --out /tmp/jev-native-accuracy
+# Replay recorded window states through Cua-S1, comparing depth-first and relevance capping
+uv run --frozen python measure_native.py replay --provider s1 --reps 5 \
+ --fixture gtk3:24:fixtures/native/gtk3-window-state-density-24-v1.json \
+ --cap-order depth_first --cap-order relevance --order element --order shuffled \
+ --out /tmp/jev-native-replay --group-by density,cap_order,order,bucket
+```
+
#### Choose with Cua-S1
The native runners also accept `--provider s1`, and `verify_native.py` accepts
diff --git a/libs/cua-driver/examples/jev-use/fixtures/native/appkit-window-state-density-12-v1.json b/libs/cua-driver/examples/jev-use/fixtures/native/appkit-window-state-density-12-v1.json
new file mode 100644
index 0000000000..e3543e2446
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/fixtures/native/appkit-window-state-density-12-v1.json
@@ -0,0 +1,1762 @@
+{
+ "_fixture": {
+ "source": "CuaTestHarness.AppKit with CUA_APPKIT_TASK_STATE and CUA_APPKIT_TASK_DENSITY=12 set (initial), observed by cua-driver 0.30.4 get_window_state (macOS 26.5.2 Lume guest)",
+ "sanitized": "Recorded by verify_native.py --capture-dir. Screenshot bytes, tree_markdown, local file paths, and Driver guidance notes removed. The system Apple menu's machine-specific items (the Recent Items entries and the account name) were removed."
+ },
+ "app_name": "CuaTestHarness.AppKit",
+ "background_input": {
+ "exact_window": {
+ "pid": 7800,
+ "status": "matched",
+ "window_id": 131
+ },
+ "observation": {
+ "frame_freshness": "unknown",
+ "one_shot_capture": "available"
+ },
+ "routes": [
+ {
+ "route": "accessibility",
+ "status": "available"
+ },
+ {
+ "route": "window_pointer",
+ "status": "available"
+ },
+ {
+ "route": "pid_keyboard",
+ "status": "available"
+ }
+ ]
+ },
+ "capture_id": "capture_60148edbb2464777b8edbbe39fbf8ad1_0000000000000014",
+ "element_count": 90,
+ "elements": [
+ {
+ "actions": [
+ "AXRaise"
+ ],
+ "depth": 0,
+ "element_index": 0,
+ "element_token": "s00000012:0",
+ "frame": {
+ "h": 892.0,
+ "w": 1300.0,
+ "x": 310.0,
+ "y": 50.0
+ },
+ "label": "CuaTestHarness AppKit",
+ "role": "AXWindow",
+ "screenshot_frame": {
+ "h": 892,
+ "w": 1300,
+ "x": 0,
+ "y": 0
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 1,
+ "element_token": "s00000012:1",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 92.0,
+ "x": 325.0,
+ "y": 117.0
+ },
+ "label": "New folder",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 92,
+ "x": 15,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 2,
+ "element_token": "s00000012:2",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 73.0,
+ "x": 423.0,
+ "y": 117.0
+ },
+ "label": "Refresh",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 73,
+ "x": 113,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 3,
+ "element_token": "s00000012:3",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 59.0,
+ "x": 502.0,
+ "y": 117.0
+ },
+ "label": "Undo",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 59,
+ "x": 192,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 4,
+ "element_token": "s00000012:4",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 58.0,
+ "x": 567.0,
+ "y": 117.0
+ },
+ "label": "Redo",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 58,
+ "x": 257,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 5,
+ "element_token": "s00000012:5",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 76.0,
+ "x": 325.0,
+ "y": 149.0
+ },
+ "label": "Zoom in",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 76,
+ "x": 15,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 6,
+ "element_token": "s00000012:6",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 85.0,
+ "x": 407.0,
+ "y": 149.0
+ },
+ "label": "Zoom out",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 85,
+ "x": 97,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 7,
+ "element_token": "s00000012:7",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 88.0,
+ "x": 498.0,
+ "y": 149.0
+ },
+ "label": "Save draft",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 88,
+ "x": 188,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 8,
+ "element_token": "s00000012:8",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 133.0,
+ "x": 592.0,
+ "y": 149.0
+ },
+ "label": "Increase font size",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 133,
+ "x": 282,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 9,
+ "element_token": "s00000012:9",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 202.0,
+ "x": 325.0,
+ "y": 181.0
+ },
+ "label": "Search",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 202,
+ "x": 15,
+ "y": 131
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 10,
+ "element_token": "s00000012:10",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 89.0,
+ "x": 325.0,
+ "y": 213.0
+ },
+ "label": "Show ruler",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 89,
+ "x": 15,
+ "y": 163
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 11,
+ "element_token": "s00000012:11",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 115.0,
+ "x": 420.0,
+ "y": 213.0
+ },
+ "label": "Show previews",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 115,
+ "x": 110,
+ "y": 163
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 12,
+ "element_token": "s00000012:12",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 90.0,
+ "x": 541.0,
+ "y": 213.0
+ },
+ "label": "Word wrap",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 90,
+ "x": 231,
+ "y": 163
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 13,
+ "element_token": "s00000012:13",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 55.0,
+ "x": 325.0,
+ "y": 237.0
+ },
+ "label": "Light",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 55,
+ "x": 15,
+ "y": 187
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 14,
+ "element_token": "s00000012:14",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 53.0,
+ "x": 386.0,
+ "y": 237.0
+ },
+ "label": "Dark",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 53,
+ "x": 76,
+ "y": 187
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 15,
+ "element_token": "s00000012:15",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 69.0,
+ "x": 445.0,
+ "y": 237.0
+ },
+ "label": "System",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 69,
+ "x": 135,
+ "y": 187
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 16,
+ "element_token": "s00000012:16",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 87.0,
+ "x": 929.0,
+ "y": 117.0
+ },
+ "label": "Increment",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 87,
+ "x": 619,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 17,
+ "element_token": "s00000012:17",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 61.0,
+ "x": 1026.0,
+ "y": 117.0
+ },
+ "label": "Reset",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 61,
+ "x": 716,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 18,
+ "element_token": "s00000012:18",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 242.0,
+ "x": 929.0,
+ "y": 221.0
+ },
+ "label": "Type here…",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 242,
+ "x": 619,
+ "y": 171
+ },
+ "value": "Type here…"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 19,
+ "element_token": "s00000012:19",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 221.0,
+ "x": 929.0,
+ "y": 277.0
+ },
+ "label": "Click target (left / right / double)",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 221,
+ "x": 619,
+ "y": 227
+ }
+ },
+ {
+ "actions": [
+ "AXIncrement",
+ "AXDecrement"
+ ],
+ "depth": 1,
+ "element_index": 20,
+ "element_token": "s00000012:20",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 322.0,
+ "x": 929.0,
+ "y": 333.0
+ },
+ "label": "sld-value",
+ "max": 100.0,
+ "min": 0.0,
+ "parent_index": 0,
+ "role": "AXSlider",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 322,
+ "x": 619,
+ "y": 283
+ },
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 21,
+ "element_token": "s00000012:21",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 66.0,
+ "x": 929.0,
+ "y": 408.0
+ },
+ "label": "I agree",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 66,
+ "x": 619,
+ "y": 358
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 4,
+ "element_index": 22,
+ "element_token": "s00000012:22",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 138.0,
+ "x": 1130.0,
+ "y": 383.0
+ },
+ "label": "alpha",
+ "parent_index": 0,
+ "role": "AXStaticText",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 138,
+ "x": 820,
+ "y": 333
+ },
+ "value": "alpha"
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 4,
+ "element_index": 23,
+ "element_token": "s00000012:23",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 138.0,
+ "x": 1130.0,
+ "y": 407.0
+ },
+ "label": "beta",
+ "parent_index": 0,
+ "role": "AXStaticText",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 138,
+ "x": 820,
+ "y": 357
+ },
+ "value": "beta"
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 4,
+ "element_index": 24,
+ "element_token": "s00000012:24",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 138.0,
+ "x": 1130.0,
+ "y": 431.0
+ },
+ "label": "gamma",
+ "parent_index": 0,
+ "role": "AXStaticText",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 138,
+ "x": 820,
+ "y": 381
+ },
+ "value": "gamma"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 25,
+ "element_token": "s00000012:25",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 26,
+ "element_token": "s00000012:26",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 27,
+ "element_token": "s00000012:27",
+ "frame": {
+ "h": 5.0,
+ "w": 11.0,
+ "x": 1257.0,
+ "y": 442.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 5,
+ "w": 11,
+ "x": 947,
+ "y": 392
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 28,
+ "element_token": "s00000012:28",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 29,
+ "element_token": "s00000012:29",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 198.0,
+ "x": 929.0,
+ "y": 482.0
+ },
+ "label": "Right-click for context menu",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 198,
+ "x": 619,
+ "y": 432
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 1,
+ "element_index": 30,
+ "element_token": "s00000012:30",
+ "frame": {
+ "h": 448.0,
+ "w": 461.0,
+ "x": 931.0,
+ "y": 540.0
+ },
+ "label": "SCROLL_TOP_MARKER_v1\nLine 0\nLine 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10\nLine 11\nLine 12\nLine 13\nLine 14\nLine 15\nLine 16\nLine 17\nLine 18\nLine 19\nLine 20\nLine 21\nLine 22\nLine 23\nLine 24\nLine 25\nLine 26\nLine 27\nLine 28\nLine 29\nSCROLL_BOTTOM_MARKER_v1",
+ "parent_index": 0,
+ "role": "AXTextArea",
+ "screenshot_frame": {
+ "h": 448,
+ "w": 461,
+ "x": 621,
+ "y": 490
+ },
+ "value": "SCROLL_TOP_MARKER_v1\nLine 0\nLine 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10\nLine 11\nLine 12\nLine 13\nLine 14\nLine 15\nLine 16\nLine 17\nLine 18\nLine 19\nLine 20\nLine 21\nLine 22\nLine 23\nLine 24\nLine 25\nLine 26\nLine 27\nLine 28\nLine 29\nSCROLL_BOTTOM_MARKER_v1"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 31,
+ "element_token": "s00000012:31",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 32,
+ "element_token": "s00000012:32",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 33,
+ "element_token": "s00000012:33",
+ "frame": {
+ "h": 82.0,
+ "w": 11.0,
+ "x": 1395.0,
+ "y": 573.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 82,
+ "w": 11,
+ "x": 1085,
+ "y": 523
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 34,
+ "element_token": "s00000012:34",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 35,
+ "element_token": "s00000012:35",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 49.0,
+ "x": 929.0,
+ "y": 666.0
+ },
+ "label": "Exit",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 49,
+ "x": 619,
+ "y": 616
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 36,
+ "element_token": "s00000012:36",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 242.0,
+ "x": 929.0,
+ "y": 722.0
+ },
+ "label": "Note",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 242,
+ "x": 619,
+ "y": 672
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 37,
+ "element_token": "s00000012:37",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 86.0,
+ "x": 1181.0,
+ "y": 722.0
+ },
+ "label": "Save note",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 86,
+ "x": 871,
+ "y": 672
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 38,
+ "element_token": "s00000012:38",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 57.0,
+ "x": 929.0,
+ "y": 754.0
+ },
+ "label": "Small",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 57,
+ "x": 619,
+ "y": 704
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 39,
+ "element_token": "s00000012:39",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 73.0,
+ "x": 996.0,
+ "y": 754.0
+ },
+ "label": "Medium",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 73,
+ "x": 686,
+ "y": 704
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 40,
+ "element_token": "s00000012:40",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 59.0,
+ "x": 1079.0,
+ "y": 754.0
+ },
+ "label": "Large",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 59,
+ "x": 769,
+ "y": 704
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 41,
+ "element_token": "s00000012:41",
+ "enabled": true,
+ "frame": {
+ "h": 16.0,
+ "w": 16.0,
+ "x": 318.0,
+ "y": 58.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 16,
+ "w": 16,
+ "x": 8,
+ "y": 8
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 42,
+ "element_token": "s00000012:42",
+ "enabled": true,
+ "frame": {
+ "h": 16.0,
+ "w": 16.0,
+ "x": 341.0,
+ "y": 58.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 16,
+ "w": 16,
+ "x": 31,
+ "y": 8
+ }
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 0,
+ "element_index": 43,
+ "element_token": "s00000012:43",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 1920.0,
+ "x": 0.0,
+ "y": 0.0
+ },
+ "role": "AXMenuBar",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 1920,
+ "x": -310,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 1,
+ "element_index": 44,
+ "element_token": "s00000012:44",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 34.0,
+ "x": 10.0,
+ "y": 0.0
+ },
+ "label": "Apple",
+ "parent_index": 43,
+ "role": "AXMenuBarItem",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 34,
+ "x": -300,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 2,
+ "element_index": 45,
+ "element_token": "s00000012:45",
+ "enabled": true,
+ "parent_index": 44,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 46,
+ "element_token": "s00000012:46",
+ "enabled": true,
+ "label": "About This Mac",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 47,
+ "element_token": "s00000012:47",
+ "enabled": true,
+ "label": "System Information",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 48,
+ "element_token": "s00000012:48",
+ "enabled": true,
+ "label": "System Settings…",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 49,
+ "element_token": "s00000012:49",
+ "enabled": true,
+ "label": "App Store",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 50,
+ "element_token": "s00000012:50",
+ "enabled": true,
+ "label": "Recent Items",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 4,
+ "element_index": 51,
+ "element_token": "s00000012:51",
+ "enabled": true,
+ "parent_index": 50,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 76,
+ "element_token": "s00000012:76",
+ "enabled": true,
+ "label": "Force Quit…",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 77,
+ "element_token": "s00000012:77",
+ "enabled": true,
+ "label": "Force Quit CuaTestHarness.AppKit",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 78,
+ "element_token": "s00000012:78",
+ "enabled": true,
+ "label": "Sleep",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 79,
+ "element_token": "s00000012:79",
+ "enabled": true,
+ "label": "Restart…",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 80,
+ "element_token": "s00000012:80",
+ "enabled": true,
+ "label": "Restart",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 81,
+ "element_token": "s00000012:81",
+ "enabled": true,
+ "label": "Shut Down…",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 82,
+ "element_token": "s00000012:82",
+ "enabled": true,
+ "label": "Shut Down",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 83,
+ "element_token": "s00000012:83",
+ "enabled": true,
+ "label": "Lock Screen",
+ "parent_index": 45,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 1,
+ "element_index": 86,
+ "element_token": "s00000012:86",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 175.0,
+ "x": 44.0,
+ "y": 0.0
+ },
+ "label": "CuaTestHarness.AppKit",
+ "parent_index": 43,
+ "role": "AXMenuBarItem",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 175,
+ "x": -266,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 2,
+ "element_index": 87,
+ "element_token": "s00000012:87",
+ "enabled": true,
+ "parent_index": 86,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 88,
+ "element_token": "s00000012:88",
+ "enabled": true,
+ "label": "Quit",
+ "parent_index": 87,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 89,
+ "element_token": "s00000012:89",
+ "enabled": true,
+ "label": "Quit and Keep Windows",
+ "parent_index": 87,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 1,
+ "element_index": 90,
+ "element_token": "s00000012:90",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 69.0,
+ "x": 219.0,
+ "y": 0.0
+ },
+ "label": "Window",
+ "parent_index": 43,
+ "role": "AXMenuBarItem",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 69,
+ "x": -91,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 2,
+ "element_index": 91,
+ "element_token": "s00000012:91",
+ "enabled": true,
+ "parent_index": 90,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 92,
+ "element_token": "s00000012:92",
+ "enabled": true,
+ "label": "Center",
+ "parent_index": 91,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 93,
+ "element_token": "s00000012:93",
+ "enabled": true,
+ "label": "Move & Resize",
+ "parent_index": 91,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 4,
+ "element_index": 94,
+ "element_token": "s00000012:94",
+ "enabled": true,
+ "parent_index": 93,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 95,
+ "element_token": "s00000012:95",
+ "enabled": true,
+ "label": "Left",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 96,
+ "element_token": "s00000012:96",
+ "enabled": true,
+ "label": "Right",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 97,
+ "element_token": "s00000012:97",
+ "enabled": true,
+ "label": "Top",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 98,
+ "element_token": "s00000012:98",
+ "enabled": true,
+ "label": "Bottom",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 99,
+ "element_token": "s00000012:99",
+ "enabled": true,
+ "label": "Top Left",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 100,
+ "element_token": "s00000012:100",
+ "enabled": true,
+ "label": "Top Right",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 101,
+ "element_token": "s00000012:101",
+ "enabled": true,
+ "label": "Bottom Left",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 102,
+ "element_token": "s00000012:102",
+ "enabled": true,
+ "label": "Bottom Right",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 103,
+ "element_token": "s00000012:103",
+ "enabled": true,
+ "label": "Left & Right",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 104,
+ "element_token": "s00000012:104",
+ "enabled": true,
+ "label": "Left & Quarters",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 105,
+ "element_token": "s00000012:105",
+ "enabled": true,
+ "label": "Right & Left",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 106,
+ "element_token": "s00000012:106",
+ "enabled": true,
+ "label": "Right & Quarters",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 107,
+ "element_token": "s00000012:107",
+ "enabled": true,
+ "label": "Top & Bottom",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 108,
+ "element_token": "s00000012:108",
+ "enabled": true,
+ "label": "Top & Quarters",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 109,
+ "element_token": "s00000012:109",
+ "enabled": true,
+ "label": "Bottom & Top",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 110,
+ "element_token": "s00000012:110",
+ "enabled": true,
+ "label": "Bottom & Quarters",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 111,
+ "element_token": "s00000012:111",
+ "enabled": true,
+ "label": "Quarters",
+ "parent_index": 94,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 112,
+ "element_token": "s00000012:112",
+ "enabled": true,
+ "label": "Arrange",
+ "parent_index": 91,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 4,
+ "element_index": 113,
+ "element_token": "s00000012:113",
+ "enabled": true,
+ "parent_index": 112,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 114,
+ "element_token": "s00000012:114",
+ "enabled": true,
+ "label": "Left",
+ "parent_index": 113,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 115,
+ "element_token": "s00000012:115",
+ "enabled": true,
+ "label": "CuaTestHarness AppKit",
+ "parent_index": 91,
+ "role": "AXMenuItem",
+ "selected": false
+ }
+ ],
+ "elements_complete": false,
+ "nodes_pending": 0,
+ "nodes_visited": 184,
+ "pid": 7800,
+ "returned_element_count": 90,
+ "screenshot_frame_valid": true,
+ "screenshot_height": 892,
+ "screenshot_mime_type": "image/png",
+ "screenshot_scale": 1.0,
+ "screenshot_width": 1300,
+ "snapshot_id": "s00000012",
+ "timeout_ms": 1000,
+ "total_element_count": 116,
+ "truncated": false,
+ "walk_elapsed_ms": 141,
+ "window_bounds": {
+ "height": 892.0,
+ "width": 1300.0,
+ "x": 310.0,
+ "y": 50.0
+ },
+ "window_id": 131,
+ "window_title": "CuaTestHarness AppKit"
+}
diff --git a/libs/cua-driver/examples/jev-use/fixtures/native/appkit-window-state-density-24-v1.json b/libs/cua-driver/examples/jev-use/fixtures/native/appkit-window-state-density-24-v1.json
new file mode 100644
index 0000000000..01635a3ee7
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/fixtures/native/appkit-window-state-density-24-v1.json
@@ -0,0 +1,2687 @@
+{
+ "_fixture": {
+ "source": "CuaTestHarness.AppKit with CUA_APPKIT_TASK_STATE and CUA_APPKIT_TASK_DENSITY=24 set (initial), observed by cua-driver 0.30.4 get_window_state (macOS 26.5.2 Lume guest)",
+ "sanitized": "Recorded by verify_native.py --capture-dir. Screenshot bytes, tree_markdown, local file paths, and Driver guidance notes removed. The system Apple menu's machine-specific items (the Recent Items entries and the account name) were removed."
+ },
+ "app_name": "CuaTestHarness.AppKit",
+ "background_input": {
+ "exact_window": {
+ "pid": 7989,
+ "status": "matched",
+ "window_id": 158
+ },
+ "observation": {
+ "frame_freshness": "unknown",
+ "one_shot_capture": "available"
+ },
+ "routes": [
+ {
+ "route": "accessibility",
+ "status": "available"
+ },
+ {
+ "route": "window_pointer",
+ "status": "available"
+ },
+ {
+ "route": "pid_keyboard",
+ "status": "available"
+ }
+ ]
+ },
+ "capture_id": "capture_60148edbb2464777b8edbbe39fbf8ad1_0000000000000021",
+ "element_count": 127,
+ "elements": [
+ {
+ "actions": [
+ "AXRaise"
+ ],
+ "depth": 0,
+ "element_index": 0,
+ "element_token": "s0000001f:0",
+ "frame": {
+ "h": 892.0,
+ "w": 1300.0,
+ "x": 310.0,
+ "y": 50.0
+ },
+ "label": "CuaTestHarness AppKit",
+ "role": "AXWindow",
+ "screenshot_frame": {
+ "h": 892,
+ "w": 1300,
+ "x": 0,
+ "y": 0
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 1,
+ "element_token": "s0000001f:1",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 92.0,
+ "x": 325.0,
+ "y": 117.0
+ },
+ "label": "New folder",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 92,
+ "x": 15,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 2,
+ "element_token": "s0000001f:2",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 73.0,
+ "x": 423.0,
+ "y": 117.0
+ },
+ "label": "Refresh",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 73,
+ "x": 113,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 3,
+ "element_token": "s0000001f:3",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 59.0,
+ "x": 502.0,
+ "y": 117.0
+ },
+ "label": "Undo",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 59,
+ "x": 192,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 4,
+ "element_token": "s0000001f:4",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 58.0,
+ "x": 567.0,
+ "y": 117.0
+ },
+ "label": "Redo",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 58,
+ "x": 257,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 5,
+ "element_token": "s0000001f:5",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 76.0,
+ "x": 325.0,
+ "y": 149.0
+ },
+ "label": "Zoom in",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 76,
+ "x": 15,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 6,
+ "element_token": "s0000001f:6",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 85.0,
+ "x": 407.0,
+ "y": 149.0
+ },
+ "label": "Zoom out",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 85,
+ "x": 97,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 7,
+ "element_token": "s0000001f:7",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 88.0,
+ "x": 498.0,
+ "y": 149.0
+ },
+ "label": "Save draft",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 88,
+ "x": 188,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 8,
+ "element_token": "s0000001f:8",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 133.0,
+ "x": 592.0,
+ "y": 149.0
+ },
+ "label": "Increase font size",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 133,
+ "x": 282,
+ "y": 99
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 9,
+ "element_token": "s0000001f:9",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 82.0,
+ "x": 325.0,
+ "y": 181.0
+ },
+ "label": "Copy link",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 82,
+ "x": 15,
+ "y": 131
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 10,
+ "element_token": "s0000001f:10",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 84.0,
+ "x": 413.0,
+ "y": 181.0
+ },
+ "label": "Duplicate",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 84,
+ "x": 103,
+ "y": 131
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 11,
+ "element_token": "s0000001f:11",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 75.0,
+ "x": 503.0,
+ "y": 181.0
+ },
+ "label": "Rename",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 75,
+ "x": 193,
+ "y": 131
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 12,
+ "element_token": "s0000001f:12",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 106.0,
+ "x": 584.0,
+ "y": 181.0
+ },
+ "label": "Print preview",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 106,
+ "x": 274,
+ "y": 131
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 13,
+ "element_token": "s0000001f:13",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 95.0,
+ "x": 325.0,
+ "y": 213.0
+ },
+ "label": "Export PDF",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 95,
+ "x": 15,
+ "y": 163
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 14,
+ "element_token": "s0000001f:14",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 66.0,
+ "x": 426.0,
+ "y": 213.0
+ },
+ "label": "Import",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 66,
+ "x": 116,
+ "y": 163
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 15,
+ "element_token": "s0000001f:15",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 54.0,
+ "x": 498.0,
+ "y": 213.0
+ },
+ "label": "Bold",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 54,
+ "x": 188,
+ "y": 163
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 16,
+ "element_token": "s0000001f:16",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 55.0,
+ "x": 558.0,
+ "y": 213.0
+ },
+ "label": "Italic",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 55,
+ "x": 248,
+ "y": 163
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 17,
+ "element_token": "s0000001f:17",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 85.0,
+ "x": 325.0,
+ "y": 245.0
+ },
+ "label": "Underline",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 85,
+ "x": 15,
+ "y": 195
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 18,
+ "element_token": "s0000001f:18",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 80.0,
+ "x": 416.0,
+ "y": 245.0
+ },
+ "label": "Align left",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 80,
+ "x": 106,
+ "y": 195
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 19,
+ "element_token": "s0000001f:19",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 99.0,
+ "x": 502.0,
+ "y": 245.0
+ },
+ "label": "Align center",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 99,
+ "x": 192,
+ "y": 195
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 20,
+ "element_token": "s0000001f:20",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 89.0,
+ "x": 607.0,
+ "y": 245.0
+ },
+ "label": "Align right",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 89,
+ "x": 297,
+ "y": 195
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 21,
+ "element_token": "s0000001f:21",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 95.0,
+ "x": 325.0,
+ "y": 277.0
+ },
+ "label": "Insert table",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 95,
+ "x": 15,
+ "y": 227
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 22,
+ "element_token": "s0000001f:22",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 101.0,
+ "x": 426.0,
+ "y": 277.0
+ },
+ "label": "Insert image",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 101,
+ "x": 116,
+ "y": 227
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 23,
+ "element_token": "s0000001f:23",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 96.0,
+ "x": 533.0,
+ "y": 277.0
+ },
+ "label": "Spell check",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 96,
+ "x": 223,
+ "y": 227
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 24,
+ "element_token": "s0000001f:24",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 97.0,
+ "x": 635.0,
+ "y": 277.0
+ },
+ "label": "Word count",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 97,
+ "x": 325,
+ "y": 227
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 25,
+ "element_token": "s0000001f:25",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 108.0,
+ "x": 325.0,
+ "y": 309.0
+ },
+ "label": "Show sidebar",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 108,
+ "x": 15,
+ "y": 259
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 26,
+ "element_token": "s0000001f:26",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 54.0,
+ "x": 439.0,
+ "y": 309.0
+ },
+ "label": "Help",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 54,
+ "x": 129,
+ "y": 259
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 27,
+ "element_token": "s0000001f:27",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 202.0,
+ "x": 325.0,
+ "y": 341.0
+ },
+ "label": "Search",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 202,
+ "x": 15,
+ "y": 291
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 28,
+ "element_token": "s0000001f:28",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 202.0,
+ "x": 533.0,
+ "y": 341.0
+ },
+ "label": "Note title",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 202,
+ "x": 223,
+ "y": 291
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 29,
+ "element_token": "s0000001f:29",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 89.0,
+ "x": 325.0,
+ "y": 373.0
+ },
+ "label": "Show ruler",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 89,
+ "x": 15,
+ "y": 323
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 30,
+ "element_token": "s0000001f:30",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 115.0,
+ "x": 420.0,
+ "y": 373.0
+ },
+ "label": "Show previews",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 115,
+ "x": 110,
+ "y": 323
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 31,
+ "element_token": "s0000001f:31",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 90.0,
+ "x": 541.0,
+ "y": 373.0
+ },
+ "label": "Word wrap",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 90,
+ "x": 231,
+ "y": 323
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 32,
+ "element_token": "s0000001f:32",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 86.0,
+ "x": 325.0,
+ "y": 397.0
+ },
+ "label": "Auto-save",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 86,
+ "x": 15,
+ "y": 347
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 33,
+ "element_token": "s0000001f:33",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 106.0,
+ "x": 417.0,
+ "y": 397.0
+ },
+ "label": "Line numbers",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 106,
+ "x": 107,
+ "y": 347
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 34,
+ "element_token": "s0000001f:34",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 91.0,
+ "x": 529.0,
+ "y": 397.0
+ },
+ "label": "Dark mode",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 91,
+ "x": 219,
+ "y": 347
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 35,
+ "element_token": "s0000001f:35",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 131.0,
+ "x": 325.0,
+ "y": 421.0
+ },
+ "label": "Show hidden files",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 131,
+ "x": 15,
+ "y": 371
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 36,
+ "element_token": "s0000001f:36",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 120.0,
+ "x": 462.0,
+ "y": 421.0
+ },
+ "label": "Sync on startup",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 120,
+ "x": 152,
+ "y": 371
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 37,
+ "element_token": "s0000001f:37",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 120.0,
+ "x": 588.0,
+ "y": 421.0
+ },
+ "label": "Compact layout",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 120,
+ "x": 278,
+ "y": 371
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 38,
+ "element_token": "s0000001f:38",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 122.0,
+ "x": 325.0,
+ "y": 445.0
+ },
+ "label": "Show status bar",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 122,
+ "x": 15,
+ "y": 395
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 39,
+ "element_token": "s0000001f:39",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 167.0,
+ "x": 453.0,
+ "y": 445.0
+ },
+ "label": "Remember window size",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 167,
+ "x": 143,
+ "y": 395
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 40,
+ "element_token": "s0000001f:40",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 187.0,
+ "x": 626.0,
+ "y": 445.0
+ },
+ "label": "Check spelling as you type",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 187,
+ "x": 316,
+ "y": 395
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 41,
+ "element_token": "s0000001f:41",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 55.0,
+ "x": 325.0,
+ "y": 469.0
+ },
+ "label": "Light",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 55,
+ "x": 15,
+ "y": 419
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 42,
+ "element_token": "s0000001f:42",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 53.0,
+ "x": 386.0,
+ "y": 469.0
+ },
+ "label": "Dark",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 53,
+ "x": 76,
+ "y": 419
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 43,
+ "element_token": "s0000001f:43",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 69.0,
+ "x": 445.0,
+ "y": 469.0
+ },
+ "label": "System",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 69,
+ "x": 135,
+ "y": 419
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 44,
+ "element_token": "s0000001f:44",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 46.0,
+ "x": 325.0,
+ "y": 493.0
+ },
+ "label": "List",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 46,
+ "x": 15,
+ "y": 443
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 45,
+ "element_token": "s0000001f:45",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 50.0,
+ "x": 377.0,
+ "y": 493.0
+ },
+ "label": "Grid",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 50,
+ "x": 67,
+ "y": 443
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 46,
+ "element_token": "s0000001f:46",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 78.0,
+ "x": 433.0,
+ "y": 493.0
+ },
+ "label": "Columns",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 78,
+ "x": 123,
+ "y": 443
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 47,
+ "element_token": "s0000001f:47",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 60.0,
+ "x": 325.0,
+ "y": 517.0
+ },
+ "label": "Name",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 60,
+ "x": 15,
+ "y": 467
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 48,
+ "element_token": "s0000001f:48",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 53.0,
+ "x": 391.0,
+ "y": 517.0
+ },
+ "label": "Date",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 53,
+ "x": 81,
+ "y": 467
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 49,
+ "element_token": "s0000001f:49",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 52.0,
+ "x": 450.0,
+ "y": 517.0
+ },
+ "label": "Kind",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 52,
+ "x": 140,
+ "y": 467
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 50,
+ "element_token": "s0000001f:50",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 93.0,
+ "x": 325.0,
+ "y": 541.0
+ },
+ "label": "Small icons",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 93,
+ "x": 15,
+ "y": 491
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 51,
+ "element_token": "s0000001f:51",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 109.0,
+ "x": 424.0,
+ "y": 541.0
+ },
+ "label": "Medium icons",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 109,
+ "x": 114,
+ "y": 491
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 52,
+ "element_token": "s0000001f:52",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 95.0,
+ "x": 539.0,
+ "y": 541.0
+ },
+ "label": "Large icons",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 95,
+ "x": 229,
+ "y": 491
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 53,
+ "element_token": "s0000001f:53",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 87.0,
+ "x": 929.0,
+ "y": 117.0
+ },
+ "label": "Increment",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 87,
+ "x": 619,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 54,
+ "element_token": "s0000001f:54",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 61.0,
+ "x": 1026.0,
+ "y": 117.0
+ },
+ "label": "Reset",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 61,
+ "x": 716,
+ "y": 67
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 55,
+ "element_token": "s0000001f:55",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 242.0,
+ "x": 929.0,
+ "y": 221.0
+ },
+ "label": "Type here…",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 242,
+ "x": 619,
+ "y": 171
+ },
+ "value": "Type here…"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 56,
+ "element_token": "s0000001f:56",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 221.0,
+ "x": 929.0,
+ "y": 277.0
+ },
+ "label": "Click target (left / right / double)",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 221,
+ "x": 619,
+ "y": 227
+ }
+ },
+ {
+ "actions": [
+ "AXIncrement",
+ "AXDecrement"
+ ],
+ "depth": 1,
+ "element_index": 57,
+ "element_token": "s0000001f:57",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 322.0,
+ "x": 929.0,
+ "y": 333.0
+ },
+ "label": "sld-value",
+ "max": 100.0,
+ "min": 0.0,
+ "parent_index": 0,
+ "role": "AXSlider",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 322,
+ "x": 619,
+ "y": 283
+ },
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 58,
+ "element_token": "s0000001f:58",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 66.0,
+ "x": 929.0,
+ "y": 408.0
+ },
+ "label": "I agree",
+ "parent_index": 0,
+ "role": "AXCheckBox",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 66,
+ "x": 619,
+ "y": 358
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 4,
+ "element_index": 59,
+ "element_token": "s0000001f:59",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 138.0,
+ "x": 1130.0,
+ "y": 383.0
+ },
+ "label": "alpha",
+ "parent_index": 0,
+ "role": "AXStaticText",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 138,
+ "x": 820,
+ "y": 333
+ },
+ "value": "alpha"
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 4,
+ "element_index": 60,
+ "element_token": "s0000001f:60",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 138.0,
+ "x": 1130.0,
+ "y": 407.0
+ },
+ "label": "beta",
+ "parent_index": 0,
+ "role": "AXStaticText",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 138,
+ "x": 820,
+ "y": 357
+ },
+ "value": "beta"
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 4,
+ "element_index": 61,
+ "element_token": "s0000001f:61",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 138.0,
+ "x": 1130.0,
+ "y": 431.0
+ },
+ "label": "gamma",
+ "parent_index": 0,
+ "role": "AXStaticText",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 138,
+ "x": 820,
+ "y": 381
+ },
+ "value": "gamma"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 62,
+ "element_token": "s0000001f:62",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 63,
+ "element_token": "s0000001f:63",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 64,
+ "element_token": "s0000001f:64",
+ "frame": {
+ "h": 5.0,
+ "w": 11.0,
+ "x": 1257.0,
+ "y": 442.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 5,
+ "w": 11,
+ "x": 947,
+ "y": 392
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 65,
+ "element_token": "s0000001f:65",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 66,
+ "element_token": "s0000001f:66",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 198.0,
+ "x": 929.0,
+ "y": 482.0
+ },
+ "label": "Right-click for context menu",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 198,
+ "x": 619,
+ "y": 432
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu"
+ ],
+ "depth": 1,
+ "element_index": 67,
+ "element_token": "s0000001f:67",
+ "frame": {
+ "h": 448.0,
+ "w": 461.0,
+ "x": 931.0,
+ "y": 540.0
+ },
+ "label": "SCROLL_TOP_MARKER_v1\nLine 0\nLine 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10\nLine 11\nLine 12\nLine 13\nLine 14\nLine 15\nLine 16\nLine 17\nLine 18\nLine 19\nLine 20\nLine 21\nLine 22\nLine 23\nLine 24\nLine 25\nLine 26\nLine 27\nLine 28\nLine 29\nSCROLL_BOTTOM_MARKER_v1",
+ "parent_index": 0,
+ "role": "AXTextArea",
+ "screenshot_frame": {
+ "h": 448,
+ "w": 461,
+ "x": 621,
+ "y": 490
+ },
+ "value": "SCROLL_TOP_MARKER_v1\nLine 0\nLine 1\nLine 2\nLine 3\nLine 4\nLine 5\nLine 6\nLine 7\nLine 8\nLine 9\nLine 10\nLine 11\nLine 12\nLine 13\nLine 14\nLine 15\nLine 16\nLine 17\nLine 18\nLine 19\nLine 20\nLine 21\nLine 22\nLine 23\nLine 24\nLine 25\nLine 26\nLine 27\nLine 28\nLine 29\nSCROLL_BOTTOM_MARKER_v1"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 68,
+ "element_token": "s0000001f:68",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 69,
+ "element_token": "s0000001f:69",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 70,
+ "element_token": "s0000001f:70",
+ "frame": {
+ "h": 82.0,
+ "w": 11.0,
+ "x": 1395.0,
+ "y": 573.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 82,
+ "w": 11,
+ "x": 1085,
+ "y": 523
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 2,
+ "element_index": 71,
+ "element_token": "s0000001f:71",
+ "parent_index": 0,
+ "role": "AXButton"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 72,
+ "element_token": "s0000001f:72",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 49.0,
+ "x": 929.0,
+ "y": 666.0
+ },
+ "label": "Exit",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 49,
+ "x": 619,
+ "y": 616
+ }
+ },
+ {
+ "actions": [
+ "AXShowMenu",
+ "AXConfirm"
+ ],
+ "depth": 1,
+ "element_index": 73,
+ "element_token": "s0000001f:73",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 242.0,
+ "x": 929.0,
+ "y": 722.0
+ },
+ "label": "Note",
+ "parent_index": 0,
+ "role": "AXTextField",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 242,
+ "x": 619,
+ "y": 672
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 74,
+ "element_token": "s0000001f:74",
+ "enabled": true,
+ "frame": {
+ "h": 26.0,
+ "w": 86.0,
+ "x": 1181.0,
+ "y": 722.0
+ },
+ "label": "Save note",
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 26,
+ "w": 86,
+ "x": 871,
+ "y": 672
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 75,
+ "element_token": "s0000001f:75",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 57.0,
+ "x": 929.0,
+ "y": 754.0
+ },
+ "label": "Small",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 57,
+ "x": 619,
+ "y": 704
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 76,
+ "element_token": "s0000001f:76",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 73.0,
+ "x": 996.0,
+ "y": 754.0
+ },
+ "label": "Medium",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 73,
+ "x": 686,
+ "y": 704
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 77,
+ "element_token": "s0000001f:77",
+ "enabled": true,
+ "frame": {
+ "h": 18.0,
+ "w": 59.0,
+ "x": 1079.0,
+ "y": 754.0
+ },
+ "label": "Large",
+ "parent_index": 0,
+ "role": "AXRadioButton",
+ "screenshot_frame": {
+ "h": 18,
+ "w": 59,
+ "x": 769,
+ "y": 704
+ },
+ "selected": false,
+ "value": "0"
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 78,
+ "element_token": "s0000001f:78",
+ "enabled": true,
+ "frame": {
+ "h": 16.0,
+ "w": 16.0,
+ "x": 318.0,
+ "y": 58.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 16,
+ "w": 16,
+ "x": 8,
+ "y": 8
+ }
+ },
+ {
+ "actions": [
+ "AXPress"
+ ],
+ "depth": 1,
+ "element_index": 79,
+ "element_token": "s0000001f:79",
+ "enabled": true,
+ "frame": {
+ "h": 16.0,
+ "w": 16.0,
+ "x": 341.0,
+ "y": 58.0
+ },
+ "parent_index": 0,
+ "role": "AXButton",
+ "screenshot_frame": {
+ "h": 16,
+ "w": 16,
+ "x": 31,
+ "y": 8
+ }
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 0,
+ "element_index": 80,
+ "element_token": "s0000001f:80",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 1920.0,
+ "x": 0.0,
+ "y": 0.0
+ },
+ "role": "AXMenuBar",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 1920,
+ "x": -310,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 1,
+ "element_index": 81,
+ "element_token": "s0000001f:81",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 34.0,
+ "x": 10.0,
+ "y": 0.0
+ },
+ "label": "Apple",
+ "parent_index": 80,
+ "role": "AXMenuBarItem",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 34,
+ "x": -300,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 2,
+ "element_index": 82,
+ "element_token": "s0000001f:82",
+ "enabled": true,
+ "parent_index": 81,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 83,
+ "element_token": "s0000001f:83",
+ "enabled": true,
+ "label": "About This Mac",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 84,
+ "element_token": "s0000001f:84",
+ "enabled": true,
+ "label": "System Information",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 85,
+ "element_token": "s0000001f:85",
+ "enabled": true,
+ "label": "System Settings…",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 86,
+ "element_token": "s0000001f:86",
+ "enabled": true,
+ "label": "App Store",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 87,
+ "element_token": "s0000001f:87",
+ "enabled": true,
+ "label": "Recent Items",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 4,
+ "element_index": 88,
+ "element_token": "s0000001f:88",
+ "enabled": true,
+ "parent_index": 87,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 113,
+ "element_token": "s0000001f:113",
+ "enabled": true,
+ "label": "Force Quit…",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 114,
+ "element_token": "s0000001f:114",
+ "enabled": true,
+ "label": "Force Quit CuaTestHarness.AppKit",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 115,
+ "element_token": "s0000001f:115",
+ "enabled": true,
+ "label": "Sleep",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 116,
+ "element_token": "s0000001f:116",
+ "enabled": true,
+ "label": "Restart…",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 117,
+ "element_token": "s0000001f:117",
+ "enabled": true,
+ "label": "Restart",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 118,
+ "element_token": "s0000001f:118",
+ "enabled": true,
+ "label": "Shut Down…",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 119,
+ "element_token": "s0000001f:119",
+ "enabled": true,
+ "label": "Shut Down",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 120,
+ "element_token": "s0000001f:120",
+ "enabled": true,
+ "label": "Lock Screen",
+ "parent_index": 82,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 1,
+ "element_index": 123,
+ "element_token": "s0000001f:123",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 175.0,
+ "x": 44.0,
+ "y": 0.0
+ },
+ "label": "CuaTestHarness.AppKit",
+ "parent_index": 80,
+ "role": "AXMenuBarItem",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 175,
+ "x": -266,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 2,
+ "element_index": 124,
+ "element_token": "s0000001f:124",
+ "enabled": true,
+ "parent_index": 123,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 125,
+ "element_token": "s0000001f:125",
+ "enabled": true,
+ "label": "Quit",
+ "parent_index": 124,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 126,
+ "element_token": "s0000001f:126",
+ "enabled": true,
+ "label": "Quit and Keep Windows",
+ "parent_index": 124,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 1,
+ "element_index": 127,
+ "element_token": "s0000001f:127",
+ "enabled": true,
+ "frame": {
+ "h": 30.0,
+ "w": 69.0,
+ "x": 219.0,
+ "y": 0.0
+ },
+ "label": "Window",
+ "parent_index": 80,
+ "role": "AXMenuBarItem",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 69,
+ "x": -91,
+ "y": -50
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 2,
+ "element_index": 128,
+ "element_token": "s0000001f:128",
+ "enabled": true,
+ "parent_index": 127,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 129,
+ "element_token": "s0000001f:129",
+ "enabled": true,
+ "label": "Center",
+ "parent_index": 128,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 130,
+ "element_token": "s0000001f:130",
+ "enabled": true,
+ "label": "Move & Resize",
+ "parent_index": 128,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 4,
+ "element_index": 131,
+ "element_token": "s0000001f:131",
+ "enabled": true,
+ "parent_index": 130,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 132,
+ "element_token": "s0000001f:132",
+ "enabled": true,
+ "label": "Left",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 133,
+ "element_token": "s0000001f:133",
+ "enabled": true,
+ "label": "Right",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 134,
+ "element_token": "s0000001f:134",
+ "enabled": true,
+ "label": "Top",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 135,
+ "element_token": "s0000001f:135",
+ "enabled": true,
+ "label": "Bottom",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 136,
+ "element_token": "s0000001f:136",
+ "enabled": true,
+ "label": "Top Left",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 137,
+ "element_token": "s0000001f:137",
+ "enabled": true,
+ "label": "Top Right",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 138,
+ "element_token": "s0000001f:138",
+ "enabled": true,
+ "label": "Bottom Left",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 139,
+ "element_token": "s0000001f:139",
+ "enabled": true,
+ "label": "Bottom Right",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 140,
+ "element_token": "s0000001f:140",
+ "enabled": true,
+ "label": "Left & Right",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 141,
+ "element_token": "s0000001f:141",
+ "enabled": true,
+ "label": "Left & Quarters",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 142,
+ "element_token": "s0000001f:142",
+ "enabled": true,
+ "label": "Right & Left",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 143,
+ "element_token": "s0000001f:143",
+ "enabled": true,
+ "label": "Right & Quarters",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 144,
+ "element_token": "s0000001f:144",
+ "enabled": true,
+ "label": "Top & Bottom",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 145,
+ "element_token": "s0000001f:145",
+ "enabled": true,
+ "label": "Top & Quarters",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 146,
+ "element_token": "s0000001f:146",
+ "enabled": true,
+ "label": "Bottom & Top",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 147,
+ "element_token": "s0000001f:147",
+ "enabled": true,
+ "label": "Bottom & Quarters",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 148,
+ "element_token": "s0000001f:148",
+ "enabled": true,
+ "label": "Quarters",
+ "parent_index": 131,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 149,
+ "element_token": "s0000001f:149",
+ "enabled": true,
+ "label": "Arrange",
+ "parent_index": 128,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel"
+ ],
+ "depth": 4,
+ "element_index": 150,
+ "element_token": "s0000001f:150",
+ "enabled": true,
+ "parent_index": 149,
+ "role": "AXMenu",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 5,
+ "element_index": 151,
+ "element_token": "s0000001f:151",
+ "enabled": true,
+ "label": "Left",
+ "parent_index": 150,
+ "role": "AXMenuItem",
+ "selected": false
+ },
+ {
+ "actions": [
+ "AXCancel",
+ "AXPress",
+ "AXPick"
+ ],
+ "depth": 3,
+ "element_index": 152,
+ "element_token": "s0000001f:152",
+ "enabled": true,
+ "label": "CuaTestHarness AppKit",
+ "parent_index": 128,
+ "role": "AXMenuItem",
+ "selected": false
+ }
+ ],
+ "elements_complete": false,
+ "nodes_pending": 0,
+ "nodes_visited": 221,
+ "pid": 7989,
+ "returned_element_count": 127,
+ "screenshot_frame_valid": true,
+ "screenshot_height": 892,
+ "screenshot_mime_type": "image/png",
+ "screenshot_scale": 1.0,
+ "screenshot_width": 1300,
+ "snapshot_id": "s0000001f",
+ "timeout_ms": 1000,
+ "total_element_count": 153,
+ "truncated": false,
+ "walk_elapsed_ms": 164,
+ "window_bounds": {
+ "height": 892.0,
+ "width": 1300.0,
+ "x": 310.0,
+ "y": 50.0
+ },
+ "window_id": 158,
+ "window_title": "CuaTestHarness AppKit"
+}
diff --git a/libs/cua-driver/examples/jev-use/fixtures/native/gtk3-window-state-density-12-v1.json b/libs/cua-driver/examples/jev-use/fixtures/native/gtk3-window-state-density-12-v1.json
new file mode 100644
index 0000000000..3c7f7dd724
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/fixtures/native/gtk3-window-state-density-12-v1.json
@@ -0,0 +1,597 @@
+{
+ "_fixture": {
+ "source": "CuaTestHarness GTK3 task mode with CUA_GTK3_TASK_DENSITY=12 (initial), observed by cua-driver 0.30.4 get_window_state on X11 with AT-SPI",
+ "sanitized": "Recorded by verify_native.py --capture-dir. Screenshot bytes, tree_markdown, local file paths, and Driver guidance notes removed."
+ },
+ "app_name": "Main.py",
+ "bounds_complete": true,
+ "capture_id": "capture_19dda7f11675406d96704faa372301bf_0000000000000000",
+ "coordinate_frame": "window",
+ "element_count": 24,
+ "elements": [
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 0,
+ "element_token": "s00000001:0",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 133,
+ "x": 671,
+ "y": 415
+ },
+ "label": "Increase font size",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 133,
+ "x": 16,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 1,
+ "element_token": "s00000001:1",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 84,
+ "x": 1164,
+ "y": 381
+ },
+ "label": "Save draft",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 84,
+ "x": 509,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 2,
+ "element_token": "s00000001:2",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 81,
+ "x": 1077,
+ "y": 381
+ },
+ "label": "Zoom out",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 81,
+ "x": 422,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 3,
+ "element_token": "s00000001:3",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 72,
+ "x": 999,
+ "y": 381
+ },
+ "label": "Zoom in",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 72,
+ "x": 344,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 4,
+ "element_token": "s00000001:4",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 51,
+ "x": 942,
+ "y": 381
+ },
+ "label": "Redo",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 51,
+ "x": 287,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 5,
+ "element_token": "s00000001:5",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 52,
+ "x": 884,
+ "y": 381
+ },
+ "label": "Undo",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 52,
+ "x": 229,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 6,
+ "element_token": "s00000001:6",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 68,
+ "x": 810,
+ "y": 381
+ },
+ "label": "Refresh",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 68,
+ "x": 155,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 7,
+ "element_token": "s00000001:7",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 89,
+ "x": 671,
+ "y": 381
+ },
+ "label": "New folder",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 89,
+ "x": 16,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "activate"
+ ],
+ "depth": 3,
+ "element_index": 8,
+ "element_token": "s00000001:8",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 154,
+ "x": 671,
+ "y": 451
+ },
+ "label": "Search",
+ "role": "text",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 154,
+ "x": 16,
+ "y": 86
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 9,
+ "element_token": "s00000001:9",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 97,
+ "x": 918,
+ "y": 489
+ },
+ "label": "Word wrap",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 97,
+ "x": 263,
+ "y": 124
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 10,
+ "element_token": "s00000001:10",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 126,
+ "x": 780,
+ "y": 489
+ },
+ "label": "Show previews",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 126,
+ "x": 125,
+ "y": 124
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 11,
+ "element_token": "s00000001:11",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 97,
+ "x": 671,
+ "y": 489
+ },
+ "label": "Show ruler",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 97,
+ "x": 16,
+ "y": 124
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 12,
+ "element_token": "s00000001:12",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 60,
+ "x": 671,
+ "y": 518
+ },
+ "label": "Light",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 60,
+ "x": 16,
+ "y": 153
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 13,
+ "element_token": "s00000001:13",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 59,
+ "x": 743,
+ "y": 518
+ },
+ "label": "Dark",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 59,
+ "x": 88,
+ "y": 153
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 14,
+ "element_token": "s00000001:14",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 77,
+ "x": 814,
+ "y": 518
+ },
+ "label": "System",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 77,
+ "x": 159,
+ "y": 153
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 15,
+ "element_token": "s00000001:15",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 84,
+ "x": 671,
+ "y": 589
+ },
+ "label": "Increment",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 84,
+ "x": 16,
+ "y": 224
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 16,
+ "element_token": "s00000001:16",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 55,
+ "x": 763,
+ "y": 589
+ },
+ "label": "Reset",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 55,
+ "x": 108,
+ "y": 224
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 2,
+ "element_index": 17,
+ "element_token": "s00000001:17",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 577,
+ "x": 671,
+ "y": 625
+ },
+ "label": "I agree",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 577,
+ "x": 16,
+ "y": 260
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 18,
+ "element_token": "s00000001:18",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 65,
+ "x": 671,
+ "y": 654
+ },
+ "label": "Small",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 65,
+ "x": 16,
+ "y": 289
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 19,
+ "element_token": "s00000001:19",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 81,
+ "x": 748,
+ "y": 654
+ },
+ "label": "Medium",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 81,
+ "x": 93,
+ "y": 289
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 20,
+ "element_token": "s00000001:20",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 64,
+ "x": 841,
+ "y": 654
+ },
+ "label": "Large",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 64,
+ "x": 186,
+ "y": 289
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "activate"
+ ],
+ "depth": 3,
+ "element_index": 21,
+ "element_token": "s00000001:21",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 234,
+ "x": 671,
+ "y": 683
+ },
+ "label": "Note",
+ "role": "text",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 234,
+ "x": 16,
+ "y": 318
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 22,
+ "element_token": "s00000001:22",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 83,
+ "x": 913,
+ "y": 683
+ },
+ "label": "Save note",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 83,
+ "x": 258,
+ "y": 318
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 2,
+ "element_index": 23,
+ "element_token": "s00000001:23",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 43,
+ "x": 671,
+ "y": 721
+ },
+ "label": "Exit",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 43,
+ "x": 16,
+ "y": 356
+ }
+ }
+ ],
+ "elements_complete": true,
+ "nodes_pending": 0,
+ "nodes_visited": 24,
+ "pid": 3482,
+ "returned_element_count": 24,
+ "screenshot_frame_valid": true,
+ "screenshot_height": 400,
+ "screenshot_mime_type": "image/png",
+ "screenshot_width": 609,
+ "snapshot_id": "s00000001",
+ "timeout_ms": 1000,
+ "total_element_count": 24,
+ "truncated": false,
+ "walk_elapsed_ms": 54,
+ "window_bounds": {
+ "height": 400,
+ "width": 609,
+ "x": 655,
+ "y": 365
+ },
+ "window_id": 50331651,
+ "window_title": "CuaTestHarness GTK3 Tasks"
+}
diff --git a/libs/cua-driver/examples/jev-use/fixtures/native/gtk3-window-state-density-24-v1.json b/libs/cua-driver/examples/jev-use/fixtures/native/gtk3-window-state-density-24-v1.json
new file mode 100644
index 0000000000..efc60ef668
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/fixtures/native/gtk3-window-state-density-24-v1.json
@@ -0,0 +1,1466 @@
+{
+ "_fixture": {
+ "source": "CuaTestHarness GTK3 task mode with CUA_GTK3_TASK_DENSITY=24 (initial), observed by cua-driver 0.30.4 get_window_state on X11 with AT-SPI",
+ "sanitized": "Recorded by verify_native.py --capture-dir. Screenshot bytes, tree_markdown, local file paths, and Driver guidance notes removed."
+ },
+ "app_name": "Main.py",
+ "bounds_complete": true,
+ "capture_id": "capture_962f6564bb34418a88cc82bedfb90147_0000000000000000",
+ "coordinate_frame": "window",
+ "element_count": 61,
+ "elements": [
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 0,
+ "element_token": "s00000001:0",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 48,
+ "x": 466,
+ "y": 174
+ },
+ "label": "Help",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 48,
+ "x": 461,
+ "y": 118
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 1,
+ "element_token": "s00000001:1",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 105,
+ "x": 355,
+ "y": 174
+ },
+ "label": "Show sidebar",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 105,
+ "x": 350,
+ "y": 118
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 2,
+ "element_token": "s00000001:2",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 91,
+ "x": 258,
+ "y": 174
+ },
+ "label": "Word count",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 91,
+ "x": 253,
+ "y": 118
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 3,
+ "element_token": "s00000001:3",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 92,
+ "x": 160,
+ "y": 174
+ },
+ "label": "Spell check",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 92,
+ "x": 155,
+ "y": 118
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 4,
+ "element_token": "s00000001:4",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 100,
+ "x": 21,
+ "y": 174
+ },
+ "label": "Insert image",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 100,
+ "x": 16,
+ "y": 118
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 5,
+ "element_token": "s00000001:5",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 92,
+ "x": 672,
+ "y": 140
+ },
+ "label": "Insert table",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 92,
+ "x": 667,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 6,
+ "element_token": "s00000001:6",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 85,
+ "x": 576,
+ "y": 140
+ },
+ "label": "Align right",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 85,
+ "x": 571,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 7,
+ "element_token": "s00000001:7",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 96,
+ "x": 466,
+ "y": 140
+ },
+ "label": "Align center",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 96,
+ "x": 461,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 8,
+ "element_token": "s00000001:8",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 76,
+ "x": 355,
+ "y": 140
+ },
+ "label": "Align left",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 76,
+ "x": 350,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 9,
+ "element_token": "s00000001:9",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 81,
+ "x": 258,
+ "y": 140
+ },
+ "label": "Underline",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 81,
+ "x": 253,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 10,
+ "element_token": "s00000001:10",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 50,
+ "x": 160,
+ "y": 140
+ },
+ "label": "Italic",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 50,
+ "x": 155,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 11,
+ "element_token": "s00000001:11",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 47,
+ "x": 21,
+ "y": 140
+ },
+ "label": "Bold",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 47,
+ "x": 16,
+ "y": 84
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 12,
+ "element_token": "s00000001:12",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 61,
+ "x": 672,
+ "y": 106
+ },
+ "label": "Import",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 61,
+ "x": 667,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 13,
+ "element_token": "s00000001:13",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 90,
+ "x": 576,
+ "y": 106
+ },
+ "label": "Export PDF",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 90,
+ "x": 571,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 14,
+ "element_token": "s00000001:14",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 104,
+ "x": 466,
+ "y": 106
+ },
+ "label": "Print preview",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 104,
+ "x": 461,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 15,
+ "element_token": "s00000001:15",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 72,
+ "x": 355,
+ "y": 106
+ },
+ "label": "Rename",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 72,
+ "x": 350,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 16,
+ "element_token": "s00000001:16",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 80,
+ "x": 258,
+ "y": 106
+ },
+ "label": "Duplicate",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 80,
+ "x": 253,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 17,
+ "element_token": "s00000001:17",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 79,
+ "x": 160,
+ "y": 106
+ },
+ "label": "Copy link",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 79,
+ "x": 155,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 18,
+ "element_token": "s00000001:18",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 133,
+ "x": 21,
+ "y": 106
+ },
+ "label": "Increase font size",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 133,
+ "x": 16,
+ "y": 50
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 19,
+ "element_token": "s00000001:19",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 84,
+ "x": 672,
+ "y": 72
+ },
+ "label": "Save draft",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 84,
+ "x": 667,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 20,
+ "element_token": "s00000001:20",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 81,
+ "x": 576,
+ "y": 72
+ },
+ "label": "Zoom out",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 81,
+ "x": 571,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 21,
+ "element_token": "s00000001:21",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 72,
+ "x": 466,
+ "y": 72
+ },
+ "label": "Zoom in",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 72,
+ "x": 461,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 22,
+ "element_token": "s00000001:22",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 51,
+ "x": 355,
+ "y": 72
+ },
+ "label": "Redo",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 51,
+ "x": 350,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 23,
+ "element_token": "s00000001:23",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 52,
+ "x": 258,
+ "y": 72
+ },
+ "label": "Undo",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 52,
+ "x": 253,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 24,
+ "element_token": "s00000001:24",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 68,
+ "x": 160,
+ "y": 72
+ },
+ "label": "Refresh",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 68,
+ "x": 155,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 25,
+ "element_token": "s00000001:25",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 89,
+ "x": 21,
+ "y": 72
+ },
+ "label": "New folder",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 89,
+ "x": 16,
+ "y": 16
+ }
+ },
+ {
+ "actions": [
+ "activate"
+ ],
+ "depth": 3,
+ "element_index": 26,
+ "element_token": "s00000001:26",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 154,
+ "x": 21,
+ "y": 210
+ },
+ "label": "Search",
+ "role": "text",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 154,
+ "x": 16,
+ "y": 154
+ }
+ },
+ {
+ "actions": [
+ "activate"
+ ],
+ "depth": 3,
+ "element_index": 27,
+ "element_token": "s00000001:27",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 154,
+ "x": 183,
+ "y": 210
+ },
+ "label": "Note title",
+ "role": "text",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 154,
+ "x": 178,
+ "y": 154
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 28,
+ "element_token": "s00000001:28",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 203,
+ "x": 504,
+ "y": 298
+ },
+ "label": "Check spelling as you type",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 203,
+ "x": 499,
+ "y": 242
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 29,
+ "element_token": "s00000001:29",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 184,
+ "x": 308,
+ "y": 298
+ },
+ "label": "Remember window size",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 184,
+ "x": 303,
+ "y": 242
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 30,
+ "element_token": "s00000001:30",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 132,
+ "x": 164,
+ "y": 298
+ },
+ "label": "Show status bar",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 132,
+ "x": 159,
+ "y": 242
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 31,
+ "element_token": "s00000001:31",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 131,
+ "x": 21,
+ "y": 298
+ },
+ "label": "Compact layout",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 131,
+ "x": 16,
+ "y": 242
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 32,
+ "element_token": "s00000001:32",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 203,
+ "x": 504,
+ "y": 273
+ },
+ "label": "Sync on startup",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 203,
+ "x": 499,
+ "y": 217
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 33,
+ "element_token": "s00000001:33",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 184,
+ "x": 308,
+ "y": 273
+ },
+ "label": "Show hidden files",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 184,
+ "x": 303,
+ "y": 217
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 34,
+ "element_token": "s00000001:34",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 132,
+ "x": 164,
+ "y": 273
+ },
+ "label": "Dark mode",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 132,
+ "x": 159,
+ "y": 217
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 35,
+ "element_token": "s00000001:35",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 131,
+ "x": 21,
+ "y": 273
+ },
+ "label": "Line numbers",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 131,
+ "x": 16,
+ "y": 217
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 36,
+ "element_token": "s00000001:36",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 203,
+ "x": 504,
+ "y": 248
+ },
+ "label": "Auto-save",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 203,
+ "x": 499,
+ "y": 192
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 37,
+ "element_token": "s00000001:37",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 184,
+ "x": 308,
+ "y": 248
+ },
+ "label": "Word wrap",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 184,
+ "x": 303,
+ "y": 192
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 38,
+ "element_token": "s00000001:38",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 132,
+ "x": 164,
+ "y": 248
+ },
+ "label": "Show previews",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 132,
+ "x": 159,
+ "y": 192
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 39,
+ "element_token": "s00000001:39",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 131,
+ "x": 21,
+ "y": 248
+ },
+ "label": "Show ruler",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 131,
+ "x": 16,
+ "y": 192
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 40,
+ "element_token": "s00000001:40",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 60,
+ "x": 21,
+ "y": 327
+ },
+ "label": "Light",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 60,
+ "x": 16,
+ "y": 271
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 41,
+ "element_token": "s00000001:41",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 59,
+ "x": 93,
+ "y": 327
+ },
+ "label": "Dark",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 59,
+ "x": 88,
+ "y": 271
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 42,
+ "element_token": "s00000001:42",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 77,
+ "x": 164,
+ "y": 327
+ },
+ "label": "System",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 77,
+ "x": 159,
+ "y": 271
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 43,
+ "element_token": "s00000001:43",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 51,
+ "x": 21,
+ "y": 356
+ },
+ "label": "List",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 51,
+ "x": 16,
+ "y": 300
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 44,
+ "element_token": "s00000001:44",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 55,
+ "x": 84,
+ "y": 356
+ },
+ "label": "Grid",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 55,
+ "x": 79,
+ "y": 300
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 45,
+ "element_token": "s00000001:45",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 85,
+ "x": 151,
+ "y": 356
+ },
+ "label": "Columns",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 85,
+ "x": 146,
+ "y": 300
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 46,
+ "element_token": "s00000001:46",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 67,
+ "x": 21,
+ "y": 385
+ },
+ "label": "Name",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 67,
+ "x": 16,
+ "y": 329
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 47,
+ "element_token": "s00000001:47",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 59,
+ "x": 100,
+ "y": 385
+ },
+ "label": "Date",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 59,
+ "x": 95,
+ "y": 329
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 48,
+ "element_token": "s00000001:48",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 57,
+ "x": 171,
+ "y": 385
+ },
+ "label": "Kind",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 57,
+ "x": 166,
+ "y": 329
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 49,
+ "element_token": "s00000001:49",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 103,
+ "x": 21,
+ "y": 414
+ },
+ "label": "Small icons",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 103,
+ "x": 16,
+ "y": 358
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 50,
+ "element_token": "s00000001:50",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 119,
+ "x": 136,
+ "y": 414
+ },
+ "label": "Medium icons",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 119,
+ "x": 131,
+ "y": 358
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 51,
+ "element_token": "s00000001:51",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 102,
+ "x": 267,
+ "y": 414
+ },
+ "label": "Large icons",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 102,
+ "x": 262,
+ "y": 358
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 52,
+ "element_token": "s00000001:52",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 84,
+ "x": 21,
+ "y": 485
+ },
+ "label": "Increment",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 84,
+ "x": 16,
+ "y": 429
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 53,
+ "element_token": "s00000001:53",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 55,
+ "x": 113,
+ "y": 485
+ },
+ "label": "Reset",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 55,
+ "x": 108,
+ "y": 429
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 2,
+ "element_index": 54,
+ "element_token": "s00000001:54",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 743,
+ "x": 21,
+ "y": 521
+ },
+ "label": "I agree",
+ "role": "check box",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 743,
+ "x": 16,
+ "y": 465
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 55,
+ "element_token": "s00000001:55",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 65,
+ "x": 21,
+ "y": 550
+ },
+ "label": "Small",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 65,
+ "x": 16,
+ "y": 494
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 56,
+ "element_token": "s00000001:56",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 81,
+ "x": 98,
+ "y": 550
+ },
+ "label": "Medium",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 81,
+ "x": 93,
+ "y": 494
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 57,
+ "element_token": "s00000001:57",
+ "enabled": true,
+ "frame": {
+ "h": 21,
+ "w": 64,
+ "x": 191,
+ "y": 550
+ },
+ "label": "Large",
+ "role": "radio button",
+ "screenshot_frame": {
+ "h": 21,
+ "w": 64,
+ "x": 186,
+ "y": 494
+ },
+ "selected": false
+ },
+ {
+ "actions": [
+ "activate"
+ ],
+ "depth": 3,
+ "element_index": 58,
+ "element_token": "s00000001:58",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 234,
+ "x": 21,
+ "y": 579
+ },
+ "label": "Note",
+ "role": "text",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 234,
+ "x": 16,
+ "y": 523
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 3,
+ "element_index": 59,
+ "element_token": "s00000001:59",
+ "enabled": true,
+ "frame": {
+ "h": 30,
+ "w": 83,
+ "x": 263,
+ "y": 579
+ },
+ "label": "Save note",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 30,
+ "w": 83,
+ "x": 258,
+ "y": 523
+ }
+ },
+ {
+ "actions": [
+ "click"
+ ],
+ "depth": 2,
+ "element_index": 60,
+ "element_token": "s00000001:60",
+ "enabled": true,
+ "frame": {
+ "h": 28,
+ "w": 43,
+ "x": 21,
+ "y": 617
+ },
+ "label": "Exit",
+ "role": "push button",
+ "screenshot_frame": {
+ "h": 28,
+ "w": 43,
+ "x": 16,
+ "y": 561
+ }
+ }
+ ],
+ "elements_complete": true,
+ "nodes_pending": 0,
+ "nodes_visited": 61,
+ "pid": 3702,
+ "returned_element_count": 61,
+ "screenshot_frame_valid": true,
+ "screenshot_height": 605,
+ "screenshot_mime_type": "image/png",
+ "screenshot_width": 775,
+ "snapshot_id": "s00000001",
+ "timeout_ms": 1000,
+ "total_element_count": 61,
+ "truncated": false,
+ "walk_elapsed_ms": 165,
+ "window_bounds": {
+ "height": 605,
+ "width": 775,
+ "x": 5,
+ "y": 56
+ },
+ "window_id": 50331651,
+ "window_title": "CuaTestHarness GTK3 Tasks"
+}
diff --git a/libs/cua-driver/examples/jev-use/fixtures/native/native-density-candidates-v1.json b/libs/cua-driver/examples/jev-use/fixtures/native/native-density-candidates-v1.json
new file mode 100644
index 0000000000..f53380bbe6
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/fixtures/native/native-density-candidates-v1.json
@@ -0,0 +1,600 @@
+{
+ "_fixture": {
+ "source": "python/native_tasks.py plan() over the AppKit and GTK3 density fixtures (#4312)",
+ "note": "Candidate IDs, in presented order, for each harness, task, density, and cap order. Python and TypeScript must both reproduce them."
+ },
+ "sets": {
+ "gtk3-counter-d12-relevance": {
+ "ids": [
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:undo",
+ "ax:button:refresh",
+ "ax:button:new-folder",
+ "ax:button:increment",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "gtk3-counter-d12-depth_first": {
+ "ids": [
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:undo",
+ "ax:button:refresh",
+ "ax:button:new-folder",
+ "ax:button:increment",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "gtk3-save-note-d12-relevance": {
+ "ids": [
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:undo",
+ "ax:button:refresh",
+ "ax:button:new-folder",
+ "ax:text_input:search:set:note",
+ "ax:button:increment",
+ "ax:text_input:note:set:note",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "gtk3-save-note-d12-depth_first": {
+ "ids": [
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:undo",
+ "ax:button:refresh",
+ "ax:button:new-folder",
+ "ax:text_input:search:set:note",
+ "ax:button:increment",
+ "ax:text_input:note:set:note",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "gtk3-choose-size-d12-relevance": {
+ "ids": [
+ "ax:checkbox:word-wrap",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:show-ruler",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:checkbox:i-agree",
+ "ax:radio:small",
+ "ax:radio:medium",
+ "ax:radio:large",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "gtk3-choose-size-d12-depth_first": {
+ "ids": [
+ "ax:checkbox:word-wrap",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:show-ruler",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:checkbox:i-agree",
+ "ax:radio:small",
+ "ax:radio:medium",
+ "ax:radio:large",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "gtk3-counter-d24-relevance": {
+ "ids": [
+ "ax:button:help",
+ "ax:button:show-sidebar",
+ "ax:button:word-count",
+ "ax:button:spell-check",
+ "ax:button:insert-image",
+ "ax:button:insert-table",
+ "ax:button:align-right",
+ "ax:button:align-center",
+ "ax:button:align-left",
+ "ax:button:underline",
+ "ax:button:italic",
+ "ax:button:bold",
+ "ax:button:import",
+ "ax:button:export-pdf",
+ "ax:button:print-preview",
+ "ax:button:rename",
+ "ax:button:duplicate",
+ "ax:button:copy-link",
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:increment",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 4
+ },
+ "gtk3-counter-d24-depth_first": {
+ "ids": [
+ "ax:button:help",
+ "ax:button:show-sidebar",
+ "ax:button:word-count",
+ "ax:button:spell-check",
+ "ax:button:insert-image",
+ "ax:button:insert-table",
+ "ax:button:align-right",
+ "ax:button:align-center",
+ "ax:button:align-left",
+ "ax:button:underline",
+ "ax:button:italic",
+ "ax:button:bold",
+ "ax:button:import",
+ "ax:button:export-pdf",
+ "ax:button:print-preview",
+ "ax:button:rename",
+ "ax:button:duplicate",
+ "ax:button:copy-link",
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:undo",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 4
+ },
+ "gtk3-save-note-d24-relevance": {
+ "ids": [
+ "ax:button:help",
+ "ax:button:show-sidebar",
+ "ax:button:word-count",
+ "ax:button:spell-check",
+ "ax:button:insert-image",
+ "ax:button:insert-table",
+ "ax:button:align-right",
+ "ax:button:align-center",
+ "ax:button:align-left",
+ "ax:button:underline",
+ "ax:button:italic",
+ "ax:button:bold",
+ "ax:button:import",
+ "ax:button:export-pdf",
+ "ax:button:print-preview",
+ "ax:button:rename",
+ "ax:button:duplicate",
+ "ax:button:copy-link",
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:text_input:note-title:set:note",
+ "ax:text_input:note:set:note",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 7
+ },
+ "gtk3-save-note-d24-depth_first": {
+ "ids": [
+ "ax:button:help",
+ "ax:button:show-sidebar",
+ "ax:button:word-count",
+ "ax:button:spell-check",
+ "ax:button:insert-image",
+ "ax:button:insert-table",
+ "ax:button:align-right",
+ "ax:button:align-center",
+ "ax:button:align-left",
+ "ax:button:underline",
+ "ax:button:italic",
+ "ax:button:bold",
+ "ax:button:import",
+ "ax:button:export-pdf",
+ "ax:button:print-preview",
+ "ax:button:rename",
+ "ax:button:duplicate",
+ "ax:button:copy-link",
+ "ax:button:increase-font-size",
+ "ax:button:save-draft",
+ "ax:button:zoom-out",
+ "ax:button:zoom-in",
+ "ax:button:redo",
+ "ax:button:undo",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 7
+ },
+ "gtk3-choose-size-d24-relevance": {
+ "ids": [
+ "ax:checkbox:check-spelling-as-you-type",
+ "ax:checkbox:remember-window-size",
+ "ax:checkbox:show-status-bar",
+ "ax:checkbox:compact-layout",
+ "ax:checkbox:sync-on-startup",
+ "ax:checkbox:show-hidden-files",
+ "ax:checkbox:dark-mode",
+ "ax:checkbox:line-numbers",
+ "ax:checkbox:auto-save",
+ "ax:checkbox:word-wrap",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:show-ruler",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:radio:list",
+ "ax:radio:grid",
+ "ax:radio:columns",
+ "ax:radio:name",
+ "ax:radio:date",
+ "ax:radio:kind",
+ "ax:radio:large-icons",
+ "ax:checkbox:i-agree",
+ "ax:radio:large",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 4
+ },
+ "gtk3-choose-size-d24-depth_first": {
+ "ids": [
+ "ax:checkbox:check-spelling-as-you-type",
+ "ax:checkbox:remember-window-size",
+ "ax:checkbox:show-status-bar",
+ "ax:checkbox:compact-layout",
+ "ax:checkbox:sync-on-startup",
+ "ax:checkbox:show-hidden-files",
+ "ax:checkbox:dark-mode",
+ "ax:checkbox:line-numbers",
+ "ax:checkbox:auto-save",
+ "ax:checkbox:word-wrap",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:show-ruler",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:radio:list",
+ "ax:radio:grid",
+ "ax:radio:columns",
+ "ax:radio:name",
+ "ax:radio:date",
+ "ax:radio:kind",
+ "ax:radio:small-icons",
+ "ax:radio:medium-icons",
+ "ax:radio:large-icons",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 4
+ },
+ "appkit-counter-d12-relevance": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:button:increment",
+ "ax:button:click-target-left-right-double",
+ "ax:button:right-click-for-context-menu",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "appkit-counter-d12-depth_first": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:button:increment",
+ "ax:button:click-target-left-right-double",
+ "ax:button:right-click-for-context-menu",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "appkit-save-note-d12-relevance": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:text_input:search:set:note",
+ "ax:button:increment",
+ "ax:button:click-target-left-right-double",
+ "ax:button:right-click-for-context-menu",
+ "ax:text_input:note:set:note",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "appkit-save-note-d12-depth_first": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:text_input:search:set:note",
+ "ax:button:increment",
+ "ax:button:click-target-left-right-double",
+ "ax:button:right-click-for-context-menu",
+ "ax:text_input:note:set:note",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "appkit-choose-size-d12-relevance": {
+ "ids": [
+ "ax:checkbox:show-ruler",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:word-wrap",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:checkbox:i-agree",
+ "ax:radio:small",
+ "ax:radio:medium",
+ "ax:radio:large",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "appkit-choose-size-d12-depth_first": {
+ "ids": [
+ "ax:checkbox:show-ruler",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:word-wrap",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:checkbox:i-agree",
+ "ax:radio:small",
+ "ax:radio:medium",
+ "ax:radio:large",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 0
+ },
+ "appkit-counter-d24-relevance": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:button:copy-link",
+ "ax:button:duplicate",
+ "ax:button:rename",
+ "ax:button:print-preview",
+ "ax:button:export-pdf",
+ "ax:button:import",
+ "ax:button:bold",
+ "ax:button:italic",
+ "ax:button:underline",
+ "ax:button:align-left",
+ "ax:button:align-center",
+ "ax:button:align-right",
+ "ax:button:insert-table",
+ "ax:button:insert-image",
+ "ax:button:spell-check",
+ "ax:button:increment",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 6
+ },
+ "appkit-counter-d24-depth_first": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:button:copy-link",
+ "ax:button:duplicate",
+ "ax:button:rename",
+ "ax:button:print-preview",
+ "ax:button:export-pdf",
+ "ax:button:import",
+ "ax:button:bold",
+ "ax:button:italic",
+ "ax:button:underline",
+ "ax:button:align-left",
+ "ax:button:align-center",
+ "ax:button:align-right",
+ "ax:button:insert-table",
+ "ax:button:insert-image",
+ "ax:button:spell-check",
+ "ax:button:word-count",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 6
+ },
+ "appkit-save-note-d24-relevance": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:button:copy-link",
+ "ax:button:duplicate",
+ "ax:button:rename",
+ "ax:button:print-preview",
+ "ax:button:export-pdf",
+ "ax:button:import",
+ "ax:button:bold",
+ "ax:button:italic",
+ "ax:button:underline",
+ "ax:button:align-left",
+ "ax:button:align-center",
+ "ax:button:align-right",
+ "ax:button:insert-table",
+ "ax:text_input:note-title:set:note",
+ "ax:text_input:note:set:note",
+ "ax:button:save-note",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 9
+ },
+ "appkit-save-note-d24-depth_first": {
+ "ids": [
+ "ax:button:new-folder",
+ "ax:button:refresh",
+ "ax:button:undo",
+ "ax:button:redo",
+ "ax:button:zoom-in",
+ "ax:button:zoom-out",
+ "ax:button:save-draft",
+ "ax:button:increase-font-size",
+ "ax:button:copy-link",
+ "ax:button:duplicate",
+ "ax:button:rename",
+ "ax:button:print-preview",
+ "ax:button:export-pdf",
+ "ax:button:import",
+ "ax:button:bold",
+ "ax:button:italic",
+ "ax:button:underline",
+ "ax:button:align-left",
+ "ax:button:align-center",
+ "ax:button:align-right",
+ "ax:button:insert-table",
+ "ax:button:insert-image",
+ "ax:button:spell-check",
+ "ax:button:word-count",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 9
+ },
+ "appkit-choose-size-d24-relevance": {
+ "ids": [
+ "ax:checkbox:show-ruler",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:word-wrap",
+ "ax:checkbox:auto-save",
+ "ax:checkbox:line-numbers",
+ "ax:checkbox:dark-mode",
+ "ax:checkbox:show-hidden-files",
+ "ax:checkbox:sync-on-startup",
+ "ax:checkbox:compact-layout",
+ "ax:checkbox:show-status-bar",
+ "ax:checkbox:remember-window-size",
+ "ax:checkbox:check-spelling-as-you-type",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:radio:list",
+ "ax:radio:grid",
+ "ax:radio:columns",
+ "ax:radio:name",
+ "ax:radio:date",
+ "ax:radio:kind",
+ "ax:radio:large-icons",
+ "ax:checkbox:i-agree",
+ "ax:radio:large",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 4
+ },
+ "appkit-choose-size-d24-depth_first": {
+ "ids": [
+ "ax:checkbox:show-ruler",
+ "ax:checkbox:show-previews",
+ "ax:checkbox:word-wrap",
+ "ax:checkbox:auto-save",
+ "ax:checkbox:line-numbers",
+ "ax:checkbox:dark-mode",
+ "ax:checkbox:show-hidden-files",
+ "ax:checkbox:sync-on-startup",
+ "ax:checkbox:compact-layout",
+ "ax:checkbox:show-status-bar",
+ "ax:checkbox:remember-window-size",
+ "ax:checkbox:check-spelling-as-you-type",
+ "ax:radio:light",
+ "ax:radio:dark",
+ "ax:radio:system",
+ "ax:radio:list",
+ "ax:radio:grid",
+ "ax:radio:columns",
+ "ax:radio:name",
+ "ax:radio:date",
+ "ax:radio:kind",
+ "ax:radio:small-icons",
+ "ax:radio:medium-icons",
+ "ax:radio:large-icons",
+ "reobserve",
+ "abstain"
+ ],
+ "dropped": 4
+ }
+ }
+}
diff --git a/libs/cua-driver/examples/jev-use/measure_native.py b/libs/cua-driver/examples/jev-use/measure_native.py
new file mode 100644
index 0000000000..db5df80a3a
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/measure_native.py
@@ -0,0 +1,429 @@
+"""Measure native jev-use decision accuracy by candidate-set size (#4312).
+
+Two subcommands produce the same per-decision records and the same table:
+
+``replay`` runs the native task specs offline over captured, sanitized
+``get_window_state`` fixtures. For each task it walks the task's declared
+steps: at every decision point it builds the real candidate set and
+``cua.jev_choice_request_v2`` from the fixture, asks the provider, records the
+decision, then applies the *correct* action's effect to the fixture (select a
+radio, toggle a checkbox, fill a field) and continues, so every decision point
+is scored even after a wrong choice. ``--cap-order`` compares strict
+depth-first capping with relevance capping, and ``--order shuffled`` also
+presents each set's executable candidates in a seeded random order, to see
+whether position matters. Each repetition uses a distinct capture ID.
+
+``logs`` reads the JSONL logs that the native runners write under
+``verify_native.py`` (one ``start`` event, then ``step`` and ``outcome``
+events carrying ``candidate_count``, ``expected_ids``, the chosen candidate,
+confidence, and ``decide_ms``).
+
+A decision is ``correct`` when the chosen candidate performs a declared step
+that is due (its ``:foreground`` variant counts), ``wrong_action`` when it is
+another executable candidate, or ``reobserve``, ``abstain``, or ``error``.
+``target_missing`` counts decisions whose set did not offer any due step, for
+example because the cap dropped it. Sizes are the full set sent to the
+provider, including ``reobserve`` and ``abstain``, bucketed as ``~4`` (up to
+8), ``~12`` (9 to 18), and ``~24`` (19 and more; the cap is 24 + 2).
+
+Examples::
+
+ python measure_native.py replay --fixture gtk3:24:fixtures/native/gtk3-window-state-density-24-v1.json \\
+ --provider s1 --reps 5 --cap-order depth_first --cap-order relevance --out /tmp/replay
+ python measure_native.py logs --platform linux /tmp/evidence/runs --out /tmp/live
+"""
+
+from __future__ import annotations
+
+import argparse
+import copy
+import hashlib
+import json
+import random
+import statistics
+import sys
+import time
+from dataclasses import replace
+from pathlib import Path
+from typing import Any, Callable, Iterable, Mapping
+
+BASE = Path(__file__).resolve().parent
+sys.path.insert(0, str(BASE / "python"))
+
+from choose_action import validate_request # noqa: E402
+from native import NativeObservation # noqa: E402
+from native_tasks import HARNESSES, TASK_KINDS, NativeStep, NativeTask, native_choice_request, native_task # noqa: E402
+from sources import NativeAccessibilitySource # noqa: E402
+from tasks import TaskSources # noqa: E402
+
+RESULTS = ("correct", "wrong_action", "reobserve", "abstain", "error")
+BUCKETS = ("~4", "~12", "~24")
+NOTE_TEXT = "jev-use native note"
+
+Provider = Callable[[dict, NativeTask, TaskSources, NativeStep, list], tuple]
+
+
+def bucket(candidate_count: int) -> str:
+ if candidate_count <= 8:
+ return "~4"
+ if candidate_count <= 18:
+ return "~12"
+ return "~24"
+
+
+def classify(selected: str | None, expected: Iterable[str], error: bool = False) -> str:
+ if error:
+ return "error"
+ if selected is None or selected == "abstain":
+ return "abstain"
+ if selected == "reobserve":
+ return "reobserve"
+ return "correct" if selected.removesuffix(":foreground") in set(expected) else "wrong_action"
+
+
+# -- providers ---------------------------------------------------------------
+
+
+def mock_provider(request, task, sources, plan, history):
+ from jev_adapter import choose_mock_for_task
+
+ return choose_mock_for_task(task, sources, plan.candidates, history)
+
+
+def s1_provider(request, task, sources, plan, history):
+ from s1_service import choose_s1_service
+
+ return choose_s1_service(request)
+
+
+def live_provider(request, task, sources, plan, history):
+ from decision_models import DecisionRequest, TypeSafeDecisionModel, choose
+ from typesafe_sdk import TypeSafeClient
+
+ with TypeSafeClient() as client:
+ result = choose(TypeSafeDecisionModel(client), DecisionRequest.from_validated(validate_request(request)))
+ if result.kind == "error":
+ raise RuntimeError(f"provider decision failed: {result.reason}")
+ return result.selected_id, result.confidence, dict(result.probabilities)
+
+
+PROVIDERS: Mapping[str, Provider] = {"mock": mock_provider, "s1": s1_provider, "live": live_provider}
+
+
+# -- replay ------------------------------------------------------------------
+
+
+def _capture_id(*parts: Any) -> str:
+ digest = hashlib.sha256(json.dumps(parts, sort_keys=True).encode()).hexdigest()
+ return f"capture_replay_{digest[:32]}"
+
+
+def apply_effect(elements: list[dict[str, Any]], sources: TaskSources, candidate_id: str, task: NativeTask) -> None:
+ """Apply one correct action's effect to the fixture's elements in place."""
+ assert sources.ax is not None
+ base = candidate_id.removesuffix(":foreground")
+ control_id, _, parameter = base.partition(":set:")
+ control = next((item for item in sources.ax.controls if item.id == control_id), None)
+ if control is None:
+ raise ValueError(f"no control for {candidate_id}")
+ element = next(item for item in elements if item.get("element_index") == control.element_index)
+ if control.action == "set_text":
+ element["value"] = next(p.value for p in task.parameters if p.name == parameter)
+ elif control.action == "toggle":
+ element["selected"] = not bool(element.get("selected"))
+ elif control.action == "select":
+ element["selected"] = True
+ # A press changes no element the task set depends on (the counter label is
+ # not actionable), so nothing else changes.
+
+
+def shuffled(plan: NativeStep, seed: str) -> NativeStep:
+ executable = [candidate for candidate in plan.candidates if candidate.tool is not None]
+ reserved = [candidate for candidate in plan.candidates if candidate.tool is None]
+ random.Random(seed).shuffle(executable)
+ return replace(plan, candidates=executable + reserved)
+
+
+def replay_task(
+ task: NativeTask,
+ payload: Mapping[str, Any],
+ platform: str,
+ provider: Provider,
+ *,
+ rep: int,
+ order: str,
+ context: Mapping[str, Any],
+) -> list[dict[str, Any]]:
+ elements = copy.deepcopy(list(payload["elements"]))
+ history: list[dict[str, Any]] = []
+ records = []
+ for step in range(1, task.max_steps + 1):
+ expected = task.expected_next(history)
+ if not expected:
+ break
+ capture_id = _capture_id(dict(context), task.cap_order, order, rep, step)
+ window_state = {**payload, "elements": elements, "capture_id": capture_id}
+ observation = NativeObservation.from_window_state(
+ window_state, expected_pid=payload["pid"], expected_window_id=payload["window_id"]
+ )
+ ax = NativeAccessibilitySource.from_observation(
+ observation, platform, redact=task.redact_text, text_method=task.text_method # type: ignore[arg-type]
+ )
+ sources = TaskSources(ax=ax)
+ plan = task.plan(sources)
+ if order == "shuffled":
+ plan = shuffled(plan, capture_id)
+ request = native_choice_request(task, sources, plan, history)
+ validate_request(request)
+ offered = {candidate.id.removesuffix(":foreground") for candidate in plan.candidates}
+ started = time.perf_counter()
+ error = None
+ selected: str | None = None
+ confidence: float | None = None
+ try:
+ selected, confidence, _ = provider(request, task, sources, plan, history)
+ except Exception as exc: # a provider failure is a scored decision
+ error = f"{type(exc).__name__}: {str(exc)[:120]}"
+ decide_ms = round((time.perf_counter() - started) * 1000, 2)
+ executable = sum(1 for candidate in plan.candidates if candidate.tool is not None)
+ records.append({
+ **context,
+ "mode": "replay",
+ "task": task.id,
+ "cap_order": task.cap_order,
+ "order": order,
+ "rep": rep,
+ "step": step,
+ "candidate_count": len(plan.candidates),
+ "executable_count": executable,
+ "dropped": plan.stats.dropped,
+ "bucket": bucket(len(plan.candidates)),
+ "expected_ids": expected,
+ "expected_offered": bool(set(expected) & offered),
+ "selected": selected,
+ "result": classify(selected, expected, error is not None),
+ "confidence": confidence,
+ "decide_ms": decide_ms,
+ "request_sha256": hashlib.sha256(
+ json.dumps({**request, "capture_id": ""}, sort_keys=True).encode()
+ ).hexdigest()[:16],
+ **({"error": error} if error else {}),
+ })
+ # Teacher forcing: continue from the correct action, offered or not.
+ correct = next((item for item in expected if item in offered), expected[0])
+ apply_effect(elements, sources, correct, task)
+ history.append(task.history_entry(step, correct, outcome=plan.outcomes.get(correct, "completed")))
+ return records
+
+
+def parse_fixture(spec: str) -> tuple[str, int | None, Path]:
+ harness, density, path = spec.split(":", 2)
+ if harness not in HARNESSES:
+ raise argparse.ArgumentTypeError(f"unknown harness {harness}")
+ return harness, (None if density in ("", "0", "base") else int(density)), Path(path)
+
+
+def run_replay(args: argparse.Namespace) -> list[dict[str, Any]]:
+ provider = PROVIDERS[args.provider]
+ records: list[dict[str, Any]] = []
+ for spec in args.fixture:
+ harness, density, path = parse_fixture(spec)
+ payload = json.loads(path.read_text(encoding="utf-8"))
+ platform = HARNESSES[harness].platform
+ for kind in args.task or TASK_KINDS:
+ for cap_order in args.cap_order or ["relevance"]:
+ for order in args.order or ["element"]:
+ for rep in range(1, args.reps + 1):
+ task = replace(
+ native_task(f"{harness}-{kind}", Path("/nonexistent"), note_text=NOTE_TEXT),
+ cap_order=cap_order,
+ )
+ context = {"platform": platform, "harness": harness, "density": density,
+ "provider": args.provider, "language": "python", "fixture": path.name}
+ records.extend(
+ replay_task(task, payload, platform, provider, rep=rep, order=order, context=context)
+ )
+ print(json.dumps({k: records[-1][k] for k in ("harness", "density", "task", "cap_order",
+ "order", "rep")}), flush=True)
+ return records
+
+
+# -- runner logs -------------------------------------------------------------
+
+
+def decisions_from_log(path: Path, platform: str | None = None) -> list[dict[str, Any]]:
+ """Per-decision records from one native runner JSONL log."""
+ events = []
+ for line in path.read_text(encoding="utf-8").splitlines():
+ try:
+ events.append(json.loads(line))
+ except json.JSONDecodeError:
+ continue
+ start = next((event for event in events if event.get("event") == "start"), {})
+ density = None
+ stem = path.stem
+ if "-d" in stem and stem.rsplit("-d", 1)[1].isdigit():
+ density = int(stem.rsplit("-d", 1)[1])
+ context = {
+ "mode": "live",
+ "platform": platform or start.get("platform"),
+ "harness": str(start.get("task", "")).split("-", 1)[0],
+ "density": density,
+ "provider": start.get("provider"),
+ "language": start.get("language"),
+ "task": start.get("task"),
+ "run": stem,
+ "cap_order": "relevance",
+ "order": "element",
+ }
+ records = []
+ for event in events:
+ if "candidate_count" not in event or "expected_ids" not in event:
+ continue
+ kind = event.get("event")
+ if kind == "step":
+ selected = event.get("candidate")
+ elif kind == "outcome" and event.get("outcome") == "abstained":
+ selected = "abstain"
+ elif kind == "outcome" and event.get("phase") == "decide":
+ selected = None
+ else:
+ continue
+ error = kind == "outcome" and event.get("phase") == "decide"
+ expected = event["expected_ids"]
+ records.append({
+ **context,
+ "step": event.get("step"),
+ "candidate_count": event["candidate_count"],
+ "dropped": (event.get("compose") or {}).get("dropped"),
+ "bucket": bucket(event["candidate_count"]),
+ "expected_ids": expected,
+ "expected_offered": event.get("expected_offered"),
+ "selected": selected,
+ "result": classify(selected, expected, error),
+ "confidence": event.get("confidence"),
+ "decide_ms": event.get("decide_ms"),
+ })
+ return records
+
+
+def run_logs(args: argparse.Namespace) -> list[dict[str, Any]]:
+ records = []
+ for root in args.paths:
+ files = [root] if root.is_file() else sorted(root.rglob("*.jsonl"))
+ for path in files:
+ if path.name in {"results.jsonl", "decisions.jsonl"}:
+ continue
+ records.extend(decisions_from_log(path, args.platform))
+ return records
+
+
+# -- table -------------------------------------------------------------------
+
+
+def _median(values: list[float]) -> float | None:
+ return round(statistics.median(values), 2) if values else None
+
+
+def _p95(values: list[float]) -> float | None:
+ if not values:
+ return None
+ ordered = sorted(values)
+ return round(ordered[min(len(ordered) - 1, int(round(0.95 * (len(ordered) - 1))))], 2)
+
+
+def aggregate(records: list[dict[str, Any]], keys: tuple[str, ...]) -> list[dict[str, Any]]:
+ groups: dict[tuple, list[dict[str, Any]]] = {}
+ for record in records:
+ groups.setdefault(tuple(record.get(key) for key in keys), []).append(record)
+
+ def sort_key(item: tuple) -> tuple:
+ return tuple(
+ BUCKETS.index(value) if key == "bucket" and value in BUCKETS else (str(value) if value is not None else "")
+ for key, value in zip(keys, item)
+ )
+
+ rows = []
+ for group in sorted(groups, key=sort_key):
+ items = groups[group]
+ counts = {result: sum(1 for item in items if item["result"] == result) for result in RESULTS}
+ confidences = [item["confidence"] for item in items if isinstance(item.get("confidence"), (int, float))]
+ latencies = [item["decide_ms"] for item in items if isinstance(item.get("decide_ms"), (int, float))]
+ sizes = [item["candidate_count"] for item in items]
+ rows.append({
+ **dict(zip(keys, group)),
+ "decisions": len(items),
+ **counts,
+ "accuracy": round(counts["correct"] / len(items), 4) if items else None,
+ "target_missing": sum(1 for item in items if item.get("expected_offered") is False),
+ "size_min": min(sizes),
+ "size_max": max(sizes),
+ "confidence_median": _median(confidences),
+ "confidence_min": round(min(confidences), 2) if confidences else None,
+ "decide_ms_median": _median(latencies),
+ "decide_ms_p95": _p95(latencies),
+ })
+ return rows
+
+
+def markdown(rows: list[dict[str, Any]], keys: tuple[str, ...]) -> str:
+ header = [*keys, "size", "decisions", "correct", "accuracy", "wrong", "reobserve", "abstain", "error",
+ "target missing", "conf. median", "conf. min", "decide ms median", "decide ms p95"]
+ lines = ["| " + " | ".join(header) + " |", "|" + "---|" * len(header)]
+ for row in rows:
+ size = f"{row['size_min']}" if row["size_min"] == row["size_max"] else f"{row['size_min']}–{row['size_max']}"
+ accuracy = f"{row['accuracy'] * 100:.1f}%" if row["accuracy"] is not None else ""
+ cells = [*(str(row[key]) if row[key] is not None else "base" if key == "density" else "" for key in keys),
+ size, str(row["decisions"]), str(row["correct"]), accuracy, str(row["wrong_action"]),
+ str(row["reobserve"]), str(row["abstain"]), str(row["error"]), str(row["target_missing"]),
+ str(row["confidence_median"] if row["confidence_median"] is not None else ""),
+ str(row["confidence_min"] if row["confidence_min"] is not None else ""),
+ str(row["decide_ms_median"] if row["decide_ms_median"] is not None else ""),
+ str(row["decide_ms_p95"] if row["decide_ms_p95"] is not None else "")]
+ lines.append("| " + " | ".join(cells) + " |")
+ return "\n".join(lines) + "\n"
+
+
+def write_outputs(records: list[dict[str, Any]], out: Path, keys: tuple[str, ...]) -> str:
+ out.mkdir(parents=True, exist_ok=True)
+ with (out / "decisions.jsonl").open("w", encoding="utf-8") as stream:
+ for record in records:
+ stream.write(json.dumps(record, sort_keys=True) + "\n")
+ rows = aggregate(records, keys)
+ (out / "table.json").write_text(json.dumps(rows, indent=2) + "\n", encoding="utf-8")
+ table = markdown(rows, keys)
+ (out / "table.md").write_text(table, encoding="utf-8")
+ return table
+
+
+def main(argv: list[str] | None = None) -> None:
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
+ sub = parser.add_subparsers(dest="command", required=True)
+ replay_parser = sub.add_parser("replay", help="replay captured fixtures offline through a provider")
+ replay_parser.add_argument("--fixture", action="append", required=True,
+ help="HARNESS:DENSITY:PATH (DENSITY 0 or base for the ordinary task mode)")
+ replay_parser.add_argument("--provider", choices=sorted(PROVIDERS), default="mock")
+ replay_parser.add_argument("--task", action="append", choices=TASK_KINDS)
+ replay_parser.add_argument("--cap-order", action="append", choices=("depth_first", "relevance"))
+ replay_parser.add_argument("--order", action="append", choices=("element", "shuffled"))
+ replay_parser.add_argument("--reps", type=int, default=5)
+ replay_parser.add_argument("--out", type=Path, required=True)
+ logs_parser = sub.add_parser("logs", help="score native runner JSONL logs")
+ logs_parser.add_argument("paths", nargs="+", type=Path)
+ logs_parser.add_argument("--platform", choices=("macos", "windows", "linux"))
+ logs_parser.add_argument("--out", type=Path, required=True)
+ for each in (replay_parser, logs_parser):
+ each.add_argument("--group-by", default="platform,provider,bucket",
+ help="comma-separated record keys for the table rows")
+ args = parser.parse_args(argv)
+ if args.command == "replay" and args.provider == "s1":
+ from s1_service import s1_service_url
+
+ s1_service_url()
+ records = run_replay(args) if args.command == "replay" else run_logs(args)
+ keys = tuple(key.strip() for key in args.group_by.split(",") if key.strip())
+ print(write_outputs(records, args.out, keys), end="")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/libs/cua-driver/examples/jev-use/python/native_tasks.py b/libs/cua-driver/examples/jev-use/python/native_tasks.py
index 6cf3f1b2c4..48b835dda7 100644
--- a/libs/cua-driver/examples/jev-use/python/native_tasks.py
+++ b/libs/cua-driver/examples/jev-use/python/native_tasks.py
@@ -26,6 +26,7 @@ schema name.
from __future__ import annotations
import json
+import re
from dataclasses import dataclass, field, replace
from pathlib import Path
from typing import Any, Callable, Literal, Mapping
@@ -69,6 +70,20 @@ NATIVE_RESERVED = (
),
)
+# Words too common to make a control relevant to a goal (#4312).
+_RELEVANCE_STOPWORDS = frozenset(
+ {"the", "and", "then", "once", "per", "step", "stop", "into", "with", "for", "from",
+ "this", "that", "its", "each", "exactly", "starts", "set", "option", "field", "button"}
+)
+
+
+def _relevance_words(text: str) -> frozenset[str]:
+ return frozenset(
+ word for word in re.findall(r"[a-z0-9]+", text.lower())
+ if len(word) >= 3 and word not in _RELEVANCE_STOPWORDS
+ )
+
+
_VERBS = {
"press": "pressed",
"toggle": "toggled",
@@ -153,14 +168,22 @@ def compose(
allowed_risks: frozenset[str],
reserved: tuple[Candidate, ...] = NATIVE_RESERVED,
cap: int = MAX_EXECUTABLE_CANDIDATES,
+ relevance: Callable[[Candidate], int] | None = None,
) -> tuple[list[Candidate], ComposeStats]:
"""Merge source outputs in the order page, ax, visual.
Duplicate IDs are dropped deterministically (first source wins). A
candidate tagged with a risk category the task did not allow is removed.
- At most ``cap`` executable candidates remain, in source then element
- order; the count dropped is reported, never silently truncated. The
- reserved ``reobserve`` and ``abstain`` candidates are always appended.
+ At most ``cap`` executable candidates remain; the count dropped is
+ reported, never silently truncated. The reserved ``reobserve`` and
+ ``abstain`` candidates are always appended.
+
+ Without ``relevance``, the first ``cap`` candidates in source then element
+ (depth-first) order are kept. With ``relevance`` (lower is more relevant),
+ a set over the cap keeps the ``cap`` candidates with the lowest
+ ``(relevance, depth-first position)`` and still presents them in
+ depth-first order (#4312), so ranking decides only which candidates
+ survive, never where they appear. A set within the cap is unchanged.
"""
seen: set[str] = {candidate.id for candidate in reserved}
merged: list[Candidate] = []
@@ -178,7 +201,11 @@ def compose(
risk_excluded[category] = risk_excluded.get(category, 0) + 1
continue
merged.append(candidate)
- kept = merged[:cap]
+ if relevance is None or len(merged) <= cap:
+ kept = merged[:cap]
+ else:
+ ranked = sorted(range(len(merged)), key=lambda index: (relevance(merged[index]), index))
+ kept = [merged[index] for index in sorted(ranked[:cap])]
counts = {source: 0 for source in SOURCE_ORDER}
for candidate in kept:
if candidate.source in counts:
@@ -256,6 +283,10 @@ class NativeTask:
# step that is not done yet, so a model need not infer order or count
# from history. Empty means the request carries no progress.
steps: tuple[TaskStep, ...] = ()
+ # How a set over the cap is cut (#4312): "relevance" keeps the declared
+ # steps' candidates first; "depth_first" keeps the first ``cap`` in element
+ # order, as before. Both present the kept candidates in element order.
+ cap_order: Literal["relevance", "depth_first"] = "relevance"
# The oracle is polled after every action, so no candidate is special.
completion_candidate_ids: frozenset[str] = field(default=frozenset(), init=False)
@@ -266,6 +297,8 @@ class NativeTask:
for parameter in self.parameters:
if not PARAMETER_NAME_PATTERN.fullmatch(parameter.name):
raise ValueError("parameter names must match [a-z][a-z0-9_]{0,7}")
+ if self.cap_order not in ("relevance", "depth_first"):
+ raise ValueError("cap_order must be relevance or depth_first")
if self.max_steps < 1:
raise ValueError("max_steps must be positive")
if len(self.steps) > MAX_PROGRESS:
@@ -297,9 +330,10 @@ class NativeTask:
def _native_candidates(
self, ax: NativeAccessibilitySource, foreground_ids: frozenset[str]
- ) -> tuple[list[Candidate], dict[str, str]]:
+ ) -> tuple[list[Candidate], dict[str, str], dict[str, str]]:
candidates: list[Candidate] = []
outcomes: dict[str, str] = {}
+ labels: dict[str, str] = {}
for native in ax.controls:
if native.action not in self.allowed_actions:
continue
@@ -324,6 +358,7 @@ class NativeTask:
)
)
outcomes[candidate_id] = f"set {label} to parameter {parameter.name}"
+ labels[candidate_id] = native.label
continue
if native.action == "select" and native.selected:
continue # selecting an already selected option is a no-op
@@ -343,7 +378,8 @@ class NativeTask:
ax.click(control, candidate_id=candidate_id, description=description, delivery=delivery)
)
outcomes[candidate_id] = f"{_VERBS[native.action]} {label}"
- return candidates, outcomes
+ labels[candidate_id] = native.label
+ return candidates, outcomes, labels
@staticmethod
def _describe(native: NativeControl, label: str) -> str:
@@ -398,13 +434,37 @@ class NativeTask:
outcomes[candidate_id] = f"clicked the visual region {_quoted(target)}"
return candidates, outcomes
+ def relevance(self, labels: Mapping[str, str]) -> Callable[[Candidate], int]:
+ """Rank candidates for the cap only (#4312); lower is more relevant.
+
+ Tier 0 is a candidate that performs one of the task's declared steps or
+ clicks a declared visual target (a ``:foreground`` variant counts).
+ Tier 1 is a control whose label shares a word with the goal. Tier 2 is
+ everything else. The rank uses only task-authored text and control
+ labels, never values, and never changes the presented order.
+ """
+ declared = {task_step.candidate_id for task_step in self.steps} | {
+ f"visual:{slug(target)}" for target in self.visual_targets
+ }
+ goal_words = _relevance_words(self.goal)
+
+ def tier(candidate: Candidate) -> int:
+ if candidate.id.removesuffix(":foreground") in declared:
+ return 0
+ if _relevance_words(labels.get(candidate.id, "")) & goal_words:
+ return 1
+ return 2
+
+ return tier
+
def plan(self, sources: TaskSources) -> NativeStep:
"""Build the step's closed candidate set, stats, and compact elements."""
groups: dict[str, list[Candidate]] = {}
outcomes: dict[str, str] = {}
+ labels: dict[str, str] = {}
elements: list[dict[str, str]] = []
if sources.ax is not None:
- groups["ax"], native_outcomes = self._native_candidates(
+ groups["ax"], native_outcomes, labels = self._native_candidates(
sources.ax, sources.foreground_ids
)
outcomes.update(native_outcomes)
@@ -418,7 +478,11 @@ class NativeTask:
]
groups["visual"], visual_outcomes = self._visual_candidates(sources)
outcomes.update(visual_outcomes)
- candidates, stats = compose(groups, allowed_risks=self.allowed_risks)
+ candidates, stats = compose(
+ groups,
+ allowed_risks=self.allowed_risks,
+ relevance=self.relevance(labels) if self.cap_order == "relevance" else None,
+ )
for candidate in candidates:
if candidate.tool is not None and candidate.tool not in self.allowed_action_kinds:
raise ValueError(f"task {self.id} does not allow action kind {candidate.tool}")
@@ -504,6 +568,24 @@ class NativeTask:
return f" The task still requires this {remaining} more time(s)."
return ""
+ def expected_next(self, history: list[Mapping[str, Any]]) -> list[str]:
+ """The candidate IDs that correctly advance the task now, for measurement.
+
+ A declared step is due when this run has performed it fewer times than
+ required and, for a step that waits, every earlier step is done. Empty
+ when the task declares no steps or every step is done. Counted only
+ from the runner's own performed actions, like ``progress``.
+ """
+ counts = performed_counts(history)
+ due = []
+ for index, task_step in enumerate(self.steps):
+ if counts.get(task_step.candidate_id, 0) >= task_step.times:
+ continue
+ earlier = self.steps[:index] if task_step.after_previous else ()
+ if all(counts.get(step.candidate_id, 0) >= step.times for step in earlier):
+ due.append(task_step.candidate_id)
+ return due
+
def reset(self) -> None:
"""The harness starts fresh for every run; there is nothing to reset."""
diff --git a/libs/cua-driver/examples/jev-use/python/run_native.py b/libs/cua-driver/examples/jev-use/python/run_native.py
index 79efa56fcd..55c29737b6 100644
--- a/libs/cua-driver/examples/jev-use/python/run_native.py
+++ b/libs/cua-driver/examples/jev-use/python/run_native.py
@@ -293,11 +293,17 @@ async def run_task(args: argparse.Namespace, task: NativeTask) -> str:
# with a logged outcome instead of a traceback.
write_event(log_path, {"event": "outcome", "outcome": "unknown",
"phase": "decide", "step": step,
+ "candidate_count": len(plan.candidates),
+ "expected_ids": task.expected_next(history),
"error": "S1ServiceError", "reason": str(error)[:128]})
return "unknown"
else:
choice, confidence, probabilities = await asyncio.to_thread(choose_live, request)
decide_ms = round((time.perf_counter() - decide_started) * 1000, 2)
+ # Measurement (#4312): the declared steps due now, and whether the
+ # candidate set offered one. IDs only; no values.
+ expected_ids = task.expected_next(history)
+ offered = {candidate.id.removesuffix(":foreground") for candidate in plan.candidates}
base_event = {
"event": "step",
"step": step,
@@ -309,6 +315,8 @@ async def run_task(args: argparse.Namespace, task: NativeTask) -> str:
"confidence": confidence,
"probabilities": probabilities,
"decide_ms": decide_ms,
+ "expected_ids": expected_ids,
+ "expected_offered": bool(set(expected_ids) & offered),
}
if choice is None:
write_event(log_path, {**base_event, "event": "outcome", "outcome": "abstained"})
diff --git a/libs/cua-driver/examples/jev-use/python/tests/test_native_density.py b/libs/cua-driver/examples/jev-use/python/tests/test_native_density.py
new file mode 100644
index 0000000000..538c3b3bcf
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/python/tests/test_native_density.py
@@ -0,0 +1,320 @@
+"""Larger candidate sets, relevance capping, and accuracy measurement (#4312)."""
+
+from __future__ import annotations
+
+import ast
+import contextlib
+import io
+import json
+import re
+import sys
+import tempfile
+import unittest
+from dataclasses import replace
+from pathlib import Path
+
+HERE = Path(__file__).resolve().parent
+EXAMPLE = HERE.parents[1]
+sys.path.insert(0, str(HERE.parent))
+sys.path.insert(0, str(EXAMPLE))
+
+import measure_native # noqa: E402
+from native import NativeObservation, risk_categories # noqa: E402
+from native_tasks import ( # noqa: E402
+ HARNESSES,
+ MAX_EXECUTABLE_CANDIDATES,
+ TASK_KINDS,
+ compose,
+ native_task,
+)
+from sources import Candidate, NativeAccessibilitySource # noqa: E402
+from tasks import TaskSources # noqa: E402
+
+FIXTURES = EXAMPLE / "fixtures" / "native"
+APPS = EXAMPLE.parents[1] / "tests" / "fixtures" / "apps"
+DENSITY_HARNESSES = ("gtk3", "appkit")
+TARGETS = {
+ "counter": {"ax:button:increment"},
+ "save-note": {"ax:text_input:note:set:note", "ax:button:save-note"},
+ "choose-size": {"ax:radio:large", "ax:checkbox:i-agree"},
+}
+
+
+def load(name: str) -> dict:
+ return json.loads((FIXTURES / name).read_text(encoding="utf-8"))
+
+
+def plan_for(harness: str, kind: str, payload: dict, cap_order: str = "relevance"):
+ task = replace(native_task(f"{harness}-{kind}", Path("/nonexistent")), cap_order=cap_order)
+ observation = NativeObservation.from_window_state(
+ payload, expected_pid=payload["pid"], expected_window_id=payload["window_id"]
+ )
+ ax = NativeAccessibilitySource.from_observation(
+ observation, HARNESSES[harness].platform, redact=task.redact_text, text_method=task.text_method
+ )
+ return task.plan(TaskSources(ax=ax))
+
+
+class ComposeRelevanceTest(unittest.TestCase):
+ @staticmethod
+ def cand(name: str) -> Candidate:
+ return Candidate(name, "d", "click", {}, source="ax")
+
+ def test_within_cap_is_unchanged(self) -> None:
+ group = [self.cand(f"ax:button:b{n}") for n in range(MAX_EXECUTABLE_CANDIDATES)]
+ plain, _ = compose({"ax": group}, allowed_risks=frozenset())
+ ranked, stats = compose(
+ {"ax": group}, allowed_risks=frozenset(), relevance=lambda c: 0 if c.id.endswith("23") else 2
+ )
+ self.assertEqual([c.id for c in plain], [c.id for c in ranked])
+ self.assertEqual(stats.dropped, 0)
+
+ def test_over_cap_keeps_relevant_in_element_order(self) -> None:
+ group = [self.cand(f"ax:button:b{n}") for n in range(30)]
+ relevant = {"ax:button:b29", "ax:button:b27"}
+ candidates, stats = compose(
+ {"ax": group}, allowed_risks=frozenset(), relevance=lambda c: 0 if c.id in relevant else 2
+ )
+ ids = [c.id for c in candidates]
+ self.assertEqual(len(ids), MAX_EXECUTABLE_CANDIDATES + 2)
+ self.assertEqual(stats.dropped, 6)
+ self.assertTrue(relevant <= set(ids))
+ # Ranking decides only which survive; the order stays depth-first.
+ executable = ids[:-2]
+ self.assertEqual(executable, sorted(executable, key=lambda i: int(i.rsplit("b", 1)[1])))
+ self.assertEqual(executable[:22], [f"ax:button:b{n}" for n in range(22)])
+ self.assertEqual(ids[-2:], ["reobserve", "abstain"])
+ # Deterministic: the same input gives the same set.
+ again, _ = compose(
+ {"ax": group}, allowed_risks=frozenset(), relevance=lambda c: 0 if c.id in relevant else 2
+ )
+ self.assertEqual(ids, [c.id for c in again])
+
+
+class DensityFixtureTest(unittest.TestCase):
+ def test_sizes_and_cap(self) -> None:
+ expected_sizes = {
+ ("gtk3", 12): {"counter": 12, "save-note": 14, "choose-size": 12},
+ ("appkit", 12): {"counter": 14, "save-note": 16, "choose-size": 12},
+ ("gtk3", 24): dict.fromkeys(TASK_KINDS, 26),
+ ("appkit", 24): dict.fromkeys(TASK_KINDS, 26),
+ }
+ for (harness, density), sizes in expected_sizes.items():
+ payload = load(f"{harness}-window-state-density-{density}-v1.json")
+ for kind in TASK_KINDS:
+ with self.subTest(harness=harness, density=density, kind=kind):
+ plan = plan_for(harness, kind, payload)
+ self.assertEqual(len(plan.candidates), sizes[kind])
+ self.assertTrue(TARGETS[kind] <= {c.id for c in plan.candidates})
+ self.assertEqual(plan.stats.dropped > 0, density == 24)
+
+ def test_golden_sets(self) -> None:
+ """The presented IDs match the golden file that the TypeScript test also checks."""
+ golden = load("native-density-candidates-v1.json")["sets"]
+ self.assertEqual(len(golden), 2 * 2 * 3 * 2)
+ for harness in DENSITY_HARNESSES:
+ for density in (12, 24):
+ payload = load(f"{harness}-window-state-density-{density}-v1.json")
+ for kind in TASK_KINDS:
+ for cap_order in ("relevance", "depth_first"):
+ plan = plan_for(harness, kind, payload, cap_order=cap_order)
+ self.assertEqual(
+ {"ids": [c.id for c in plan.candidates], "dropped": plan.stats.dropped},
+ golden[f"{harness}-{kind}-d{density}-{cap_order}"],
+ )
+
+ def test_depth_first_drops_targets_behind_distractors(self) -> None:
+ for harness in DENSITY_HARNESSES:
+ payload = load(f"{harness}-window-state-density-24-v1.json")
+ for kind in TASK_KINDS:
+ with self.subTest(harness=harness, kind=kind):
+ plan = plan_for(harness, kind, payload, cap_order="depth_first")
+ self.assertEqual(len(plan.candidates), MAX_EXECUTABLE_CANDIDATES + 2)
+ self.assertFalse(TARGETS[kind] & {c.id for c in plan.candidates})
+
+ def test_cap_order_is_irrelevant_within_the_cap(self) -> None:
+ fixtures = {
+ "appkit": "appkit-window-state-initial-v1.json",
+ "wpf": "wpf-window-state-initial-v1.json",
+ "gtk3": "gtk3-window-state-initial-v1.json",
+ }
+ for harness, name in fixtures.items():
+ payload = load(name)
+ for kind in TASK_KINDS:
+ with self.subTest(harness=harness, kind=kind):
+ ranked = plan_for(harness, kind, payload)
+ plain = plan_for(harness, kind, payload, cap_order="depth_first")
+ self.assertEqual(
+ [(c.id, c.description, dict(c.arguments)) for c in ranked.candidates],
+ [(c.id, c.description, dict(c.arguments)) for c in plain.candidates],
+ )
+ payload = load("gtk3-window-state-density-12-v1.json")
+ for kind in TASK_KINDS:
+ self.assertEqual(
+ [c.id for c in plan_for("gtk3", kind, payload).candidates],
+ [c.id for c in plan_for("gtk3", kind, payload, cap_order="depth_first").candidates],
+ )
+
+ def test_relevance_uses_no_values(self) -> None:
+ payload = load("gtk3-window-state-density-24-v1.json")
+ for element in payload["elements"]:
+ if element.get("label") == "Search":
+ element["value"] = "Increment Save note Large I agree"
+ plan = plan_for("gtk3", "save-note", payload)
+ self.assertNotIn("ax:text_input:search:set:note", [c.id for c in plan.candidates][:1])
+ baseline = plan_for("gtk3", "save-note", load("gtk3-window-state-density-24-v1.json"))
+ self.assertEqual([c.id for c in plan.candidates], [c.id for c in baseline.candidates])
+
+ def test_invalid_cap_order(self) -> None:
+ with self.assertRaises(ValueError):
+ replace(native_task("gtk3-counter", Path("/nonexistent")), cap_order="random") # type: ignore[arg-type]
+
+
+class ExpectedNextTest(unittest.TestCase):
+ def entry(self, task, candidate_id: str) -> dict:
+ return task.history_entry(1, candidate_id, outcome="done")
+
+ def test_counter(self) -> None:
+ task = native_task("gtk3-counter", Path("/nonexistent"))
+ history: list[dict] = []
+ for _ in range(3):
+ self.assertEqual(task.expected_next(history), ["ax:button:increment"])
+ history.append(self.entry(task, "ax:button:increment"))
+ self.assertEqual(task.expected_next(history), [])
+
+ def test_ordered_and_unordered_steps(self) -> None:
+ note = native_task("gtk3-save-note", Path("/nonexistent"))
+ self.assertEqual(note.expected_next([]), ["ax:text_input:note:set:note"])
+ self.assertEqual(
+ note.expected_next([self.entry(note, "ax:text_input:note:set:note")]), ["ax:button:save-note"]
+ )
+ size = native_task("gtk3-choose-size", Path("/nonexistent"))
+ self.assertEqual(size.expected_next([]), ["ax:radio:large", "ax:checkbox:i-agree"])
+ # A refused or reobserve step performed nothing.
+ refused = size.history_entry(1, "ax:radio:large", refusal="background_denied")
+ self.assertEqual(size.expected_next([refused]), ["ax:radio:large", "ax:checkbox:i-agree"])
+ self.assertEqual(
+ size.expected_next([self.entry(size, "ax:radio:large:foreground")]), ["ax:checkbox:i-agree"]
+ )
+
+
+class DistractorLabelTest(unittest.TestCase):
+ """The harnesses' distractor labels are benign and identical across platforms."""
+
+ @staticmethod
+ def gtk3_lists() -> dict[str, list]:
+ tree = ast.parse((APPS / "linux/gtk3/main.py").read_text(encoding="utf-8"))
+ values = {}
+ for node in tree.body:
+ if isinstance(node, ast.Assign) and isinstance(node.targets[0], ast.Name):
+ name = node.targets[0].id
+ if name.startswith("DISTRACTOR_") or name == "DENSITY_COUNTS":
+ values[name] = ast.literal_eval(node.value)
+ return values
+
+ @staticmethod
+ def swift_list(source: str, name: str) -> list[str]:
+ match = re.search(rf"let {name}\s*(?::[^=]+)?=\s*\[(.*?)\n\]", source, re.S) or re.search(
+ rf"let {name}\s*=\s*\[([^\n]*)\]", source
+ )
+ assert match, name
+ return re.findall(r'"([^"]+)"', match.group(1))
+
+ def test_labels(self) -> None:
+ gtk3 = self.gtk3_lists()
+ swift = (APPS / "macos/appkit/main.swift").read_text(encoding="utf-8")
+ self.assertEqual(list(gtk3["DISTRACTOR_BUTTONS"]), self.swift_list(swift, "kDistractorButtons"))
+ self.assertEqual(list(gtk3["DISTRACTOR_CHECKBOXES"]), self.swift_list(swift, "kDistractorCheckboxes"))
+ self.assertEqual(
+ [label for group in gtk3["DISTRACTOR_RADIO_GROUPS"] for label in group],
+ self.swift_list(swift, "kDistractorRadioGroups"),
+ )
+ self.assertEqual(list(gtk3["DISTRACTOR_FIELDS"]), self.swift_list(swift, "kDistractorFields"))
+ self.assertIn("12: (8, 3, 1, 1), 24: (26, 12, 4, 2)", swift)
+ self.assertEqual(gtk3["DENSITY_COUNTS"], {12: (8, 3, 1, 1), 24: (26, 12, 4, 2)})
+ labels = [
+ *gtk3["DISTRACTOR_BUTTONS"], *gtk3["DISTRACTOR_CHECKBOXES"], *gtk3["DISTRACTOR_FIELDS"],
+ *(label for group in gtk3["DISTRACTOR_RADIO_GROUPS"] for label in group),
+ ]
+ self.assertEqual(len(labels), len(set(labels)))
+ task_labels = {"Increment", "Reset", "I agree", "Small", "Medium", "Large", "Note", "Save note", "Exit"}
+ for label in labels:
+ with self.subTest(label=label):
+ self.assertEqual(risk_categories(label), frozenset())
+ self.assertNotIn(label, task_labels)
+
+
+class MeasureTest(unittest.TestCase):
+ def test_bucket_and_classify(self) -> None:
+ self.assertEqual([measure_native.bucket(n) for n in (4, 8, 9, 14, 18, 19, 26)],
+ ["~4", "~4", "~12", "~12", "~12", "~24", "~24"])
+ self.assertEqual(measure_native.classify("ax:a:foreground", ["ax:a"]), "correct")
+ self.assertEqual(measure_native.classify("ax:b", ["ax:a"]), "wrong_action")
+ self.assertEqual(measure_native.classify("reobserve", ["ax:a"]), "reobserve")
+ self.assertEqual(measure_native.classify(None, ["ax:a"]), "abstain")
+ self.assertEqual(measure_native.classify("ax:a", ["ax:a"], error=True), "error")
+
+ def test_mock_replay(self) -> None:
+ with tempfile.TemporaryDirectory() as out:
+ specs = [
+ f"gtk3:0:{FIXTURES / 'gtk3-window-state-initial-v1.json'}",
+ f"gtk3:12:{FIXTURES / 'gtk3-window-state-density-12-v1.json'}",
+ f"gtk3:24:{FIXTURES / 'gtk3-window-state-density-24-v1.json'}",
+ ]
+ args = ["replay", "--provider", "mock", "--reps", "2", "--cap-order", "depth_first",
+ "--cap-order", "relevance", "--order", "element", "--order", "shuffled", "--out", out,
+ "--group-by", "density,cap_order,order,bucket"]
+ for spec in specs:
+ args += ["--fixture", spec]
+ with contextlib.redirect_stdout(io.StringIO()):
+ measure_native.main(args)
+ rows = json.loads((Path(out) / "table.json").read_text())
+ decisions = [json.loads(line) for line in (Path(out) / "decisions.jsonl").read_text().splitlines()]
+ # Seven decision points per repetition: counter 3, save-note 2, choose-size 2.
+ self.assertEqual(len(decisions), 3 * 2 * 2 * 2 * 7)
+ for row in rows:
+ with self.subTest(row=row):
+ if row["density"] == 24 and row["cap_order"] == "depth_first":
+ self.assertEqual((row["correct"], row["target_missing"]), (0, row["decisions"]))
+ self.assertEqual(row["reobserve"], row["decisions"])
+ else:
+ self.assertEqual(row["accuracy"], 1.0)
+ self.assertEqual(row["target_missing"], 0)
+ self.assertEqual({row["bucket"] for row in rows}, {"~4", "~12", "~24"})
+ shuffled = [d for d in decisions if d["order"] == "shuffled" and d["density"] == 24]
+ element = [d for d in decisions if d["order"] == "element" and d["density"] == 24]
+ self.assertNotEqual({d["request_sha256"] for d in shuffled}, {d["request_sha256"] for d in element})
+
+ def test_runner_logs(self) -> None:
+ events = [
+ {"event": "start", "task": "gtk3-counter", "language": "python", "provider": "s1", "platform": "linux"},
+ {"event": "step", "step": 1, "candidate": "ax:button:increment", "candidate_count": 26,
+ "expected_ids": ["ax:button:increment"], "expected_offered": True, "confidence": 0.9,
+ "decide_ms": 2000.0, "compose": {"dropped": 4}},
+ {"event": "step", "step": 2, "candidate": "ax:button:refresh", "candidate_count": 26,
+ "expected_ids": ["ax:button:increment"], "expected_offered": True, "confidence": 0.4,
+ "decide_ms": 2100.0},
+ {"event": "step", "step": 3, "candidate": "reobserve", "candidate_count": 26,
+ "expected_ids": ["ax:button:increment"], "expected_offered": True, "confidence": 0.5,
+ "decide_ms": 2050.0},
+ {"event": "outcome", "outcome": "abstained", "step": 4, "candidate_count": 26,
+ "expected_ids": ["ax:button:increment"], "confidence": 0.6, "decide_ms": 1990.0},
+ {"event": "outcome", "outcome": "unknown", "phase": "decide", "step": 5, "candidate_count": 26,
+ "expected_ids": ["ax:button:increment"], "error": "S1ServiceError"},
+ {"event": "outcome", "outcome": "verified", "step": 5},
+ ]
+ with tempfile.TemporaryDirectory() as root:
+ log = Path(root) / "python-s1-gtk3-counter-d24.jsonl"
+ log.write_text("".join(json.dumps(event) + "\n" for event in events))
+ records = measure_native.decisions_from_log(log)
+ self.assertEqual([r["result"] for r in records], ["correct", "wrong_action", "reobserve", "abstain", "error"])
+ self.assertEqual({r["density"] for r in records}, {24})
+ self.assertEqual({r["bucket"] for r in records}, {"~24"})
+ rows = measure_native.aggregate(records, ("platform", "provider", "bucket"))
+ self.assertEqual(len(rows), 1)
+ self.assertEqual(rows[0]["accuracy"], 0.2)
+ self.assertIn("| linux | s1 | ~24 | 26 | 5 | 1 | 20.0% |", measure_native.markdown(rows, ("platform", "provider", "bucket")))
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/libs/cua-driver/examples/jev-use/typescript/native_density.test.ts b/libs/cua-driver/examples/jev-use/typescript/native_density.test.ts
new file mode 100644
index 0000000000..13a11306b6
--- /dev/null
+++ b/libs/cua-driver/examples/jev-use/typescript/native_density.test.ts
@@ -0,0 +1,119 @@
+// Larger candidate sets and relevance capping (#4312). Mirrors
+// python/tests/test_native_density.py; the fixtures are get_window_state
+// results recorded from the GTK3 harness with CUA_GTK3_TASK_DENSITY set.
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import test from 'node:test';
+
+import { validateRequest } from './choose_action.js';
+import { parseWindowState } from './native.js';
+import {
+ HARNESSES,
+ MAX_EXECUTABLE_CANDIDATES,
+ NativeTask,
+ compose,
+ nativeChoiceRequest,
+ nativeTask,
+ type CapOrder,
+} from './native_tasks.js';
+import { NativeAccessibilitySource, immutableCandidate } from './sources.js';
+import type { TaskSources } from './tasks.js';
+
+const KINDS = ['counter', 'save-note', 'choose-size'] as const;
+const TARGETS: Record<string, string[]> = {
+ counter: ['ax:button:increment'],
+ 'save-note': ['ax:text_input:note:set:note', 'ax:button:save-note'],
+ 'choose-size': ['ax:radio:large', 'ax:checkbox:i-agree'],
+};
+
+function fixture(name: string): any {
+ return JSON.parse(readFileSync(new URL(`../fixtures/native/${name}`, import.meta.url), 'utf8'));
+}
+
+function task(kind: string, capOrder: CapOrder = 'relevance', harness = 'gtk3'): NativeTask {
+ return new NativeTask({ ...nativeTask(`${harness}-${kind}`, '/tmp/none.json'), capOrder });
+}
+
+function sources(t: NativeTask, payload: any, harness = 'gtk3'): TaskSources {
+ return {
+ ax: NativeAccessibilitySource.fromObservation(
+ parseWindowState(payload, payload.pid, payload.window_id),
+ HARNESSES[harness].platform,
+ { redact: t.redactText, textMethod: t.textMethod }
+ ),
+ visualPath: false,
+ foregroundIds: new Set(),
+ };
+}
+
+test('compose keeps relevant candidates over the cap in element order', () => {
+ const group = Array.from({ length: 30 }, (_, n) =>
+ immutableCandidate({ id: `ax:button:b${n}`, description: 'd', tool: 'click', arguments: {}, source: 'ax' })
+ );
+ const relevant = new Set(['ax:button:b29', 'ax:button:b27']);
+ const rank = (c: { id: string }) => (relevant.has(c.id) ? 0 : 2);
+ const { candidates, stats } = compose({ ax: group }, new Set(), undefined, undefined, rank);
+ const ids = candidates.map((c) => c.id);
+ assert.equal(ids.length, MAX_EXECUTABLE_CANDIDATES + 2);
+ assert.equal(stats.dropped, 6);
+ assert.deepEqual(ids.slice(0, 22), Array.from({ length: 22 }, (_, n) => `ax:button:b${n}`));
+ assert.deepEqual(ids.slice(22), ['ax:button:b27', 'ax:button:b29', 'reobserve', 'abstain']);
+ const within = compose({ ax: group.slice(0, 24) }, new Set(), undefined, undefined, rank);
+ assert.deepEqual(
+ within.candidates.map((c) => c.id),
+ compose({ ax: group.slice(0, 24) }, new Set()).candidates.map((c) => c.id)
+ );
+});
+
+test('density fixtures reproduce the golden candidate sets', () => {
+ const golden = fixture('native-density-candidates-v1.json').sets;
+ assert.equal(Object.keys(golden).length, 24);
+ for (const harness of ['gtk3', 'appkit']) {
+ for (const density of [12, 24]) {
+ const payload = fixture(`${harness}-window-state-density-${density}-v1.json`);
+ for (const kind of KINDS) {
+ for (const capOrder of ['relevance', 'depth_first'] as const) {
+ const t = task(kind, capOrder, harness);
+ const src = sources(t, payload, harness);
+ const plan = t.plan(src);
+ assert.deepEqual(
+ { ids: plan.candidates.map((c) => c.id), dropped: plan.stats.dropped },
+ golden[`${harness}-${kind}-d${density}-${capOrder}`],
+ `${harness} ${kind} d${density} ${capOrder}`
+ );
+ const offered = new Set(plan.candidates.map((c) => c.id));
+ const present = TARGETS[kind].filter((id) => offered.has(id));
+ assert.equal(present.length, density === 24 && capOrder === 'depth_first' ? 0 : TARGETS[kind].length);
+ validateRequest(nativeChoiceRequest(t, src, plan, []));
+ }
+ }
+ }
+ }
+});
+
+test('expectedNext follows the declared steps', () => {
+ const counter = task('counter');
+ const history = [] as ReturnType<NativeTask['historyEntry']>[];
+ for (let i = 0; i < 3; i += 1) {
+ assert.deepEqual(counter.expectedNext(history), ['ax:button:increment']);
+ history.push(counter.historyEntry(i + 1, 'ax:button:increment', undefined, { outcome: 'done' }));
+ }
+ assert.deepEqual(counter.expectedNext(history), []);
+ const note = task('save-note');
+ assert.deepEqual(note.expectedNext([]), ['ax:text_input:note:set:note']);
+ assert.deepEqual(
+ note.expectedNext([note.historyEntry(1, 'ax:text_input:note:set:note', undefined, { outcome: 'done' })]),
+ ['ax:button:save-note']
+ );
+ const size = task('choose-size');
+ assert.deepEqual(size.expectedNext([]), ['ax:radio:large', 'ax:checkbox:i-agree']);
+ assert.deepEqual(size.expectedNext([size.historyEntry(1, 'ax:radio:large', 'background_denied')]), [
+ 'ax:radio:large',
+ 'ax:checkbox:i-agree',
+ ]);
+ assert.deepEqual(
+ size.expectedNext([size.historyEntry(1, 'ax:radio:large:foreground', undefined, { outcome: 'done' })]),
+ ['ax:checkbox:i-agree']
+ );
+ assert.throws(() => new NativeTask({ ...nativeTask('gtk3-counter', '/tmp/none.json'), capOrder: 'random' as CapOrder }));
+});
diff --git a/libs/cua-driver/examples/jev-use/typescript/native_tasks.ts b/libs/cua-driver/examples/jev-use/typescript/native_tasks.ts
index 5b6c69b1e2..64cb7d790f 100644
--- a/libs/cua-driver/examples/jev-use/typescript/native_tasks.ts
+++ b/libs/cua-driver/examples/jev-use/typescript/native_tasks.ts
@@ -57,6 +57,22 @@ export const NATIVE_RESERVED: readonly Candidate[] = [
}),
];
+// Words too common to make a control relevant to a goal (#4312).
+const RELEVANCE_STOPWORDS = new Set([
+ 'the', 'and', 'then', 'once', 'per', 'step', 'stop', 'into', 'with', 'for', 'from',
+ 'this', 'that', 'its', 'each', 'exactly', 'starts', 'set', 'option', 'field', 'button',
+]);
+
+function relevanceWords(text: string): Set<string> {
+ return new Set(
+ (text.toLowerCase().match(/[a-z0-9]+/g) ?? []).filter(
+ (word) => word.length >= 3 && !RELEVANCE_STOPWORDS.has(word)
+ )
+ );
+}
+
+export type CapOrder = 'relevance' | 'depth_first';
+
const VERBS: Readonly<Record<string, string>> = {
press: 'pressed',
toggle: 'toggled',
@@ -125,13 +141,18 @@ export type ComposeStats = Readonly<{
* Merge source outputs in the order page, ax, visual: first source wins on a
* duplicate ID, unallowed risk categories are removed, at most `cap`
* executable candidates remain (the drop count is reported), and the reserved
- * candidates are appended.
+ * candidates are appended. Without `relevance`, the first `cap` in
+ * depth-first order are kept. With `relevance` (lower is more relevant), a set
+ * over the cap keeps the `cap` lowest `(relevance, position)` candidates and
+ * still presents them in depth-first order (#4312). A set within the cap is
+ * unchanged.
*/
export function compose(
groups: Partial<Record<(typeof SOURCE_ORDER)[number], readonly Candidate[]>>,
allowedRisks: ReadonlySet<string>,
reserved: readonly Candidate[] = NATIVE_RESERVED,
- cap = MAX_EXECUTABLE_CANDIDATES
+ cap = MAX_EXECUTABLE_CANDIDATES,
+ relevance?: (candidate: Candidate) => number
): { candidates: Candidate[]; stats: ComposeStats } {
const seen = new Set(reserved.map((candidate) => candidate.id));
const merged: Candidate[] = [];
@@ -152,7 +173,18 @@ export function compose(
merged.push(candidate);
}
}
- const kept = merged.slice(0, cap);
+ let kept: Candidate[];
+ if (!relevance || merged.length <= cap) {
+ kept = merged.slice(0, cap);
+ } else {
+ const ranked = merged
+ .map((candidate, index) => ({ index, rank: relevance(candidate) }))
+ .sort((a, b) => a.rank - b.rank || a.index - b.index)
+ .slice(0, cap)
+ .map((entry) => entry.index)
+ .sort((a, b) => a - b);
+ kept = ranked.map((index) => merged[index]);
+ }
const counts: Record<string, number> = { page: 0, ax: 0, visual: 0 };
for (const candidate of kept) {
if (candidate.source && candidate.source in counts) counts[candidate.source] += 1;
@@ -219,6 +251,7 @@ export type NativeTaskSpec = Readonly<{
visualMinConfidence?: number;
mockPreferences?: readonly string[];
steps?: readonly TaskStep[];
+ capOrder?: CapOrder;
}>;
export class NativeTask implements Task {
@@ -243,6 +276,12 @@ export class NativeTask implements Task {
* step that is not done yet. Empty means the request carries no progress.
*/
readonly steps: readonly TaskStep[];
+ /**
+ * How a set over the cap is cut (#4312): 'relevance' keeps the declared
+ * steps' candidates first; 'depth_first' keeps the first `cap` in element
+ * order, as before. Both present the kept candidates in element order.
+ */
+ readonly capOrder: CapOrder;
/** The oracle is polled after every action, so no candidate is special. */
readonly completionCandidateIds: ReadonlySet<string> = new Set();
@@ -262,6 +301,10 @@ export class NativeTask implements Task {
this.visualMinConfidence = spec.visualMinConfidence ?? 0.8;
this.mockPreferences = spec.mockPreferences ?? [];
this.steps = spec.steps ?? [];
+ this.capOrder = spec.capOrder ?? 'relevance';
+ if (this.capOrder !== 'relevance' && this.capOrder !== 'depth_first') {
+ throw new Error('capOrder must be relevance or depth_first');
+ }
const unknown = [...this.allowedActions].filter((action) => !ACTION_KINDS.has(action));
if (unknown.length) throw new Error(`unknown action kinds: ${unknown.sort().join(', ')}`);
for (const parameter of this.parameters) {
@@ -299,6 +342,7 @@ export class NativeTask implements Task {
private nativeCandidates(ax: NativeAccessibilitySource, foregroundIds: ReadonlySet<string>) {
const candidates: Candidate[] = [];
const outcomes: Record<string, string> = {};
+ const labels: Record<string, string> = {};
for (const native of ax.controls) {
if (!this.allowedActions.has(native.action)) continue;
const control = ax.control(native);
@@ -317,6 +361,7 @@ export class NativeTask implements Task {
)
);
outcomes[id] = `set ${label} to parameter ${parameter.name}`;
+ labels[id] = native.label;
}
continue;
}
@@ -334,8 +379,9 @@ export class NativeTask implements Task {
}
candidates.push(ax.click(control, id, description, delivery));
outcomes[id] = `${VERBS[native.action]} ${label}`;
+ labels[id] = native.label;
}
- return { candidates, outcomes };
+ return { candidates, outcomes, labels };
}
static describe(native: NativeControl, label: string): string {
@@ -380,13 +426,52 @@ export class NativeTask implements Task {
return { candidates, outcomes };
}
+ /**
+ * Rank candidates for the cap only (#4312); lower is more relevant. Tier 0
+ * performs a declared step or clicks a declared visual target; tier 1 has a
+ * label sharing a word with the goal; tier 2 is everything else. Uses only
+ * task-authored text and labels, never values.
+ */
+ relevance(labels: Readonly<Record<string, string>>): (candidate: Candidate) => number {
+ const declared = new Set([
+ ...this.steps.map((taskStep) => taskStep.candidateId),
+ ...this.visualTargets.map((target) => `visual:${slug(target)}`),
+ ]);
+ const goalWords = relevanceWords(this.goal);
+ return (candidate) => {
+ if (declared.has(candidate.id.replace(/:foreground$/, ''))) return 0;
+ for (const word of relevanceWords(labels[candidate.id] ?? '')) if (goalWords.has(word)) return 1;
+ return 2;
+ };
+ }
+
+ /**
+ * The candidate IDs that correctly advance the task now, for measurement: a
+ * declared step performed fewer times than required whose earlier steps
+ * (for a step that waits) are done. Counted from this run's own actions.
+ */
+ expectedNext(history: readonly HistoryEntry[]): string[] {
+ const counts = performedCounts(history);
+ const due: string[] = [];
+ this.steps.forEach((taskStep, index) => {
+ if ((counts[taskStep.candidateId] ?? 0) >= (taskStep.times ?? 1)) return;
+ const earlier = taskStep.afterPrevious === false ? [] : this.steps.slice(0, index);
+ if (earlier.every((step) => (counts[step.candidateId] ?? 0) >= (step.times ?? 1))) {
+ due.push(taskStep.candidateId);
+ }
+ });
+ return due;
+ }
+
plan(sources: TaskSources): NativeStep {
const outcomes: Record<string, string> = {};
+ let labels: Record<string, string> = {};
let axCandidates: Candidate[] = [];
let elements: CompactElement[] = [];
if (sources.ax) {
const native = this.nativeCandidates(sources.ax, sources.foregroundIds ?? new Set());
axCandidates = native.candidates;
+ labels = native.labels;
Object.assign(outcomes, native.outcomes);
elements = sources.ax.controls.slice(0, MAX_ELEMENTS).map((control) => ({
role_class: control.roleClass,
@@ -396,7 +481,13 @@ export class NativeTask implements Task {
}
const visual = this.visualCandidates(sources);
Object.assign(outcomes, visual.outcomes);
- const { candidates, stats } = compose({ ax: axCandidates, visual: visual.candidates }, this.allowedRisks);
+ const { candidates, stats } = compose(
+ { ax: axCandidates, visual: visual.candidates },
+ this.allowedRisks,
+ NATIVE_RESERVED,
+ MAX_EXECUTABLE_CANDIDATES,
+ this.capOrder === 'relevance' ? this.relevance(labels) : undefined
+ );
for (const candidate of candidates) {
if (candidate.tool !== null && !this.allowedActionKinds.has(candidate.tool)) {
throw new Error(`task ${this.id} does not allow action kind ${candidate.tool}`);
diff --git a/libs/cua-driver/examples/jev-use/typescript/run_native.ts b/libs/cua-driver/examples/jev-use/typescript/run_native.ts
index 63551edb16..644b3381e1 100644
--- a/libs/cua-driver/examples/jev-use/typescript/run_native.ts
+++ b/libs/cua-driver/examples/jev-use/typescript/run_native.ts
@@ -288,10 +288,15 @@ export async function runTask(args: Arguments, task: NativeTask): Promise<Outcom
// logged outcome instead of a stack trace.
await writeEvent(args.log, {
event: 'outcome', outcome: 'unknown', phase: 'decide', step,
+ candidate_count: plan.candidates.length, expected_ids: task.expectedNext(history),
error: 'S1ServiceError', reason: error.message.slice(0, 128),
});
return 'unknown';
}
+ // Measurement (#4312): the declared steps due now, and whether the
+ // candidate set offered one. IDs only; no values.
+ const expectedIds = task.expectedNext(history);
+ const offered = new Set(plan.candidates.map((candidate) => candidate.id.replace(/:foreground$/, '')));
const baseEvent: Record<string, unknown> = {
event: 'step',
step,
@@ -303,6 +308,8 @@ export async function runTask(args: Arguments, task: NativeTask): Promise<Outcom
confidence: decision.confidence,
probabilities: decision.probabilities,
decide_ms: Math.round((performance.now() - decideStarted) * 100) / 100,
+ expected_ids: expectedIds,
+ expected_offered: expectedIds.some((id) => offered.has(id)),
};
if (!decision.choice) {
await writeEvent(args.log, { ...baseEvent, event: 'outcome', outcome: 'abstained' });
diff --git a/libs/cua-driver/examples/jev-use/verify_native.py b/libs/cua-driver/examples/jev-use/verify_native.py
index 307bc1d395..bcad457327 100644
--- a/libs/cua-driver/examples/jev-use/verify_native.py
+++ b/libs/cua-driver/examples/jev-use/verify_native.py
@@ -12,6 +12,10 @@ itself and checks it against the task's expected end state. The runners' own
outcome events are not the oracle. Evidence (redacted JSONL logs plus
``summary.json``) goes to a new ``--output-dir``. ``--capture-dir`` also
records sanitized ``get_window_state`` fixtures before and after each run.
+``--density 12`` or ``24`` launches the AppKit or GTK3 harness with
+``CUA_<HARNESS>_TASK_DENSITY`` set, which adds benign distractor controls
+before the task controls; the harness confirms the density in its state file
+(#4312). ``measure_native.py`` turns the runner logs into an accuracy table.
Build the harness first, from the repository root:
``libs/cua-driver/tests/fixtures/build/macos.sh --only appkit``,
@@ -49,6 +53,7 @@ class Harness(NamedTuple):
state_env: str
journal: bool = False # the app posts its state to a loopback journal
max_depth: int | None = None # the task scope's walk depth, for --capture-dir
+ density_env: str | None = None # opt-in distractor density (#4312)
@@ -58,6 +63,7 @@ HARNESSES = {
"appkit": Harness(
TEST_APPS / "harness-appkit/CuaTestHarness.AppKit.app", "Contents/MacOS/CuaTestHarness.AppKit",
"CuaTestHarness AppKit", "cua.appkit_task_state_v1", "CUA_APPKIT_TASK_STATE",
+ density_env="CUA_APPKIT_TASK_DENSITY",
),
"wpf": Harness(
TEST_APPS / "harness-wpf/CuaTestHarness.Wpf.exe", "",
@@ -70,6 +76,7 @@ HARNESSES = {
"gtk3": Harness(
TEST_APPS / "harness-gtk3/CuaTestHarness.Gtk3", "",
"CuaTestHarness GTK3 Tasks", "cua.gtk3_task_state_v1", "CUA_GTK3_TASK_STATE",
+ density_env="CUA_GTK3_TASK_DENSITY",
),
"canvas": Harness(
REPO / "libs/cua-driver/tests/fixtures/apps/cross-platform/visual-only-canvas/main.py", "",
@@ -78,6 +85,7 @@ HARNESSES = {
),
}
FORM_KINDS = ("choose-size", "counter", "save-note")
+DENSITIES = (12, 24)
HARNESS_KINDS = {name: (("cancel",) if name == "canvas" else FORM_KINDS) for name in HARNESSES}
# The independent end-state check for each task kind, read from the app's own file.
@@ -146,7 +154,7 @@ def start_journal(harness: Harness, state: Path) -> tuple[str, Callable[[], None
def launch_harness(
- harness: Harness, app: Path, state: Path
+ harness: Harness, app: Path, state: Path, density: int | None = None
) -> tuple[subprocess.Popen, Callable[[], None]]:
executable = app / harness.executable if harness.executable else app
if not executable.is_file():
@@ -158,6 +166,12 @@ def launch_harness(
else:
command = [str(executable)]
env = {**os.environ, harness.state_env: str(state)}
+ if harness.density_env:
+ env.pop(harness.density_env, None)
+ if density is not None:
+ if harness.density_env is None:
+ raise SystemExit("this harness has no distractor density mode")
+ env[harness.density_env] = str(density)
process = subprocess.Popen(command, env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
try:
wait_for_initial_state(process, state)
@@ -225,17 +239,20 @@ def capture(harness_name: str, pid: int, output: Path, label: str) -> None:
def verify(
language: str, provider: str, harness_name: str, kind: str, app: Path, output: Path, work: Path,
- capture_dir: Path | None = None,
+ capture_dir: Path | None = None, density: int | None = None,
) -> dict:
harness = HARNESSES[harness_name]
task = f"{harness_name}-{kind}"
- state = work / f"{language}-{provider}-{task}-state.json"
- log = output / f"{language}-{provider}-{task}.jsonl"
- process, close_journal = launch_harness(harness, app, state)
+ suffix = f"-d{density}" if density is not None else ""
+ state = work / f"{language}-{provider}-{task}{suffix}-state.json"
+ log = output / f"{language}-{provider}-{task}{suffix}.jsonl"
+ process, close_journal = launch_harness(harness, app, state, density)
try:
initial = read_state(harness, state, process.pid)
+ if initial.get("density") != density:
+ raise RuntimeError(f"harness reports density {initial.get('density')!r}, not {density!r}")
if capture_dir is not None:
- capture(harness_name, process.pid, capture_dir / f"{language}-{task}-initial.json", "initial")
+ capture(harness_name, process.pid, capture_dir / f"{language}-{task}{suffix}-initial.json", "initial")
command = runner_command(language) + [
"--task", task, "--provider", provider, "--pid", str(process.pid),
"--state-file", str(state), "--note-text", NOTE_TEXT, "--log", str(log),
@@ -247,7 +264,7 @@ def verify(
completed = subprocess.run(command, cwd=BASE, check=False, timeout=300)
observed = read_state(harness, state, process.pid)
if capture_dir is not None:
- capture(harness_name, process.pid, capture_dir / f"{language}-{task}-after.json", "after the task")
+ capture(harness_name, process.pid, capture_dir / f"{language}-{task}{suffix}-after.json", "after the task")
finally:
process.kill()
process.wait(timeout=10)
@@ -257,6 +274,8 @@ def verify(
"language": language,
"provider": provider,
"task": task,
+ "density": density,
+ "distractor_actions": observed.get("distractor_actions"),
"exit_code": completed.returncode,
"runner_outcome": events[-1].get("outcome") if events else None,
"initial": {key: initial.get(key) for key in ("counter", "agreed", "size", "note_saved", "selected", "action_count")},
@@ -289,12 +308,18 @@ def main() -> None:
)
parser.add_argument("--task", action="append", choices=sorted(EXPECTED), help="limit to task kinds")
parser.add_argument("--capture-dir", type=Path, help="also record sanitized window-state fixtures")
+ parser.add_argument(
+ "--density", type=int, choices=DENSITIES,
+ help="add the harness's benign distractor controls (AppKit and GTK3 only)",
+ )
parser.add_argument("--output-dir", type=Path, required=True, help="new evidence directory")
args = parser.parse_args()
if args.live and not os.environ.get("TYPESAFE_API_KEY", "").strip():
if not sys.stdin.isatty():
raise SystemExit("Human prerequisite: provision TYPESAFE_API_KEY before a live run")
os.environ["TYPESAFE_API_KEY"] = getpass.getpass("TypeSafe API key: ").strip()
+ if args.density is not None and HARNESSES[args.harness].density_env is None:
+ parser.error(f"--harness {args.harness} has no distractor density mode")
unsupported = sorted(set(args.task or ()) - set(HARNESS_KINDS[args.harness]))
if unsupported:
parser.error(f"--harness {args.harness} has no task kind {', '.join(unsupported)}")
@@ -315,6 +340,7 @@ def main() -> None:
summary: dict = {
"complete": False,
"harness": args.harness,
+ "density": args.density,
"live_requested": args.live,
"s1_requested": args.s1,
"typescript_requested": args.typescript,
@@ -327,7 +353,8 @@ def main() -> None:
for provider in providers:
for kind in args.task or HARNESS_KINDS[args.harness]:
result = verify(
- language, provider, args.harness, kind, app, output, Path(work), capture_dir
+ language, provider, args.harness, kind, app, output, Path(work), capture_dir,
+ args.density,
)
summary["checks"].append(result)
print(json.dumps({"event": "independently_verified", **result}), flush=True)
diff --git a/libs/cua-driver/tests/fixtures/apps/linux/gtk3/main.py b/libs/cua-driver/tests/fixtures/apps/linux/gtk3/main.py
index 03760112f4..aaaa225dd5 100755
--- a/libs/cua-driver/tests/fixtures/apps/linux/gtk3/main.py
+++ b/libs/cua-driver/tests/fixtures/apps/linux/gtk3/main.py
@@ -283,6 +283,44 @@ class HarnessWindow(Gtk.Window):
TASK_STATE_ENV = "CUA_GTK3_TASK_STATE"
TASK_STATE_SCHEMA = "cua.gtk3_task_state_v1"
+TASK_DENSITY_ENV = "CUA_GTK3_TASK_DENSITY"
+
+# Opt-in distractor controls for measuring jev-use accuracy at larger
+# candidate sets (#4312). The labels are benign (no risky-action phrase) and
+# match the AppKit harness, so candidate IDs agree across platforms. Some are
+# unrelated to every task; some are close to a task control ("Save draft",
+# "Increase font size", "Note title", "Large icons"). Density 12 uses the first
+# entries of each list; density 24 uses all of them.
+DISTRACTOR_BUTTONS = (
+ "New folder", "Refresh", "Undo", "Redo", "Zoom in", "Zoom out", "Save draft",
+ "Increase font size", "Copy link", "Duplicate", "Rename", "Print preview", "Export PDF",
+ "Import", "Bold", "Italic", "Underline", "Align left", "Align center", "Align right",
+ "Insert table", "Insert image", "Spell check", "Word count", "Show sidebar", "Help",
+)
+DISTRACTOR_CHECKBOXES = (
+ "Show ruler", "Show previews", "Word wrap", "Auto-save", "Line numbers", "Dark mode",
+ "Show hidden files", "Sync on startup", "Compact layout", "Show status bar",
+ "Remember window size", "Check spelling as you type",
+)
+DISTRACTOR_RADIO_GROUPS = (
+ ("Light", "Dark", "System"),
+ ("List", "Grid", "Columns"),
+ ("Name", "Date", "Kind"),
+ ("Small icons", "Medium icons", "Large icons"),
+)
+DISTRACTOR_FIELDS = ("Search", "Note title")
+# density -> (buttons, checkboxes, radio groups, text fields)
+DENSITY_COUNTS = {12: (8, 3, 1, 1), 24: (26, 12, 4, 2)}
+
+
+def task_density():
+ """The opt-in distractor density: None, 12, or 24. Anything else is an error."""
+ raw = os.environ.get(TASK_DENSITY_ENV, "").strip()
+ if not raw:
+ return None
+ if raw not in ("12", "24"):
+ raise SystemExit(f"{TASK_DENSITY_ENV} must be 12 or 24, not {raw!r}")
+ return int(raw)
class TaskWindow(Gtk.Window):
@@ -291,17 +329,20 @@ class TaskWindow(Gtk.Window):
It carries the same labeled controls as the AppKit and WPF task modes
(Increment, Reset, I agree, Small/Medium/Large, Note, Save note, Exit) in a
- small window where every control is on screen. Accessible names are the
+ small window where every control is on screen. CUA_GTK3_TASK_DENSITY=12 or
+ 24 also adds benign distractor controls before them (#4312). Accessible names are the
visible labels here, not the aid-style names of HarnessWindow, so candidate
IDs match across platforms. Every change atomically rewrites an app-owned
JSON state file; the jev-use task oracle reads that file and never depends
on Cua Driver output. Ordinary launches never create this window.
"""
- def __init__(self, state_path):
+ def __init__(self, state_path, density=None):
super().__init__(title="CuaTestHarness GTK3 Tasks")
self.set_default_size(480, 320)
self.state_path = state_path
+ self.density = density
+ self.distractor_actions = 0
self.counter = 0
self.agreed = False
self.size = "none"
@@ -311,6 +352,10 @@ class TaskWindow(Gtk.Window):
root = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=8)
root.set_border_width(16)
self.add(root)
+ if density is not None:
+ # Before the task controls, as a toolbar and sidebar precede the
+ # content in a typical document app's depth-first order.
+ self.add_distractors(root, density)
self.counter_label = Gtk.Label(label="counter=0", xalign=0)
root.pack_start(self.counter_label, False, False, 0)
@@ -345,6 +390,46 @@ class TaskWindow(Gtk.Window):
self.connect("destroy", Gtk.main_quit)
self.publish()
+ def add_distractors(self, root, density):
+ buttons, checkboxes, groups, fields = DENSITY_COUNTS[density]
+ grid = Gtk.Grid(column_spacing=6, row_spacing=6)
+ for index, label in enumerate(DISTRACTOR_BUTTONS[:buttons]):
+ grid.attach(self.button(label, self.on_distractor), index % 7, index // 7, 1, 1)
+ root.pack_start(grid, False, False, 0)
+ field_row = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=8)
+ for label in DISTRACTOR_FIELDS[:fields]:
+ # An accessible name and no placeholder, like the Note field.
+ entry = aid(Gtk.Entry(), label)
+ entry.set_width_chars(18)
+ entry.connect("changed", self.on_distractor)
+ field_row.pack_start(entry, False, False, 0)
+ root.pack_start(field_row, False, False, 0)
+ checks = Gtk.Grid(column_spacing=12, row_spacing=4)
+ for index, label in enumerate(DISTRACTOR_CHECKBOXES[:checkboxes]):
+ check = Gtk.CheckButton(label=label)
+ check.connect("toggled", self.on_distractor)
+ checks.attach(check, index % 4, index // 4, 1, 1)
+ root.pack_start(checks, False, False, 0)
+ for options in DISTRACTOR_RADIO_GROUPS[:groups]:
+ row = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
+ # A hidden member keeps every visible option unselected at launch.
+ hidden = Gtk.RadioButton(label="none")
+ row.hidden_member = hidden
+ for label in options:
+ radio = Gtk.RadioButton.new_with_label_from_widget(hidden, label)
+ radio.connect("toggled", self.on_distractor_radio)
+ row.pack_start(radio, False, False, 0)
+ root.pack_start(row, False, False, 0)
+ root.pack_start(Gtk.Separator(), False, False, 4)
+
+ def on_distractor(self, *_):
+ self.distractor_actions += 1
+ self.publish()
+
+ def on_distractor_radio(self, radio):
+ if radio.get_active():
+ self.on_distractor()
+
@staticmethod
def button(label, handler):
widget = Gtk.Button(label=label)
@@ -385,6 +470,9 @@ class TaskWindow(Gtk.Window):
"size": self.size,
"note_saved": self.saved_note,
}
+ if self.density is not None:
+ state["density"] = self.density
+ state["distractor_actions"] = self.distractor_actions
temporary = f"{self.state_path}.{os.getpid()}.tmp"
with open(temporary, "w", encoding="utf-8") as stream:
json.dump(state, stream, sort_keys=True)
@@ -393,7 +481,7 @@ class TaskWindow(Gtk.Window):
def main():
task_state = os.environ.get(TASK_STATE_ENV, "").strip()
- win = TaskWindow(task_state) if task_state else HarnessWindow()
+ win = TaskWindow(task_state, task_density()) if task_state else HarnessWindow()
win.show_all()
Gtk.main()
diff --git a/libs/cua-driver/tests/fixtures/apps/macos/appkit/main.swift b/libs/cua-driver/tests/fixtures/apps/macos/appkit/main.swift
index 2572a82dcd..4621a46279 100644
--- a/libs/cua-driver/tests/fixtures/apps/macos/appkit/main.swift
+++ b/libs/cua-driver/tests/fixtures/apps/macos/appkit/main.swift
@@ -21,6 +21,9 @@
// buttons, plus an app-owned JSON state file rewritten on
// every counter, checkbox, size, and save change. Ordinary
// launches do not add these controls or write any file.
+// CUA_APPKIT_TASK_DENSITY=12|24 (task mode only) also adds
+// benign distractor controls in a sidebar before them, for
+// measuring jev-use accuracy at larger candidate sets.
//
// AX identifiers (via `setAccessibilityIdentifier(_:)`) match the IDs in
// scenarios.json. Window title is set to "CuaTestHarness AppKit" so the
@@ -64,6 +67,47 @@ let kTaskStateSchema = "cua.appkit_task_state_v1"
let kNoteFieldAID = "txt-note"
let kSaveNoteButtonAID = "btn-save-note"
let kSizeOptions = ["Small", "Medium", "Large"]
+let kTaskDensityEnv = "CUA_APPKIT_TASK_DENSITY"
+// Opt-in distractor controls (#4312). The labels are benign (no risky-action
+// phrase) and match the GTK3 harness, so candidate IDs agree across platforms.
+// Some are unrelated to every task; some are close to a task control ("Save
+// draft", "Increase font size", "Note title", "Large icons"). Density 12 uses
+// the first entries of each list; density 24 uses all of them.
+let kDistractorButtons = [
+ "New folder", "Refresh", "Undo", "Redo", "Zoom in", "Zoom out", "Save draft",
+ "Increase font size", "Copy link", "Duplicate", "Rename", "Print preview", "Export PDF",
+ "Import", "Bold", "Italic", "Underline", "Align left", "Align center", "Align right",
+ "Insert table", "Insert image", "Spell check", "Word count", "Show sidebar", "Help",
+]
+let kDistractorCheckboxes = [
+ "Show ruler", "Show previews", "Word wrap", "Auto-save", "Line numbers", "Dark mode",
+ "Show hidden files", "Sync on startup", "Compact layout", "Show status bar",
+ "Remember window size", "Check spelling as you type",
+]
+let kDistractorRadioGroups = [
+ ["Light", "Dark", "System"],
+ ["List", "Grid", "Columns"],
+ ["Name", "Date", "Kind"],
+ ["Small icons", "Medium icons", "Large icons"],
+]
+let kDistractorFields = ["Search", "Note title"]
+// density -> (buttons, checkboxes, radio groups, text fields)
+let kDensityCounts: [Int: (Int, Int, Int, Int)] = [12: (8, 3, 1, 1), 24: (26, 12, 4, 2)]
+let kDistractorPanelWidth: CGFloat = 600
+
+/// The opt-in distractor density in task mode: nil, 12, or 24. Anything else
+/// is a launch error, so a measurement never runs at an unintended density.
+func taskDensityFromEnvironment() -> Int? {
+ let env = ProcessInfo.processInfo.environment
+ guard env[kTaskStateEnv] != nil,
+ let raw = env[kTaskDensityEnv]?.trimmingCharacters(in: .whitespaces), !raw.isEmpty
+ else { return nil }
+ guard let density = Int(raw), kDensityCounts[density] != nil else {
+ fputs("\(kTaskDensityEnv) must be 12 or 24, not \(raw)\n", stderr)
+ exit(2)
+ }
+ return density
+}
// MARK: - Controller
@@ -94,14 +138,23 @@ final class HarnessWindowController: NSObject, NSTextFieldDelegate, NSTableViewD
var size = "none"
var savedNote: String?
var taskStateSequence = 0
+ let taskDensity = taskDensityFromEnvironment()
+ var distractorActions = 0
// Pinned content size — every launch MUST produce a byte-identical window
// so screenshot dimensions (and the hardcoded pixel coords the harness tests
// rely on) never drift.
static let kContentSize = NSSize(width: 720, height: 860)
+ /// The pinned size, widened by the distractor sidebar in density mode.
+ static func contentSize(density: Int?) -> NSSize {
+ guard density != nil else { return kContentSize }
+ return NSSize(width: kContentSize.width + kDistractorPanelWidth, height: kContentSize.height)
+ }
+
override init() {
- let rect = NSRect(origin: NSPoint(x: 100, y: 100), size: HarnessWindowController.kContentSize)
+ let contentSize = HarnessWindowController.contentSize(density: taskDensityFromEnvironment())
+ let rect = NSRect(origin: NSPoint(x: 100, y: 100), size: contentSize)
// No `.resizable`: a resizable window can be left at a different size,
// and macOS would persist/restore that drifted frame on the next launch.
let mask: NSWindow.StyleMask = [.titled, .closable, .miniaturizable]
@@ -118,7 +171,7 @@ final class HarnessWindowController: NSObject, NSTextFieldDelegate, NSTableViewD
// size on every launch so each run is identical.
window.isRestorable = false
window.setFrameAutosaveName("")
- window.setContentSize(HarnessWindowController.kContentSize)
+ window.setContentSize(contentSize)
super.init()
buildContent()
installKeyboardMonitor()
@@ -343,10 +396,23 @@ final class HarnessWindowController: NSObject, NSTextFieldDelegate, NSTableViewD
let container = NSView(frame: window.contentLayoutRect)
container.autoresizingMask = [.width, .height]
content.translatesAutoresizingMaskIntoConstraints = false
+ var contentLeading: CGFloat = 0
+ if let density = taskDensity {
+ // Added first, so the sidebar precedes the content in depth-first
+ // order, as a sidebar does in a typical document app.
+ let panel = distractorPanel(density)
+ container.addSubview(panel)
+ NSLayoutConstraint.activate([
+ panel.topAnchor.constraint(equalTo: container.topAnchor, constant: 12),
+ panel.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: 16),
+ panel.widthAnchor.constraint(equalToConstant: kDistractorPanelWidth - 24),
+ ])
+ contentLeading = kDistractorPanelWidth
+ }
container.addSubview(content)
NSLayoutConstraint.activate([
content.topAnchor.constraint(equalTo: container.topAnchor),
- content.leadingAnchor.constraint(equalTo: container.leadingAnchor),
+ content.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: contentLeading),
content.trailingAnchor.constraint(equalTo: container.trailingAnchor),
content.widthAnchor.constraint(equalToConstant: 700),
])
@@ -387,12 +453,77 @@ final class HarnessWindowController: NSObject, NSTextFieldDelegate, NSTableViewD
content.addArrangedSubview(sizeRow)
}
+ /// Benign distractor controls for density mode (#4312): a grid of buttons,
+ /// labeled text fields, checkboxes, and radio groups. Each radio row is
+ /// its own group (radio buttons group by superview and action).
+ private func distractorPanel(_ density: Int) -> NSStackView {
+ let (buttons, checkboxes, groups, fields) = kDensityCounts[density]!
+ let panel = NSStackView()
+ panel.orientation = .vertical
+ panel.alignment = .leading
+ panel.spacing = 8
+ panel.translatesAutoresizingMaskIntoConstraints = false
+ panel.addArrangedSubview(sectionLabel("jev_use_distractors"))
+ func row() -> NSStackView {
+ let row = NSStackView()
+ row.orientation = .horizontal
+ row.spacing = 8
+ return row
+ }
+ let buttonTitles = Array(kDistractorButtons.prefix(buttons))
+ for start in stride(from: 0, to: buttonTitles.count, by: 4) {
+ let buttonRow = row()
+ for title in buttonTitles[start..<min(start + 4, buttonTitles.count)] {
+ buttonRow.addArrangedSubview(
+ NSButton(title: title, target: self, action: #selector(onDistractor(_:))))
+ }
+ panel.addArrangedSubview(buttonRow)
+ }
+ let fieldRow = row()
+ for title in kDistractorFields.prefix(fields) {
+ // An accessibility label and no placeholder, like the Note field.
+ let field = NSTextField(string: "")
+ field.setAccessibilityLabel(title)
+ field.target = self
+ field.action = #selector(onDistractor(_:))
+ field.translatesAutoresizingMaskIntoConstraints = false
+ NSLayoutConstraint.activate([field.widthAnchor.constraint(equalToConstant: 200)])
+ fieldRow.addArrangedSubview(field)
+ }
+ panel.addArrangedSubview(fieldRow)
+ let checkTitles = Array(kDistractorCheckboxes.prefix(checkboxes))
+ for start in stride(from: 0, to: checkTitles.count, by: 3) {
+ let checkRow = row()
+ for title in checkTitles[start..<min(start + 3, checkTitles.count)] {
+ checkRow.addArrangedSubview(
+ NSButton(checkboxWithTitle: title, target: self, action: #selector(onDistractor(_:))))
+ }
+ panel.addArrangedSubview(checkRow)
+ }
+ for options in kDistractorRadioGroups.prefix(groups) {
+ let radioRow = row()
+ for title in options {
+ let radio = NSButton(radioButtonWithTitle: title, target: self,
+ action: #selector(onDistractor(_:)))
+ radio.state = .off
+ radioRow.addArrangedSubview(radio)
+ }
+ panel.addArrangedSubview(radioRow)
+ }
+ return panel
+ }
+
+ @objc private func onDistractor(_ sender: Any) {
+ distractorActions += 1
+ writeTaskState()
+ }
+
/// Atomically rewrite the app-owned task state. The jev-use task oracle
/// reads this file; it never depends on Cua Driver's own observations.
private func writeTaskState() {
guard let path = taskStatePath else { return }
taskStateSequence += 1
- let state: [String: Any] = [
+ var state: [String: Any] = [
"schema": kTaskStateSchema,
"pid": Int(ProcessInfo.processInfo.processIdentifier),
"seq": taskStateSequence,
@@ -401,6 +532,10 @@ final class HarnessWindowController: NSObject, NSTextFieldDelegate, NSTableViewD
"size": size,
"note_saved": savedNote.map { $0 as Any } ?? NSNull(),
]
+ if let density = taskDensity {
+ state["density"] = density
+ state["distractor_actions"] = distractorActions
+ }
do {
let data = try JSONSerialization.data(withJSONObject: state, options: [.sortedKeys])
try data.write(to: URL(fileURLWithPath: path), options: .atomic)
diff --git a/rfcs/4268-jev-use-native-candidates.md b/rfcs/4268-jev-use-native-candidates.md
index 2fc0e2d83c..12c93a4093 100644
--- a/rfcs/4268-jev-use-native-candidates.md
+++ b/rfcs/4268-jev-use-native-candidates.md
@@ -4,7 +4,7 @@ authors:
- f-trycua
created: 2026-09-27
last_updated: 2026-09-29
-status: accepted
+status: completed
discussion: https://github.com/trycua/cua/issues/4268
rfc_pr: https://github.com/trycua/cua/pull/4269
implementation:
@@ -17,6 +17,8 @@ implementation:
- https://github.com/trycua/cua/pull/4301
- https://github.com/trycua/cua/pull/4299
- https://github.com/trycua/cua/pull/4324
+ - https://github.com/trycua/cua/pull/4329
+ - https://github.com/trycua/cua/pull/4330
supersedes:
superseded_by:
---
@@ -360,7 +362,12 @@ risky-action policy, caps the executable candidates at 24, and appends
`reobserve` and `abstain`. The limit of 24 plus 2 fits the S1 26-option limit
and the v1 schema's 32-candidate limit. A step that would exceed the cap
drops the lowest-priority candidates and records the count dropped in the log.
-It never truncates silently.
+It never truncates silently. Priority is by task relevance
+([#4312](https://github.com/trycua/cua/issues/4312)): candidates that perform
+the task's declared steps first, then controls whose label shares a word with
+the goal, then the rest, each tier in depth-first order. The kept candidates
+are still presented in depth-first order, and a set within the cap is
+unchanged.
### Task spec
@@ -757,9 +764,12 @@ TypeScript parity in the same change.
`max_elements`, and task-supplied `query` when the task names its controls.
Is a task-supplied subtree anchor also needed, given that `query` matching is
substring-only?
-- **Accuracy at scale.** Jev and S1 accuracy with about 24 candidates, compared
- with about 4 today. Should the composer rank by task relevance before capping,
- or keep strict depth-first order for determinism?
+- **Resolved: accuracy at scale.** Jev and S1 chose correctly in every live
+ decision at about 4, 12, and 24 candidates on macOS and Linux. The composer
+ ranks by task relevance before capping and keeps depth-first presentation
+ order; strict depth-first capping dropped every task control behind the
+ distractors and led both models to press look-alike controls (see the
+ #4312 evidence in the decision record).
- **Electron and Catalyst.** These report misleading accessibility values. The
proposal excludes `in_web_content` elements from the native source. Should
Electron applications with a reachable CDP endpoint route through the browser
@@ -929,5 +939,75 @@ run recorded and verified by the harness's own state file):
422 / 4249 / 45 ms for S1. Another client shared the S1 service during the
run, which roughly doubled its decide time relative to the WPF run.
-Acceptance criteria not yet met, which keep this RFC `accepted`: accuracy at
-about 12 and 24 candidates.
+Accuracy at about 12 and 24 candidates, [#4330](https://github.com/trycua/cua/pull/4330)
+for [#4312](https://github.com/trycua/cua/issues/4312) (released Driver 0.30.4
+from the canonical installers, `cua-s1-4b-0.2@16818868`, Python runners; each
+run verified by the harness's own state file):
+
+- The AppKit and GTK3 harnesses gained an opt-in `CUA_<HARNESS>_TASK_DENSITY`
+ of `12` or `24`, in task mode only. It adds benign distractors before the
+ task controls, the way a toolbar and sidebar precede the content in a
+ document app: buttons, labeled text fields, checkboxes, and radio groups
+ with the same labels on both platforms. None matches a risk phrase. Some are
+ unrelated to every task; some are close to a task control ("Save draft",
+ "Increase font size", "Note title", "Large icons"). Density 12 gives 11 to 16
+ candidates. Density 24 makes 28 to 33 eligible, so the cap binds at 24 plus
+ `reobserve` and `abstain`. Ordinary launches and the existing task mode are
+ unchanged. WPF and WinUI3 have no density mode yet, so Windows was not
+ measured.
+- The runners log each decision's due steps (`expected_ids`) and whether the
+ set offered one. `measure_native.py` scores those logs, or replays captured
+ fixtures offline, into a table by set size, including the full set with the
+ two reserved candidates: `~4` (up to 8), `~12` (9 to 18), and `~24`.
+- Live, recorded (the first repetition of every row has a video): 5
+ repetitions × 3 tasks × 3 densities × 2 providers per platform. All 180 runs
+ passed, and all 420 decisions were correct:
+
+ | Provider | Size | Platform | Candidates | Decisions | Correct | Confidence median / min | Decide median / p95 |
+ | -------- | ---- | -------- | ---------- | --------- | ------- | ----------------------- | ------------------- |
+ | Jev | ~4 | macOS | 5–7 | 35 | 35 | 1.00 / 0.95 | 240 / 331 ms |
+ | Jev | ~4 | Linux | 4–6 | 35 | 35 | 0.99 / 0.94 | 209 / 294 ms |
+ | Jev | ~12 | macOS | 11–16 | 35 | 35 | 0.99 / 0.96 | 232 / 288 ms |
+ | Jev | ~12 | Linux | 11–14 | 35 | 35 | 1.00 / 0.96 | 197 / 255 ms |
+ | Jev | ~24 | macOS | 26 | 35 | 35 | 0.99 / 0.94 | 242 / 286 ms |
+ | Jev | ~24 | Linux | 26 | 35 | 35 | 0.99 / 0.94 | 212 / 288 ms |
+ | S1 | ~4 | macOS | 5–7 | 35 | 35 | 0.83 / 0.65 | 4.5 / 7.0 s |
+ | S1 | ~4 | Linux | 4–6 | 35 | 35 | 0.91 / 0.70 | 5.5 / 7.7 s |
+ | S1 | ~12 | macOS | 11–16 | 35 | 35 | 0.89 / 0.59 | 5.2 / 7.5 s |
+ | S1 | ~12 | Linux | 11–14 | 35 | 35 | 0.88 / 0.57 | 6.7 / 8.9 s |
+ | S1 | ~24 | macOS | 26 | 35 | 35 | 0.81 / 0.68 | 7.5 / 9.8 s |
+ | S1 | ~24 | Linux | 26 | 35 | 35 | 0.81 / 0.65 | 9.3 / 11.2 s |
+
+ S1 decide times include queueing: an offline replay and another client
+ shared the one S1 service during these runs. Its lowest confidence at the
+ cap stayed at 0.65, close to the 0.65 to 0.70 seen at about 4.
+- Offline replay of the captured AppKit and GTK3 fixtures (5 capture IDs per
+ decision point, 7 decision points per platform, 1,120 decisions): with
+ relevance capping, Jev was correct in 420/420 and S1 in 419/420. The one S1
+ miss was a `model_error` at a base-size choose-size step, where Large and
+ I agree are both correct. Shuffling the offered candidates into a seeded
+ random order changed nothing else, so position does not drive the choice.
+- Strict depth-first capping at density 24 kept only distractors in every one
+ of 140 decision points: the due step was never offered. Jev then abstained
+ or reobserved in 96 of 140 decisions, but pressed a wrong control in 44,
+ mostly the look-alikes "Large icons" and "Save draft". S1 pressed a wrong
+ control in 137 of 140 and never abstained; the other 3 were model errors. Its median confidence was 0.26
+ to 0.31, compared with 0.82 to 0.86 with relevance capping.
+- Decision: rank by task relevance before capping. Tier 0 is a candidate that
+ performs a declared step or clicks a declared visual target. Tier 1 is a
+ control whose label shares a word with the goal. Tier 2 is everything else,
+ and each tier keeps depth-first order. The kept candidates are presented in
+ depth-first order, so ranking decides only which candidates survive. The
+ ranking uses only task-authored text and labels, never values, and it is
+ deterministic. A set within the cap is unchanged, so the ordinary AppKit,
+ WPF, WinUI3, and GTK3 tasks send the same requests as before, and the
+ browser path, which does not use this composer, still sends byte-identical
+ v1 requests. A task with no declared steps and a goal that names no control
+ still falls back to depth-first order.
+- CI: jev-use now also runs the AppKit and GTK3 tasks at density 24 with the
+ mock provider.
+
+All acceptance criteria have shipped, so this RFC is `completed`. The TypeScript
+runners share the composer and the logging, and golden candidate sets pin
+Python and TypeScript to the same result, but the live accuracy rows above ran
+the Python runners only.