Skip to main content

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?

  1. Fast feedback - Catch issues immediately during development
  2. Local validation - No cloud dependency for basic checks
  3. Authoritative validation - Final gate before merge
  4. Story consistency - Ensure development aligns with stories

Architecture

Layer 1: Pre-commit (Local - Fast)

Performance Target: Less than 5 seconds
Trigger: git commit
Location: .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 seconds
Trigger: git push
Location: .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

  • id
  • title
  • description
  • acceptance_criteria
  • status

3. Status Flow

Manual Validation

Example Output

Layer 3: CI/CD Pipeline

Performance: 2-5 minutes
Trigger: Push to any branch, PR creation
Platform: GitHub Actions
Location: .github/workflows/ci.yml

Jobs

  1. ESLint (lint job)
    • Runs on clean environment
    • No cache dependency
  2. TypeScript (typecheck job)
    • Full type checking
    • No incremental compilation
  3. Tests (test job)
    • Full test suite
    • Coverage reporting
    • 80% threshold enforced
  4. Story Validation (story-validation job)
    • All stories validated
    • Status consistency checked
  5. Validation Summary (validation-summary job)
    • Aggregates all results
    • Blocks merge if any fail

CI Triggers

Push Events:
  • master branch
  • develop branch
  • feature/** branches
  • bugfix/** branches
Pull Request Events:
  • Against master
  • Against develop

Viewing CI Results

Daily Workflow

Starting a New Feature

Updating a Story

Fixing Validation Failures

ESLint Errors:
TypeScript Errors:
Story Validation Errors:
Test Failures:

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 info
  • coverage/ - Test coverage data
Commit to .gitignore:

Incremental Development

  1. Small commits - Fewer files = faster validation
  2. Test during development - Don’t wait for pre-commit
  3. Fix issues immediately - Don’t accumulate problems

Best Practices

Git Commit Messages

Follow conventional commits:

Branch Strategy

  • master - Production-ready code
  • develop - Integration branch
  • feature/* - New features
  • bugfix/* - Bug fixes
  • hotfix/* - 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