/** * Parse implementation — chunked parse + resolve loop. * * This is the core parsing engine of the ingestion pipeline. It reads * source files in byte-budget chunks (~20MB each), parses via the worker * pool (the sole parse path — there is no sequential fallback), and emits * route CALLS edges. Import, * call, and inheritance resolution are owned by the scope-resolution * phase, not here (RING4-1 #942 removed the legacy call DAG; RING4-2 #943 * removed the legacy per-file import resolution + wildcard synthesis). * * Consumed by the parse phase (`parse.ts`) — the phase file handles * dependency wiring while the heavy implementation lives here. * * @module */ import { BindingAccumulator } from '../binding-accumulator.js'; import { type ExportedTypeMap } from '../call-processor.js'; import { type MutableSemanticModel } from '../model/index.js'; import { type PipelineProgress } from '../../../_shared/index.js'; import type { ExtractedDecoratorRoute, ExtractedFetchCall, ExtractedORMQuery, ExtractedRoute, ExtractedToolDef, FetchWrapperDef } from '../workers/parse-worker.js'; import type { KnowledgeGraph } from '../../graph/types.js'; import type { PipelineOptions } from '../pipeline.js'; type ScannedFile = { path: string; size: number; }; type ProgressFn = (progress: PipelineProgress) => void; /** * Handle a worker-pool startup failure by FAILING FAST with the captured cause * (#1741). The pool self-heals *transient* worker crashes on its own — a * bounded, jittered startup restart loop (see worker-pool.ts) — so this is * reached only when that self-heal is EXHAUSTED, or a deterministic crash-loop * was detected, or the pool could not even be constructed. In every such case * the workers genuinely cannot start. * * There is no sequential parser to silently degrade to — that fallback was * removed (and it had masked a worker-startup regression as a 2-hour "stuck" * run in #1741, rc99: a dropped `logger.warn` plus an unbounded sequential * grind). GitNexus surfaces the real crash and aborts so the operator fixes the * worker startup (commonly a missing build). The pool's own crash * classification (`crashClass` on WorkerPoolInitializationError) sharpens the * message. * * @throws always — an actionable Error carrying the captured worker crash. * @internal Exported for unit tests; production callers are the parse loop's * two worker-startup catch sites below. */ export declare function handleWorkerStartupFailure(err: Error): never; /** * Chunked parse + resolve loop. * * Reads source in byte-budget chunks (~20MB each): * 1. Parse each chunk via the worker pool (the sole parse path) * 2. After all chunks parse, emit route CALLS edges (deferred so resolution * sees the full repo graph) and collect the exported-type map * 3. Collect TypeEnv bindings for cross-file propagation * * Import, call, and inheritance edges are emitted by the scope-resolution * phase, not here (RING4-1 #942 / RING4-2 #943 removed the legacy passes). */ export declare function runChunkedParseAndResolve(graph: KnowledgeGraph, scannedFiles: ScannedFile[], allPaths: string[], totalFiles: number, repoPath: string, pipelineStart: number, onProgress: ProgressFn, options?: PipelineOptions): Promise<{ exportedTypeMap: ExportedTypeMap; allFetchCalls: ExtractedFetchCall[]; allFetchWrapperDefs: FetchWrapperDef[]; allExtractedRoutes: ExtractedRoute[]; allDecoratorRoutes: ExtractedDecoratorRoute[]; allToolDefs: ExtractedToolDef[]; allORMQueries: ExtractedORMQuery[]; bindingAccumulator: BindingAccumulator; /** SemanticModel populated during parse — scope-resolution reads its * TypeRegistry / MethodRegistry / SymbolTable indexes. */ model: MutableSemanticModel; /** Whether a worker pool was actually constructed for this run. False * means no pool was needed: a warm all-cache-hit run replays cached * worker output without spawning workers, or there were no parseable * files. There is no sequential parser — the pool is the sole parse path * whenever a chunk misses the cache. */ usedWorkerPool: boolean; /** Worker-produced ParsedFile artifacts aggregated across chunks. * Threaded into scope-resolution as a re-extract cache so the warm- * cache analyze run can skip the dominant `extractParsedFile` cost * (otherwise ~58s on a 1000-file repo). */ parsedFiles: import('../../../_shared/index.js').ParsedFile[]; }>; export {};