import type { BacklogFinding, IssueRecord } from "../backlog/lib.js"; import type { AttemptRecord, RulingBaseline } from "../fix/state.js"; import { type IssueContext } from "./context.js"; import { type ArtifactFact, type ScopeFacts, type SiblingFact } from "./facts.js"; /** Which side of the fix a dossier picture is of. */ export type ShotSide = "pre" | "post"; /** One screenshot as the dossier records it. */ export interface IssueShot { /** Filename inside img//, flattened from the evidence-relative path. */ file: string; /** Which subfolder it is in, and what it is a picture of. */ side: ShotSide; route: string; formFactor: string; scheme: string; state: string; } /** A member finding, whole, with its evidence made absolute. */ export type IssueMember = Omit & { evidence: { shotId: string; path: string; absPath: string; hash: string; runId: string; capturedAt?: string; }[]; }; export interface IssueDocument { generated: string; id: string; key: string; title: string; label: string; severity: string; category: string; attribute: string; status: "open" | "blocked" | "fixed" | "archived"; channel: string; verified: boolean; confidence: string; region: string[]; routes: string[]; seenRoutes: string[]; defects: { attribute: string; severity: string; title: string; problem: string; }[]; expected: string; observed: string; fingerprints: string[]; shots: IssueShot[]; acceptance: IssueRecord["acceptance"]; attemptsSpent: number; createdAt: string; causedBy?: IssueRecord["causedBy"]; placement?: IssueRecord["placement"]; archived?: IssueRecord["archived"]; members: IssueMember[]; attempts: AttemptRecord[]; baseline?: RulingBaseline; scope: ScopeFacts | null; siblings: SiblingFact[]; artifacts: ArtifactFact[]; /** The capture that filed the newest evidence, when the workspace still holds it. */ run?: { id: string; finishedAt: string; flags: Record; }; } /** The issue's own status, from its findings alone. */ export declare function statusOf(members: BacklogFinding[]): IssueDocument["status"]; export declare function buildIssueDocument(ctx: IssueContext, record: IssueRecord, shots: IssueShot[]): IssueDocument;