// engine/spec-audit/tier2-classifier.ts — SPEC-744
// Tier-2 LLM-based semantic drift detection.
// STUB: actual LLM call is out of scope per spec — returns canned response.
// Budget tracking is simulated.
export function createBudgetTracker(budgetUsd) {
    return { usedUsd: 0, budgetUsd, exhausted: false };
}
/**
 * Run tier-2 classification for an ambiguous case.
 *
 * STUB implementation: assumes the first candidate is a rename of the
 * original symbol (same behaviour). Returns no finding.
 *
 * In production this would call a Haiku-class LLM with the spec body +
 * candidate symbol and interpret the response.
 */
// eslint-disable-next-line @typescript-eslint/require-await -- stub; production impl will be async
export async function classifyAmbiguous(input, tracker, _model = 'haiku') {
    if (tracker.exhausted) {
        return null;
    }
    // Simulated cost per invocation ($0.001 per call — Haiku tier)
    const costUsd = 0.001;
    if (tracker.usedUsd + costUsd > tracker.budgetUsd) {
        // eslint-disable-next-line no-param-reassign -- intentional budget tracking mutation
        tracker.exhausted = true;
        return null;
    }
    // eslint-disable-next-line no-param-reassign -- intentional budget tracking mutation
    tracker.usedUsd += costUsd;
    // STUB: if candidates exist, assume rename → no drift (P1 suppressed)
    if (input.candidates.length > 0) {
        return { finding: null, costUsd };
    }
    const finding = {
        specId: input.specId,
        path: input.path,
        priority: 'P1',
        reason: `Symbol "${input.symbol}" appears to have been removed (tier-2 confirmed)`,
        evidence: `No semantically equivalent symbol found near "${input.symbol}"`,
        tier: 2,
    };
    return { finding, costUsd };
}
//# sourceMappingURL=tier2-classifier.js.map