@@ -144,7 +144,7 @@ export async function collectResults(resultsDir: string, suiteConfig: SuiteConfi
144144 console . warn ( "Failed to parse existing package.json, overwriting..." ) ;
145145 }
146146 }
147- pkgJsonObj . scripts [ "run-grader" ] = `node grade.mjs --id ${ relativeId } ` ;
147+ pkgJsonObj . scripts [ "run-grader" ] = `node --experimental-strip-types grade.mjs --id ${ relativeId } ` ;
148148 fs . writeFileSync ( targetPkgJson , JSON . stringify ( pkgJsonObj , null , 2 ) ) ;
149149
150150 pnpmWorkspacePackages . push ( relativeId ) ;
@@ -153,15 +153,32 @@ export async function collectResults(resultsDir: string, suiteConfig: SuiteConfi
153153
154154 // --- PASS 1.5: Execute the accumulated grading runs in parallel ---
155155 if ( pnpmWorkspacePackages . length > 0 ) {
156- console . log ( `\n>>> Discovered ${ pnpmWorkspacePackages . length } un-graded tasks. Running parallel grading with pnpm -r run-grader...` ) ;
156+ const rootPkgJsonPath = path . join ( resultsDir , 'package.json' ) ;
157+ let wroteRootPkgJson = false ;
158+ if ( ! fs . existsSync ( rootPkgJsonPath ) ) {
159+ fs . writeFileSync ( rootPkgJsonPath , JSON . stringify ( {
160+ name : "evaluation-suite-workspace" ,
161+ private : true
162+ } , null , 2 ) ) ;
163+ wroteRootPkgJson = true ;
164+ }
165+
157166 const pnpmWorkspacePath = path . join ( resultsDir , 'pnpm-workspace.yaml' ) ;
158167 fs . writeFileSync ( pnpmWorkspacePath , 'packages:\n - \'**\'\n' ) ;
168+
159169 try {
170+ console . log ( `\n>>> Bootstrapping dependencies inside results workspace with pnpm install...` ) ;
171+ spawnSync ( 'pnpm' , [ 'install' , '--no-frozen-lockfile' ] , { cwd : resultsDir , stdio : 'inherit' } ) ;
172+
173+ console . log ( `\n>>> Discovered ${ pnpmWorkspacePackages . length } un-graded tasks. Running parallel grading with pnpm -r run-grader...` ) ;
160174 spawnSync ( 'pnpm' , [ '-r' , 'run-grader' ] , { cwd : resultsDir , stdio : 'inherit' } ) ;
161175 } finally {
162176 if ( fs . existsSync ( pnpmWorkspacePath ) ) {
163177 fs . unlinkSync ( pnpmWorkspacePath ) ;
164178 }
179+ if ( wroteRootPkgJson && fs . existsSync ( rootPkgJsonPath ) ) {
180+ fs . unlinkSync ( rootPkgJsonPath ) ;
181+ }
165182 }
166183 console . log ( `✅ Completed parallel grading pass\n` ) ;
167184 }
0 commit comments