/** * Human-readable + JSON renderers for preflight results. */ import type { DiffResult } from './diff.js'; import type { ScoreResult } from './score.js'; /** * `ANALYSIS_IN_PROGRESS` is distinct from `STALE` on purpose: a repository whose * index is mid-rebuild is not one whose index the user must go rebuild. Telling * them to "run `openlore analyze`" while an analyze is running is exactly the * duplicate work single flight exists to prevent (change * `harden-spec-workflow-lifecycle`). */ export type PreflightStatus = 'FRESH' | 'STALE' | 'MISSING' | 'ANALYSIS_IN_PROGRESS' | 'ERROR'; /** Live owner metadata, present only under `ANALYSIS_IN_PROGRESS`. */ export interface PreflightActiveAnalysis { pid: number | null; stage: string | null; startedAt: string | null; elapsedMs: number | null; heartbeatAgeMs: number; } export interface PerFileEntry { filePath: string; weight: number; hub: boolean; /** Highest fan-in across nodes in the file (for "why is this a hub"). */ maxFanIn: number; /** True if the file isn't represented in the graph at all. */ unknown: boolean; } export interface PreflightSummary { status: PreflightStatus; graphBuiltAt: string | null; graphCommit: string | null; workingCommit: string | null; changedFiles: string[]; unknownFiles: string[]; /** Per-file detail with weight + hub flag. Same order as `changedFiles`. */ perFile: PerFileEntry[]; hubCount: number; leafCount: number; stalenessScore: number; threshold: number; mechanism: 'git' | 'mtime'; warnings: string[]; message: string; /** Present only when an analysis owns this repository right now. */ activeAnalysis?: PreflightActiveAnalysis; } export interface BuildSummaryInput { diff: DiffResult; score: ScoreResult; graphBuiltAt: string | null; graphCommit: string | null; threshold: number; /** Live analysis owner, when one holds the repository. */ activeAnalysis?: PreflightActiveAnalysis; /** True when no analysis artifacts exist at all. */ missing?: boolean; } export declare function buildSummary(input: BuildSummaryInput): PreflightSummary; export declare function renderHuman(s: PreflightSummary): string; /** * Emit GitHub Actions workflow-command annotations so that stale files * appear inline in the PR diff UI when this runs in CI. No-op outside of * GHA. Format docs: * https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions */ export declare function renderGithubAnnotations(s: PreflightSummary): string; export declare function renderJson(s: PreflightSummary): string; //# sourceMappingURL=report.d.ts.map