@vzn/vx 0.0.99 → 0.0.100

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.99",
3
+ "version": "0.0.100",
4
4
  "description": "A fast, correct task runner and build cache for JavaScript monorepos.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,10 +17,10 @@
17
17
  "node": ">=18"
18
18
  },
19
19
  "optionalDependencies": {
20
- "@vzn/vx-linux-x64": "0.0.99",
21
- "@vzn/vx-linux-arm64": "0.0.99",
22
- "@vzn/vx-darwin-x64": "0.0.99",
23
- "@vzn/vx-darwin-arm64": "0.0.99"
20
+ "@vzn/vx-linux-x64": "0.0.100",
21
+ "@vzn/vx-linux-arm64": "0.0.100",
22
+ "@vzn/vx-darwin-x64": "0.0.100",
23
+ "@vzn/vx-darwin-arm64": "0.0.100"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -340,7 +340,18 @@ function unlinkOnExit(file: string): void {
340
340
  * that names it outright still reaches it.
341
341
  */
342
342
  function taskTmpdir(tag: string): string {
343
- return path.join(sandboxTmpdir(), `vx-task-${process.pid}-${tag}`)
343
+ return path.join(taskTmpRoot(), `vx-task-${process.pid}-${tag}`)
344
+ }
345
+
346
+ /**
347
+ * The parent of every task's own temp directory, walled off from every
348
+ * sandboxed task, each granted its own directory inside: SRT binds its
349
+ * whole temp dir writable into every task, so a task listed and read what
350
+ * a concurrent one kept in its TMPDIR, or replaced its port bridge's
351
+ * socket (L-10).
352
+ */
353
+ function taskTmpRoot(): string {
354
+ return path.join(sandboxTmpdir(), 'vx-tasks')
344
355
  }
345
356
 
346
357
  const liveTaskTmpdirs = new Set<string>()
@@ -799,6 +810,11 @@ export async function wrapSandboxedCommand(
799
810
 
800
811
  const baselines = canonicalBaselines(args)
801
812
  const customConfig = buildCustomConfig(args, baselines)
813
+ customConfig!.filesystem!.denyRead!.push(toRealPath(taskTmpRoot()))
814
+ customConfig!.filesystem!.allowWrite!.push(toRealPath(tmp))
815
+ // Seatbelt re-allows a read inside a denied region only by name; on Linux
816
+ // a read grant over a write path would remount it read-only.
817
+ if (process.platform === 'darwin') customConfig!.filesystem!.allowRead!.push(toRealPath(tmp))
802
818
  // Linux: the ports a list grants are bridged out of the task's network
803
819
  // namespace. The task's side of each bridge is a socat in front of the
804
820
  // user command, so it goes INTO the sandboxed command; the host side is
@@ -972,7 +988,7 @@ export function bridgedPorts(c: Pick<ResolvedSandboxConfig, 'localBinding'>): nu
972
988
 
973
989
  /** Where a bridge's unix socket lives: the sandbox tmpdir, bound read-write on both sides. */
974
990
  export function portBridgeSocket(tag: string, port: number): string {
975
- return path.join(sandboxTmpdir(), `vx-port-${tag}-${port}.sock`)
991
+ return path.join(taskTmpdir(tag), `vx-port-${tag}-${port}.sock`)
976
992
  }
977
993
 
978
994
  /**