Skip to content

Phase F: Linux pins (x64, arm64) and Linux acceptance on a Tart arm64 Ubuntu VM - #57

Merged
SSFSKIM merged 40 commits into
mainfrom
feat/phase-f
Oct 6, 2026
Merged

SSFSKIM merged 40 commits into
mainfrom
feat/phase-f

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Closes #51

Phase F of docs/doperpowers/specs/2026-10-06-remote-and-linux-design.md. cua now has pinned Linux runtimes and runs on the owner's Tart arm64 Ubuntu 24.04 VM: cua install takes the vendor's deb, cua doctor passes, cua serve over stdio gives the same tools, and the ChatGPT extension starts cua's Linux Chrome host. On macOS nothing changes; the whole-branch review checked darwin output against 87f39f3.

  • F1, Linux pins. Two pins (runtime/releases/26.928.40906-linux-{x64,arm64}.json) keyed by {platform, arch}. Each deb's _gpgorigin signature verifies against vendor key 3BFA0E4A…, and the result is recorded in the pin's notes.
  • Platform branches. The branches the spec names are all in: deb extraction with a missing_tool check, the XDG home, the Linux launch environment and bus derivation, and the doctor rows display, accessibility.bus and sandbox.userns. The skip status was added here and is shared with Phase E. Also: Chrome registration paths through browsersFor, secrets_unsupported_platform, Linux host notes and search hints, and Linux branches in countLiveHosts, profiles open and verify.mjs.
  • F2, acceptance on the VM, items 8–12. Results are in docs/evidence/2026-10-06-linux-acceptance.md, the README has a new "Linux" section, and there are fixtures to re-run items 9 and 10 (scripts/accept/linux-native.mjs, scripts/accept/linux-chrome.mjs).
  • Sandbox, decided during execution (Decision Log, ### Phase F). The vendor's scoped sandbox fails open under Ubuntu's default userns restriction, and where it does work it refuses every socket connection. So on Linux:
    • CUA_SHIM_SANDBOX defaults to disabled when the computer surface is on;
    • every scoped launch is refused with sandbox_unavailable when bwrap cannot create a user namespace;
    • doctor reports both states truthfully.
  • Phase E. main (Phase E, PR Phase E: remote control of a user's Mac (HTTP server mode, launchd agent, relay) #52) is merged in. Three conflicts were resolved: usageFor, settingsFrom and the doctor skip status. Off macOS, agent install|uninstall|status now refuse with unsupported_platform, and runAgent reads the console only on darwin.

BLOCKED: acceptance 10's tab cell needs the owner

Everything else in item 10 passes: chrome register writes the Linux manifest, the signed-out extension starts cua's host, countLiveHosts counts it, and profiles add/bind me work. What is left is the js cell that opens a tab, reads its title and closes it. It needs a ChatGPT sign-in inside the VM, and the owner was away.

Owner steps (the VM cua-linux is running; its Tart window shows Chrome on the ChatGPT "Log in or sign up" page):

  1. In the VM window, sign in to ChatGPT in Chrome ("Continue with Google" or email). Optionally, check that the extension shows you signed in (puzzle icon → ChatGPT).
  2. On the Mac, run ssh cua-linux 'cd ~/cua && DISPLAY=:0 XAUTHORITY=/home/admin/.Xauthority node bin/cua.mjs login' and finish the sign-in tab that opens in the VM's Chrome. Alternative without the VM window: ssh -t cua-linux 'cd ~/cua && node bin/cua.mjs login --device-auth', then use the printed URL and code on the Mac.

After that, an executor finishes the item. The VM's ~/cua is at 30c77ab, which has the same code as this branch:

ssh cua-linux
cd ~/cua && export DISPLAY=:0 XAUTHORITY=/home/admin/.Xauthority
node bin/cua.mjs login --status
node bin/cua.mjs doctor                              # codex.login should now pass
node bin/cua.mjs profiles list                       # me ready; else: node bin/cua.mjs profiles bind me
node scripts/accept/linux-chrome.mjs me              # expect "status": "PASS"
CUA_SHIM_SURFACES=computer,browser node verify.mjs   # problems []

Then append the results to item 10 of the evidence doc and commit them on this branch before merging.

Validation Evidence

  • Suite on macOS: npm test gives # tests 702, # pass 701, # fail 0, # skipped 1. The skip is the Linux-only unsupported_platform test. Run in this session at 30c77ab.
  • Suite on the VM (Ubuntu 24.04.5 arm64, kernel 7.0.0-38), npm test at 30c77ab:
    • user namespaces allowed: 702 tests, 659 pass, 43 skipped, 0 fail. The skips are darwin-only: codesign, ditto zip fixtures, Keychain.
    • kernel.apparmor_restrict_unprivileged_userns=1: 655 pass, 47 skipped (the same 43 plus 4 CLI tests that need a scoped launch), 0 fail.
    • No warnings in any log.
  • verify.mjs:
    • On the VM it exits 0 with problems [] under the default surface, computer,browser, and browser scoped.
    • With user namespaces restricted, browser exits 1 on sandbox_unavailable and leaves run/ empty.
    • On the MacBook, one read-only run against the owner's installed runtime exits 0, and the new survivors check passes.
  • Item 8: cua install --archive ~/mirror/chatgpt_26.928.40906_arm64.deb and an install from the pinned URL both verify length and hash, then extract. cua doctor --json passes every row except codex.login, which is the owner step. sandbox.userns reads blocked before the sysctl step and passes after it; both are recorded in the evidence doc.
  • Item 9: scripts/accept/linux-native.mjs binds a gedit window by X11 id, types a marker with pressKey, reads it back through AT-SPI, and the screenshot shows it. run/ is empty afterwards.
  • Item 11: under scoped, item 9 fails (X11 connect EPERM); under disabled, the Linux default for the computer surface, it passes. The evidence doc has the three-state table.
  • Reviews:
    • F1 task review: clean after two fix waves.
    • F2 task review: clean after two fix waves.
    • Whole-branch review at the reviewer-high brief (run on opus because the astra route was at its limit): one P3, a darwin sandbox row regression, fixed in ac1635d.

Unresolved Review Findings

None. Every deferred Minor finding is in tech-debt-tracker.md:

  • Linux countLiveHosts has no parent check (src/profiles/chrome.mjs).
  • Deb install peaks at about 2.6 GB of scratch (src/runtime/install.mjs).
  • verify's process walk has an exit race a few milliseconds wide (scripts/probe/lib.mjs).
  • CUA_SHIM_SANDBOX=default on Linux has not been measured.
  • The vendor helper's typeText/paste crash GTK3 editors.

Residue

  • Acceptance 10's tab cell. Finish it with the owner steps above. It is in this PR's scope, not a new ticket; if this merges first, it carries forward under Phase F: Linux pin and acceptance for a cloud agent's own VM (X11, deb Chrome, ChatGPT extension) #51.
  • Linux secrets backend (libsecret). Linux refuses secrets with secrets_unsupported_platform. A libsecret-backed broker is the spec's named later initiative.
  • Relay and agent on Linux. remote and agent run stay in Linux USAGE as platform-neutral Node but are untested there; agent install refuses. The spec defers proving them, and a systemd-user-unit counterpart to the launchd job, to a later initiative.
  • x64 Linux pin proven only by inspection. The arm64 build passed on real hardware, and x64 has the same layout and file hashes. A run on an x64 cloud VM would close this.

SSFSKIM added 30 commits October 6, 2026 03:24
Two pins for the vendor's 26.928.40906 debs (linux-x64, linux-arm64), each
recording the _gpgorigin check against the vendor key in notes. The pin schema
branches on platform: a linux pin names a deb, has no signing, IPC or helper
app, may have file components, and names the X11 helper. install unpacks the
deb with ar and tar (missing_tool before any download), launch passes the X11
and session-bus variables and pins OAI_SKY_LINUX_BIN, doctor reports display,
accessibility.bus and sandbox.userns with secrets as skip, Chrome registration
and profile discovery use the ~/.config table (browsersFor), and secrets are
refused with secrets_unsupported_platform. macOS behaviour is unchanged.
The Linux host notes (window binding, no element setters, X keysyms, no per-app
approval, the trusted wrapper is not a boundary) beside the macOS ones, both
within the 2,048-character budget with the vendor line. cua login passes the
desktop session to the CLI on Linux and says so when xdg-open is absent. The
usage names each platform's archive and default home. verify.mjs reads the
process tree from /proc on Linux and skips the native-socket holder step;
profiles open starts google-chrome detached.
…eps F1's host and gains E1's onWithdrawn)
- verify's Linux process table keeps a process whose /proc exe is unreadable
  as <unreadable CODE>, so its subtree stays and it fails relocation visibly;
  the failing check names the pids.
- Search hints name linux on Linux (macOS hints unchanged).
- Install, recovery, permission and sandbox-conflict hints name the platform's
  archive, home and fix (macOS text unchanged).
- sandbox.userns says what bubblewrap did, not that the sandbox cannot start.
- Relative XDG_DATA_HOME, XDG_CONFIG_HOME and CHROME_CONFIG_HOME are ignored.
- One desktop-session environment helper for launch and login; the manifest
  test uses the fixture's linuxPinJson.
- A test for doctor's default Chrome wiring on Linux; unused names removed.
…inux process too

Tests of the macOS layout (registration, Chrome checks, profiles open, the
Keychain broker and secrets routes, host notes and hints) inject the darwin
host; fixtures forge the pin of the host they are given (this process's by
default), and CLI tests find Chrome where this host's CLI looks, with the
caller's XDG_CONFIG_HOME/CHROME_CONFIG_HOME dropped. Access-fix assertions follow
the OS's own text, and the readiness and pick reasons name it per platform
(macOS text unchanged). Only what needs macOS is skipped elsewhere: the
codesign refusal, the Keychain helper routes and broker, and the ditto-built
zip installs.
… on Linux

- The scoped-sandbox conflict test sets TMPDIR (the home's parent) for its
  serve and listing launches, so it holds where no TMPDIR is exported.
- shortScratch homes are outside $TMPDIR: /tmp, or /var/tmp when TMPDIR
  covers /tmp, so a session exporting TMPDIR=/tmp does not trip sandbox_conflict.
- secrets_list on Linux says secrets are unavailable there
  (secrets_unsupported_platform) instead of teaching references Linux refuses;
  the macOS description is unchanged.
…nder, and checks every runtime process ends

On the VM the pinned codex runs each runtime child inside /usr/bin/bwrap --new-session, so the
subtree leaves the anchor's process group by design and bwrap itself is not under the release.
verify now names the system sandbox launcher as the one allowed outside executable, exempts it and
what runs below it from the group check, and fails if any runtime process it saw outlives the close.
…ed; doctor says what each mode does there

Measured on Ubuntu 24.04 arm64: under any managed profile node_repl lets no runtime process connect
to a socket (the unix-socket allowance and network: enabled are not honoured there), so the scoped
sandbox keeps sky_linux off the X display and the session bus; and where bubblewrap cannot create a
user namespace the runtime silently runs cells with no sandbox. The default stays scoped for the
browser surface alone, which works under it. Doctor fails scoped with the computer surface on Linux,
fails scoped where user namespaces are refused, and reads sandbox.userns skip while no sandbox runs.
… views

On the VM the helper's typeText and paste (AT-SPI insertion) crashed gedit and mousepad with SIGSEGV
in gtk_text_buffer_get_iter_at_offset, while pressKey typed into gedit. The note replaces the
setValue/selectText sentence the vendor document already carries; computer+browser is 2,045
characters with a 63-character vendor line.
…ld there

The bind test expected the macOS Full Disk Access wording, the sandbox-state tests assumed scoped is
the default for the computer surface, and the staging-mode test relied on a 077 umask.
scripts/accept/linux-native.mjs binds its own standalone gedit window by X11 id over cua serve, types a
marker key by key, reads it back through AT-SPI, takes a screenshot, ends the task and checks run/ is
left as it was; it ends its gedit and removes its directory in finally.
Items 8, 9, 11 and 12 on the Tart arm64 Ubuntu 24.04 VM, item 10 up to the Codex login, and spike
#12's unverified items answered: bubblewrap fails open under Ubuntu's userns restriction, X and the
session bus are unreachable inside the sandbox, Chrome needs toolkit accessibility and
--force-renderer-accessibility for its web contents, and the arm64 deb behaves as the x64 one.
…er has signed in

scripts/accept/linux-chrome.mjs checks the live host runs from $CUA_HOME/runtimes, takes the bound
profile's instance id from profiles_list, opens a tab on example.com, reads its title, closes it and
checks run/ is clean. Before the Codex login it stops at createBrowserTab with
"Codex auth token is unavailable" (dry-run on the VM).
…re agent) into feat/phase-f

Conflicts and how both sides' behaviour is kept:
- src/cli.mjs: usageFor(platform) keeps F's per-platform archive word and
  home, and gains E's --relay lines for agent run, agent install|uninstall|
  status and the CUA_AGENT_CONSOLE_CHECK text. usageFor('darwin') equals E's
  USAGE byte for byte. On Linux the usage keeps remote enroll|show and agent
  run with --relay (platform-neutral Node) and omits the launchd commands and
  the console-check setting; agent install|uninstall|status refuse off macOS
  with unsupported_platform after argument parsing, before any plist is
  written or launchctl run.
- src/mcp/server.mjs: settingsFrom(env, {platform}) as F threads it, with
  surfacesFrom imported from src/mcp/surface.mjs where E moved it.
- src/runtime/doctor.mjs: one skip status (F1's, E2's semantics identical);
  inspectRuntime takes both inspectLinux and inspectAgent; F's Linux rows and
  E's agent.* rows both reported; off macOS the agent.* rows read skip
  without consulting launchd or the console registry (E's own guard).
- test/cli.test.mjs: E's empty-home doctor test under F's skip condition, with
  E's agent.* skip assertions; the darwin usage regex follows E's text; new
  tests for the per-platform agent lines and the Linux refusal.
- README.md: Requirements names Linux and the ws dependency; both the Remote
  control and the Linux sections, the latter saying what remote control does
  on Linux. tech-debt-tracker.md: both entries. Spec: E's Progress ticks with
  F's, Phase F's Surprises and Decision Log intact, a Decision Log entry for
  this merge.

Semantic clash outside the conflicts: runAgent read the console through ioreg
on every platform, so on Linux each js call would log an unreadable console;
it now reads it on macOS only (platform seam, test extended).

Suite 694 (693 pass, 1 Linux-only skip) under default, unset and /tmp TMPDIR;
694 (651 pass, 43 macOS-only skips) on the arm64 Linux VM.
…ptance 11, Surprises); tech debt: GTK3 text input crash
…s are, instead of running unconfined

Where bubblewrap cannot create an unprivileged user namespace the vendor's sandbox fails open. A scoped
connection and the scoped profile listing now run doctor's probe (bwrap --ro-bind / / true, shared as
bwrapUserns) once per open on Linux and refuse with sandbox_unavailable before anything starts; the
hint names the sysctl, an AppArmor userns profile for bwrap, and CUA_SHIM_SANDBOX=disabled. The
listing's mode is pinned as listingSandboxMode: scoped on both platforms unless set otherwise.
…_SHIM_SURFACES

