Skip to content

#159: hosted-macOS gates for cua's headless live checks (sandbox-live, sandbox-denials, parity-browser) - #167

Merged
SSFSKIM merged 18 commits into
mainfrom
feat/159-hosted-macos-gate
Oct 18, 2026
Merged

SSFSKIM merged 18 commits into
mainfrom
feat/159-hosted-macos-gate

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Closes #159

This moves cua's headless macOS live checks off the Mac mini (MAWS's shared CI runner) onto GitHub's hosted macOS runner, so a pull request that changes the sandbox is proven with no mini time. The full account is in docs/evidence/2026-10-18-hosted-macos-gate/README.md.

What changes

There are three new ci-kit gates on lane hosted-macos, configured in .github/ci-kit.yml.

sandbox-live (scripts/sandbox-probe/hosted-gate.sh, about 1.5 min) runs on pull requests. Its trigger paths are:

  • src/sandbox, src/runtime, src/secrets, src/repl-host, src/services, src/mcp and src/cua-api;
  • src/cli.mjs, bin/cua.mjs and bin/cua-codex-compat;
  • runtime/;
  • the checks' own scripts and the records they judge against.

On every run it does a fresh cua install of the pinned runtime into a scratch home, then:

  • Oracles. The fingerprints under cua's launcher are judged equal to a baseline recorded on the hosted image. port-vs-capture replays M0's signed-CLI captures, relocated from the mini's root to the runner's.
  • Own-sandbox on cua's host (76 checks) and the vendor host (86 checks).
  • probe-secrets against its own synthetic store.
  • Doctor, and a check that the install contains no Codex CLI.

sandbox-denials (about 21 min) runs on pull requests that touch the sandbox profile or the kernel's launch. It runs the cells and services suites under sudo log stream, and judges the Sandbox denials one-sided against M1's declared set. A preferences denial, an undeclared kind or a malformed record fails the gate.

parity-browser (about 9 min) runs only on a ci ref or a dispatch, for now. It runs parity's browser lanes (api, docs-profiles), vendor against cua, on a harness Chrome for Testing with cua's extension in a fresh profile. The runner reaches itself as the parity device hosted-macos over a loopback sshd. It stays off pull requests because 3 of its first 6 runs went red on two racy parity cells, not on the change; adding pr is a one-line change once those cells are fixed.

Harness changes:

  • compareFingerprints reads env and cwd relative to each side's harness-given roots.
  • oracle.mjs port-vs-capture --relocate is new.
  • The fingerprint creates a fresh home's state/.
  • scripts/sandbox-probe/hosted-public.mjs allowlists what the logs and artifacts publish.
  • scripts/repl-parity/devices.mjs declares hosted-macos.

What stays on the mini is written down in scripts/mini-rules.mjs's header and in CLAUDE.md: only what needs the owner, a TCC grant, branded Chrome or the owner's profile, or the mini's own state. The M0 fingerprint pairs also stay there, because the mini runs macOS 27 and the hosted image runs macOS 26.6.2, and the two answer file-link differently under the same profile. That was measured: the same cua code differs on six system paths only.

Validation Evidence

The claims below are proven on hosted macOS: image macos26 20261013.0424.1, macOS 26.6.2, Node 24.21.0.

