/** * Ticket Complexity Validation * * Provides complexity-based validation rules that return warnings rather than * errors. This encourages completeness without blocking ticket creation. * * @see MCI-023-04-complexity-validation-rules */ import type { TicketImplementation, TicketTechnicalDetails, TicketNotes } from '../types/index.js'; /** * Ticket complexity levels */ export type TicketComplexity = 'small' | 'medium' | 'large' | 'xlarge'; /** * Validation warning severity levels */ export type WarningSeverity = 'info' | 'warning' | 'recommendation'; /** * Validation strictness levels */ export type StrictnessLevel = 'lenient' | 'normal' | 'strict'; /** * Single validation warning */ export interface ValidationWarning { /** Warning code for programmatic handling */ code: string; /** Human-readable message */ message: string; /** Field that triggered the warning */ field?: string; /** Severity level */ severity: WarningSeverity; } /** * Complete validation result */ export interface TicketValidationResult { /** Always true - warnings don't block creation */ valid: true; /** List of warnings */ warnings: ValidationWarning[]; /** Completeness score (0-100) */ completenessScore: number; } /** * Validation rules for a complexity level */ export interface ComplexityRules { /** Whether implementation steps are recommended */ requiresImplementation: boolean; /** Whether technical details are recommended */ requiresTechnicalDetails: boolean; /** Whether notes are recommended */ requiresNotes: boolean; /** Minimum recommended implementation steps */ minSteps: number; /** Minimum recommended acceptance criteria */ minAcceptanceCriteria: number; /** Whether file information is recommended */ requiresFileInfo: boolean; } /** * Validation rules by complexity * * These rules define what fields are recommended for each complexity level. * Small tickets have minimal requirements, while xlarge tickets need * comprehensive documentation. */ export declare const validationRules: Record; /** * Ticket data for validation */ export interface TicketValidationInput { complexity?: TicketComplexity; implementation?: TicketImplementation | null; technicalDetails?: TicketTechnicalDetails | null; notes?: TicketNotes | null; acceptanceCriteria?: string[]; } /** * Validate a ticket against complexity-based rules * * Returns warnings for missing or incomplete fields based on the ticket's * complexity level. Does not block ticket creation - all validations * produce warnings, not errors. * * @param ticket - The ticket data to validate * @returns Validation result with warnings and completeness score * * @example * ```typescript * const result = validateTicket({ * complexity: 'large', * implementation: { steps: [{ order: 1, title: 'Setup', action: 'create', detail: '...' }] }, * acceptanceCriteria: ['Works correctly'] * }); * * if (result.warnings.length > 0) { * console.log('Suggestions:', result.warnings.map(w => w.message)); * } * console.log('Completeness:', result.completenessScore + '%'); * ``` */ export declare function validateTicket(ticket: TicketValidationInput): TicketValidationResult; /** * Filter warnings by strictness level * * Allows callers to filter out lower-priority warnings based on their * desired strictness level. * * - lenient: Only show 'warning' severity (most important issues only) * - normal: Show 'warning' and 'recommendation' (default) * - strict: Show all warnings including 'info' level * * @param warnings - Array of validation warnings * @param strictness - Desired strictness level * @returns Filtered array of warnings * * @example * ```typescript * const result = validateTicket(ticket); * const warnings = filterWarningsByStrictness(result.warnings, 'lenient'); * // Only includes warnings with severity 'warning' * ``` */ export declare function filterWarningsByStrictness(warnings: ValidationWarning[], strictness: StrictnessLevel): ValidationWarning[]; /** * Get the rules for a specific complexity level * * Useful for displaying requirements to users or for custom validation. * * @param complexity - The complexity level * @returns Rules for that complexity level */ export declare function getComplexityRules(complexity: TicketComplexity): ComplexityRules; /** * Check if a complexity value is valid * * @param value - The value to check * @returns True if value is a valid TicketComplexity */ export declare function isValidComplexity(value: unknown): value is TicketComplexity; /** * Get human-readable description of complexity level * * @param complexity - The complexity level * @returns Description of what this complexity level means */ export declare function getComplexityDescription(complexity: TicketComplexity): string; /** * Suggest appropriate complexity based on ticket content * * Analyzes the provided ticket data and suggests an appropriate * complexity level. Useful for auto-suggesting complexity during * ticket creation. * * @param ticket - The ticket data * @returns Suggested complexity level */ export declare function suggestComplexity(ticket: TicketValidationInput): TicketComplexity; //# sourceMappingURL=ticket-validation.d.ts.map