import type { GitCommitFileChange, GitRange } from '../../git/types.js';
import type { CodeFileGuardrails } from '../parsers.js';
import type { BlobEntityCache } from './indexer.js';
import type { LineageState } from './lineage.js';
import type { EntityBounds, EntityCounters, EntityRecord, LineageThresholds } from './types.js';
import type { OccEntityDiffOptions, OccEntityDiffResult, OccEntityRef } from './api-types.js';
import type { TestRecognizer } from '../tests.js';
export interface WorkspaceVisibilityEntry {
    relativePath: string;
    tag: string;
    assumeUnchanged: boolean;
    skipWorktree: boolean;
}
/** Parse `git ls-files -v -z` without decoding a path until its framing is proved. */
export declare function parseWorkspaceVisibility(input: Buffer): WorkspaceVisibilityEntry[];
export interface EntityDiffContext {
    repoRoot: string;
    repoIdentity: string;
    /** Lineage state at the indexed head, used to attach ids where they are known. */
    state?: LineageState;
    recognizer: TestRecognizer;
    bounds?: EntityBounds;
    thresholds?: LineageThresholds;
    guardrails?: CodeFileGuardrails;
    cache?: BlobEntityCache;
    /** Optional successful Git-body cache shared by bounded history observers. */
    bodyCache?: Map<string, Buffer>;
    /** Optional unique-object byte budget shared across multiple diff calls. */
    materializationBudget?: {
        bytesRead: number;
        seenOids?: Set<string>;
    };
    /** Pre-resolved immutable transition used by full-DAG observation instruments. */
    immutableTransition?: {
        range: GitRange;
        changes: GitCommitFileChange[];
    };
    /** @internal Observe accepted no-change pairs so a DAG overlay can advance coordinates. */
    observeUnchangedMatch?: (previous: EntityRecord, current: EntityRecord) => void;
    /** Session-level default for data-format entities; the per-call option wins. */
    formats?: boolean;
    signal?: AbortSignal;
    counters?: EntityCounters;
    /** Internal deterministic I/O seams used only by fail-closed mutation/read tests. */
    wholeDiffTestHooks?: {
        afterInitialWorkspaceSnapshot?: () => void | Promise<void>;
        beforeWorkingTreeRead?: (relativePath: string) => void | Promise<void>;
        beforeFinalWorkspaceSnapshot?: () => void | Promise<void>;
        /** Deterministically exercises the bounded visibility-command failure path. */
        visibilityMaxBufferBytes?: number;
    };
}
/** @internal Read the extractor slot without adding it to the public entity-ref wire shape. */
export declare function entityRefOrdinalFor(ref: OccEntityRef): number | undefined;
/**
 * Entity-level semantic diff.
 *
 * Deliberately independent of the lineage cache: it re-derives both sides from
 * blobs, so it answers for any range including the index and the working tree,
 * whether or not history has ever been indexed. When a cache is present its
 * lineage ids are attached, which is enrichment rather than a dependency.
 */
export declare function computeEntityDiff(options: OccEntityDiffOptions, context: EntityDiffContext): Promise<OccEntityDiffResult>;
