import type { AuditVerdict } from './audit-runner.js'; import { todayUtcYmd } from './today.js'; /** * Pure rendering of the PR title/body for a freshness audit. Kept separate * from the git/gh side effects in `openFreshnessPr` so the rendering is * testable without invoking subprocesses (Task 10 acceptance: "The PR * title/body rendering MUST be a pure function"). */ export interface RenderPrOptions { /** Optional MMR job ID to reference in the PR body (Task 11 will gate on it). */ mmrJobId?: string; } export interface RenderedPr { title: string; body: string; /** Branch suffix derived from entry name; caller pairs with a date. */ entryName: string; } export declare function renderFindingsTable(verdict: AuditVerdict): string; export declare function renderPrTitle(verdict: AuditVerdict): string; export declare function renderPrBody(verdict: AuditVerdict, opts?: RenderPrOptions): string; export { todayUtcYmd }; /** * Sanitize an entry name for use as a git branch component. We never * interpolate raw user-controlled strings into a shell command, but the * entry name does become a branch ref — disallow whitespace, slashes * (already a path separator in the prefix), and non-ascii. The on-disk * entry names in `content/knowledge/*` are all kebab-case ASCII so this * is a safety net, not a transformation. */ export declare function sanitizeForBranch(entryName: string): string; export declare function branchNameForEntry(entryName: string, ymd: string): string; export declare function renderFreshnessPr(verdict: AuditVerdict, opts?: RenderPrOptions): RenderedPr; /** Volatility-tier → PR label mapping. Used for triage/filtering. */ export declare function volatilityLabel(volatility: string | undefined): string | undefined; export interface OpenPrOptions { /** Path to the audited entry .md (already updated on disk). */ entryPath: string; /** Volatility from the entry frontmatter; used to derive the volatility label. */ volatility: string | undefined; /** Optional MMR job ID. */ mmrJobId?: string; /** Override the date used for the branch suffix (tests). */ now?: Date; } /** * Open a freshness PR. Pre-conditions: * - The on-disk entry at `entryPath` already has the verdict applied. * - The git working tree must show ONLY `entryPath` as modified (no other * unrelated changes). This is a safety guard so a manual run can't * accidentally sweep in unrelated work. * - `gh` CLI is authenticated. */ export declare function openFreshnessPr(verdict: AuditVerdict, opts: OpenPrOptions): { branch: string; prUrl: string; }; /** * Extract `volatility` from an entry's frontmatter. We can't import the * knowledge-loader here because it pulls in the full assembly stack; * a minimal yaml-only read keeps this surface lean. */ export declare function readVolatility(entryContent: string): string | undefined; //# sourceMappingURL=audit-apply-pr.d.ts.map