/** * CrossPassEdgeMerger — Phase 2 of slice-topology-multipass (W2 T7). * * Produces `CrossPassEdge`s that span two adjacent decomposition passes by * combining fast structural detectors with the `LLMArbitrator` fallback. * * Pipeline (per adjacent pass pair `(upper, lower)`): * 1. Build a `path → upperSliceId` index of every file owned by `upper`. * 2. For each lower slice, for each file in that slice: * a. type-shares — `import type { ... } from '...'` resolves to an upper file. * b. import-re-export — `export ... from '...'` resolves to an upper file. * c. fixture-shares — file is a test file AND `from '...'` resolves to an upper file. * Each match emits one `CrossPassEdge` with `confidence: 'structural'` and * `arbitratedBy: null`. * 3. If a lower slice emitted NO static edges AND `opts.llmRunner` is provided AND * `llmCalls.length < opts.maxLlmCalls`, invoke `arbitrate(...)` once. On a * successful `{"depends": true}` response, emit one edge with * `kind: 'llm-arbitrated'`, `confidence: 'llm'`, and `arbitratedBy: `. * 4. The budget is `opts.maxLlmCalls ?? 2`; once exhausted the merger returns * what it has accumulated and never crashes. * * Pass 3 is reserved for future use; the type allows `passNumber: 3` but v1 input * never contains it. Pairs are processed left-to-right so edges are deterministic. */ import type { PassResult } from './slice-topology-types.js'; import { type LlmCallTrace, type MergeOptions, type MergeResult } from './cross-pass-edge-static-scan-support.js'; export type { LlmCallTrace, MergeOptions, MergeResult }; export declare function merge(passes: readonly PassResult[], opts: MergeOptions): Promise;