From f1d6d56ad4095e1a3f1b46a86c9417d22cfb4a9c Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 06:27:01 +0000 Subject: [PATCH] chore: update vibe-check-runner for fidelity pass and report generation - Updated `vibe-check-runner.js` to change the success commit message to `[chore: fidelity-pass]`. - Updated the violation report file name to `fidelity-gap-report.md`. - Added logic to `getModifiedFiles()` to search for both untracked/unstaged (`git ls-files`) and committed files in the last 24h (`git log`). - Appended a unique ID logic to the temp TS AST creation using `.replace(/\//g, '_')` to prevent overwriting. Co-authored-by: beginwebdev2002 <102213457+beginwebdev2002@users.noreply.github.com> --- vibe-check-runner.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/vibe-check-runner.js b/vibe-check-runner.js index f56ee94..3d05695 100644 --- a/vibe-check-runner.js +++ b/vibe-check-runner.js @@ -29,8 +29,15 @@ function getModifiedFiles() { try { // In CI (daily run), check files modified in the last 24 hours. // We filter for non-empty lines that end in .md and are in frontend/ or backend/ - const output = execFileSync('sh', ['-c', 'git log --since="24 hours ago" --name-only --pretty=format: | sort | uniq'], { encoding: 'utf-8' }); - const allFiles = output.split('\n') + const outputLog = execFileSync('sh', ['-c', 'git log --since="24 hours ago" --name-only --pretty=format: | sort | uniq'], { encoding: 'utf-8' }); + let outputLsFiles = ''; + try { + outputLsFiles = execFileSync('sh', ['-c', 'git ls-files -m -o --exclude-standard'], { encoding: 'utf-8' }); + } catch (e) { + // ignore errors + } + const combinedOutput = outputLog + '\n' + outputLsFiles; + const allFiles = combinedOutput.split('\n') .map(f => f.trim()) .filter(f => f.length > 0) .filter(f => f.endsWith('.md')) @@ -284,7 +291,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 +312,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.`); @@ -320,7 +327,7 @@ async function runVibeCheck() { const reportDir = path.join('benchmarks', 'logs'); if (!await fileOrDirExists(reportDir)) await fsPromises.mkdir(reportDir, { recursive: true }); - const reportPath = path.join(reportDir, `violation-report.md`); + const reportPath = path.join(reportDir, `fidelity-gap-report.md`); const reportContent = `# Critical Violation Report\n\n> [!CAUTION]\n> Fidelity Score dropped below 95%.\n\n**File:** \`${file}\`\n**Fidelity Score:** ${score}%\n**Threshold:** 95%\n\n## Breakdown\n| Metric | Score |\n|---|---|\n| Arch Integrity | ${breakdown.arch} |\n| Type Safety | ${breakdown.type} |\n| Security | ${breakdown.security} |\n| Efficiency | ${breakdown.efficiency} |\n\n## Generated Code\n\`\`\`typescript\n${generatedCode}\n\`\`\`\n\nReview the AST rules.`; await fsPromises.writeFile(reportPath, reportContent);