/** * @fileoverview Unified human-readable graph report. * * Extracted from `cli/graph.ts` so the orchestrator there stays focused * on dispatch (json/sarif/catalog-json/packages/report/gate/cloud-report). * * Owns the catalog-summary, findings-by-rule, entry-points, and summary * sections as a `string[]` builder (`buildUnifiedReportLines`). The graph * CLI feeds these lines into the `RunPresentation.verboseDetail` it hands the * render seam (envelope-first-presentation RP-2); the central render seam turns * them into Ink (TTY) or plain text (pipe/CI) — there is no direct stdout writer * here anymore. */ import type { Catalog, Indexes } from '../types.js'; import type { Signal } from '@opensip-cli/core'; /** Inputs for building the unified human-readable graph report. */ export interface UnifiedReportInput { readonly catalog: Catalog | null; readonly indexes: Indexes | null; readonly signals: readonly Signal[]; readonly cacheHit: boolean; } /** * The serializable live-run output the off-process graph worker streams back to * the parent (ADR-0028). A `RunGraphResult` itself can't cross the fork boundary * — it carries class instances with methods (the resolution-stats accumulator) + * Maps — so the worker (which holds the catalog/indexes) pre-computes the things * the live renderer needs: the run's `signals` (for persistence + the verdict), * the count of waivers applied, and the already-built `reportLines`. All plain * data. * * `signals` here is the POST-`@graph-ignore` waived set. {@link buildLiveGraphOutput} * is the live path's leg of the single suppression chokepoint (it calls * {@link finalizeGraphSignals}), so the live/worker producers and the static * `dispatchGraphResult` path apply IDENTICAL waivers — that is the structural fix * for the TTY-only leak (suppression was previously applied on the static path * only). `reportLines` is rendered from the SAME waived set, so the TTY final * frame and the piped report agree finding-for-finding. */ export interface LiveGraphOutput { readonly signals: readonly Signal[]; readonly suppressedCount: number; readonly reportLines: readonly string[]; /** * The catalog's RESOLVED resolution tier (envelope-first-presentation RP-2). * Plain data so it survives the IPC structured-clone. The live done frame * surfaces graph's fast-tier caveat as a muted banner above the summary/detail * body — parity with the static `presentationToView` banners, which read the * same `catalog.resolutionMode`. Absent / `exact` ⇒ no banner. */ readonly resolutionMode?: 'exact' | 'fast'; /** * Count of discovered files the parser dropped (from * `catalog.buildCoverage.parseErrorFiles`). Plain data for the IPC boundary; * the live done frame surfaces it as the parse-failure banner — parity with * the static path's `RunPresentation.banners`. Absent / `0` ⇒ no banner. */ readonly parseErrorFiles?: number; } /** * Derive the serializable {@link LiveGraphOutput} from a completed build — the * LIVE path's leg of the single suppression chokepoint. Used by BOTH the * off-process worker and the in-process fallback so the live renderer gets an * identical, already-waived payload regardless of where the build ran. * * `buildRoot` is the directory the signals' project-relative `code.file` paths * resolve against — the same base the static path threads as `suppressionRoot`. * For the bare-`graph` live view this is the project cwd. Both `signals` and the * `reportLines` rendered from them are the WAIVED set, closing the parity gap. */ export declare function buildLiveGraphOutput(input: UnifiedReportInput, buildRoot: string): Promise; /** Count distinct source files referenced in a catalog. */ export declare function countFiles(catalog: Catalog): number; /** Options for {@link buildUnifiedReportLines}. */ export interface BuildUnifiedReportOptions { /** * Whether to append the trailing "== Summary ==" footer block. * Default `true` for back-compat with the stdout writer. The Ink * runner sets this to `false` because the cli-ui `RunSummary` * component renders the summary in its place. */ readonly includeSummary?: boolean; } /** Build unified terminal report lines from catalog, indexes, and signals. */ export declare function buildUnifiedReportLines(input: UnifiedReportInput, options?: BuildUnifiedReportOptions): readonly string[]; /** * The fast-tier approximation caveat for a catalog, or `undefined` when * the catalog is exact (semantic). Surfaced through `RunPresentation.banners` * (envelope-first-presentation RP-2) so the render seam shows it once as a muted * line above the summary, themed in Ink and plain in pipes — no hand-written * stdout copy. */ export declare function resolutionBannerText(resolutionMode: 'exact' | 'fast' | undefined): string | undefined; /** * The parse-failure coverage notice for a run, or `undefined` when every * discovered file parsed. Surfaced beside the resolution caveat through * `RunPresentation.banners` / the live done-frame banner so a catalog missing * unparseable files is never silently green — the run log * (`graph.catalog.parse.dropped`) names each dropped file. */ export declare function parseFailureBannerText(parseErrorFiles: number | undefined): string | undefined; //# sourceMappingURL=graph-report.d.ts.map