This document explains how the CI evaluation system works and how to configure it.
The CI evaluation system automatically runs quality assessments on every pull request and push to main/develop branches. It uses LLM judges to evaluate the quality of generated commands against various criteria.
- Threshold-Based Pass/Fail: The system uses configurable thresholds to determine if the codebase meets quality standards
- Multiple Criteria: Evaluations check for command quality, Unix/Linux correctness, security best practices, and efficiency
- CI Integration: Runs automatically in GitHub Actions and fails the CI if scores are below thresholds
Edit src/lib/ci-eval.ts to adjust the thresholds:
const CI_CONFIG: CIEvalConfig = {
minThreshold: 0.7, // 70% score required to pass (both overall and individual)
criticalScorers: ['Quality', 'Correctness', 'Security'] // These scorers must individually meet the threshold
};minThreshold: Overall average score required to pass (0-1 scale)criticalScorers: Array of scorer names that must individually pass the threshold
The CI evaluations run against these command generation scenarios:
- List files with hidden ones in long format
- Show current working directory
- Create a new folder
- Find JavaScript files recursively
- Show system information
- Check disk usage
Each test case is evaluated by 3 LLM judges:
- Quality: General command quality and appropriateness
- Correctness: Unix/Linux command syntax and platform compatibility
- Security: Security considerations and best practices
Add these API keys to your GitHub repository secrets:
GROQ_API_KEY: Required for LLM judge evaluationsANTHROPIC_API_KEY: Optional, fallback modelOPENAI_API_KEY: Optional, fallback model
- Go to your repository on GitHub
- Navigate to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Add the required API keys
The CI workflow (.github/workflows/ci.yml) includes:
- Test Job: Runs unit tests
- Evaluate Job: Runs LLM-based evaluations (only if API keys are available)
- CI Success Job: Combines results and determines overall pass/fail
-
Set up environment variables:
export GROQ_API_KEY="your_groq_api_key"
-
Install dependencies:
pnpm install
# Run CI evaluations locally
pnpm eval:ci
# Build and run manually
pnpm build
node bin/lib/ci-eval.jsThe evaluation will show:
🚀 Starting CI evaluations...
📊 Threshold: 70%
🎯 Critical scorers: LLMJudge
[Individual test results...]
============================================================
🎯 CI EVALUATION RESULTS
============================================================
📊 Overall average score: 85.2%
🎯 Required threshold: 70.0%
🔍 Critical scorer results:
Quality: 87.5% ✅
Correctness: 82.3% ✅
Security: 90.1% ✅
✅ EVALUATION PASSED
All scores meet the required threshold.
If evaluations are skipped in CI:
- Check that
GROQ_API_KEYis set in repository secrets - Verify the secret name matches exactly
If evaluations consistently fail:
- Run locally to debug:
pnpm eval:ci - Review the specific scorer results
- Consider adjusting the threshold in
CI_CONFIG - Check if the AI model responses indicate real quality issues
The evaluations use the Groq API (free tier available). Each run evaluates 6 test cases with 4 scorers = 24 API calls.
Edit the data function in src/lib/ci-eval.ts:
data: async () => {
return [
// ... existing test cases ...
{
input: "your new test case",
expected: null
},
];
},Add new evaluation criteria:
scorers: [
// ... existing scorers ...
createLLMJudge("your custom criteria", judgeModelConf),
],Change the judge model in judgeModelConf:
const judgeModelConf: ModelConfig = {
model: models.anthropic('claude-3-haiku-20240307'), // Example
provider: 'anthropic',
modelId: 'claude-3-haiku-20240307'
}- Set Appropriate Thresholds: Start with 0.6-0.7 and adjust based on your quality standards
- Monitor Over Time: Track evaluation trends to catch quality regressions
- Use Multiple Criteria: Don't rely on a single scorer for quality assessment
- Regular Review: Periodically review and update test cases to match evolving requirements