Context
src/daemon/handlers/__tests__/session-replay-vars.test.ts (2,299 lines, 65 tests, 0 describe blocks) contains zero references to buildReplayBuiltinVars — the only export of the module it is named after (src/daemon/handlers/session-replay-vars.ts, whose real test lives next door in the correctly-named session-replay-builtin-vars.test.ts). What it actually contains (verified 2026-07-28):
- ~450 lines testing
src/replay/vars.ts (buildReplayVarScope, resolveReplayString, collectReplayShellEnv, parseReplayCliEnvEntries, resolveReplayAction) — a module with real precedence/escaping logic and no test file of its own name anywhere.
- ~15 tests of
parseReplayScriptDetailed/readReplayScriptMetadata that are pure duplication — src/replay/__tests__/script.test.ts (589 lines, property-based) already covers both thoroughly.
- ~1,820 lines re-testing
runReplayScriptFile from session-replay-runtime.ts, which already has its own 540-line session-replay-runtime.test.ts (18 direct calls vs this file's 4).
Anyone auditing coverage for these modules lands in the wrong file or concludes coverage is missing. Note: PR #1451 (daemon modularity proposal) will eventually relocate replay tests wholesale — keep this move minimal and mechanical so it doesn't fight that migration.
Task
Redistribute the file's contents to where each test's subject lives; delete true duplicates.
Acceptance criteria
Context
src/daemon/handlers/__tests__/session-replay-vars.test.ts(2,299 lines, 65 tests, 0 describe blocks) contains zero references tobuildReplayBuiltinVars— the only export of the module it is named after (src/daemon/handlers/session-replay-vars.ts, whose real test lives next door in the correctly-namedsession-replay-builtin-vars.test.ts). What it actually contains (verified 2026-07-28):src/replay/vars.ts(buildReplayVarScope,resolveReplayString,collectReplayShellEnv,parseReplayCliEnvEntries,resolveReplayAction) — a module with real precedence/escaping logic and no test file of its own name anywhere.parseReplayScriptDetailed/readReplayScriptMetadatathat are pure duplication —src/replay/__tests__/script.test.ts(589 lines, property-based) already covers both thoroughly.runReplayScriptFilefromsession-replay-runtime.ts, which already has its own 540-linesession-replay-runtime.test.ts(18 direct calls vs this file's 4).Anyone auditing coverage for these modules lands in the wrong file or concludes coverage is missing. Note: PR #1451 (daemon modularity proposal) will eventually relocate replay tests wholesale — keep this move minimal and mechanical so it doesn't fight that migration.
Task
Redistribute the file's contents to where each test's subject lives; delete true duplicates.
Acceptance criteria
src/replay/vars.tstests move tosrc/replay/__tests__/vars.test.ts(new file, co-located with its subject).src/replay/__tests__/script.test.ts; any test asserting something script.test.ts does not cover moves there instead. List the disposition of each in the PR description (moved/deleted-as-duplicate-of-X).runReplayScriptFiletests merge intosession-replay-runtime.test.ts(or a clearly named sibling likesession-replay-runtime-maestro.test.tsif size demands), deduplicating against its existing 18 call sites the same way — one obvious home for that function's coverage afterward.session-replay-vars.test.tsis deleted.pnpm test:unitgreen; changed-line coverage gate (check:coverage-changed) unaffected since no prod lines change.