@@ -80,16 +80,49 @@ test('R74 rejects new symbols on a classified edge', () => {
8080 assert . match ( found [ 0 ] ! . message , / e n s u r e L o c a l P l a t f o r m D e v i c e R e a d y , e x t r a R e a d i n e s s / ) ;
8181} ) ;
8282
83- test ( 'R74 matches a dynamic import by target with empty symbols ' , ( ) => {
83+ test ( 'R74 matches a destructured dynamic import by target with the recorded bindings ' , ( ) => {
8484 const sources = {
8585 'src/platform-runtime-operation-host.ts' :
8686 'export async function recoverLegacyAppLogMarkersAfterDaemonLock() { return {}; }\n' ,
8787 'src/daemon/server/daemon-runtime.ts' :
88- "const mod = await import('../../platform-runtime-operation-host.ts');\nvoid mod;\n" ,
88+ "const { recoverLegacyAppLogMarkersAfterDaemonLock } = await import('../../platform-runtime-operation-host.ts');\n" +
89+ 'void recoverLegacyAppLogMarkersAfterDaemonLock;\n' ,
8990 } ;
9091 assert . deepEqual ( edgeViolations ( sources , 'src/daemon/server/daemon-runtime.ts' ) , [ ] ) ;
9192} ) ;
9293
94+ test ( 'R74 rejects an expanded destructured dynamic import on a classified edge' , ( ) => {
95+ const sources = {
96+ 'src/platform-runtime-operation-host.ts' :
97+ 'export async function recoverLegacyAppLogMarkersAfterDaemonLock() { return {}; }\n' +
98+ 'export async function extraLegacyMarkerSweep() { return {}; }\n' ,
99+ 'src/daemon/server/daemon-runtime.ts' :
100+ "const { recoverLegacyAppLogMarkersAfterDaemonLock, extraLegacyMarkerSweep } = await import('../../platform-runtime-operation-host.ts');\n" +
101+ 'void [recoverLegacyAppLogMarkersAfterDaemonLock, extraLegacyMarkerSweep];\n' ,
102+ } ;
103+ const found = edgeViolations ( sources , 'src/daemon/server/daemon-runtime.ts' ) ;
104+ assert . equal ( found . length , 1 ) ;
105+ assert . equal ( found [ 0 ] ! . rule , DAEMON_PLATFORM_RUNTIME_RULE ) ;
106+ assert . match ( found [ 0 ] ! . message , / c l a s s i f i e d s y m b o l s d r i f t e d / ) ;
107+ assert . match (
108+ found [ 0 ] ! . message ,
109+ / e x t r a L e g a c y M a r k e r S w e e p , r e c o v e r L e g a c y A p p L o g M a r k e r s A f t e r D a e m o n L o c k / ,
110+ ) ;
111+ } ) ;
112+
113+ test ( 'R74 rejects a namespace-form dynamic import that hides the recorded bindings' , ( ) => {
114+ const sources = {
115+ 'src/platform-runtime-operation-host.ts' :
116+ 'export async function recoverLegacyAppLogMarkersAfterDaemonLock() { return {}; }\n' ,
117+ 'src/daemon/server/daemon-runtime.ts' :
118+ "const mod = await import('../../platform-runtime-operation-host.ts');\nvoid mod;\n" ,
119+ } ;
120+ const found = edgeViolations ( sources , 'src/daemon/server/daemon-runtime.ts' ) ;
121+ assert . equal ( found . length , 1 ) ;
122+ assert . equal ( found [ 0 ] ! . rule , DAEMON_PLATFORM_RUNTIME_RULE ) ;
123+ assert . match ( found [ 0 ] ! . message , / c l a s s i f i e d s y m b o l s d r i f t e d / ) ;
124+ } ) ;
125+
93126test ( 'R74 treats the import and re-export of one classified pair as one entry' , ( ) => {
94127 const sources = {
95128 'src/platform-runtime-open-target.ts' :
0 commit comments