Implement quality orchestration service to enforce standards on AI agent work and prevent premature completion claims. Components: - QualityOrchestratorService: Core validation and gate execution - QualityGate interface: Extensible gate definitions - CompletionClaim/Validation: Track claims and verdicts - OrchestrationConfig: Per-workspace configuration Features: - Validate completions against quality gates (build/lint/test/coverage) - Run gates with command execution and output validation - Support string and RegExp output pattern matching - Smart continuation logic with attempt tracking - Generate actionable feedback for failed gates - Strict/lenient mode for gate enforcement - 5-minute timeout, 10MB output buffer per gate Default gates: - Build Check (required) - Lint Check (required) - Test Suite (required) - Coverage Check (optional, 85% threshold) Tests: 21 passing with 85.98% coverage Fixes #134 Co-Authored-By: Claude Opus 4.5 <[email protected]>
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
/**
|
|
* Defines a quality gate that must be passed for task completion
|
|
*/
|
|
export interface QualityGate {
|
|
/** Unique identifier for the gate */
|
|
id: string;
|
|
|
|
/** Human-readable name */
|
|
name: string;
|
|
|
|
/** Description of what this gate checks */
|
|
description: string;
|
|
|
|
/** Type of quality check */
|
|
type: "test" | "lint" | "build" | "coverage" | "custom";
|
|
|
|
/** Command to execute for this gate (optional for custom gates) */
|
|
command?: string;
|
|
|
|
/** Expected output pattern (optional, for validation) */
|
|
expectedOutput?: string | RegExp;
|
|
|
|
/** Whether this gate must pass for completion */
|
|
required: boolean;
|
|
|
|
/** Execution order (lower numbers run first) */
|
|
order: number;
|
|
}
|
|
|
|
/**
|
|
* Result of running a quality gate
|
|
*/
|
|
export interface QualityGateResult {
|
|
/** ID of the gate that was run */
|
|
gateId: string;
|
|
|
|
/** Name of the gate */
|
|
gateName: string;
|
|
|
|
/** Whether the gate passed */
|
|
passed: boolean;
|
|
|
|
/** Output from running the gate */
|
|
output?: string;
|
|
|
|
/** Error message if gate failed */
|
|
error?: string;
|
|
|
|
/** Duration in milliseconds */
|
|
duration: number;
|
|
}
|