@@ -186,12 +186,14 @@ function runHooksRuntimeVisibilityScenarios(context) {
186186 hookEventName : 'Stop' ,
187187 assistantMessage : 'All work is complete.'
188188 } )
189- assert . match ( missingPrecheckReminder . systemMessage || '' , / e n t r y c h e c k b l o c k / i)
189+ assert . match ( missingPrecheckReminder . systemMessage || '' , / c l o s u r e i n c o m p l e t e | e n t r y c h e c k b l o c k / i)
190190 const duplicateMissingPrecheckReminder = run ( {
191191 hookEventName : 'Stop' ,
192192 assistantMessage : 'All work is complete.'
193193 } )
194- assert . ok ( ! duplicateMissingPrecheckReminder . systemMessage )
194+ const duplicateMessage = duplicateMissingPrecheckReminder . systemMessage || ''
195+ assert . ok ( ! / e n t r y c h e c k b l o c k / i. test ( duplicateMessage ) )
196+ assert . match ( duplicateMessage , / S t o p g a t e i n c o m p l e t e | i n c o m p l e t e c l o s u r e / i)
195197 captureEntries = fs . readFileSync ( CAPTURE_LOG , 'utf8' ) . trim ( ) . split ( / \r ? \n / ) . map ( line => JSON . parse ( line ) )
196198 assert . strictEqual ( captureEntries . length , 2 )
197199 assert . strictEqual ( captureEntries [ 1 ] . eventName , 'Stop' )
@@ -204,7 +206,7 @@ function runHooksRuntimeVisibilityScenarios(context) {
204206 assistantMessage : 'All work is complete.'
205207 } , TEMP_ROOT , { DEVCODEX_HOOK_ENFORCEMENT : 'strict' , CODEX_HOME : '1' } )
206208 assert . strictEqual ( strictStopBlock . decision , 'block' )
207- assert . match ( strictStopBlock . reason || '' , / e n t r y c h e c k b l o c k / i)
209+ assert . match ( strictStopBlock . reason || '' , / S t o p g a t e i n c o m p l e t e | i n c o m p l e t e c l o s u r e | e n t r y - c h e c k - m i s s i n g / i)
208210 assert . ok ( ! strictStopBlock . hookSpecificOutput ?. decision )
209211 assert . ok ( readInterceptionEntries ( ) . some ( entry => entry . eventName === 'Stop' && entry . code === 'closure-incomplete' && entry . effective === true ) )
210212
@@ -273,7 +275,7 @@ function runHooksRuntimeVisibilityScenarios(context) {
273275 hookEventName : 'Stop' ,
274276 assistantMessage : 'Final answer without compliance block or artifact paths.'
275277 } )
276- assert . match ( missingComplianceAndPathsReminder . systemMessage || '' , / 合 规 检 查 状 态 块 未 输 出 / )
278+ assert . match ( missingComplianceAndPathsReminder . systemMessage || '' , / 合 规 检 查 状 态 块 未 输 出 | 完 成 检 查 未 输 出 / )
277279 assert . match ( missingComplianceAndPathsReminder . systemMessage || '' , / 用 户 可 见 交 付 不 完 整 .* V i s i b l e O u t p u t H o s t E v i d e n c e G a t e / )
278280 assert . match ( missingComplianceAndPathsReminder . systemMessage || '' , / m i s s i n g I t e m s = .* a r t i f a c t - s e c t i o n / )
279281
@@ -659,7 +661,7 @@ function runHooksRuntimeVisibilityScenarios(context) {
659661 { type : 'text' , text : '### DevCodex · 入口检查\n- PC0 [PASS] Context plan\n- PC1 [PASS] Intent\n- PC2 [PASS] Session\n- PC3 [PASS] Project\n- PC4 [N/A] skipReason=non-dev\n- PC5 [PASS] Host\n- PC6 [PASS] Git\n- PC7 [PASS] Next' }
660662 ]
661663 } )
662- assert . ok ( ! contentPartsStop . systemMessage )
664+ assert . ok ( ! / e n t r y c h e c k b l o c k 未 输 出 | e n t r y - c h e c k - m i s s i n g / i . test ( contentPartsStop . systemMessage || '' ) )
663665 let visibleState = JSON . parse ( fs . readFileSync ( STATE_FILE , 'utf8' ) )
664666 assert . strictEqual ( visibleState . visible . precheckStatus , 'verified-present' )
665667
@@ -675,7 +677,7 @@ function runHooksRuntimeVisibilityScenarios(context) {
675677 { role : 'assistant' , content : [ { type : 'text' , text : '### DevCodex · 入口检查\n- PC0 [PASS] Context plan\n- PC1 [PASS] Intent\n- PC2 [PASS] Session\n- PC3 [PASS] Project\n- PC4 [N/A] skipReason=non-dev\n- PC5 [PASS] Host\n- PC6 [PASS] Git\n- PC7 [PASS] Next' } ] }
676678 ]
677679 } )
678- assert . ok ( ! messagesStop . systemMessage )
680+ assert . ok ( ! / e n t r y c h e c k b l o c k 未 输 出 | e n t r y - c h e c k - m i s s i n g / i . test ( messagesStop . systemMessage || '' ) )
679681
680682 cleanState ( )
681683 run ( {
@@ -688,7 +690,7 @@ function runHooksRuntimeVisibilityScenarios(context) {
688690 { message : { role : 'assistant' , content : [ { text : '### DevCodex · 入口检查\n- PC0 [PASS] Context plan\n- PC1 [PASS] Intent\n- PC2 [PASS] Session\n- PC3 [PASS] Project\n- PC4 [N/A] skipReason=non-dev\n- PC5 [PASS] Host\n- PC6 [PASS] Git\n- PC7 [PASS] Next' } ] } }
689691 ]
690692 } )
691- assert . ok ( ! choicesStop . systemMessage )
693+ assert . ok ( ! / e n t r y c h e c k b l o c k 未 输 出 | e n t r y - c h e c k - m i s s i n g / i . test ( choicesStop . systemMessage || '' ) )
692694
693695 cleanState ( )
694696 run ( {
@@ -703,7 +705,7 @@ function runHooksRuntimeVisibilityScenarios(context) {
703705 hookEventName : 'Stop' ,
704706 transcript_path : variantTranscriptPath
705707 } )
706- assert . ok ( ! variantTranscriptStop . systemMessage )
708+ assert . ok ( ! / e n t r y c h e c k b l o c k 未 输 出 | e n t r y - c h e c k - m i s s i n g / i . test ( variantTranscriptStop . systemMessage || '' ) )
707709
708710 cleanState ( )
709711 run ( {
0 commit comments