/**
 * Skill Judge - LLM-as-Judge for validating skill/agent output quality
 *
 * Uses Opus model for deep semantic analysis of code quality, spec alignment,
 * and best practices. Includes timeout handling to prevent stuck states.
 *
 * Features:
 * - Opus model for thorough analysis
 * - Configurable timeout (default 60s)
 * - Progress logging to .specweave/logs/judge-llm.log
 * - Structured verdict: PASS / CONCERNS / FAIL
 * - Domain-specific evaluation criteria
 *
 * @since v1.0.130
 */
import { type CacheBlock } from '../cache/static-context-loader.js';
/**
 * Judge verdict levels
 */
export type JudgeVerdict = 'PASS' | 'CONCERNS' | 'FAIL';
/**
 * Domain-specific criteria
 */
export interface DomainCriteria {
    domain: string;
    criteria: string[];
    weight: number;
}
/**
 * Input for judge evaluation
 */
export interface JudgeInput {
    domain: string;
    taskDescription: string;
    codeChanges: string;
    specRequirements?: string;
    acceptanceCriteria?: string[];
    /**
     * Active increment ID used to expand the `<active>` placeholder in
     * `cache.staticContextFiles` (0669 Wave 2 prompt caching).
     */
    incrementId?: string;
}
/**
 * Judge evaluation result
 */
export interface JudgeResult {
    verdict: JudgeVerdict;
    score: number;
    summary: string;
    strengths: string[];
    concerns: string[];
    recommendations: string[];
    domainChecks: DomainCheck[];
    duration_ms: number;
    timedOut: boolean;
}
/**
 * Individual domain check result
 */
export interface DomainCheck {
    criterion: string;
    passed: boolean;
    notes: string;
}
/**
 * Judge options
 */
export interface JudgeOptions {
    timeout_ms?: number;
    verbose?: boolean;
    logFile?: string;
    model?: string;
    projectRoot?: string;
    thinkingBudget?: ThinkingBudget;
}
/**
 * Thinking-budget mode.
 * - "adaptive": no API `thinking` parameter; rely on prompt-hint adaptive thinking (4.7+ default)
 * - "legacy": pre-4.7 behavior, passes `thinking: { type: "enabled", budget_tokens }` on non-4.7 models
 */
export type ThinkingBudget = 'adaptive' | 'legacy';
/**
 * Check if a model ID belongs to the Opus 4.7 family or newer.
 * 4.7+ models drop the `thinking` API parameter in favor of adaptive thinking
 * triggered by prompt hints.
 */
export declare function isOpus47Family(modelId: string): boolean;
/**
 * Parameters for constructing a judge API request.
 */
export interface BuildApiRequestInput {
    model: string;
    system: string;
    userPrompt: string;
    maxTokens: number;
    thinkingBudget?: ThinkingBudget;
    /**
     * Optional ephemeral cache_control blocks to prepend to the user message
     * content. Populated from {@link loadStaticContext} so CLAUDE.md, config
     * and per-increment spec/rubric can be cached across calls (ADR-0250).
     */
    cacheBlocks?: CacheBlock[];
}
/**
 * Construct the Anthropic API request body for a judge call.
 *
 * Model-version guard:
 * - Opus 4.7 family → never includes `thinking` (adaptive-thinking prompt hint carries the load)
 * - Legacy models  → includes `thinking` only when `thinkingBudget === "legacy"`
 *
 * Prompt caching (0669 Wave 2):
 * - When `cacheBlocks` is non-empty, its entries are prepended to the user
 *   message content as the first elements, BEFORE the dynamic prompt text.
 *   This lets the Anthropic API reuse the cached prefix on subsequent calls.
 */
export declare function buildJudgeApiRequest(input: BuildApiRequestInput): Record<string, unknown>;
/**
 * Resolve the list of static files to cache from the SpecWeave config,
 * expanding the `<active>` placeholder to the provided increment ID.
 *
 * Returns an empty array when prompt caching is disabled or the config
 * doesn't include any static files.
 */
export declare function resolveCacheFilePaths(projectRoot: string, incrementId?: string): Promise<string[]>;
/**
 * Skill Judge using Opus model
 */
export declare class SkillJudge {
    private client;
    private timeout_ms;
    private verbose;
    private logPath;
    private model;
    private projectRoot;
    constructor(options?: JudgeOptions);
    /**
     * Judge skill/agent output
     */
    judge(input: JudgeInput): Promise<JudgeResult>;
    /**
     * Build the evaluation prompt
     */
    private buildPrompt;
    /**
     * Basic evaluation when no API available
     */
    private basicEvaluation;
    /**
     * Result when timeout occurs
     */
    private timeoutResult;
    /**
     * Write judge result to persistent report file for CLI verification.
     * The completion-validator checks for this file before allowing closure.
     */
    writeReport(incrementId: string, result: JudgeResult, consentStatus: 'granted' | 'denied' | 'no-api-key'): string;
    /**
     * Post-processing step for `writeReport`: scan concerns/recommendations/
     * summary for skill-attributable findings and emit one refinement signal
     * per attributed skill. Silent on PASS verdicts. Never throws.
     *
     * @internal exported for testability via a direct method call.
     */
    emitRefinementSignals(incrementId: string, result: JudgeResult): Promise<void>;
    /**
     * Write a WAIVED report when consent is denied or no API key available.
     */
    writeWaivedReport(incrementId: string, reason: string): string;
    /**
     * Format result for display
     */
    formatResult(result: JudgeResult): string;
}
/**
 * Quick judge function for CLI usage
 */
export declare function judgeSkillOutput(domain: string, taskDescription: string, codeChanges: string, options?: JudgeOptions): Promise<JudgeResult>;
/**
 * Judge with spec context
 */
export declare function judgeWithSpec(domain: string, taskDescription: string, codeChanges: string, specRequirements: string, acceptanceCriteria: string[], options?: JudgeOptions): Promise<JudgeResult>;
//# sourceMappingURL=skill-judge.d.ts.map