Skip to content

ci(cua-driver): automated lane for the interactive modality #[ignore] suite - #2060

Merged
f-trycua merged 4 commits into
mainfrom
ci/cua-driver-interactive-modality-lane
Jun 27, 2026
Merged

ci(cua-driver): automated lane for the interactive modality #[ignore] suite#2060
f-trycua merged 4 commits into
mainfrom
ci/cua-driver-interactive-modality-lane

Conversation

@f-trycua

@f-trycua f-trycua commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Why

The harness/modality integration tests are #[ignore] — they need a display, the AT-SPI bus, and the GTK3 harness. So the rest of CI only compiles them; their behavioral signal has come from manual VM/host runs at a point in time, not continuous protection. This was called out as the single biggest gap in the desktop-scope confidence review.

What

A Linux job that actually runs them on every cua-driver change:

  • modality_capture_mode_test (ax→tree-only / vision→image-only / som→both)
  • modality_desktop_scope_linux_test (window-less screen-absolute click via XTest + the desktop_scope_disabled gate)

The GUI session is provided headlessly: Xvfb (display) + a per-job D-Bus session bus (so AT-SPI org.a11y.Bus auto-activates) + at-spi2-core (bridge) + GTK3/PyGObject (harness runtime). An AT-SPI reachability probe prints up front for visibility.

Honest framing

The tests skip-with-note when the a11y bus is unavailable rather than false-failing, so a vacuous run is visible (no green-for-nothing). This PR's own run is the experiment: it tells us whether headless AT-SPI is viable on GitHub runners, or whether this coverage must live in the Nix desktop sessions (nix-wayland.yml) instead. If the AT-SPI probe + the ax/som assertions come back real (not skipped), we have the lane; if not, the follow-up is a Nix-session check.

Runs on free runners, path-filtered to the Rust driver + harness, plus push-to-main and manual dispatch. Companion to — not a replacement for — nix-build.yml / nix-wayland.yml.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a Linux CI check for the app’s interactive test flow in a headless desktop environment.
    • Test runs now save video and log artifacts for easier review when issues occur.

… suite

The harness/modality integration tests are `#[ignore]` — they need a display,
the AT-SPI bus, and the GTK3 harness, so the rest of CI only COMPILES them and
their behavioral signal came from manual VM/host runs. This adds a Linux job
that actually RUNS them, so behavior is guarded on every cua-driver change:

  - modality_capture_mode_test        (ax→tree-only / vision→image-only / som→both)
  - modality_desktop_scope_linux_test (window-less screen-absolute click + gate)

Session is provided headlessly: Xvfb for the display, a per-job D-Bus session
bus so AT-SPI's `org.a11y.Bus` auto-activates, at-spi2-core for the bridge, and
the GTK3/PyGObject runtime for the harness. The tests skip-with-note when the
a11y bus is unavailable (rather than false-failing), so a vacuous run is visible
without breaking the build — and this PR's own run is the experiment that tells
us whether headless AT-SPI is viable here or whether this coverage must live in
the Nix desktop sessions (nix-wayland.yml) instead.

Runs on free GitHub runners, path-filtered to the Rust driver + harness, plus
push-to-main and manual dispatch. Companion to — not a replacement for —
nix-build.yml / nix-wayland.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Jun 27, 2026 3:43am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad1d1851-8691-4362-9faf-c9ab636e13cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a GitHub Actions job for the Linux interactive modality harness. It installs GUI/accessibility dependencies, builds the Rust driver and GTK3 harness, runs the interactive tests under Xvfb and D-Bus, and uploads MP4 and log artifacts.

Changes

Interactive Linux CI workflow

Layer / File(s) Summary
Workflow triggers and job definition
.github/workflows/ci-cua-driver-interactive-linux.yml
Sets the workflow name, trigger paths, repository permissions, job name, runner, and timeout for the interactive Linux lane.
Dependency install and release build
.github/workflows/ci-cua-driver-interactive-linux.yml
Installs GUI, accessibility, and Rust build dependencies, configures Cargo caching, and builds cua-driver in release mode.
Harness build and test execution
.github/workflows/ci-cua-driver-interactive-linux.yml
Builds the GTK3 harness, writes the AT-SPI probe, and runs the ignored interactive targets inside xvfb-run and dbus-run-session with accessibility variables set.
Artifact upload
.github/workflows/ci-cua-driver-interactive-linux.yml
Uploads MP4 recordings and driver release logs with unconditional cleanup behavior and 7-day retention.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • trycua/cua#2053: Adds the Linux interactive CI lane for the Rust cua-driver interactive modality path.

Poem

I’m a rabbit in the Linux glow,
Hopping where the GTK wind blows.
Xvfb hums, and the buses sing,
While MP4 carrots take wing. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the new CI lane for the cua-driver interactive modality ignored test suite.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/cua-driver-interactive-modality-lane

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci-cua-driver-interactive-linux.yml:
- Around line 58-59: The Rust toolchain step is using a floating action
reference, so update the dtolnay/rust-toolchain usage in the workflow to an
immutable commit SHA like the other third-party actions. Keep the step name and
behavior the same, but replace the `@stable` reference in the Rust toolchain
action with a pinned SHA so the workflow stays deterministic.
- Around line 46-47: The Checkout step in this workflow leaves repository
credentials available to later commands, which is unnecessary for this job.
Update the actions/checkout usage to disable persisted credentials by setting
persist-credentials to false, keeping the existing Checkout step and its
surrounding build/test steps unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5be44d6f-4230-4e8f-98bb-41599476be35

📥 Commits

Reviewing files that changed from the base of the PR and between af2255c and 950b698.

📒 Files selected for processing (1)
  • .github/workflows/ci-cua-driver-interactive-linux.yml

