Why
Effect-based session tests adapted an async-disposable temporary-directory fixture through Effect.promise and repeated acquisition wrappers. That duplicated lifecycle wiring at each call site and obscured the fixture policy that canonicalizes paths and retries transient Windows cleanup failures.
What Changes
The shared fixture now exposes a scoped Effect resource directly:
const tmp = yield* tmpdirScoped()
Six acquisitions across Session move, remove, revert, and view tests use that API without manual release callbacks or disposable adaptation. tmpdirScoped() owns acquisition and release with Effect.acquireRelease; the async tmpdir() API and withTempDir share the same make and remove implementation.
Windows Path Contract
The OS boundary deliberately remains on fs/promises. Under Bun on Windows, the callback APIs used by Effect FileSystem returned short RUNNER~1 paths instead of the canonical runneradmin path and could hang during recursive removal. The promise APIs preserve the existing canonical-path contract and the established 30-attempt EBUSY cleanup policy with garbage collection and a 100 ms delay.
Scope
This is test infrastructure only. It preserves the temporary-directory prefix, canonical paths, cleanup policy, and async API; other Promise-based fixture call sites remain available for incremental migration.
Verification
cd packages/core
bun run test
bun run test test/session-move.test.ts test/session-remove.test.ts test/session-revert.test.ts test/session-view.test.ts test/tool-edit.test.ts test/tool-write.test.ts
bun typecheck
cd ../..
bunx prettier --check packages/core/test/fixture/tmpdir.ts packages/core/test/session-move.test.ts packages/core/test/session-remove.test.ts packages/core/test/session-revert.test.ts packages/core/test/session-view.test.ts
bunx oxlint packages/core/test/fixture/tmpdir.ts
git diff --check
git push origin disposable-fixtures
The full Core run passed 3,815 tests and the focused run passed 35 tests. Core typecheck, formatting, fixture lint, diff validation, and the full 33-package push-hook typecheck passed.