Follow-up to #164 (which fixed the live-state clobbering in server/state.test.ts).
Status: latent, not currently leaking. Verified on main + #170: a full bun test with CLAUDE_CONFIG_DIR unset and HOME pointed at a temp dir writes no buddy state under the fake home, and a run with the real environment leaves every file in the live state dir untouched except the .substatus.* caches the running statusline owns.
The hazard shape. These files statically import a module that resolves buddy/Claude paths, and never redirect CLAUDE_CONFIG_DIR:
adapters/omp/extension.test.ts
adapters/pi/events.test.ts
adapters/pi/renderers.test.ts
adapters/shared/file-storage.test.ts
adapters/shared/widget-layout.test.ts
core/command-service.test.ts
core/identity.test.ts
server/statusline.test.ts
server/uninstall.test.ts
server/state.test.ts carries a REGRESSION GUARD comment explaining exactly why this is dangerous — the same shape silently overwrote a live companion on every bun test. Today these 9 stay safe only because they happen not to hit a write path with default-resolved paths. That is a property of the current test bodies, not of the setup.
Suggested fix: a shared test bootstrap that points CLAUDE_CONFIG_DIR at a temp dir before any import, so isolation is structural rather than incidental.
🤖 Created with the help of AI (Claude Opus 5).
Follow-up to #164 (which fixed the live-state clobbering in
server/state.test.ts).Status: latent, not currently leaking. Verified on
main+ #170: a fullbun testwithCLAUDE_CONFIG_DIRunset andHOMEpointed at a temp dir writes no buddy state under the fake home, and a run with the real environment leaves every file in the live state dir untouched except the.substatus.*caches the running statusline owns.The hazard shape. These files statically import a module that resolves buddy/Claude paths, and never redirect
CLAUDE_CONFIG_DIR:adapters/omp/extension.test.tsadapters/pi/events.test.tsadapters/pi/renderers.test.tsadapters/shared/file-storage.test.tsadapters/shared/widget-layout.test.tscore/command-service.test.tscore/identity.test.tsserver/statusline.test.tsserver/uninstall.test.tsserver/state.test.tscarries a REGRESSION GUARD comment explaining exactly why this is dangerous — the same shape silently overwrote a live companion on everybun test. Today these 9 stay safe only because they happen not to hit a write path with default-resolved paths. That is a property of the current test bodies, not of the setup.Suggested fix: a shared test bootstrap that points
CLAUDE_CONFIG_DIRat a temp dir before any import, so isolation is structural rather than incidental.🤖 Created with the help of AI (Claude Opus 5).