summaryrefslogtreecommitdiff
path: root/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
diff options
context:
space:
mode:
authorSomhairle H. Marisol <[email protected]>2026-09-21 10:58:44 +0800
committerSomhairle H. Marisol <[email protected]>2026-09-21 10:58:44 +0800
commit7a4e0b4677e0241ab19489ef40a462810f841415 (patch)
treeb33d7ca5fb8d9527989696da52be8e47d26a5198 /src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
parentb8e49e1b8b57393f47bcc9a29664a7f509584ba2 (diff)
downloadsomhairles-dream-fsharp-7a4e0b4677e0241ab19489ef40a462810f841415.tar.gz
fix(boot): failed live attempt no longer shadows pre-published history; boot-default submit picks a fresh live run id
Diffstat (limited to 'src/SomhairlesDream.Server/ArtifactRunCoordinator.fs')
-rw-r--r--src/SomhairlesDream.Server/ArtifactRunCoordinator.fs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs b/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
index 51a4fcd..6cd5fd3 100644
--- a/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
+++ b/src/SomhairlesDream.Server/ArtifactRunCoordinator.fs
@@ -267,10 +267,17 @@ type ArtifactRunCoordinator(
| Some store ->
let snapshot = store.Observe(clock ())
- if snapshot.Status <> "complete" then
- Error(RunNotComplete snapshot)
- else
+ if snapshot.Status = "complete" then
verifiedManifest projectId runId
+ else
+ // A live entry that failed or is idling (e.g. "run directory
+ // already exists" because the run was pre-published on disk)
+ // must not shadow a complete on-disk manifest: the historical
+ // replay stays viewable while the rejected live attempt is
+ // reported by /api/runs/events.
+ match verifiedManifest projectId runId with
+ | Ok manifest -> Ok manifest
+ | Error _ -> Error(RunNotComplete snapshot)
member _.Artifact(projectId: string, runId: string, relativePath: string) : Result<ArtifactFile, ArtifactLookupError> =
match registry.TryFind(projectId, runId) with