import { type CompiledBuildPlan } from "../core/buildPlan.js"; import { type BuildDispatchCheckpoint, type BuildEffectIdentity } from "../core/buildExecution.js"; import type { ArtifactReference } from "../core/scheduler.js"; import type { GraphCheckpointLease } from "../runtime/graphCheckpoint.js"; import { type RunPaths } from "./artifacts.js"; export interface ImmutableBuildPlanReference { planVersion: number; planHash: string; graphPath: string; markdownPath: string; manifestPath: string; } export interface BuildDispatchLedgerRead { head: string | null; eventCount: number; checkpoints: readonly Readonly[]; } export interface BuildEffectReceiptReference { path: string; sha256: string; sizeBytes: number; } export interface BuildDispatchSealReference extends ArtifactReference { outputArtifacts: readonly Readonly[]; } export interface BuildValidatedOutputsReceipt { schemaVersion: 1; kind: "validated-build-outputs"; artifactRefs: readonly Readonly[]; } export interface BuildArtifactMutationOptions { owner: Readonly; failAt?(point: "after-reservation" | "after-graph" | "after-markdown"): void; } export interface BuildLedgerAppendOptions extends BuildArtifactMutationOptions { expectedHead: string | null; } export declare function buildPlanVersionForSubmission(paths: RunPaths): number; export declare function latestBuildPlanVersion(paths: RunPaths): number | undefined; export declare function recoverIncompleteBuildPlan(paths: RunPaths, options: BuildArtifactMutationOptions): ImmutableBuildPlanReference | undefined; export declare function writeImmutableBuildPlan(paths: RunPaths, compiled: Readonly, options: BuildArtifactMutationOptions): ImmutableBuildPlanReference; export declare function readImmutableBuildPlan(paths: RunPaths, planVersion: number): CompiledBuildPlan; export declare function writeBuildEffectReceipt(paths: RunPaths, effectValue: Readonly, receiptValue: unknown, options: BuildArtifactMutationOptions): BuildEffectReceiptReference; /** Read and verify the immutable receipt selected by a terminal ledger checkpoint. */ export declare function readVerifiedBuildEffectReceipt(paths: RunPaths, checkpoint: Readonly): Readonly<{ receipt: unknown; sha256: string; }>; /** Write one coordinator-owned node artifact under the immutable attempt namespace. */ export declare function writeBuildNodeArtifact(paths: RunPaths, input: Readonly<{ planVersion: number; nodeId: string; attempt: number; contract: string; bytes: string; }>, options: BuildArtifactMutationOptions): ArtifactReference; /** Read one immutable BUILD node artifact through its exact persisted reference. */ export declare function readBuildNodeArtifact(paths: RunPaths, reference: Readonly): Buffer; export declare function appendBuildDispatchCheckpoint(paths: RunPaths, checkpointValue: unknown, options: BuildLedgerAppendOptions): BuildDispatchLedgerRead; export declare function readBuildDispatchLedger(paths: RunPaths, planVersion: number, nodeId: string): BuildDispatchLedgerRead; export declare function sealBuildDispatchLedger(paths: RunPaths, input: Readonly<{ runId: string; planVersion: number; planHash: string; nodeId: string; visit: number; attempt: number; expectedHead: string; }>, options: BuildArtifactMutationOptions): BuildDispatchSealReference; /** Read and verify a dispatch seal before binding it into another trusted checkpoint namespace. */ export declare function readBuildDispatchSeal(paths: RunPaths, reference: Readonly): Buffer;