Remove all test-only DI parameters from handleSessionCommands (signature
drops from ~30 params to 5: req, sessionName, logPath, sessionStore,
invoke) and from the remaining sub-handlers (session-inventory,
session-observability, session-replay, session-close, session-state).
Migrate all 89 remaining node:test unit test files to vitest. Tests that
passed DI overrides now use vi.mock instead. Update vitest.config.ts to
include *.test.ts alongside *.vitest.ts, and remove the dual-runner
node --test from package.json scripts.
Add a permanent CI lint guard that fails if optional typeof DI seams
reappear in production code.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: migrate leaf modules from test-only DI to vitest mocking
Drop optional DI parameters from 6 production modules that existed
solely as test seams. Replace with vi.mock() in new vitest test files.
Production files simplified:
- recording-telemetry.ts: remove writeTelemetry?
- find.ts: remove dispatch?, use dispatchCommand directly
- install-source.ts: remove entire deps? object (7 params)
- session-runtime-command.ts: remove clearRuntimeHints?
- android-system-dialog.ts: remove 4 DI params, simplify internals
- record-trace-recording.ts: remove writeRecordingTelemetry from deps
Closes#281
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: restore DI seams broken by premature removal, fix test script
- request-router.ts: remove 4 dead DI params (snapshotAndroidUi,
reopenAndroidApp, readAndroidAppState, execCommand) from
RequestRouterDeps since recoverAndroidBlockingSystemDialog no
longer accepts them
- session-runtime-command.ts: restore clearRuntimeHints? param that
handleSessionCommands threads through — removing it broke callers
that override the seam
- session.ts: restore clearRuntimeHints pass-through to runtime branch
- session.test.ts: restore the end-to-end runtime clear DI test
- package.json: include vitest in the default `test` script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: rename *.vitest.test.ts → *.vitest.ts to avoid node:test collision
Node's default test discovery matches *.test.ts, which picked up vitest
files and crashed. Rename to *.vitest.ts so the two runners have disjoint
file sets without needing find-based exclusions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use vi.mocked().mock.calls instead of module-level mutable state
Replace manual clearCalls array with direct assertion on the mock,
consistent with the pattern used in request-router-android-modal.vitest.ts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>