diff --git a/.github/workflows/benchmark-sync.yml b/.github/workflows/benchmark-sync.yml new file mode 100644 index 0000000..7ba53b3 --- /dev/null +++ b/.github/workflows/benchmark-sync.yml @@ -0,0 +1,38 @@ +name: Benchmark Context Architect + +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +permissions: + contents: write + issues: write + +jobs: + synchronize-and-validate: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Configure Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Install Dependencies + run: npm install ts-morph @google/genai + + - name: Run Vibe-Check Runner + env: + GOOGLE_AI_API_KEY: ${{ secrets.GOOGLE_AI_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: node vibe-check-runner.js diff --git a/vibe-check-runner.js b/vibe-check-runner.js index f56ee94..973bd3b 100644 --- a/vibe-check-runner.js +++ b/vibe-check-runner.js @@ -29,7 +29,7 @@ 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 output = execFileSync('sh', ['-c', '(git log --since="24 hours ago" --name-only --pretty=format: && git ls-files -m -o --exclude-standard) | sort | uniq'], { encoding: 'utf-8' }); const allFiles = output.split('\n') .map(f => f.trim()) .filter(f => f.length > 0) @@ -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}%`);