Skip to content

feat(bot-computers): add Linux systemd driver, AT-SPI roles, tools, and Chromium sign-in (F3) - #943

Open
sambitcreate wants to merge 10 commits into
pr/a2-cua-driverfrom
pr/f3-linux-driver-tools-signin
Open

sambitcreate wants to merge 10 commits into
pr/a2-cua-driverfrom
pr/f3-linux-driver-tools-signin

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

Summary

  • Adds the Linux arm64 guest cua-driver 0.38.0 installer & systemd --user service unit (guest-driver-install.ts, guest-driver.ts), mapping Linux x11/atspi readiness checks with XAUTHORITY and zero macOS TCC permission prompts (gated behind AIDEN_BOT_COMPUTERS_LINUX).
  • Adds Linux AT-SPI password role classification (classify.ts), aiden-bot unprivileged shell execution (computer-shell-tool.ts), Command→Ctrl chord mapping (computer-tool.ts), and Chromium sign-in handoff (bot-computer-handoff.ts) that stops all aiden-bot processes + suspends the driver and launches Chromium with full DISPLAY/XAUTHORITY/XDG_RUNTIME_DIR/DBUS_SESSION_BUS_ADDRESS/ACCESSIBILITY_ENABLED/GNOME_ACCESSIBILITY env.
  • Plan reference: docs/plans/linux-desktop-bots-plan.md (PR 6 / F3).

Stack

Verification

  • npm run test:bot-sign-in: 21/21 pass
  • tsx --test main/services/bot-computers/{guest-driver-install,guest-driver,computer-tool,computer-shell-tool}.test.ts main/services/bot-rules/classify.test.ts main/services/bot-runtime/bot-computer-tools.test.ts: 80/80 pass
  • eslint on modified .ts/.tsx/.mjs files: 0 issues
  • Live Mac Studio (SambitscStudio2): botComputerSignInOpenScript("https://example.com") launched Chromium on a fresh VM and cua-driver get_window_state / ComputerUseController (mode: "ax") returned 52 live AT-SPI elements.
  • Adversarial audit: 0 remaining P0/P1/P2 findings.

Remaining checks

  • Hosted GitHub Actions CI run on this PR head.
  • Interactive light/dark Settings & sign-in UI screenshots on owner Mac.

@pullfrog pullfrog 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.

Important

Read-only AT-SPI text controls can currently suppress delete-intent classification; preserve editability explicitly or classify ambiguous roles conservatively before merging.

Reviewed changes across the complete 25-file diff, including the Linux guest-driver lifecycle, Bot tools, AT-SPI policy mapping, and Chromium sign-in handoff.

  • Linux driver lifecycle — Adds pinned Linux arm64 installation, systemd --user service management, X11/AT-SPI readiness, and bridge/suspend behavior.
  • Computer tools — Runs shell commands as aiden-bot, updates Linux-facing schemas and guidance, and maps Command/cmd input to Ctrl.
  • Sign-in isolation — Suspends the desktop driver, terminates shell-user processes, and opens Chromium with the desktop session environment.
  • AT-SPI policy — Recognizes password roles across secure-field capture, Bot rules, and approval facts, with one editability-classification issue inline.
  • Verification — Focused changed-surface tests passed after building the documented lease helper prerequisite, and npm run type-check passed.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

@pullfrog pullfrog 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.

Important

The incremental fix still depends on element fields the pinned runtime does not emit, and its new behavioral test is not assigned to CI.

Reviewed changes since the prior Pullfrog review, focusing on the attempted AT-SPI editability fix and its runtime/test contracts.

  • Propagated editability — Added an optional element editability fact sourced from a driver boolean or AT-SPI-style state strings.
  • Constrained ambiguous roles — Required explicit editability before treating Linux text and entry roles as text input for Backspace/Delete classification.
  • Expanded behavioral coverage — Added parser, Computer Use, and Bot-tool cases for editable and read-only AT-SPI controls.
  • Merged the updated base — Incorporated the latest pr/a2-cua-driver head before the editability fix.

⚠️ New behavioral test is not assigned to CI

The repository's registry gate reports main/services/bot-computers/computer-elements.test.ts as unassigned, so the PR's CI test-registry check fails even though the focused test itself passes.

Technical details
# Register the new element-capture test

