refactor(daemon): move four pure leaves to their kits - #2347
Open
thymikee wants to merge 6 commits into
Open
Conversation
`parameterized-recorded-fill.ts` has no value dependency on the daemon: it reads a `TargetAnnotationV1` type from contracts and calls `selectorContainsValue`, so its whole value graph already sits inside `@agent-device/selectors`. Move it there behind its own subpath and let the two daemon consumers reach it by specifier. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK
`code-signature.ts` fingerprints a checkout from `node:crypto`/`fs`/`path` and `findProjectRoot`; `code-signature-cache.ts` adds a stat-validated cache over it through `publishFileSync`. Neither reaches the daemon, and both questions — what does this source tree hash to, and can that hash be replayed from stat alone — are host mechanics. Move both into host-kit behind their own subpaths, carrying `code-signature-cache.test.ts` unchanged apart from its specifiers, and let the launch spec and server lifecycle reach them by specifier. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK
`screenshot-overlay.ts` decides which snapshot nodes earn a ref and where the ref lands on a screenshot; `screenshot-overlay-draw.ts` paints them. Both read kernel snapshot vocabulary, contracts snapshot predicates, and capture-kit's own PNG and rect-projection mechanics — nothing from the daemon. The two `src/snapshot/screenshot-overlay/` helpers had no other importer, and `react-native-overlay.ts` sits on kernel plus its contracts vocabulary alone. Move the cluster into capture-kit as flat siblings of the PNG and projection modules it already used, exposing `./screenshot-overlay` and `./react-native-overlay`; the draw, rects, and android halves stay package internals with no subpath of their own. The moved tests carry over unchanged apart from their specifiers, over a package-local snapshot-state fixture. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK
`post-gesture-stability.ts` polls a caller-supplied snapshot function until a surface settles. It is generic over its snapshot and signature types and reads only host-kit diagnostics and `sleep`, so the loop is capture mechanics with no daemon knowledge; the daemon keeps the pending record, the comparator, and the verdict wiring it hands in. The verdict test stays in `src/daemon` because it composes the loop with the daemon's own `interaction-outcome-policy.ts`; only its specifier changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK
R11 pins every workspace package's exact subpath set, so the four moves need
their new specifiers named: `@agent-device/selectors/parameterized-recorded-fill`,
`@agent-device/host-kit/code-signature{,-cache}`, and
`@agent-device/capture-kit/{screenshot-overlay,react-native-overlay,post-gesture-stability}`.
The selectors comment counted its subpaths in prose; it now counts four and
says what the fourth is. No eager-closure row is needed: every new entry is a
rename the merge-base reader follows, and each closure is unchanged
(56/5/19/32/4/8), so all six fall under no-growth rather than the new-entry
ceiling.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK
Size Report
Startup median (7 runs, lower is better):
|
The `fallow-ignore-next-line code-duplication` on the package-local snapshot-state fixture suppressed nothing: `fallow dupes` reports three clone groups on this tree and the fixture is in none of them, with or without the comment. A suppression that matches no finding is dead weight at best and a stale-suppression failure at worst. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2340. Four
src/daemonleaves 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-fillcode-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-overlayand./react-native-overlay; draw/rects/android stay package internalspost-gesture-stability.ts→@agent-device/capture-kit/post-gesture-stabilitysession-target-evidence.tsis untouched and no re-export shim is left behind.Issue correction: #2340 names
sparse-fallback-screenshot.tsandgeneric-runtime-execution.tsas overlay consumers, but onmainneither imports it — the real consumers arescreenshot-runtime.tsandandroid-snapshot-timeout-evidence.ts.The moved capture-kit tests use a package-local snapshot-state fixture, as a package test cannot reach root
src/__tests__(the repo's existing shape:tmp-dir.fixtures.tsin capture-kit and host-kit).fallow dupesreports 3 clone groups on this tree and the fixture is in none, so it carries no suppression.Package
exportsadditions sit in their move commits, not the finalchore(gates)one, so each implementation commit compiles and bisects; the R11 export-list pins are the gate edit.Validation
Full gate sweep at
41dec50; headc4f5633only deletes a comment line, revalidated with format, lint, typecheck and the two moved capture-kit suites (20 tests green).git diff -M90% --stat origin/main...HEAD: 31 files, every moved file a rename whose changed lines are specifier switches only.pnpm check:affected --runfails open to all 58 checks. Every local gate green exceptunit/vitest-related, which fail on 3 durable-capture tests that fail identically atorigin/main27a97ee and predate this branch; no open PR fixes them.Eager-closure green with no
APPROVED_OVER_CEILINGrow — rename detection carries each baseline and closures are unchanged (56/5/19/32/4/8).R7 unaffected:
SESSION_STATE_FIELD_OWNERSinscripts/layering/session-state.tsnames none of the moved files; grepping the five basenames there returns nothing.Fallow green, and no baseline entry in
fallow-baselines/is keyed to any moved path, so none needed moving.🤖 Generated with Claude Code
https://claude.ai/code/session_01BPFjVXwbDrXPqp5W6K2iDK