@@ -320,7 +320,7 @@ describe(__filename, function () {
320320 ] ) ) ;
321321 const supPath = path . join ( tmpDir , 'sup.yml' ) ;
322322 fs . writeFileSync ( supPath , 'findings: []\n' ) ;
323- runCli ( [ 'aggregate' , runDir , supPath , 'medium' ] ) ;
323+ runCli ( [ 'aggregate' , runDir , supPath , 'medium' , '/' ] ) ;
324324 const merged = JSON . parse ( fs . readFileSync ( path . join ( runDir , 'merged.json' ) , 'utf8' ) ) ;
325325 assert . equal ( merged . length , 1 ) ;
326326 assert . equal ( merged [ 0 ] . severity , 'high' ) ;
@@ -339,11 +339,36 @@ describe(__filename, function () {
339339 } ) ) ;
340340 const supPath = path . join ( tmpDir , 'sup-empty.yml' ) ;
341341 fs . writeFileSync ( supPath , 'findings: []\n' ) ;
342- runCli ( [ 'aggregate' , runDir , supPath , 'medium' ] ) ;
342+ runCli ( [ 'aggregate' , runDir , supPath , 'medium' , '/' ] ) ;
343343 const merged = JSON . parse ( fs . readFileSync ( path . join ( runDir , 'merged.json' ) , 'utf8' ) ) ;
344344 assert . equal ( merged . length , 1 ) ;
345345 assert . match ( merged [ 0 ] . fingerprint , / ^ [ 0 - 9 a - f ] { 64 } $ / ) ;
346346 } ) ;
347+
348+ it ( 'aggregate resolves repo-relative file paths against repoRoot' , function ( ) {
349+ this . timeout ( 15000 ) ;
350+ const runDir = path . join ( tmpDir , 'run-2026-05-09-3' ) ;
351+ fs . mkdirSync ( runDir ) ;
352+ // Use a relative path that requires repoRoot resolution.
353+ const fakeRepoRoot = FIXTURE_DIR ;
354+ const relPath = 'sample-source.ts' ; // exists at FIXTURE_DIR/sample-source.ts
355+ fs . writeFileSync ( path . join ( runDir , 'auth-sessions.json' ) , JSON . stringify ( {
356+ findings : [
357+ { source : 'auth-sessions' , severity : 'high' , category : 'bug' , file : relPath , line : 6 , ruleId : 'auth-sessions.x' , message : 'm' } ,
358+ ] ,
359+ } ) ) ;
360+ const supPath = path . join ( tmpDir , 'sup-rel.yml' ) ;
361+ fs . writeFileSync ( supPath , 'findings: []\n' ) ;
362+ runCli ( [ 'aggregate' , runDir , supPath , 'medium' , fakeRepoRoot ] ) ;
363+ const merged = JSON . parse ( fs . readFileSync ( path . join ( runDir , 'merged.json' ) , 'utf8' ) ) ;
364+ assert . equal ( merged . length , 1 ) ;
365+ // Fingerprint should be computed from real file content.
366+ // Compare to a known fingerprint we can derive directly.
367+ const { computeFingerprint} = require ( '../../../node/utils/releaseReview/fingerprint' ) ;
368+ const lines = fs . readFileSync ( path . join ( fakeRepoRoot , relPath ) , 'utf8' ) . split ( '\n' ) ;
369+ const expected = computeFingerprint ( 'auth-sessions.x' , relPath , 6 , lines ) ;
370+ assert . equal ( merged [ 0 ] . fingerprint , expected ) ;
371+ } ) ;
347372 } ) ;
348373
349374 describe ( 'suppression' , function ( ) {
0 commit comments