## Affected sites
- `main/services/bot-computers/computer-elements.test.ts:1` — new behavioral suite has no CI registry assignment.
- `scripts/ci-test-registry.json` — the Bot-computers lane does not include the new file.

## Required outcome
- Assign the new test file to the appropriate CI lane.
- Make `node --test scripts/ci-test-registry.test.mjs` pass.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment on lines +2354 to +2363
{ role: "entry", label: "Search", editable: true, frame: { x: 110, y: 60, w: 80, h: 20 }, depth: 1 },
{ role: "entry", label: "Static entry", editable: false, frame: { x: 110, y: 90, w: 80, h: 20 }, depth: 1 },
{
role: "text",
label: "Editable text",
states: ["focusable", "ATSPI_STATE_EDITABLE"],
frame: { x: 110, y: 120, w: 80, h: 20 },
depth: 1,
},
{ role: "text", label: "Read-only text", states: ["focusable"], frame: { x: 110, y: 150, w: 80, h: 20 }, depth: 1 },

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.

These fixtures assume the pinned Linux driver emits editable or states, but cua-driver 0.38.0 emits neither field in get_window_state element records. In production every ambiguous text/entry therefore remains unknown, so Backspace/Delete in a real editable field becomes a destructive press; update the pinned contract or base this distinction on data that version actually emits.

Technical details
# Pinned driver cannot supply the new editability fact

## Affected sites
- `main/services/computer-use/computer-use-tool.test.ts:2354-2363` — fabricates fields absent from pinned 0.38.0 output.
- `main/services/computer-use/controller.ts:634-639` — parses only those unsupported fields.
- `main/services/bot-runtime/bot-computer-approval.ts:36` — requires the resulting fact for ambiguous roles.

## Required outcome
- Preserve the conservative `press` path for read-only controls while retaining text-edit classification for genuinely editable `ROLE_TEXT`/`ROLE_ENTRY` controls using a field the pinned runtime supplies, or update the pinned runtime to emit an explicit editability field.
- Cover the production 0.38.0 element shape rather than only synthetic parser inputs.

## Contract evidence
- [Pinned `AtspiNode`](https://github.com/trycua/cua/blob/cua-driver-rs-v0.38.0/libs/cua-driver/rust/crates/platform-linux/src/atspi/mod.rs) has no editability or state member.
- [Pinned `build_element_entry`](https://github.com/trycua/cua/blob/cua-driver-rs-v0.38.0/libs/cua-driver/rust/crates/platform-linux/src/tools/impl_.rs#L686-L756) emits role, value, enabled, selected, actions, and geometry, but no `editable` or `states`.

@pullfrog pullfrog 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.

Important

The CI registration gap is fixed, but the new field-derived heuristic does not resolve the existing AT-SPI editability blocker; the original threads remain open.

Reviewed changes since the prior Pullfrog review, covering the updated pinned-driver inference and CI assignment.

  • Replaced unsupported editability fields — Derived retained editability from cua-driver 0.38.0's emitted role, enabled, selected, and non-empty value fields while continuing to discard field values.
  • Expanded production-shape coverage — Reworked parser and end-to-end Bot-tool fixtures around the fields emitted by the pinned driver.
  • Registered the new suite — Assigned computer-elements.test.ts to the runtime-subagents CI lane and restored a passing registry gate.
  • Merged the updated base — Incorporated the latest pr/a2-cua-driver changes into the feature branch.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

@pullfrog pullfrog 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.

Important

The new fail-closed policy fixes the read-only false negative, but the existing pinned-runtime thread remains open: genuine editable entry/text controls are still indistinguishable in cua-driver 0.38.0 and therefore take the destructive-policy path for Backspace/Delete.

Reviewed changes since the prior Pullfrog review, covering the final editability-policy revision and its behavioral coverage.

  • Removed unsafe inference — Stopped deriving editability from AT-SPI role or value and now leaves ambiguous entry/text controls on the conservative press path.
  • Preserved explicit capability support — Retained an explicit driver editable boolean when available while continuing to strip element values from Bot facts.
  • Updated production-shape coverage — Reworked parser and end-to-end Bot-tool cases to verify value-bearing and read-only 0.38.0 records fail closed without regressing password-role handling.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

This branch has not been deployed

No deployments
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