/** * Sharded build pipeline (plan #2, Phase 4). * * Ties the shard substrate together into a single unified build: * plan (reuse cached fragments) → run changed shards in parallel → * merge fragments + recover cross-package edges → persist → derive * indexes + run rules → return the same RunGraphResult the * single-process path produces. * * The result's catalog is unified: intra-shard edges keep their original * (semantic, in exact mode) fidelity; cross-package edges are recovered * by the boundary pass and labeled `crossShard: true` / `'syntactic'`. */ import { type Signal } from '@opensip-tools/core'; import type { Shard } from './shard-model.js'; import type { GraphLanguageAdapter } from '../../lang-adapter/types.js'; import type { CatalogRepo } from '../../persistence/catalog-repo.js'; import type { Catalog, FeatureColumn, FeatureTable, GraphConfig, Indexes, ResolutionMode, ResolutionStats, Rule } from '../../types.js'; /** * Input to {@link runShardedGraph}: the planned shards plus the shared build * context (project root, worker entry script, language adapter, resolution * tier, cache/persistence handles, and optional rules/config overrides). */ export interface RunShardedInput { readonly shards: readonly Shard[]; /** Common project root — every fragment's filePaths resolve against it. */ readonly projectRoot: string; /** CLI entry script (`process.argv[1]`) for spawning shard workers. */ readonly cliScript: string; readonly adapter: GraphLanguageAdapter; readonly resolutionMode: ResolutionMode; readonly concurrency?: number; readonly useCache: boolean; readonly catalogRepo: CatalogRepo | null; readonly config?: GraphConfig; readonly rules?: readonly Rule[]; /** * Dashboard feature columns to materialize into the persisted catalog * (ADR-0006). The sharded build is the producing run for multi-package * repos, so it persists the same columns as the single path. Unioned with * the rule set's `featureDeps`. */ readonly emitFeatures?: readonly FeatureColumn[]; } /** * Result of {@link runShardedGraph}: the unified catalog and derived indexes, * the rule signals evaluated over it, cross-shard resolution stats, and * cache/failure metadata (whether every shard was a cache hit, and the ids of * any shards whose worker failed). */ export interface RunShardedResult { readonly catalog: Catalog; readonly indexes: Indexes; readonly signals: readonly Signal[]; readonly resolutionStats: ResolutionStats; /** True when every shard was reused from cache (no worker ran). */ readonly cacheHit: boolean; /** Shard ids whose worker failed (build proceeds with the rest). */ readonly failedShardIds: readonly string[]; /** Engine-computed feature table over the merged global catalog (only the * requested columns populated). */ readonly features: FeatureTable; } /** Run the full sharded build and return a unified RunGraphResult-shaped value. */ export declare function runShardedGraph(input: RunShardedInput): Promise; //# sourceMappingURL=sharded-graph.d.ts.map