import type { CollectedEvidence } from './final-review-evidence-sources.js'; import type { DimensionEvidence, DimensionKind } from './final-review-types.js'; /** * H2 — the reason a dimension is red PERMANENTLY, as opposed to merely unfed on * this run. Reported per source, so the arithmetic is checkable by the reader. */ export interface UndeliverableDimensionEvidence { readonly dimension: DimensionKind; /** * Did the reviewer receive a bounded EXCERPT of at least one of these sources? * * Measured 2026-10-13 on the all-oversized set this report was written for * (`qa-test-report` 19,256 B, `qa/test-cases` 42,335 B, `prd-handoff` 28,414 B * against a 10,240 cap): the allocator inlined 30,720 bytes — a cap-sized head * of each — into the prompt. So "no source can ever be delivered" was true * only of WHOLE delivery, and the report read as if the reviewer had been * shown nothing. This flag is which of those two facts it is. */ readonly excerptDelivered: boolean; readonly sources: readonly { readonly key: string; readonly relativePath: string; readonly totalBytes: number; /** Bytes of this source inlined as an excerpt (0 when none was inlined). */ readonly excerptBytes: number; }[]; } /** * H2 — every required dimension whose verdict is locked to `inconclusive` by * BYTE ARITHMETIC rather than by the reviewer's judgement. * * The defect this exists for: `qa/test-reports/.md` measured 9,492 bytes * on this repo's own run and is the ONLY source on disk for `problem-resolution` * and `no-new-bugs` (the other sources that support them are absent), against a * per-file cap of 10,240 — a 748-byte margin on a file that is REWRITTEN every * round and only grows. The moment it crosses 10,240 both dimensions go * permanently red, and NOTHING said so: `assertFloorReservationAffordable()` * only checks the constant-level relation (`4 x cap <= total`), never whether * any actual source fits the cap it must live under, so the red handoff read as * "the reviewer was unsure" instead of "no evidence can ever reach the * reviewer". A gate that is always red and never explains itself is noise, and * this is the same "always red" harm the floor reservation was built to remove * — one layer down. * * The conditions, all three of which must hold, are chosen so the report cannot * be noise: * 1. NOTHING on disk can back the dimension (no `isDelivered`), and * 2. there IS something on disk to deliver (a source that was never written * is not a delivery failure — same reasoning as the scope-contract gate's * `missing` exemption: a run with no QA phase has no report to lose), and * 3. EVERY one of those on-disk sources is structurally undeliverable — a * single source that merely did not fit TODAY (budget-exhausted `omitted`) * is a different, self-correcting state and is left to the allocator. * * The report is consumed by the prompt (stated to the reviewer), by the * envelope (a marker on each dimension's summary) and by `needsAttention` * (which also clears `allPass`) — see `enforceDeliveryReachability` and * `renderDeliveryReachabilityStatus`. It is a LOUD STATEMENT, not a silent * downgrade, and it is deliberately not a throw: a crash would destroy the * evidence for the three dimensions that ARE deliverable, and the honest fact * here is per-dimension, so it is reported per-dimension. */ export declare function undeliverableDimensions(collected: readonly CollectedEvidence[]): readonly UndeliverableDimensionEvidence[]; /** * H2 — the envelope half of the same fact. A dimension named by * `undeliverableDimensions()` cannot be `pass` (no source on disk can carry its * conclusion), so this is not where the verdict is decided — that is * `enforceEvidenceBackedVerdicts`, and this gate re-applies it so the property * does not depend on that gate's order. What this adds is the REASON: the * dimension's own summary says it is red by construction. Because the verdict * it leaves behind is non-`pass`, the dimension also reaches `needsAttention` * (and clears `allPass`) through the ordinary verdict route, which is the field * the CLI envelope prints — so the human is told WHY instead of being left to * read a permanent red as the reviewer's uncertainty. */ export declare function enforceDeliveryReachability(dimensions: readonly DimensionEvidence[], report: readonly UndeliverableDimensionEvidence[]): readonly DimensionEvidence[];