Skip to content

Own REPL host (#116) M5: supported sessions default to cua's own host on a managed Node 24; final acceptance - #149

Merged
SSFSKIM merged 97 commits into
mainfrom
feat/own-repl-host-m5
Oct 17, 2026
Merged

SSFSKIM merged 97 commits into
mainfrom
feat/own-repl-host-m5

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 17, 2026

Copy link
Copy Markdown
Owner

M5 of #116, the last milestone. This PR makes cua's own REPL host the default for the sessions it supports, ships a managed Node 24 for that host, and records the final acceptance evidence.

Closes #116

What changes for users

Which host runs

  • Own host by default: Linux sessions, and browser-only macOS sessions whose browser service resolves to cua's (including MAWS client mode and cua profiles list). Doctor reports the reason as linux or browser_only.
  • Vendor host stays:
  • Explicit choice: CUA_REPL_HOST=cua|vendor, with vendor as the rollback. agent install saves an explicit value in the job; an unset one is resolved again at each launch.

Node for the own host

  • cua install installs a pinned, verified official Node 24.22.0 under $CUA_HOME/node for the own host.
    • Pins are checked against nodejs.org's GPG-signed SHASUMS256.
    • On darwin, the Developer ID signature is checked before the binary is ever run.
    • The install record binds the binary's SHA-256 and size, and nothing that doesn't match is executed.
    • Activation rolls back on failure.
    • $CUA_HOME/node and $CUA_HOME/staging are protected from scoped-sandbox writes.
  • Resolution order: CUA_NODE, then the managed Node, then the node running cua, then PATH.
  • With no Node 24 available, an implicit default stays on the vendor host with the reason own_host_node_unavailable, and doctor shows a new warn status with the remedies. An explicit CUA_REPL_HOST=cua is refused with repl_host_node; it is never downgraded.
  • cua's own engines floor is unchanged (^22.14 || >=23.7).

nativePipe

  • Path failures now produce the vendor's exact sentences: native pipe path unavailable: … / stat failed / not a socket / file name is too long. The order and wording were taken from the vendor binary.
  • Socket paths longer than sun_path:
    • macOS: connected through a supervisor-owned connector process running in the socket's directory. The connector is reaper-owned and dev/ino-checked, holds the connection's peer identity, and is bounded by the connect deadline. The vendor does the same with a per-thread cwd.
    • Linux: refused with the vendor's SUN_LEN sentence.

Versions and docs

Validation Evidence

Every recording below ran on one product tree, e24a1cd. git diff e24a1cd HEAD -- src bin runtime package.json .claude-plugin is empty.

Gates

Reviews

  • Whole-branch doperpowers:reviewer-high over 56ea8c3..e9007ba (code): correct, no material findings; delta re-review e9007ba..4a33237: correct.
  • Ten task reviews, all clean after their fix waves.

Acceptance 1–4 and 6, mini (docs/evidence/2026-10-14-own-repl-host-parity/m5/mini/)

  • repl-parity diff all-vendor-2 all-cua --through M5 --expected … gives 479 cases, 1,380 cells, 0 unexpected. The expected set is 1,367 identity slots only. The inventory gate covers 542/542.
  • The 59-case corpus by host shows 0 unexpected against three vendor controls. The trace tolerance was recalibrated mechanically from vendor-vs-vendor pairs, with no hand allowances.
  • docs-profiles 12/12. Services show 0 differences, including the new stat-missing cell and the 192-byte connect-over-limit cell, which has a peer-side witness.
  • Every own connection attests cua-repl-host 0.5.0 on the managed Node from a fresh cua install; CUA_NODE was never used.

Acceptance 1–6, Linux (m5/linux/)

Acceptance 5: the Linux native route through the owned worker passes, via the runners and the --suite all native cases above.

Acceptance 7

  • The unchanged MAWS live probe passes on the own host, on the mini, between CI jobs (m5/mini/maws/).
  • e2e:browser-cua is green on the mini runner (MAWS run 38936813609, 7 passed). It is a fake-host regression, not host proof.
  • Remote: harness-owned relay endpoints pass on the mini (browser) and cua-linux (computer,browser). That covers js observe/act/verify, js_reset, end_task, switch-local and the task_open refusal. Kill-client counts exactly 1 with no replay (m5/remote/, m5/linux/remote/).
  • Elicitation is not reachable live on these routes: the cua browser service asks for no approvals, cells can't reach createElicitation, and secrets are off. It is proven by test/mcp-devices.test.mjs and the services suite's accept/decline/cancel cases.

Acceptance 8

  • Browser, model-driven, 3+3 on one browser-only endpoint:
    • Tool time is within max(10%, 500 ms) on 23/23 tasks; the worst is +117 ms.
    • The summarizer's outcome line reads regression, kept as recorded. The session ruled it not a host regression: two misses are controller mistakes, and the third is a single miss whose scripted counterpart passes 3/3.
    • Browser benchmark: scripted-outcome parity in place of the success-count rule #130's scripted outcomes at the same head are 12/12 on both hosts.
  • Native, on the quiet cloud box cua-bench, with vendor and own triples in one sitting (docs/evidence/2026-10-14-own-repl-host-native/m5-cua-bench/):

Acceptance 9

  • The selection lane runs the real doctor and real calls against an independent table: 260/260 on both mini and cua-linux, plus the cache checks (reuse, version miss, cross-host) and the job checks.
  • It covers all five Node cases, including "PATH Node 22 + managed Node → implicit cua".

Installed-agent rollback on the mini: the session's step, done after review.

Confusions

Unresolved Review Findings

  • test/repl-host/native-pipe-long-path.test.mjs:322 reads socket.destroyed after relay.closeAll(), so that one assertion can't tell expiry-driven destruction apart from cleanup. The timeout-reply assertion still holds. Test-only.
  • docs/evidence/…/m5/mini/maws/README.md says the MAWS browser implementation is unchanged since M3. The reviewer could not establish that, because GitHub's compare hit its 300-file limit. The live PASS results don't depend on it.
  • The MAWS ci-gate-e2e-browser-cua.txt transcript keeps job statuses only. The job log also has a pnpm config warning and two SQLite ExperimentalWarnings, which are upstream MAWS noise.
  • The evidence JSON has fields named token. They are scratch-ownership cleanup nonces for directories that no longer exist, not credentials, and were dismissed in review.
  • Each eligible connection now runs up to three node --version probes (accepted by the spec). Doctor's --json has a new warn status value, which external parsers may not expect.
  • Each long-path (over-sun_path) macOS nativePipe connection costs one Node connector process, 60–100 ms to start, absorbed by the 1,000 ms connect budget.

Residue

…lt to the own host where Node 24 resolves (own_host_node_unavailable otherwise); doctor warns; agent install persists an explicit CUA_NODE; host 0.5.0, plugin 0.12.0; package-contents check
…re they test its launch, and cover the own host's Linux default and trusted roots
… CUA_NODE that is not an absolute path whatever the selection, as serve refuses it; the healthy Linux doctor test gives its own host a Node 24
…regression runs on its no-registration home, which reads vendor_browser_route
…icial Node 24 (v24.22.0) for the own host under $CUA_HOME/node; resolution tries it after CUA_NODE; doctor names cua install
…ected from scoped writes on either host; its install record binds bin/node's SHA-256 and size, and nothing that does not match is reused or run; the pointer is checked and staged before an install is published, with classified failures and rollback
…install verifies the runtime and the Node before placing them, is protected from scoped writes on either host
…_REPL_HOST at its refusal boundary and evaluates every row

serve refuses an invalid value at start (settingsFrom, invalid_setting); the profile listing and doctor
refuse it at selection (replHostFor, invalid_repl_host). The table now expects each boundary's code and
the exact sentence 'CUA_REPL_HOST must be cua or vendor', from the real call and from doctor's sentence
for the row's own lane; the serve and listing observation frames carry the sentence.

The lane evaluates all 260 rows and the cache and job checks whatever an earlier one did, records every
failure by row and case, and exits nonzero naming each; a failure restoring the managed Node still stops
the lane. Diagnostic: ddc7427.
…lerance (89496dd): 0 unexpected against each of the three vendor controls
…ost sentence with its on-Node clause

doctor words an own selection 'cua host (REASON) on Node PATH: ...', which the oracle's
'HOST host (REASON):' prefix refused for every live own success. The lane sentence is now
parsed at its anchored opening: host and reason compared exactly, and for managed rows the
clause's path must equal the managed Node that answered, never a path found elsewhere in the
row. Regressions grade doctor's actual output (inspectRuntime with stubbed inspections) for
both lanes, Linux and the managed fifth case, and reject wrong host, reason and path.
…-cua green on the mini runner (38936813609, fake host), live probe PASS on the own host at 8a134ab with the managed Node under a fresh scratch home, Electron quit cleanly
…dor, own x3, fresh managed homes): 800x600 in 6/6, all PASS; attempt 1's 800x500 never recurred, an environmental/MAWS flake
…ws pass; 22 MAWS-plus-cua-registration rows fail the oracle's /MAWS/ route check, and the cache check reads no handshake record
…oute by the documented precedence

