Skip to content

Independence 4: cua's own native accessibility engine (replace sky) measured against a native baseline #117

Open
11 of 29 issues completed

Description

@SSFSKIM

Purpose

Child 4 of the independence composite, the last and hardest. The native macOS engine (@oai/sky, "Codex Computer Use.app": accessibility tree reading, element search and naming, input, screenshots, the TCC identity the user approved) and its Linux counterpart (sky_linux) are the vendor's, and they set the quality of the accessibility-based JS API the owner requires (2026-10-13: a screenshot loop is only ever a fallback).

Goal

cua's own native engine behind the same sky service contract: on macOS a Swift helper over the Accessibility API (the Keychain helper and the N-API peer-auth addon are the precedents), on Linux AT-SPI, with element search, naming and action semantics measured against the vendor's on a recorded native baseline. Screenshot-and-coordinates stays as the fallback path, never the primary.

Acceptance

A native baseline (the native acceptance script's items plus a timed scenario set on the owner's apps: TextEdit, Finder, Chrome's chrome, a Catalyst app) recorded against the vendor engine first; the replacement meets every item; clean-machine and TCC acceptance in the VM (#9's gate) pass with cua's own helper as the TCC identity; no regression in element search latency or naming accuracy; README, spec, plugin bump.

Open

Whether to start with a spike that measures how far a Swift AX helper is from sky on the baseline before committing; the Linux engine's scope.

Sub-issues

Sub-issues

11 of 29 Issues completed
Loading 29 sub-issues

