/**
 * Read `.lisa.config.json`, degrading a refusal into a stated problem.
 * @param registry - The shipped registry
 * @param projectRoot - Project root
 * @returns The parsed config
 */
export function readConfig(registry, projectRoot) {
    try {
        const { runner, gates } = registry.readGates(projectRoot);
        return {
            gates,
            runner,
            runnerFinding: { state: "verified", value: runner },
            runnerSource: runner === registry.DEFAULT_RUNNER ? "default" : "declared",
            problems: registry.validateGates(gates),
        };
    }
    catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return {
            gates: {},
            runner: registry.DEFAULT_RUNNER,
            runnerFinding: {
                state: "unknown",
                reason: "config-unreadable",
                message,
            },
            runnerSource: "unknown",
            problems: [message],
        };
    }
}
//# sourceMappingURL=gate-report-config.js.map