import { type JsonObject } from '../depot/shape.js'; import type { RunTree } from './ci-tree.js'; import type { FailureGroup } from './diagnosis.js'; /** * What one job contributed to `GetRunMetrics`. Verified live 2026-09-06: the document nests * `workflows[].jobs[].job` (identity plus `startedAt`/`finishedAt`) and * `workflows[].jobs[].attempts[].{attempt,availability,stats}`, where `stats` carries * `peakMemoryUtilization` as a 0..1 fraction. Depot publishes no schema, so byte-valued spellings * are read too in case a later response carries them. */ export interface JobMetrics { durationSeconds: number | undefined; peakMemoryBytes: number | undefined; peakMemoryUtilization: number | undefined; } /** Per-job timing and memory read from a `GetRunMetrics` document, keyed the same way as the tree. */ export declare function parseRunMetricsByJob(response: JsonObject): Map; /** * Jobs are matched across runs by `jobKey`, which is stable across runs of the same workflow * (`_inline_0.yaml:build`), never by job id, which is fresh per run. */ export declare function jobKeyOf(job: { key: string | undefined; displayName: string | undefined; jobId: string | undefined; }): string | undefined; export type JobPresence = 'both' | 'onlyA' | 'onlyB'; export interface JobComparison { jobKey: string; presence: JobPresence; statusA: string | undefined; statusB: string | undefined; statusChanged: boolean; durationSecondsA: number | undefined; durationSecondsB: number | undefined; durationDeltaSeconds: number | undefined; peakMemoryBytesA: number | undefined; peakMemoryBytesB: number | undefined; peakMemoryDeltaBytes: number | undefined; peakMemoryUtilizationA: number | undefined; peakMemoryUtilizationB: number | undefined; peakMemoryUtilizationDelta: number | undefined; } /** * Union of both runs' jobs, in A's order with B-only jobs appended. Rows whose presence or status * differs come first so a capped matrix still shows every change. */ export declare function compareJobs(treeA: RunTree, treeB: RunTree, metricsA: ReadonlyMap, metricsB: ReadonlyMap): JobComparison[]; export interface FailureFingerprint { errorMessage: string; fingerprint: string | undefined; count: number | undefined; jobKeys: string[]; } export interface FailureDiff { newInB: FailureFingerprint[]; resolvedInB: FailureFingerprint[]; inBoth: FailureFingerprint[]; } /** * Failure groups are matched on their error message rather than Depot's `fingerprint`, which * embeds source and message and so would separate identical errors reported from different * places. A side with no diagnosis contributes no fingerprints. */ export declare function diffFailures(groupsA: readonly FailureGroup[], groupsB: readonly FailureGroup[]): FailureDiff; //# sourceMappingURL=ci-compare.d.ts.map