Skip to content

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

Open
thymikee wants to merge 6 commits into
mainfrom
claude/2340-daemon-leaf-moves
Open

refactor(daemon): move four pure leaves to their kits#2347
thymikee wants to merge 6 commits into
mainfrom
claude/2340-daemon-leaf-moves

Conversation

@thymikee

@thymikee thymikee commented Sep 6, 2026

Copy link
Copy Markdown
Member

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.

Issue correction: #2340 names sparse-fallback-screenshot.ts and generic-runtime-execution.ts as overlay consumers, but on main neither imports it — the real consumers are screenshot-runtime.ts and android-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.ts in capture-kit and host-kit). fallow dupes reports 3 clone groups on this tree and the fixture is in none, so it carries no suppression.

Package exports additions sit in their move commits, not the final chore(gates) one, so each implementation commit compiles and bisects; the R11 export-list pins are the gate edit.

Validation

Full gate sweep at 41dec50; head c4f5633 only 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 --run fails open to all 58 checks. Every local gate green except unit/vitest-related, which 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 and closures are 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; 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

`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
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.49 MB 4.49 MB 0 B
Package (unpacked) 4.49 MB 4.49 MB 0 B
Package (download) 1.33 MB 1.33 MB +6 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.9 ms 28.7 ms +0.8 ms
CLI --help 82.3 ms 80.2 ms -2.1 ms

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants