import type { CallConfidence, CallResolution, DependencyClassification, FunctionKind, FunctionOccurrence, Visibility } from '../types.js'; export type { AdapterSelectionEvidence, CatalogEngineMode } from '../types.js'; /** Production vs test vs all source files. */ export type SourceScope = 'production' | 'test' | 'all'; /** How generated-file occurrences are treated. */ export type GeneratedPolicy = 'exclude' | 'include' | 'only'; /** Traversal node identity mode. */ export type TraversalIdentity = 'occurrence' | 'body-twin-union'; /** Package dependency edge kind for package evidence queries. */ export type PackageEdgeKind = 'call' | 'import' | 'combined'; /** Freshness reason codes returned by complete input verification. */ export type FreshnessReasonCode = 'missing' | 'files-changed' | 'language-changed' | 'cache-key-changed' | 'engine-mode-changed' | 'selection-changed' | 'verification-unavailable'; /** Bounded file-change summary (at most 50 samples). */ export interface FreshnessChangeSummary { readonly added: number; readonly modified: number; readonly deleted: number; readonly sample: readonly string[]; } /** * Complete freshness verification result from {@link verifyCatalogInputs}. * `verification: 'partial'` never claims unqualified fresh. */ export interface FreshnessVerification { readonly fresh: boolean; readonly verifiedAt: string; readonly verification: 'complete' | 'partial' | 'missing'; readonly reasonCode?: FreshnessReasonCode; readonly reason?: string; readonly changes?: FreshnessChangeSummary; } /** * Bounded, PLAIN-DATA audit source-role policy (P2 Phase 1.4). This is the sole * source-role shape that crosses the read boundary: it is echoed on responses, * normalized into cursor digests, and carries ONLY the validated audit-test glob * strings plus a versioned evaluation mode. The compiled runtime matcher that * evaluates these globs is a separate non-serializable type in `source-filter.ts` * and NEVER appears in a DTO. */ export interface AuditSourceRolePolicy { /** The validated audit-test source-role globs (see graph.auditTestSourceGlobs). */ readonly testGlobs: readonly string[]; /** Versioned role-evaluation contract — the only mode currently defined. */ readonly mode: 'audit-test-globs-v1'; } /** * Shared source filter applied before projection/paging in every graph read view. * Exact `filePath` and segment-aware `filePrefix` are both project-relative POSIX. */ export interface GraphSourceFilter { readonly packages?: readonly string[]; /** Exact project-relative POSIX path. */ readonly filePath?: string; /** Segment-aware prefix: matches path or path/…, not path-sibling. */ readonly filePrefix?: string; readonly kinds?: readonly FunctionKind[]; readonly visibilities?: readonly Visibility[]; readonly sourceScope: SourceScope; readonly generated: GeneratedPolicy; /** * Audit source-role policy (P2 Phase 1.4). Absent (or empty `testGlobs`) means * adapter `inTestFile` classification only. The compiled matcher is supplied * separately as an explicit execution dependency; only THIS plain policy is * serialized into responses / cursor digests. */ readonly sourceRoles?: AuditSourceRolePolicy; } /** Effective filter echoed on every graph response (always fully populated). */ export type EffectiveGraphSourceFilter = GraphSourceFilter; /** Coverage for a single read: complete vs hard-cap truncated. */ export interface GraphReadCoverage { readonly complete: boolean; readonly truncated: boolean; readonly reasons: readonly string[]; } /** The four named coverage facets a graph read reports on (P2 Phase 2.1). */ export type CoverageFacetName = 'inventory' | 'evidence' | 'grouping' | 'projection'; /** * One coverage facet (P2 Phase 2.1). `requested` states whether the caller asked * for this family at all — an UNrequested facet is `complete: true`, * `truncated: false` and never contributes to the top-level summary, so an * intentionally omitted sample/group/detail is not mistaken for truncation. */ export interface CoverageFacet { readonly requested: boolean; readonly complete: boolean; readonly truncated: boolean; readonly reasons: readonly string[]; } /** * Facet-specific coverage (P2 Phase 2.1). Each facet carries its own * completeness; the top-level `complete`/`truncated`/`reasons` is a deliberately * redefined CONSERVATIVE summary over the REQUESTED facets only (not a * compatibility adapter). A complete inventory can therefore report complete * even when a bounded evidence sample was capped, provided that sample was not * requested. */ export interface GraphReadFacetCoverage { readonly inventory: CoverageFacet; readonly evidence: CoverageFacet; readonly grouping: CoverageFacet; readonly projection: CoverageFacet; readonly complete: boolean; readonly truncated: boolean; readonly reasons: readonly string[]; } /** * Public symbol projection reused by every graph audit view. * Control-free bounded fields; malformed oversized catalog rows are omitted. */ export interface GraphSymbolRef { /** Stable identity: `"${filePath}:${line}:${column}"`. */ readonly symbolId: string; /** sha256(normalized body). */ readonly bodyHash: string; readonly simpleName: string; readonly qualifiedName: string; readonly filePath: string; readonly line: number; readonly column: number; readonly kind: FunctionKind; readonly visibility: Visibility; readonly package: string; readonly inTestFile: boolean; readonly definedInGenerated: boolean; } /** Resolved call-edge evidence (never includes call-expression text). */ export interface CallEdgeEvidence { readonly kind: 'call'; readonly from: GraphSymbolRef; readonly to: GraphSymbolRef; readonly source: { readonly file: string; readonly line: number; readonly column: number; }; readonly resolution: CallResolution; readonly confidence: CallConfidence; readonly crossShard: boolean; } /** Resolved call evidence crossing a canonical package boundary. */ export interface PackageCallEvidence extends CallEdgeEvidence { readonly fromPackage: string; readonly toPackage: string; readonly kind: 'call'; } /** One module-level import statement and its package-resolution outcome. */ export interface PackageImportEvidence { readonly fromPackage: string; readonly toPackage: string | null; readonly target: string; readonly kind: 'import'; readonly resolution: 'internal' | 'external' | 'unresolved'; readonly specifier: string; readonly importSite: { readonly filePath: string; readonly line: number; readonly column: number; }; /** * The persisted atomic dependency classification (form/role/target-kind/basis/ * reason/resolvedPackage) of the underlying edge, when the producing catalog * carried one (P2 Phase 0.3). Absent for a pre-feature edge. */ readonly classification?: DependencyClassification; /** * Attribution confidence (P2 Phase 0.3): `'high'` for a unique catalog-target * or a unique workspace-manifest declaration entry; absent for weaker / * unresolved / external outcomes. */ readonly confidence?: 'high' | 'medium' | 'low'; } /** Canonical concrete proof row for one package dependency. */ export type PackageDependencyEvidence = PackageCallEvidence | PackageImportEvidence; /** Bounds for control-free projection fields. */ export declare const GRAPH_SYMBOL_PATH_MAX = 1024; export declare const GRAPH_SYMBOL_NAME_MAX = 512; export declare const GRAPH_SYMBOL_PACKAGE_MAX = 256; /** Canonical graph package attribution, including the legacy `pkgOf` fallback. */ export declare function graphPackageOf(occurrence: Pick): string; /** Validate a package label before it crosses the public read boundary. */ export declare function toGraphPackageName(value: string): string | undefined; /** * Project one occurrence to {@link GraphSymbolRef}. * Returns `undefined` when any identity field is malformed/oversized so the * caller can omit the row with partial coverage rather than truncate identity. */ export declare function toGraphSymbolRef(occurrence: FunctionOccurrence): GraphSymbolRef | undefined; //# sourceMappingURL=query-contracts.d.ts.map