/**
 * Semantic concept judge — "does the built artifact actually implement
 * the features the user asked for?"
 *
 * Distinct from the domain/code/coherence judges in `judges.ts`:
 *   - those judges score free-form conversational agent outputs along
 *     quality dimensions (accuracy, depth, etc.)
 *   - this judge scores a *built artifact* (served HTML + source files)
 *     against an explicit list of expected concepts, returning per-concept
 *     {present, score 0-10, evidence, severity}.
 *
 * The judge is strict about distinguishing (a) a working implementation
 * from (b) a keyword-present stub. "// TODO: mint button" is NOT present.
 * Only real, functional, wired-up code counts.
 *
 * Use via {@link createSemanticConceptJudge} or directly via
 * {@link runSemanticConceptJudge}. Soft-fails (available=false) on LLM
 * or JSON-parse errors so the caller can treat that as "layer skipped"
 * rather than "layer failed" in a multi-layer pipeline.
 */
import { type LlmClientOptions } from './llm-client';
import type { Severity } from './multi-layer-verifier';
/**
 * Implementation complexity class for weighted scoring.
 *
 * - `render` (default): the concept is a UI surface that displays static
 *   data — render a list, show a counter, lay out a button. Single-file
 *   work, no external integration.
 * - `integrate`: the concept requires wiring a real external system —
 *   wallet connect (wagmi + RainbowKit + chain config), payment provider
 *   (Stripe Elements + intent + webhook), an API client with auth.
 *   Multi-file, library-knowledge, runtime correctness matters.
 * - `compute`: the concept requires algorithmic work — solver, simulator,
 *   constraint propagation, ML inference. Correctness > UI polish.
 *
 * Default weights (when applied via `weightConcepts: 'complexity'`):
 *   render=1.0, integrate=2.0, compute=2.5
 *
 * Cross-vertical scoring without complexity weighting silently inflates
 * the rate of UI-heavy verticals (healthcare, fintech dashboards) vs
 * integration-heavy verticals (DeFi, wallets) — all concepts treated
 * equally even though the agent does 2-3x the work for `integrate`.
 */
export type ConceptComplexity = 'render' | 'integrate' | 'compute';
export interface ConceptSpec {
    name: string;
    /** Short hints that help the judge; not used for matching. */
    keywords?: string[];
    /** Optional explicit weight; default 1.0. Overrides complexity-derived weight. */
    weight?: number;
    /** Implementation complexity class. Default `render`. */
    complexity?: ConceptComplexity;
}
export interface ConceptFinding {
    concept: string;
    present: boolean;
    /** 0..10. 10 = production-ready; 7 = functional thin; 4 = partial; 0 = absent. */
    score: number;
    evidence: string;
    severity: Severity;
}
export interface SemanticConceptJudgeInput {
    /** Full natural-language prompt the agent was handed. */
    userRequest: string;
    /** Rendered HTML the preview returns (UI artifacts). Optional. */
    servedHtml?: string;
    /** Top-level source files from the agent's workdir. */
    sourceFiles: Array<{
        path: string;
        content: string;
    }>;
    /** The expected concept list. */
    expectedConcepts: ConceptSpec[];
    /** Free-form metadata (id, difficulty) to inject into the prompt. */
    artifactLabel?: string;
    artifactDescription?: string;
}
export interface SemanticConceptJudgeResult {
    kind: 'semantic-concept';
    version: string;
    /** Normalized 0..1 score — mean of per-concept scores / 10. */
    score: number;
    presentCount: number;
    totalCount: number;
    findings: ConceptFinding[];
    summary: string;
    durationMs: number;
    costUsd: number | null;
    /** False on LLM/JSON error — treat as "skipped / unable to judge" in pipelines. */
    available: boolean;
    error?: string;
}
/**
 * Score-aggregation strategy. `mean` averages 0-10 scores uniformly.
 * `complexity` applies the default weight table (render=1, integrate=2,
 * compute=2.5) unless a concept has an explicit `weight`. `explicit`
 * honors only `weight` (defaulting to 1 for unspecified).
 */
export type ConceptWeightStrategy = 'mean' | 'complexity' | 'explicit';
export declare const DEFAULT_COMPLEXITY_WEIGHTS: Record<ConceptComplexity, number>;
export interface SemanticConceptJudgeOptions {
    /** Model id to call. Default 'claude-sonnet-4-6' via agent-eval defaults. */
    model?: string;
    /** Per-call timeout. Default 300s. */
    timeoutMs?: number;
    /** Pipeline budget for the prompt (source blob truncation). Default 45000. */
    maxSourceChars?: number;
    /** Per-file cap before inclusion. Default 20000. */
    maxPerFileChars?: number;
    /** HTML cap. Default 30000. */
    maxHtmlChars?: number;
    /** LlmClient config (baseUrl, apiKey, authHeader, …). */
    llm?: LlmClientOptions;
    /**
     * Score aggregation strategy. Default `mean` — uniform average across
     * concepts. Cross-vertical comparisons should use `complexity` to
     * neutralize the integrate-vs-render asymmetry.
     */
    weightConcepts?: ConceptWeightStrategy;
    /** Override the default complexity → weight table. */
    complexityWeights?: Partial<Record<ConceptComplexity, number>>;
}
export declare const SEMANTIC_CONCEPT_JUDGE_VERSION = "semantic-concept-judge-v1-2026-04-24";
/**
 * Run the semantic concept judge. Soft-fails to available=false on
 * LLM/JSON errors — callers in a MultiLayerVerifier pipeline can treat
 * that as "skip" rather than "fail."
 */
export declare function runSemanticConceptJudge(input: SemanticConceptJudgeInput, options?: SemanticConceptJudgeOptions): Promise<SemanticConceptJudgeResult>;
/**
 * Factory: pin LLM options once, return a closure that accepts inputs.
 * Convenient for pipelines that want to share a single LlmClient config.
 */
export declare function createSemanticConceptJudge(options?: SemanticConceptJudgeOptions): (input: SemanticConceptJudgeInput) => Promise<SemanticConceptJudgeResult>;
//# sourceMappingURL=semantic-concept-judge.d.ts.map