/** * Decide whether a recipe change can be applied in place, and what it would do. * * Pure: the caller supplies the two recipes and the runtime facts, and gets back either a set of * refusals or the report an update would produce. Nothing here reads disk, the venue, or the * registry, so the whole decision is testable without standing a runtime up — and the same function * backs both `--dry-run` and the real apply, which is what makes their output identical by * construction rather than by discipline. * * ## Why refusals are computed BEFORE anything is torn down * * The update verb's one safety property is that a refusal changes nothing. The install gate exists * but runs at install only, deliberately — the boot loop starts every runtime inside one `try`, so * refusing there would stop every other strategy on the box over one bad recipe. An update has no * such constraint and every reason to refuse loudly, because the alternative is a strategy left * with no scanners and no actions but an open book. * * ## What counts as "not an update" * * Three changes are structural rather than configural: they would silently orphan state that the * runtime keys on. They refuse with the remedy named, rather than proceeding and reporting the * damage afterwards. */ import type { RuntimeConfig } from "./runtime-schema.js"; import type { Finding } from "../validate/types.js"; import { type ReportedGate, type ReportedPosition, type UpdateReport } from "./update-report.js"; /** Codes this module raises. Distinct from validate's set: these are update-time decisions. */ export declare const UPDATE_CODE: { readonly walletChanged: "E_UPDATE_WALLET_CHANGED"; readonly scannerRenamed: "E_UPDATE_SCANNER_RENAMED"; readonly scannerReordered: "E_UPDATE_SCANNER_REORDERED"; readonly actionTypeChanged: "E_UPDATE_ACTION_TYPE_CHANGED"; }; export interface UpdatePlanInputs { runtimeId: string; /** The recipe the runtime is running now, as stored in the registry. */ current: RuntimeConfig; /** The recipe being proposed. */ next: RuntimeConfig; openPositions: readonly ReportedPosition[]; closedGates: readonly ReportedGate[]; /** False produces the identical report minus the claim that anything happened. */ applied: boolean; } export type UpdatePlan = { ok: true; report: UpdateReport; } | { ok: false; refusals: Finding[]; }; /** * The whole decision, in one call. * * Refusals are returned rather than thrown: a caller must be able to render several at once, and an * exception would stop at the first — leaving an agent to fix one problem, re-run, and discover the * next, which is the loop this codebase's finding model exists to avoid. */ export declare function planUpdate(inputs: UpdatePlanInputs): UpdatePlan; //# sourceMappingURL=update-plan.d.ts.map