'use client'; import { CiVerdict } from "./verdict.mjs"; import { CiConclusion } from "./taxonomy.mjs"; //#region src/ci/policy.d.ts /** What a repo lets a condition do: fail the run, warn-only, or ignore it. */ type ConditionPolicy = "fail" | "warn" | "off"; /** One condition's evaluated outcome, before policy is applied. */ interface ConditionResult { /** Stable condition key, matched against the repo config (e.g. "untested-data-access"). */ condition: string; verdict: CiVerdict; } /** A condition after policy resolution — its effective conclusion and the policy that shaped it. */ interface ResolvedCondition { condition: string; policy: ConditionPolicy; verdict: CiVerdict; conclusion: CiConclusion; } interface RunEvaluation { /** The run's overall conclusion — the worst surfaced per-condition conclusion. */ conclusion: CiConclusion; /** Per-condition results that were surfaced (an `off` condition is dropped). */ conditions: ResolvedCondition[]; } /** Per-repo policy: condition key → its policy. Absent keys fall back to defaults. */ type RepoPolicyConfig = Record; /** * Opinionated safe defaults (epic #3493). A captured new query already ran in a * test (tested by definition), so plain `new-query` is informational; but a new * query that ships with a beyond-threshold index recommendation is actionable * while it's still a one-line fix, so `new-query-index` blocks. Everything that * marks a genuine, diff-introduced problem fails by default. The set is * deliberately narrow so the gate under-fires. */ declare const DEFAULT_CONDITION_POLICIES: RepoPolicyConfig; /** * Fallback for a condition with neither a repo setting nor a documented default: * surface it, don't block. Under-firing on an unrecognised condition is the safe * side of the line. */ declare const FALLBACK_POLICY: ConditionPolicy; /** Resolve the effective policy for a condition: repo config, else default, else fallback. */ declare function policyFor(condition: string, config?: RepoPolicyConfig): ConditionPolicy; /** * Evaluate a run: apply each condition's policy, then take the run conclusion as * the worst surfaced conclusion. Pure — the same (results, config) always yields * the same evaluation. * * Only diff-introduced conditions should reach here: detectors (e.g. the crude * gate, #3496) evaluate the PR diff, so pre-existing untouched code never * produces a result and can't trip a condition. With no results, the run passes. */ declare function evaluateRun(results: ConditionResult[], config?: RepoPolicyConfig): RunEvaluation; //#endregion export { ConditionPolicy, ConditionResult, DEFAULT_CONDITION_POLICIES, FALLBACK_POLICY, RepoPolicyConfig, ResolvedCondition, RunEvaluation, evaluateRun, policyFor }; //# sourceMappingURL=policy.d.mts.map