/** * Mapping Generator * * Builds a requirement→function mapping artifact from pipeline results and * the dependency graph. Written to .openlore/analysis/mapping.json. * * Enables refactoring workflows: dead code detection, naming normalization. */ import type { PipelineResult } from './spec-pipeline.js'; import type { DependencyGraphResult } from '../analyzer/dependency-graph.js'; import type { SearchResult } from '../analyzer/vector-index.js'; export interface FunctionRef { name: string; file: string; line: number; kind: string; confidence: 'llm' | 'semantic' | 'heuristic'; } export interface RequirementMapping { requirement: string; service: string; domain: string; specFile: string; functions: FunctionRef[]; } export interface MappingArtifact { generatedAt: string; mappings: RequirementMapping[]; orphanFunctions: FunctionRef[]; stats: { totalRequirements: number; mappedRequirements: number; totalExportedFunctions: number; orphanCount: number; }; } /** * A semantic search function closed over VectorIndex + EmbeddingService + outputDir. * Returns ranked results (closest first, score = cosine distance) for a text query. */ export type SemanticSearchFn = (query: string, limit: number) => Promise; export declare class MappingGenerator { private rootPath; private openspecPath; private semanticSearch?; constructor(rootPath: string, openspecPath?: string, semanticSearch?: SemanticSearchFn); /** Semantic lookup: returns FunctionRefs matched by vector similarity */ private semanticMatch; generate(pipeline: PipelineResult, depGraph: DependencyGraphResult): Promise; private write; /** Load an existing mapping artifact */ static load(rootPath: string): Promise; } //# sourceMappingURL=mapping-generator.d.ts.map