@@ -2,7 +2,7 @@ import {join} from 'path';
22import chalk from 'chalk' ;
33import boxen from 'boxen' ;
44import { IndividualAssessmentState , RunInfo , ScoreBucket } from '../shared-interfaces.js' ;
5- import { DEFAULT_AUTORATER_MODEL_NAME , REPORTS_ROOT_DIR } from '../configuration/constants.js' ;
5+ import { DEFAULT_AUTORATER_MODEL_NAME } from '../configuration/constants.js' ;
66import { calculateBuildAndCheckStats } from '../ratings/stats.js' ;
77import { safeWriteFile } from '../file-system-utils.js' ;
88import { BuildResultStatus } from '../workers/builder/builder-types.js' ;
@@ -17,7 +17,6 @@ import {
1717} from './format.js' ;
1818import { Environment } from '../configuration/environment.js' ;
1919import { groupSimilarReports } from '../orchestration/grouping.js' ;
20- import { LocalExecutor } from '../orchestration/executors/local-executor.js' ;
2120
2221/**
2322 * Generates a structured report on fs, based on the assessment run information.
@@ -38,14 +37,19 @@ import {LocalExecutor} from '../orchestration/executors/local-executor.js';
3837 *
3938 * @param runInfo An object containing all details and results of the assessment run.
4039 * @param id ID of the environment that was used for the eval.
40+ * @param reportsRootDir Root directory where the reports are written to.
4141 * @returns The original `runInfo` object, allowing for chaining.
4242 */
43- export async function writeReportToDisk ( runInfo : RunInfo , id : string ) : Promise < void > {
43+ export async function writeReportToDisk (
44+ runInfo : RunInfo ,
45+ id : string ,
46+ reportsRootDir : string ,
47+ ) : Promise < void > {
4448 // Sanitize report name: allow only a-z, A-Z, 0-9, and hyphens. Replace others with a hyphen.
4549 const sanitizedReportName = runInfo . details . reportName . replace ( / [ ^ a - z A - Z 0 - 9 - ] / g, '-' ) ;
4650
4751 const { results} = runInfo ;
48- const reportBaseDir = join ( REPORTS_ROOT_DIR , id , sanitizedReportName ) ;
52+ const reportBaseDir = join ( reportsRootDir , id , sanitizedReportName ) ;
4953
5054 // Write `summary.json` file, which contains **all** available info.
5155 const summaryJsonPath = join ( reportBaseDir , 'summary.json' ) ;
0 commit comments