/** * Turn coded verification outcomes into routable {@link SupportFinding}s — the * bridge between PR1's `Check.code` taxonomy and the ticket-ready templates in * `templates.ts`. A finding answers "who fixes this, and how": * * - audience !== developer → EXTERNAL. The fix is a system/environment change * owned by IT / security / a platform team. The rendered ticket is * tool-neutral (never names this harness) and frames the failed INTERNAL * configuration — a `fail` is an `escalation`, a `skip` an `improvement`. * - audience === developer → INTERNAL `self-fix`: the developer runs a command * themselves, so that note may reference the harness's own tooling. * * Everything a ticket needs is canned per `code` (title, evidence, affected area, * requested fix, acceptance criteria) so the template is filled from a stable * `code + verdict + project context`, NEVER from guessed free text. The live * `Check.detail`(s) ride along as supporting evidence. The map is * `Record`, so a new union member without metadata won't compile. */ import type { Check, CheckCode } from "../internals/verify.js"; /** Who acts on a finding. Anything but `developer` is external (tool-neutral). */ export type Audience = "internal-it" | "dev-platform" | "security" | "developer"; /** How urgent. `skip` outcomes are always `optional` (a skip never fails a run). */ export type Severity = "blocking" | "degraded" | "optional"; /** * What the finding produces — derived from audience + verdict, not stored: * `escalation` (external fail), `improvement` (external skip), `self-fix` * (developer, internal). */ export type TemplateKind = "escalation" | "self-fix" | "improvement"; export interface SupportFinding { code: CheckCode; audience: Audience; severity: Severity; kind: TemplateKind; /** Short, tool-neutral issue title (canned per code). */ title: string; /** The requested fix — a system/environment change for external findings. */ recommendedAction: string; /** Live `Check.detail`(s) for this code — deduped across checks that share it. */ details: string[]; /** Canned tool-neutral observation for the "Observed evidence" block (external). */ evidence?: string; /** Fixed-vocabulary routing hint for the Environment block (external). */ affectedArea?: string; /** Canned post-fix checks for the "Acceptance criteria" block (external). */ acceptance?: string[]; /** The capability whose verification surfaced this (e.g. "heal"). */ capability: string; } /** External audiences get tool-neutral, system-fix tickets; developers self-fix. */ export declare function isExternal(audience: Audience): boolean; /** * Map one {@link Check} to a {@link SupportFinding}, or `undefined` when it isn't * routable — a `pass`, or a check with no `code`. Kind derives from audience + * verdict; a `skip` is always optional. */ export declare function toFinding(check: Check, capability: string): SupportFinding | undefined; /** * Collect findings from a verification run's checks: one finding per distinct * `code` (checks that share a code merge their `details`), sorted * most-urgent-first for stable, useful output. */ export declare function findingsFrom(checks: readonly Check[], capability: string): SupportFinding[];