Overview
The AIOX Quality Gate System provides automated quality assurance through three progressive layers of validation. Each layer catches different types of issues at the appropriate stage of development.The 3-Layer Architecture
| Layer | Type | Speed | Purpose |
|---|---|---|---|
| Layer 1 | Automated | ~30s | Catch syntax, linting, type errors |
| Layer 2 | AI-Assisted | ~5m | Catch logic, security, patterns |
| Layer 3 | Human | Variable | Strategic review, sign-off |
Layer 1: Pre-commit Checks
Purpose
Fast, local checks that run before code is committed. Catches obvious issues immediately.Checks Included
| Check | Tool | Timeout | Description |
|---|---|---|---|
| Lint | ESLint | 60s | Code style and best practices |
| Test | Jest | 5m | Unit tests with coverage |
| TypeCheck | TypeScript | 2m | Static type validation |
Configuration
Running Layer 1
Expected Output
Layer 2: PR Automation
Purpose
AI-assisted code review that runs on pull requests. Catches deeper issues like logic errors, security vulnerabilities, and architectural problems.Tools Integrated
| Tool | Purpose | Blocking Severity |
|---|---|---|
| CodeRabbit | AI code review | CRITICAL |
| Quinn (@qa) | Automated QA review | CRITICAL |
Severity Levels
| Severity | Action | Description |
|---|---|---|
| CRITICAL | Block | Security vulnerability, data loss risk, breaking change |
| HIGH | Warn + Document | Performance issue, missing validation, anti-pattern |
| MEDIUM | Document | Code smell, improvement suggestion, minor risk |
| LOW | Ignore | Style preference, minor optimization |
Configuration
Running Layer 2
CodeRabbit Integration
CodeRabbit performs AI-powered code review with these focus areas:- Security vulnerabilities
- Performance issues
- Code quality and maintainability
- Best practices violations
- Documentation completeness
Quinn (@qa) Integration
The QA agent performs automated review focused on:- Test coverage adequacy
- Edge case handling
- Error handling completeness
- Acceptance criteria validation
Layer 3: Human Review
Purpose
Strategic human review for final sign-off. Ensures business requirements are met and architectural decisions are sound.Configuration
Review Checklist
Sign-off Process
CLI Commands
aiox qa run
Run quality gate checks.
aiox qa status
Check current quality gate status.
aiox qa report
Generate quality gate report.
aiox qa configure
Configure quality gate settings.
CI/CD Integration
GitHub Actions
Pre-commit Hook
Troubleshooting
Layer 1 Failures
| Issue | Solution |
|---|---|
| Lint errors | Run npm run lint -- --fix to auto-fix |
| Test failures | Check test output, update tests or fix code |
| TypeCheck errors | Review type annotations, fix type mismatches |
| Timeout | Increase timeout in config or optimize tests |
Layer 2 Failures
| Issue | Solution |
|---|---|
| CodeRabbit critical | Address security/breaking change issues |
| CodeRabbit timeout | Check network, try manual run |
| Quinn blocked | Review @qa feedback, update code |
Layer 3 Issues
| Issue | Solution |
|---|---|
| No reviewer assigned | Set defaultReviewer in config |
| Sign-off expired | Request new review |
| Checklist incomplete | Complete all required items |
Best Practices
Layer 1
- Run locally before commit - Don’t wait for pre-commit hook
- Fix issues immediately - Don’t accumulate technical debt
- Keep tests fast - Optimize slow tests
- Use caching - Leverage
.eslintcacheand.tsbuildinfo
Layer 2
- Address critical issues first - They block the merge
- Document medium issues - Create follow-up stories
- Review Quinn feedback - AI catches patterns you might miss
- Keep PRs small - Easier to review, faster CI
Layer 3
- Complete checklist thoroughly - Each item has a purpose
- Ask questions - Don’t approve what you don’t understand
- Consider long-term impact - Not just immediate functionality
- Provide constructive feedback - Help improve code quality
Performance Optimization
Layer 1 Speed
- First run: ~10-15s (no cache)
- Subsequent runs: Less than 5s (cached)
- Optimization: Clear caches if corrupted
Layer 2 Speed
- CodeRabbit: 2-5 minutes typical
- Quinn: 1-3 minutes typical
- Optimization: Run in parallel when possible
Layer 3 Speed
- Human review: Variable (hours to days)
- Optimization: Clear checklist, good PR description