@@ -161,21 +161,21 @@ test('logical modules reject forbidden imports', () => {
161161 assert . match ( violations [ 0 ] ! . message , / r e p l a y - t e s t m u s t n o t i m p o r t / ) ;
162162} ) ;
163163
164- test ( 'replay-test rejects request-global and engine-internal imports' , ( ) => {
164+ test ( 'replay-test rejects request-global and replay-port imports' , ( ) => {
165165 const edges = resolveImportEdges (
166166 new Map ( [
167167 [
168168 'packages/replay-test/src/internal/scheduler.ts' ,
169169 [
170170 "import { emitRequestProgress } from '../../../../src/request/progress.ts';" ,
171- "import { readReplayScriptMetadata } from '../../../.. /src/daemon/replay/internal /native-command.ts';" ,
171+ "import { runReplayCommand } from '../../../replay-port /src/daemon-port /native-command.ts';" ,
172172 "import { parseMaestroProgram } from '../../../../src/compat/maestro/program-ir-parser.ts';" ,
173173 ] . join ( '\n' ) ,
174174 ] ,
175175 [ 'src/request/progress.ts' , 'export function emitRequestProgress() {}' ] ,
176176 [
177- 'src/daemon/ replay/internal /native-command.ts' ,
178- 'export function readReplayScriptMetadata () {}' ,
177+ 'packages/ replay-port/src/daemon-port /native-command.ts' ,
178+ 'export function runReplayCommand () {}' ,
179179 ] ,
180180 [ 'src/compat/maestro/program-ir-parser.ts' , 'export function parseMaestroProgram() {}' ] ,
181181 ] ) ,
@@ -190,7 +190,7 @@ test('replay-test rejects request-global and engine-internal imports', () => {
190190 violations . map ( ( { message } ) => message . replace ( / ; .* / , '' ) ) ,
191191 [
192192 'replay-test must not import src/request/progress.ts' ,
193- "packages/ replay-test/src/internal/scheduler.ts must not import daemon- replay's internal tree ( src/daemon/replay/internal/ native-command.ts)" ,
193+ ' replay-test must not import packages/ replay-port/ src/daemon-port/ native-command.ts' ,
194194 'replay-test must not import src/compat/maestro/program-ir-parser.ts' ,
195195 ] ,
196196 ) ;
@@ -230,33 +230,20 @@ test('internal trees reject deep imports globally, including from daemon', () =>
230230 assert . match ( violations [ 0 ] ! . message , / m u s t n o t i m p o r t m a e s t r o ' s i n t e r n a l t r e e / ) ;
231231} ) ;
232232
233- test ( 'daemon replay rejects handler, owner, session-store, and engine deep edges' , ( ) => {
233+ test ( 'replay-port rejects daemon source imports and engine back edges' , ( ) => {
234234 const edges = resolveImportEdges (
235235 new Map ( [
236236 [
237- 'src/daemon/handlers/session.ts' ,
238- "import { runReplayCommand } from '../replay/internal/native-command.ts';" ,
239- ] ,
240- [
241- 'src/daemon/replay/internal/test-command.ts' ,
242- "import { handleSessionCloseCommands } from '../../session-lifecycle/internal/session-close.ts';" ,
237+ 'packages/replay-port/src/daemon-port/test-command.ts' ,
238+ "import { handleSessionCloseCommands } from '../../../../src/daemon/session-lifecycle/index.ts';" ,
243239 ] ,
244240 [
245- 'src/daemon/replay/internal/close-command.ts' ,
246- "import { handleSessionCloseCommands } from '../../session-lifecycle/index.ts';" ,
247- ] ,
248- [
249- 'src/daemon/replay/internal/command-types.ts' ,
250- "import { SessionStore } from '../../session-store.ts';" ,
241+ 'packages/replay-port/src/daemon-port/native-command.ts' ,
242+ "import { SessionStore } from '../../../../src/daemon/session-store.ts';" ,
251243 ] ,
252244 [
253245 'packages/ad-replay/src/internal/step-loop.ts' ,
254- "import { runReplayCommand } from '../../../../src/daemon/replay/internal/native-command.ts';" ,
255- ] ,
256- [ 'src/daemon/replay/internal/native-command.ts' , 'export function runReplayCommand() {}' ] ,
257- [
258- 'src/daemon/session-lifecycle/internal/session-close.ts' ,
259- 'export function handleSessionCloseCommands() {}' ,
246+ "import { runReplayCommand } from '../../../replay-port/src/daemon-port/native-command.ts';" ,
260247 ] ,
261248 [ 'src/daemon/session-lifecycle/index.ts' , 'export function handleSessionCloseCommands() {}' ] ,
262249 [ 'src/daemon/session-store.ts' , 'export class SessionStore {}' ] ,
@@ -269,39 +256,19 @@ test('daemon replay rejects handler, owner, session-store, and engine deep edges
269256 REFERENCE ,
270257 ) ;
271258 assert . deepEqual (
272- violations . map ( ( { file, line, message } ) => ( {
273- file,
274- line,
275- message : message . replace ( / ; .* / , '' ) ,
276- } ) ) ,
259+ violations . map ( ( { file, message } ) => ( { file, message : message . replace ( / ; .* / , '' ) } ) ) ,
277260 [
278261 {
279- file : 'src/daemon/handlers/session.ts' ,
280- line : 1 ,
281- message :
282- "src/daemon/handlers/session.ts must not import daemon-replay's internal tree (src/daemon/replay/internal/native-command.ts)" ,
262+ file : 'packages/replay-port/src/daemon-port/test-command.ts' ,
263+ message : 'replay-port must not import src/daemon/session-lifecycle/index.ts' ,
283264 } ,
284265 {
285- file : 'src/daemon/replay/internal/test-command.ts' ,
286- line : 1 ,
287- message :
288- "src/daemon/replay/internal/test-command.ts must not import daemon-session-lifecycle's internal tree (src/daemon/session-lifecycle/internal/session-close.ts)" ,
289- } ,
290- {
291- file : 'src/daemon/replay/internal/close-command.ts' ,
292- line : 1 ,
293- message : 'daemon-replay must not import src/daemon/session-lifecycle/index.ts' ,
294- } ,
295- {
296- file : 'src/daemon/replay/internal/command-types.ts' ,
297- line : 1 ,
298- message : 'daemon-replay must not import src/daemon/session-store.ts' ,
266+ file : 'packages/replay-port/src/daemon-port/native-command.ts' ,
267+ message : 'replay-port must not import src/daemon/session-store.ts' ,
299268 } ,
300269 {
301270 file : 'packages/ad-replay/src/internal/step-loop.ts' ,
302- line : 1 ,
303- message :
304- "packages/ad-replay/src/internal/step-loop.ts must not import daemon-replay's internal tree (src/daemon/replay/internal/native-command.ts)" ,
271+ message : 'ad-replay must not import packages/replay-port/src/daemon-port/native-command.ts' ,
305272 } ,
306273 ] ,
307274 ) ;
0 commit comments