import { z } from 'zod';
import type { TestRecognizer } from '../tests.js';
import { type EntityDriftHonesty } from './drift.js';
import type { EntityIndex } from './store.js';
import type { OccEntityErrorCode, OccEntityFreshness, OccEntityRef } from './api-types.js';
import type { EntityEvidenceGapSummary } from './evidence.js';
export declare const ENTITY_DOCUMENT_DRIFT_DEFAULT_MAX_DOCUMENTS = 1000;
export declare const ENTITY_DOCUMENT_DRIFT_HARD_MAX_DOCUMENTS = 10000;
export declare const ENTITY_DOCUMENT_DRIFT_DEFAULT_MAX_TOTAL_BYTES: number;
export declare const ENTITY_DOCUMENT_DRIFT_HARD_MAX_TOTAL_BYTES: number;
export declare const EntityDriftDocumentInputSchema: z.ZodObject<{
    id: z.ZodString;
    content: z.ZodString;
    baseCommit: z.ZodString;
}, z.core.$strip>;
export type EntityDriftDocumentInput = z.infer<typeof EntityDriftDocumentInputSchema>;
export declare const EntityDriftForDocumentsOptionsSchema: z.ZodObject<{
    documents: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        content: z.ZodString;
        baseCommit: z.ZodString;
    }, z.core.$strip>>;
    maxDocuments: z.ZodOptional<z.ZodNumber>;
    maxTotalDocumentBytes: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
export type EntityDriftForDocumentsOptions = z.infer<typeof EntityDriftForDocumentsOptionsSchema>;
export interface EntityDriftForDocumentsRuntimeOptions extends EntityDriftForDocumentsOptions {
    signal?: AbortSignal;
}
export interface EntityDriftForDocumentsContext {
    repoRoot: string;
    entityIndex: EntityIndex;
    freshness: OccEntityFreshness;
    recognizer: TestRecognizer;
}
export type EntityDocumentDriftDiagnosticCode = 'base-commit-not-found' | 'base-commit-not-indexed' | 'base-commit-resolution-failed' | 'link-not-found' | 'link-ambiguous';
export interface EntityDocumentDriftDiagnostic {
    code: EntityDocumentDriftDiagnosticCode;
    message: string;
    documentId: string;
    baseCommit: string;
    underlyingCode?: OccEntityErrorCode;
    docSpan?: {
        startLine: number;
        endLine: number;
    };
    line?: number;
    reference?: string;
    candidates?: OccEntityRef[];
}
export interface EntityDocumentDriftRow {
    documentId: string;
    docSpan: {
        startLine: number;
        endLine: number;
    };
    entityAtBase: OccEntityRef;
    entityAtHead?: OccEntityRef;
    changesSince: {
        count: number;
        strongestEvidence: 'cst-proved' | 'body-hash' | 'unknown';
    };
}
export interface EntityDocumentDriftBaseline {
    requested: string;
    commit: string;
    commitOrder: number;
    committedAt: string;
}
export interface EntityDocumentDriftResolved {
    status: 'resolved';
    id: string;
    baseline: EntityDocumentDriftBaseline;
    rows: EntityDocumentDriftRow[];
    diagnostics: EntityDocumentDriftDiagnostic[];
    honesty: EntityDriftHonesty;
}
export interface EntityDocumentDriftRefused {
    status: 'refused';
    id: string;
    baseCommit: string;
    rows: [];
    diagnostics: EntityDocumentDriftDiagnostic[];
    honesty: EntityDriftHonesty;
}
export type EntityDocumentDriftOutcome = EntityDocumentDriftResolved | EntityDocumentDriftRefused;
export interface EntityDocumentDriftBatchHonesty {
    freshness: EntityDriftHonesty['freshness'];
    truncation: EntityDriftHonesty['truncation'];
    coverage: {
        documentsSubmitted: number;
        documentsResolved: number;
        documentsRefused: number;
        totalDocumentBytes: number;
        rowsEmitted: number;
        diagnosticsOmitted: number;
    };
    inputBounds: {
        maxDocuments: number;
        maxTotalDocumentBytes: number;
        hardMaxDocuments: number;
        hardMaxTotalDocumentBytes: number;
    };
    ambiguityCount: number;
    evidenceGaps: EntityEvidenceGapSummary;
}
export type EntityDriftForDocumentsResult = {
    status: 'resolved';
    documents: EntityDocumentDriftOutcome[];
    honesty: EntityDocumentDriftBatchHonesty;
} | {
    status: 'error';
    code: 'invalid-options' | 'budget-exceeded';
    message: string;
    limits: {
        maxDocuments: number;
        maxTotalDocumentBytes: number;
        hardMaxDocuments: number;
        hardMaxTotalDocumentBytes: number;
    };
    actual?: {
        documents: number;
        totalDocumentBytes: number;
    };
};
/**
 * Evaluate Markdown held entirely by the caller against entity state at each
 * supplied baseline. Only Git commits and the already-built lineage index are
 * read; document paths and working-tree bytes are never consulted.
 */
export declare function entityDriftForDocuments(options: EntityDriftForDocumentsRuntimeOptions, context: EntityDriftForDocumentsContext): Promise<EntityDriftForDocumentsResult>;
