@@ -2,6 +2,7 @@ import assert from 'node:assert/strict';
22import { test } from 'node:test' ;
33import {
44 checkDaemonModularityRatchets ,
5+ checkRetiredInteractionPaths ,
56 checkRetiredSessionLifecyclePaths ,
67 checkRetiredSessionObservabilityPaths ,
78 DAEMON_MODULARITY_BASELINE ,
@@ -317,10 +318,18 @@ test('interaction rejects handler crossings and deep imports around its facade',
317318 'src/daemon/handlers/interaction.ts' ,
318319 "import { refSnapshotFlagGuardResponse } from '../interaction/internal/interaction-flags.ts';\nexport function handleInteractionCommands() {}" ,
319320 ] ,
321+ [
322+ 'src/daemon/handlers/find.ts' ,
323+ "import { preferOnscreenMatches } from '../interaction/internal/find-match-ranking.ts';\nexport function handleFindCommands() {}" ,
324+ ] ,
320325 [
321326 'src/daemon/interaction/internal/interaction-runtime.ts' ,
322327 "import { handleInteractionCommands } from '../../handlers/interaction.ts';\nexport function createInteractionRuntime() {}" ,
323328 ] ,
329+ [
330+ 'src/daemon/interaction/internal/find.ts' ,
331+ "import { handleFindCommands } from '../../handlers/find.ts';\nexport function find() {}" ,
332+ ] ,
324333 [
325334 'src/daemon/generic-settle.ts' ,
326335 "import { createInteractionRuntime } from './interaction/internal/interaction-runtime.ts';" ,
@@ -337,6 +346,10 @@ test('interaction rejects handler crossings and deep imports around its facade',
337346 'src/daemon/interaction/internal/interaction-flags.ts' ,
338347 'export function refSnapshotFlagGuardResponse() {}' ,
339348 ] ,
349+ [
350+ 'src/daemon/interaction/internal/find-match-ranking.ts' ,
351+ 'export function preferOnscreenMatches() {}' ,
352+ ] ,
340353 [
341354 'src/daemon/interaction/internal/interaction-read.ts' ,
342355 'export function readTextForNode() {}' ,
@@ -348,7 +361,7 @@ test('interaction rejects handler crossings and deep imports around its facade',
348361 [ ...baselineEdges ( ) , ...edges ] ,
349362 baselineTypeCycleMembers ( ) ,
350363 ) ;
351- assert . equal ( violations . length , 5 ) ;
364+ assert . equal ( violations . length , 7 ) ;
352365 assert . ok (
353366 violations . some ( ( { message } ) =>
354367 message . includes (
@@ -367,7 +380,7 @@ test('interaction rejects handler crossings and deep imports around its facade',
367380 violations . filter ( ( { message } ) =>
368381 message . includes ( "must not import daemon-interaction's internal tree" ) ,
369382 ) . length ,
370- 4 ,
383+ 5 ,
371384 ) ;
372385} ) ;
373386
@@ -491,6 +504,26 @@ test('session observability rejects restored handler paths', () => {
491504 ) ;
492505} ) ;
493506
507+ test ( 'interaction rejects restored handler paths' , ( ) => {
508+ const restoredPaths = [
509+ 'src/daemon/handlers/find.ts' ,
510+ 'src/daemon/handlers/interaction-touch-direct-ios-regressed.ts' ,
511+ 'src/daemon/handlers/interaction-common-regressed.ts' ,
512+ 'src/daemon/interaction/internal/find.ts' ,
513+ ] as const ;
514+ const violations = checkRetiredInteractionPaths ( restoredPaths ) ;
515+
516+ assert . deepEqual (
517+ violations . map ( ( { file, message } ) => ( { file, message } ) ) ,
518+ restoredPaths . slice ( 0 , 3 ) . map ( ( file ) => ( {
519+ file,
520+ message :
521+ `retired interaction path was restored: ${ file } . ` +
522+ 'Keep the neutral seam at its daemon owner instead of rebuilding a handler grab-bag.' ,
523+ } ) ) ,
524+ ) ;
525+ } ) ;
526+
494527test ( 'R9 records zone ceilings and keeps engine files outside the largest component' , ( ) => {
495528 // One commands file and one engine file traded for two provider-webdriver ones, so the
496529 // total stays at the baseline and only the per-zone claims are on trial.
0 commit comments