Skip to content

Own sandbox M0: oracles, probes, harness extensions and baselines (#115) - #153

Merged
SSFSKIM merged 52 commits into
mainfrom
feat/115-own-sandbox
Oct 17, 2026
Merged

SSFSKIM merged 52 commits into
mainfrom
feat/115-own-sandbox

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Part of #115 (M0 of the own-sandbox spec, docs/doperpowers/specs/2026-10-17-own-sandbox-design.md). No production code under src/ changes: this milestone lands the oracles, probes, harness extensions and baselines that M1 to M4 test against, the spec itself, and its execution record.

What landed

  • M0a, mini oracles (scripts/sandbox-golden/, scripts/sandbox-probe/, test/fixtures/sandbox/seatbelt/): the golden generator over the original's crates at rust-v0.159.2, its fixture matrix with executable filesystem setup, the unprivileged argv capture, the sandbox_check fingerprint probe, experiment A (public build in the signed CLI's slot), and the app-server capture with a privacy audit and replay.
  • M0b, harness extensions: native-baseline --surfaces browser and compare --same-host (judges the two cold first_js rows; permits only the launcher, the per-session TMPDIR and the Linux computer sandbox-mode transitions; acceptance sizes enforced), repl-parity's cua-gce device with lanes by device, host-aware preparation and the configuration-transition comparator kind, and scripts/sandbox-probe/tz-probe.mjs.
  • M0c, live probes and baselines: the GCE box, the Linux probes (XShm, app launch, nesting), native-baseline --approved-runtime with an admission, lossless state moves and causal helper ownership (exact executable plus the run's own TMPDIR), scripts/mini-rules.mjs (the mini's run rules as tested code), and the evidence under docs/evidence/2026-10-17-own-sandbox/m0/.
  • main (Remove the ChatGPT extension route, the vendor browser service and the Codex login (ahead of #115) #79, 94366c1) merged in; the M0 harness no longer sets CUA_BROWSER_SERVICE.

Verdicts

  • Experiment A: the public build equals the signed CLI in all four configurations, native calls included; the helper accepts its app-server. Promote.
  • Argv capture: byte-equal to the golden generator for both inputs. Promote.
  • App-server replay: the helper sends only initialize, configRequirements/read, config/read; the replay is accepted. Promote.
  • Fingerprint: signed and public equal (result and errno). The macOS home nesting holds.
  • Linux: app launch breaks inside the worker's sandbox (selects the supervisor-side launch, M3); nesting is not expressible (selects the per-directory deny extended with run/, M3).
  • One unforeseen finding: node_repl filters the kernel launcher's environment, so M2's compat executable takes its settings from a per-session file (spec Decision Log).

Validation Evidence

  • HOME=$(mktemp -d) npm test at d9c027a (after the main merge): # tests 2665, # pass 2498, # fail 1, # skipped 166. The one failure is create-hetzner.sh copies an upload whose local path has a space to the name the VM watches (printf: write error: Broken pipe), which fails identically at base a35ccc8 on this MacBook (spec Surprises); CI is the gate of record.
  • Focused suites after the last fix: HOME=$(mktemp -d) node --test test/native-baseline/*.test.mjs test/sandbox-probe/*.test.mjs test/mini-rules.test.mjs → 164/164 pass (task 3 report, round 3); test/repl-parity/{managed-prepare,device-lanes,configuration-transition}.test.mjs with the above → 159/159 at d9c027a.
  • npm run test:mods pass and claude plugin validate . exit 0 (task 2 report).
  • Each verdict's evidence path is listed in docs/evidence/2026-10-17-own-sandbox/m0/README.md and the sub-READMEs.

Unresolved Review Findings

  • test/mini-rules.test.mjs:241-242: the accept-launch regression test snapshots every /tmp/cua-115-accept.* directory and removes those created after, so two concurrent runs of that test could remove each other's directories. Left: test-isolation polish with no functional effect; noted by the task review as non-blocking.

  • test/native-baseline/device.test.mjs:163,167 interpolates ${home} (a temp path) into sh -c source, the pattern the PR review found and fixed in the new argv-capture test (8ec8a5a). Left: it predates this PR and is test-only; worth the same "$1" treatment in a later pass.

  • test/native-pipe-long-path failed once in a full local run during the review fix (a cua-* entry in the literal /tmp vanished between the test's two snapshots on a shared machine); it passes alone and in CI. Left: a pre-existing check that races with other users of /tmp.

PR review

reviewer-high on the whole diff found three harness defects (Linux probe signalling without causal ownership; argv capture leaking the sandboxed child on a miss; the tz verdict ignoring HOME and Node), fixed in 420c4ee, f5086c4 and 418fa72, then one test-launcher shell interpolation introduced by the fix, fixed in 8ec8a5a and verified under a hostile TMPDIR.

Residue

  • The held mini runs (spec Progress, "M0 residue"): the vendor computer triple, the own-host browser-only triple, the tz baseline under the real HOME, and accept-native at main 94366c1. They wait for the mini's native-run hold to lift and run in the next cleared window, before M1's live acceptance and before M2 or M4 depend on them. They are the execution session's own work, not a new ticket.
  • ~/cua-115 on the mini (about 9.5 GB) and the stopped cua-gce instance are kept for M1 to M4 and removed when Independence 2: cua's own sandbox for node_repl cells; drop the Codex binary and app-server #115 ends.

The research behind the design (the original's macOS and Linux sandbox paths at
rust-v0.159.2, cua's wiring, the app-server callers, the live helper spike on the
mini, the converged critique) and the approved design with its execution section:
M0 oracles and probes, M1 policy and seatbelt port on macOS, M2 the compat
executable for the macOS vendor host, M3 the Linux helper, M4 #138, CODEX_HOME,
docs and acceptance.
…-exposed paths, per-session TMPDIR, symlinked tiers; Linux path kept until M3, src/sandbox protected from M1, M0 harness extensions, real parity and acceptance commands)
…inux helper re-exposed for its own re-exec, one recorded sessionTmp, host-aware parity preparation and a comparator allowance, the demonstrated tz trigger with a reproducing control, platform-by-platform retirement)
…aware preparation, the declared configuration transition

cua-gce is declared beside the paused cua-linux VM; the native, API and capability lanes and the CLI accept any declared
device of the right platform. Preparation lists profiles through the own host on Linux, so it survives the vendor host's
retirement there (tested under that rule). The comparator accepts one declared configuration-transition entry: the
Linux native fixture's disabled -> scoped move on its listed cases, and only the cell differences it declares, field for
field (#115 M0).
…box launch witness

A browser-surface run makes the native run's cold connections through the browser surface and cua's browser service,
and nothing else. Every real answer now carries what confined the launch's children (the launcher CODEX_CLI_PATH names
and whether TMPDIR is the session's own). compare --same-host judges one host's cold first_js rows after a change
against before it by the harness limit, and permits only acceptance 11's differences (launcher, per-session TMPDIR, the
Linux computer sandbox mode disabled -> scoped), each recorded in the result (#115 M0).
… role

Fresh plain-Node children reproduce the demonstrated trigger (200 vm.createContext calls, then the first host-local-time
use about 2.5 s in, no TZ), each under a launcher in its own process group, bounded and classified as completed, hung or
launcher failure. --launcher codex is the signed CLI's `codex sandbox` with today's scoped policy; --launcher cua is the
slot M1 wires to src/sandbox; --notification-center deny|allow is accepted for M4, and `verdict` applies acceptance 13.
It replaces the history-hang probe, which hard-coded the installed CLI (#115 M0).
…ptance-sized verdicts, selection tested without the run path

compare --same-host permits TMPDIR unset -> session as well as inherited -> session: a prepared serve starts from env -i,
so a real baseline's launch has no TMPDIR; a test connects the generated serve environment, the production launch, its
witness and the comparison. A same-host comparison of runs off the harness's default plan is DIAGNOSTIC, never PASS, and
tz-probe's verdict is diagnostic for anything but 80 runs at 15 s (and refuses counts that do not account for each run).
The parity CLI's selection is parseSelection, tested without reading a preparation journal or reaching a device.
…v capture, fingerprint, experiment A, app-server capture and replay)

The golden generator (scripts/sandbox-golden) renders the original's seatbelt argv at rust-v0.159.2
from its own crates; 20 fixtures under test/fixtures/sandbox/seatbelt. The argv capture of the signed
CLI equals the generator's for cua's two inputs; the signed and public builds fingerprint and behave
alike; the native helper accepts the replayed initialize, configRequirements/read and config/read.
Evidence and verdicts: docs/evidence/2026-10-17-own-sandbox/m0/.
…iltered kernel environment), the mini's native-run rules, M0a's verdicts
…prompt; M2's pin change and the mini's resident update
…keeps only allowlisted settings

Keys are normalized to snake_case before the credential/account/identifier match, so authToken, apiKey,
accountId and installationId are withheld whatever their value; the enum-word exception is replaced by
SAFE_SETTINGS, four exact paths with their allowed values. Re-auditing every committed exchange
(app-server.mjs reaudit) changes only the reason recorded for installationId.
…proves is its own

A helper is the run's only when its CODEX_CLI_PATH is the run's own CLI slot (helpers.mjs); any
other helper, started before or during the run, is counted as foreign and never signalled, and a
helper whose environment cannot be read fails the run.
…lter, not only allow/deny

Checks match by (op, filter, label) and compare {result, errno}, so a sandbox EPERM and a refused
connection no longer compare equal. The committed signed and public fingerprints still compare equal
(every failed connect, link and clone is EPERM under both).
…opy in place (--approved-runtime), with the real HOME, the run's own XDG_CONFIG_HOME and the home's state/ and run/ moved aside and back
… GCE own-host computer baseline, the mini's run rules
…endor control's first attempt (file URL access off), mini vendor computer run-1 and the sitting log up to the prompt
…cases, 492 covered, the #135 vendor defect recorded), after turning on file URL access for the box's extension; the idle check also requires Terminal frontmost
…, run-owned helper stop and lossless state moves (review fixes 1-3)
…op at once on a non-Terminal frontmost app, propagate failures, archive only verified fresh evidence (review fixes 4-6)
…' booleans; the committed result redacted to match (review minor)
…wn TMPDIR, no global environment scan; the 10:52Z vendor run-1 superseded for the retaken triple (review round 2, findings 1-2)
…e acceptance report validated by its own fields (review round 2, finding 3 and the minor)
…ted on the remote launch body itself (review round 3)
…nvironment carries the launch's marker (review P1)
…h its whole tree ended, TERM then KILL, bounded (review P2)
…Node, platform and launcher identity; the verdict refuses a pair that differs in anything but the tested permission (review P2)
@SSFSKIM
SSFSKIM merged commit 90cbfe0 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.

1 participant