@@ -697,6 +697,52 @@ describe("Slack live QA runtime helpers", () => {
697697 }
698698 } ) ;
699699
700+ it ( "classifies only exact Slack commentary lane presentations" , ( ) => {
701+ const scenario = testing . findScenario ( [ "slack-progress-commentary-true" ] ) [ 0 ] ;
702+ const run = scenario ?. buildRun ( "U999999999" ) ;
703+ const input = run && "input" in run ? run . input : "" ;
704+ const commentaryMarker = input . match ( / S L A C K - Q A - C O M M E N T A R Y - [ 0 - 9 A - F ] { 8 } / u) ?. [ 0 ] ;
705+ const finalMarker = input . match ( / S L A C K - Q A - C O M M E N T A R Y - D O N E - [ 0 - 9 A - F ] { 8 } / u) ?. [ 0 ] ;
706+ const verifyObserved = run && "verifyObserved" in run ? run . verifyObserved : undefined ;
707+ if ( ! commentaryMarker || ! finalMarker || ! verifyObserved ) {
708+ throw new Error ( "missing Slack progress commentary lane verifier" ) ;
709+ }
710+ const verifyCommentaryMessage = ( message : { blockText ?: string [ ] ; text : string } ) =>
711+ verifyObserved ( {
712+ finalMessage : { text : finalMarker , ts : "2.000000" } ,
713+ messages : [
714+ {
715+ channelId : "C123456789" ,
716+ ...message ,
717+ ts : "1.500000" ,
718+ } ,
719+ {
720+ channelId : "C123456789" ,
721+ text : finalMarker ,
722+ ts : "2.000000" ,
723+ } ,
724+ ] ,
725+ } ) ;
726+
727+ for ( const message of [
728+ { text : `_${ commentaryMarker } _` } ,
729+ { text : ` \n_${ commentaryMarker } _\t` } ,
730+ { text : `💬 ${ commentaryMarker } ` } ,
731+ { blockText : [ "Update" , commentaryMarker ] , text : "Working…" } ,
732+ ] ) {
733+ expect ( ( ) => verifyCommentaryMessage ( message ) ) . not . toThrow ( ) ;
734+ }
735+ for ( const text of [
736+ commentaryMarker ,
737+ `prefix _${ commentaryMarker } _ suffix` ,
738+ `_${ commentaryMarker } _\nmore` ,
739+ ] ) {
740+ expect ( ( ) => verifyCommentaryMessage ( { text } ) ) . toThrow (
741+ "expected commentary in the Slack progress commentary lane" ,
742+ ) ;
743+ }
744+ } ) ;
745+
700746 it ( "rejects commentary when false and mismatched tool progress" , ( ) => {
701747 const verify = (
702748 scenarioId : string ,
0 commit comments