Skip to content

fix(hub): bundle workspace tool runner before sandbox startup - #115

Merged
TheGreatAxios merged 2 commits into
mainfrom
fix/posix-child-prebuild
Nov 4, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
fix/posix-child-prebuild

Conversation

@etodanik

@etodanik etodanik commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Designers could not read project documents or create mockups because the
sandboxed tool runner failed to resolve @intx/tools-posix. The package
was installed, but Bun's workspace package lookup required access to
repository paths outside the sandbox's read policy.

Bundle the trusted tool runner and its dependencies before isolation,
then execute that bundle inside the existing sandbox. This removes
runtime package discovery without expanding filesystem or network access.

Add a sandbox behavior test that verifies:

  • Workspace output can be written and read.
  • Host files cannot be read or changed.
  • Approved inputs remain readable and cannot be changed.

Fixes #123

@corbits-triage

corbits-triage Bot commented Nov 3, 2026

Copy link
Copy Markdown

Open an issue for this change first, then a pull request that links it.

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-sandbox bundle is the right fix for the package lookup. One leftover from the old entry path: the sandbox still allow-reads apps/hub/src/builds for a reason that no longer applies. Detail is on the new child command.

Not asking for the other items that came up while reading this:

  • Rebuilding on each createPosixBuildExecutor is real, but it is once per executor (sidecar lease or live-app start), not per tool call, and a warm build is tens of milliseconds. Memoizing it can wait.
  • Do not fail the new isolation test when CI is set. The required test job is ubuntu-24.04 with only bun install. bubblewrap, socat, and kernel.apparmor_restrict_unprivileged_userns=0 are set up on e2e-pipeline, which does not run this file and is continue-on-error. A hard fail would red test on every apps change. The skip is why that job stays green; the test simply does not gate CI today.
  • Leave minify: true with no sourcemap. An unminified bundle or an inline sourcemap puts repository paths back into a file the sandbox is allowed to read.

Comment thread apps/hub/src/builds/posix-sandbox.ts Resolved
@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

CL-11875

Bundle posix-child.ts and its dependencies before entering the sandbox.

Run the bundle with Bun so tool startup no longer needs repository-wide
package discovery that the sandbox correctly blocks.

This affects tool calls for design process.
@etodanik
etodanik force-pushed the fix/posix-child-prebuild branch from 52ca312 to 46eb519 Compare November 3, 2026 19:26
The bundled tool runner no longer needs to read the hub source directory. Remove that allowlist entry and verify source reads are denied in the existing sandbox behavior test.
@TheGreatAxios
TheGreatAxios added this pull request to the merge queue Nov 4, 2026
@corbits-triage

corbits-triage Bot commented Nov 4, 2026

Copy link
Copy Markdown

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Merged via the queue into main with commit de44e8e Nov 4, 2026
9 checks passed
@etodanik
etodanik deleted the fix/posix-child-prebuild branch November 4, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Designers crash because of failure to resolve @intx/tools-posix

2 participants