import { type CodebaseIndex } from './types.js';
import type { OccEntityImpactOptions, OccEntityImpactResult, OccEntityIndexStatus, OccEntityQuery } from './entity/api-types.js';
export declare const CODE_FACT_PREDICATES: readonly [{
    readonly name: "exported-unreferenced";
    readonly description: "Exported symbols with no indexed call, usage, inheritance, or import-binding reference.";
}, {
    readonly name: "untested-entrypoints";
    readonly description: "Exported entry points with no reachable test; uses entity impact when available.";
}, {
    readonly name: "cycle-members";
    readonly description: "Modules participating in a resolved local-import cycle.";
}, {
    readonly name: "orphan-modules";
    readonly description: "Indexed modules with no resolved local importer.";
}, {
    readonly name: "layer-violations";
    readonly description: "Resolved local imports forbidden by an explicit layer manifest.";
}];
export type CodeFactPredicate = (typeof CODE_FACT_PREDICATES)[number]['name'];
export interface CodeFactDescriptor {
    name: CodeFactPredicate;
    description: string;
}
export interface LayerManifestEntry {
    name: string;
    paths: string[];
    allow: string[];
}
export interface LayerManifest {
    layers: LayerManifestEntry[];
}
export interface ExportedUnreferencedFact {
    kind: 'exported-unreferenced';
    nodeId: string;
    name: string;
    symbolKind: string;
    relativePath: string;
    line: number;
    /** Unresolved call observations whose target name equals this symbol. */
    unresolvedCallEdgesNamingSymbol: number;
}
export interface UntestedEntrypointFact {
    kind: 'untested-entrypoint';
    nodeId: string;
    name: string;
    symbolKind: string;
    relativePath: string;
    line: number;
    coverage: 'full' | 'index-only';
}
export interface CycleMemberFact {
    kind: 'cycle-member';
    relativePath: string;
    cycle: string[];
}
export interface OrphanModuleFact {
    kind: 'orphan-module';
    relativePath: string;
    exportedSymbols: number;
}
export interface LayerViolationFact {
    kind: 'layer-violation';
    from: string;
    fromLayer: string;
    to: string;
    toLayer: string;
    line?: number;
    specifier?: string;
}
export type CodeFact = ExportedUnreferencedFact | UntestedEntrypointFact | CycleMemberFact | OrphanModuleFact | LayerViolationFact;
export interface QueryCodeFactsOptions {
    limit?: number;
    layers?: LayerManifest;
    entitySession?: CodeFactsEntityImpactProvider;
    entityUnavailableReason?: string;
}
export type CodeFactCapabilityGapReason = 'import-resolution-unsupported' | 'call-resolution-unavailable' | 'template-use-resolution-unavailable';
export interface CodeFactCapabilityGap {
    language: string;
    reason: CodeFactCapabilityGapReason;
    files: number;
}
/**
 * The narrow entity contract facts consumes.
 *
 * Keeping this structural avoids a code/session -> facts -> entity/session
 * cycle while accepting the full OccEntityIntelligenceSession unchanged.
 */
export interface CodeFactsEntityImpactProvider {
    impact(query: OccEntityQuery, options?: OccEntityImpactOptions): Promise<OccEntityImpactResult>;
    status(): OccEntityIndexStatus;
}
export interface CodeFactsResult {
    status: 'resolved';
    predicate: CodeFactPredicate;
    description: string;
    bestEffort: boolean;
    rows: CodeFact[];
    total: number;
    omitted: number;
    truncated: boolean;
    diagnostics: string[];
    capabilityGaps: CodeFactCapabilityGap[];
    honesty: {
        freshness: 'unverified';
        stalenessReason: string;
        coverage: 'full' | 'partial' | 'best-effort';
        bestEffort: boolean;
        truncated: boolean;
        omitted: number;
        ambiguityCount: number;
        unresolvedCallEdges: number;
        unresolvedUsageEdges: number;
    };
}
export declare function listCodeFactPredicates(): CodeFactDescriptor[];
export declare function parseCodeFactPredicate(value: string): CodeFactPredicate;
export declare function parseLayerManifest(value: unknown): LayerManifest;
export declare function readLayerManifest(filePath: string): Promise<LayerManifest>;
export declare function queryCodeFacts(index: CodebaseIndex, predicate: CodeFactPredicate, options?: QueryCodeFactsOptions): Promise<CodeFactsResult>;
