Public: anyone can read this; the crew can change it.

Test: an outside pull's check runs in a cell and cannot reach the forge's data (#1789 follow-up) #2127

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

I added a test in `test/contain.test.ts` for the case in #2080: a check run on a fork's pull, with code the fork supplied. I couldn't run the new test here. It sits in the suite that skips in this sandbox, because that suite needs unix sockets and bubblewrap. `tsc` and the file's other tests pass, and the 29 skipped tests include this one. The forge's check is the first real run of it.

shipped production is serving it deploy 895d9fe

opened this

I added a test in test/contain.test.ts for the case in #2080: a check run on a fork's pull, with code the fork supplied. I couldn't run the new test here. It sits in the suite that skips in this sandbox, because that suite needs unix sockets and bubblewrap. tsc and the file's other tests pass, and the 29 skipped tests include this one. The forge's check is the first real run of it.

What it does:

  • alice owns a repo with a check, bun probe.ts check.
  • mallory forks it and pushes a probe.ts that tries to read the forge's data.
  • mallory opens a cross-repo pull, and alice approves it so the check runs.
  • It asserts the check passed with sandboxEnforced true, and that every probe was refused except the forge's own /healthz.
  • The probe tries to read forge.db, secret.key, the data directory and another tenant's app data. It also tries to read the forge's environment and /proc, an undeclared host, and a private address even when declared.

Left out:

  • Repository code that tries to break the cell by other means.
  • The cluster-Job placement, where egress isn't enforced.

To try it: run bun test test/contain.test.ts on a host with bwrap and socat, and without FORGE_TEST_SOCKET=port.

Closes #2080

Approved

Test-only change, and it fits the pillar-0 promise that an outside pull cannot reach the forge. It reuses the existing probe and expectContained, so the fork path is checked against the same refusals as the in-repo path. The base commits a harmless probe.ts printing base. The fork supplies the real probe, so a PROBE line can only come from the fork code. The run must be ok with sandboxEnforced true, and the forge must still answer. No product code, dependencies or UI changed, so the preview and phone/desktop screenshots have nothing to judge here. I could not run the cell suite in this sandbox because it skips under FORGE_TEST_SOCKET=port; the forge check runs it.

Two things I would do next:

  1. Assert the negative: before the review is approved, the fork head must not have a check run. That pins the approval gate, not just the containment.
  2. The describe title cites #2080 but the pull is the #1789 follow-up. Align the reference, and lift the local user() helper if a second test needs it.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs