/** * Pipeline orchestrator — threads stages 0–5 together. * * The single module that wires adapter outputs into the rule pipeline. * Per spec §5, the orchestrator is straight-line code; every * interesting decision happens inside one of the stages. * * PR 3 of plan local planning notes: this * module no longer imports `'typescript'` directly. The orchestrator * looks up an adapter from the lang-adapter registry and routes * file-discovery / parse / walk / resolution through its method * surface. The TypeScript adapter is the only one registered today; * future adapters slot in via `currentAdapterRegistry().register(...)` * at bootstrap. * * Stage decomposition (siblings under `./orchestrate/`): * - `catalog-builder.ts` — full + incremental rebuild paths * - `cache-orchestrator.ts` — cache hit/miss/incremental routing * - `incremental-merge.ts` — Wave-4 closure expansion + edge merge * This file keeps `runGraph()` (entry), `runStage()` (the * progress/pressure-monitor wrapper threaded into siblings), and the * public type surface. */ import { type Signal } from '@opensip-cli/core'; import type { Catalog, FeatureColumn, FeatureTable, GraphConfig, Indexes, ResolutionMode, ResolutionStats, Rule } from '../types.js'; import type { ShardRunStats } from './orchestrate/shard-model.js'; import type { GraphProgressCallback } from './orchestrate/types.js'; import type { DataStore } from '@opensip-cli/datastore'; export { GRAPH_STAGES } from './orchestrate/types.js'; export type { GraphProgressCallback, GraphProgressEvent, GraphStage } from './orchestrate/types.js'; export { runShardedGraph } from './orchestrate/sharded-graph.js'; export { loadGraphConfig, resolveGraphRecipeSelection } from './graph-config.js'; export type { RunShardedInput, RunShardedResult } from './orchestrate/sharded-graph.js'; /** Input bundle for {@link runGraph}: project scope, optional overrides, and progress callback. */ export interface RunGraphInput { readonly cwd: string; readonly noCache?: boolean; readonly config?: GraphConfig; /** Override the rule set (tests, custom invocations). */ readonly rules?: readonly Rule[]; /** Override the adapter's config-file path (e.g. tsconfig.json). */ readonly tsConfigPath?: string; /** * Optional canonical adapter id (`typescript`, `python`, `rust`, * etc.). When set, bypasses `pickAdapter`'s file-extension dominance * heuristic and selects the named adapter directly. The graph CLI * surfaces this via the `--language` flag. */ readonly language?: string; /** * Edge resolution tier. `'exact'` (default, or absent) runs the * semantic type-checker-backed resolvers; `'fast'` runs the syntactic * resolver with no type checker. Normalized to `'exact'` at the * orchestrator boundary and folded into the cacheKey so the two tiers * never collide in the catalog cache. Surfaced by the `--resolution` * CLI flag. */ readonly resolution?: ResolutionMode; /** * Optional structured progress callback. The orchestrator emits one * `stage-start` + one of `stage-done` / `stage-cached` per pipeline * stage (discover, parse, walk, resolve, index, rules). Used by the * Ink live view; non-interactive callers (json/gate/report) leave it * undefined. */ readonly onProgress?: GraphProgressCallback; /** * Datastore for catalog persistence. v2: replaces the v1 * `paths.graphCatalogPath` JSON file. Optional so legacy callers * (acceptance tests pre-Phase-3) can still drive the orchestrator * without a DataStore — the catalog will be rebuilt every run. */ readonly datastore?: DataStore; /** * Columns to materialize into the persisted catalog for the decoupled * dashboard (ADR-0006). Absent/empty ⇒ no features persisted. The standard * interactive run requests `['blast','scc','packageCoupling']`; export-only * paths omit it. Unioned with every enabled rule's `featureDeps` to decide * what the features stage computes. */ readonly emitFeatures?: readonly FeatureColumn[]; } /** Output of {@link runGraph}: catalog, indexes, signals, resolution stats, and cache state. */ export interface RunGraphResult { readonly catalog: Catalog | null; readonly indexes: Indexes | null; readonly signals: readonly Signal[]; readonly resolutionStats: ResolutionStats | null; readonly cacheHit: boolean; /** The engine-computed feature table for this run (only the requested * columns are populated). `null` only on a path that produced no catalog. */ readonly features: FeatureTable | null; /** * Per-run sharded-build statistics (ADR-0045 measurement plane), mirrored * into the `--profile` summary. Present only on the sharded path; the exact * (`runGraph`) single-program path leaves it undefined. */ readonly shardStats?: ShardRunStats; } /** * Run the pipeline end-to-end. Each stage runs in isolation; the * orchestrator wires their outputs together and consults the cache * before redoing stages 1+2. */ export declare function runGraph(input: RunGraphInput): Promise; //# sourceMappingURL=orchestrate.d.ts.map