/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Corpus linter. Compares a new recipe output (one parquet file) against pre-computed corpus statistics and * flags token-label distribution outliers, label-vacuum tokens, bigram-label collisions, anti-pattern rule * matches and basic sanity problems. * * The markdown report goes to stdout, with optional markdown and JSON sidecars. The command exits 0 when no * errors are found and 1 when any are, because warnings do not refuse. A flagged recipe output should include * `lint_acknowledged: true` in its manifest before training consumes it. */ /** * Options for {@linkcode lintRecipeOutput}. */ export interface LintRecipeOutputOptions { /** * The new recipe output parquet to lint. */ recipeOutputPath: string; /** * Pre-computed corpus stats JSON (see `corpus-stats.ts`). */ statsPath: string; /** * Anti-pattern rules JSON. * * Default: the `lint-rules.json` beside this module. */ rulesPath?: string; /** * Write the markdown report here as well as stdout. */ outMd?: string; /** * Write a JSON sidecar of the flags + summary here. */ outJSON?: string; } /** * One lint flag emitted by a check. */ export interface LintFlag { check: string; severity: "error" | "warn"; token?: string; bigram?: string; outputLabel?: string; corpusLabel?: string; outputCount?: number; corpusCount?: number; detail: string; ruleID?: string; } /** * Findings summary returned by {@linkcode lintRecipeOutput}. */ export interface LintRecipeOutputSummary { errors: number; warnings: number; findings: LintFlag[]; /** * The rendered markdown report (also printed to stdout). */ report: string; } /** * Lint a recipe output against corpus stats and the anti-pattern rules, * printing the markdown report to stdout. */ export declare function lintRecipeOutput(options: LintRecipeOutputOptions, report?: (line: string) => void): Promise; //# sourceMappingURL=recipe-output.d.ts.map