import type { IndexFiles } from "../../indexer/index-files.js"; import type { IndexCode } from "../../indexer/index-code.js"; import type { IndexGraph } from "../../indexer/index-graph.js"; import { type HeuristicFinding } from "./diff-heuristics.js"; export type RiskLevel = "critical" | "high" | "medium" | "low"; export interface InlineComment { /** Repo-relative path of the file being commented on. */ path: string; /** 1-based file line number. GitHub accepts `line` directly since 2022. */ line: number; /** GitHub PR review API value (`RIGHT` for additions, `LEFT` for deletions). */ side: "RIGHT" | "LEFT"; severity: HeuristicFinding["severity"]; /** Markdown body for the inline comment (may include a `suggestion` block). */ body: string; } export interface ReviewJson { ref: string; max_risk: RiskLevel; summary: string; inline: InlineComment[]; /** Files the markdown summary already calls out as high-risk; pre-deduped. */ high_risk_files: { path: string; severity: HeuristicFinding["severity"]; }[]; } /** * Same input shape as `handleReviewDiff` (`{ ref, max_files, ... }`); same * git-diff + heuristic pipeline. Different rendering: a JSON payload the * GitHub Action can hand to `pulls.createReview` to post inline comments. */ export declare function buildReviewJson(indexer: IndexFiles & IndexCode & IndexGraph, args: Record): ReviewJson | { error: string; }; /** Confirms the diff command works in the given repo. Used for smoke tests. */ export declare function diffCommandWorks(rootPath: string, ref: string): boolean;