Activity

  1. added
    enhancement
    status:ready-for-architect
    priority:P1
    on Oct 13, 2026
  2. SSFSKIM commented on Oct 14, 2026

    @SSFSKIM
    OwnerAuthor

    Scope addition from #116's design (2026-10-14): the macOS native helper only accepts the vendor node_repl as a socket peer (see #114's comment of today), so the switch of macOS computer-surface sessions from the vendor node_repl to cua's own REPL host (#116) is part of #117: once cua's own engine replaces the helper, #116's host serves every session. The macOS native baseline to measure against is PR #133 (docs/evidence/2026-10-14-native-baseline).

  3. SSFSKIM commented on Oct 17, 2026

    @SSFSKIM
    OwnerAuthor

    Design paused by the owner on 2026-10-17, after research and two rounds of answers; nothing built.

    Owner's rulings so far:

    • Distribution is public open source.
    • The owner has, or will create, an Apple Developer account, so the engine app is Developer ID-signed, notarized and prebuilt.
    • Comparison covers every ordinary GUI app and the browser (Electron, Apple apps, Catalyst, Chrome's own UI, web content). Any ordinary app must show no difference from sky in performance, accuracy or capability.
    • Beyond parity, the engine must beat sky on three points: speed, finding elements, and not interfering. 'Interfering' means the driven app's window jumping to the front, so the user's front window must stay in front.
    • The public name and bundle id are settled before the signed-release milestone; development uses a provisional id. trycua/cua shares the name.

    Research facts that shape the design:

    • cua reaches 11 macOS sky methods.
    • The wire is JSON-RPC 2.0 with a 4-byte length prefix, over a Unix socket in the vendor's App Group container. The helper accepts only peers descended from the vendor node_repl.
    • Per-connection approval memory lives in the vendor Rust host today, so cua must own it.
    • The helper renders the AX text: localized role descriptions, diff by default.
    • From its symbols, the helper appears to use private SkyLight calls (resolved at run time) for background input, and ScreenCaptureKit for capture.
    • Its TCC identity is bundle id plus team id.
    • The GTK 3.24 accessible PasteText use-after-return explains the gedit crash.

    trycua cua-driver (MIT): the evaluation recommends writing cua's own engine around the sky contract and copying separable MIT modules with attribution, not pinning or vendoring it. Possibly Rust on both platforms. The reasons:

    • its index and naming model differs from sky's;
    • select_text, named actions and HTML paste are missing;
    • its contract changes fast (10 breaking prereleases in 3 months);
    • PostHog telemetry is on by default.

    Open on resume:

    • the engine's origin and language;
    • the Linux scope (later milestones vs a sibling ticket);
    • a measured spike as the first milestone (recommended).

    The research reports are local to the coordinating session: ~/.claude/jobs/1ea561bc/tmp/117/ (A-contract, B-helper (partial), C-macos-prior-art, C-linux, D-cua-driver).

  4. SSFSKIM commented on Oct 17, 2026

    @SSFSKIM
    OwnerAuthor

    Owner ruling (2026-10-17): no unvetted third-party open source in the engine. Popularity, such as trycua cua-driver's ~30k stars, is not vetting. This supersedes the cua-driver evaluation's recommendation to copy its MIT modules: the engine takes no code from cua-driver, Peekaboo, AXorcist or similar projects, and none of them is a dependency. The engine is written by cua against the sky contract, Apple's documented APIs and cua's own measurements. General platform facts gathered in research stay usable as domain knowledge: which public and private macOS APIs exist, the GTK 3.24 PasteText defect, and TCC's signing rules.

  5. SSFSKIM commented on Oct 17, 2026

    @SSFSKIM
    OwnerAuthor

    Owner ruling (2026-10-17, later the same day): this reverses the public open-source ruling above. cua stays an internal research project for the owner's own machines, and the clean-room rewrite (#120) is not current work.

    What this changes for #117:

    • Signing serves the owner's machines only. A stable local signing identity, such as a self-signed code-signing certificate on each Mac, keeps TCC grants across rebuilds. Developer ID signing and notarization are no longer a requirement.
    • The public-name question is moot for now.

    Unchanged:

    • no unvetted third-party open source in the engine;
    • parity with sky on every ordinary GUI app and the browser;
    • the three ways the engine must beat sky: speed, finding elements, and keeping the user's front window in front.
  6. SSFSKIM commented on Oct 18, 2026

    @SSFSKIM
    OwnerAuthor

    Owner ruling (2026-10-18, after #115 finished): keep #117 paused. Nothing resumes until the owner says so.

  7. SSFSKIM commented on Oct 18, 2026

    @SSFSKIM
    OwnerAuthor

    Owner resumed the design on 2026-10-18 (sminos: let's start the remaining sky work's design again). The pause above is lifted. The design restarts from the paused state: the rulings and research facts recorded here stand; the open items are the engine's origin and language, the Linux scope, and a measured spike as the first milestone. The confirmed remaining vendor pieces at run time: macOS Codex Computer Use.app (the engine), @oai/sky's JS client and policy modules behind src/services/sky.mjs, and the vendor node_repl (kept only because the helper accepts no other peer; it also holds the per-connection approval memory); Linux sky_linux and its JS client. Ported JS (src/cua-api, src/browser-service) is #120's, deferred.

  8. SSFSKIM commented on Oct 18, 2026

    @SSFSKIM
    OwnerAuthor

    Owner rulings (2026-10-18, on resume):

    • Linux is in scope, but macOS goes first; the Linux engine (sky_linux's replacement) is a separate ticket opened after macOS lands, under the same contract.
    • Signing identity for TCC stability across rebuilds: the owner's Apple Development certificate (one identity on every Mac; the mini imports it once).
    • App approvals: the engine keeps asking 'Allow Computer Use to use X?' once per connection per app as the default, on macOS and Linux alike; the plugin's Elicitation hook (hooks/cua-approve.sh) answers, so no dialog shows, and a stricter hook can veto. Approval memory moves into cua's JS service layer (the per-connection trusted worker). No cross-connection persistence store.
    • The core requirement: no performance drop across the replacement, proven by a rigorous equivalence verification system (engine-axis baseline harness, differential suites, unit tests) before any default switch.
    • Approach: not from scratch. Start by reading the pinned helper (26.928.40906's Codex Computer Use.app, bundle 26.924, which still carries its symbol table; the installed ChatGPT 26.1013 build's helper is stripped to about 1.5k symbols) as far as it can be read, and reimplement from those findings plus Apple's documented APIs and black-box measurement. Clean-room (Independence: clean-room rewrite of the ported browser service before distribution (removes the derivation from the readable vendor tree) #120) stays deferred; whatever the engine derives from the helper joins Independence: clean-room rewrite of the ported browser service before distribution (removes the derivation from the readable vendor tree) #120's list.
  9. added
    status:in-design
    and removed
    status:ready-for-architect
    on Oct 18, 2026
  10. SSFSKIM commented on Oct 18, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-design: Design resumed 2026-10-18 in the coordinating session (maws-3f). M0 tier-1 static reading of the pinned helper is running; the owner's answers on the M0 shape, Ghidra, the scenario apps and the element-finding criterion are pending; the spec is written after them.

  11. 306 remaining items

  12. added
    status:ready-for-architect
    and removed
    status:in-progress
    on Nov 23, 2026
  13. SSFSKIM commented on Nov 23, 2026

    @SSFSKIM
    OwnerAuthor

    [board-epic] ready-for-architect: recomposition-due: all children terminal

  14. added
    status:in-design
    and removed
    status:ready-for-architect
    on Nov 23, 2026
  15. SSFSKIM commented on Nov 23, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-design: epic: child #505 active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:P1status:in-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions