@@ -27,6 +27,14 @@ const FIXED_PID: number = 4242;
2727const CLASSIFIED_SECRET : string = 'qualification-fake-secret-token' ;
2828const CLASSIFIED_SECRET_PRODUCER : string = '@secret/qualification-fixture' ;
2929const CLASSIFIED_SECRET_COMPONENT : string = 'SecretQualificationFixture' ;
30+ const CLASSIFIED_SECRET_COMMAND : string = 'qualification-secret-command' ;
31+ const CLASSIFIED_SECRET_OPERATION : string = 'qualification-secret-operation' ;
32+ const CLASSIFIED_SECRET_PROJECT : string = '@private/qualification-secret-project' ;
33+ const CLASSIFIED_SECRET_PHASE : string = 'qualification-secret-phase' ;
34+ const CLASSIFIED_SECRET_PARENT_SESSION : string = 'qualification-secret-parent-session' ;
35+ const CLASSIFIED_SECRET_PARENT_OPERATION : string = 'qualification-secret-parent-operation' ;
36+ const CLASSIFIED_SECRET_MESSAGE : string = 'qualification-secret-message-text' ;
37+ const CLASSIFIED_SECRET_DIAGNOSTIC : string = 'qualification-secret-diagnostic-summary' ;
3038const PRIVATE_PRODUCER : string = '@private/example-rush-plugin' ;
3139const PRIVATE_COMPONENT : string = 'PrivatePluginImplementation' ;
3240const LOCAL_SENSITIVE_FALLBACK_MESSAGE : string = 'qualification-local-sensitive-fallback-message' ;
@@ -637,6 +645,74 @@ function createEvents(testCase: ICorpusCase, logPath: string): IReporterEventEnv
637645 return events ;
638646}
639647
648+ function createSecretProjectionProbeEvents ( testCase : ICorpusCase ) : IReporterEventEnvelope < unknown > [ ] {
649+ const createProbe = (
650+ eventId : string ,
651+ sequence : number ,
652+ type : IReporterEventEnvelope < unknown > [ 'type' ] ,
653+ payload : unknown ,
654+ scope : IReporterEventEnvelope < unknown > [ 'scope' ] = {
655+ commandName : CLASSIFIED_SECRET_COMMAND ,
656+ operationId : CLASSIFIED_SECRET_OPERATION ,
657+ projectName : CLASSIFIED_SECRET_PROJECT ,
658+ phaseName : CLASSIFIED_SECRET_PHASE
659+ }
660+ ) : IReporterEventEnvelope < unknown > => ( {
661+ protocolVersion : { major : 1 , minor : 1 } ,
662+ eventId,
663+ sessionId : `${ testCase . name } -session` ,
664+ parentSessionId : CLASSIFIED_SECRET_PARENT_SESSION ,
665+ parentOperationId : CLASSIFIED_SECRET_PARENT_OPERATION ,
666+ sequence,
667+ sourceSequence : sequence - 10000 ,
668+ timestamp : FIXED_TIMESTAMP ,
669+ source : {
670+ packageName : CLASSIFIED_SECRET_PRODUCER ,
671+ packageVersion : '1.0.0' ,
672+ component : CLASSIFIED_SECRET_COMPONENT
673+ } ,
674+ scope,
675+ privacy : 'secret' ,
676+ required : true ,
677+ type,
678+ payload
679+ } ) ;
680+
681+ return [
682+ createProbe (
683+ `${ testCase . name } -secret-command` ,
684+ 10001 ,
685+ 'commandStarted' ,
686+ {
687+ commandName : CLASSIFIED_SECRET_COMMAND
688+ } ,
689+ {
690+ commandName : CLASSIFIED_SECRET_COMMAND
691+ }
692+ ) ,
693+ createProbe ( `${ testCase . name } -secret-operation-registered` , 10002 , 'operationRegistered' , {
694+ operationId : CLASSIFIED_SECRET_OPERATION ,
695+ projectName : CLASSIFIED_SECRET_PROJECT ,
696+ phaseName : CLASSIFIED_SECRET_PHASE
697+ } ) ,
698+ createProbe ( `${ testCase . name } -secret-operation-completed` , 10003 , 'operationCompleted' , {
699+ operationId : CLASSIFIED_SECRET_OPERATION ,
700+ status : 'failure'
701+ } ) ,
702+ createProbe ( `${ testCase . name } -secret-message` , 10004 , 'messageEmitted' , {
703+ severity : 'info' ,
704+ text : CLASSIFIED_SECRET_MESSAGE
705+ } ) ,
706+ createProbe ( `${ testCase . name } -secret-diagnostic` , 10005 , 'diagnosticEmitted' , {
707+ diagnosticId : `${ testCase . name } -secret-diagnostic` ,
708+ code : 'RUSH_INTERNAL_UNEXPECTED' ,
709+ category : 'internal' ,
710+ severity : 'info' ,
711+ summary : CLASSIFIED_SECRET_DIAGNOSTIC
712+ } )
713+ ] ;
714+ }
715+
640716async function runCaseAsync (
641717 testCase : ICorpusCase ,
642718 caseDirectory : string ,
@@ -678,6 +754,15 @@ async function runCaseAsync(
678754 plaintextReporter . report ( event ) ;
679755 legacyReporter . report ( event ) ;
680756 }
757+ for ( const event of createSecretProjectionProbeEvents ( testCase ) ) {
758+ // Operation grouping is a separate file-sidecar policy. Exercise shared
759+ // file redaction with records that do not enter the grouping path.
760+ if ( event . type === 'messageEmitted' || event . type === 'diagnosticEmitted' ) {
761+ fileReporter . report ( event ) ;
762+ }
763+ aiReporter . report ( event ) ;
764+ jsonReporter . report ( event ) ;
765+ }
681766 await fileReporter . closeAsync ( ) ;
682767 await aiReporter . closeAsync ( ) ;
683768 await jsonReporter . closeAsync ( ) ;
@@ -820,6 +905,14 @@ async function runCaseAsync(
820905 ! allLocalOutput . includes ( CLASSIFIED_SECRET ) &&
821906 ! allLocalOutput . includes ( CLASSIFIED_SECRET_PRODUCER ) &&
822907 ! allLocalOutput . includes ( CLASSIFIED_SECRET_COMPONENT ) &&
908+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_COMMAND ) &&
909+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_OPERATION ) &&
910+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_PROJECT ) &&
911+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_PHASE ) &&
912+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_PARENT_SESSION ) &&
913+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_PARENT_OPERATION ) &&
914+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_MESSAGE ) &&
915+ ! allLocalOutput . includes ( CLASSIFIED_SECRET_DIAGNOSTIC ) &&
823916 ! machinePresentedOutput . includes ( LOCAL_SENSITIVE_FALLBACK_MESSAGE ) &&
824917 ! machinePresentedOutput . includes ( OVERSIZED_LOCAL_SENSITIVE_VALUE ) &&
825918 ! machinePresentedOutput . includes ( OVERSIZED_LOCAL_SENSITIVE_PRODUCER ) &&
0 commit comments