Skip to main content

Quality Assurance Workflow

Comprehensive workflow for ensuring task quality, evidence verification, and compliance with CODITECT standards.

Workflow Overview

┌─────────────────────────────────────────────────────────────────┐
│ QUALITY ASSURANCE WORKFLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ EVIDENCE │──▶│ QUALITY │──▶│TRACEABIL │──▶│ COMPLIA- │ │
│ │ CHECKS │ │ CHECKS │ │ITY CHECKS│ │NCE CHECK │ │
│ └──────────┘ └──────────┘ └──────────┘ └────┬─────┘ │
│ │ │
│ ┌──────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ REPORT │◀──│ DECIDE │◀──│AGGREGATE │ │
│ │ GENERATE │ │PASS/FAIL │ │ RESULTS │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Quality Gate Categories

1. Evidence Checks (Required)

Verify that completion claims have supporting evidence.

CheckDescriptionPass Criteria
file_existsImplementation file existsFile at expected path
tests_definedTests implemented≥1 test method found
plan_updatedPILOT plan marked[x] checkbox present
log_entrySession log createdEntry with timestamp

Verify code quality standards.

CheckDescriptionPass Criteria
naming_conventionFollows standardsMatches patterns
coverageTest coverage≥80% for new code
lint_cleanNo linting errors0 errors
type_checkType annotationsNo type errors

3. Traceability Checks (Audit)

Verify complete audit trail.

CheckDescriptionPass Criteria
git_commitChanges committedCommit exists
commit_formatMessage format[Track X.Y.Z] prefix
agent_loggedAgent invocationEntry in context DB

Workflow Phases

Phase 1: Evidence Verification

Trigger: Task marked complete

Actions:

  1. Check file existence
  2. Verify test count
  3. Confirm plan update
  4. Validate session log

Command:

/quality-gate --task E.1.1

# Output:
✅ PASS File Exists
└─ tests/e2e/test_signup_activation_flow.py (450 lines)
✅ PASS Tests Defined
└─ 10 test methods in 3 classes
✅ PASS Plan Updated
└─ [x] E.1.1 marked complete in plan
✅ PASS Session Log Entry
└─ Entry found: 2026-01-01T23:00:00Z

Phase 2: Quality Verification

Trigger: Evidence checks passed

Actions:

  1. Check naming conventions
  2. Verify test coverage
  3. Run linting
  4. Check type annotations

Command:

/quality-gate --task E.1.1 --include-quality

# Additional checks:
✅ PASS Naming Convention
└─ All tests follow test_* pattern
✅ PASS Coverage
└─ 85% coverage on new code
⚠️ WARN Type Check
└─ 2 missing type annotations

Phase 3: Traceability Verification

Trigger: Quality checks complete

Actions:

  1. Verify git commit exists
  2. Check commit message format
  3. Confirm agent invocation logged

Command:

/quality-gate --task E.1.1 --include-traceability

# Additional checks:
⚠️ WARN Git Commit
└─ Not yet committed (pending)
✅ PASS Commit Format
└─ Will use [Track E.1.1] prefix
✅ PASS Agent Invocation Logged
└─ testing-specialist invoked at 22:00:00Z

Phase 4: Compliance Check

Trigger: All checks complete

Actions:

  1. Verify ADR compliance (if applicable)
  2. Check security requirements
  3. Validate documentation standards

Phase 5: Result Aggregation

Trigger: All checks executed

Actions:

  1. Count passed/warned/failed
  2. Calculate overall status
  3. Identify blocking issues

Result Calculation:

if failed > 0:
overall = "FAILED"
elif warned > 0 and strict:
overall = "FAILED"
elif warned > 0:
overall = "PASSED_WITH_WARNINGS"
else:
overall = "PASSED"

Phase 6: Decision

Trigger: Results aggregated

Actions:

  1. Apply decision rules
  2. Determine if blocking
  3. Generate recommendations

Decision Rules:

ConditionResultAction
All passPASSProceed
Warnings onlyPASS*Proceed with notes
Any failFAILBlock completion
Strict mode + warningsFAILBlock completion

Phase 7: Report Generation

Trigger: Decision made

Actions:

  1. Generate summary report
  2. Include recommendations
  3. Log to audit trail

Report Format:

QUALITY GATE: E.1.1 - Full signup → payment → activation E2E test
═══════════════════════════════════════════════════════════════

Summary
───────────────────────────────────────────────────────────────
Passed: 7/8 checks
Warned: 1/8 checks
Failed: 0/8 checks

RESULT: ✅ QUALITY GATE PASSED (with warnings)

Recommendations
───────────────────────────────────────────────────────────────
1. Commit changes: git add tests/e2e/ && git commit -m "[Track E.1.1] ..."

Exit Codes

CodeMeaningAction
0All checks passedProceed
1Passed with warningsProceed, review warnings
2Required checks failedBlock, fix issues
3Invalid inputFix parameters

Automation Support

Single Task:

python H.P.004-SCRIPTS/quality_gate.py --task E.1.1

Track Verification:

python H.P.004-SCRIPTS/quality_gate.py --track E --report

All Pending:

python H.P.004-SCRIPTS/quality_gate.py --pending --json

Strict Mode:

python H.P.004-SCRIPTS/quality_gate.py --task E.1.1 --strict

Integration with CI/CD

# GitHub Actions integration
- name: Quality Gate Check
run: |
python H.P.004-SCRIPTS/quality_gate.py --pending --strict
exit_code=$?
if [ $exit_code -eq 2 ]; then
echo "Quality gate failed"
exit 1
fi

Pre-Commit Hook

#!/bin/bash
# .git/H.P.005-HOOKS/pre-commit

# Run quality gate on modified tasks
modified_tasks=$(git diff --cached --name-only | grep -oP '[A-G]\.\d+\.\d+' | sort -u)

for task in $modified_tasks; do
python H.P.004-SCRIPTS/quality_gate.py --task $task --strict
if [ $? -eq 2 ]; then
echo "Quality gate failed for $task"
exit 1
fi
done

Workflow Version: 1.0.0 Created: 2026-01-02 Author: CODITECT Process Refinement