Repository navigation
Own sandbox M0: oracles, probes, harness extensions and baselines (#115) - #153
Merged
Merged
Conversation
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)
…ssion TMPDIR it inherits
…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).
…) under the helper invoked directly
…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
…aring process and its callers
… 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
…er-directory deny with run/)
…138's HOME dependence, Linux verdicts accepted
…run front-app check
…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
…r sets CUA_BROWSER_SERVICE
…, 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)
… $1, never as part of its source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #115 (M0 of the own-sandbox spec,
docs/doperpowers/specs/2026-10-17-own-sandbox-design.md). No production code undersrc/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
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, thesandbox_checkfingerprint probe, experiment A (public build in the signed CLI's slot), and the app-server capture with a privacy audit and replay.--surfaces browserandcompare --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'scua-gcedevice with lanes by device, host-aware preparation and theconfiguration-transitioncomparator kind, andscripts/sandbox-probe/tz-probe.mjs.--approved-runtimewith 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 underdocs/evidence/2026-10-17-own-sandbox/m0/.CUA_BROWSER_SERVICE.Verdicts
initialize,configRequirements/read,config/read; the replay is accepted. Promote.run/, M3).Validation Evidence
HOME=$(mktemp -d) npm testat d9c027a (after the main merge):# tests 2665,# pass 2498,# fail 1,# skipped 166. The one failure iscreate-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.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.mjswith the above → 159/159 at d9c027a.npm run test:modspass andclaude plugin validate .exit 0 (task 2 report).docs/evidence/2026-10-17-own-sandbox/m0/README.mdand 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,167interpolates${home}(a temp path) intosh -csource, 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-pathfailed once in a full local run during the review fix (acua-*entry in the literal/tmpvanished 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
~/cua-115on the mini (about 9.5 GB) and the stoppedcua-gceinstance 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.