@sagentlab/navarch-runtime 0.1.36 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -361,6 +361,14 @@ as an explicit read-only mount.
361
361
  user or checked-in legacy `sandbox_mode` from silently disabling the
362
362
  generated profile; Codex authentication still comes from `CODEX_HOME`, and
363
363
  repository instructions such as `AGENTS.md` still load.
364
+ On macOS the profile also grants read access to `/Library/Developer` and
365
+ `/Applications` (Xcode and CoreSimulator, which `xcrun simctl` and
366
+ `xcodebuild` load) and write access to `~/Library/Developer` (simulator
367
+ devices and DerivedData) and `~/Library/Caches/org.swift.swiftpm` (SwiftPM
368
+ repository, artifact, metadata, and manifest caches); the Claude hook gets
369
+ the same write roots. Without these, iOS builds and simulator tests fail
370
+ under the sandbox with
371
+ `access to /Library/Developer/PrivateFrameworks/CoreSimulator.framework is blocked`.
364
372
  - **Gemini:** the runtime uses Gemini CLI's native sandbox with only the
365
373
  current worktree, shared gitdir, session `gh` config, and approved extra
366
374
  roots mounted. The `gh` config and lease MCP settings are read-only; header
@@ -7,6 +7,7 @@ exports.guardHookScriptPath = guardHookScriptPath;
7
7
  exports.readClaudeApiKeyHelper = readClaudeApiKeyHelper;
8
8
  exports.prepareWorktreeGuard = prepareWorktreeGuard;
9
9
  exports.codexToolReadRoots = codexToolReadRoots;
10
+ exports.macosDeveloperWriteRoots = macosDeveloperWriteRoots;
10
11
  exports.sessionGhConfigDir = sessionGhConfigDir;
11
12
  exports.codexWorktreeGuardArgs = codexWorktreeGuardArgs;
12
13
  exports.geminiSandboxMounts = geminiSandboxMounts;
@@ -74,9 +75,12 @@ async function prepareWorktreeGuard(options) {
74
75
  const hookScriptPath = guardHookScriptPath();
75
76
  const configPath = node_path_1.default.join(options.workDir, "worktree-guard.json");
76
77
  const settingsPath = node_path_1.default.join(options.workDir, "claude-settings.json");
78
+ const workspaceRoot = node_path_1.default.resolve(options.workspaceRoot);
77
79
  const allowedRoots = [
78
80
  options.worktreePath,
79
81
  options.repositoryPath,
82
+ // Xcode and SwiftPM's per-user build state; see macosDeveloperWriteRoots.
83
+ ...macosDeveloperWriteRoots().filter((root) => !isPathInside(node_path_1.default.resolve(root), workspaceRoot)),
80
84
  ...(options.extraRoots ?? []),
81
85
  ];
82
86
  const deniedRoots = [options.workspaceRoot];
@@ -110,7 +114,7 @@ async function prepareWorktreeGuard(options) {
110
114
  * installations are sufficient for helpers such as apply_patch, npm, gh, and
111
115
  * browser evidence tooling.
112
116
  */
113
- function codexToolReadRoots(env = process.env) {
117
+ function codexToolReadRoots(env = process.env, platform = process.platform) {
114
118
  const homeDir = env.HOME?.trim() || node_os_1.default.homedir();
115
119
  const codexHome = env.CODEX_HOME?.trim() || node_path_1.default.join(homeDir, ".codex");
116
120
  return [
@@ -126,6 +130,35 @@ function codexToolReadRoots(env = process.env) {
126
130
  "/System/Library/CoreServices/SystemAppearance.bundle",
127
131
  node_path_1.default.join(homeDir, "Library", "Caches", "ms-playwright"),
128
132
  node_path_1.default.join(homeDir, ".cache", "ms-playwright"),
133
+ ...(platform === "darwin" ? MACOS_TOOLCHAIN_READ_ROOTS : []),
134
+ ];
135
+ }
136
+ /**
137
+ * World-readable macOS toolchain locations. `xcrun simctl` / `xcodebuild`
138
+ * load /Library/Developer/PrivateFrameworks/CoreSimulator.framework and the
139
+ * Xcode bundle itself; without these an iOS build or simulator test dies
140
+ * under Codex's seatbelt with "access to ... is blocked". Both are already
141
+ * system prefixes for the Claude hook (bin/worktree-guard-hook.cjs), so this
142
+ * only brings the Codex profile level with it.
143
+ */
144
+ const MACOS_TOOLCHAIN_READ_ROOTS = ["/Library/Developer", "/Applications"];
145
+ /**
146
+ * Per-user macOS build state that Xcode and SwiftPM write during a build or
147
+ * test run: simulator devices and DerivedData under `~/Library/Developer`,
148
+ * plus SwiftPM's repository, artifact, package-metadata, and manifest caches
149
+ * under `~/Library/Caches/org.swift.swiftpm`. Shared between sessions on one
150
+ * machine (that is inherent to these tools), but nothing under these cache
151
+ * roots is Navarch session state or credentials. Deliberately do not grant
152
+ * `~/Library/org.swift.swiftpm` or `~/.swiftpm`, which may contain registry or
153
+ * security configuration. Empty off macOS.
154
+ */
155
+ function macosDeveloperWriteRoots(env = process.env, platform = process.platform) {
156
+ if (platform !== "darwin")
157
+ return [];
158
+ const homeDir = env.HOME?.trim() || node_os_1.default.homedir();
159
+ return [
160
+ node_path_1.default.join(homeDir, "Library", "Developer"),
161
+ node_path_1.default.join(homeDir, "Library", "Caches", "org.swift.swiftpm"),
129
162
  ];
130
163
  }
131
164
  /**
@@ -169,7 +202,7 @@ function codexWorktreeGuardArgs(options) {
169
202
  continue;
170
203
  filesystem[resolved] = "read";
171
204
  }
172
- for (const root of options.extraRoots ?? []) {
205
+ for (const root of [...macosDeveloperWriteRoots(), ...(options.extraRoots ?? [])]) {
173
206
  const resolved = node_path_1.default.resolve(root);
174
207
  // Match the Claude hook's denied-root precedence: an extra root cannot
175
208
  // reopen sibling sessions or metadata inside the Navarch workspace.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sagentlab/navarch-runtime",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
4
4
  "description": "Navarch machine-side session manager: claims delivery tasks and runs them through Claude Code, Codex, Gemini, or OpenCode.",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",