Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(tests): migrate to tinyflows_bus types in tests

Steven Enamakelc302e63a727c
diff --git a/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs b/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs
index 184e098d4f..d723b7634f 100644
--- a/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_draft_id_tests.rs
@@ -22,7 +22,7 @@ async fn cancel_flow_run_cancels_when_flow_id_matches_the_owner() {
&flow.id,
json!({}),
serde_json::Map::new(),
- tinyflows_catalog::FlowRunTrigger::Rpc,
+ tinyflows_bus::runs::FlowRunTrigger::Rpc,
)
.await
.unwrap();
@@ -158,7 +158,7 @@ async fn validate_workflow_by_draft_id_checks_the_draft_graph() {
None,
"Draft".to_string(),
valid_graph(),
- tinyflows_catalog::DraftOrigin::Chat,
+ tinyflows_bus::catalog::DraftOrigin::Chat,
)
.unwrap()
.value;
@@ -182,7 +182,7 @@ async fn save_workflow_by_draft_id_persists_the_draft_graph_onto_the_flow() {
Some(flow_id.clone()),
"Draft".to_string(),
valid_graph(),
- tinyflows_catalog::DraftOrigin::Chat,
+ tinyflows_bus::catalog::DraftOrigin::Chat,
)
.unwrap()
.value;
diff --git a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
index 5b6fcc3073..86e936c74c 100644
--- a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
@@ -535,7 +535,7 @@ async fn cancel_flow_run_refuses_a_run_the_caller_does_not_own() {
&owner_flow.id,
json!({}),
serde_json::Map::new(),
- tinyflows_catalog::FlowRunTrigger::Rpc,
+ tinyflows_bus::runs::FlowRunTrigger::Rpc,
)
.await
.unwrap();
diff --git a/crates/openhuman-core/src/flows/bus/owner_tests.rs b/crates/openhuman-core/src/flows/bus/owner_tests.rs
index 512c484fca..7e8cbcd543 100644
--- a/crates/openhuman-core/src/flows/bus/owner_tests.rs
+++ b/crates/openhuman-core/src/flows/bus/owner_tests.rs
@@ -27,12 +27,12 @@ fn a_forgotten_owner_is_resolved_again() {
assert!(!OWNERS.lock().unwrap().contains_key("owner-test-flow"));
}
-fn local_flow(id: &str) -> tinyflows_catalog::Flow {
- tinyflows_catalog::Flow {
+fn local_flow(id: &str) -> tinyflows_bus::catalog::Workflow {
+ tinyflows_bus::catalog::Workflow {
id: id.to_string(),
name: id.to_string(),
enabled: true,
- graph: tinyflows::model::WorkflowGraph::default(),
+ graph: serde_json::json!({"nodes": [], "edges": []}),
created_at: "2026-01-01T00:00:00Z".to_string(),
updated_at: "2026-01-01T00:00:00Z".to_string(),
last_run_at: None,
diff --git a/crates/openhuman-core/src/flows/ops_tests.rs b/crates/openhuman-core/src/flows/ops_tests.rs
index 813088bd64..8eef2225f8 100644
--- a/crates/openhuman-core/src/flows/ops_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_tests.rs
@@ -73,12 +73,6 @@ fn referenced_child_graph(workflow_id: &str) -> Value {
})
}
-fn structurally_valid_graph(value: Value) -> WorkflowGraph {
- let graph = tinyflows::migrate::deserialize_graph(value).expect("graph should deserialize");
- tinyflows::validate::validate(&graph).expect("fixture should be structurally valid");
- graph
-}
-
#[tokio::test]
async fn flows_import_uses_the_tinyflows_authoring_module_in_a_cold_process() {
const CHILD_ENV: &str = "OPENHUMAN_FLOWS_IMPORT_AUTHORING_CHILD";
@@ -296,7 +290,7 @@ fn http_summary(name: &str, scheme: &str) -> HttpCredentialSummary {
// ── Flow Scout suggestion lifecycle ──────────────────────────────────────────
fn seed_suggestion(config: &Config, id: &str) {
- let s = tinyflows_catalog::FlowSuggestion {
+ let s = tinyflows_bus::catalog::FlowSuggestion {
id: id.to_string(),
title: format!("Idea {id}"),
one_liner: "does a thing".to_string(),
@@ -307,7 +301,7 @@ fn seed_suggestion(config: &Config, id: &str) {
suggested_slugs: vec![],
build_prompt: "Build a workflow…".to_string(),
confidence: 0.5,
- status: tinyflows_catalog::SuggestionStatus::New,
+ status: tinyflows_bus::catalog::SuggestionStatus::New,
created_at: "2026-07-05T00:00:00Z".to_string(),
source_run_id: None,
};
@@ -316,15 +310,6 @@ fn seed_suggestion(config: &Config, id: &str) {
// ── validate_binding_resolvability ──────────────────────────────────────────
-/// Runs a candidate graph `Value` through the exact same migrate/validate
-/// path the builder tools use, for a [`WorkflowGraph`] test fixture.
-fn graph(value: Value) -> WorkflowGraph {
- let graph = tinyflows::migrate::deserialize_graph(value).expect("test graph deserializes");
- tinyflows::validate::validate(&graph).expect("structurally valid test graph");
- tinyflows::compat::ensure_compatible(&graph).expect("engine-compatible test graph");
- graph
-}
-
// ── validate_inference_readiness (provider-connectivity author gate, B45) ──
//
// An `agent` node needs a working LLM inference provider the same way a
@@ -431,8 +416,8 @@ fn seeded_slack_send_message_contract_with_schema() -> ToolContract {
// degrade_completed_status (PR2 — run honesty)
// ─────────────────────────────────────────────────────────────────────────────
-fn clean_step(node_id: &str) -> tinyflows_catalog::FlowRunStep {
- tinyflows_catalog::FlowRunStep {
+fn clean_step(node_id: &str) -> tinyflows_bus::catalog::FlowRunStep {
+ tinyflows_bus::catalog::FlowRunStep {
node_id: node_id.to_string(),
output: Value::Null,
port: None,
diff --git a/crates/openhuman-core/src/flows/runs_adapter/session_tests.rs b/crates/openhuman-core/src/flows/runs_adapter/session_tests.rs
index 126184b192..472793e800 100644
--- a/crates/openhuman-core/src/flows/runs_adapter/session_tests.rs
+++ b/crates/openhuman-core/src/flows/runs_adapter/session_tests.rs
@@ -60,7 +60,7 @@ async fn private_agent_progress_advances_cursor_without_leaking_text_or_replayin
id: format!("projection:{}", uuid::Uuid::new_v4()),
name: "Projection test".into(),
enabled: true,
- graph: tinyflows::model::WorkflowGraph::default(),
+ graph: serde_json::json!({"nodes": [], "edges": []}),
created_at: "2026-01-01T00:00:00Z".into(),
updated_at: "2026-01-01T00:00:00Z".into(),
last_run_at: None,
diff --git a/crates/openhuman-core/src/flows/store_tests.rs b/crates/openhuman-core/src/flows/store_tests.rs
index 492363a6ef..2e6e3eef21 100644
--- a/crates/openhuman-core/src/flows/store_tests.rs
+++ b/crates/openhuman-core/src/flows/store_tests.rs
@@ -9,19 +9,20 @@ fn config(tmp: &TempDir) -> Config {
}
}
-fn graph() -> tinyflows::model::WorkflowGraph {
- tinyflows::migrate::deserialize_graph(json!({
+fn graph() -> serde_json::Value {
+ json!({
"nodes": [{"id":"trigger","name":"Trigger","kind":"trigger","config":{"trigger_kind":"manual"}}],
"edges": []
- }))
- .unwrap()
+ })
}
#[test]
fn catalog_clients_preserve_definition_revisions_and_suggestion_semantics() {
let tmp = TempDir::new().unwrap();
let config = config(&tmp);
- let flow = create_flow(&config, "before".into(), graph(), false, true).unwrap();
+ let flow = create_flow(&config, "before".into(), graph(), false)
+ .unwrap()
+ .workflow;
assert_eq!(get_flow(&config, &flow.id).unwrap().unwrap().name, "before");
let (listed, skipped) = list_flows(&config).unwrap();
assert_eq!(skipped, 0);
@@ -38,7 +39,8 @@ fn catalog_clients_preserve_definition_revisions_and_suggestion_semantics() {
false,
Some(&flow.updated_at),
)
- .unwrap();
+ .unwrap()
+ .workflow;
assert_eq!(updated.name, "after");
assert_eq!(list_revisions(&config, &flow.id, 10).unwrap().len(), 1);
assert!(matches!(