/** * Is this already written down? * * The answer decides the most useful distinction the digest makes — `new` vs * `restated` vs `has-skill` — and it used to be decided by bag-of-words * overlap: count how many content words of the proposal appear anywhere in a * rule line, call it covered above 0.6. That is wrong in both directions and * for the same reason, namely that it does not read. It calls "always run tests * before pushing" covered by a line about "running the test suite in CI", and * it misses a real paraphrase that happens to pick different vocabulary. * * Both mistakes are expensive. A false `restated` accuses a rule that is * working of not working, and tells the reader to rewrite something fine. A * false `new` proposes a rule they already have, which is how a context file * grows duplicates. * * So a model reads the rules and the proposals together and matches them. One * call for the whole batch, because the question is small and the corpus is the * same for every item — the context file is a few thousand tokens and does not * want re-sending once per proposal. */ import type { Model } from "@kolisachint/hoocode-ai"; export interface CoverageIndex { /** Candidate rule lines from the repo context file and both user scopes. */ ruleLines: string[]; skills: Array<{ name: string; description: string; }>; } export interface CoverageMatch { /** The context-file line that covers this, if any. */ rule?: string; /** The skill that covers this, if any. Only set when no rule matched. */ skill?: string; } /** One thing to look up, identified by the label the reduce step grouped on. */ export interface CoverageQuery { label: string; text: string; } /** * Decide coverage for a batch. Injectable so the pipeline can be tested without * a model, and so a run with no model configured can degrade to "everything is * new" rather than failing. */ export type CoverageJudge = (queries: CoverageQuery[], index: CoverageIndex, signal?: AbortSignal) => Promise>; /** Read the verdict list back, ignoring anything malformed rather than failing the run. */ export declare function parseVerdicts(response: string, queries: CoverageQuery[], index: CoverageIndex): Map; export interface CoverageDeps { model: Model; apiKey?: string; headers?: Record; } export declare function createLlmCoverageJudge(deps: CoverageDeps): CoverageJudge; /** Everything is new. Used when no model is available, so the run still produces a digest. */ export declare const noCoverageJudge: CoverageJudge; //# sourceMappingURL=coverage.d.ts.map