From 012b556367b461085936fb07db5bc96fdba487a0 Mon Sep 17 00:00:00 2001 From: Scott Werner Date: Sun, 13 Sep 2026 08:55:55 -0600 Subject: [PATCH] Remove tests and fixtures tied to retired manifest fields --- lib/apps/fabro-cli/tests/it/cmd/attach.rs | 2 +- lib/apps/fabro-server/src/demo/mod.rs | 1 - lib/apps/fabro-server/src/server/tests.rs | 52 +++---------------- lib/components/fabro-store/src/run_state.rs | 8 +-- .../fabro-workflow/src/operations/create.rs | 5 -- lib/foundation/fabro-test/src/lib.rs | 4 +- .../fabro-types/src/run_event/mod.rs | 38 -------------- .../fabro-types/tests/run_spec_serde.rs | 27 +--------- 8 files changed, 11 insertions(+), 126 deletions(-) diff --git a/lib/apps/fabro-cli/tests/it/cmd/attach.rs b/lib/apps/fabro-cli/tests/it/cmd/attach.rs index 7312ba021..7f74114d0 100644 --- a/lib/apps/fabro-cli/tests/it/cmd/attach.rs +++ b/lib/apps/fabro-cli/tests/it/cmd/attach.rs @@ -66,7 +66,7 @@ fn format_output_snapshot(output: &Output, filters: &[(String, String)]) -> Stri } fn normalize_attach_json_progress_event(mut event: Value) -> Value { - // manifest_blob/definition_blob hashes are already rewritten to + // Definition and spec blob hashes are already rewritten to // [BLOB_HASH] by the shared json_snapshot_filters regexes. // Strip v2-shape server/version fields that the bridge emits, // since the test fixture's socket path is randomised per run. diff --git a/lib/apps/fabro-server/src/demo/mod.rs b/lib/apps/fabro-server/src/demo/mod.rs index 5dfcfe1cc..14936a897 100644 --- a/lib/apps/fabro-server/src/demo/mod.rs +++ b/lib/apps/fabro-server/src/demo/mod.rs @@ -1727,7 +1727,6 @@ mod runs { client: None, subject: DEMO_PRINCIPAL.clone(), }, - manifest_blob: None, definition_blob: None, spec_blob: None, git: None, diff --git a/lib/apps/fabro-server/src/server/tests.rs b/lib/apps/fabro-server/src/server/tests.rs index 65700bbbd..57f3442da 100644 --- a/lib/apps/fabro-server/src/server/tests.rs +++ b/lib/apps/fabro-server/src/server/tests.rs @@ -3559,8 +3559,8 @@ async fn generated_title_does_not_overwrite_user_title_edit() { assert_eq!(title_update_event_count(&state, run_id).await, 1); } -async fn post_run_intent(app: &Router, manifest: serde_json::Value) -> serde_json::Value { - let response = post_run_intent_response(app, manifest).await; +async fn post_run_intent(app: &Router, intent: serde_json::Value) -> serde_json::Value { + let response = post_run_intent_response(app, intent).await; response_json!(response, StatusCode::CREATED).await } @@ -4685,7 +4685,7 @@ async fn post_runs_run_intent_accepts_none_target_with_ready_daytona_environment } #[tokio::test] -async fn post_runs_rejects_legacy_manifests() { +async fn post_runs_reports_malformed_json() { let state = test_app_state(); let app = crate::test_support::build_test_router(Arc::clone(&state)); let malformed = app @@ -4702,27 +4702,6 @@ async fn post_runs_rejects_legacy_manifests() { .unwrap(); let malformed = response_json!(malformed, StatusCode::BAD_REQUEST).await; assert_eq!(malformed["errors"][0]["code"], "invalid_json"); - - let intent_shaped = app - .clone() - .oneshot( - Request::builder() - .method("POST") - .uri(api("/runs")) - .header("content-type", "application/json") - .body(Body::from(json!({ "workflow_version_id": fabro_types::test_support::test_workflow_version_id() }).to_string())) - .unwrap(), - ) - .await - .unwrap(); - let intent_shaped = response_json!(intent_shaped, StatusCode::UNPROCESSABLE_ENTITY).await; - assert_eq!(intent_shaped["errors"][0]["code"], "run_intent_invalid"); - - let mut legacy = minimal_manifest_json(MINIMAL_DOT); - legacy["workflow_version_id"] = json!(fabro_types::test_support::test_workflow_version_id()); - let response = post_run_intent_response(&app, legacy).await; - let body = response_json!(response, StatusCode::UNPROCESSABLE_ENTITY).await; - assert_eq!(body["errors"][0]["code"], "run_intent_invalid"); } #[tokio::test] @@ -4732,13 +4711,9 @@ async fn post_runs_attributes_parse_failures_and_rejects_duplicate_keys() { let id = fabro_types::test_support::test_workflow_version_id(); for (raw, expected_detail) in [ ("{}".to_string(), "missing field"), - ( - minimal_manifest_json(MINIMAL_DOT).to_string(), - "unknown field", - ), ( format!( - r#"{{"workflow_version_id":"{id}","target":{{"kind":"none"}},"cwd":"/tmp","args":{{}}}}"# + r#"{{"workflow_version_id":"{id}","target":{{"kind":"none"}},"unexpected":true,"args":{{}}}}"# ), "unknown field", ), @@ -4976,16 +4951,6 @@ enabled = false assert_run_intent_targets_unavailable(&daytona_state).await; } -#[tokio::test] -async fn post_runs_rejects_removed_run_id_input() { - let app = test_app_with(); - let mut intent = test_intent(&app, MINIMAL_DOT).await; - intent["run_id"] = json!(RunId::new()); - let response = post_run_intent_response(&app, intent).await; - let body = response_json!(response, StatusCode::UNPROCESSABLE_ENTITY).await; - assert_eq!(body["errors"][0]["code"], "run_intent_invalid"); -} - #[tokio::test] async fn post_runs_create_regression_keeps_api_behavior_without_automation_metadata() { let state = TestAppStateBuilder::new() @@ -12189,7 +12154,7 @@ async fn dev_token_web_login_authorizes_cookie_backed_api_requests() { } #[tokio::test] -async fn create_run_persists_definition_and_spec_blobs_without_manifest() { +async fn create_run_persists_definition_and_spec_blobs() { let state = test_app_state(); let app = crate::test_support::build_test_router(Arc::clone(&state)); let raw_intent = serde_json::to_string_pretty(&test_intent(&app, MINIMAL_DOT).await).unwrap(); @@ -12198,7 +12163,7 @@ async fn create_run_persists_definition_and_spec_blobs_without_manifest() { .method("POST") .uri(api("/runs")) .header("content-type", "application/json") - .body(Body::from(raw_intent.clone())) + .body(Body::from(raw_intent)) .unwrap(); let response = app.clone().oneshot(req).await.unwrap(); @@ -12209,7 +12174,6 @@ async fn create_run_persists_definition_and_spec_blobs_without_manifest() { let events = run_store.list_events().await.unwrap(); let created = events[0].event.to_value().unwrap(); let submitted = events[1].event.to_value().unwrap(); - assert!(created["properties"].get("manifest_blob").is_none()); assert!(created["properties"]["spec_blob"].is_string()); let definition_blob = submitted["properties"]["definition_blob"] .as_str() @@ -12224,10 +12188,6 @@ async fn create_run_persists_definition_and_spec_blobs_without_manifest() { .expect("accepted definition blob should exist"); let accepted_definition: serde_json::Value = serde_json::from_slice(&accepted_definition_bytes).unwrap(); - assert!( - accepted_definition.get("version").is_none(), - "accepted run definition should not carry compatibility versioning" - ); assert_eq!(accepted_definition["workflow_path"], "workflow.fabro"); assert!(accepted_definition["workflows"]["workflow.fabro"].is_object()); } diff --git a/lib/components/fabro-store/src/run_state.rs b/lib/components/fabro-store/src/run_state.rs index c965b0c3c..c5381f977 100644 --- a/lib/components/fabro-store/src/run_state.rs +++ b/lib/components/fabro-store/src/run_state.rs @@ -2677,7 +2677,6 @@ mod tests { "base_branch": null, "labels": {}, "provenance": test_support::test_run_provenance(), - "manifest_blob": null, "definition_blob": null, "git": null, "fork_source_ref": null @@ -4169,8 +4168,7 @@ mod tests { } #[test] - fn projection_serialization_includes_manifest_and_definition_blob_refs() { - let manifest_blob = BlobHash::new(br#"{"version":1}"#).to_string(); + fn projection_serialization_includes_definition_blob() { let definition_blob = BlobHash::new(br#"{"version":1,"workflow_path":"workflow.fabro"}"#).to_string(); let events = vec![ @@ -4191,8 +4189,7 @@ mod tests { }, "labels": {}, "source_directory": "/tmp/run", - "provenance": test_support::test_run_provenance(), - "manifest_blob": manifest_blob + "provenance": test_support::test_run_provenance() } })) .unwrap(), @@ -4215,7 +4212,6 @@ mod tests { let state = RunProjection::apply_events(&events).unwrap(); let value = serde_json::to_value(&state).unwrap(); - assert!(value["spec"].get("manifest_blob").is_none()); assert_eq!( value["spec"]["definition_blob"], events[1].event.properties().unwrap()["definition_blob"] diff --git a/lib/components/fabro-workflow/src/operations/create.rs b/lib/components/fabro-workflow/src/operations/create.rs index b888ddeeb..56166ec77 100644 --- a/lib/components/fabro-workflow/src/operations/create.rs +++ b/lib/components/fabro-workflow/src/operations/create.rs @@ -1805,11 +1805,6 @@ mod tests { Some(compiled_source.as_str()) ); assert_eq!(created.workflow_version_id, Some(workflow_version_id)); - assert!( - events[0].event.to_value().unwrap()["properties"] - .get("manifest_blob") - .is_none() - ); assert!(created.spec_blob.is_some()); } diff --git a/lib/foundation/fabro-test/src/lib.rs b/lib/foundation/fabro-test/src/lib.rs index 8fe993421..dadcaee70 100644 --- a/lib/foundation/fabro-test/src/lib.rs +++ b/lib/foundation/fabro-test/src/lib.rs @@ -1967,7 +1967,7 @@ pub fn json_snapshot_filters(mut filters: Vec<(String, String)>) -> Vec<(String, r#""id": "[EVENT_ID]""#.to_string(), )); filters = json_elapsed_ms_snapshot_filters(filters); - for field in ["manifest_blob", "definition_blob", "spec_blob"] { + for field in ["definition_blob", "spec_blob"] { filters.push(( format!(r#""{field}":\s*"[0-9a-f]{{64}}""#), format!(r#""{field}": "[BLOB_HASH]""#), @@ -2576,7 +2576,6 @@ mod tests { "inference_time_ms": 34567, "tool_time_ms": 45678, "active_time_ms": 80245, - "manifest_blob": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "definition_blob": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789", "run_dir": "[STORAGE_DIR]/scratch/20260424-01ARZ3NDEKTSV4RRFFQ69G5FAV", "message": "custom-value" @@ -2593,7 +2592,6 @@ mod tests { "inference_time_ms": "[INFERENCE_TIME_MS]", "tool_time_ms": "[TOOL_TIME_MS]", "active_time_ms": "[ACTIVE_TIME_MS]", - "manifest_blob": "[BLOB_HASH]", "definition_blob": "[BLOB_HASH]", "run_dir": "[RUN_DIR]", "message": "[CUSTOM]" diff --git a/lib/foundation/fabro-types/src/run_event/mod.rs b/lib/foundation/fabro-types/src/run_event/mod.rs index fc87943cc..4e036eb11 100644 --- a/lib/foundation/fabro-types/src/run_event/mod.rs +++ b/lib/foundation/fabro-types/src/run_event/mod.rs @@ -1363,44 +1363,6 @@ mod tests { assert_eq!(sandbox["properties"]["id"], ""); } - #[test] - fn run_created_reads_retired_manifest_blob_without_serializing_it() { - let line = json!({ - "id": "evt_created_blob", - "ts": "2026-04-04T12:00:00.000Z", - "run_id": fixtures::RUN_1, - "event": "run.created", - "properties": { - "settings": WorkflowSettings::default(), - "graph": Graph::new("test"), - "labels": {}, - "source_directory": "/tmp/run", - "provenance": test_support::test_run_provenance(), - "manifest_blob": BlobHash::new(br#"{"version":1}"#).to_string() - } - }); - - for legacy_hash in [ - Some(line["properties"]["manifest_blob"].clone()), - Some(serde_json::Value::Null), - None, - ] { - let mut historical = line.clone(); - historical["properties"] - .as_object_mut() - .unwrap() - .remove("manifest_blob"); - if let Some(hash) = legacy_hash { - historical["properties"]["manifest_blob"] = hash; - } - let parsed = RunEvent::from_value(historical).unwrap(); - assert!(matches!(parsed.body, EventBody::RunCreated(_))); - let serialized = parsed.to_value().unwrap(); - assert_eq!(serialized["event"], "run.created"); - assert!(serialized["properties"].get("manifest_blob").is_none()); - } - } - #[test] fn interview_interrupted_kind_matches_event_name() { let body = EventBody::InterviewInterrupted(InterviewInterruptedProps { diff --git a/lib/foundation/fabro-types/tests/run_spec_serde.rs b/lib/foundation/fabro-types/tests/run_spec_serde.rs index d930680fa..aacfc4c4b 100644 --- a/lib/foundation/fabro-types/tests/run_spec_serde.rs +++ b/lib/foundation/fabro-types/tests/run_spec_serde.rs @@ -7,7 +7,7 @@ use fabro_types::settings::run::RunGoal; use fabro_types::test_support::{test_run_provenance, test_workflow_version_id}; use fabro_types::{ AutomationRef, GitRunTarget, ResolvedAutomationGitWorkflowSource, RunTarget, WorkflowSettings, - fixtures, test_support, + fixtures, }; fn templated_settings() -> WorkflowSettings { @@ -117,28 +117,3 @@ fn run_spec_defaults_automation_for_legacy_specs() { let round_trip = serde_json::to_value(&record).expect("record should serialize"); assert!(round_trip.get("workflow_version_id").is_none()); } - -#[test] -fn historical_run_spec_ignores_retired_manifest_blob() { - let spec = test_support::test_run_spec(); - let value = serde_json::to_value(spec).unwrap(); - for hash in [ - Some(serde_json::json!(fabro_types::BlobHash::new( - b"old manifest" - ))), - Some(serde_json::Value::Null), - None, - ] { - let mut historical = value.clone(); - if let Some(hash) = hash { - historical["manifest_blob"] = hash; - } - let decoded: RunSpec = serde_json::from_value(historical).unwrap(); - assert!( - serde_json::to_value(decoded) - .unwrap() - .get("manifest_blob") - .is_none() - ); - } -}