/** * The human layer over `GrammarDiagnosis`. * * Three layers, not two: `gating.ts`/`corpus.ts` produce data, `diagnose.ts` decides * `ok` (the CI verdict), and this file makes either readable. Nothing here computes a * finding and nothing here decides pass or fail. A gate consumes the object; a person * reads this. If a number appears below that is not in the report, that is a bug here. * * GROUPED BY CAUSE, NOT BY SITE * ----------------------------- * The first version grouped by site: thirteen findings, each carrying its own copy of * the explanation, the `do` line and the `ok as-is?` line. Measured on * `examples/css/parser.ts`, that was three distinct explanations rendered nine times * across 146 lines. Density that comes from repetition is not detail — it is the same * sentence again, and it buries the arm tables, which are the part a reader acts on. * * A cause is now stated ONCE, given a glyph, and followed by its sites. That also * disposes of the question a glossary would have answered: the glyph is defined at the * head of the only group it labels, so there is nothing to look up. Shipping a glossary * AND the inline explanations would just re-create the duplication this removes. * * WHAT CARRIES MEANING * -------------------- * colour — severity, and importance WITHIN a finding. Exactly one span per block is * the brightest thing in it; provenance and accept keys recede. * glyph — the cause class, so sites are scannable without reading prose. * rules — group boundaries, so the report is blocks rather than a paragraph. * columns — the arm table is aligned, so an ANY arm or an overlap is visible as a * shape before it is read as text. * * All of that lives in the STYLED path. The plain path is the same content with the same * padding and no escapes, so `docs/samples/` stays diffable and the two cannot drift. */ import { type GrammarDiagnosis } from './diagnose.ts'; import type { ChoiceCorpusCost } from './corpus.ts'; import { groupDigits, type Line, type RenderTarget } from './terminal.ts'; export type DiagnoseRenderOptions = RenderTarget & { /** Grammar label for the header. The CLI passes a cwd-relative path. */ name?: string; /** Sites to expand. Default 20; the report always holds all of them. */ limit?: number; /** Corpus cost per choice id, from `measureChoiceCost`. */ cost?: ReadonlyMap; /** Per-arm first-set renderings per choice id, in arm order. */ armFirstSets?: ReadonlyMap; /** Per-arm leading-term labels per choice id, in arm order. */ armLabels?: ReadonlyMap; /** Absolute corpus root, used ONLY for the frame's terminal hyperlink. */ corpusRoot?: string; /** * Finding ids for which `proposeFixes` PROVED a rewrite — applied it, recompiled, and * re-parsed the corpus with identical output. Only these may carry the wrench. A * candidate that was proposed and rejected must never appear here: offering a fix that * does not exist would destroy the one guarantee the feature has. */ fixable?: ReadonlySet; /** The command that would apply them, printed verbatim so nobody has to guess it. */ fixCommand?: string; }; export { groupDigits }; /** The lines a diagnosis renders to — data, so a caller can compose them into a larger * report without going through a string. */ export declare function diagnosisLines(d: GrammarDiagnosis, opts?: DiagnoseRenderOptions): Line[]; export declare function renderDiagnosis(d: GrammarDiagnosis, opts?: DiagnoseRenderOptions): string; //# sourceMappingURL=diagnose-render.d.ts.map