Repository navigation
Follow top-level links of harness read roots - #72
Merged
Merged
Conversation
An app worktree outside the home links node_modules to a checkout inside
it. The allowlist granted the worktree but not the link target, so the
sandbox masked the dependencies and `import("zod")` failed. Resolve the
top-level symlinks of each extra read root; deeper links are not scanned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
The home allowlist from #71 grants each
readableRootsentry (the solver app root) but does not follow symlinks inside it. A development worktree outside the home linksnode_modules -> ~/theorem-os/node_modules, so inside the sandbox that directory became an empty mask andimport("zod")failed withCannot find package 'zod'. Running from~/theorem-ositself, or from the/opt/theorem-osimage, was not affected.Fix
harnessReadRootsnow resolves the top-level symlinks of each extra read root and grants targets outside it. Only the top level is followed, because a full scan of a large app root would exhaust the link-scan budget. Credential paths are still masked inside every grant.Tests
tests/harnessProcess.test.ts:node_moduleslinks into it, and reads a dependency through the link; a sibling secret in that checkout stays hidden;bun scripts/build.tspass. 51 related test files: 665 passed, 9 skipped.node_modulesentries and loads zod/smol-toml. sub2api files,~/.codex/auth.json,~/.ssh/known_hostsandmath.envstay unreadable.🤖 Generated with Claude Code