Skip to content

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

chore: files changed crates/openhuman-core/src/flows/authoring_host_tests.rs,crates/openhuman-core/s

Steven Enamakel2ebfce3d099a
diff --git a/crates/openhuman-core/src/flows/authoring_host_tests.rs b/crates/openhuman-core/src/flows/authoring_host_tests.rs
index 67190c0ee4..21d42ff842 100644
--- a/crates/openhuman-core/src/flows/authoring_host_tests.rs
+++ b/crates/openhuman-core/src/flows/authoring_host_tests.rs
@@ -29,6 +29,7 @@ fn nested_conditional_fan_in() -> Value {
#[tokio::test]
async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {
use crate::core::runtime::{ContextOverlay, CoreContext, DispatchCtx, DomainSet};
+ use crate::integrations::composio::catalog::{seed_live_catalog_cache, ToolContract};
use crate::tools::toolpacks::ToolGroups;
let tmp = tempfile::tempdir().expect("temporary workspace");
@@ -88,6 +89,84 @@ async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {
let proxy = crate::modules::tinyflows::authoring_proxy(&config)
.await
.unwrap();
+
+ // Exercise the released native WiringWarnings operation with two actual
+ // OpenHuman LookupToolContract callbacks. Each call runs while the other
+ // profile is ambient; its supplied host address must retain its captured
+ // callback context.
+ for (toolkit, slug, output_field) in [
+ ("authoringalice", "AUTHORINGALICE_ACTION", "alice_field"),
+ ("authoringbob", "AUTHORINGBOB_ACTION", "bob_field"),
+ ] {
+ seed_live_catalog_cache(
+ toolkit,
+ vec![ToolContract {
+ slug: slug.into(),
+ toolkit: toolkit.into(),
+ description: None,
+ required_args: vec![],
+ input_schema: None,
+ output_fields: vec![output_field.into()],
+ output_schema: None,
+ primary_array_path: None,
+ is_curated: true,
+ }],
+ );
+ }
+ let alice_warnings_request = tinyflows_bus::WiringWarningsRequest {
+ graph: json!({
+ "nodes": [
+ {"id":"source","kind":"tool_call","name":"Alice action","config":{"slug":"AUTHORINGALICE_ACTION"}},
+ {"id":"sink","kind":"transform","name":"Sink","config":{"set":{"value":"=nodes.source.item.json.data.unknown"}}}
+ ],
+ "edges": [{"from_node":"source","to_node":"sink"}]
+ }),
+ host: alice_registration.authoring.clone(),
+ };
+ let bob_warnings_request = tinyflows_bus::WiringWarningsRequest {
+ graph: json!({
+ "nodes": [
+ {"id":"source","kind":"tool_call","name":"Bob action","config":{"slug":"AUTHORINGBOB_ACTION"}},
+ {"id":"sink","kind":"transform","name":"Sink","config":{"set":{"value":"=nodes.source.item.json.data.unknown"}}}
+ ],
+ "edges": [{"from_node":"source","to_node":"sink"}]
+ }),
+ host: bob_registration.authoring.clone(),
+ };
+ let (alice_warnings, bob_warnings) = tokio::join!(
+ CoreContext::scope(Arc::clone(&bob), async {
+ proxy
+ .call::<Vec<String>>(
+ tinyflows_bus::methods::WIRING_WARNINGS,
+ &(alice_warnings_request,),
+ )
+ .await
+ .unwrap()
+ }),
+ CoreContext::scope(Arc::clone(&alice), async {
+ proxy
+ .call::<Vec<String>>(
+ tinyflows_bus::methods::WIRING_WARNINGS,
+ &(bob_warnings_request,),
+ )
+ .await
+ .unwrap()
+ })
+ );
+ assert!(
+ alice_warnings
+ .iter()
+ .any(|warning| warning.contains("AUTHORINGALICE_ACTION")
+ && warning.contains("alice_field")),
+ "native WiringWarnings should use Alice's registered contract callback: {alice_warnings:?}"
+ );
+ assert!(
+ bob_warnings
+ .iter()
+ .any(|warning| warning.contains("AUTHORINGBOB_ACTION") && warning.contains("bob_field")),
+ "native WiringWarnings should use Bob's registered contract callback: {bob_warnings:?}"
+ );
+
let candidate = json!({
"nodes": [
{"id":"start","kind":"trigger","name":"Start"},
diff --git a/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs b/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs
index e94b524acf..eaf65bfdae 100644
--- a/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_save_and_edit_tests.rs
@@ -153,13 +153,9 @@ async fn dry_run_no_routing_divergence_warning_when_every_node_executes() {
);
}
-/// (systemic tool-contract fix, Part 2b) A missing required Composio arg is
-/// now a HARD REJECT at `revise_workflow` — `validate_tool_contracts` runs
-/// ahead of the older advisory `graph_wiring_warnings` check and catches the
-/// exact same condition first, so the graph never gets far enough to merely
-/// warn about it. `graph_wiring_warnings`'s own required-arg warning (still
-/// exercised directly in `ops_tests.rs`) stays as a defense-in-depth
-/// fallback for any caller that doesn't also run `validate_tool_contracts`.
+/// A missing required Composio arg is a HARD REJECT at `revise_workflow` via
+/// `validate_tool_contracts`; TinyFlows wiring warnings cover output bindings
+/// and split paths, not required input arguments.
#[tokio::test]
async fn revise_workflow_rejects_a_missing_required_composio_arg() {
seed_live_catalog_cache("gmail", vec![seeded_gmail_send_contract()]);
diff --git a/crates/openhuman-core/src/flows/host_gates/tool_contracts.rs b/crates/openhuman-core/src/flows/host_gates/tool_contracts.rs
index e8bf1a4d37..81a1b4575e 100644
--- a/crates/openhuman-core/src/flows/host_gates/tool_contracts.rs
+++ b/crates/openhuman-core/src/flows/host_gates/tool_contracts.rs
@@ -32,10 +32,9 @@ use tinyflows::model::{NodeKind, WorkflowGraph};
/// live-catalog fetch itself fails (no backend session, network error) the
/// node is SKIPPED with a debug log — never rejected — because a
/// hallucinated slug can only be confirmed hallucinated once the real
-/// catalog was actually reachable; `graph_wiring_warnings`'s
-/// `composio_required_args` checks share this exact contract. Once the
-/// catalog IS reachable, though, both checks below are HARD: an unreal slug
-/// or a missing required arg rejects the graph outright, unlike the
+/// catalog was actually reachable. Once the catalog IS reachable, both
+/// checks below are HARD: an unreal slug or a missing required arg rejects
+/// the graph outright, unlike the
/// advisory output-field/`split_out.path` WARNs in `graph_wiring_warnings`
/// (Part 2c/2d) — those degrade gracefully because a binding to an unknown
/// field can't be proven wrong, whereas a nonexistent slug or a missing
diff --git a/crates/openhuman-core/src/flows/ops/builder_gates.rs b/crates/openhuman-core/src/flows/ops/builder_gates.rs
index b73368d4e3..d20f60a63e 100644
--- a/crates/openhuman-core/src/flows/ops/builder_gates.rs
+++ b/crates/openhuman-core/src/flows/ops/builder_gates.rs
@@ -148,7 +148,9 @@ pub(crate) async fn build_builder_proposal(
let mut warnings = graph_trigger_warnings(graph);
match graph_wiring_warnings(ctx, config, graph).await {
Ok(wiring_warnings) => warnings.extend(wiring_warnings),
- Err(error) => tracing::warn!(target: "flows", %error, "[flows] TinyFlows wiring warnings failed"),
+ Err(error) => {
+ tracing::warn!(target: "flows", %error, "[flows] TinyFlows wiring warnings failed")
+ }
}
// Connector onboarding (Phase 5, item 18): tell the proposal card which
// toolkits this graph needs and whether they're connected, so it can render
diff --git a/crates/openhuman-core/src/flows/ops/wiring_warnings.rs b/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
index 9f45d3afd0..1ff977d672 100644
--- a/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
+++ b/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
@@ -10,7 +10,11 @@ pub(crate) async fn graph_wiring_warnings(
) -> Result<Vec<String>, String> {
let graph = match serde_json::to_value(graph) {
Ok(graph) => graph,
- Err(error) => return Err(format!("wiring warnings could not serialize graph: {error}")),
+ Err(error) => {
+ return Err(format!(
+ "wiring warnings could not serialize graph: {error}"
+ ))
+ }
};
wiring_warnings(context, config, graph).await
}
diff --git a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
index 976f9e379f..fa840faf14 100644
--- a/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_run_status_and_prompt_binding_tests.rs
@@ -50,9 +50,22 @@ async fn graph_wiring_warnings_uses_the_probed_output_fields_when_schema_is_unkn
]
}));
assert!(
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &real_field).await.expect("TinyFlows wiring warnings should succeed").is_empty(),
+ graph_wiring_warnings(
+ &crate::core::runtime::DispatchCtx::unbound(),
+ &config,
+ &real_field
+ )
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
+ .is_empty(),
"a probed-real field must not warn: {:?}",
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &real_field).await
+ graph_wiring_warnings(
+ &crate::core::runtime::DispatchCtx::unbound(),
+ &config,
+ &real_field
+ )
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
);
// A binding to a field the probe did NOT observe — flagged, using the
@@ -72,7 +85,13 @@ async fn graph_wiring_warnings_uses_the_probed_output_fields_when_schema_is_unkn
{ "from_node": "post", "to_node": "xform" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &fake_field).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings = graph_wiring_warnings(
+ &crate::core::runtime::DispatchCtx::unbound(),
+ &config,
+ &fake_field,
+ )
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
warnings
.iter()
diff --git a/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs b/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs
index 9e7d8f2b0c..39f95c8e94 100644
--- a/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs
@@ -53,8 +53,7 @@ async fn flows_get_tool_contract_rpc_warns_for_runtime_gated_uncurated_action()
);
}
-// ── graph_wiring_warnings: required-arg advisory + output-field/split_out.path
-// advisories (Part 2c/2d) ────────────────────────────────────────────────
+// ── TinyFlows wiring warnings and the single hard required-arg gate ────────
/// Required args have one authoritative authoring check: the hard host gate.
/// The TinyFlows advisory surface reports portable wiring diagnostics only,
@@ -72,14 +71,16 @@ async fn wiring_warnings_omits_missing_required_arg_advisory_but_host_gate_rejec
],
"edges": [ { "from_node": "t", "to_node": "post" } ]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
- assert!(
- warnings.is_empty(),
- "{warnings:?}"
- );
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
+ assert!(warnings.is_empty(), "{warnings:?}");
let errors = crate::flows::host_gates::validate_tool_contracts(&config, &g).await;
assert!(
- errors.iter().any(|error| error.contains("text") && error.contains("post")),
+ errors
+ .iter()
+ .any(|error| error.contains("text") && error.contains("post")),
"the hard host gate must remain authoritative: {errors:?}"
);
}
@@ -106,7 +107,10 @@ async fn graph_wiring_warnings_flags_a_downstream_field_not_in_output_fields() {
{ "from_node": "post", "to_node": "xform" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
warnings
.iter()
@@ -135,7 +139,10 @@ async fn graph_wiring_warnings_is_silent_when_the_downstream_field_is_real() {
{ "from_node": "post", "to_node": "xform" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
!warnings.iter().any(|w| w.contains("not in")),
"a real output field must not warn: {warnings:?}"
@@ -168,7 +175,10 @@ async fn graph_wiring_warnings_flags_a_downstream_binding_missing_the_data_prefi
{ "from_node": "post", "to_node": "xform" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
warnings.iter().any(|w| w.contains("item.json.data.ts")
&& w.contains("post")
@@ -202,9 +212,14 @@ async fn graph_wiring_warnings_is_silent_for_a_whole_payload_binding() {
]
}));
assert!(
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed").is_empty(),
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
+ .is_empty(),
"{:?}",
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
);
}
@@ -236,9 +251,14 @@ async fn graph_wiring_warnings_is_silent_for_composio_envelope_metadata_fields()
]
}));
assert!(
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed").is_empty(),
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
+ .is_empty(),
"{:?}",
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
);
}
@@ -264,7 +284,10 @@ async fn graph_wiring_warnings_suggests_the_real_split_out_path() {
{ "from_node": "post", "to_node": "split" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
warnings.iter().any(|w| w.contains("json.data.messages")),
"{warnings:?}"
@@ -299,7 +322,10 @@ async fn graph_wiring_warnings_flags_a_split_out_path_that_resolves_to_a_non_arr
{ "from_node": "post", "to_node": "split" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
warnings
.iter()
@@ -340,9 +366,14 @@ async fn graph_wiring_warnings_is_silent_on_split_out_when_schema_is_wholly_unkn
]
}));
assert!(
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed").is_empty(),
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
+ .is_empty(),
"{:?}",
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
);
}
@@ -394,7 +425,10 @@ async fn graph_wiring_warnings_suggests_the_probed_split_out_path_when_schema_is
{ "from_node": "post", "to_node": "split" }
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings =
+ graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &g)
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert!(
warnings.iter().any(|w| w.contains("json.data.issues")),
"{warnings:?}"
@@ -417,9 +451,22 @@ async fn graph_wiring_warnings_suggests_the_probed_split_out_path_when_schema_is
]
}));
assert!(
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &fixed).await.expect("TinyFlows wiring warnings should succeed").is_empty(),
+ graph_wiring_warnings(
+ &crate::core::runtime::DispatchCtx::unbound(),
+ &config,
+ &fixed
+ )
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
+ .is_empty(),
"{:?}",
- graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &config, &fixed).await
+ graph_wiring_warnings(
+ &crate::core::runtime::DispatchCtx::unbound(),
+ &config,
+ &fixed
+ )
+ .await
+ .expect("TinyFlows wiring warnings should succeed")
);
}
@@ -443,7 +490,13 @@ async fn graph_wiring_warnings_resolves_a_separated_action_slug_alias() {
]
}));
- let warnings = graph_wiring_warnings(&crate::core::runtime::DispatchCtx::unbound(), &Config::default(), &g).await.expect("TinyFlows wiring warnings should succeed");
+ let warnings = graph_wiring_warnings(
+ &crate::core::runtime::DispatchCtx::unbound(),
+ &Config::default(),
+ &g,
+ )
+ .await
+ .expect("TinyFlows wiring warnings should succeed");
assert_eq!(
warnings.len(),