Claim Evidence
sandbox-live is green and not flaky 7 of 7 runs with the baseline in place were GREEN, 1m20s–1m52s, three of them concurrent: 39152577157, 39152580339, 39152583978, 39153110600, 39153113713, 39154681618, 39156236619. This PR's two runs were also GREEN: 39165844728 and 39166423984. The three earlier reds were deterministic and are fixed (README, "Runs").
sandbox-live catches a policy regression Negative control: dropping ~/.config/cua from the deny list turned it RED in 6 steps (the four baseline judgements, plus own-sandbox on both hosts), before (39152820629) and after (39156850149) the review fixes.
The runtime is never cached or uploaded Install takes 16–21 s per run, so there is no cache. A failing run's artifact holds only the public forms, about 300 KB, checked.
sandbox-denials is green 6 of 6 GREEN, 18–22 min. This PR's run 39166423984 is one of them; the others: 39158313474, 39158338768, 39159480640, 39159500411, 39163456859. Each run had 9–10 denial kinds, all declared, with 0 preferences denials and 0 malformed records.
A PR's merge commit (on no GitHub ref) can be checked out by the parity harness Probe run 39163467915 was GREEN on a commit on no ref. Live proof: this PR's own run 39166423984, where sandbox-denials passed (18m23s) on the synthetic merge commit.
parity-browser passes but is intermittent 5 of 8 GREEN. The reds were the waitfor race (2) and cua's drag cell (1), with causes in tech-debt-tracker.md; so it runs by hand only.
Unit tests node --test "test/sandbox-probe/*.test.mjs" test/repl-parity/hosted.test.mjs test/accept-scripts-load.test.mjs test/package-contents.test.mjs: all pass. The full npm test locally on Node 26: 2867 pass, and 2 fail in test/remote-client.test.mjs, which fail the same way on main (Node 26 timing). The test gate on this PR runs Node 24.
The mini's existing judgements are unchanged M4's four fingerprint judgements, recomputed with the new compare.mjs, are all still ok.

Unresolved Review Findings

  • Unfiltered diagnostics at the very start and in the exit trap (scripts/repl-parity/hosted/hosted.sh). If the script fails before its first step, or in its exit trap, mktemp/mkdir/rm diagnostics reach the log unfiltered. Left because the only thing exposed is the runner's temp path, which is already public. Logged in tech-debt-tracker.md.

Residue

  • Make parity-browser a pull-request gate.
    • Fix the waitfor cell's two-deadline race in the scenario (api/browser-playwrightlocator/waitfor, cell locator-contract-diagnostics-no-matches).
    • Read the cause of the intermittent api/browser-cuaapi/drag failure on a rerun.
    • Then add pr to the gate's on:.
    • Both are in tech-debt-tracker.md. They touch parity's corpus, which the mini's runs share, so they were left out of this ticket.
  • Re-record the hosted baseline when macos-latest moves. When the hosted image moves (for example to macOS 27), sandbox-live's baseline judgement fails, and its log names both images. Someone re-records docs/evidence/2026-10-18-hosted-macos-gate/baseline/ from a run of main's code; the README says how. A scheduled check could catch the move before a PR does.
  • test/remote-client.test.mjs fails on Node 26. Two resume-budget timing tests fail locally on Node 26, on main too, and pass in CI's Node 24. Worth a look before the repo moves to a newer Node.

SSFSKIM and others added 17 commits October 18, 2026 10:55
…sts, probe-secrets); fingerprints compare relative to their roots, captures replay relocated
…skips hidden files), the runner's macOS recorded, undeclared fingerprint differences named
… (M0's pairs stay the mini's: macOS 27 vs 26); the fingerprint creates a fresh home's state/
…s26 20261013.0424.1) recorded from this branch's unchanged sandbox code; roots match inside JSON values
… Log entries; the gate names an image change when a baseline judgement fails
… harness; relocation once per occurrence; public output allowlisted

- ci-kit.yml sandbox-live paths: add the hosted baseline, src/mcp, src/cua-api, src/cli.mjs and bin/cua.mjs.
- compareFingerprints: the user-home root is config-cua's grandparent (a target the harness passes), never
  fingerprint.c's `home` target, which is the child's own HOME; a kernel whose HOME moved no longer compares equal.
- relocateCapture: one alternation pass, escaped spelling first, each occurrence replaced once by its own spelling
  (a destination under the root is not moved twice); a root whose two spellings coincide is refused when the
  destination's differ. M0's captures relocate exactly as before.
