import { TSC_VERIFIER } from './verifiers/tsc.js';
import { STUB_COMPLETENESS_VERIFIER } from './verifiers/stub-completeness.js';
export const VERIFIERS = [
    TSC_VERIFIER,
    STUB_COMPLETENESS_VERIFIER,
    // Future:
    //   PY_MYPY_VERIFIER  — `mypy --strict src/`
    //   GO_VET_VERIFIER   — `go vet ./...`
    //   JAVA_MVN_VERIFIER — `mvn -q compile`
    //   RUST_CARGO_CHECK_VERIFIER — `cargo check`
];
/**
 * Run all applicable verifiers against the realized output. Verifiers
 * run in series (most are heavyweight enough that parallel doesn't
 * help much, and series gives predictable log output). Each verifier's
 * tool-level failures are isolated — one failure doesn't stop the
 * others.
 *
 * Verifier filtering order:
 *   1. `enabledByDefault === false` AND id NOT in `enabledOverrides` → SKIP
 *   2. `applies(ctx)` returns false → SKIP
 *   3. Otherwise → run
 *
 * Missing `enabledByDefault` field is treated as `true` (backwards-
 * compatible default). The `enabledOverrides` parameter lets callers
 * opt-in to experimental verifiers at run-time without changing the
 * manifest.
 */
export async function runAllVerifiers(ctx, enabledOverrides) {
    const out = [];
    for (const v of VERIFIERS) {
        const enabledByDefault = v.enabledByDefault !== false;
        const explicitlyEnabled = enabledOverrides?.has(v.id) ?? false;
        if (!enabledByDefault && !explicitlyEnabled)
            continue;
        if (!v.applies(ctx))
            continue;
        try {
            const result = await v.verify(ctx);
            out.push(result);
        }
        catch (err) {
            out.push({
                verifierId: v.id,
                durationMs: 0,
                ok: false,
                errors: [],
                notes: [`Verifier "${v.id}" threw: ${err?.message ?? String(err)}`],
            });
        }
    }
    return out;
}
export function findVerifier(id) {
    return VERIFIERS.find((v) => v.id === id);
}
//# sourceMappingURL=verifier-manifest.js.map