Evaluation Framework
This directory contains the evaluation framework for all stochastic tools in the PRR codebase.
Structure
benchmark/- Golden datasets for each toolprr/- PRR benchmark PRs and expected outcomespill/- Pill benchmark logs and expected improvementssplit-plan/- Split-plan benchmark PRs and expected plansstory/- Story benchmark PRs and expected narratives
runner/- Eval execution engineeval-runner.ts- Tool-agnostic runner with tool-specific implementationsmetrics.ts- Tool-specific metrics calculationcomparison.ts- Regression detectiontypes.ts- Type definitions
results/- Eval results storage (JSON files)prr/,pill/,split-plan/,story/- Tool-specific eval test files
Usage
Running evals manually
# Run eval on a specific benchmark
npm run eval -- run -t prr -b simple-fix
# Compare against baseline
npm run eval -- run -t prr -b simple-fix --compare
# List available benchmarks
npm run eval -- list
Running evals in tests
import { runPRREval, loadBenchmarkPR, loadExpectedOutcome } from '../runner/eval-runner.js';
import { calculateMetrics } from '../runner/metrics.js';
const benchmark = loadBenchmarkPR('prr', 'simple-fix');
const expected = loadExpectedOutcome('prr', 'simple-fix');
const result = await runPRREval(benchmark, {});
const metrics = calculateMetrics('prr', result, expected);
Metrics
Each tool has specific metrics:
- PRR: fix rate, accuracy, false positives/negatives, token/time efficiency
- Pill: improvement relevance, severity accuracy, coverage
- Split-plan: dependency accuracy, split quality, merge order correctness
- Story: narrative quality, changelog accuracy, completeness
CI Integration
Evals run in CI via .github/workflows/eval.yml:
- Fast evals on PRs (subset of benchmarks)
- Full evals on main branch
- Regression detection and alerts