// engine/ac-gap-detector/keyword-loader.ts — Config-driven keyword sets for AC gap analysis (SPEC-211)
import { z } from 'zod';
import { ConfigLoader } from '../config-loader.js';
/** Schema for a single keyword group (one per domain). */
const AcGapKeywordGroupSchema = z.object({
    id: z.string().describe('Domain identifier matching the gap category (e.g. "error-handling")'),
    domain: z
        .string()
        .describe('Human-readable domain label used in gap rules (must match gap category names)'),
    language: z.string().describe('BCP-47 language tag for this keyword set (e.g. "en", "es")'),
    keywords: z
        .array(z.string())
        .describe('List of lowercase keyword strings that indicate coverage of this domain'),
});
const AcGapKeywordGroupArraySchema = z.array(AcGapKeywordGroupSchema);
const loader = new ConfigLoader('ac-gap-keywords', AcGapKeywordGroupArraySchema);
/**
 * Load all keyword groups, optionally merging project-level overrides.
 * Results are indexed by domain for O(1) lookup.
 */
export function loadKeywordGroups(projectHash) {
    const groups = loader.load(projectHash);
    const map = new Map();
    for (const group of groups) {
        map.set(group.domain, group.keywords);
    }
    return map;
}
/**
 * Get the ConfigLoader instance (for testing / inspection).
 */
export function getKeywordLoader() {
    return loader;
}
//# sourceMappingURL=keyword-loader.js.map