/** * NEXUS index diff — compare relation/node counts between two git commits. * * Runs an incremental pipeline re-analysis against the current working tree * state and compares relation/node counts against the pre-analysis snapshot. * Reports new relations, removed relations, and regression classification. * * @task T1473 */ import { type EngineResult } from '../engine-result.js'; /** Health classification for a diff result. */ export type NexusDiffHealth = 'STABLE' | 'RELATIONS_ADDED' | 'RELATIONS_REDUCED' | 'REGRESSIONS_DETECTED'; /** Options for {@link diffNexusIndex}. */ export interface NexusDiffOptions { /** Git ref for the "before" snapshot (default: 'HEAD~1'). */ beforeRef?: string; /** Git ref for the "after" snapshot (default: 'HEAD'). */ afterRef?: string; /** Override the project ID (default: derived from repoPath). */ projectIdOverride?: string; } /** Result envelope for {@link diffNexusIndex}. */ export interface NexusDiffResult { /** Resolved "before" ref. */ beforeRef: string; /** Resolved "after" ref. */ afterRef: string; /** Short SHA for beforeRef. */ beforeSha: string; /** Short SHA for afterRef. */ afterSha: string; /** Project ID. */ projectId: string; /** Absolute repository path. */ repoPath: string; /** Changed files detected between the refs. */ changedFiles: string[]; /** Node count before the incremental run. */ nodesBefore: number; /** Node count after. */ nodesAfter: number; /** New nodes added. */ newNodes: number; /** Nodes removed. */ removedNodes: number; /** Relation count before. */ relationsBefore: number; /** Relation count after. */ relationsAfter: number; /** New relations added. */ newRelations: number; /** Relations removed. */ removedRelations: number; /** Health classification. */ healthStatus: NexusDiffHealth; /** Regression messages (empty if none). */ regressions: string[]; } /** * Diff the NEXUS index between two git commits. * * Snapshots current node/relation counts, runs an incremental pipeline for * the changed files, then re-counts to compute deltas. Regressions are * flagged when more than 5 relations are removed or any nodes are removed. * * @param repoPath - Absolute path to the repository. * @param opts - Optional before/after git refs and project ID override. * @returns Diff result with health classification. * * @example * const result = await diffNexusIndex('/home/user/myproject'); * console.log(result.healthStatus, result.regressions); */ export declare function diffNexusIndex(repoPath: string, opts?: NexusDiffOptions): Promise; export declare function nexusDiff(repoPath: string, beforeRef?: string, afterRef?: string, projectId?: string): Promise>; //# sourceMappingURL=diff.d.ts.map