From 5e482486e71cb90905e2425b4d8e4b3ab324f793 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 21 Apr 2026 07:44:15 -0400 Subject: [PATCH] test: finish metadata cleanup sweep Rename the last stale workflow test helpers and assertions that still used pre-refactor checkpoint/retro file terminology, and update the retro docs to describe the exported layout that now exists. --- docs/execution/retros.mdx | 2 +- lib/crates/fabro-workflow/src/operations/fork.rs | 8 ++++---- .../fabro-workflow/src/operations/rewind.rs | 2 +- .../src/operations/test_support.rs | 2 +- .../fabro-workflow/src/pipeline/execute/tests.rs | 2 +- .../fabro-workflow/src/pipeline/finalize.rs | 2 +- lib/crates/fabro-workflow/src/pipeline/retro.rs | 2 +- .../fabro-workflow/tests/it/integration.rs | 16 +++------------- 8 files changed, 13 insertions(+), 23 deletions(-) diff --git a/docs/execution/retros.mdx b/docs/execution/retros.mdx index 8aae4be1e..d0b5f6b63 100644 --- a/docs/execution/retros.mdx +++ b/docs/execution/retros.mdx @@ -143,4 +143,4 @@ Retros are also available via the REST API. See the [list retros](/api-reference ## Storage -Retros are stored in durable run state. If you need files on disk, `fabro store dump` materializes the retro as `retro.json` alongside other exported run data. +Retros are stored in durable run state. If you need files on disk, `fabro store dump` materializes retro text under `retro/` alongside `run.json`, stage files, and the rest of the exported run data. diff --git a/lib/crates/fabro-workflow/src/operations/fork.rs b/lib/crates/fabro-workflow/src/operations/fork.rs index 32037a39c..f0b43153a 100644 --- a/lib/crates/fabro-workflow/src/operations/fork.rs +++ b/lib/crates/fabro-workflow/src/operations/fork.rs @@ -252,15 +252,15 @@ mod tests { for (i, node) in nodes.iter().enumerate() { let mut projection = init_projection.clone(); projection.checkpoint = Some( - serde_json::from_slice(&make_checkpoint_json( + serde_json::from_slice(&make_checkpoint_bytes( node, 1, Some(&run_oids[i].to_string()), )) .unwrap(), ); - let checkpoint_json = serde_json::to_vec_pretty(&projection).unwrap(); - bs.write_entry("run.json", &checkpoint_json, "checkpoint") + let projection_json = serde_json::to_vec_pretty(&projection).unwrap(); + bs.write_entry("run.json", &projection_json, "checkpoint") .unwrap(); } @@ -318,7 +318,7 @@ mod tests { let mut checkpoint_projection = make_run_projection(&run_id); checkpoint_projection.checkpoint = - Some(serde_json::from_slice(&make_checkpoint_json("start", 1, None)).unwrap()); + Some(serde_json::from_slice(&make_checkpoint_bytes("start", 1, None)).unwrap()); let cp = serde_json::to_vec_pretty(&checkpoint_projection).unwrap(); let oid = bs.write_entry("run.json", &cp, "checkpoint").unwrap(); let entry = TimelineEntry { diff --git a/lib/crates/fabro-workflow/src/operations/rewind.rs b/lib/crates/fabro-workflow/src/operations/rewind.rs index 17deb07f4..23603293f 100644 --- a/lib/crates/fabro-workflow/src/operations/rewind.rs +++ b/lib/crates/fabro-workflow/src/operations/rewind.rs @@ -405,7 +405,7 @@ mod tests { ) -> Vec { let mut projection = RunProjection::default(); projection.checkpoint = Some( - serde_json::from_slice(&make_checkpoint_json(current_node, visit, git_commit_sha)) + serde_json::from_slice(&make_checkpoint_bytes(current_node, visit, git_commit_sha)) .unwrap(), ); serde_json::to_vec_pretty(&projection).unwrap() diff --git a/lib/crates/fabro-workflow/src/operations/test_support.rs b/lib/crates/fabro-workflow/src/operations/test_support.rs index 79319fa7b..1065d20b8 100644 --- a/lib/crates/fabro-workflow/src/operations/test_support.rs +++ b/lib/crates/fabro-workflow/src/operations/test_support.rs @@ -13,7 +13,7 @@ pub(super) fn test_sig() -> Signature<'static> { Signature::now("Test", "test@example.com").unwrap() } -pub(super) fn make_checkpoint_json( +pub(super) fn make_checkpoint_bytes( current_node: &str, visit: usize, git_sha: Option<&str>, diff --git a/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs b/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs index 16c824d01..61a8b886f 100644 --- a/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs +++ b/lib/crates/fabro-workflow/src/pipeline/execute/tests.rs @@ -645,7 +645,7 @@ async fn execute_conditional_routing_uses_unconditional_success_path() { } #[tokio::test] -async fn execute_writes_start_json_and_node_status() { +async fn execute_persists_start_record_and_node_status() { let dir = tempfile::tempdir().unwrap(); let mut run_options = test_run_options(dir.path(), "test-run"); run_options.git = Some(GitCheckpointOptions { diff --git a/lib/crates/fabro-workflow/src/pipeline/finalize.rs b/lib/crates/fabro-workflow/src/pipeline/finalize.rs index 188b3fd02..924d43bcf 100644 --- a/lib/crates/fabro-workflow/src/pipeline/finalize.rs +++ b/lib/crates/fabro-workflow/src/pipeline/finalize.rs @@ -342,7 +342,7 @@ mod tests { } #[tokio::test] - async fn finalize_writes_conclusion_json() { + async fn finalize_persists_conclusion_in_projection() { let temp = tempfile::tempdir().unwrap(); let run_dir = temp.path().join("run"); std::fs::create_dir_all(&run_dir).unwrap(); diff --git a/lib/crates/fabro-workflow/src/pipeline/retro.rs b/lib/crates/fabro-workflow/src/pipeline/retro.rs index 300f53afd..74dd181a2 100644 --- a/lib/crates/fabro-workflow/src/pipeline/retro.rs +++ b/lib/crates/fabro-workflow/src/pipeline/retro.rs @@ -312,7 +312,7 @@ mod tests { } #[tokio::test] - async fn retro_phase_writes_retro_json() { + async fn retro_phase_persists_retro_in_projection() { let temp = tempfile::tempdir().unwrap(); let run_dir = temp.path().join("run"); std::fs::create_dir_all(&run_dir).unwrap(); diff --git a/lib/crates/fabro-workflow/tests/it/integration.rs b/lib/crates/fabro-workflow/tests/it/integration.rs index ec8c8b7f5..9c174ea7a 100644 --- a/lib/crates/fabro-workflow/tests/it/integration.rs +++ b/lib/crates/fabro-workflow/tests/it/integration.rs @@ -71,16 +71,6 @@ fn test_run_id(label: &str) -> RunId { } fn load_checkpoint(path: &Path) -> Result> { - if !path.exists() - && path - .file_name() - .is_some_and(|name| name == "checkpoint.json") - { - let run_dir = path - .parent() - .ok_or("checkpoint path should have a parent")?; - return load_run_checkpoint(run_dir); - } let data = std::fs::read_to_string(path)?; Ok(serde_json::from_str(&data)?) } @@ -188,9 +178,9 @@ fn load_run_checkpoint(run_dir: &Path) -> Result ArtifactStore { @@ -1462,7 +1452,7 @@ async fn pipeline_with_many_nodes() { #[test] fn checkpoint_save_and_resume_roundtrip() { let dir = tempfile::tempdir().unwrap(); - let path = dir.path().join("checkpoint.json"); + let path = dir.path().join("checkpoint_state.json"); let ctx = Context::new(); ctx.set("goal", serde_json::json!("Test checkpoint"));