The oracle required MAWS in doctor's route words whenever MAWS client mode was configured, so
the 22 MAWS rows whose home carries an active cua registration failed at e63daa1 although doctor
named the registration that decides. The oracle now restates the order independently (explicit
CUA_BROWSER_SERVICE, then an active cua registration, then MAWS client mode, then the ChatGPT
extension route by its registration or by default), expects the deciding source's words in the
row's Browser route, and MAWS only where MAWS decides. Replaying e63daa1's 260 rows: 0 failing
(22 before). Regressions grade doctor's actual row for every non-refused darwin row and reject
another source's route words.
…3cb6db: compare FAIL on method.typeText's outcome only (one vendor sample's os error 11 against NoReply); every latency row passes
…s 0 differences, the Linux vendor confirms the provisional over-limit refusal; three runners PASS, Linux lifeline 251/223 ms, native-pipe tests, selection 260/260, doctor; --suite all held by the 120 s boundary-probe bound
…ration-owned archive cache

Preparation fetches the pinned vendor archive and Node tarball once into the
prepared home (scripts/repl-parity/archive-cache.mjs: the installer's own
download and length/SHA-256 verification), installs the prepared home from
them, and every managed fixture's fresh scratch install runs
cua install --archive <vendor> --node-archive <node> from those copies.
A fixture never downloads: an absent, short or refused cache fails with
cleanup-prepared + prepare again. Removing the prepared home removes the
cache. The 120 s boundary-probe and 150 s request bounds are unchanged and
now pinned by test/repl-parity/fixture-bounds.test.mjs.
…a-remote skill flow (observe/act/verify, js_reset, task_open refusal, end_task, switch local), kill-client count 1, cua-repl-host 0.5.0 on the managed Node attested at the endpoint; resident mini vendor-routed; elicitation not reachable on this route
…browser-only endpoint: tool time within bound on all 23 judged tasks; summarizer verdict regression on outcomes (T2, drag-box, drag-items cua 2/3, controller misses); endpoint-level host attestation
…p, so it exits while a FIFO writer stays open
…-1 vs own 0 differences over 490 cases (1,394 cells); cached fixture installs 22-24 s; trailing vendor control owed (two diagnostics); paused for the VM resize
… trailing vendor control on the resized VM (2 vCPU / 4 GB), own vs vendor-4 0 differences, vendor pair 0, no OOM
…er) at fabfb11: own host attested on the managed Node, plugin-tool observe/act/verify on gedit and a page, js_reset, task_open refusal, end_task, kill-client count 1; endpoint and both preparations cleaned up
…diff over the identical case set (session ruling)
@SSFSKIM
SSFSKIM merged commit 8c3392d into main Oct 17, 2026
4 checks passed
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.

Independence 3: cua's own REPL host and a vendor-compatible cua JS API (replace @oai/cua, cua-repl, node_repl)

1 participant