/** * Guidance-surface passthrough for PR reviews. * * The review pipeline only chunks/analyzes files whose extension is in the * parser-supported set (see `filterAnalyzableFiles` in ./analyzable-files.ts). That drops * two kinds of prose from the material the reviewer reasons about: * - agent-guidance surfaces — shell hooks, `.mdc` rules, CLAUDE.md; and * - project documentation — architecture docs / ADRs under `docs/`, the * user-guide site under `packages/site/docs/`, and `.changeset/` entries. * Both make behavioral/structural claims about the code. For a tool whose * *product* is agent guidance, hiding a hook that calls a keyword search * "meaning-based discovery" is exactly wrong; the same is true of an ADR that * describes a mechanism the code no longer has, or a changeset whose "adds * " line the diff's exports contradict. Stale docs/guidance are a * functional bug, not a style nit (see PR #658, and the 60-PR review-gap * analysis that found doc↔code drift escaping on exactly these surfaces). * * This module widens the review INPUT without touching the parser: it collects * the raw unified-diff hunks of any changed file that is a guidance/doc surface * and injects them as a clearly-labeled `` block, so * the prose reaches the model (and the `doc-truth` rule) instead of being * silently dropped. It is a deterministic, zero-LLM pass over the existing * patches — mirroring the `` / `` * precedents (a focused view derived from the diff, appended unconditionally). * * Scope is deliberately tight (KISS): NOT every `.md`/`.json` in the repo — only * the guidance surfaces above and specific documentation roots (no blanket * `**\/*.md`, no source-tree READMEs). The passthrough is byte-capped both * per-file (so one huge doc can't evict the others) and in total; when either * cap bites it says so rather than truncating silently. */ import type { SignalContext } from './signal-context.js'; /** A changed guidance/doc surface file and its raw unified-diff hunk(s). */ export interface GuidanceSurfaceChange { file: string; /** Raw unified-diff patch text for this file, as returned by the GitHub API. */ patch: string; } /** True when `file` is a guidance or documentation surface (see matchers). */ export declare function isGuidanceSurface(file: string): boolean; /** * Collect the changed guidance/doc-surface files and their raw diff hunks from * the PR patches, SMALLEST HUNK FIRST. Order is a budget-fairness decision, * not cosmetics: with a total cap, processing in diff order lets one * voluminous prose file exhaust the budget and evict small claim-dense files * entirely (observed on PR #687, where skills/rules prose crowded out the * config-system.md retired-key note the doc-truth rule needed to see). * Smallest-first guarantees every compact claim-bearing hunk gets in before * any file needs truncation. Exposed for testing. */ export declare function collectGuidanceSurfaceChanges(patches: Map): GuidanceSurfaceChange[]; /** * Render the collected guidance/doc-surface changes as a * `` block for the agent's initial message. Returns '' * when there are none, so callers can append unconditionally. * * Two caps keep the block bounded without silent loss: * - each file's hunk is capped at MAX_PER_FILE_CHARS, so one oversized doc * can't evict the others (over-cap hunks are marked truncated in place and * the loop CONTINUES to the next file); * - the total is capped at MAX_GUIDANCE_CHARS; once it is exhausted the * remaining files are omitted with an explicit count. * Both a per-file truncation and a whole-file omission are stated inline. */ export declare function renderGuidanceSurfaceChanges(changes: GuidanceSurfaceChange[]): string; /** * Build the `` section from the review context. * Returns '' when there is no diff or no changed guidance/doc surface. */ export declare function renderGuidanceSurfaceSection(context: SignalContext): string; //# sourceMappingURL=guidance-surface-signals.d.ts.map