@@ -3115,8 +3115,10 @@ describe('serve app', () => {
31153115 const timestampDir = path . join ( runsDir , runId ) ;
31163116 const resultDir = 'demo-test-greeting--111111111111' ;
31173117 const transcriptArtifactPath = `${ resultDir } /sample-1/transcript.json` ;
3118+ const transcriptRawArtifactPath = `${ resultDir } /sample-1/transcript-raw.jsonl` ;
31183119 const answerArtifactPath = `${ resultDir } /sample-1/outputs/answer.md` ;
31193120 const transcriptPath = path . join ( timestampDir , transcriptArtifactPath ) ;
3121+ const transcriptRawPath = path . join ( timestampDir , transcriptRawArtifactPath ) ;
31203122 const answerPath = path . join ( timestampDir , answerArtifactPath ) ;
31213123 const transcriptJson = `${ JSON . stringify (
31223124 {
@@ -3142,9 +3144,14 @@ describe('serve app', () => {
31423144 null ,
31433145 2 ,
31443146 ) } \n`;
3147+ const transcriptRawJsonl = `${ JSON . stringify ( {
3148+ type : 'raw_event' ,
3149+ message : 'provider event' ,
3150+ } ) } \n`;
31453151
31463152 mkdirSync ( path . dirname ( transcriptPath ) , { recursive : true } ) ;
31473153 writeFileSync ( transcriptPath , transcriptJson ) ;
3154+ writeFileSync ( transcriptRawPath , transcriptRawJsonl ) ;
31483155 mkdirSync ( path . dirname ( answerPath ) , { recursive : true } ) ;
31493156 writeFileSync ( answerPath , 'done' ) ;
31503157 mkdirSync ( path . join ( timestampDir , '.internal' ) , { recursive : true } ) ;
@@ -3155,6 +3162,7 @@ describe('serve app', () => {
31553162 experiment : 'canonical-transcript' ,
31563163 result_dir : resultDir ,
31573164 transcript_path : transcriptArtifactPath ,
3165+ transcript_raw_path : transcriptRawArtifactPath ,
31583166 answer_path : answerArtifactPath ,
31593167 } ) ,
31603168 ) ;
@@ -3168,13 +3176,15 @@ describe('serve app', () => {
31683176 const transcriptData = ( await transcriptRes . json ( ) ) as {
31693177 status : string ;
31703178 transcript_path : string ;
3179+ transcript_raw_path : string ;
31713180 content : string ;
31723181 answer_path : string ;
31733182 answer_content : string ;
31743183 } ;
31753184 expect ( transcriptData ) . toMatchObject ( {
31763185 status : 'ok' ,
31773186 transcript_path : transcriptArtifactPath ,
3187+ transcript_raw_path : transcriptRawArtifactPath ,
31783188 content : transcriptJson ,
31793189 answer_path : answerArtifactPath ,
31803190 answer_content : 'done' ,
@@ -3186,6 +3196,68 @@ describe('serve app', () => {
31863196
31873197 expect ( rawRes . status ) . toBe ( 200 ) ;
31883198 expect ( await rawRes . text ( ) ) . toBe ( transcriptJson ) ;
3199+
3200+ const rawSidecarRes = await app . request (
3201+ `/api/runs/${ encodeURIComponent ( runId ) } /evals/test-greeting/files/${ transcriptRawArtifactPath } ?result_dir=${ encodeURIComponent ( resultDir ) } &raw=1` ,
3202+ ) ;
3203+
3204+ expect ( rawSidecarRes . status ) . toBe ( 200 ) ;
3205+ expect ( await rawSidecarRes . text ( ) ) . toBe ( transcriptRawJsonl ) ;
3206+ } ) ;
3207+
3208+ it ( 'omits missing raw transcript sidecars from the transcript response' , async ( ) => {
3209+ const runsDir = localResultsExperimentDir ( tempDir , 'canonical-transcript-normalized-only' ) ;
3210+ const runId = '2026-03-25T10-45-00-000Z' ;
3211+ const timestampDir = path . join ( runsDir , runId ) ;
3212+ const resultDir = 'demo-test-greeting--222222222222' ;
3213+ const transcriptArtifactPath = `${ resultDir } /sample-1/transcript.json` ;
3214+ const transcriptRawArtifactPath = `${ resultDir } /sample-1/transcript-raw.jsonl` ;
3215+ const transcriptPath = path . join ( timestampDir , transcriptArtifactPath ) ;
3216+ const transcriptJson = `${ JSON . stringify ( {
3217+ schema_version : 'agentv.normalized_transcript.v1' ,
3218+ target : 'codex' ,
3219+ turns : [
3220+ {
3221+ v : 1 ,
3222+ agent : 'codex' ,
3223+ type : 'assistant' ,
3224+ content : [ { type : 'text' , text : 'done' } ] ,
3225+ } ,
3226+ ] ,
3227+ } ) } \n`;
3228+
3229+ mkdirSync ( path . dirname ( transcriptPath ) , { recursive : true } ) ;
3230+ writeFileSync ( transcriptPath , transcriptJson ) ;
3231+ mkdirSync ( path . join ( timestampDir , '.internal' ) , { recursive : true } ) ;
3232+ writeFileSync (
3233+ path . join ( timestampDir , '.internal' , 'index.jsonl' ) ,
3234+ toJsonl ( {
3235+ ...RESULT_A ,
3236+ experiment : 'canonical-transcript-normalized-only' ,
3237+ result_dir : resultDir ,
3238+ transcript_path : transcriptArtifactPath ,
3239+ transcript_raw_path : transcriptRawArtifactPath ,
3240+ } ) ,
3241+ ) ;
3242+
3243+ const app = createApp ( [ ] , tempDir , tempDir , undefined , { studioDir } ) ;
3244+ const transcriptRes = await app . request (
3245+ `/api/runs/${ encodeURIComponent ( runId ) } /evals/test-greeting/transcript?result_dir=${ encodeURIComponent ( resultDir ) } ` ,
3246+ ) ;
3247+
3248+ expect ( transcriptRes . status ) . toBe ( 200 ) ;
3249+ const transcriptData = ( await transcriptRes . json ( ) ) as {
3250+ status : string ;
3251+ transcript_path : string ;
3252+ transcript_raw_path ?: string ;
3253+ content : string ;
3254+ } ;
3255+ expect ( transcriptData ) . toMatchObject ( {
3256+ status : 'ok' ,
3257+ transcript_path : transcriptArtifactPath ,
3258+ content : transcriptJson ,
3259+ } ) ;
3260+ expect ( transcriptData . transcript_raw_path ) . toBeUndefined ( ) ;
31893261 } ) ;
31903262
31913263 it ( 'loads pointer-shaped transcript metadata when it resolves to a local artifact path' , async ( ) => {
0 commit comments