- hosted-gate.sh: raw reports stay in the scratch root; the artifact holds only hosted-public.mjs's allowlisted forms
  (fingerprints without input, image.json, port-vs-capture booleans and counts, own-sandbox labels/passes/codes,
  probe-secrets and doctor statuses, nothing of install's); the log names differing environment variables, never
  their values. The four baseline files are converted to the reduced form (each still judges equal to the original).
- M4's four mini judgements, recomputed: ok.
…gets; env and cwd relative to the run's roots, unknown values withheld; the baseline converted); producers' stderr stays in the scratch root; a failed publication fails its step

Co-Authored-By: Claude <[email protected]>
…scripts/repl-parity/hosted/): a harness Chrome for Testing with cua's extension, the runner as parity device hosted-macos over loopback sshd; the cells and services denials judged one-sided against M1's declared set, the api and docs-profiles lanes diffed vendor against cua; public lines only, refuses off a GitHub-hosted macOS runner
…s as live; a run or diff fails when either its producer or its report says so, and a run with no complete passing report fails; preferences denials counted on node's raw events, before the reduction classes them; a step's stray stderr withheld; the scratch root checked before anything uses it. Path filters narrowed to what each gate can catch; mini-rules, CLAUDE.md and ci-kit.yml's header name the two gates
…at each runs, its filter, the spike's and the gates' hosted runs, parity-browser's two intermittent causes, what a hosted pass does not show); What stays on the mini updated; tech debt: the waitfor race seen hosted, the drag assertion, start-up stderr
…cy parity cells are fixed: 3 of 6 hosted runs went red on them, and a flaky PR gate is worse than none
…prepare, so a pull request's merge commit (on no GitHub ref) can be checked out; the denial judge fails on any record that does not parse (counted as malformed records, never printed), the stream's banner and blank lines aside, and log stream is stopped with SIGINT and read only once it has exited (30 s, then killed and the step fails); parity-browser's paths take what its lanes import (scripts/browser-parity, test/browser-parity, the pause gate, the server both hosts run under and its runtime, the pinned runtime), sandbox-denials' the inputs of the sandbox profile and the kernel child's spawn
…one made from the job's checkout (and the probe that proves it on a commit on no ref), the malformed-record check and the SIGINT stop, both filter lists; runs 39163456859 (both GREEN) and 39163467915 (probe, GREEN)
@SSFSKIM

SSFSKIM commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner Author

ci-kit review (CI-opt): the wiring fits, and the slot use is fine. Ready to merge on green.

Wiring. Every field is used as docs/adopting.md defines it:

  • lane: hosted-macos is macos-latest, so nothing here can land on the Mac mini or the MacBook.
  • paths filters pr and ci-ref selection. A dispatch, or CI-Gates: / ci-gate --gates, ignores it.
  • on: [ci-ref, dispatch] on parity-browser keeps it out of PRs. On a ci/** push it still needs a path match unless it is named. That matches the "by hand" comment.
  • artifacts uploads only on failure.
  • The timeouts (30/60/40) leave sensible headroom over the measured 1.5/25/12 min.

Hosted macOS slots. GitHub caps a personal account at 5 concurrent macOS jobs. A sandbox PR now holds 4 of them: test, plugin, sandbox-live, and sandbox-denials (the last for ~21–25 min). A parity-browser dispatch makes 5. A second sandbox PR at the same time queues rather than fails. That is acceptable: no other SSFSKIM repo uses hosted-macos (checked doperpowers, ci-kit, manim-master and MAWS, whose Mac work runs on the mini), and the minutes are free on a public repo. If sandbox PRs start overlapping often, the first lever is to make sandbox-denials ci-ref-only, like parity-browser, and keep sandbox-live as the PR check.

Notes, none blocking:

  • .github/ci-kit.yml is in all three path lists, so any config edit runs the 25-minute denials gate. That is intended, just a cost to know.
  • sandbox-denials has no on: line, so it takes the default, [pr, ci-ref, dispatch], path-filtered on pr and ci-ref. That is not PR-only as the description says. If PR-only was the intent, add on: [pr, dispatch].

@SSFSKIM
SSFSKIM merged commit c615ea4 into main Oct 18, 2026
6 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.

Hosted-macOS gate for cua's headless live checks (oracles, own-sandbox, probe-secrets), so the mini serves only what needs it

1 participant