import { z } from "zod"; /** * The constraint media types (design §3.1.3). * 9-value enum: 8 from design + backward-compat aliases. */ export type RuleMedium = "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "ci" | "hook" | "settings" | "none" | "claude.md" | "linter" | "settings.json"; /** @deprecated Use RuleMedium instead. */ export type Medium = RuleMedium; /** Project phase for context-aware decisions */ export type ProjectPhase = "prototype" | "early" | "growth" | "mature"; /** Team size bracket */ export type TeamSize = "solo" | "small" | "medium" | "large"; /** Git provider for CI/CD generation */ export type GitProvider = "github" | "gitlab" | "both"; /** Team collaboration mode */ export type CollaborationMode = "solo" | "team"; /** State machine for harness setup progress */ export type HarnessStatus = null | "evaluated" | "confirmed" | "generated" | "validated"; /** Tech stack category for rule filtering */ export type TechStack = "typescript" | "javascript" | "python" | "go" | "java" | "generic"; export type ErrorCode = "STATE_NOT_FOUND" | "STATE_PHASE_MISMATCH" | "FILE_READ_ERROR" | "FILE_WRITE_ERROR" | "FILE_BACKUP_ERROR" | "CONFIRM_REQUIRED" | "NO_DECISIONS" | "INVALID_CONFIG" | "DEPENDENCY_MISSING" | "SCAN_FAILED" | "ROLLBACK_FAILED" | "UNKNOWN_ERROR" | "UNKNOWN_TOOL"; export interface HarnessError { code: ErrorCode; message: string; detail?: string; recoverable: boolean; } export interface RuleCognitiveSupport { required: boolean; skillTriggers: string[]; contextRequirements: string[]; } export interface RuleDefinition { id: string; name: string; description: string; category: string; formalizable: boolean; cost: number; feedbackSpeed: number; frequency: number; recommendedMedium: RuleMedium; alternativeMedium: RuleMedium[]; techStack: TechStack[]; cognitiveLayerSupport?: RuleCognitiveSupport; /** Design §3.1.1: structured error message with why/whatInstead/reference */ errorMessage?: { why: string; whatInstead: string; reference: string; }; } export interface RuleDecision { ruleId: string; ruleName: string; recommendedMedium: RuleMedium; alternativeMedia: RuleMedium[]; confidence: number; reasons: string[]; cognitiveLayerRequired: boolean; cognitiveSkillTriggers: string[]; /** Design §3.1.1: adjusted cost after phase multiplier (1-5) */ adjustedCost?: number; /** Design §3.1.1: cost classification label */ adjustedCostLabel?: "critical" | "high" | "medium" | "low"; /** Design §3.1.1: feedback speed from rule definition (1-5) */ feedbackSpeed?: number; /** Design §3.1.1: structured error message (why/whatInstead/reference) */ errorMessage?: { why: string; whatInstead: string; reference: string; }; } /** Design §6.2: Conflict between two rules */ export interface RuleConflict { ruleA: string; ruleB: string; type: "direct_conflict" | "redundant" | "needs_refinement"; description: string; resolution: string; } export interface EngineInput { projectDir: string; projectPhase: ProjectPhase; teamSize: TeamSize; techStack: TechStack[]; dryRun?: boolean; gitProvider?: GitProvider; collaborationMode?: CollaborationMode; } export interface EngineOutput { decisions: RuleDecision[]; conflicts: RuleConflict[]; summary: { total: number; byMedium: Record; highConfidence: number; cognitiveRequired: number; }; } export declare const EvaluateRulesInputSchema: z.ZodObject<{ projectDir: z.ZodString; projectPhase: z.ZodEnum<["prototype", "early", "growth", "mature"]>; teamSize: z.ZodEnum<["solo", "small", "medium", "large"]>; techStack: z.ZodArray, "many">; dryRun: z.ZodDefault>; }, "strip", z.ZodTypeAny, { projectDir: string; projectPhase: "prototype" | "early" | "growth" | "mature"; teamSize: "small" | "medium" | "solo" | "large"; techStack: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[]; dryRun: boolean; }, { projectDir: string; projectPhase: "prototype" | "early" | "growth" | "mature"; teamSize: "small" | "medium" | "solo" | "large"; techStack: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[]; dryRun?: boolean | undefined; }>; export type EvaluateRulesInput = z.infer; export declare const GenerateConfigInputSchema: z.ZodObject<{ projectDir: z.ZodString; decisions: z.ZodArray; }, "strip", z.ZodTypeAny, { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; }, { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; }>, "many">; dryRun: z.ZodDefault>; }, "strip", z.ZodTypeAny, { projectDir: string; dryRun: boolean; decisions: { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; }[]; }, { projectDir: string; decisions: { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; }[]; dryRun?: boolean | undefined; }>; export type GenerateConfigInput = z.infer; export declare const QueryStateInputSchema: z.ZodObject<{ projectDir: z.ZodString; }, "strip", z.ZodTypeAny, { projectDir: string; }, { projectDir: string; }>; export type QueryStateInput = z.infer; export interface ConfigError { file: string; message: string; code: string; } export interface GenerateConfigOutput { files: Array<{ path: string; content: string; action: "created" | "overwritten" | "skipped" | "merged" | "dry_run"; backupPath?: string; }>; summary: { total: number; created: number; updated: number; skipped: number; }; errors: ConfigError[]; warnings: string[]; } export interface GenerationRecord { phase: string; timestamp: string; action: string; detail?: string; } export interface HarnessState { phase: HarnessStatus; projectDir: string; createdAt: string; updatedAt: string; engineInput?: EngineInput; engineOutput?: EngineOutput; decisions?: RuleDecision[]; confirmedAt?: string; configOutput?: GenerateConfigOutput; version: string; evaluatedAt?: string; sessionId?: string; validatedAt?: string; generationLog?: GenerationRecord[]; validation?: { status: "pass" | "warn" | "fail"; errors: number; warnings: number; findings: number; checkedAt: string; }; project?: { techStack: TechStack[]; projectPhase: ProjectPhase; teamSize: TeamSize; gitProvider?: GitProvider; collaborationMode?: CollaborationMode; }; } export interface SuitabilityWarning { type: "prototype" | "script" | "overhead"; severity: "low" | "medium" | "high"; message: string; evidence?: string[]; } export interface SuitabilityAssessment { suitable: boolean; score: number; reason: string; warnings: SuitabilityWarning[]; recommendations: string[]; } export interface ABTestMetric { name: string; weight: number; } export interface ABTestConfig { ruleId: string; baselineMedium: RuleMedium; testMedium: RuleMedium; durationDays: number; metrics: ABTestMetric[]; } export interface ABTestDataPoint { timestamp: string; triggerCount: number; fixRate: number; bypassCount: number; userFeedback?: string; } export interface ABTestResult { testId: string; ruleId: string; config: ABTestConfig; dataPoints: ABTestDataPoint[]; statisticalSignificance: boolean; recommendation: "keep" | "revert" | "adjust"; confidenceScore: number; } export interface ErrorMessageTemplate { id: string; name: string; structure: { why: string; whatInstead: string; reference: string; context: string; learningTip: string; }; applicableScenarios: string[]; effectiveness?: { fixRate: number; clarityScore: number; learningImpact: number; }; } export interface ErrorSuggestion { templateId: string; renderedMessage: string; confidence: number; } /** Cognitive auto-trigger for repeated error pattern detection (OpenAPI CognitiveAutoTrigger). */ export interface CognitiveAutoTrigger { skillType: "educational"; ruleId: string; topic: string; experienceLevel: "beginner" | "intermediate" | "advanced"; } export declare const ScanCodebaseInputSchema: z.ZodObject<{ projectDir: z.ZodString; techStack: z.ZodOptional, "many">>; projectPhase: z.ZodOptional>; teamSize: z.ZodOptional>; scanDepth: z.ZodDefault>>; useCache: z.ZodDefault>; }, "strip", z.ZodTypeAny, { projectDir: string; scanDepth: "quick" | "full"; useCache: boolean; projectPhase?: "prototype" | "early" | "growth" | "mature" | undefined; teamSize?: "small" | "medium" | "solo" | "large" | undefined; techStack?: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[] | undefined; }, { projectDir: string; projectPhase?: "prototype" | "early" | "growth" | "mature" | undefined; teamSize?: "small" | "medium" | "solo" | "large" | undefined; techStack?: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[] | undefined; scanDepth?: "quick" | "full" | undefined; useCache?: boolean | undefined; }>; export type ScanCodebaseInput = z.infer; export declare const InitHarnessInputSchema: z.ZodObject<{ projectDir: z.ZodString; projectPhase: z.ZodEnum<["prototype", "early", "growth", "mature"]>; teamSize: z.ZodEnum<["solo", "small", "medium", "large"]>; techStack: z.ZodArray, "many">; dryRun: z.ZodDefault>; preset: z.ZodOptional, "many">>; projectPhase: z.ZodOptional>; teamSize: z.ZodOptional>; }, "strip", z.ZodTypeAny, { projectPhase?: "prototype" | "early" | "growth" | "mature" | undefined; teamSize?: "small" | "medium" | "solo" | "large" | undefined; techStack?: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[] | undefined; }, { projectPhase?: "prototype" | "early" | "growth" | "mature" | undefined; teamSize?: "small" | "medium" | "solo" | "large" | undefined; techStack?: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[] | undefined; }>>; gitProvider: z.ZodDefault>>; collaborationMode: z.ZodDefault>>; }, "strip", z.ZodTypeAny, { projectDir: string; projectPhase: "prototype" | "early" | "growth" | "mature"; teamSize: "small" | "medium" | "solo" | "large"; techStack: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[]; dryRun: boolean; gitProvider: "github" | "gitlab" | "both"; collaborationMode: "solo" | "team"; preset?: { projectPhase?: "prototype" | "early" | "growth" | "mature" | undefined; teamSize?: "small" | "medium" | "solo" | "large" | undefined; techStack?: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[] | undefined; } | undefined; }, { projectDir: string; projectPhase: "prototype" | "early" | "growth" | "mature"; teamSize: "small" | "medium" | "solo" | "large"; techStack: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[]; dryRun?: boolean | undefined; preset?: { projectPhase?: "prototype" | "early" | "growth" | "mature" | undefined; teamSize?: "small" | "medium" | "solo" | "large" | undefined; techStack?: ("typescript" | "python" | "go" | "java" | "javascript" | "generic")[] | undefined; } | undefined; gitProvider?: "github" | "gitlab" | "both" | undefined; collaborationMode?: "solo" | "team" | undefined; }>; export type InitHarnessInput = z.infer; export declare const ConfirmDecisionsInputSchema: z.ZodObject<{ projectDir: z.ZodString; decisions: z.ZodArray; recommendedMedium: z.ZodEnum<["linter_error", "linter_warn", "linter+hook", "claude_md", "ci", "hook", "settings", "none", "claude.md", "linter", "settings.json"]>; alternativeMedia: z.ZodOptional, "many">>; confidence: z.ZodOptional; reasons: z.ZodOptional>; cognitiveLayerRequired: z.ZodOptional; cognitiveSkillTriggers: z.ZodOptional>; }, "strip", z.ZodTypeAny, { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; reasons?: string[] | undefined; ruleName?: string | undefined; alternativeMedia?: ("none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json")[] | undefined; confidence?: number | undefined; cognitiveLayerRequired?: boolean | undefined; cognitiveSkillTriggers?: string[] | undefined; }, { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; reasons?: string[] | undefined; ruleName?: string | undefined; alternativeMedia?: ("none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json")[] | undefined; confidence?: number | undefined; cognitiveLayerRequired?: boolean | undefined; cognitiveSkillTriggers?: string[] | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { projectDir: string; decisions: { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; reasons?: string[] | undefined; ruleName?: string | undefined; alternativeMedia?: ("none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json")[] | undefined; confidence?: number | undefined; cognitiveLayerRequired?: boolean | undefined; cognitiveSkillTriggers?: string[] | undefined; }[]; }, { projectDir: string; decisions: { ruleId: string; recommendedMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; reasons?: string[] | undefined; ruleName?: string | undefined; alternativeMedia?: ("none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json")[] | undefined; confidence?: number | undefined; cognitiveLayerRequired?: boolean | undefined; cognitiveSkillTriggers?: string[] | undefined; }[]; }>; export type ConfirmDecisionsInput = z.infer; export interface RollbackOutput { status: "success" | "partial" | "failed"; restored: string[]; failed: string[] | null; errors: string[] | null; backupId: string; cleaned?: string[] | null; } export declare const RollbackInputSchema: z.ZodObject<{ projectDir: z.ZodString; backupId: z.ZodOptional; list: z.ZodDefault>; }, "strip", z.ZodTypeAny, { list: boolean; projectDir: string; backupId?: string | undefined; }, { projectDir: string; list?: boolean | undefined; backupId?: string | undefined; }>; export type RollbackInput = z.infer; export declare const ValidateSetupInputSchema: z.ZodObject<{ projectDir: z.ZodString; checkFiles: z.ZodOptional>; skipSyntaxCheck: z.ZodDefault>; skipPermissionCheck: z.ZodDefault>; }, "strip", z.ZodTypeAny, { projectDir: string; skipSyntaxCheck: boolean; skipPermissionCheck: boolean; checkFiles?: string[] | undefined; }, { projectDir: string; checkFiles?: string[] | undefined; skipSyntaxCheck?: boolean | undefined; skipPermissionCheck?: boolean | undefined; }>; export type ValidateSetupInput = z.infer; export declare const RuleStatsInputSchema: z.ZodObject<{ projectDir: z.ZodString; collect: z.ZodDefault>; }, "strip", z.ZodTypeAny, { projectDir: string; collect: boolean; }, { projectDir: string; collect?: boolean | undefined; }>; export type RuleStatsInput = z.infer; export declare const AnalyzeAdjustmentsInputSchema: z.ZodObject<{ projectDir: z.ZodString; }, "strip", z.ZodTypeAny, { projectDir: string; }, { projectDir: string; }>; export type AnalyzeAdjustmentsInput = z.infer; export declare const ExportRulesInputSchema: z.ZodObject<{ projectDir: z.ZodString; saveToFile: z.ZodDefault>; filename: z.ZodOptional; }, "strip", z.ZodTypeAny, { projectDir: string; saveToFile: boolean; filename?: string | undefined; }, { projectDir: string; saveToFile?: boolean | undefined; filename?: string | undefined; }>; export type ExportRulesInput = z.infer; export declare const ImportRulesInputSchema: z.ZodEffects; presetId: z.ZodOptional; filePath: z.ZodOptional; }, "strip", z.ZodTypeAny, { projectDir: string; exportJson?: string | undefined; presetId?: string | undefined; filePath?: string | undefined; }, { projectDir: string; exportJson?: string | undefined; presetId?: string | undefined; filePath?: string | undefined; }>, { projectDir: string; exportJson?: string | undefined; presetId?: string | undefined; filePath?: string | undefined; }, { projectDir: string; exportJson?: string | undefined; presetId?: string | undefined; filePath?: string | undefined; }>; export type ImportRulesInput = z.infer; export declare const ListRulePresetsInputSchema: z.ZodObject<{ techStack: z.ZodOptional>; }, "strip", z.ZodTypeAny, { techStack?: string[] | undefined; }, { techStack?: string[] | undefined; }>; export type ListRulePresetsInput = z.infer; export declare const ListRuleExportsInputSchema: z.ZodObject<{ projectDir: z.ZodString; }, "strip", z.ZodTypeAny, { projectDir: string; }, { projectDir: string; }>; export type ListRuleExportsInput = z.infer; export declare const ResetStateInputSchema: z.ZodObject<{ projectDir: z.ZodString; }, "strip", z.ZodTypeAny, { projectDir: string; }, { projectDir: string; }>; export type ResetStateInput = z.infer; export declare const SuggestErrorImprovementInputSchema: z.ZodObject<{ projectDir: z.ZodString; }, "strip", z.ZodTypeAny, { projectDir: string; }, { projectDir: string; }>; export type SuggestErrorImprovementInput = z.infer; export declare const AnalyzeABResultsInputSchema: z.ZodObject<{ projectDir: z.ZodString; testId: z.ZodOptional; }, "strip", z.ZodTypeAny, { projectDir: string; testId?: string | undefined; }, { projectDir: string; testId?: string | undefined; }>; export type AnalyzeABResultsInput = z.infer; export declare const AssessSuitabilityInputSchema: z.ZodObject<{ projectDir: z.ZodString; techStack: z.ZodOptional>; analysisDepth: z.ZodDefault>>; }, "strip", z.ZodTypeAny, { projectDir: string; analysisDepth: "quick" | "full"; techStack?: string[] | undefined; }, { projectDir: string; techStack?: string[] | undefined; analysisDepth?: "quick" | "full" | undefined; }>; export type AssessSuitabilityInput = z.infer; export declare const StartABTestInputSchema: z.ZodObject<{ projectDir: z.ZodString; ruleId: z.ZodString; baselineMedium: z.ZodEnum<["linter_error", "linter_warn", "linter+hook", "claude_md", "ci", "hook", "settings", "none", "claude.md", "linter", "settings.json"]>; testMedium: z.ZodEnum<["linter_error", "linter_warn", "linter+hook", "claude_md", "ci", "hook", "settings", "none", "claude.md", "linter", "settings.json"]>; durationDays: z.ZodDefault>; metrics: z.ZodDefault]>, "many">>>; }, "strip", z.ZodTypeAny, { ruleId: string; projectDir: string; baselineMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; testMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; durationDays: number; metrics: (string | { name: string; weight: number; })[]; }, { ruleId: string; projectDir: string; baselineMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; testMedium: "none" | "linter" | "ci" | "linter_error" | "linter_warn" | "linter+hook" | "claude_md" | "hook" | "settings" | "claude.md" | "settings.json"; durationDays?: number | undefined; metrics?: (string | { name: string; weight: number; })[] | undefined; }>; export type StartABTestInput = z.infer; export declare const CollectABMetricsInputSchema: z.ZodObject<{ projectDir: z.ZodString; testId: z.ZodString; triggerCount: z.ZodNumber; fixRate: z.ZodNumber; bypassCount: z.ZodNumber; userFeedback: z.ZodOptional; }, "strip", z.ZodTypeAny, { testId: string; projectDir: string; triggerCount: number; fixRate: number; bypassCount: number; userFeedback?: string | undefined; }, { testId: string; projectDir: string; triggerCount: number; fixRate: number; bypassCount: number; userFeedback?: string | undefined; }>; export type CollectABMetricsInput = z.infer; export declare const OptimizeErrorMessageInputSchema: z.ZodObject<{ projectDir: z.ZodOptional; ruleId: z.ZodOptional; ruleName: z.ZodOptional; scenario: z.ZodOptional; actualCode: z.ZodOptional; fileName: z.ZodOptional; lineNumber: z.ZodOptional; rateAfter: z.ZodOptional; }, "strip", z.ZodTypeAny, { ruleId?: string | undefined; projectDir?: string | undefined; ruleName?: string | undefined; scenario?: string | undefined; actualCode?: string | undefined; fileName?: string | undefined; lineNumber?: number | undefined; rateAfter?: boolean | undefined; }, { ruleId?: string | undefined; projectDir?: string | undefined; ruleName?: string | undefined; scenario?: string | undefined; actualCode?: string | undefined; fileName?: string | undefined; lineNumber?: number | undefined; rateAfter?: boolean | undefined; }>; export type OptimizeErrorMessageInput = z.infer; export declare const CognitiveSkillInputSchema: z.ZodObject<{ skillType: z.ZodEnum<["diagnostic", "educational", "decision-support"]>; ruleId: z.ZodString; projectDir: z.ZodOptional; codePattern: z.ZodOptional; contextDescription: z.ZodOptional; topic: z.ZodOptional; experienceLevel: z.ZodOptional>; currentMedium: z.ZodOptional; candidateMedia: z.ZodOptional>; projectPhase: z.ZodOptional; teamSize: z.ZodOptional; techStack: z.ZodOptional>; }, "strip", z.ZodTypeAny, { ruleId: string; skillType: "educational" | "diagnostic" | "decision-support"; projectDir?: string | undefined; projectPhase?: string | undefined; teamSize?: string | undefined; techStack?: string[] | undefined; codePattern?: string | undefined; contextDescription?: string | undefined; topic?: string | undefined; experienceLevel?: "beginner" | "intermediate" | "advanced" | undefined; currentMedium?: string | undefined; candidateMedia?: string[] | undefined; }, { ruleId: string; skillType: "educational" | "diagnostic" | "decision-support"; projectDir?: string | undefined; projectPhase?: string | undefined; teamSize?: string | undefined; techStack?: string[] | undefined; codePattern?: string | undefined; contextDescription?: string | undefined; topic?: string | undefined; experienceLevel?: "beginner" | "intermediate" | "advanced" | undefined; currentMedium?: string | undefined; candidateMedia?: string[] | undefined; }>; export type CognitiveSkillInput = z.infer; //# sourceMappingURL=types.d.ts.map