Comment on lines +46 to +47
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable persisted checkout credentials.

This job runs repository-controlled code after checkout (bash libs/cua-driver/test-harness/build/linux.sh, cargo build, cargo test), so leaving the workflow token in the local git config widens the blast radius if those steps are compromised. Set persist-credentials: false on actions/checkout.

Suggested change
       - name: Checkout
         uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+        with:
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 46-47: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-cua-driver-interactive-linux.yml around lines 46 - 47,
The Checkout step in this workflow leaves repository credentials available to
later commands, which is unnecessary for this job. Update the actions/checkout
usage to disable persisted credentials by setting persist-credentials to false,
keeping the existing Checkout step and its surrounding build/test steps
unchanged.

Comment on lines +58 to +59
- name: Rust toolchain
uses: dtolnay/rust-toolchain@stable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Pin dtolnay/rust-toolchain to an immutable commit SHA.
@stable is a floating ref, so this workflow can change behavior outside review. Pin it the same way as the other third-party actions in this file.

🧰 Tools
🪛 zizmor (1.26.1)

[error] 59-59: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-cua-driver-interactive-linux.yml around lines 58 - 59,
The Rust toolchain step is using a floating action reference, so update the
dtolnay/rust-toolchain usage in the workflow to an immutable commit SHA like the
other third-party actions. Keep the step name and behavior the same, but replace
the `@stable` reference in the Rust toolchain action with a pinned SHA so the
workflow stays deterministic.

…se race

The Linux video run surfaced a cold-start race: the test clicks within ~1.5s of
launching the GTK3 harness, before some WMs (XFCE/Openbox) raise the
freshly-mapped window under the pointer — so the screen-absolute XTest click
misses the first attempt and the counter stays 0 (`pre=0 post=0`). The feature
is correct (recorded landing the click + the counter climbing 0→1→2→3); only the
test was too eager, and its retry loop re-fetched the button frame but not the
click.

Retry the window-less click until the counter advances (12×500ms). Re-issuing
the same click is safe — extra landed clicks only increment further, and
`post > pre` still holds. Still asserts the first attempt was dispatched as
desktop scope, and that it lands within the budget. Also makes this test
reliable under the new headless interactive CI lane (Xvfb window-raise timing).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@f-trycua

Copy link
Copy Markdown
Collaborator Author

Bundled a robustness fix surfaced by the Linux video run: modality_desktop_scope_linux_test had a cold-start window-raise race (it clicked within ~1.5s, before XFCE/Openbox raised the freshly-mapped harness window under the pointer, so the first XTest desktop click missed). Now retries the window-less click until the counter advances (12×500ms) — which also makes it reliable under this lane's Xvfb window-raise timing. The feature itself was verified on camera (counter 0→1→2→3).

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Linux visual regression artifacts

Matrix jobs now run independently. Download visual artifacts from this workflow run.
Each background-GUI job uploads a .gif of the interaction plus two annotated PNGs (<app>.png raw, <app>-atspi.png with AT-SPI element boxes); the cua-driver-linux-som-overlays artifact adds <app>-som.png cua Set-of-Marks overlays:

  • cua-driver-linux-cursor-click-gif
  • cua-driver-linux-background-terminal-gif
  • cua-driver-linux-parallel-drag-xserver
  • cua-driver-linux-background-gui-chromium
  • cua-driver-linux-background-gui-tk
  • cua-driver-linux-background-gui-gtk3-gedit
  • cua-driver-linux-background-gui-gtk3-mousepad
  • cua-driver-linux-background-gui-gtk3-scite
  • cua-driver-linux-background-gui-gtk4-characters
  • cua-driver-linux-background-gui-qt5-manuskript
  • cua-driver-linux-background-gui-qt5-klog
  • cua-driver-linux-background-gui-qt5-openambit
  • cua-driver-linux-background-gui-qt6-kate
  • cua-driver-linux-background-gui-qt6-kcalc
  • cua-driver-linux-background-gui-qt6-okular
  • cua-driver-linux-background-gui-qt6-qownnotes
  • cua-driver-linux-background-gui-electron-zettlr
  • cua-driver-linux-background-gui-electron-joplin
  • cua-driver-linux-background-gui-electron-logseq
  • cua-driver-linux-som-overlays

Open workflow run and download artifacts

f-trycua and others added 2 commits June 26, 2026 20:36
First run proved headless AT-SPI works — the capture_mode matrix passed with
real assertions (ax→tree-only / vision→image-only / som→both). The desktop-scope
test failed because bare Xvfb has no window manager, so the freshly-mapped GTK3
harness window is never raised/focused and the screen-absolute XTest click can't
land (button at (62,56), counter stayed 0 through all retries). Launch openbox
(the same WM the Nix tests use) under Xvfb before the suite so the window is
managed; the capture_mode tests are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two CI runs proved the split: headless Xvfb+AT-SPI runs the capture_mode matrix
(ax/vision/som) with real assertions, and the desktop-scope GATE
(desktop_scope_disabled). The desktop-scope *landing* (counter advances on a
window-less screen-absolute click) needs a real display + WM to deliver the
XTest click — even with openbox, Xvfb doesn't faithfully deliver it (the click
never lands, button at a sensible 812,343). That assertion is covered on real
desktops (the Azure GNOME VM run + the recorded mp4) and is a follow-up for a
real-session Nix lane. Scope this lane to the headless-reliable subset so it is
green + meaningful rather than red on an environment limitation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@f-trycua
f-trycua merged commit 86913e2 into main Jun 27, 2026
72 checks passed
@f-trycua
f-trycua deleted the ci/cua-driver-interactive-modality-lane branch June 27, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant