Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

test: convergence suite's userDataDir under the run root; docs

reviewd3cf2a216eb2
diff --git a/CLAUDE.md b/CLAUDE.md
index ac3b320d4..eb91cca74 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -7362,7 +7362,9 @@ teardown never throws and is listed first so it runs last: vitest's teardown loo
file, and a throw there would silently skip the tmux sandbox's teardown. The leaf under the root is a
bare `u-`, because every byte added is closer to the macOS unix-socket path budget
(`hook-sock-path.ts`) for anything a test binds under `userDataDir`. A run killed before teardown
-leaves ONE directory.
+leaves ONE directory. A test that builds its own `CorePlatform` takes its `userDataDir` from
+`makeFakeUserDataDir()` (same root, removed with it) — never a bare `mkdtemp` in the system temp
+dir and never a fixed `/tmp/...` literal.
`platform-fake.test.ts` fails if the root is not in effect, so dropping the `globalSetup` entry is loud.
## Conventions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 419c21b7a..3e85679c9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1057,8 +1057,9 @@ production socket on purpose; adding a third is a review conversation, not a che
on first read under one per-run root (`test/setup/fake-platform-root.ts`), and that root is removed
after the last test file finishes. It used to be one `mkdtemp` in the system temp dir per call, never
removed, and a development server collected ~395,000 of them until `/tmp` ran out of inodes and whole
-runs failed with ENOSPC. If you `mkdtemp` in a test yourself, remove it in `afterEach`/`afterAll` — or, for the `userDataDir`
-of a `CorePlatform` you build by hand, call `makeFakeUserDataDir()`, which lands under the same root.
+runs failed with ENOSPC. If you `mkdtemp` in a test yourself, remove it in `afterEach`/`afterAll`
+— or, for the `userDataDir` of a `CorePlatform` you build by hand, call `makeFakeUserDataDir()`,
+which lands under the same root.
**An `infinite` CSS animation is a frame loop, and it runs whether or not anyone is looking.** A
running animation makes the compositor produce a frame every vsync — 120/s on a ProMotion display —
diff --git a/src/core/canvas-sync.convergence.test.ts b/src/core/canvas-sync.convergence.test.ts
index 466e3fa96..03efa1679 100644
--- a/src/core/canvas-sync.convergence.test.ts
+++ b/src/core/canvas-sync.convergence.test.ts
@@ -19,6 +19,7 @@
import { describe, it, expect, beforeEach, afterEach } from 'vitest'
import { initPlatform, resetPlatformForTests, type CorePlatform } from './platform'
+import { makeFakeUserDataDir } from './platform-fake'
import { initCanvasSync, MUTATION_MAX_BYTES } from './canvas-sync'
import { applyCanvasMutation, isCanvasMutation } from '../shared/canvas-mutations'
import { createCanvasOrder, createReconnectWatch, PENDING_TTL_MS } from '../shared/canvas-order'
@@ -69,7 +70,9 @@ class Bus {
private readonly stalled = new Set<number>()
platform: CorePlatform = {
- userDataDir: '/tmp/nodeterm-convergence',
+ // Never a fixed literal: a predictable '/tmp/...' registered through initPlatform is the
+ // js/insecure-temporary-file shape (see canvas-sync.test.ts). Under the run root, removed with it.
+ userDataDir: makeFakeUserDataDir(),
appVersion: '0.0.0-test',
isPackaged: false,
handle: () => {},