@@ -17,6 +17,8 @@ import { getAgentvHome } from '../paths.js';
1717import type { ResultsConfig } from './loaders/config-loader.js' ;
1818
1919const execFileAsync = promisify ( execFile ) ;
20+ const RESULTS_REPO_RESULTS_DIR = '.agentv/results' ;
21+ const RESULTS_REPO_RUNS_DIR = `${ RESULTS_REPO_RESULTS_DIR } /runs` ;
2022
2123export interface ResultsRepoLocalPaths {
2224 readonly rootDir : string ;
@@ -345,7 +347,7 @@ export async function stageResultsArtifacts(params: {
345347
346348export function resolveResultsRepoRunsDir ( config : ResultsConfig ) : string {
347349 const normalized = normalizeResultsConfig ( config ) ;
348- return path . join ( normalized . path , 'runs' ) ;
350+ return path . join ( normalized . path , RESULTS_REPO_RESULTS_DIR , 'runs' ) ;
349351}
350352
351353export async function directorySizeBytes ( targetPath : string ) : Promise < number > {
@@ -443,7 +445,12 @@ export async function directPushResults(params: {
443445 const baseBranch = await resolveDefaultBranch ( repoDir ) ;
444446 await fetchResultsRepo ( repoDir ) ;
445447
446- const destinationDir = path . join ( repoDir , 'runs' , params . destinationPath ) ;
448+ const destinationDir = path . join (
449+ repoDir ,
450+ RESULTS_REPO_RESULTS_DIR ,
451+ 'runs' ,
452+ params . destinationPath ,
453+ ) ;
447454 await stageResultsArtifacts ( {
448455 repoDir,
449456 sourceDir : params . sourceDir ,
@@ -655,9 +662,12 @@ function parseGitBatchBlobs(output: Buffer): GitBatchBlob[] {
655662}
656663
657664export async function listGitRuns ( repoDir : string , ref = 'origin/main' ) : Promise < GitListedRun [ ] > {
658- const { stdout : treeOut } = await runGit ( [ 'ls-tree' , '-r' , '--name-only' , ref , 'runs' ] , {
659- cwd : repoDir ,
660- } ) ;
665+ const { stdout : treeOut } = await runGit (
666+ [ 'ls-tree' , '-r' , '--name-only' , ref , RESULTS_REPO_RUNS_DIR ] ,
667+ {
668+ cwd : repoDir ,
669+ } ,
670+ ) ;
661671
662672 const benchmarkPaths = treeOut
663673 . split ( / \r ? \n / )
@@ -679,7 +689,7 @@ export async function listGitRuns(repoDir: string, ref = 'origin/main'): Promise
679689 const benchmarkPath = benchmarkPaths [ index ] ;
680690 const benchmark = JSON . parse ( blob . content . toString ( 'utf8' ) ) as GitRunBenchmark ;
681691 const runDir = path . posix . dirname ( benchmarkPath ) ;
682- const relativeRunPath = path . posix . relative ( 'runs' , runDir ) ;
692+ const relativeRunPath = path . posix . relative ( RESULTS_REPO_RUNS_DIR , runDir ) ;
683693 const runId = buildGitRunId ( relativeRunPath ) ;
684694 const timestamp = benchmark . metadata ?. timestamp ?. trim ( ) || path . posix . basename ( runDir ) ;
685695 const targets = benchmark . metadata ?. targets ?? [ ] ;
@@ -712,7 +722,7 @@ export async function materializeGitRun(
712722 ref = 'origin/main' ,
713723) : Promise < void > {
714724 const normalizedRunPath = relativeRunPath . split ( path . sep ) . join ( '/' ) ;
715- const runTreePath = path . posix . join ( 'runs' , normalizedRunPath ) ;
725+ const runTreePath = path . posix . join ( RESULTS_REPO_RUNS_DIR , normalizedRunPath ) ;
716726 const targetRunDir = path . join ( repoDir , ...runTreePath . split ( '/' ) ) ;
717727 const { stdout : treeOut } = await runGit ( [ 'ls-tree' , '-r' , '--name-only' , ref , runTreePath ] , {
718728 cwd : repoDir ,
0 commit comments