From 8eb23daebcfbfc8f2413289efad327e4347cbd73 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 06:09:45 +0000 Subject: [PATCH] chore: enforce automated fidelity verification rules Updates vibe-check-runner.js to scan for new/modified .md files using git ls-files alongside git log, generates safe unique filenames for AST analysis, and uses the correct [chore: fidelity-pass] commit message format on success. Co-authored-by: beginwebdev2002 <102213457+beginwebdev2002@users.noreply.github.com> --- vibe-check-runner.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vibe-check-runner.js b/vibe-check-runner.js index f56ee94..7cea70b 100644 --- a/vibe-check-runner.js +++ b/vibe-check-runner.js @@ -29,8 +29,10 @@ 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 logOutput = execFileSync('sh', ['-c', 'git log --since="24 hours ago" --name-only --pretty=format: | sort | uniq'], { encoding: 'utf-8' }); + const untrackedOutput = execFileSync('sh', ['-c', 'git ls-files -m -o --exclude-standard'], { encoding: 'utf-8' }); + + const allFiles = [...logOutput.split('\n'), ...untrackedOutput.split('\n')] .map(f => f.trim()) .filter(f => f.length > 0) .filter(f => f.endsWith('.md')) @@ -284,7 +286,8 @@ async function runVibeCheck() { continue; } - const sourceFile = project.createSourceFile(`temp_${tech}.ts`, generatedCode, { overwrite: true }); + const safeFileName = file.replace(/\//g, '_'); + const sourceFile = project.createSourceFile(`temp_${tech}_${safeFileName}.ts`, generatedCode, { overwrite: true }); const { total: score, breakdown } = analyzeAST(sourceFile, tech); console.log(`Fidelity Score for ${file}: ${score}%`); @@ -305,7 +308,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.`);