Repository navigation
refactor(daemon): relocate the find tests by what they assert - #3693
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
The move itself looks right, but one assertion from the deleted root test is now lost: nothing at 17ec921 checks the sparse find-wait hint, and CI is green (16/16) with no conflicts. The old root test checked that Not blocking, and you can take or leave these: Could the production-route half use I did not run the suites or your mutation checks. I also did not trace whether the daemon capture runtime ever writes a sparse capture to the session, or whether the two ambiguous-match click cases on Once the hint assertion is in the command-side test, this is ready to merge. |
|
Confirmed and fixed in 3312002. |
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The sparse-tree test now asserts details.reason 'sparse tree' again, with the code and an unchanged-session check, and the test has a new name, so the earlier gap at 2b38ce1 is fixed. The relocated find tests are ready on code, and all 16 checks pass. The delta touches only two test files, so no production route is involved. I did not run the test suites or the reported mutation checks (hint removed gives 1/20 failing, non-sparse verdict gives 1/4 failing), so that evidence is the author's own and still needs the maintainer to accept it. The fixture-duplication and hard-coded dispatched-point notes from the earlier review are unchanged, and I did not re-evaluate them. No conflicts. Nothing else blocks merge once the maintainer accepts. Could the new fakes reuse what command-surface-fake.ts already has? One option is to export forwardingCreateCommandSurface's captureIntoSession and use it in place of the new captureAndStoreSnapshot. Another is to have the legacy-capture helper call installInteractorSnapshotResolution and point mockInteractorSnapshot at captureSnapshotThroughLegacyDispatchFixture. Daemon test support would then keep one interactor-resolution installer and one capture-and-store routine. The Cubic thread on the sparse test (#3693 (comment)) is fixed at this head, so you can resolve it. No other open review threads apply. |
|
Accepting the gap at 2b38ce1 as fixed (sparse test asserts code, |
|
Thanks. With the gap at 2b38ce1 accepted as fixed, this PR has no open blockers: the code is ready, all checks pass, and there are no conflicts. Moving the fake consolidation to the follow-up after the stack merges is fine. |
…gacy-capture interactor resolution Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mand cases land beside the selector read (c) find-ambiguous-match: 4 daemon ambiguity/--first cases (a) run on the inert surface; the 2 list cases (a) keep ref issuance and the partial ref frame on a listing surface member, and their command-side halves (list returns every match, unique included) are new (c) tests in selector-read-find-list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a) and command-side carried-node action (c) find-production-route: the two producer cases (a) assert the node find selected reaches the command surface as preresolvedTarget through the real interaction handler; the four cases that asserted the dispatched point (including the diverged-tree invariants) are command behavior (c) and land as preresolved-target tests beside the interaction runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… runtime (a) find-read-only: all four cases are daemon decisions (forced-fresh polling, Android freshness recovery, sparse capture storing nothing, recording deferral) and run on a polling find member over the daemon's real capture backend. The command-side wait/sparse behavior is already pinned by selector-read.test.ts (runtime find wait ...). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed-target command test for its module (R84) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p the daemon test to what the daemon decides Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eout cannot pass for it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2b38ce1 to
e984462
Compare
|
Summary
Part 1 of 3 of the find/settle batch of the daemon test redesign (no test exports of any kind): the three
find-*root tests undersrc/__tests__/daemon-composition/interaction/that drove the find handler with the real command surface. Daemon halves (a) run against two new unexported package fakes; assertions about what the realsrc/commands/interaction/**code does (c) moved beside that code. Parts 2 (settle, disclosure, capture) and 3 (target evidence) follow one at a time. The original 15-commit branch is about 1,970 added lines, so it is split by dependency to stay reviewable (this part: ~510 added).New package fixtures, both new files, nothing shared edited:
support/command-surface-override-fake.ts(a surface whose named members are replaced per case) andsupport/legacy-capture-interactor-resolution.ts(installs anInteractorResolutionthat routes legacy snapshot capture through the shared capture double).a / c split and test-count parity
Before = exact count at the old path (vitest JSON reporter,
origin/main); after = run count per destination on this head.find-ambiguous-match(6)execution/interaction/internal/find-ambiguous-match.test.ts(6; the twolistcases run on a listing member and keep ref issuance and the partial ref frame)src/commands/interaction/runtime/selector-read-find-list.test.ts(2: "list returns every match", "unique match still lists")find-production-route(4)execution/interaction/internal/find-production-route.test.ts(2: the surface receivespreresolvedTargetfor click and for fill)src/commands/interaction/runtime/interactions-find-carried-target.test.ts(4: press/fill act on the carried node; a diverged stored tree cannot retarget)find-read-only(4)execution/selector-runtime-find-read-only.test.ts(4)selector-read.test.ts(below)14 tests before; 18 after (+4: the command halves of the two splits).
One assertion had been dropped and is restored: the sparse find-wait hint. The old root test checked
details.hintagainst/snapshot quality verdict is sparse/; the hint is command-authored (sparseSelectorSnapshotErrorinselector-read-utils.ts), and the daemon test now runs on a fake surface that writes its own error. The command-side testselector-read.test.ts"runtime find wait reports sparse snapshot verdicts on the selector-read route" now asserts the message,details.reasonanddetails.hint. Mutation: deleting thehintline fromsparseSelectorSnapshotErrorfails exactly that test (1/20 across the file). The daemon-side sparse test no longer asserts command-authored message or reason (its fake wrote them); it keeps the daemon-owned part: the refusal passes through asCOMMAND_FAILEDand the stored tree is untouched.One assertion was strengthened: "handleFindCommands wait captures fresh snapshots while polling" asserted
>= 2dispatches because the real surface owned the poll count; the fake owns it now, so it asserts exactly 3. The other command-authored assertions of the three source files are accounted for: the ambiguous-matchdetails.matches/candidatesstay in the daemon test (daemon-authored inselector-match-errors.ts), thelistdata and ref-frame assertions moved with the split to the daemon test andselector-read-find-list.test.ts, and the dispatched point(310, 510)is asserted command-side ininteractions-find-carried-target.test.ts(SAVE_CENTER).vi.mockNo
vi.mockin any destination file; the onlyvi.fnspies are local to the production-route test's fake surface members, whose recorded calls are asserted (preresolvedTargetforwarding).Mutation checks
internal: { findResolvedTarget: preresolvedTarget(match) }withinternal: {}failsfind-production-route"find: stop chaining two resolution engines on mutating actions #1654 production route: find click carries its resolved node" (1/2).forceFresh: needsFreshSnapshotwithforceFresh: falseinselector-runtime-backend.tsfails "handleFindCommands wait captures fresh snapshots while polling" (1/10 across the find tests).Selection
All destinations match
packages/*/src/**/*.test.tsorsrc/**/*.test.ts, sounit-coreselects them (pnpm test:unit,test:coverage); the sources were already inunit-core.check:affected --runran thevitest relatedleg and passes.Subpath exports
daemonNo subpath is freed here: the
./testing/*entries these tests used are still imported by parts 2 and 3, which delete them. No new subpath, barrel orexport *.Notes
src/commands/interaction/runtime/(interactions-find-carried-targetforinteractions.ts,selector-read-find-listforselector-read.ts).Validation
check:quick,check:layering,check:fallow,check:gate-manifestandcheck:affected --runpass on this head.🤖 Generated with Claude Code