Skip to content

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

chore(flows): apply rustfmt formatting across flow modules

Steven Enamakele3c59c4e853c
diff --git a/crates/openhuman-core/src/flows/authoring_host.rs b/crates/openhuman-core/src/flows/authoring_host.rs
index ac143ff502..ebbb04c4c7 100644
--- a/crates/openhuman-core/src/flows/authoring_host.rs
+++ b/crates/openhuman-core/src/flows/authoring_host.rs
@@ -67,13 +67,16 @@ impl Callbacks {
let graph: tinyflows::model::WorkflowGraph =
serde_json::from_value(graph).map_err(|error| error.to_string())?;
match stage.as_str() {
- tinyflows_bus::host::TOOL_POLICY => Ok(crate::flows::host_gates::validate_upload_paths(&graph)),
- tinyflows_bus::host::AGENT_REFERENCES => {
- Ok(crate::flows::host_gates::validate_agent_refs(&context, &config, &graph).await)
- }
- tinyflows_bus::host::CONNECTIONS => {
- Ok(crate::flows::host_gates::validate_connection_refs(&context, &config, &graph).await)
+ tinyflows_bus::host::TOOL_POLICY => {
+ Ok(crate::flows::host_gates::validate_upload_paths(&graph))
}
+ tinyflows_bus::host::AGENT_REFERENCES => Ok(
+ crate::flows::host_gates::validate_agent_refs(&context, &config, &graph).await,
+ ),
+ tinyflows_bus::host::CONNECTIONS => Ok(
+ crate::flows::host_gates::validate_connection_refs(&context, &config, &graph)
+ .await,
+ ),
tinyflows_bus::host::TOOL_CONTRACTS => {
Ok(crate::flows::host_gates::validate_tool_contracts(&config, &graph).await)
}
@@ -87,10 +90,8 @@ impl Callbacks {
async fn lookup_tool_contract(&self, slug: String) -> BusResult<Option<ToolContract>> {
let config = Arc::clone(&self.config);
self.in_context(async move {
- let Ok((contract, _)) = crate::integrations::composio::catalog::lookup_contract(
- &config, &slug,
- )
- .await
+ let Ok((contract, _)) =
+ crate::integrations::composio::catalog::lookup_contract(&config, &slug).await
else {
return Ok(None);
};
@@ -119,54 +120,57 @@ impl ApprovalCallbacks {
request: ClassifyManifestCandidatesRequest,
) -> BusResult<catalog::ClassifyManifestCandidatesResponse> {
let config = Arc::clone(&self.0.config);
- self.0.in_context(async move {
- use crate::flows::tinyflows::caps::classify_composio_action_for_tier;
- use crate::security::{GateDecision, SecurityPolicy};
- use tinybox_bus::CommandClass;
- use tinyflows_bus::catalog::{ManifestCandidate, ManifestClass};
+ self.0
+ .in_context(async move {
+ use crate::flows::tinyflows::caps::classify_composio_action_for_tier;
+ use crate::security::{GateDecision, SecurityPolicy};
+ use tinybox_bus::CommandClass;
+ use tinyflows_bus::catalog::{ManifestCandidate, ManifestClass};
- let security = SecurityPolicy::from_config(
- &config.autonomy,
- &config.workspace_dir,
- &config.action_dir,
- );
- let gated = |class: CommandClass| {
- Some(ManifestClass {
- name: format!("{class:?}"),
- blocked: security.gate_decision(class) == GateDecision::Block,
- skip: false,
- })
- };
- let mut classes = Vec::with_capacity(request.candidates.len());
- for candidate in request.candidates {
- let class = match candidate {
- ManifestCandidate::Http { .. } => gated(CommandClass::Network),
- ManifestCandidate::Code { .. } => gated(CommandClass::Write),
- ManifestCandidate::NativeTool { tool_name, args, .. } => {
- let class = crate::tools::native_ops::classify_tool_call(
- &config,
- &tool_name,
- &args,
- )
- .unwrap_or(CommandClass::Network);
- gated(class)
- }
- ManifestCandidate::ConnectorTool { slug, .. } => {
- let class = classify_composio_action_for_tier(&slug).await;
- Some(ManifestClass {
- name: format!("{class:?}"),
- blocked: security.gate_decision(class) == GateDecision::Block,
- skip: class == CommandClass::Read,
- })
- }
- ManifestCandidate::DynamicTool { .. } | ManifestCandidate::Agent { .. } => None,
+ let security = SecurityPolicy::from_config(
+ &config.autonomy,
+ &config.workspace_dir,
+ &config.action_dir,
+ );
+ let gated = |class: CommandClass| {
+ Some(ManifestClass {
+ name: format!("{class:?}"),
+ blocked: security.gate_decision(class) == GateDecision::Block,
+ skip: false,
+ })
};
- classes.push(class);
- }
- Ok(classes)
- })
- .await
- .map_err(|error| tinybus::Error::failed(error))
+ let mut classes = Vec::with_capacity(request.candidates.len());
+ for candidate in request.candidates {
+ let class = match candidate {
+ ManifestCandidate::Http { .. } => gated(CommandClass::Network),
+ ManifestCandidate::Code { .. } => gated(CommandClass::Write),
+ ManifestCandidate::NativeTool {
+ tool_name, args, ..
+ } => {
+ let class = crate::tools::native_ops::classify_tool_call(
+ &config, &tool_name, &args,
+ )
+ .unwrap_or(CommandClass::Network);
+ gated(class)
+ }
+ ManifestCandidate::ConnectorTool { slug, .. } => {
+ let class = classify_composio_action_for_tier(&slug).await;
+ Some(ManifestClass {
+ name: format!("{class:?}"),
+ blocked: security.gate_decision(class) == GateDecision::Block,
+ skip: class == CommandClass::Read,
+ })
+ }
+ ManifestCandidate::DynamicTool { .. } | ManifestCandidate::Agent { .. } => {
+ None
+ }
+ };
+ classes.push(class);
+ }
+ Ok(classes)
+ })
+ .await
+ .map_err(|error| tinybus::Error::failed(error))
}
}
@@ -184,7 +188,10 @@ pub(crate) async fn register(
config: Arc<Config>,
context: DispatchCtx,
) -> Result<Registration, String> {
- let path = format!("/ai/tinyhumans/openhuman/AuthoringHost/h{}", uuid::Uuid::new_v4().simple());
+ let path = format!(
+ "/ai/tinyhumans/openhuman/AuthoringHost/h{}",
+ uuid::Uuid::new_v4().simple()
+ );
let callbacks = Callbacks {
config,
context,
diff --git a/crates/openhuman-core/src/flows/authoring_host_tests.rs b/crates/openhuman-core/src/flows/authoring_host_tests.rs
index 0b9483e1cc..d8c3f1ec57 100644
--- a/crates/openhuman-core/src/flows/authoring_host_tests.rs
+++ b/crates/openhuman-core/src/flows/authoring_host_tests.rs
@@ -48,10 +48,16 @@ async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {
.profile("authoring-bob"),
);
let shared_id = "same-child-id";
- for (core, graph) in [(&alice, nested_conditional_fan_in()), (&bob, json!({
- "nodes": [{"id":"start","kind":"trigger","name":"Start"}],
- "edges": []
- }))] {
+ for (core, graph) in [
+ (&alice, nested_conditional_fan_in()),
+ (
+ &bob,
+ json!({
+ "nodes": [{"id":"start","kind":"trigger","name":"Start"}],
+ "edges": []
+ }),
+ ),
+ ] {
let core = Arc::clone(core);
let config = config.clone();
CoreContext::scope(core, async move {
@@ -70,10 +76,12 @@ async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {
.await;
}
- let alice_registration =
- register(Arc::new(config.clone()), DispatchCtx::new(Arc::clone(&alice)))
- .await
- .unwrap();
+ let alice_registration = register(
+ Arc::new(config.clone()),
+ DispatchCtx::new(Arc::clone(&alice)),
+ )
+ .await
+ .unwrap();
let bob_registration = register(Arc::new(config.clone()), DispatchCtx::new(Arc::clone(&bob)))
.await
.unwrap();
@@ -119,15 +127,18 @@ async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {
})
);
assert!(
- alice_report
- .errors
- .iter()
- .any(|error| {
- error.code == "incompatible_referenced_workflow"
- && error.message.contains("unsupported_nested_conditional_fan_in")
- }),
+ alice_report.errors.iter().any(|error| {
+ error.code == "incompatible_referenced_workflow"
+ && error
+ .message
+ .contains("unsupported_nested_conditional_fan_in")
+ }),
"Alice must resolve her incompatible child: {:?}",
alice_report.errors
);
- assert!(bob_report.errors.is_empty(), "Bob's safe child: {:?}", bob_report.errors);
+ assert!(
+ bob_report.errors.is_empty(),
+ "Bob's safe child: {:?}",
+ bob_report.errors
+ );
}
diff --git a/crates/openhuman-core/src/flows/copilot_bus.rs b/crates/openhuman-core/src/flows/copilot_bus.rs
index 02d7eee8e4..7b26a8192a 100644
--- a/crates/openhuman-core/src/flows/copilot_bus.rs
+++ b/crates/openhuman-core/src/flows/copilot_bus.rs
@@ -44,9 +44,9 @@ impl CopilotToolCatalog {
})
.map_err(|error| format!("could not load workflow node contracts: {error}"))
.and_then(|contracts| serde_json::to_value(contracts).map_err(|error| error.to_string()))?
- .as_array()
- .cloned()
- .ok_or_else(|| "workflow node contracts were not an array".to_string())?;
+ .as_array()
+ .cloned()
+ .ok_or_else(|| "workflow node contracts were not an array".to_string())?;
let request = ToolCatalogRequest {
node_kinds: node_kinds.clone(),
};
diff --git a/crates/openhuman-core/src/flows/host_gates/mod_tests.rs b/crates/openhuman-core/src/flows/host_gates/mod_tests.rs
index 8ec00ae6db..bbffd0d84c 100644
--- a/crates/openhuman-core/src/flows/host_gates/mod_tests.rs
+++ b/crates/openhuman-core/src/flows/host_gates/mod_tests.rs
@@ -2,9 +2,9 @@ use super::*;
use crate::config::Config;
use crate::integrations::composio::catalog::{seed_live_catalog_cache, ToolContract};
use serde_json::{json, Value};
-use tinyflows_catalog::FlowConnection;
-use tinyflows::model::WorkflowGraph;
use tempfile::TempDir;
+use tinyflows::model::WorkflowGraph;
+use tinyflows_catalog::FlowConnection;
fn test_config(tmp: &TempDir) -> Config {
let mut config = Config {
@@ -17,7 +17,6 @@ fn test_config(tmp: &TempDir) -> Config {
config
}
-
fn graph(value: Value) -> WorkflowGraph {
let graph = tinyflows::migrate::deserialize_graph(value).expect("test graph deserializes");
tinyflows::validate::validate(&graph).expect("test graph is structurally valid");
@@ -583,7 +582,6 @@ async fn validate_tool_contracts_rejects_a_real_but_uncurated_action_on_a_static
assert!(errors[0].contains("curated"), "{}", errors[0]);
}
-
#[tokio::test]
async fn validate_tool_contracts_skips_expression_derived_and_native_slugs() {
let config = Config::default();
@@ -604,7 +602,6 @@ async fn validate_tool_contracts_skips_expression_derived_and_native_slugs() {
assert!(errors.is_empty(), "{errors:?}");
}
-
#[tokio::test]
async fn validate_tool_contracts_skips_rather_than_rejects_when_the_catalog_is_unreachable() {
// No seed for this toolkit and no live backend configured — the fetch
@@ -625,7 +622,6 @@ async fn validate_tool_contracts_skips_rather_than_rejects_when_the_catalog_is_u
);
}
-
#[tokio::test]
async fn validate_tool_contracts_rejects_an_arg_name_not_in_the_input_schema() {
seed_live_catalog_cache(
@@ -650,7 +646,6 @@ async fn validate_tool_contracts_rejects_an_arg_name_not_in_the_input_schema() {
assert!(errors[0].contains("get_tool_contract"), "{}", errors[0]);
}
-
#[tokio::test]
async fn validate_tool_contracts_passes_the_real_arg_name_from_the_input_schema() {
seed_live_catalog_cache(
@@ -711,7 +706,6 @@ async fn validate_tool_contracts_skips_arg_name_check_when_input_schema_is_unkno
);
}
-
#[tokio::test]
async fn validate_tool_contracts_allows_arbitrary_arg_names_when_schema_permits_additional_properties(
) {
@@ -749,4 +743,3 @@ async fn validate_tool_contracts_allows_arbitrary_arg_names_when_schema_permits_
"additionalProperties: true must allow arbitrary arg names: {errors:?}"
);
}
-
diff --git a/crates/openhuman-core/src/flows/host_gates/upload_paths.rs b/crates/openhuman-core/src/flows/host_gates/upload_paths.rs
index c156322a1c..353291bb54 100644
--- a/crates/openhuman-core/src/flows/host_gates/upload_paths.rs
+++ b/crates/openhuman-core/src/flows/host_gates/upload_paths.rs
@@ -50,4 +50,3 @@ pub(crate) fn validate_upload_paths(graph: &WorkflowGraph) -> Vec<String> {
}
errors
}
-
diff --git a/crates/openhuman-core/src/flows/mod.rs b/crates/openhuman-core/src/flows/mod.rs
index a204402147..01bd1db74e 100644
--- a/crates/openhuman-core/src/flows/mod.rs
+++ b/crates/openhuman-core/src/flows/mod.rs
@@ -24,15 +24,15 @@
//! family must convert to the facade+stub shape (see `voice/`).
mod agent_route;
+pub(crate) mod authoring_host;
pub mod builder_host;
pub(crate) mod builder_tools;
mod builder_tools_connection_reads;
pub mod bus;
-pub(crate) mod authoring_host;
-pub(crate) mod host_gates;
pub mod catalogue;
mod copilot_bus;
mod draft_store;
+pub(crate) mod host_gates;
pub mod memory_tools;
pub mod node_contracts;
pub mod ops;
diff --git a/crates/openhuman-core/src/flows/node_contracts.rs b/crates/openhuman-core/src/flows/node_contracts.rs
index 1aa69b3d67..7389771b1a 100644
--- a/crates/openhuman-core/src/flows/node_contracts.rs
+++ b/crates/openhuman-core/src/flows/node_contracts.rs
@@ -155,7 +155,9 @@ fn apply_host_overlay(contract: NodeKindContract) -> NodeKindContract {
/// Every node-kind contract returned by Catalog.NodeKinds with this host's
/// overlay applied, in the module's catalog order.
-pub async fn all_node_kind_contracts(config: &crate::config::Config) -> Result<Vec<NodeKindContract>, String> {
+pub async fn all_node_kind_contracts(
+ config: &crate::config::Config,
+) -> Result<Vec<NodeKindContract>, String> {
let proxy = crate::modules::tinyflows::catalog_proxy(config).await?;
let contracts: Vec<NodeKindContract> = proxy
.call(tinyflows_bus::catalog::members::NODE_KINDS, ())
@@ -166,7 +168,10 @@ pub async fn all_node_kind_contracts(config: &crate::config::Config) -> Result<V
/// The overlaid contract for one node kind, or `None` when the module catalog
/// does not contain `kind`.
-pub async fn node_kind_contract(config: &crate::config::Config, kind: &str) -> Result<Option<NodeKindContract>, String> {
+pub async fn node_kind_contract(
+ config: &crate::config::Config,
+ kind: &str,
+) -> Result<Option<NodeKindContract>, String> {
Ok(all_node_kind_contracts(config)
.await?
.into_iter()
diff --git a/crates/openhuman-core/src/flows/node_contracts_tests.rs b/crates/openhuman-core/src/flows/node_contracts_tests.rs
index 8a4ea6f192..693f6cad81 100644
--- a/crates/openhuman-core/src/flows/node_contracts_tests.rs
+++ b/crates/openhuman-core/src/flows/node_contracts_tests.rs
@@ -15,12 +15,17 @@ async fn overlay_preserves_every_kind_from_the_catalog_bus() {
.unwrap();
assert_eq!(contracts.len(), NODE_KINDS.len());
for kind in NODE_KINDS {
- assert!(contracts.iter().any(|contract| contract.kind == kind), "missing {kind}");
+ assert!(
+ contracts.iter().any(|contract| contract.kind == kind),
+ "missing {kind}"
+ );
}
- assert!(node_kind_contract(&crate::config::Config::default(), "not_a_kind")
- .await
- .unwrap()
- .is_none());
+ assert!(
+ node_kind_contract(&crate::config::Config::default(), "not_a_kind")
+ .await
+ .unwrap()
+ .is_none()
+ );
}
#[tokio::test]
@@ -32,7 +37,10 @@ async fn memory_overlay_adds_flow_memory_coherence_facts_and_redirects_dedup_to_
assert!(notes.contains("SAME per-flow memory namespace"), "{notes}");
assert!(!notes.contains("Canonical dedupe pattern"), "{notes}");
assert!(!notes.contains("item.json.found"), "{notes}");
- assert!(!notes.contains("deferred to a dedicated primitive"), "{notes}");
+ assert!(
+ !notes.contains("deferred to a dedicated primitive"),
+ "{notes}"
+ );
assert!(notes.contains("use a dedup node instead"), "{notes}");
}
diff --git a/crates/openhuman-core/src/flows/ops.rs b/crates/openhuman-core/src/flows/ops.rs
index 4fc9cde509..50a7a6f949 100644
--- a/crates/openhuman-core/src/flows/ops.rs
+++ b/crates/openhuman-core/src/flows/ops.rs
@@ -63,7 +63,6 @@ use tinyflows_catalog::types::{
};
use {tinyflows_catalog::Flow, tinyflows_catalog::FlowRun};
-
/// Overall safety bound on a single `flows_run` / `flows_resume`. Individual
/// capabilities have their own timeouts (HTTP, sandbox), but a hung LLM/tool
/// call must never let the RPC block indefinitely — this caps the whole run.
diff --git a/crates/openhuman-core/src/flows/ops/approval_manifest.rs b/crates/openhuman-core/src/flows/ops/approval_manifest.rs
index d64f85ad45..f6dc446bac 100644
--- a/crates/openhuman-core/src/flows/ops/approval_manifest.rs
+++ b/crates/openhuman-core/src/flows/ops/approval_manifest.rs
@@ -38,7 +38,12 @@ pub async fn compute_approval_manifest(
config: &Config,
graph: &WorkflowGraph,
) -> Result<Vec<Value>, String> {
- compute_approval_manifest_json(ctx, config, serde_json::to_value(graph).map_err(|e| e.to_string())?).await
+ compute_approval_manifest_json(
+ ctx,
+ config,
+ serde_json::to_value(graph).map_err(|e| e.to_string())?,
+ )
+ .await
}
async fn compute_approval_manifest_json(
@@ -46,11 +51,9 @@ async fn compute_approval_manifest_json(
config: &Config,
graph: Value,
) -> Result<Vec<Value>, String> {
- let registration = crate::flows::authoring_host::register(
- std::sync::Arc::new(config.clone()),
- ctx.clone(),
- )
- .await?;
+ let registration =
+ crate::flows::authoring_host::register(std::sync::Arc::new(config.clone()), ctx.clone())
+ .await?;
let proxy = crate::modules::tinyflows::catalog_proxy(config).await?;
let entries: Vec<Value> = proxy
.call(
@@ -97,7 +100,10 @@ pub async fn flows_approval_manifest(
.map_err(|e| e.to_string())?
.ok_or_else(|| format!("flow not found: {id}"))?;
// `store::get_flow` already returns a migrated, deserialized graph.
- (serde_json::to_value(flow.graph).map_err(|e| e.to_string())?, Some(id.to_string()))
+ (
+ serde_json::to_value(flow.graph).map_err(|e| e.to_string())?,
+ Some(id.to_string()),
+ )
}
(None, Some(graph_json)) => (graph_json, None),
(None, None) => return Err("provide 'id' or 'graph'".to_string()),
diff --git a/crates/openhuman-core/src/flows/ops/builder_gates.rs b/crates/openhuman-core/src/flows/ops/builder_gates.rs
index b6f5c4aab5..56ea86efa0 100644
--- a/crates/openhuman-core/src/flows/ops/builder_gates.rs
+++ b/crates/openhuman-core/src/flows/ops/builder_gates.rs
@@ -85,7 +85,9 @@ pub(crate) async fn strict_gate(
) -> Result<(), String> {
let graph = validate_and_migrate_graph(ctx, config, graph_json.clone())
.await
- .map_err(|error| format!("strict validation failed — the graph is structurally invalid:\n{error}"))?;
+ .map_err(|error| {
+ format!("strict validation failed — the graph is structurally invalid:\n{error}")
+ })?;
let gate_errors = run_builder_gates(ctx, config, &graph).await;
if !gate_errors.is_empty() {
return Err(format!(
diff --git a/crates/openhuman-core/src/flows/ops/definitions.rs b/crates/openhuman-core/src/flows/ops/definitions.rs
index b7c36aa580..3fc96d1a6b 100644
--- a/crates/openhuman-core/src/flows/ops/definitions.rs
+++ b/crates/openhuman-core/src/flows/ops/definitions.rs
@@ -200,7 +200,8 @@ pub(crate) async fn load_engine_compatible_flow_graph(
) -> Result<Option<WorkflowGraph>, String> {
let graph = load_flow_graph(config, id)?;
if let Some(graph) = graph.as_ref() {
- ensure_config_aware_engine_compatible(ctx, config, graph).await
+ ensure_config_aware_engine_compatible(ctx, config, graph)
+ .await
.map_err(|error| format!("workflow_id '{id}' is engine-incompatible: {error}"))?;
}
Ok(graph)
diff --git a/crates/openhuman-core/src/flows/ops/validation.rs b/crates/openhuman-core/src/flows/ops/validation.rs
index 8ca9810a13..5e45ee920a 100644
--- a/crates/openhuman-core/src/flows/ops/validation.rs
+++ b/crates/openhuman-core/src/flows/ops/validation.rs
@@ -11,7 +11,8 @@ async fn validate_over_bus(
config: &Config,
graph: Value,
) -> Result<GraphValidation, String> {
- let registration = crate::flows::authoring_host::register(Arc::new(config.clone()), ctx.clone()).await?;
+ let registration =
+ crate::flows::authoring_host::register(Arc::new(config.clone()), ctx.clone()).await?;
let proxy = crate::modules::tinyflows::authoring_proxy(config).await?;
proxy
.call(
@@ -66,7 +67,8 @@ pub(super) async fn ensure_config_aware_engine_compatible(
graph: &WorkflowGraph,
) -> Result<(), String> {
let graph = serde_json::to_value(graph).map_err(|error| error.to_string())?;
- match config_aware_engine_compatibility_errors(ctx, config, graph).await?
+ match config_aware_engine_compatibility_errors(ctx, config, graph)
+ .await?
.into_iter()
.next()
{
@@ -124,7 +126,9 @@ pub async fn flows_validate(
"flow validation failed",
);
}
- let graph: WorkflowGraph = match report.graph.ok_or_else(|| "TinyFlows validation returned no graph".to_string())
+ let graph: WorkflowGraph = match report
+ .graph
+ .ok_or_else(|| "TinyFlows validation returned no graph".to_string())
.and_then(|graph| serde_json::from_value(graph).map_err(|error| error.to_string()))
{
Ok(graph) => graph,
@@ -166,8 +170,15 @@ pub async fn flows_import(
format: Option<String>,
) -> Result<Outcome<tinyflows_catalog::FlowImport>, String> {
use tinyflows_catalog::FlowImport;
- let requested = format.as_deref().unwrap_or("auto").trim().to_ascii_lowercase();
- if !matches!(requested.as_str(), "auto" | "" | "native" | "tinyflows" | "n8n") {
+ let requested = format
+ .as_deref()
+ .unwrap_or("auto")
+ .trim()
+ .to_ascii_lowercase();
+ if !matches!(
+ requested.as_str(),
+ "auto" | "" | "native" | "tinyflows" | "n8n"
+ ) {
return Err(format!(
"unknown import format '{requested}' (expected 'native' or 'n8n')"
));
@@ -192,7 +203,10 @@ pub async fn flows_import(
.and_then(|graph| serde_json::from_value(graph).map_err(|error| error.to_string()))?;
let mut warnings = imported.warnings;
warnings.extend(graph_trigger_warnings(&graph));
- Ok(Outcome::single_log(FlowImport { graph, warnings }, "flow imported"))
+ Ok(Outcome::single_log(
+ FlowImport { graph, warnings },
+ "flow imported",
+ ))
}
/// Compatibility diagnostics for a portable Copilot graph payload.
diff --git a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
index 69bbfe2d1a..ae92ea85b5 100644
--- a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs
@@ -1,14 +1,18 @@
use super::*;
#[tokio::test]
async fn dynamic_agent_ref_is_rejected_during_structural_validation() {
- let err = validate_and_migrate_graph(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), json!({
- "nodes": [
- { "id": "t", "kind": "trigger", "name": "Manual" },
- { "id": "a", "kind": "agent", "name": "Dynamic",
- "config": { "agent_ref": "=nodes.t.item.agent_choice", "prompt": "go" } }
- ],
- "edges": [ { "from_node": "t", "to_node": "a" } ]
- }))
+ let err = validate_and_migrate_graph(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ json!({
+ "nodes": [
+ { "id": "t", "kind": "trigger", "name": "Manual" },
+ { "id": "a", "kind": "agent", "name": "Dynamic",
+ "config": { "agent_ref": "=nodes.t.item.agent_choice", "prompt": "go" } }
+ ],
+ "edges": [ { "from_node": "t", "to_node": "a" } ]
+ }),
+ )
.await
.expect_err("dynamic agent_ref must fail structural validation");
assert!(
@@ -382,4 +386,3 @@ async fn harness_readiness_checks_session_for_execution_provider() {
}
}
}
-
diff --git a/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs b/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
index 9b38d0a9f6..1ab05cc6c0 100644
--- a/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
@@ -84,7 +84,13 @@ async fn flows_run_detached_registers_the_run_before_returning_its_id() {
async fn approval_manifest_lists_gated_nodes_and_skips_curated_reads() {
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp); // default tier: Supervised
- let entries = compute_approval_manifest(&crate::core::runtime::DispatchCtx::ambient(), &config, &manifest_graph()).await.unwrap();
+ let entries = compute_approval_manifest(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &manifest_graph(),
+ )
+ .await
+ .unwrap();
let kinds = entry_kinds_by_tool(&entries);
// Supervised prompts on every acting class → all three are approvable.
@@ -104,7 +110,13 @@ async fn approval_manifest_marks_blocked_classes_under_readonly_tier() {
let tmp = TempDir::new().unwrap();
let mut config = test_config(&tmp);
config.autonomy.level = crate::security::AutonomyLevel::ReadOnly;
- let entries = compute_approval_manifest(&crate::core::runtime::DispatchCtx::ambient(), &config, &manifest_graph()).await.unwrap();
+ let entries = compute_approval_manifest(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &manifest_graph(),
+ )
+ .await
+ .unwrap();
let kinds = entry_kinds_by_tool(&entries);
// Read-only blocks every non-Read class: informational, never approvable.
@@ -135,7 +147,13 @@ async fn approval_manifest_dedupes_repeated_tools_and_flags_dynamic_slugs() {
{ "from_node": "h2", "from_port": "main", "to_node": "d" }
]
}));
- let entries = compute_approval_manifest(&crate::core::runtime::DispatchCtx::ambient(), &config, &graph).await.unwrap();
+ let entries = compute_approval_manifest(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &graph,
+ )
+ .await
+ .unwrap();
// Two http nodes share one trust key → exactly one row.
let http_rows = entries
@@ -170,7 +188,13 @@ async fn approval_manifest_discloses_agent_ref_nodes_only() {
{ "from_node": "plain", "from_port": "main", "to_node": "harness" }
]
}));
- let entries = compute_approval_manifest(&crate::core::runtime::DispatchCtx::ambient(), &config, &graph).await.unwrap();
+ let entries = compute_approval_manifest(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ &graph,
+ )
+ .await
+ .unwrap();
let agent_rows: Vec<_> = entries
.iter()
@@ -489,9 +513,14 @@ async fn approval_manifest_never_claims_trust_that_was_never_granted() {
// A candidate graph carries no flow id, so there is no `flow_tool_trust`
// row to join against and nothing can legitimately be "already trusted" —
// whether or not this process happens to have an `ApprovalGate` installed.
- let outcome = flows_approval_manifest(&crate::core::runtime::DispatchCtx::ambient(), &config, None, Some(manifest_graph_json()))
- .await
- .expect("manifest must compute for a candidate graph");
+ let outcome = flows_approval_manifest(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &config,
+ None,
+ Some(manifest_graph_json()),
+ )
+ .await
+ .expect("manifest must compute for a candidate graph");
let already_trusted = outcome.value["already_trusted"]
.as_array()
diff --git a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
index f0e1344926..81b7720dda 100644
--- a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
@@ -19,7 +19,7 @@ async fn resolver_lookup_rejects_an_incompatible_saved_child() {
&child.id,
)
.await
- .expect_err("resolver lookup must reject an unsafe legacy child");
+ .expect_err("resolver lookup must reject an unsafe legacy child");
assert!(
error.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN),
"{error}"
@@ -54,7 +54,7 @@ async fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {
&child.id,
)
.await
- .expect_err("resolver lookup must reject an unsafe saved grandchild");
+ .expect_err("resolver lookup must reject an unsafe saved grandchild");
assert!(
error.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN),
"{error}"
@@ -66,7 +66,12 @@ async fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {
#[tokio::test]
async fn flows_validate_returns_stable_nested_conditional_fan_in_error() {
- let outcome = flows_validate(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), nested_conditional_fan_in_graph()).await;
+ let outcome = flows_validate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ nested_conditional_fan_in_graph(),
+ )
+ .await;
assert!(!outcome.value.valid);
assert_eq!(outcome.value.error_details.len(), 1);
assert_eq!(
diff --git a/crates/openhuman-core/src/flows/ops_tests.rs b/crates/openhuman-core/src/flows/ops_tests.rs
index 9426d4bf12..7d202a527a 100644
--- a/crates/openhuman-core/src/flows/ops_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_tests.rs
@@ -104,7 +104,9 @@ async fn flows_import_uses_the_tinyflows_authoring_module_in_a_cold_process() {
);
assert!(
child_output.contains("running 1 test")
- && child_output.contains("flows_import_uses_the_tinyflows_authoring_module_in_a_cold_process ... ok")
+ && child_output.contains(
+ "flows_import_uses_the_tinyflows_authoring_module_in_a_cold_process ... ok"
+ )
&& child_output.contains("1 passed; 0 failed"),
"child must prove exactly one test ran:\n{child_output}"
);
diff --git a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
index 17687985a9..30e56b16dc 100644
--- a/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_validate_warnings_and_connections_tests.rs
@@ -175,7 +175,12 @@ async fn parked_run_ttl_sweep_expires_stale_runs_but_spares_fresh_ones() {
#[tokio::test]
async fn flows_validate_warns_on_unfired_webhook_trigger() {
- let outcome = flows_validate(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), webhook_trigger_graph()).await;
+ let outcome = flows_validate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ webhook_trigger_graph(),
+ )
+ .await;
assert!(outcome.value.valid, "a webhook graph is structurally valid");
assert!(outcome.value.errors.is_empty());
assert_eq!(
@@ -194,7 +199,12 @@ async fn flows_validate_warns_on_unfired_webhook_trigger() {
#[tokio::test]
async fn flows_validate_does_not_warn_on_schedule_trigger() {
- let outcome = flows_validate(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), schedule_trigger_graph("0 9 * * *")).await;
+ let outcome = flows_validate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ schedule_trigger_graph("0 9 * * *"),
+ )
+ .await;
assert!(outcome.value.valid);
assert!(
outcome.value.warnings.is_empty(),
@@ -210,7 +220,12 @@ async fn flows_validate_reports_error_for_graph_without_trigger() {
"nodes": [ { "id": "a", "kind": "output_parser", "name": "A" } ],
"edges": []
});
- let outcome = flows_validate(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), graph).await;
+ let outcome = flows_validate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ graph,
+ )
+ .await;
assert!(!outcome.value.valid);
assert_eq!(outcome.value.errors.len(), 1);
assert!(outcome.value.errors[0].contains("trigger"));
@@ -233,7 +248,12 @@ async fn flows_validate_accumulates_every_structural_error() {
],
"edges": [ { "from_node": "dup", "to_node": "ghost" } ]
});
- let outcome = flows_validate(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), graph).await;
+ let outcome = flows_validate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ graph,
+ )
+ .await;
assert!(!outcome.value.valid);
// errors[] and error_details[] must be 1:1.
assert_eq!(
@@ -283,7 +303,12 @@ async fn flows_validate_reports_unparseable_graph_as_single_error() {
"nodes": [ { "id": "a", "kind": "not_a_real_kind", "name": "A" } ],
"edges": []
});
- let outcome = flows_validate(&crate::core::runtime::DispatchCtx::ambient(), &Config::default(), graph).await;
+ let outcome = flows_validate(
+ &crate::core::runtime::DispatchCtx::ambient(),
+ &Config::default(),
+ graph,
+ )
+ .await;
assert!(!outcome.value.valid);
assert_eq!(outcome.value.errors.len(), 1);
assert_eq!(outcome.value.error_details.len(), 1);
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
index 199edc2192..8afa323d80 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_gate_and_timeouts_tests.rs
@@ -506,9 +506,9 @@ async fn resolver_rejects_an_engine_incompatible_saved_graph() {
ctx: crate::core::runtime::DispatchCtx::ambient(),
config,
}
- .resolve(&flow.id)
- .await
- .expect_err("resolver must reject an incompatible legacy child");
+ .resolve(&flow.id)
+ .await
+ .expect_err("resolver must reject an incompatible legacy child");
match error {
EngineError::Capability(message) => assert!(
message.contains("unsupported_nested_conditional_fan_in"),
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs b/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs
index 83952d509a..0049fb6d5f 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs
@@ -41,7 +41,9 @@ impl WorkflowResolver for OpenHumanWorkflowResolver {
%workflow_id,
"[flows] sub_workflow resolver: resolving workflow_id to a saved flow graph"
);
- let loaded = flows::ops::load_engine_compatible_flow_graph(&self.ctx, &self.config, workflow_id).await;
+ let loaded =
+ flows::ops::load_engine_compatible_flow_graph(&self.ctx, &self.config, workflow_id)
+ .await;
match loaded {
Ok(Some(graph)) => {
tracing::debug!(
diff --git a/crates/openhuman-core/src/modules/tinyflows.rs b/crates/openhuman-core/src/modules/tinyflows.rs
index fd525a9a5f..c44d580c42 100644
--- a/crates/openhuman-core/src/modules/tinyflows.rs
+++ b/crates/openhuman-core/src/modules/tinyflows.rs
@@ -131,7 +131,11 @@ mod imp {
.map_err(|error| format!("the module bus is unavailable: {error}"))?;
runtime
.connection()
- .proxy(tinyflows_bus::BUS_NAME, tinyflows_bus::OBJECT_PATH, tinyflows_bus::INTERFACE)
+ .proxy(
+ tinyflows_bus::BUS_NAME,
+ tinyflows_bus::OBJECT_PATH,
+ tinyflows_bus::INTERFACE,
+ )
.map(|proxy| proxy.with_timeout(CALL_TIMEOUT))
.map_err(|error| format!("the tinyflows authoring object is unreachable: {error}"))
}
@@ -144,7 +148,11 @@ mod imp {
.map_err(|error| format!("the module bus is unavailable: {error}"))?;
runtime
.connection()
- .proxy(tinyflows_bus::BUS_NAME, tinyflows_bus::OBJECT_PATH, tinyflows_bus::catalog::INTERFACE)
+ .proxy(
+ tinyflows_bus::BUS_NAME,
+ tinyflows_bus::OBJECT_PATH,
+ tinyflows_bus::catalog::INTERFACE,
+ )
.map(|proxy| proxy.with_timeout(CALL_TIMEOUT))
.map_err(|error| format!("the tinyflows catalog object is unreachable: {error}"))
}
@@ -296,7 +304,8 @@ mod fixture;
pub(crate) use imp::serve_pair_after_first;
#[cfg(feature = "modules")]
pub(crate) use imp::{
- authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve, serve_pair, unserve,
+ authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve,
+ serve_pair, unserve,
};
#[cfg(not(feature = "modules"))]
@@ -357,7 +366,8 @@ mod imp {
#[cfg(not(feature = "modules"))]
pub(crate) use imp::{
- authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve, serve_pair, unserve,
+ authoring_proxy, catalog_proxy, copilot_invoke_proxy, copilot_proxy, proxy, run_proxy, serve,
+ serve_pair, unserve,
};
/// Whether the module can serve in this build and configuration (the switch
diff --git a/tests/tinyflows_published_prompt_e2e.rs b/tests/tinyflows_published_prompt_e2e.rs
index 74bac5fecd..90e5a5d396 100644
--- a/tests/tinyflows_published_prompt_e2e.rs
+++ b/tests/tinyflows_published_prompt_e2e.rs
@@ -191,10 +191,15 @@ async fn published_module_public_import_uses_authoring_bus_in_a_cold_process() {
print!("{stdout}");
eprint!("{stderr}");
let child_output = format!("{stdout}{stderr}");
- assert!(output.status.success(), "published authoring child failed:\n{child_output}");
+ assert!(
+ output.status.success(),
+ "published authoring child failed:\n{child_output}"
+ );
assert!(
child_output.contains("running 1 test")
- && child_output.contains("published_module_public_import_uses_authoring_bus_in_a_cold_process ... ok")
+ && child_output.contains(
+ "published_module_public_import_uses_authoring_bus_in_a_cold_process ... ok"
+ )
&& child_output.contains("1 passed; 0 failed"),
"child must prove exactly one public-import test ran:\n{child_output}"
);
@@ -290,6 +295,8 @@ async fn published_module_public_import_uses_authoring_bus_in_a_cold_process() {
Some(legacy_graph),
)
.await
- .expect_err("a failed Catalog operation must propagate instead of yielding an empty grant list");
+ .expect_err(
+ "a failed Catalog operation must propagate instead of yielding an empty grant list",
+ );
assert!(error.contains("COMPONENT_DISABLED"), "{error}");
}