/** * Batch Assignment module (batch-runner DESIGN D4). * * Deterministic provider distribution for a parsed batch manifest: * - Eligibility per command-group: descriptors that are * `isConfigured(env, capabilityId)` AND `capabilities().has(capabilityId)`, * in registry order. * - Round-robin cursors per capability id (the grouping key). Vision ops * resolve to their per-operation `vision.` id through the * same chain the manifest parser pins: the local mirror of * `visionOperationForCommand` (module-private in `index.ts`, mirrored * inside `batch-manifest.ts`) chained through the exported * `visionOperationToCapability` (`capabilities/vision.ts`). * - Pin precedence: per-op `provider` > global `--provider` > * distribution. Pinned ops never consume a cursor slot. * - Zero eligible providers for a group that needs distribution → * whole-batch `ValidationError` naming the configured set and the * registry (mirrors `executeFanoutPlan`'s zero-arms wording). * * Same manifest + same eligible sets → same assignment, always. The * module performs no I/O and never calls `descriptor.create()`; * descriptors are metadata-only here (the dry-run gates and the runner * consume the returned `capabilityId` for their own checks). */ import type { AllowedBatchCommand, BatchManifest } from "./batch-manifest.js"; import type { ProviderCapability, ProviderDescriptor, ProviderId } from "../providers/types.js"; /** * Injected dependencies. `descriptors` is the provider registry in * registry order; `env` feeds the capability-aware configuration check; * `globalProvider` is the global `--provider` pin (already validated by * dispatch) which disables distribution for every unpinned op. */ export interface BatchAssignmentDeps { readonly descriptors: readonly ProviderDescriptor[]; readonly env: NodeJS.ProcessEnv; readonly globalProvider?: ProviderId; } /** One resolved assignment, aligned with manifest order. */ export interface BatchProviderAssignment { readonly name: string; readonly command: AllowedBatchCommand; /** Capability id the op exercises — the cursor's grouping key. */ readonly capabilityId: ProviderCapability; /** Resolved provider: pin (per-op or global) or round-robin assignment. */ readonly provider: ProviderId; } /** * Assign every operation in the manifest a provider (DESIGN D4). * * Walks ops in manifest order. Pinned ops (per-op `provider`, then * `deps.globalProvider`) resolve to their pin and never touch a cursor; * unpinned ops receive `eligible[cursor++ % len]` from their capability * group's eligible list. Groups are keyed by capability id, so a * mixed-vision batch holds separate cursors per sub-operation and a * search op never consumes a vision or read slot. The zero-eligible * error fires only for a group that actually needs distribution — a * global pin disables distribution entirely, and per-op pins are * validated (registry + capable) at manifest parse. */ export declare function assignBatchProviders(manifest: BatchManifest, deps: BatchAssignmentDeps): readonly BatchProviderAssignment[]; //# sourceMappingURL=batch-assign.d.ts.map