With scoped, the computer surface and refused user namespaces, the sandbox row now says the sandbox
would fail open and cua refuses (sandbox_unavailable), then the computer surface's own problem. The
surfaces are parsed with the shared surfacesFrom, so an invalid value fails the row.
…d of waiting out the timeout

A refused open (sandbox_unavailable, sandbox_conflict) made verify wait 120 s for an initialize answer
that could not come; now it reports the exit within the same run.
…pArmor route, the MacBook verify run, new totals
…de; doctor's userns row holds while a scoped listing can be refused

With computer,browser and the mode unset the connection runs disabled, yet its profiles_list listing ran
scoped and was refused where user namespaces are, while doctor read sandbox.userns skip and ok. The
connection now passes its mode to its listing (a disabled connection's cells already run unconfined).
Doctor reads sandbox.userns skip only when no scoped launch can happen (browser surface off, or
CUA_SHIM_SANDBOX set to another mode); otherwise a refusal stays blocked and names cua profiles
list/bind's sandbox_unavailable. Doctor finds bwrap on the system path, as the launch check does.
… user namespaces

The seven serve-cli tests that spawn the real CLI on a scoped launch (browser-only serve, profiles
list and bind) skip with a sandbox_unavailable reason where bwrapUserns does not pass, computed once
from the real probe, as the darwin-only tests skip off macOS. There is no bypass switch.
SSFSKIM added 10 commits October 6, 2026 06:36
…ns row on the VM, suite totals with user namespaces restricted and allowed
…sting, connection listing follows its mode, userns skip rule, the bwrap AppArmor route)
…; an explicitly scoped connection keeps the userns probe's row

Doctor parsed CUA_SHIM_SURFACES on every platform, so on macOS an invalid value failed the sandbox row
where it had passed before Phase F; surfaces are now read on Linux only, pinned by a darwin test that
runs on any host. And with CUA_SHIM_SANDBOX=scoped and the computer surface only, sandbox.userns read
skip although the connection itself is refused; a scoped connection now keeps the probe's row.
The three tests that inject listBackends to test a readiness listing's lifecycle serve under
CUA_SHIM_SANDBOX=disabled, so they no longer need user namespaces and lose their NO_SCOPED_LAUNCH gate.
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.

Phase F: Linux pin and acceptance for a cloud agent's own VM (X11, deb Chrome, ChatGPT extension)

1 participant