// engine/readiness-config-loader.ts — Config loader for readiness-checker (SPEC-208)
//
// Provides the 3-layer configurable readiness settings using ObjectConfigLoader.
// Layer 1: src/config/readiness-config.json — system defaults
// Layer 2: data/global/readiness-config-custom.json — global overrides
// Layer 3: data/projects/{hash}/config/readiness-config-overrides.json — project overrides
import { z } from 'zod';
import { ObjectConfigLoader } from './config-loader.js';
// ── Schema ────────────────────────────────────────────────────────────────────
const vagueWordItemSchema = z.object({
    id: z.string().min(1).describe('Unique identifier for this vague word entry'),
    word: z.string().min(1).describe('The vague word to detect in acceptance criteria'),
});
const readinessConfigSchema = z
    .object({
    vagueWords: z
        .array(vagueWordItemSchema)
        .describe('List of words considered vague in acceptance criteria'),
    thresholds: z
        .object({
        strictBlocker: z
            .number()
            .int()
            .min(0)
            .max(100)
            .describe('Score below this triggers a blocker in strict mode'),
        strictCaution: z
            .number()
            .int()
            .min(0)
            .max(100)
            .describe('Score below this triggers a caution warning in strict mode'),
        lenientBlocker: z
            .number()
            .int()
            .min(0)
            .max(100)
            .describe('Score below this triggers a blocker in lenient mode'),
        lenientCaution: z
            .number()
            .int()
            .min(0)
            .max(100)
            .describe('Score below this triggers a caution warning in lenient mode'),
    })
        .describe('Score thresholds for each readiness mode'),
})
    .describe('Readiness checker configuration including vague words and thresholds');
// ── Loader instance ───────────────────────────────────────────────────────────
const loader = new ObjectConfigLoader('readiness-config', readinessConfigSchema);
/**
 * Load the merged readiness configuration for a given project.
 * Falls back to system defaults when no overrides exist.
 */
export function loadReadinessConfig(projectHash) {
    return loader.load(projectHash);
}
//# sourceMappingURL=readiness-config-loader.js.map