refactor(recording): move gesture telemetry out of the daemon zone - #1985
refactor(recording): move gesture telemetry out of the daemon zone#1985thymikee wants to merge 1 commit into
Conversation
`recording-telemetry.ts` imports only `node:fs`, `node:path` and `@agent-device/contracts/platform` — it has no daemon dependency and is recording-domain file serialization, not daemon behavior. Sitting under `src/daemon/` made the platform-runtime composition root reach up into daemon-server (rank 4) for it. Move it to `src/recording/telemetry.ts`, alongside `output-path.ts` and `overlay.ts`, which share its shape (node builtins plus contracts/kernel). Pure rename: the module body is unchanged and the three import sites are retargeted. This removes one of the composition root's four upward value edges — the only one reaching rank 4. Confirmed with `pnpm depgraph`: those edges drop from 4 to 3 and the daemon-server target is gone, with cycle, back-edge and type-inversion counts unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWLBCBDBpdR8z1aCmDerXS
Size Report
npm unpacked components
Startup median (7 runs, lower is better):
Top changed chunks: no changes in the largest emitted chunks. Top changed packed files
|
|
That is #1874 — "testBareTypeUsesTappedInputWhenSoftwareKeyboardIsHidden fails intermittently on unrelated branches (blocking ios.yml PR gate)" — still open, with Not fixing it here, and not touching the test. This PR renames one TypeScript module ( The base branch is not red: I have re-run the failed job once to confirm. If it comes back red on the same test I will report that here rather than push at it — under #1874 that is a gate problem, not a defect in this diff. Generated by Claude Code |
|
Clean and merge-ready at |
Summary
No behavior change.
recording-telemetry.tswrites the gesture-telemetry sidecar next to arecording; it imports only
node:fs,node:pathand@agent-device/contracts/platform, and has nodaemon dependency at all. Living under
src/daemon/made the platform-runtime composition root(
src/platform-runtime-screen-recording-finalizer-host.ts) reach up intodaemon-server(rank 4)to persist telemetry.
It moves to
src/recording/telemetry.ts, next tooutput-path.tsandoverlay.ts— siblings withthe same shape (node builtins plus contracts/kernel/utils). Named
telemetry.tsrather thanrecording-telemetry.tsto match those siblings, which do not restate the directory.The module body is byte-identical; the diff is the rename plus three retargeted import sites
(
platform-runtime-screen-recording-finalizer-host.ts, its test'svi.mockpath, anddaemon/handlers/record-runtime-response.ts).Effect on the spine. The composition root had four upward value edges. This removes the only one
reaching rank 4:
platform-runtime-screen-recording-finalizer-host.tsdaemon/recording-telemetry.tsplatform-runtime-android-emulator-host.tscore/device-inventory-context.tsprovider-limrun-runtime.tssdk/limrun-runtime-dependencies.tsruntime.tscommands/index.tsbindCommandsis the aggregate binderThe two remaining candidates were left alone deliberately: the limrun one carries an explicit comment
marking it the deliberate seam ("making it lazy would require a proxy interactor"), and
bindCommandsaggregating every command is the purpose of
runtime.ts. Only the emulator-host edge is a realopen question, and inverting it changes a host-factory signature — out of scope here.
This is a small collocation fix, not a step in #1739:
daemon → platformedges are untouched (still61), and the daemon file count drops by one.
Validation
pnpm check:affected --runpassed on this head — 154 test files, 835 tests, "all runnable checkspassed", including both tests that cover the changed imports
(
platform-runtime-screen-recording-finalizer-host.test.tsandhandlers/__tests__/record-runtime-response.test.ts).pnpm typecheckandpnpm check:layeringalso run clean; the layering summary is unchanged from
main(R6 still 7, R11 still 17 packages /95 subpaths / zero root back-imports).
The spine claim above is from
pnpm depgraphbefore and after: composition-root upward value edges4 → 3 with the
daemon-servertarget gone, and value-import cycles (0), spine back-edges (0) andtype-only inversions (7) all unchanged.
No device-facing path is touched — the telemetry writer's behavior, output path and envelope are
untouched — so this owes no live device evidence. Published and reported; CI on this head is the
authority still to come.
Generated by Claude Code