From c332e2efa767c76037540a3fa1c649c9f2e0498e Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Mon, 21 Sep 2026 12:53:57 +0800 Subject: fix(steps): failed/idle live entries no longer shadow on-disk step artifacts; running stays protected --- src/SomhairlesDream.Server/ArtifactRunCoordinator.fs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs b/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs index 6cd5fd3..c77d22b 100644 --- a/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs +++ b/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs @@ -342,7 +342,15 @@ type ArtifactRunCoordinator( elif snapshot.CompletedSteps |> Array.exists (fun recorded -> recorded = normalized) then checkpointDigest projectId runId normalized else - Error ArtifactNotFound + // A live entry that failed or is idling (e.g. a + // re-run rejected because the run was already + // pre-published on disk) must not shadow the + // historical artifact; only a completed on-disk + // manifest may back it, so an in-flight failure + // never serves half-written files. + match snapshot.Status with + | "running" -> Error ArtifactNotFound + | _ -> completedDigest projectId runId normalized match digest with | Error lookupError -> Error lookupError -- cgit v1.2.3