The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore: files changed src/openhuman/flows/builder_tools_tests.rs,src/openhuman/flows/catalogue_tests.
Steven Enamakel409345aced8f
diff --git a/src/openhuman/flows/builder_tools_tests.rs b/src/openhuman/flows/builder_tools_tests.rsindex 10fd6007cb..a7a6a027d3 100644--- a/src/openhuman/flows/builder_tools_tests.rs+++ b/src/openhuman/flows/builder_tools_tests.rs@@ -1618,7 +1618,8 @@ async fn revise_workflow_rejects_a_missing_required_composio_arg() {async fn seed_flow(config: &Arc<Config>, name: &str) -> String {let outcome = ops::flows_create(config,- name.to_string(), String::new(),+ name.to_string(),+ String::new(),json!({"nodes": [ { "id": "t", "kind": "trigger", "name": "Manual" } ],"edges": []@@ -2232,7 +2233,8 @@ async fn edit_workflow_does_not_persist_an_incompatible_saved_child_reference()tinyflows::validate::validate(&child_graph).unwrap();let child = crate::openhuman::flows::store::create_flow(&config,- "Legacy unsafe child".to_string(), String::new(),+ "Legacy unsafe child".to_string(),+ String::new(),child_graph,false,false,@@ -2331,10 +2333,16 @@ async fn edit_workflow_edits_a_saved_flow_by_id() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);// Create a saved flow to edit.- let flow = ops::flows_create(&config, "Base flow".to_string(), String::new(), valid_graph(), false)- .await- .unwrap()- .value;+ let flow = ops::flows_create(+ &config,+ "Base flow".to_string(),+ String::new(),+ valid_graph(),+ false,+ )+ .await+ .unwrap()+ .value;let tool = EditWorkflowTool::new(config.clone());let result = tool@@ -2612,10 +2620,16 @@ async fn create_workflow_rejects_an_invalid_graph() {async fn duplicate_flow_creates_a_disabled_copy() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = ops::flows_create(&config, "Original".to_string(), String::new(), valid_graph(), false)- .await- .unwrap()- .value;+ let flow = ops::flows_create(+ &config,+ "Original".to_string(),+ String::new(),+ valid_graph(),+ false,+ )+ .await+ .unwrap()+ .value;let tool = DuplicateFlowTool::new(config.clone());let result = tool.execute(json!({ "flow_id": flow.id })).await.unwrap();assert!(!result.is_error, "{}", result.output());@@ -2629,10 +2643,16 @@ async fn duplicate_flow_creates_a_disabled_copy() {async fn list_flow_runs_is_empty_for_a_fresh_flow() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = ops::flows_create(&config, "F".to_string(), String::new(), valid_graph(), false)- .await- .unwrap()- .value;+ let flow = ops::flows_create(+ &config,+ "F".to_string(),+ String::new(),+ valid_graph(),+ false,+ )+ .await+ .unwrap()+ .value;let tool = ListFlowRunsTool::new(config.clone());let result = tool.execute(json!({ "flow_id": flow.id })).await.unwrap();assert!(!result.is_error, "{}", result.output());@@ -2695,7 +2715,8 @@ async fn cancel_flow_run_refuses_a_run_the_caller_does_not_own() {let owner_flow = ops::flows_create(&config,- "owner".to_string(), String::new(),+ "owner".to_string(),+ String::new(),cancel_test_approval_gated_graph(),false,)@@ -2704,7 +2725,8 @@ async fn cancel_flow_run_refuses_a_run_the_caller_does_not_own() {.value;let other_flow = ops::flows_create(&config,- "other".to_string(), String::new(),+ "other".to_string(),+ String::new(),cancel_test_approval_gated_graph(),false,)@@ -2757,7 +2779,8 @@ async fn cancel_flow_run_cancels_when_flow_id_matches_the_owner() {let flow = ops::flows_create(&config,- "F".to_string(), String::new(),+ "F".to_string(),+ String::new(),cancel_test_approval_gated_graph(),false,)@@ -2824,10 +2847,16 @@ async fn edit_workflow_by_flow_id_seeds_a_retrievable_draft_and_marks_unpersistelet config = test_config(&tmp);// A saved flow to edit — editing it must NOT write onto the flow (the WS2// bug: a flow_id edit used to persist nothing and return no handle).- let flow = ops::flows_create(&config, "Base flow".to_string(), String::new(), valid_graph(), false)- .await- .unwrap()- .value;+ let flow = ops::flows_create(+ &config,+ "Base flow".to_string(),+ String::new(),+ valid_graph(),+ false,+ )+ .await+ .unwrap()+ .value;let tool = EditWorkflowTool::new(config.clone());let result = tool@@ -2881,10 +2910,16 @@ async fn edit_workflow_by_flow_id_seeds_a_retrievable_draft_and_marks_unpersisteasync fn dry_run_workflow_by_flow_id_runs_the_saved_flow_graph() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = ops::flows_create(&config, "Runnable".to_string(), String::new(), valid_graph(), false)- .await- .unwrap()- .value;+ let flow = ops::flows_create(+ &config,+ "Runnable".to_string(),+ String::new(),+ valid_graph(),+ false,+ )+ .await+ .unwrap()+ .value;let tool = DryRunWorkflowTool::new(config.clone());let result = tool.execute(json!({ "flow_id": flow.id })).await.unwrap();assert!(!result.is_error, "{}", result.output());diff --git a/src/openhuman/flows/catalogue_tests.rs b/src/openhuman/flows/catalogue_tests.rsindex a0dd3c9e44..956da1bd95 100644--- a/src/openhuman/flows/catalogue_tests.rs+++ b/src/openhuman/flows/catalogue_tests.rs@@ -228,9 +228,15 @@ fn a_saved_flow_reaches_the_catalogue_with_its_real_id() {],..Default::default()};- let saved =- super::super::store::create_flow(&config, "Weekly Report".to_string(), String::new(), graph, false, true)- .expect("flow saves");+ let saved = super::super::store::create_flow(+ &config,+ "Weekly Report".to_string(),+ String::new(),+ graph,+ false,+ true,+ )+ .expect("flow saves");let entries = flow_entries(&config);assert_eq!(entries.len(), 1, "the saved flow must appear: {entries:?}");@@ -255,7 +261,8 @@ fn entries_are_sorted_by_name_so_the_prompt_prefix_is_stable() {for name in ["Zebra", "Alpha", "Mango"] {super::super::store::create_flow(&config,- name.to_string(), String::new(),+ name.to_string(),+ String::new(),WorkflowGraph::default(),false,true,diff --git a/src/openhuman/flows/medulla_bridge_tests.rs b/src/openhuman/flows/medulla_bridge_tests.rsindex bf11f30bd4..699c26f2eb 100644--- a/src/openhuman/flows/medulla_bridge_tests.rs+++ b/src/openhuman/flows/medulla_bridge_tests.rs@@ -250,7 +250,8 @@ async fn list_and_get_answer_out_of_the_real_store() {let config = test_config(&tmp);let created = ops::flows_create(&config,- "Deploy".to_string(), String::new(),+ "Deploy".to_string(),+ String::new(),serde_json::to_value(graph_with_step("Ship it")).unwrap(),false,)@@ -295,7 +296,8 @@ async fn runs_answers_with_an_empty_window_for_a_flow_that_never_ran() {let config = test_config(&tmp);let created = ops::flows_create(&config,- "Deploy".to_string(), String::new(),+ "Deploy".to_string(),+ String::new(),serde_json::to_value(graph_with_step("Ship it")).unwrap(),false,)@@ -341,7 +343,8 @@ async fn an_update_cannot_lower_the_approval_requirement() {let config = test_config(&tmp);let created = ops::flows_create(&config,- "Deploy".to_string(), String::new(),+ "Deploy".to_string(),+ String::new(),serde_json::to_value(graph_with_step("Ship it")).unwrap(),true,)@@ -392,7 +395,8 @@ async fn a_remote_automatic_revision_requires_explicit_rearming() {let config = test_config(&tmp);let created = ops::flows_create(&config,- "Scheduled".to_string(), String::new(),+ "Scheduled".to_string(),+ String::new(),schedule_graph("0 9 * * *"),true,)@@ -436,7 +440,8 @@ async fn an_update_refuses_to_overwrite_a_concurrent_edit() {let config = test_config(&tmp);let created = ops::flows_create(&config,- "Deploy".to_string(), String::new(),+ "Deploy".to_string(),+ String::new(),serde_json::to_value(graph_with_step("Ship it")).unwrap(),true,)@@ -447,7 +452,8 @@ async fn an_update_refuses_to_overwrite_a_concurrent_edit() {ops::flows_update(&config,&created.id,- Some("User edit".to_string()), None,+ Some("User edit".to_string()),+ None,None,None,Some(created.updated_at.clone()),diff --git a/src/openhuman/flows/ops_tests.rs b/src/openhuman/flows/ops_tests.rsindex f8f00e6417..098efdb8f0 100644--- a/src/openhuman/flows/ops_tests.rs+++ b/src/openhuman/flows/ops_tests.rs@@ -464,7 +464,8 @@ fn resolver_lookup_rejects_an_incompatible_saved_child() {let config = test_config(&tmp);let child = store::create_flow(&config,- "legacy child".to_string(), String::new(),+ "legacy child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -486,7 +487,8 @@ fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {let config = test_config(&tmp);let grandchild = store::create_flow(&config,- "legacy unsafe grandchild".to_string(), String::new(),+ "legacy unsafe grandchild".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -494,7 +496,8 @@ fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {.unwrap();let child = store::create_flow(&config,- "saved child".to_string(), String::new(),+ "saved child".to_string(),+ String::new(),structurally_valid_graph(referenced_child_graph(&grandchild.id)),false,false,@@ -532,7 +535,15 @@ async fn flows_run_rejects_legacy_nested_conditional_fan_in_before_execution() {// Bypass the current author-time gate to simulate a definition persisted// by an older OpenHuman build. Reads remain supported; execution does not.let graph = structurally_valid_graph(nested_conditional_fan_in_graph());- let flow = store::create_flow(&config, "legacy".to_string(), String::new(), graph, false, true).unwrap();+ let flow = store::create_flow(+ &config,+ "legacy".to_string(),+ String::new(),+ graph,+ false,+ true,+ )+ .unwrap();let err = flows_run(&config,@@ -559,7 +570,8 @@ async fn flows_run_rejects_an_incompatible_saved_child_before_execution() {let config = test_config(&tmp);let child = store::create_flow(&config,- "legacy unsafe child".to_string(), String::new(),+ "legacy unsafe child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -567,7 +579,8 @@ async fn flows_run_rejects_an_incompatible_saved_child_before_execution() {.unwrap();let parent = store::create_flow(&config,- "parent".to_string(), String::new(),+ "parent".to_string(),+ String::new(),structurally_valid_graph(referenced_child_graph(&child.id)),false,true,@@ -598,12 +611,21 @@ async fn flows_update_allows_metadata_only_edits_of_legacy_incompatible_graph()let tmp = TempDir::new().unwrap();let config = test_config(&tmp);let graph = structurally_valid_graph(nested_conditional_fan_in_graph());- let flow = store::create_flow(&config, "legacy".to_string(), String::new(), graph, false, false).unwrap();+ let flow = store::create_flow(+ &config,+ "legacy".to_string(),+ String::new(),+ graph,+ false,+ false,+ )+ .unwrap();let updated = flows_update(&config,&flow.id,- Some("renamed legacy".to_string()), None,+ Some("renamed legacy".to_string()),+ None,None,Some(true),None,@@ -622,7 +644,8 @@ async fn flows_create_rejects_an_incompatible_saved_child_before_persisting() {let config = test_config(&tmp);let child = store::create_flow(&config,- "legacy unsafe child".to_string(), String::new(),+ "legacy unsafe child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -631,7 +654,8 @@ async fn flows_create_rejects_an_incompatible_saved_child_before_persisting() {let error = flows_create(&config,- "rejected parent".to_string(), String::new(),+ "rejected parent".to_string(),+ String::new(),referenced_child_graph(&child.id),false,)@@ -654,7 +678,8 @@ async fn flows_update_rejects_an_incompatible_saved_child_before_persisting() {let config = test_config(&tmp);let child = store::create_flow(&config,- "legacy unsafe child".to_string(), String::new(),+ "legacy unsafe child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -663,7 +688,8 @@ async fn flows_update_rejects_an_incompatible_saved_child_before_persisting() {let original_graph = structurally_valid_graph(trigger_only_graph());let parent = store::create_flow(&config,- "safe parent".to_string(), String::new(),+ "safe parent".to_string(),+ String::new(),original_graph.clone(),false,true,@@ -673,7 +699,8 @@ async fn flows_update_rejects_an_incompatible_saved_child_before_persisting() {let error = flows_update(&config,&parent.id,- None, None,+ None,+ None,Some(referenced_child_graph(&child.id)),None,None,@@ -704,9 +731,15 @@ async fn flows_create_rejects_graph_without_trigger() {"edges": []});- let err = flows_create(&config, "bad".to_string(), String::new(), graph_without_trigger, false)- .await- .expect_err("graph without a trigger must be rejected");+ let err = flows_create(+ &config,+ "bad".to_string(),+ String::new(),+ graph_without_trigger,+ false,+ )+ .await+ .expect_err("graph without a trigger must be rejected");assert!(err.contains("trigger"),"expected a MissingTrigger-style error, got: {err}"@@ -718,9 +751,15 @@ async fn flows_create_get_list_delete_roundtrip() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let flow_id = created.value.id.clone();let fetched = flows_get(&config, &flow_id).await.unwrap();@@ -741,9 +780,15 @@ async fn flows_duplicate_produces_disabled_unbound_copy_with_new_id() {let config = test_config(&tmp);// Enabled source with require_approval set.- let created = flows_create(&config, "My Flow".to_string(), String::new(), trigger_only_graph(), true)- .await- .unwrap();+ let created = flows_create(+ &config,+ "My Flow".to_string(),+ String::new(),+ trigger_only_graph(),+ true,+ )+ .await+ .unwrap();assert!(created.value.enabled);let source_id = created.value.id.clone();@@ -779,9 +824,15 @@ async fn flows_duplicate_missing_flow_errors() {async fn flows_set_enabled_toggles() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();assert!(created.value.enabled);let disabled = flows_set_enabled(&config, &created.value.id, false)@@ -799,9 +850,15 @@ async fn flows_set_enabled_toggles() {async fn flows_update_replaces_name_and_graph() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let mut new_graph = trigger_only_graph();new_graph["name"] = json!("renamed-graph");@@ -809,7 +866,8 @@ async fn flows_update_replaces_name_and_graph() {let updated = flows_update(&config,&created.value.id,- Some("renamed".to_string()), None,+ Some("renamed".to_string()),+ None,Some(new_graph),None,None,@@ -825,14 +883,28 @@ async fn flows_update_replaces_name_and_graph() {async fn flows_update_can_set_require_approval() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();assert!(!created.value.require_approval);- let updated = flows_update(&config, &created.value.id, None, None, None, Some(true), None)- .await- .unwrap();+ let updated = flows_update(+ &config,+ &created.value.id,+ None,+ None,+ None,+ Some(true),+ None,+ )+ .await+ .unwrap();assert!(updated.value.require_approval);// Omitting `require_approval` on a later update preserves the current value.@@ -846,9 +918,15 @@ async fn flows_update_can_set_require_approval() {async fn flows_update_rejects_invalid_replacement_graph() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let invalid_graph = json!({"name": "no-trigger",@@ -859,7 +937,8 @@ async fn flows_update_rejects_invalid_replacement_graph() {let err = flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(invalid_graph),None,None,@@ -873,9 +952,15 @@ async fn flows_update_rejects_invalid_replacement_graph() {async fn flows_run_completes_trigger_only_graph() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let outcome = flows_run(&config,@@ -909,9 +994,15 @@ async fn flows_run_completes_trigger_only_graph() {async fn flows_run_on_trigger_only_graph_surfaces_no_actionable_nodes_note() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "empty".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "empty".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let outcome = flows_run(&config,@@ -1006,9 +1097,15 @@ async fn flows_run_on_graph_with_disconnected_component_still_surfaces_empty_flo{ "from_node": "a", "to_node": "b" }]});- let created = flows_create(&config, "disconnected".to_string(), String::new(), graph, false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "disconnected".to_string(),+ String::new(),+ graph,+ false,+ )+ .await+ .unwrap();let outcome = flows_run(&config,@@ -1129,7 +1226,8 @@ async fn flows_run_threads_declared_inputs_into_the_run() {let created = flows_create(&config,- "parameterized".to_string(), String::new(),+ "parameterized".to_string(),+ String::new(),parameterized_graph(),false,)@@ -1175,7 +1273,8 @@ async fn flows_run_detached_threads_and_validates_declared_inputs_too() {let created = flows_create(&config,- "parameterized".to_string(), String::new(),+ "parameterized".to_string(),+ String::new(),parameterized_graph(),false,)@@ -1214,7 +1313,8 @@ async fn flows_run_rejects_a_missing_required_input_without_creating_a_run_row()let created = flows_create(&config,- "parameterized".to_string(), String::new(),+ "parameterized".to_string(),+ String::new(),parameterized_graph(),false,)@@ -1257,7 +1357,8 @@ async fn flows_run_rejects_a_wrongly_typed_or_undeclared_input() {let created = flows_create(&config,- "parameterized".to_string(), String::new(),+ "parameterized".to_string(),+ String::new(),parameterized_graph(),false,)@@ -1388,9 +1489,15 @@ async fn flows_run_populates_error_when_a_continue_policy_node_errors() {"edges": [ { "from_node": "t", "to_node": "x" } ]});- let created = flows_create(&config, "boom-continue".to_string(), String::new(), graph, false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "boom-continue".to_string(),+ String::new(),+ graph,+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -1454,7 +1561,8 @@ async fn flows_create_binds_schedule_cron_job_for_an_enabled_flow() {let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -1491,7 +1599,8 @@ async fn flows_delete_unbinds_schedule_cron_job() {let config = test_config(&tmp);let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -1530,7 +1639,8 @@ async fn reconcile_schedule_triggers_on_boot_survives_a_corrupt_row() {let good = flows_create(&config,- "good-scheduled".to_string(), String::new(),+ "good-scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -1542,7 +1652,8 @@ async fn reconcile_schedule_triggers_on_boot_survives_a_corrupt_row() {let bad = flows_create(&config,- "bad-scheduled".to_string(), String::new(),+ "bad-scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 10 * * *"),false,)@@ -1613,7 +1724,8 @@ async fn flows_delete_clears_flow_memory_namespace() {let created = flows_create(&config,- "with-memory".to_string(), String::new(),+ "with-memory".to_string(),+ String::new(),trigger_only_graph(),false,)@@ -1664,7 +1776,8 @@ async fn flows_update_rebinds_schedule_cron_job_when_trigger_schedule_changes()let config = test_config(&tmp);let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -1681,7 +1794,8 @@ async fn flows_update_rebinds_schedule_cron_job_when_trigger_schedule_changes()flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(schedule_trigger_graph("30 8 * * *")),None,None,@@ -1712,7 +1826,8 @@ async fn flows_update_does_not_rebind_when_graph_is_not_supplied() {let config = test_config(&tmp);let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -1730,7 +1845,8 @@ async fn flows_update_does_not_rebind_when_graph_is_not_supplied() {flows_update(&config,&created.value.id,- Some("renamed".to_string()), None,+ Some("renamed".to_string()),+ None,None,None,None,@@ -1765,7 +1881,8 @@ async fn flows_update_disables_on_manual_to_automatic_trigger_transition_when_en// only gates automatic triggers).let created = flows_create(&config,- "manual-then-scheduled".to_string(), String::new(),+ "manual-then-scheduled".to_string(),+ String::new(),manual_trigger_graph(),false,)@@ -1778,7 +1895,8 @@ async fn flows_update_disables_on_manual_to_automatic_trigger_transition_when_enlet updated = flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(schedule_trigger_graph("0 8 * * *")),None,None,@@ -1830,7 +1948,8 @@ async fn flows_update_disarms_manual_to_automatic_transition_even_when_already_dlet created = flows_create(&config,- "manual-then-scheduled".to_string(), String::new(),+ "manual-then-scheduled".to_string(),+ String::new(),manual_trigger_graph(),false,)@@ -1843,7 +1962,8 @@ async fn flows_update_disarms_manual_to_automatic_transition_even_when_already_dlet updated = flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(schedule_trigger_graph("0 8 * * *")),None,None,@@ -1869,7 +1989,8 @@ async fn flows_update_preserves_enabled_when_already_automatic() {// explicitly — this IS the "already reviewed and opted in" state.let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -1885,7 +2006,8 @@ async fn flows_update_preserves_enabled_when_already_automatic() {let updated = flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(schedule_trigger_graph("30 8 * * *")),None,None,@@ -1906,9 +2028,15 @@ async fn flows_update_preserves_enabled_for_manual_target() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "manual".to_string(), String::new(), manual_trigger_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "manual".to_string(),+ String::new(),+ manual_trigger_graph(),+ false,+ )+ .await+ .unwrap();assert!(created.value.enabled);// manual → manual: no automatic trigger ever enters the picture, so@@ -1918,7 +2046,8 @@ async fn flows_update_preserves_enabled_for_manual_target() {let updated = flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(new_graph),None,None,@@ -1951,9 +2080,15 @@ fn approval_gated_graph() -> Value {async fn flows_resume_continues_a_paused_run_to_completion() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2008,9 +2143,15 @@ async fn flows_resume_continues_a_paused_run_to_completion() {async fn flows_resume_refuses_when_the_graph_changed_after_park() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2041,7 +2182,8 @@ async fn flows_resume_refuses_when_the_graph_changed_after_park() {store::update_flow_graph(&config,&created.value.id,- created.value.name.clone(), None,+ created.value.name.clone(),+ None,structurally_valid_graph(rewritten),created.value.require_approval,None, // enabled_override@@ -2099,9 +2241,15 @@ async fn flows_resume_refuses_when_the_graph_changed_after_park() {async fn flows_resume_succeeds_when_the_graph_is_unchanged() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2149,9 +2297,15 @@ async fn flows_resume_succeeds_when_the_graph_is_unchanged() {async fn flows_resume_allows_a_legacy_row_with_null_graph_hash() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2194,7 +2348,8 @@ async fn flows_resume_allows_a_legacy_row_with_null_graph_hash() {store::update_flow_graph(&config,&created.value.id,- created.value.name.clone(), None,+ created.value.name.clone(),+ None,structurally_valid_graph(rewritten),created.value.require_approval,None, // enabled_override@@ -2280,9 +2435,15 @@ fn graph_hash_is_stable_across_serialization_key_order() {async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,&created.value.id,@@ -2303,7 +2464,8 @@ async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {store::update_flow_graph(&config,&created.value.id,- created.value.name.clone(), None,+ created.value.name.clone(),+ None,legacy_graph.clone(),created.value.require_approval,None,@@ -2360,9 +2522,15 @@ async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failed() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,&created.value.id,@@ -2377,7 +2545,8 @@ async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failedserde_json::from_value(run.value["pending_approvals"].clone()).unwrap();let child = store::create_flow(&config,- "legacy unsafe child".to_string(), String::new(),+ "legacy unsafe child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -2387,7 +2556,8 @@ async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failedstore::update_flow_graph(&config,&created.value.id,- created.value.name.clone(), None,+ created.value.name.clone(),+ None,legacy_graph.clone(),created.value.require_approval,None,@@ -2458,9 +2628,15 @@ async fn flows_resume_missing_flow_errors() {async fn flows_resume_with_empty_approvals_is_rejected_and_does_not_complete_the_run() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2498,9 +2674,15 @@ async fn flows_resume_with_empty_approvals_is_rejected_and_does_not_complete_theasync fn flows_resume_with_mismatched_approvals_is_rejected() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2530,9 +2712,15 @@ async fn flows_resume_with_mismatched_approvals_is_rejected() {async fn flows_resume_with_the_correct_gate_completes_and_runs_downstream() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2591,7 +2779,8 @@ async fn flows_resume_denying_a_gate_routes_to_its_error_port() {let config = test_config(&tmp);let created = flows_create(&config,- "gated-deny".to_string(), String::new(),+ "gated-deny".to_string(),+ String::new(),approval_gated_graph_with_error_port(),false,)@@ -2645,9 +2834,15 @@ async fn flows_resume_denying_a_gate_with_no_error_port_fails_the_run() {let config = test_config(&tmp);// `approval_gated_graph()` has only a `main` edge out of the gate — no// `error` port to route a denial to, so the whole run must fail.- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2684,9 +2879,15 @@ async fn flows_resume_denying_a_gate_with_no_error_port_fails_the_run() {async fn flows_resume_rejects_a_gate_named_in_both_approvals_and_rejections() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2719,9 +2920,15 @@ async fn flows_resume_rejects_a_gate_named_in_both_approvals_and_rejections() {async fn flows_resume_of_a_non_paused_run_errors_clearly() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();// This run completes outright (no approval gate) — its recorded status// is "completed", not "pending_approval".@@ -2749,9 +2956,15 @@ async fn flows_resume_of_a_non_paused_run_errors_clearly() {async fn flows_resume_with_no_recorded_run_for_thread_id_errors_clearly() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let err = flows_resume(&config,@@ -2771,9 +2984,15 @@ async fn flows_resume_with_no_recorded_run_for_thread_id_errors_clearly() {async fn flows_run_persists_a_flow_run_row_queryable_via_list_and_get() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -2807,12 +3026,24 @@ async fn flows_list_all_runs_aggregates_across_flows_newest_first() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let a = flows_create(&config, "alpha".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();- let b = flows_create(&config, "beta".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let a = flows_create(+ &config,+ "alpha".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();+ let b = flows_create(+ &config,+ "beta".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();// Run alpha first, then beta — beta's run is the newest.flows_run(@@ -2866,7 +3097,8 @@ async fn flows_run_emits_pending_approval_notification() {let created = flows_create(&config,- "gated-notify".to_string(), String::new(),+ "gated-notify".to_string(),+ String::new(),approval_gated_graph(),false,)@@ -2927,9 +3159,15 @@ async fn flows_run_does_not_notify_when_run_completes_without_pending_approvals(let config = test_config(&tmp);let mut rx = crate::openhuman::desktop::notifications::bus::subscribe_core_notifications();- let created = flows_create(&config, "no-gate".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "no-gate".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let created_id = created.value.id.clone();flows_run(@@ -3007,7 +3245,8 @@ async fn flows_run_publishes_flow_run_started_with_flow_and_run_id() {let config = test_config(&tmp);let created = flows_create(&config,- "b35-run-started".to_string(), String::new(),+ "b35-run-started".to_string(),+ String::new(),trigger_only_graph(),false,)@@ -3100,7 +3339,8 @@ async fn flows_run_finished_event_skips_pending_approval_and_fires_once_on_resumlet config = test_config(&tmp);let created = flows_create(&config,- "b35-finished-skips-pause".to_string(), String::new(),+ "b35-finished-skips-pause".to_string(),+ String::new(),approval_gated_graph(),false,)@@ -3192,9 +3432,15 @@ async fn observer_persists_each_step_incrementally() {// `start_flow_run_row`), so seed a flow + a running run row first.let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "obs".to_string(), String::new(), passthrough_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "obs".to_string(),+ String::new(),+ passthrough_graph(),+ false,+ )+ .await+ .unwrap();let run_id = format!("flow:{}:run-under-test", created.value.id);store::insert_flow_run(&config,@@ -3263,7 +3509,8 @@ async fn flows_run_persists_live_steps_with_status_and_timing() {let config = test_config(&tmp);let created = flows_create(&config,- "passthrough".to_string(), String::new(),+ "passthrough".to_string(),+ String::new(),passthrough_graph(),false,)@@ -3318,9 +3565,15 @@ async fn flows_run_persists_live_steps_with_status_and_timing() {async fn flows_cancel_run_cancels_a_parked_pending_approval_run() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();// Run pauses at the gate → a durable `pending_approval` row with no live// task (the run future already returned): the not-in-flight cancel path.@@ -3377,9 +3630,15 @@ async fn flows_cancel_run_cancels_a_parked_pending_approval_run() {async fn flows_cancel_run_of_an_already_completed_run_errors() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -3407,9 +3666,15 @@ async fn flows_cancel_run_of_a_completed_with_warnings_run_errors() {// the run already recorded.let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -3448,9 +3713,15 @@ async fn flows_cancel_run_of_an_interrupted_run_errors() {// discarding the interruption reason it already carries.let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();let run = flows_run(&config,@@ -3505,9 +3776,15 @@ async fn flows_cancel_run_missing_run_errors() {async fn parked_run_ttl_sweep_expires_stale_runs_but_spares_fresh_ones() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "gated".to_string(), String::new(), approval_gated_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "gated".to_string(),+ String::new(),+ approval_gated_graph(),+ false,+ )+ .await+ .unwrap();// Seed a parked run whose "parked since" (finished_at) is far in the past,// so it is well beyond the TTL.@@ -3710,7 +3987,8 @@ async fn flows_set_enabled_surfaces_unfired_trigger_warning_at_enable() {let created = flows_create(&config,- "hooked".to_string(), String::new(),+ "hooked".to_string(),+ String::new(),webhook_trigger_graph(),false,)@@ -3741,7 +4019,8 @@ async fn flows_set_enabled_schedule_flow_has_no_warning() {let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("0 9 * * *"),false,)@@ -4724,9 +5003,15 @@ async fn flows_run_fails_cleanly_without_invoking_engine_when_inference_not_read],"edges": [ { "from_node": "t", "to_node": "a" } ]});- let created = flows_create(&config, "needs-a-provider".to_string(), String::new(), g, false)- .await- .expect("creating (authoring) an agent-node flow must succeed even when signed out");+ let created = flows_create(+ &config,+ "needs-a-provider".to_string(),+ String::new(),+ g,+ false,+ )+ .await+ .expect("creating (authoring) an agent-node flow must succeed even when signed out");let err = flows_run(&config,@@ -6811,9 +7096,15 @@ async fn flows_create_rejects_condition_edges_with_branch_label_on_to_port() {let config = test_config(&tmp);let bad_graph = condition_graph("main", "true", "main", "false");- let err = flows_create(&config, "bad-condition".to_string(), String::new(), bad_graph, false)- .await- .expect_err("flows_create must reject a condition graph routed on to_port");+ let err = flows_create(+ &config,+ "bad-condition".to_string(),+ String::new(),+ bad_graph,+ false,+ )+ .await+ .expect_err("flows_create must reject a condition graph routed on to_port");assert!(err.contains("condition") && err.contains("from_port"),"expected an InvalidConditionRouting-style error, got: {err}"@@ -6930,7 +7221,8 @@ async fn flows_create_schedule_trigger_creates_disabled() {let created = flows_create(&config,- "scheduled".to_string(), String::new(),+ "scheduled".to_string(),+ String::new(),schedule_trigger_graph("30 7 * * 1-5"),false,)@@ -6964,7 +7256,8 @@ async fn flows_create_app_event_trigger_creates_disabled() {let created = flows_create(&config,- "app-event".to_string(), String::new(),+ "app-event".to_string(),+ String::new(),app_event_trigger_graph(),false,)@@ -6982,9 +7275,15 @@ async fn flows_create_manual_trigger_creates_enabled() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "manual".to_string(), String::new(), manual_trigger_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "manual".to_string(),+ String::new(),+ manual_trigger_graph(),+ false,+ )+ .await+ .unwrap();assert!(created.value.enabled,@@ -6997,9 +7296,15 @@ async fn flows_create_no_trigger_kind_creates_enabled() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "legacy".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "legacy".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();assert!(created.value.enabled,@@ -7013,9 +7318,15 @@ async fn flows_create_outbound_node_forces_require_approval() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "tool-flow".to_string(), String::new(), tool_call_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "tool-flow".to_string(),+ String::new(),+ tool_call_graph(),+ false,+ )+ .await+ .unwrap();assert!(created.value.require_approval,@@ -7039,7 +7350,8 @@ async fn flows_create_outbound_http_forces_require_approval() {let created = flows_create(&config,- "http-flow".to_string(), String::new(),+ "http-flow".to_string(),+ String::new(),http_request_graph(),false,)@@ -7057,9 +7369,15 @@ async fn flows_create_outbound_code_forces_require_approval() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "code-flow".to_string(), String::new(), code_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "code-flow".to_string(),+ String::new(),+ code_graph(),+ false,+ )+ .await+ .unwrap();assert!(created.value.require_approval,@@ -7074,7 +7392,8 @@ async fn flows_create_readonly_graph_respects_caller_require_approval() {let created = flows_create(&config,- "readonly-flow".to_string(), String::new(),+ "readonly-flow".to_string(),+ String::new(),readonly_graph(),false,)@@ -7115,9 +7434,15 @@ async fn flows_create_schedule_outbound_creates_disabled_and_approval() {"edges": [ { "from_node": "t", "to_node": "post" } ]});- let created = flows_create(&config, "scheduled-slack".to_string(), String::new(), graph, false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "scheduled-slack".to_string(),+ String::new(),+ graph,+ false,+ )+ .await+ .unwrap();assert!(!created.value.enabled,@@ -7139,9 +7464,15 @@ async fn flows_update_forces_require_approval_when_adding_side_effect_nodes() {// re-checked.let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();assert!(!created.value.require_approval,"a trigger-only graph must not force require_approval on create"@@ -7150,7 +7481,8 @@ async fn flows_update_forces_require_approval_when_adding_side_effect_nodes() {let updated = flows_update(&config,&created.value.id,- None, None,+ None,+ None,Some(tool_call_graph()),Some(false),None,@@ -7177,16 +7509,23 @@ async fn flows_update_forces_require_approval_when_adding_side_effect_nodes() {async fn flows_update_does_not_force_require_approval_on_readonly_graph() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let created = flows_create(&config, "demo".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap();+ let created = flows_create(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap();assert!(!created.value.require_approval);// Name-only update — no graph change, no side-effect nodes.let updated = flows_update(&config,&created.value.id,- Some("renamed".to_string()), None,+ Some("renamed".to_string()),+ None,None,None,None,@@ -7272,7 +7611,8 @@ async fn strict_gate_rejects_an_incompatible_saved_child_reference() {let config = test_config(&tmp);let child = store::create_flow(&config,- "legacy unsafe child".to_string(), String::new(),+ "legacy unsafe child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -7296,7 +7636,8 @@ async fn builder_proposal_rejects_an_incompatible_saved_child_reference() {let config = test_config(&tmp);let child = store::create_flow(&config,- "legacy unsafe child".to_string(), String::new(),+ "legacy unsafe child".to_string(),+ String::new(),structurally_valid_graph(nested_conditional_fan_in_graph()),false,false,@@ -7331,7 +7672,8 @@ fn referenced_child_compatibility_stops_at_saved_workflow_cycles() {let config = test_config(&tmp);let flow_a = store::create_flow(&config,- "cycle a".to_string(), String::new(),+ "cycle a".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,false,@@ -7339,7 +7681,8 @@ fn referenced_child_compatibility_stops_at_saved_workflow_cycles() {.unwrap();let flow_b = store::create_flow(&config,- "cycle b".to_string(), String::new(),+ "cycle b".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,false,@@ -7348,7 +7691,8 @@ fn referenced_child_compatibility_stops_at_saved_workflow_cycles() {store::update_flow_graph(&config,&flow_a.id,- flow_a.name.clone(), None,+ flow_a.name.clone(),+ None,structurally_valid_graph(referenced_child_graph(&flow_b.id)),false,None,@@ -7359,7 +7703,8 @@ fn referenced_child_compatibility_stops_at_saved_workflow_cycles() {store::update_flow_graph(&config,&flow_b.id,- flow_b.name.clone(), None,+ flow_b.name.clone(),+ None,structurally_valid_graph(referenced_child_graph(&flow_a.id)),false,None,@@ -7407,10 +7752,16 @@ async fn draft_promote_with_flow_id_updates_the_existing_flow() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = flows_create(&config, "Original".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap()- .value;+ let flow = flows_create(+ &config,+ "Original".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap()+ .value;let draft = flows_draft_create(&config,@@ -7460,16 +7811,23 @@ async fn draft_promote_of_invalid_graph_is_rejected_and_keeps_the_draft() {async fn flows_update_rejects_a_stale_expected_version() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = flows_create(&config, "V".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap()- .value;+ let flow = flows_create(+ &config,+ "V".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap()+ .value;// A correct expected_version succeeds.let ok = flows_update(&config,&flow.id,- Some("renamed".to_string()), None,+ Some("renamed".to_string()),+ None,None,None,Some(flow.updated_at.clone()),@@ -7482,7 +7840,8 @@ async fn flows_update_rejects_a_stale_expected_version() {let err = flows_update(&config,&flow.id,- Some("again".to_string()), None,+ Some("again".to_string()),+ None,None,None,Some(flow.updated_at.clone()),@@ -7500,10 +7859,16 @@ async fn flows_update_rejects_a_stale_expected_version() {async fn update_records_revisions_and_rollback_restores() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = flows_create(&config, "Orig".to_string(), String::new(), trigger_only_graph(), false)- .await- .unwrap()- .value;+ let flow = flows_create(+ &config,+ "Orig".to_string(),+ String::new(),+ trigger_only_graph(),+ false,+ )+ .await+ .unwrap()+ .value;// Update the graph → the prior graph is snapshotted as a revision.let two_node = json!({@@ -8005,7 +8370,8 @@ fn seed_running_run(tmp: &TempDir) -> (Config, String, String) {let config = test_config(tmp);let flow = store::create_flow(&config,- "reliability".to_string(), String::new(),+ "reliability".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8163,7 +8529,8 @@ async fn flows_run_detached_returns_running_run_id_and_inserts_row() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "detached".to_string(), String::new(),+ "detached".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8205,7 +8572,8 @@ async fn flows_run_detached_registers_the_run_before_returning_its_id() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "detached-cancel-race".to_string(), String::new(),+ "detached-cancel-race".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8401,7 +8769,8 @@ async fn finish_flow_run_refuses_to_overwrite_an_already_terminal_row() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "guarded-finish".to_string(), String::new(),+ "guarded-finish".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8451,7 +8820,8 @@ async fn cancel_does_not_relabel_a_run_that_settled_concurrently() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "cancel-toctou".to_string(), String::new(),+ "cancel-toctou".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8486,7 +8856,8 @@ async fn mark_run_resuming_claims_only_a_parked_row() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "resume-claim".to_string(), String::new(),+ "resume-claim".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8535,7 +8906,8 @@ async fn ttl_sweep_cannot_expire_a_run_a_resume_has_claimed() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "resume-vs-ttl".to_string(), String::new(),+ "resume-vs-ttl".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8580,7 +8952,8 @@ async fn ttl_sweep_still_expires_an_unclaimed_parked_run() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "ttl-still-works".to_string(), String::new(),+ "ttl-still-works".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,@@ -8654,7 +9027,8 @@ async fn stale_approval_refusal_does_not_settle_a_run_another_resume_claimed() {let config = test_config(&tmp);let flow = store::create_flow(&config,- "refusal-vs-winner".to_string(), String::new(),+ "refusal-vs-winner".to_string(),+ String::new(),structurally_valid_graph(trigger_only_graph()),false,true,diff --git a/src/openhuman/flows/store_tests.rs b/src/openhuman/flows/store_tests.rsindex 4792fa8057..d3bcf728b3 100644--- a/src/openhuman/flows/store_tests.rs+++ b/src/openhuman/flows/store_tests.rs@@ -52,7 +52,15 @@ fn create_get_list_delete_roundtrip() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert_eq!(flow.name, "demo");assert!(flow.enabled);@@ -89,7 +97,15 @@ fn remove_flow_errors_when_not_found() {fn set_enabled_toggles_and_persists() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert!(flow.enabled);let disabled = set_enabled(&config, &flow.id, false).unwrap();@@ -106,14 +122,23 @@ fn set_enabled_toggles_and_persists() {fn update_flow_graph_bumps_updated_at_and_preserves_created_at() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let mut new_graph = trigger_graph();new_graph.name = "renamed-graph".to_string();let updated = update_flow_graph(&config,&flow.id,- "renamed".to_string(), None,+ "renamed".to_string(),+ None,new_graph,false,None,@@ -135,13 +160,22 @@ fn update_flow_graph_bumps_updated_at_and_preserves_created_at() {fn update_flow_graph_with_none_override_preserves_current_enabled_column() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert!(flow.enabled, "flow created enabled");let updated = update_flow_graph(&config,&flow.id,- flow.name.clone(), None,+ flow.name.clone(),+ None,trigger_graph(),false,None, // enabled_override@@ -166,13 +200,22 @@ fn update_flow_graph_with_none_override_preserves_current_enabled_column() {fn update_flow_graph_with_some_false_override_forces_disabled() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert!(flow.enabled, "flow created enabled");let updated = update_flow_graph(&config,&flow.id,- flow.name.clone(), None,+ flow.name.clone(),+ None,trigger_graph(),false,Some(false), // enabled_override@@ -205,7 +248,15 @@ fn update_flow_graph_with_some_false_override_forces_disabled() {fn update_flow_graph_override_wins_over_concurrently_enabled_row() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, false).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ false,+ )+ .unwrap();assert!(!flow.enabled, "flow created disabled");// Simulates a concurrent `flows_set_enabled(id, true)` racing in after@@ -217,7 +268,8 @@ fn update_flow_graph_override_wins_over_concurrently_enabled_row() {let updated = update_flow_graph(&config,&flow.id,- flow.name.clone(), None,+ flow.name.clone(),+ None,trigger_graph(),false,Some(false), // the unconditional disarm override@@ -252,13 +304,22 @@ fn update_flow_graph_disarms_transition_from_the_fresh_row_even_when_override_as{let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert!(flow.enabled, "flow created enabled");let updated = update_flow_graph(&config,&flow.id,- flow.name.clone(), None,+ flow.name.clone(),+ None,automatic_schedule_graph(),false,Some(true), // caller explicitly asks to stay enabled@@ -289,7 +350,8 @@ fn update_flow_graph_does_not_disarm_an_automatic_to_automatic_update() {let config = test_config(&tmp);let flow = create_flow(&config,- "demo".to_string(), String::new(),+ "demo".to_string(),+ String::new(),automatic_schedule_graph(),false,false,@@ -302,7 +364,8 @@ fn update_flow_graph_does_not_disarm_an_automatic_to_automatic_update() {let updated = update_flow_graph(&config,&flow.id,- flow.name.clone(), None,+ flow.name.clone(),+ None,automatic_schedule_graph(),false,None, // no explicit override — preserve current.enabled@@ -321,7 +384,15 @@ fn update_flow_graph_does_not_disarm_an_automatic_to_automatic_update() {fn record_run_sets_last_run_fields() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert!(flow.last_run_at.is_none());record_run(&config, &flow.id, "completed").unwrap();@@ -394,7 +465,15 @@ fn create_flow_persists_require_approval() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), true, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ true,+ true,+ )+ .unwrap();assert!(flow.require_approval);let reloaded = get_flow(&config, &flow.id).unwrap().unwrap();@@ -405,13 +484,22 @@ fn create_flow_persists_require_approval() {fn update_flow_graph_can_change_require_approval() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert!(!flow.require_approval);let updated = update_flow_graph(&config,&flow.id,- flow.name.clone(), None,+ flow.name.clone(),+ None,trigger_graph(),true,None,@@ -458,11 +546,19 @@ fn list_enabled_flows_excludes_disabled() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let enabled_flow =- create_flow(&config, "enabled".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let enabled_flow = create_flow(+ &config,+ "enabled".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let disabled_flow = create_flow(&config,- "disabled".to_string(), String::new(),+ "disabled".to_string(),+ String::new(),trigger_graph(),false,true,@@ -482,7 +578,15 @@ fn list_enabled_flows_excludes_disabled() {fn flow_run_insert_finish_get_round_trip() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let thread_id = format!("flow:{}:run-1", flow.id);insert_flow_run(@@ -537,7 +641,15 @@ fn flow_run_insert_finish_get_round_trip() {fn finish_flow_run_records_error_on_failure() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let thread_id = format!("flow:{}:run-2", flow.id);insert_flow_run(&config,@@ -576,8 +688,24 @@ fn get_flow_run_returns_none_for_unknown_id() {fn list_flow_runs_orders_newest_first_and_is_scoped_to_flow() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow_a = create_flow(&config, "a".to_string(), String::new(), trigger_graph(), false, true).unwrap();- let flow_b = create_flow(&config, "b".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow_a = create_flow(+ &config,+ "a".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();+ let flow_b = create_flow(+ &config,+ "b".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();insert_flow_run(&config,@@ -624,7 +752,15 @@ fn insert_duplicate_flow_makes_a_disabled_copy_with_new_id_and_same_graph() {// Enabled source with require_approval + a distinctive graph name.let mut graph = trigger_graph();graph.name = "original-graph".to_string();- let source = create_flow(&config, "My Flow".to_string(), String::new(), graph, true, true).unwrap();+ let source = create_flow(+ &config,+ "My Flow".to_string(),+ String::new(),+ graph,+ true,+ true,+ )+ .unwrap();assert!(source.enabled);record_run(&config, &source.id, "completed").unwrap();let source = get_flow(&config, &source.id).unwrap().unwrap();@@ -677,7 +813,15 @@ fn seed_run(config: &Config, flow_id: &str, id: &str, day: u32, status: &str) {fn prune_flow_runs_keeps_newest_n_terminal_runs() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();// 5 completed runs on ascending days.for i in 1..=5 {@@ -696,7 +840,15 @@ fn prune_flow_runs_keeps_newest_n_terminal_runs() {fn prune_flow_runs_never_removes_pending_approval_run() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();// An OLD parked pending_approval run (day 1) plus newer completed runs.seed_run(&config, &flow.id, "parked", 1, "pending_approval");@@ -722,7 +874,15 @@ fn prune_flow_runs_never_removes_pending_approval_run() {fn prune_flow_runs_leaves_running_rows_alone() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();seed_run(&config, &flow.id, "live", 1, "running");for i in 2..=4 {@@ -739,7 +899,15 @@ fn prune_flow_runs_leaves_running_rows_alone() {fn insert_flow_run_auto_prunes_beyond_retention_cap() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();// Seed exactly MAX_FLOW_RUNS_PER_FLOW completed runs.let cap = MAX_FLOW_RUNS_PER_FLOW;@@ -784,7 +952,15 @@ fn insert_flow_run_auto_prunes_beyond_retention_cap() {fn list_flow_runs_respects_limit() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();for i in 0..3 {let id = format!("run-{i}");@@ -903,7 +1079,15 @@ fn upsert_suggestions_empty_is_noop() {fn list_running_run_ids_returns_only_running_rows() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();insert_flow_run(&config,@@ -957,7 +1141,15 @@ fn list_running_run_ids_returns_only_running_rows() {fn list_running_run_ids_excludes_rows_started_at_or_after_the_floor() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();insert_flow_run(&config,@@ -1001,7 +1193,15 @@ fn list_running_run_ids_excludes_rows_started_at_or_after_the_floor() {fn mark_run_interrupted_reconciles_a_running_row_with_reason() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();insert_flow_run(&config, "run-x", &flow.id, "run-x", "2026-01-01T00:00:00Z").unwrap();let flipped =@@ -1018,7 +1218,15 @@ fn mark_run_interrupted_reconciles_a_running_row_with_reason() {fn mark_run_interrupted_is_a_noop_for_a_terminal_row() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();insert_flow_run(&config, "run-y", &flow.id, "run-y", "2026-01-01T00:00:00Z").unwrap();finish_flow_run(&config,@@ -1060,7 +1268,15 @@ fn mark_run_interrupted_is_a_noop_for_a_terminal_row() {fn expire_parked_runs_returns_only_rows_it_actually_flipped() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "ttl".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "ttl".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let stale_at = "2000-01-01T00:00:00+00:00";for id in ["claimed-run", "genuinely-stale-run"] {@@ -1123,9 +1339,33 @@ fn list_flows_skips_a_corrupt_row_and_reports_the_count() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let good_a = create_flow(&config, "good-a".to_string(), String::new(), trigger_graph(), false, true).unwrap();- let bad = create_flow(&config, "bad".to_string(), String::new(), trigger_graph(), false, true).unwrap();- let good_b = create_flow(&config, "good-b".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let good_a = create_flow(+ &config,+ "good-a".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();+ let bad = create_flow(+ &config,+ "bad".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();+ let good_b = create_flow(+ &config,+ "good-b".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();force_corrupt_graph_json_for_test(&config, &bad.id, "{ not even valid json").unwrap();let (flows, skipped) = list_flows(&config).unwrap();@@ -1152,9 +1392,24 @@ fn list_flows_skips_a_row_whose_schema_version_is_newer_than_this_build_supportslet tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let good = create_flow(&config, "good".to_string(), String::new(), trigger_graph(), false, true).unwrap();- let too_new =- create_flow(&config, "too-new".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let good = create_flow(+ &config,+ "good".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();+ let too_new = create_flow(+ &config,+ "too-new".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let newer_schema_json = serde_json::json!({"schema_version": 999,"name": "from-the-future",@@ -1178,8 +1433,24 @@ fn list_enabled_flows_still_returns_the_good_rows_when_one_is_corrupt() {let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let good = create_flow(&config, "good".to_string(), String::new(), trigger_graph(), false, true).unwrap();- let bad = create_flow(&config, "bad".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let good = create_flow(+ &config,+ "good".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();+ let bad = create_flow(+ &config,+ "bad".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();force_corrupt_graph_json_for_test(&config, &bad.id, "not json at all").unwrap();let (enabled, skipped) = list_enabled_flows(&config).unwrap();@@ -1197,10 +1468,19 @@ fn list_enabled_flows_excludes_a_corrupt_disabled_row_without_counting_it_as_skilet tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let good = create_flow(&config, "good".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let good = create_flow(+ &config,+ "good".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let disabled_and_corrupt = create_flow(&config,- "disabled-bad".to_string(), String::new(),+ "disabled-bad".to_string(),+ String::new(),trigger_graph(),false,true,@@ -1228,7 +1508,15 @@ fn concurrent_step_upserts_do_not_lose_a_step() {// `status: None`, not its real outcome.let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let run_id = "run-concurrent";insert_flow_run(&config, run_id, &flow.id, run_id, "2026-01-01T00:00:00Z").unwrap();@@ -1289,7 +1577,15 @@ fn concurrent_upserts_to_the_same_node_id_do_not_corrupt_the_step_list() {// serialization order), never a torn/duplicated list.let tmp = TempDir::new().unwrap();let config = test_config(&tmp);- let flow = create_flow(&config, "demo".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow = create_flow(+ &config,+ "demo".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let run_id = "run-same-node";insert_flow_run(&config, run_id, &flow.id, run_id, "2026-01-01T00:00:00Z").unwrap();@@ -1339,7 +1635,8 @@ fn schema_initializes_correctly_on_a_fresh_database_and_is_idempotent_across_cal// has never been opened before.let flow = create_flow(&config,- "fresh-db".to_string(), String::new(),+ "fresh-db".to_string(),+ String::new(),trigger_graph(),true, // require_approvaltrue,@@ -1374,11 +1671,27 @@ fn schema_initializes_independently_for_each_distinct_database_path() {// creation and every write against it would fail with "no such table".let tmp_a = TempDir::new().unwrap();let config_a = test_config(&tmp_a);- let flow_a = create_flow(&config_a, "a".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow_a = create_flow(+ &config_a,+ "a".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();let tmp_b = TempDir::new().unwrap();let config_b = test_config(&tmp_b);- let flow_b = create_flow(&config_b, "b".to_string(), String::new(), trigger_graph(), false, true).unwrap();+ let flow_b = create_flow(+ &config_b,+ "b".to_string(),+ String::new(),+ trigger_graph(),+ false,+ true,+ )+ .unwrap();assert_eq!(list_flows(&config_a).unwrap().0.len(), 1);assert_eq!(list_flows(&config_b).unwrap().0.len(), 1);@@ -1410,7 +1723,8 @@ fn schema_reinitializes_when_the_database_file_is_deleted_at_runtime() {// First use populates the per-path cache and creates the schema.let flow = create_flow(&config,- "before-deletion".to_string(), String::new(),+ "before-deletion".to_string(),+ String::new(),trigger_graph(),false,true,@@ -1443,7 +1757,8 @@ fn schema_reinitializes_when_the_database_file_is_deleted_at_runtime() {// And the store is fully usable again, not merely readable.let recreated = create_flow(&config,- "after-deletion".to_string(), String::new(),+ "after-deletion".to_string(),+ String::new(),trigger_graph(),false,true,diff --git a/src/openhuman/flows/tinyflows/caps/ops.rs b/src/openhuman/flows/tinyflows/caps/ops.rsindex 70113109b8..4a0e5bd4a6 100644--- a/src/openhuman/flows/tinyflows/caps/ops.rs+++ b/src/openhuman/flows/tinyflows/caps/ops.rs@@ -2077,9 +2077,15 @@ mod tests {let config = Arc::new(resolver_test_config(&tmp));let graph_json = serde_json::to_value(trigger_only_graph()).unwrap();- let flow = flows::ops::flows_create(&config, "child".to_string(), String::new(), graph_json, false)- .await- .expect("create flow");+ let flow = flows::ops::flows_create(+ &config,+ "child".to_string(),+ String::new(),+ graph_json,+ false,+ )+ .await+ .expect("create flow");let flow_id = flow.value.id.clone();let resolver = OpenHumanWorkflowResolver {@@ -2120,7 +2126,8 @@ mod tests {let config = Arc::new(resolver_test_config(&tmp));let flow = flows::ops::flows_create(&config,- "legacy child".to_string(), String::new(),+ "legacy child".to_string(),+ String::new(),serde_json::to_value(trigger_only_graph()).unwrap(),false,)diff --git a/src/openhuman/flows/tools_tests.rs b/src/openhuman/flows/tools_tests.rsindex 45cdf7f204..61372d1213 100644--- a/src/openhuman/flows/tools_tests.rs+++ b/src/openhuman/flows/tools_tests.rs@@ -455,7 +455,8 @@ async fn propose_workflow_rejects_an_incompatible_saved_child_reference() {.expect("legacy child should remain structurally valid");let child = crate::openhuman::flows::store::create_flow(&config,- "Legacy unsafe child".to_string(), String::new(),+ "Legacy unsafe child".to_string(),+ String::new(),child_graph,false,false,