refactor(daemon): move four pure leaves to their kits

Merged
TH
2mo ago
+604-219

Summary

Closes #2340. Four src/daemon leaves move to the kit whose dependency set already covered them; each is a git rename carrying its tests.

  • parameterized-recorded-fill.ts → @agent-device/selectors/parameterized-recorded-fill
  • code-signature.ts + code-signature-cache.ts → @agent-device/host-kit/code-signature{,-cache}
  • screenshot-overlay{,-draw}.ts, snapshot/screenshot-overlay/{rects,android}.ts, core/react-native-overlay.ts → capture-kit, exposing ./screenshot-overlay and ./react-native-overlay; draw/rects/android stay package internals
  • post-gesture-stability.ts → @agent-device/capture-kit/post-gesture-stability

session-target-evidence.ts is untouched and no re-export shim is left behind.

One behaviour fix rides along, because the moves exposed it (review thread): walkDaemonCodeGraph followed relative specifiers only, so moving daemon code behind workspace specifiers dropped it — and the walker itself — out of the source-checkout signature. It now resolves scoped specifiers through the owning package's exports map, stamping the manifest so a retarget invalidates. Graph from src/daemon.ts: 619 modules on main, 611 after the moves alone, 1459 now.

Issue correction: #2340 names sparse-fallback-screenshot.ts and generic-runtime-execution.ts as overlay consumers, but neither imports it — the real consumers are screenshot-runtime.ts and android-snapshot-timeout-evidence.ts.

Package exports additions sit in their move commits so each compiles and bisects; the R11 export-list pins are the chore(gates) commit.

Validation

Full 58-check sweep at 41dec50; re-run at 266a1ee: format, lint, typecheck, layering (186), eager-closure (454), fallow, production-exports and the signature/daemon-client suites (89) all green.

git diff -M90% --stat origin/main...HEAD: every moved file a rename whose changed lines are specifier switches only.

unit/vitest-related fail on 3 durable-capture tests that fail identically at origin/main 27a97ee and predate this branch; no open PR fixes them.

Eager-closure green with no APPROVED_OVER_CEILING row — rename detection carries each baseline, closures unchanged (56/5/19/32/4/8).

R7 unaffected: SESSION_STATE_FIELD_OWNERS in scripts/layering/session-state.ts names none of the moved files.

Fallow green; no baseline entry is keyed to a moved path, so none needed moving.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK