Skip to content

CTQ Quality Gates

Every build is scored across 6 dimensions. Scores below 70 in any dimension trigger an automatic re-run of the relevant agent before the output is returned.

The 6 dimensions

DimensionWhat's measured
CorrectnessCode runs, tests pass, no runtime errors
SecurityOWASP top 10, secrets in code, auth flows
PerformanceQuery complexity, N+1 detection, async usage
MaintainabilityCyclomatic complexity, duplication, naming
Test coverageLine and branch coverage across the test suite
DocumentationDocstrings, README completeness, API docs

Viewing scores

bash
# Score for a specific project
GET /quality/project/{project_name}
json
{
  "project": "my-api",
  "overall_score": 86,
  "dimensions": {
    "correctness": 92,
    "security": 88,
    "performance": 81,
    "maintainability": 87,
    "test_coverage": 87,
    "documentation": 79
  },
  "gates_passed": ["unit_tests", "lint", "security_scan"],
  "gates_failed": []
}
bash
# Portfolio-level summary across all projects
GET /quality/portfolio

# Historical trends
GET /quality/trends

# Trigger a fresh scan
POST /quality/refresh
{ "project_name": "my-api" }

Gates and promotion

A project must pass all CTQ gates before it can be promoted to production. The POST /promotion/check endpoint runs this validation automatically.

The default gate thresholds:

GateMinimum score
Overall75
Security80
Test coverage70
Correctness85

Purple8 Builder is proprietary software. All rights reserved.