import type { BuildArchiveManifest } from "./verbs/build-archive.js"; import type { DriverStepRecord } from "./driver.js"; /** * Find the most fully-accumulated `BuildArchiveManifest` a component run * produced, by scanning its step records for the last manifest-bearing * output — mirroring `extractRunDigest`'s "last wins" convention, which is * also the correct one here: every build-family capability's `manifest` * input/output accumulates onto whatever manifest came before it in the same * phase (see ../components/verbs/build.ts's `DockerBuildInput.manifest` * doc), so the *last* manifest-bearing step output in run order is always * the fullest one — a template + SBOM + config-BOM composition's final step * carries every earlier entry too, not just its own. */ export declare function extractRunManifest(records: DriverStepRecord[]): BuildArchiveManifest | undefined; /** * Same manifest extraction as `extractRunManifest`, but over a component * Temporal workflow's returned `phaseOutputs` (`{ [phase]: output }`) — * mirroring ./auto-release.ts's `extractRunDigestFromPhaseOutputs`, the * `--temporal` CLI path's counterpart, since that path never sees individual * step records either. */ export declare function extractRunManifestFromPhaseOutputs(phaseOutputs: Record> | undefined): BuildArchiveManifest | undefined; /** Explicit reasons `maybePersistBuildManifest` declined to write — never a thrown error, mirroring ./auto-release.ts's `AutoReleaseSkipReason`. */ export type ManifestPersistSkipReason = "opted-out" | "run-not-successful" | "no-manifest"; export type ManifestPersistResult = { persisted: true; commit: string; manifestDigest: string; } | { persisted: false; reason: ManifestPersistSkipReason; } | { persisted: false; reason: "error"; error: string; }; /** Input describing one component's completed run — the manifest-persistence counterpart of ./auto-release.ts's `AutoReleaseRunInfo`. */ export interface ManifestPersistRunInfo { /** Whether the run reported overall success. A caller must not call this for a non-terminal/in-progress run — mirrors `AutoReleaseRunInfo.success`. */ success: boolean; /** The component's step records (local executor), used to locate the accumulated manifest via `extractRunManifest`. Mutually exclusive with `manifest`. */ records?: DriverStepRecord[]; /** A manifest already resolved by the caller (e.g. a future durable/Temporal path that has its own phaseOutputs-shaped extraction). Takes precedence over `records` when both are given. */ manifest?: BuildArchiveManifest; } /** Opt-out knobs for manifest persistence, mirroring ./auto-release.ts's `AutoReleaseOptions`. */ export interface ManifestPersistOptions { /** `--no-release-record` / `chant.config.ts`'s `release.autoRecord: false` also gates manifest persistence — both are "durably record this successful deploy" side effects with the same opt-out story, so one flag/config knob controls both rather than introducing a second, easy-to-forget switch. Default: persistence is ON. */ disabled?: boolean; /** Working directory for the git plumbing calls (tests). */ cwd?: string; } /** * After a successful `chant run --components --env ` (local * executor), persist the run's accumulated `BuildArchiveManifest` (if any) * to the durable build-manifest store (../lifecycle/build-ledger-store.ts) * and push it — or explain, without throwing, why it didn't. Never called * for a failed run, matching `maybeRecordAutoRelease`'s contract exactly. * * Skips (returns `{ persisted: false, reason }`, never throws): * - `options.disabled` — the opt-out flag/config was set. * - `run.success` false — defensive; callers should not reach here on * failure. A dry-run/failed deploy persists nothing, by construction — * this is also what makes a dry run safe: `chant run --components` never * calls this function at all unless the run actually completed. * - no manifest found in the run's records — a component with no * build-family step (an infra-only/apply-only component, or a * build-less `Publish`-only producer that reused a prior archive) has * nothing to persist. This is the expected common case for most deploys, * not an error. * * Write/push failures (any error `persistBuildManifest`/`pushLifecycle` * throw) are reported as `{ persisted: false, reason: "error", error }` * rather than propagated — same "never turn a successful deploy into a * failing CLI invocation" contract `maybeRecordAutoRelease` already * establishes for release records. */ export declare function maybePersistBuildManifest(run: ManifestPersistRunInfo, options?: ManifestPersistOptions): Promise; //# sourceMappingURL=manifest-persistence.d.ts.map