import type { Triage } from './index.js'; /** * What a bug looks like from outside, for deciding whether two reports are the same bug. * * The feature (or page) alone is too coarse: a broken discount code and a rejected postcode are both on /checkout but * need separate fixes. The exact wording is too fine: "Pay button does nothing" and "clicking pay does nothing" are one * bug. So reports match when they are about the same feature and either raise the same error or, when a model wrote * the summaries, describe the symptom in largely the same words. * * Without a model the summary is the customer's own wording, which varies too much to compare: those reports group by * feature/page, as one bug reported many ways, unless their console errors show they are different bugs. Splitting one * bug into several incidents would mean duplicate fixes; a second bug on the page is reported again after the first * one's fix merges. */ export interface Symptom { /** The affected feature (as the model named it) or page, normalized. */ feature?: string; /** The path of the page the report came from, normalized. */ page?: string; /** The first console error with volatile parts (URLs, file positions, numbers, ids) removed. */ error?: string; /** Distinctive words of the symptom description, stemmed, sorted. */ words: string[]; /** The words come from a model's normalized summary, so comparing them is meaningful. */ normalized?: boolean; } export declare function symptomWords(text: string): string[]; /** "TypeError: x is undefined at https://a.b/c.js:10:4" and the same error from another build or line read the same. */ export declare function normalizeError(error: string): string; export declare function symptomOf(triage: Pick & Partial>, consoleErrors?: string[]): Symptom; /** * Whether two reports describe the same bug. `samePageIsEnough` (the default) lets reports whose wording can't be * compared, because no model wrote it, join on the feature alone; pass false when only a real match should count. */ export declare function sameSymptom(a: Symptom, b: Symptom, samePageIsEnough?: boolean): boolean; /** For storing a symptom in a GitHub issue as a hidden marker: no characters that could end an HTML comment. */ export declare const encodeSymptom: (symptom: Symptom) => string; export declare function decodeSymptom(encoded: string): Symptom | undefined; //# sourceMappingURL=grouping.d.ts.map