/** * Reading a failure and saying what kind it is. * * A CATEGORY IS A PROMISE THAT A RULE CAN BE WRITTEN. "This failed" teaches * nothing; "this failed because the path does not exist, 14 times, always under * the same directory" is a line worth putting in an instructions file. So the * patterns here are deliberately narrow: each one recognises wording a tool * actually emits, and anything else stays Unknown and is counted as such rather * than guessed at. * * These run over other people's build output, which is exactly the input a * catastrophic backtrack is found by, and a JavaScript regex cannot be given a * timeout to stop one. So the input is bounded instead -- classification reads a * fixed head of the output, never the whole thing -- and every pattern below is * kept free of a quantifier inside a quantifier. A bound the caller cannot exceed * is the only guarantee available here; a timeout constant would be decoration. */ import { FailureCategory } from './models.js'; /** * Classify one failed tool call. * * `toolName` is used only where the same wording means different things to * different tools -- a search tool returning nothing is a "no matches", the same * words from an edit tool are a missing file. */ export declare function classifyFailure(toolName: string, output: string): FailureCategory; /** How much of an output classification looks at, exported for the same reason. */ export declare const classifyHeadBytes = 2000; /** * The first meaningful line of a failure, for showing as evidence. * * A SHELL FAILURE LEADS WITH "Exit code 1", AND THAT IS NOT THE EVIDENCE. Measured * on real transcripts, taking the first non-empty line made every one of 175 shell * failures read "Exit code 1" -- the detail restated the category and the actual * message sat on the next line, unread. So the lines that only say "this failed" * are stepped over, and one of them is returned only when it is all there was. */ export declare function failureDetail(output: string, limit?: number): string; //# sourceMappingURL=classify.d.ts.map