/** * `pre-post-diff` producer — the missing evidence source for the * `existing-functionality-intact` dimension of `peaks prepare-final-review`. * * THE GAP THIS CLOSES. The dimension's own contract * (`skills/peaks-final-review/references/4-dimensions.md`) asks for "a pre/post * baseline diff [showing] no unintended drift in the test surface, public API, * or key behavior" — an `EvidenceItem` of kind `pre-post-diff`. Nothing in * peaks-loop produced one: the sources mapped to that dimension were * `rd/tech-doc.md` (design intent) and `prd/handoff.md` (approved scope), and * the reviewer LLM itself reported the mismatch ("the only FOUND source is a * design-intent document, not a regression assessment"). `allPass === true` * was therefore unreachable by construction, on every workflow. * * WHAT IT DOES. Compares a base ref against the working tree with git (no new * dependency; `git` is already the repo's baseline tool) and records two * structural surfaces: * 1. test surface — the test FILE lists, and `it(` / `test(` case counts, * before/after; * 2. public API surface — the `.ts` / `.tsx` SOURCE FILE lists, the top-level * `export` statement count, and the ADDED/REMOVED export NAMES over the * changed files. * * WHAT IT DELIBERATELY DOES NOT DO. It never invents a baseline. When no base * ref resolves — or the project is not a git work tree at all, or the base * resolves to HEAD itself so the compared range is empty — it returns * `unavailable` with a reason and writes NO artifact, so the dimension has no * `pre-post-diff` evidence and cannot be reported `pass` on the strength of a * fabricated (or empty) diff. * * HONESTY BOUNDARY (also written into the artifact itself). Export detection is * a line-anchored REGEX, not a type checker. It detects a structural loss — an * export that was removed or renamed — and it CANNOT detect a signature change, * a narrowed type, or a behaviour change inside a function body. It is a drift * detector, not proof that the API is unchanged. File-level deletion IS visible, * because it is read from the file lists rather than inferred from the counts. * * THE VERDICT COMES FIRST. The artifact opens with its `VERDICT:` line, above * the metadata and the counts. The consumer may legitimately receive only the * head of this file (it is an evidence source under a per-file byte cap), and * with the conclusion at the end every such truncation dropped exactly the part * the dimension has to judge — so a partially delivered artifact was * indistinguishable from a clean comparison. Conclusion-first makes "the * reviewer got the answer" a property of the bytes received. */ import { type PrePostDiffResult, type ProducePrePostDiffOptions } from './final-review-contract.js'; /** Test-file globs — the single definition both the file count and the case * count use, so the two can never disagree about what a "test file" is. */ export declare const TEST_FILE_GLOBS: readonly ["*.test.ts", "*.test.tsx", "*.spec.ts", "*.spec.tsx"]; /** Source globs for the public-API surface. */ export declare const API_SOURCE_GLOBS: readonly ["*.ts", "*.tsx"]; /** * The exported NAMES bound by one source line. Approximate by design: the * column-0 anchor is what keeps it to top-level declarations, and * `export { a as b }` binds `b` (the name importers get). */ export declare function extractExportedNames(line: string): readonly string[]; /** * Produce the diff, or say why it could not be produced. Total: it never * throws, because a final review must not die on a missing git binary — it * must report a dimension it could not assess. */ export declare function producePrePostDiff(opts: ProducePrePostDiffOptions): PrePostDiffResult; export { API_DIFF_ARTIFACT_SEGMENTS, PRE_POST_DIFF_VERDICT_MARKER, PRE_POST_DIFF_NO_DRIFT, PRE_POST_DIFF_ADDITIONS_ONLY, PRE_POST_DIFF_DRIFT_DETECTED, classifyPrePostDiffVerdict, type PrePostDiffConclusion, type PrePostDiffComputed, type PrePostDiffUnavailable, type PrePostDiffResult, type ProducePrePostDiffOptions } from './final-review-contract.js';