diff --git a/vibe-check-runner.js b/vibe-check-runner.js index f56ee94..644b139 100644 --- a/vibe-check-runner.js +++ b/vibe-check-runner.js @@ -244,7 +244,7 @@ async function runVibeCheck() { for (const file of modifiedFiles) { console.log(`Processing ${file}...`); - if (!fs.existsSync(file)) { + if (!await fileOrDirExists(file)) { console.log(`File ${file} does not exist. Skipping.`); continue; } @@ -270,7 +270,7 @@ async function runVibeCheck() { await syncBenchmarks(tech, mdContent); const suitePath = path.join('benchmarks', 'suites', `${tech}.json`); - if (!fs.existsSync(suitePath)) { + if (!await fileOrDirExists(suitePath)) { console.log(`No benchmark suite found for ${tech}. Skipping.`); continue; } @@ -284,7 +284,7 @@ async function runVibeCheck() { continue; } - const sourceFile = project.createSourceFile(`temp_${tech}.ts`, generatedCode, { overwrite: true }); + const sourceFile = project.createSourceFile(`temp_${tech}_${file.replace(/\//g, '_')}.ts`, generatedCode, { overwrite: true }); const { total: score, breakdown } = analyzeAST(sourceFile, tech); console.log(`Fidelity Score for ${file}: ${score}%`); @@ -305,7 +305,7 @@ async function runVibeCheck() { // Only commit if there are changes (badge might already be there) const status = execFileSync('git', ['status', '--porcelain'], { encoding: 'utf-8' }); if (status.includes(file) || status.includes('benchmarks/')) { - execFileSync('git', ['commit', '-m', '[chore: benchmark-sync]']); + execFileSync('git', ['commit', '-m', '[chore: fidelity-pass]']); execFileSync('git', ['push', 'origin', 'HEAD:main']); } else { console.log(`Badge already present in ${file}, skipping commit.`);