'use client'; import { z } from "zod"; //#region src/ci/verdict.d.ts /** * The versioned, shared verdict contract (#3497) — the cohesion mechanism for * the CI⇄MCP verdict loop (epic #3493). One condition's outcome on a CI run, * structured so an agent can *route* it (fix / add a test / escalate) without * scraping a build log. Every future condition — coverage gaps, regressions, * schema drift, nudges — emits this same shape, so no condition grows its own * red/green or its own remediation UX. * * The same payload is meant to render to the PR comment and to surface in the * MCP run object; the surfacing itself is owned by #3106/#3105, so this module * defines and validates the contract they consume, plus a reference renderer. * * Copy rule (ADR-0003): every string a verdict carries — `reason`, the action * `detail`s — renders verbatim in the PR comment. Hold it to * the `writing` skill (`.claude/skills/writing/SKILL.md`): one point per field, no hedging, no * self-narration, no restating the condition. The terse-voice test in * `verdict.test.ts` is the reference copy the analyzer conforms to. */ /** * Bump only on a *breaking* change to the shape below, so a consumer can refuse * a payload it doesn't understand. Additive, backward-compatible fields do not * require a bump. */ declare const VERDICT_CONTRACT_VERSION = 1; /** * How honest the run can be about a condition. `pass` is the only clean * outcome; every other class is a non-pass the loop must route. * `uncertain-conservative-flag` is the deliberate "we could not check this, so * we're flagging to be safe" state — kept distinct so the tool's blindness is * never dressed up as either a clean pass or a hard failure. */ declare const VerdictClass: z.ZodEnum<{ pass: "pass"; "coverage-gap": "coverage-gap"; finding: "finding"; "infra-error": "infra-error"; "setup-broken": "setup-broken"; "uncertain-conservative-flag": "uncertain-conservative-flag"; }>; type VerdictClass = z.infer; /** * The kind of action a verdict routes to. The ceiling is `auto-fix`; the floor * is `notify-human` — escalate-to-human-with-context, a designed success state * rather than a gap. `none` is only for a clean pass. */ declare const VerdictActionKind: z.ZodEnum<{ "auto-fix": "auto-fix"; "add-test": "add-test"; triage: "triage"; "notify-human": "notify-human"; none: "none"; }>; type VerdictActionKind = z.infer; /** * A routable next action. `detail` always carries the human- and * machine-readable specifics: the fix instruction, the test to add, or — for * `notify-human` — the context handed to the person. Modeling "notify human * (with context)" as a first-class value, not an absent field, is the point: * the escalate-to-human floor is always well-formed, never an absence. */ declare const VerdictAction: z.ZodObject<{ kind: z.ZodEnum<{ "auto-fix": "auto-fix"; "add-test": "add-test"; triage: "triage"; "notify-human": "notify-human"; none: "none"; }>; detail: z.ZodString; }, z.core.$strip>; type VerdictAction = z.infer; /** A next step / triage action that escalates to a human, carrying context. */ declare function notifyHuman(context: string): VerdictAction; /** The "nothing to do" action, for a clean pass. */ declare const NO_ACTION: VerdictAction; declare const CiVerdict: z.ZodObject<{ version: z.ZodLiteral<1>; condition: z.ZodString; verdictClass: z.ZodEnum<{ pass: "pass"; "coverage-gap": "coverage-gap"; finding: "finding"; "infra-error": "infra-error"; "setup-broken": "setup-broken"; "uncertain-conservative-flag": "uncertain-conservative-flag"; }>; reason: z.ZodString; nextStep: z.ZodObject<{ kind: z.ZodEnum<{ "auto-fix": "auto-fix"; "add-test": "add-test"; triage: "triage"; "notify-human": "notify-human"; none: "none"; }>; detail: z.ZodString; }, z.core.$strip>; triageAction: z.ZodObject<{ kind: z.ZodEnum<{ "auto-fix": "auto-fix"; "add-test": "add-test"; triage: "triage"; "notify-human": "notify-human"; none: "none"; }>; detail: z.ZodString; }, z.core.$strip>; docsUrl: z.ZodOptional; suggestedMcpTools: z.ZodDefault>; }, z.core.$strip>; type CiVerdict = z.infer; /** * Render a verdict to Markdown for a PR comment. Intentionally presentation * only: it shows the fields, it does not decide pass/fail (that mapping is the * failure taxonomy, #3498). Kept alongside the contract so "the comment renders * from the contract" is demonstrably true and ready for the analyzer to import. */ declare function renderVerdictMarkdown(verdict: CiVerdict): string; //#endregion export { CiVerdict, NO_ACTION, VERDICT_CONTRACT_VERSION, VerdictAction, VerdictActionKind, VerdictClass, notifyHuman, renderVerdictMarkdown }; //# sourceMappingURL=verdict.d.mts.map