Overview
Synkra AIOX implements a Defense in Depth validation strategy with three progressive layers that catch issues early and ensure code quality before merge.Why Three Layers?
- Fast feedback - Catch issues immediately during development
- Local validation - No cloud dependency for basic checks
- Authoritative validation - Final gate before merge
- Story consistency - Ensure development aligns with stories
Architecture
Layer 1: Pre-commit (Local - Fast)
Performance Target: Less than 5 secondsTrigger:
git commitLocation:
.husky/pre-commit
What It Validates
- ESLint code quality
- TypeScript type checking
- Syntax errors
- Import issues
How It Works
Benefits
- ⚡ Fast feedback (less than 5s)
- 💾 Cached for speed
- 🔒 Prevents broken code commits
- 🚫 No invalid syntax in history
Manual Validation
Layer 2: Pre-push (Local - Story Validation)
Performance Target: Less than 2 secondsTrigger:
git pushLocation:
.husky/pre-push
What It Validates
- Story checkbox completion vs status
- Required story sections present
- Status consistency
- Dev agent records
Validation Rules
1. Status Consistency
2. Required Sections
idtitledescriptionacceptance_criteriastatus
3. Status Flow
Manual Validation
Example Output
Layer 3: CI/CD Pipeline
Performance: 2-5 minutesTrigger: Push to any branch, PR creation
Platform: GitHub Actions
Location:
.github/workflows/ci.yml
Jobs
-
ESLint (
lintjob)- Runs on clean environment
- No cache dependency
-
TypeScript (
typecheckjob)- Full type checking
- No incremental compilation
-
Tests (
testjob)- Full test suite
- Coverage reporting
- 80% threshold enforced
-
Story Validation (
story-validationjob)- All stories validated
- Status consistency checked
-
Validation Summary (
validation-summaryjob)- Aggregates all results
- Blocks merge if any fail
CI Triggers
Push Events:masterbranchdevelopbranchfeature/**branchesbugfix/**branches
- Against
master - Against
develop
Viewing CI Results
Daily Workflow
Starting a New Feature
Updating a Story
Fixing Validation Failures
ESLint Errors:Merging a Pull Request
Troubleshooting
Hook Not Running
Symptoms: Commit succeeds without validation Solutions:Slow Pre-commit Hook
Symptoms: Pre-commit takes >10 seconds Solutions:CI Fails but Local Passes
Symptoms: CI fails but all local validations pass Solutions:Performance Tips
Cache Management
Keep caches:.eslintcache- ESLint results.tsbuildinfo- TypeScript build infocoverage/- Test coverage data
Incremental Development
- Small commits - Fewer files = faster validation
- Test during development - Don’t wait for pre-commit
- Fix issues immediately - Don’t accumulate problems
Best Practices
Git Commit Messages
Follow conventional commits:Branch Strategy
master- Production-ready codedevelop- Integration branchfeature/*- New featuresbugfix/*- Bug fixeshotfix/*- Emergency fixes
Story Integration
- Always reference story ID in commits
- Update story checkboxes as you work
- Change status to “Ready for Review” when done
- Document blockers in story notes