import type { FindingStore } from "./finding-port.js"; import type { RunState } from "../mcp/run-manager.js"; /** * Injected dependencies for reconcilePromotions. * Keeps the core pure so tests can inject a run-state fake without a real run. */ export interface ReconcileDeps { store: FindingStore; /** * Injected run-state reader. * CLI passes `(runId) => readRunState(projectRoot, runId)`. * Tests inject a fake that returns a predetermined RunState or null. */ readState: (runId: string) => Promise; /** Clock injection — never call new Date() inside the core. */ now: () => string; } /** Counts of findings advanced in a single reconcilePromotions pass. */ export interface ReconcileSummary { /** Findings transitioned to 'done' (run completed). */ completed: number; /** Findings returned to 'open' (run aborted or failed). */ aborted: number; /** Findings left unchanged (run still running, missing, or unrecognised). */ unchanged: number; } /** * For each Finding whose promotesTo.status is 'launched', read the linked * run's state.json snapshot and advance the Finding to its terminal status. * * Transition table: * run 'completed' → finding 'done', promotesTo.status 'completed' * run 'aborted'|'failed' → finding 'open', promotesTo.status 'aborted' * run 'running' (or null) → finding unchanged (no write) * * PURE-ish: all I/O is injected. Never throws — per-finding failures are * swallowed internally. Reads the current snapshot and returns immediately; * does NOT poll or block waiting for an in-flight run to finish. */ export declare function reconcilePromotions(deps: ReconcileDeps): Promise; /** * Thin wrapper around reconcilePromotions that injects the real readRunState * adapter for a given project root. Called by the `bober do` CLI handler. * * Caller is responsible for wrapping this in try/catch so a reconcile failure * can never abort the enclosing command (mirrors seedProjectFacts in * src/orchestrator/pipeline.ts:981). */ export declare function reconcilePromotionsForRoot(projectRoot: string, store: FindingStore, now: () => string): Promise; //# sourceMappingURL=reconcile.d.ts.map