Learn how to configure and customize quality gates in Yemaya pipelines.
Table of Contents#
- Overview
- Built-in Quality Gates
- Configuration Options
- Threshold Settings
- Custom Quality Checks
- Auto-Remediation
- Human Review Workflows
- Monitoring & Reporting
- Best Practices
Overview#
Quality gates are automated checkpoints that validate outputs before proceeding to the next phase. They ensure consistent quality and catch issues early.
How Quality Gates Work#
text
Phase Output → Quality Assessment → Decision
↓
┌──────┴──────┐
↓ ↓
Score ≥ Score <
Threshold Threshold
↓ ↓
PASS FAIL/WARN
↓ ↓
Continue Remediate
or Review
Built-in Quality Gates#
Narrative Quality Gate#
Evaluates scripts, dialogue, and story elements.
typescript
const narrativeGate: QualityGateConfig = {
type: 'narrative',
enabled: true,
checks: {
scriptQuality: {
enabled: true,
threshold: 0.8,
criteria: ['structure', 'pacing', 'clarity'],
},
dialogueNaturalness: {
enabled: true,
threshold: 0.75,
},
characterConsistency: {
enabled: true,
threshold: 0.85,
},
plotCoherence: {
enabled: true,
threshold: 0.9,
},
thematicAlignment: {
enabled: true,
threshold: 0.8,
},
},
};
Visual Quality Gate#
Evaluates visual assets and consistency.
typescript
const visualGate: QualityGateConfig = {
type: 'visual',
enabled: true,
checks: {
styleConsistency: {
enabled: true,
threshold: 0.9,
compareAgainst: 'styleGuide',
},
technicalSpecs: {
enabled: true,
requirements: {
minResolution: 1024,
maxPolygons: 50000,
uvQuality: 0.8,
},
},
colorPaletteAdherence: {
enabled: true,
threshold: 0.85,
},
compositionQuality: {
enabled: true,
threshold: 0.75,
},
},
};
Audio Quality Gate#
Evaluates audio assets and mixing.
typescript
const audioGate: QualityGateConfig = {
type: 'audio',
enabled: true,
checks: {
levelConsistency: {
enabled: true,
peakMax: -3, // dB
lufs: { min: -16, max: -14 },
},
frequencyBalance: {
enabled: true,
threshold: 0.8,
},
noiseFloor: {
enabled: true,
maxNoiseDb: -60,
},
syncAccuracy: {
enabled: true,
maxDriftMs: 50,
},
formatCompliance: {
enabled: true,
required: {
sampleRate: 48000,
bitDepth: 24,
},
},
},
};
Technical Quality Gate#
Evaluates performance and compatibility.
typescript
const technicalGate: QualityGateConfig = {
type: 'technical',
enabled: true,
checks: {
performance: {
enabled: true,
fps: { min: 60, target: 120 },
frameTime: { max: 16.67 }, // ms
memoryUsage: { max: 2048 }, // MB
},
stability: {
enabled: true,
crashFree: 0.999,
aniTestDuration: 3600, // seconds
},
compatibility: {
enabled: true,
platforms: ['pc', 'switch', 'mobile'],
},
loadTimes: {
enabled: true,
initial: { max: 5 },
level: { max: 3 },
},
},
};
Gameplay Quality Gate#
Evaluates gameplay mechanics and balance.
typescript
const gameplayGate: QualityGateConfig = {
type: 'gameplay',
enabled: true,
checks: {
balance: {
enabled: true,
threshold: 0.8,
aspects: ['difficulty', 'economy', 'progression'],
},
difficultyProgression: {
enabled: true,
curve: 'smooth',
maxSpikes: 2,
},
funFactor: {
enabled: true,
threshold: 0.7,
aiPlaytestHours: 100,
},
accessibility: {
enabled: true,
requirements: ['remappable-controls', 'colorblind-mode', 'subtitles'],
},
},
};
Configuration Options#
Global Settings#
typescript
const globalConfig: QualityGateGlobalConfig = {
// Enable/disable all gates
enabled: true,
// Strict mode fails on any warning
strictMode: false,
// Require all gates to pass
allMustPass: true,
// Allow overrides with justification
allowOverride: true,
requireJustification: true,
// Auto-remediation settings
autoRemediation: {
enabled: true,
maxAttempts: 3,
timeoutMs: 300000,
},
// Notification settings
notifications: {
onPass: false,
onWarning: true,
onFail: true,
channels: ['email', 'slack'],
},
};
Per-Phase Configuration#
typescript
const phaseGates: PhaseQualityGates = {
concept: {
gates: ['narrative'],
strictMode: false,
},
gdd: {
gates: ['narrative'],
strictMode: true,
},
assetProduction: {
gates: ['visual', 'audio', 'technical'],
strictMode: true,
},
levelAssembly: {
gates: ['visual', 'technical', 'gameplay'],
strictMode: true,
},
qa: {
gates: ['technical', 'gameplay'],
strictMode: true,
allMustPass: true,
},
};
Threshold Settings#
Numeric Thresholds#
typescript
const thresholds = {
// Simple threshold
quality: 0.85, // 85% minimum
// Range threshold
score: { min: 0.7, max: 1.0 },
// Tiered thresholds
tiered: {
pass: 0.85,
warning: 0.7,
fail: 0.5,
},
};
Dynamic Thresholds#
typescript
const dynamicThresholds = {
// Based on project phase
byPhase: {
concept: 0.7,
prototype: 0.75,
production: 0.85,
release: 0.95,
},
// Based on quality setting
byQuality: {
draft: 0.6,
standard: 0.8,
high: 0.9,
ultra: 0.95,
},
};
Weighted Scoring#
typescript
const weightedScoring = {
weights: {
technicalQuality: 0.3,
visualQuality: 0.25,
narrativeQuality: 0.2,
audioQuality: 0.15,
gameplayQuality: 0.1,
},
// Minimum per category (even if weighted average passes)
minimums: {
technicalQuality: 0.7,
visualQuality: 0.6,
},
};
Custom Quality Checks#
Defining Custom Checks#
typescript
const customCheck: CustomQualityCheck = {
name: 'brand-compliance',
description: 'Ensures brand guidelines are followed',
// Check function
check: async (artifact, context) => {
const logo = await extractLogo(artifact);
const colors = await extractColors(artifact);
const issues = [];
if (!validateLogo(logo, context.brandGuidelines)) {
issues.push({
severity: 'error',
message: 'Logo does not match brand guidelines',
});
}
if (!validateColors(colors, context.brandGuidelines)) {
issues.push({
severity: 'warning',
message: 'Colors deviate from brand palette',
});
}
return {
passed: issues.filter((i) => i.severity === 'error').length === 0,
score: calculateScore(issues),
issues,
};
},
// Remediation function
remediate: async (artifact, issues) => {
// Attempt to fix issues automatically
const fixed = await applyBrandCorrections(artifact, issues);
return fixed;
},
};
Registering Custom Checks#
typescript
// Register globally
await client.qualityGates.registerCheck(customCheck);
// Or use in specific project
const project = await client.autonomous.createProject({
// ...
qualityGates: {
customChecks: [customCheck],
},
});
Composite Checks#
typescript
const compositeCheck: CompositeQualityCheck = {
name: 'release-ready',
description: 'Comprehensive release readiness check',
// Combine multiple checks
checks: [
{ check: 'technical', weight: 0.3 },
{ check: 'gameplay', weight: 0.25 },
{ check: 'visual', weight: 0.2 },
{ check: 'audio', weight: 0.15 },
{ check: 'brand-compliance', weight: 0.1 },
],
// All must pass for composite to pass
requireAll: true,
// Minimum individual score
minimumScore: 0.7,
};
Auto-Remediation#
Configuration#
typescript
const remediationConfig: AutoRemediationConfig = {
enabled: true,
// Maximum attempts
maxAttempts: 3,
// Timeout per attempt
timeoutMs: 300000,
// Strategy
strategy: 'progressive', // 'aggressive' | 'conservative' | 'progressive'
// Which issues to auto-remediate
autoRemediateTypes: [
'format-violation',
'optimization-needed',
'missing-metadata',
'color-deviation',
],
// Always require human review for
requireHumanReview: [
'content-safety',
'narrative-inconsistency',
'severe-quality-issue',
],
// Remediation actions
actions: {
'texture-too-large': 'resize-and-compress',
'mesh-too-complex': 'decimate-geometry',
'audio-clipping': 'normalize-and-limit',
'missing-lod': 'generate-lods',
},
};
Custom Remediation#
typescript
const customRemediation = {
issue: 'style-inconsistency',
remediate: async (asset, issue, context) => {
// Get style reference
const styleGuide = await getStyleGuide(context.projectId);
// Apply style transfer
const corrected = await applyStyleTransfer(asset, styleGuide);
// Verify correction
const verification = await verifyStyle(corrected, styleGuide);
if (verification.score >= 0.8) {
return { success: true, asset: corrected };
} else {
return { success: false, reason: 'Style transfer insufficient' };
}
},
};
Human Review Workflows#
Configuration#
typescript
const humanReviewConfig: HumanReviewConfig = {
// When to require human review
triggers: {
qualityBelowThreshold: 0.7,
criticalIssueFound: true,
autoRemediationFailed: true,
sensitiveContent: true,
},
// Review process
process: {
// Reviewers
assignTo: ['creative-lead', 'quality-manager'],
// Timeout
deadline: '24h',
// Escalation
escalateAfter: '12h',
escalateTo: 'project-lead',
// Required approvals
requiredApprovals: 1,
// Allow delegation
allowDelegation: true,
},
// Decision options
decisions: {
approve: {
label: 'Approve',
requiresJustification: false,
},
approveWithConditions: {
label: 'Approve with Conditions',
requiresJustification: true,
requiresFollowUp: true,
},
requestChanges: {
label: 'Request Changes',
requiresJustification: true,
returnsToPhase: true,
},
reject: {
label: 'Reject',
requiresJustification: true,
blocksProgress: true,
},
},
};
Review Interface#
typescript
// Get pending reviews
const reviews = await client.reviews.getPending(userId);
// Submit review decision
await client.reviews.submitDecision(reviewId, {
decision: 'approveWithConditions',
justification: 'Visual quality acceptable for prototype stage',
conditions: [
'Improve lighting before final release',
'Add more detail to background elements',
],
followUpDate: '2024-02-15',
});
Monitoring & Reporting#
Real-Time Monitoring#
typescript
// Subscribe to quality gate events
subscription.on('qualityGateStarted', (event) => {
console.log(`Checking: ${event.gate} for phase ${event.phase}`);
});
subscription.on('qualityGateProgress', (event) => {
console.log(`Progress: ${event.checkName} - ${event.status}`);
});
subscription.on('qualityGateCompleted', (event) => {
console.log(`Result: ${event.passed ? 'PASSED' : 'FAILED'}`);
console.log(`Score: ${event.score}`);
for (const issue of event.issues) {
console.log(` - ${issue.severity}: ${issue.message}`);
}
});
Reports#
typescript
// Get quality report for project
const report = await client.qualityGates.getReport(projectId);
console.log('Quality Gate Report');
console.log('==================');
console.log(`Overall Score: ${report.overallScore}`);
console.log(`Gates Passed: ${report.passed}/${report.total}`);
for (const gate of report.gates) {
console.log(`\n${gate.name}:`);
console.log(` Score: ${gate.score}`);
console.log(` Status: ${gate.status}`);
console.log(` Issues: ${gate.issues.length}`);
}
// Get trend analysis
const trends = await client.qualityGates.getTrends(projectId, {
period: '30d',
groupBy: 'day',
});
Dashboards#
typescript
// Configure quality dashboard
const dashboardConfig = {
widgets: [
{
type: 'score-gauge',
gate: 'overall',
position: { x: 0, y: 0 },
},
{
type: 'issues-list',
filter: { severity: 'critical' },
position: { x: 1, y: 0 },
},
{
type: 'trend-chart',
gates: ['technical', 'visual'],
period: '7d',
position: { x: 0, y: 1 },
},
],
alerts: [
{
condition: 'score < 0.7',
notify: ['slack', 'email'],
},
],
};
Best Practices#
1. Start Lenient, Tighten Over Time#
typescript
const progressiveThresholds = {
prototype: 0.6,
alpha: 0.75,
beta: 0.85,
release: 0.95,
};
2. Prioritize Critical Gates#
typescript
const criticalGates = {
mustPass: ['technical', 'content-safety'],
shouldPass: ['visual', 'audio'],
optional: ['brand-compliance'],
};
3. Enable Auto-Remediation for Common Issues#
typescript
const autoRemediateList = [
'texture-compression',
'mesh-optimization',
'audio-normalization',
'metadata-completion',
];
4. Set Up Proper Escalation#
typescript
const escalationPath = {
level1: { timeout: '4h', notify: 'team-lead' },
level2: { timeout: '8h', notify: 'project-manager' },
level3: { timeout: '24h', notify: 'executive' },
};
5. Document Override Decisions#
typescript
// Always require justification for overrides
const overridePolicy = {
requireJustification: true,
requireApprover: true,
auditLog: true,
expirationDays: 90,
};