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
refactor(flows): reorder imports and collapse wrapped expressions
Steven Enamakel5f335a21f46d
diff --git a/crates/openhuman-core/src/flows/authoring_host.rs b/crates/openhuman-core/src/flows/authoring_host.rsindex e7592c543e..77b9b9e529 100644--- a/crates/openhuman-core/src/flows/authoring_host.rs+++ b/crates/openhuman-core/src/flows/authoring_host.rs@@ -49,9 +49,8 @@ impl Callbacks {async fn resolve_workflow(&self, workflow_id: String) -> BusResult<Option<Value>> {let config = Arc::clone(&self.config);self.in_context(async move {- ops::load_flow_graph(&config, &workflow_id).map(|graph| {- graph.map(|graph| serde_json::to_value(graph).expect("graph serializes"))- })+ ops::load_flow_graph(&config, &workflow_id)+ .map(|graph| graph.map(|graph| serde_json::to_value(graph).expect("graph serializes")))}).await.map_err(|error| tinybus::Error::failed(error))@@ -84,8 +83,10 @@ 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,+ )+ .awaitelse {return Ok(None);};@@ -114,57 +115,54 @@ 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 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 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))+ classes.push(class);+ }+ Ok(classes)+ })+ .await+ .map_err(|error| tinybus::Error::failed(error))}}@@ -182,10 +180,7 @@ 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.rsindex 882fb833b0..0f45047381 100644--- a/crates/openhuman-core/src/flows/authoring_host_tests.rs+++ b/crates/openhuman-core/src/flows/authoring_host_tests.rs@@ -48,16 +48,10 @@ 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 {@@ -76,12 +70,10 @@ 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();@@ -134,9 +126,5 @@ async fn saved_workflow_callback_uses_its_captured_profile_over_the_bus() {"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/builder_host.rs b/crates/openhuman-core/src/flows/builder_host.rsindex 70adf5db07..2eaf8508ad 100644--- a/crates/openhuman-core/src/flows/builder_host.rs+++ b/crates/openhuman-core/src/flows/builder_host.rs@@ -4,7 +4,7 @@ use std::future::Future;use std::sync::Arc;use serde::de::DeserializeOwned;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinybus::Result as BusResult;use tinyflows_bus::copilot::{self, CopilotHost, PortOperation};diff --git a/crates/openhuman-core/src/flows/builder_tools_dry_run_tests.rs b/crates/openhuman-core/src/flows/builder_tools_dry_run_tests.rsindex d517387626..78646e4a0a 100644--- a/crates/openhuman-core/src/flows/builder_tools_dry_run_tests.rs+++ b/crates/openhuman-core/src/flows/builder_tools_dry_run_tests.rs@@ -81,13 +81,11 @@ async fn dry_run_supervised_runs_against_mock_and_labels_sandbox() {let parsed: Value = serde_json::from_str(&result.output()).unwrap();assert_eq!(parsed["sandbox"], true);assert_eq!(parsed["ok"], true);- assert!(- parsed["note"]- .as_str()- .unwrap()- .to_lowercase()- .contains("sandbox")- );+ assert!(parsed["note"]+ .as_str()+ .unwrap()+ .to_lowercase()+ .contains("sandbox"));}#[tokio::test]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.rsindex 4450748b44..e0bc33ab70 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@@ -435,21 +435,17 @@ async fn get_node_kind_contract_tool_returns_contract_and_rejects_unknown() {assert!(!ok.is_error, "{}", ok.output());let parsed: Value = serde_json::from_str(&ok.output()).unwrap();assert_eq!(parsed["kind"], "tool_call");- assert!(- parsed["config_fields"]- .as_array()- .unwrap()- .iter()- .any(|f| f["name"] == "slug")- );+ assert!(parsed["config_fields"]+ .as_array()+ .unwrap()+ .iter()+ .any(|f| f["name"] == "slug"));// Host overlay is present on the tool's output.- assert!(- parsed["notes"]- .as_array()- .unwrap()- .iter()- .any(|n| n.as_str().unwrap_or("").contains("Composio"))- );+ assert!(parsed["notes"]+ .as_array()+ .unwrap()+ .iter()+ .any(|n| n.as_str().unwrap_or("").contains("Composio")));let bad = tool.execute(json!({ "kind": "nope" })).await.unwrap();assert!(bad.is_error);diff --git a/crates/openhuman-core/src/flows/builder_tools_tests.rs b/crates/openhuman-core/src/flows/builder_tools_tests.rsindex 260592c1af..18bca19c68 100644--- a/crates/openhuman-core/src/flows/builder_tools_tests.rs+++ b/crates/openhuman-core/src/flows/builder_tools_tests.rs@@ -4,7 +4,7 @@ use super::tests_support::*;use super::*;use crate::config::Config;use crate::flows::ops;-use serde_json::{Value, json};+use serde_json::{json, Value};use tempfile::TempDir;use tinytools::{PermissionLevel, Tool};@@ -37,7 +37,7 @@ fn valid_graph() -> Value {// share a toolkit key (same discipline the pre-fix required-args/response-// fields caches already required).-use crate::integrations::composio::catalog::{ToolContract, seed_live_catalog_cache};+use crate::integrations::composio::catalog::{seed_live_catalog_cache, ToolContract};fn seeded_gmail_send_contract() -> ToolContract {ToolContract {diff --git a/crates/openhuman-core/src/flows/bus.rs b/crates/openhuman-core/src/flows/bus.rsindex ce86a87287..064aea9752 100644--- a/crates/openhuman-core/src/flows/bus.rs+++ b/crates/openhuman-core/src/flows/bus.rs@@ -33,10 +33,10 @@ use crate::core::events::DomainEvent;#[cfg(test)]use crate::flows::store;#[cfg(test)]-use dedup_commit::{CommitTestHooks, flow_commit_lock};+use dedup_commit::{flow_commit_lock, CommitTestHooks};#[cfg(test)]use run_digest::{- DIGEST_MAX_CHARS, digest_filter, enforce_retention_cap, render_run_digest, truncate_chars,+ digest_filter, enforce_retention_cap, render_run_digest, truncate_chars, DIGEST_MAX_CHARS,};#[cfg(test)]use serde_json::Value;diff --git a/crates/openhuman-core/src/flows/bus/owner.rs b/crates/openhuman-core/src/flows/bus/owner.rsindex 91346389c4..375e12423d 100644--- a/crates/openhuman-core/src/flows/bus/owner.rs+++ b/crates/openhuman-core/src/flows/bus/owner.rs@@ -12,7 +12,7 @@ use std::sync::{LazyLock, Mutex};use crate::config::Config;use crate::core::runtime::DispatchCtx;-use crate::storage::agents::{LookupFailed, find_owner, within_agent, within_agent_ctx};+use crate::storage::agents::{find_owner, within_agent, within_agent_ctx, LookupFailed};/// Flows whose owner this process has resolved (`None` = `local`).static OWNERS: LazyLock<Mutex<HashMap<String, Option<String>>>> = LazyLock::new(Default::default);@@ -63,7 +63,7 @@ async fn resolve(return Err(LookupFailed {agent: owner,error,- });+ })}Some(Ok(false)) | None => forget(flow_id),}diff --git a/crates/openhuman-core/src/flows/bus/trigger.rs b/crates/openhuman-core/src/flows/bus/trigger.rsindex 03dd7f4abd..026cef6122 100644--- a/crates/openhuman-core/src/flows/bus/trigger.rs+++ b/crates/openhuman-core/src/flows/bus/trigger.rs@@ -16,7 +16,7 @@ use std::sync::{Arc, Mutex, RwLock};use tinybus::EventHandler;use tinyflows::model::TriggerKind;use tinyflows_catalog::Flow;-use tokio::sync::{Mutex as AsyncMutex, mpsc};+use tokio::sync::{mpsc, Mutex as AsyncMutex};/// Reads `trigger_kind` from a flow's trigger node config, deserializing into/// `tinyflows::model::TriggerKind`. Returns `None` when the flow doesn't havediff --git a/crates/openhuman-core/src/flows/bus_subscriber_tests.rs b/crates/openhuman-core/src/flows/bus_subscriber_tests.rsindex 98706c70da..2df43eb364 100644--- a/crates/openhuman-core/src/flows/bus_subscriber_tests.rs+++ b/crates/openhuman-core/src/flows/bus_subscriber_tests.rs@@ -436,10 +436,9 @@ async fn retention_cap_forgets_the_oldest_digests() {assert_eq!(enforce_retention_cap(&config, "f-cap", 2).await.unwrap(), 2);let kept = stored_digests(&config, "f-cap").await;assert_eq!(kept.len(), 2);- assert!(- kept.iter()- .all(|hit| hit.text.contains("digest 2") || hit.text.contains("digest 3"))- );+ assert!(kept+ .iter()+ .all(|hit| hit.text.contains("digest 2") || hit.text.contains("digest 3")));}#[test]@@ -586,11 +585,9 @@ async fn dedup_commit_treats_completed_with_warnings_as_success() {.unwrap().expect("completed_with_warnings must still commit");assert_eq!(committed, json!(["x"]));- assert!(- store::kv_get(&config, &namespace, "dedup:dd:tentative")- .unwrap()- .is_none()- );+ assert!(store::kv_get(&config, &namespace, "dedup:dd:tentative")+ .unwrap()+ .is_none());}#[tokio::test]diff --git a/crates/openhuman-core/src/flows/bus_tests.rs b/crates/openhuman-core/src/flows/bus_tests.rsindex a0f7f2da97..be1a7349b0 100644--- a/crates/openhuman-core/src/flows/bus_tests.rs+++ b/crates/openhuman-core/src/flows/bus_tests.rs@@ -186,9 +186,7 @@ async fn dedup_nodes_are_read_from_the_explicit_contexts_config() {assert_eq!(ids, vec![expected.to_string()]);}// The registered config has no such flow: it is never consulted.- assert!(- subscriber- .dedup_node_ids(&DispatchCtx::unbound(), "shared-flow")- .is_empty()- );+ assert!(subscriber+ .dedup_node_ids(&DispatchCtx::unbound(), "shared-flow")+ .is_empty());}diff --git a/crates/openhuman-core/src/flows/catalogue_tests.rs b/crates/openhuman-core/src/flows/catalogue_tests.rsindex 6d7520d33e..0bd41db747 100644--- a/crates/openhuman-core/src/flows/catalogue_tests.rs+++ b/crates/openhuman-core/src/flows/catalogue_tests.rs@@ -123,11 +123,9 @@ fn a_disabled_flow_is_still_listed_and_says_it_is_paused() {#[test]fn an_enabled_flow_does_not_claim_to_be_disabled() {- assert!(- !entry_for(flow("Live", true, vec![]))- .description- .contains("disabled")- );+ assert!(!entry_for(flow("Live", true, vec![]))+ .description+ .contains("disabled"));}#[test]diff --git a/crates/openhuman-core/src/flows/copilot_bus.rs b/crates/openhuman-core/src/flows/copilot_bus.rsindex 63b0a24ba4..02d7eee8e4 100644--- a/crates/openhuman-core/src/flows/copilot_bus.rs+++ b/crates/openhuman-core/src/flows/copilot_bus.rs@@ -3,7 +3,7 @@use std::collections::HashMap;use std::sync::Arc;-use serde::{Serialize, de::DeserializeOwned};+use serde::{de::DeserializeOwned, Serialize};use serde_json::Value;use tinyflows_bus::copilot::{ToolCatalogRequest, ToolDescriptor};use tinytools::{PermissionLevel, Tool, ToolResult};@@ -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/copilot_bus_tests.rs b/crates/openhuman-core/src/flows/copilot_bus_tests.rsindex b685dd2a3a..3e4a411cff 100644--- a/crates/openhuman-core/src/flows/copilot_bus_tests.rs+++ b/crates/openhuman-core/src/flows/copilot_bus_tests.rs@@ -205,11 +205,9 @@ async fn module_proposal_tool_uses_host_gates_without_persisting() {let proposal: Value = serde_json::from_str(&valid.output()).expect("proposal JSON");assert_eq!(proposal["type"], "workflow_proposal");assert_eq!(proposal["persisted"], false);- assert!(- crate::flows::ops::flows_list(&config)- .await- .expect("flow list")- .value- .is_empty()- );+ assert!(crate::flows::ops::flows_list(&config)+ .await+ .expect("flow list")+ .value+ .is_empty());}diff --git a/crates/openhuman-core/src/flows/memory_tools.rs b/crates/openhuman-core/src/flows/memory_tools.rsindex 380a8f27a1..e582eb621d 100644--- a/crates/openhuman-core/src/flows/memory_tools.rs+++ b/crates/openhuman-core/src/flows/memory_tools.rs@@ -36,8 +36,8 @@ use crate::agent::turn_origin::{AgentTurnOrigin, TrustedAutomationSource};use crate::config::Config;use crate::memory::types::{ForgetParams, ItemsListParams, LearnParams, RecallParams};use crate::memory::{MemoryError, MemoryResult};-use crate::security::SecurityPolicy;use crate::security::policy::ToolOperation;+use crate::security::SecurityPolicy;/// Prefix of a flow's own tag (see [`flow_tag`]).pub const FLOW_TAG_PREFIX: &str = "flow:";@@ -369,7 +369,7 @@ impl Tool for FlowMemoryRecallTool {other => {return Ok(ToolResult::error(format!("Unknown scope '{other}': expected 'flow' or 'flows'"- )));+ )))}};#[allow(clippy::cast_possible_truncation)]@@ -387,7 +387,7 @@ impl Tool for FlowMemoryRecallTool {Err(error) => {return Ok(ToolResult::error(format!("Flow memory recall failed: {error}"- )));+ )))}};tracing::debug!(@@ -540,7 +540,7 @@ impl Tool for FlowMemoryRememberTool {Err(error) => {return Ok(ToolResult::error(format!("Failed to store flow memory: {error}"- )));+ )))}};match remember_keyed(&config, &flow_id, key, content, kind).await {diff --git a/crates/openhuman-core/src/flows/mod.rs b/crates/openhuman-core/src/flows/mod.rsindex 07345fbe38..545066b21c 100644--- a/crates/openhuman-core/src/flows/mod.rs+++ b/crates/openhuman-core/src/flows/mod.rs@@ -24,11 +24,11 @@//! 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 mod catalogue;mod copilot_bus;mod draft_store;@@ -63,6 +63,6 @@ pub use {node_contracts::all_node_kind_contracts, node_contracts::node_kind_cont// subscriber, `flows_delete` and the tinyflows `memory` node adapter reach the// same helpers through these re-exports so every caller tags identically.pub use memory_tools::{- FLOWS_TAG, cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, flow_meta, flow_tag,- forget_matching, remember_keyed,+ cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, flow_meta, flow_tag,+ forget_matching, remember_keyed, FLOWS_TAG,};diff --git a/crates/openhuman-core/src/flows/node_contracts.rs b/crates/openhuman-core/src/flows/node_contracts.rsindex 57178d4daf..4bc4d3531f 100644--- a/crates/openhuman-core/src/flows/node_contracts.rs+++ b/crates/openhuman-core/src/flows/node_contracts.rs@@ -155,9 +155,7 @@ fn apply_host_overlay(contract: NodeKindContract) -> NodeKindContract {/// Every node-kind contract with this host's overlay applied, in/// [`tinyflows::catalog::NODE_KINDS`] 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, ())@@ -168,10 +166,7 @@ pub async fn all_node_kind_contracts(/// The overlaid contract for one node kind, or `None` when `kind` is not one/// of [`tinyflows::catalog::NODE_KINDS`].-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.rsindex 693f6cad81..8a4ea6f192 100644--- a/crates/openhuman-core/src/flows/node_contracts_tests.rs+++ b/crates/openhuman-core/src/flows/node_contracts_tests.rs@@ -15,17 +15,12 @@ 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]@@ -37,10 +32,7 @@ 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.rsindex cd7e4ee9c5..e995478379 100644--- a/crates/openhuman-core/src/flows/ops.rs+++ b/crates/openhuman-core/src/flows/ops.rs@@ -37,7 +37,7 @@ use std::collections::HashSet;use std::sync::{Arc, LazyLock};use chrono::Utc;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::model::{NodeKind, TriggerKind, WorkflowGraph};use tinyflows::triggers::graph_trigger_warnings;// The save/run safety predicates are `tinyflows-catalog`'s: whether a graph@@ -50,7 +50,7 @@ pub(crate) use tinyflows_catalog::graph_policy::{};use tokio_util::sync::CancellationToken;-use crate::agent::turn_origin::{AgentTurnOrigin, TrustedAutomationSource, with_origin};+use crate::agent::turn_origin::{with_origin, AgentTurnOrigin, TrustedAutomationSource};use crate::config::Config;use crate::core::Outcome;use crate::flows::bus;diff --git a/crates/openhuman-core/src/flows/ops/approval_manifest.rs b/crates/openhuman-core/src/flows/ops/approval_manifest.rsindex f6dc446bac..d64f85ad45 100644--- a/crates/openhuman-core/src/flows/ops/approval_manifest.rs+++ b/crates/openhuman-core/src/flows/ops/approval_manifest.rs@@ -38,12 +38,7 @@ 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(@@ -51,9 +46,11 @@ 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(@@ -100,10 +97,7 @@ 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.rsindex 31640a449d..06fd3a9e6f 100644--- a/crates/openhuman-core/src/flows/ops/builder_gates.rs+++ b/crates/openhuman-core/src/flows/ops/builder_gates.rs@@ -135,9 +135,7 @@ 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!(@@ -371,7 +369,7 @@ pub(crate) async fn validate_agent_refs() -> Vec<String> {use crate::agent::harness::host_definition::AgentDefinitionRegistry;use crate::agent::registry::AgentRegistryEntry;- use crate::flows::agent_route::{AgentRoute, route_for_agent_ref};+ use crate::flows::agent_route::{route_for_agent_ref, AgentRoute};let mut errors = Vec::new();let mut harness_registry_init_attempted = false;diff --git a/crates/openhuman-core/src/flows/ops/catalog.rs b/crates/openhuman-core/src/flows/ops/catalog.rsindex ae5d554c72..ceeb7d6eae 100644--- a/crates/openhuman-core/src/flows/ops/catalog.rs+++ b/crates/openhuman-core/src/flows/ops/catalog.rs@@ -2,7 +2,7 @@ use super::*;#[cfg(test)]pub(crate) use crate::integrations::composio::catalog::toolkit_for_contract_slug;-pub(crate) use crate::integrations::composio::catalog::{ContractLookupError, lookup_contract};+pub(crate) use crate::integrations::composio::catalog::{lookup_contract, ContractLookupError};// ─────────────────────────────────────────────────────────────────────────────// Catalog RPCs for the UI (Phase 5, item 16) — one implementation, two consumersdiff --git a/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs b/crates/openhuman-core/src/flows/ops/connection_ref_gate.rsindex bc36ce5531..b9042ce5de 100644--- a/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs+++ b/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs@@ -65,7 +65,7 @@ pub(super) fn validate_connection_refs_against(connections: Option<&[FlowConnection]>,) -> Vec<String> {use crate::integrations::composio::contract::validation::{- ConnectedAccountRef, ConnectionRefNode, validate_connection_refs as validate,+ validate_connection_refs as validate, ConnectedAccountRef, ConnectionRefNode,};let nodes: Vec<_> = graphdiff --git a/crates/openhuman-core/src/flows/ops/definitions.rs b/crates/openhuman-core/src/flows/ops/definitions.rsindex 897a3b9399..bde9d4d11f 100644--- a/crates/openhuman-core/src/flows/ops/definitions.rs+++ b/crates/openhuman-core/src/flows/ops/definitions.rs@@ -57,12 +57,7 @@ pub async fn flows_create(graph_json: Value,require_approval: bool,) -> Result<Outcome<Flow>, String> {- let graph = validate_and_migrate_graph(- &crate::core::runtime::DispatchCtx::ambient(),- config,- graph_json,- )- .await?;+ let graph = validate_and_migrate_graph(&crate::core::runtime::DispatchCtx::ambient(), config, graph_json).await?;// Rule 1: automatic triggers create DISABLED — the user must arm them// explicitly.@@ -187,8 +182,7 @@ 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(config, graph)- .await+ ensure_config_aware_engine_compatible(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/discovery.rs b/crates/openhuman-core/src/flows/ops/discovery.rsindex 45a7e08d88..adae05f5bc 100644--- a/crates/openhuman-core/src/flows/ops/discovery.rs+++ b/crates/openhuman-core/src/flows/ops/discovery.rs@@ -51,8 +51,8 @@ pub async fn flows_discover(config: &Config,stream: Option<FlowStreamTarget>,) -> Result<Outcome<Vec<FlowSuggestion>>, String> {+ use crate::agent::turn_origin::{with_origin, AgentTurnOrigin};use crate::agent::OpenHumanSessionHost;- use crate::agent::turn_origin::{AgentTurnOrigin, with_origin};tracing::info!(target: "flows",diff --git a/crates/openhuman-core/src/flows/ops/execution_tests.rs b/crates/openhuman-core/src/flows/ops/execution_tests.rsindex 3bf01a4040..d82e2fad67 100644--- a/crates/openhuman-core/src/flows/ops/execution_tests.rs+++ b/crates/openhuman-core/src/flows/ops/execution_tests.rs@@ -1,6 +1,6 @@use super::*;-use tinyflows::graph::GraphEvent;use tinyflows::graph::ids;+use tinyflows::graph::GraphEvent;#[test]fn graph_observations_are_adapted_without_changing_their_wire_shape() {diff --git a/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs b/crates/openhuman-core/src/flows/ops/tool_contract_gate.rsindex c7ed3a873b..908a34c844 100644--- a/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs+++ b/crates/openhuman-core/src/flows/ops/tool_contract_gate.rs@@ -58,7 +58,7 @@ pub(crate) fn toolkit_has_curated_catalog(toolkit: &str) -> bool {pub(crate) async fn validate_tool_contracts(config: &Config, graph: &WorkflowGraph) -> Vec<String> {use crate::integrations::composio::contract::validation::{- ToolContractNode, validate_tool_contract_nodes,+ validate_tool_contract_nodes, ToolContractNode,};let nodes: Vec<_> = graphdiff --git a/crates/openhuman-core/src/flows/ops/updates.rs b/crates/openhuman-core/src/flows/ops/updates.rsindex 68b9575267..7968fbba36 100644--- a/crates/openhuman-core/src/flows/ops/updates.rs+++ b/crates/openhuman-core/src/flows/ops/updates.rs@@ -103,12 +103,7 @@ async fn flows_update_inner(let graph_changed = graph_json.is_some();let graph = match graph_json {Some(raw) => {- let graph = validate_and_migrate_graph(- &crate::core::runtime::DispatchCtx::ambient(),- config,- raw,- )- .await?;+ let graph = validate_and_migrate_graph(&crate::core::runtime::DispatchCtx::ambient(), config, raw).await?;graph}None => {diff --git a/crates/openhuman-core/src/flows/ops/validation.rs b/crates/openhuman-core/src/flows/ops/validation.rsindex cce0fcf3bc..bf68aa4fdf 100644--- a/crates/openhuman-core/src/flows/ops/validation.rs+++ b/crates/openhuman-core/src/flows/ops/validation.rs@@ -11,8 +11,7 @@ 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(@@ -125,9 +124,7 @@ 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,@@ -169,15 +166,8 @@ 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')"));@@ -202,10 +192,7 @@ 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.rsindex d7cf7406c7..f8cec281bc 100644--- a/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs+++ b/crates/openhuman-core/src/flows/ops_agent_binding_tests.rs@@ -110,18 +110,14 @@ async fn agent_ref_unknown_is_rejected() {/// sees on rejection is this host's contract with it.#[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!(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.rsindex 1ab05cc6c0..9b38d0a9f6 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,13 +84,7 @@ 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.@@ -110,13 +104,7 @@ 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.@@ -147,13 +135,7 @@ 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@@ -188,13 +170,7 @@ 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()@@ -513,14 +489,9 @@ 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_builder_repair_tests.rs b/crates/openhuman-core/src/flows/ops_builder_repair_tests.rsindex 8ad1591bdd..0319800102 100644--- a/crates/openhuman-core/src/flows/ops_builder_repair_tests.rs+++ b/crates/openhuman-core/src/flows/ops_builder_repair_tests.rs@@ -3,60 +3,48 @@ use super::*;use crate::core::runtime::DispatchCtx;use crate::{config::Config,- flows::ops::{FlowStreamTarget, flows_build_with_extra_hidden_tools},+ flows::ops::{flows_build_with_extra_hidden_tools, FlowStreamTarget},};#[tokio::test]async fn classifies_backend_failures_without_classifying_graph_timeouts() {let config = Config::default();- assert!(- is_backend_or_infrastructure_failure(- &config,- "File upload failed: Backend returned 500 Internal Server Error"- )- .await- .unwrap()- );- assert!(- !is_backend_or_infrastructure_failure(- &config,- "File upload failed: Backend returned 400 Bad Request"- )- .await- .unwrap()- );- assert!(- is_backend_or_infrastructure_failure(- &config,- "connection timed out while calling file storage"- )- .await- .unwrap()- );- assert!(- is_backend_or_infrastructure_failure(- &config,- "POST https://api.example.test/files failed: connection timed out"- )- .await- .unwrap()- );- assert!(- !is_backend_or_infrastructure_failure(- &config,- "agent node fetch_profile timed out after 30 seconds"- )- .await- .unwrap()- );- assert!(- !is_backend_or_infrastructure_failure(- &config,- "required argument resolved null: nodes.get_link.item.json.url"- )- .await- .unwrap()- );+ assert!(is_backend_or_infrastructure_failure(+ &config,+ "File upload failed: Backend returned 500 Internal Server Error"+ )+ .await+ .unwrap());+ assert!(!is_backend_or_infrastructure_failure(+ &config,+ "File upload failed: Backend returned 400 Bad Request"+ )+ .await+ .unwrap());+ assert!(is_backend_or_infrastructure_failure(+ &config,+ "connection timed out while calling file storage"+ )+ .await+ .unwrap());+ assert!(is_backend_or_infrastructure_failure(+ &config,+ "POST https://api.example.test/files failed: connection timed out"+ )+ .await+ .unwrap());+ assert!(!is_backend_or_infrastructure_failure(+ &config,+ "agent node fetch_profile timed out after 30 seconds"+ )+ .await+ .unwrap());+ assert!(!is_backend_or_infrastructure_failure(+ &config,+ "required argument resolved null: nodes.get_link.item.json.url"+ )+ .await+ .unwrap());}#[tokio::test]@@ -68,15 +56,13 @@ async fn backend_repair_message_explains_why_the_graph_was_preserved() {assert!(message.contains("workflow was not changed"));assert!(message.contains("HTTP 503 from file storage"));- assert!(- backend_repair_message(- &Config::default(),- "agent node fetch_profile timed out after 30 seconds",- )- .await- .unwrap()- .is_none()- );+ assert!(backend_repair_message(+ &Config::default(),+ "agent node fetch_profile timed out after 30 seconds",+ )+ .await+ .unwrap()+ .is_none());}#[test]@@ -111,12 +97,10 @@ fn repair_backend_failure_returns_no_proposal_before_starting_the_builder() {assert_eq!(outcome.value["proposal"], Value::Null);assert_eq!(outcome.value["error"], Value::Null);- assert!(- outcome.value["assistant_text"]- .as_str()- .expect("assistant text")- .contains("workflow was not changed")- );+ assert!(outcome.value["assistant_text"]+ .as_str()+ .expect("assistant text")+ .contains("workflow was not changed"));let request_id = format!("backend-repair-{}", uuid::Uuid::new_v4());let stream = FlowStreamTarget {@@ -144,11 +128,10 @@ fn repair_backend_failure_returns_no_proposal_before_starting_the_builder() {};assert_eq!(done.event, "chat_done");assert_eq!(done.thread_id, "backend-repair-thread");- assert!(- done.full_response- .as_deref()- .expect("terminal response text")- .contains("workflow was not changed")- );+ assert!(done+ .full_response+ .as_deref()+ .expect("terminal response text")+ .contains("workflow was not changed"));});}diff --git a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rsindex 8d2db3c32d..512a1c4659 100644--- a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs+++ b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs@@ -13,8 +13,7 @@ async fn resolver_lookup_rejects_an_incompatible_saved_child() {).unwrap();- let error = load_engine_compatible_flow_graph(&config, &child.id)- .await+ let error = load_engine_compatible_flow_graph(&config, &child.id).await.expect_err("resolver lookup must reject an unsafe legacy child");assert!(error.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN),@@ -44,8 +43,7 @@ async fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {).unwrap();- let error = load_engine_compatible_flow_graph(&config, &child.id)- .await+ let error = load_engine_compatible_flow_graph(&config, &child.id).await.expect_err("resolver lookup must reject an unsafe saved grandchild");assert!(error.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN),@@ -58,12 +56,7 @@ 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_migration_and_side_effect_tests.rs b/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rsindex 0bd6d8eebd..4f1878ba28 100644--- a/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs+++ b/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs@@ -334,15 +334,13 @@ async fn flows_update_does_not_force_require_approval_on_readonly_graph() {async fn strict_gate_passes_a_valid_graph_and_rejects_a_structurally_invalid_one() {let config = Config::default();// A trigger-only graph is structurally valid and has no outbound gates.- assert!(- strict_gate(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &trigger_only_graph()- )- .await- .is_ok()- );+ assert!(strict_gate(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &trigger_only_graph()+ )+ .await+ .is_ok());// No trigger → structural failure surfaced by strict mode.let bad = json!({@@ -474,16 +472,14 @@ async fn referenced_child_compatibility_stops_at_saved_workflow_cycles() {.unwrap();let candidate = structurally_valid_graph(referenced_child_graph(&flow_a.id));- assert!(- config_aware_engine_compatibility_errors(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- serde_json::to_value(candidate).unwrap(),- )- .await- .unwrap()- .is_empty()- );+ assert!(config_aware_engine_compatibility_errors(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ serde_json::to_value(candidate).unwrap(),+ )+ .await+ .unwrap()+ .is_empty());}// ── core-managed drafts (F5) ─────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs b/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rsindex c126d29f6b..1366647153 100644--- a/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs+++ b/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs@@ -329,12 +329,10 @@ async fn flows_resume_marks_a_checkpoint_with_an_incompatible_saved_child_failedlet run_row = flows_get_run(&config, &thread_id).await.unwrap().value;assert_eq!(run_row.status, "failed");assert!(run_row.pending_approvals.is_empty());- assert!(- run_row- .error- .as_deref()- .is_some_and(|value| value.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN))- );+ assert!(run_row+ .error+ .as_deref()+ .is_some_and(|value| value.contains(UNSUPPORTED_NESTED_CONDITIONAL_FAN_IN)));let flow = flows_get(&config, &created.value.id).await.unwrap().value;assert_eq!(flow.last_status.as_deref(), Some("failed"));}diff --git a/crates/openhuman-core/src/flows/ops_resume_race_tests.rs b/crates/openhuman-core/src/flows/ops_resume_race_tests.rsindex 1a9306acc5..9aa9f50a36 100644--- a/crates/openhuman-core/src/flows/ops_resume_race_tests.rs+++ b/crates/openhuman-core/src/flows/ops_resume_race_tests.rs@@ -3,19 +3,17 @@ use super::*;fn insert_parked_run(config: &Config, flow_id: &str, run_id: &str) {let now = Utc::now().to_rfc3339();store::insert_flow_run(config, run_id, flow_id, run_id, &now).unwrap();- assert!(- store::finish_flow_run(- config,- run_id,- "pending_approval",- &now,- &[],- &["gate".into()],- None,- Some("parked-graph"),- )- .unwrap()- );+ assert!(store::finish_flow_run(+ config,+ run_id,+ "pending_approval",+ &now,+ &[],+ &["gate".into()],+ None,+ Some("parked-graph"),+ )+ .unwrap());}async fn park_approval_flow(config: &Config, name: &str) -> (String, String, Vec<String>) {@@ -219,19 +217,17 @@ async fn compatibility_refusal_does_not_settle_a_resume_claimed_after_its_snapshlet current_flow = store::get_flow(&config, &flow_id).unwrap().unwrap();let hash = compute_graph_hash(&incompatible_graph, current_flow.require_approval).unwrap();let row = store::get_flow_run(&config, &run_id).unwrap().unwrap();- assert!(- store::finish_flow_run(- &config,- &run_id,- "pending_approval",- row.finished_at.as_deref().unwrap_or(&row.started_at),- &row.steps,- &pending,- None,- Some(&hash),- )- .unwrap()- );+ assert!(store::finish_flow_run(+ &config,+ &run_id,+ "pending_approval",+ row.finished_at.as_deref().unwrap_or(&row.started_at),+ &row.steps,+ &pending,+ None,+ Some(&hash),+ )+ .unwrap());let summary_before = current_flow.last_status;let mut owner = None;diff --git a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rsindex da4dc331f2..c9eb26ff8b 100644--- a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs+++ b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs@@ -3,19 +3,17 @@ use super::*;fn insert_parked_run(config: &Config, flow_id: &str, run_id: &str) {let now = Utc::now().to_rfc3339();store::insert_flow_run(config, run_id, flow_id, run_id, &now).unwrap();- assert!(- store::finish_flow_run(- config,- run_id,- "pending_approval",- &now,- &[],- &["gate".into()],- None,- Some("parked-graph"),- )- .unwrap()- );+ assert!(store::finish_flow_run(+ config,+ run_id,+ "pending_approval",+ &now,+ &[],+ &["gate".into()],+ None,+ Some("parked-graph"),+ )+ .unwrap());}#[tokio::test]diff --git a/crates/openhuman-core/src/flows/ops_tests.rs b/crates/openhuman-core/src/flows/ops_tests.rsindex 711528cafd..9c0b6db025 100644--- a/crates/openhuman-core/src/flows/ops_tests.rs+++ b/crates/openhuman-core/src/flows/ops_tests.rs@@ -104,9 +104,7 @@ 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}");@@ -349,7 +347,7 @@ fn graph(value: Value) -> WorkflowGraph {fn seed_app_session_for_gate_test(tmp: &TempDir) {use crate::security::credentials::{- APP_SESSION_PROVIDER, AuthService, DEFAULT_AUTH_PROFILE_NAME,+ AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,};// `verify_session_active` reads from `config.config_path.parent()`, which// `test_config` sets to `tmp.path()` itself (distinct from@@ -372,7 +370,7 @@ fn seed_app_session_for_gate_test(tmp: &TempDir) {// so none of this touches a live Composio backend.use crate::integrations::composio::catalog::{- ProbedOutputSample, ToolContract, seed_live_catalog_cache, seed_probe_cache,+ seed_live_catalog_cache, seed_probe_cache, ProbedOutputSample, ToolContract,};fn seeded_slack_send_contract() -> ToolContract {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.rsindex f8978c93a6..573cd4c72d 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@@ -1,5 +1,5 @@use super::*;-use crate::integrations::composio::catalog::{ToolContract, seed_live_catalog_cache};+use crate::integrations::composio::catalog::{seed_live_catalog_cache, ToolContract};fn seeded_alias_contract() -> ToolContract {ToolContract {@@ -121,8 +121,8 @@ async fn graph_wiring_warnings_resolves_a_separated_action_slug_alias() {/// (`notion`, not `slack`/`gmail`) since it seeds different `is_curated`/// content than every other test sharing those keys.#[tokio::test]-async fn validate_tool_contracts_rejects_a_real_but_uncurated_action_on_a_statically_catalogued_toolkit()- {+async fn validate_tool_contracts_rejects_a_real_but_uncurated_action_on_a_statically_catalogued_toolkit(+) {seed_live_catalog_cache("notion",vec![ToolContract {@@ -282,8 +282,8 @@ 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()- {+async fn validate_tool_contracts_allows_arbitrary_arg_names_when_schema_permits_additional_properties(+) {seed_live_catalog_cache("argschemaadditional",vec![ToolContract {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.rsindex 30e56b16dc..17687985a9 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,12 +175,7 @@ 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!(@@ -199,12 +194,7 @@ 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(),@@ -220,12 +210,7 @@ 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"));@@ -248,12 +233,7 @@ 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!(@@ -303,12 +283,7 @@ 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/registration_tests.rs b/crates/openhuman-core/src/flows/registration_tests.rsindex a8954febbd..d0037eee6e 100644--- a/crates/openhuman-core/src/flows/registration_tests.rs+++ b/crates/openhuman-core/src/flows/registration_tests.rs@@ -1,5 +1,5 @@use super::*;-use serde_json::{Value, json};+use serde_json::{json, Value};/// The persisted catalogue is recorded in session transcripts/// (`session_host/recorded_tools.rs`), so every tool's name, description,diff --git a/crates/openhuman-core/src/flows/schemas.rs b/crates/openhuman-core/src/flows/schemas.rsindex 83888af3b9..680d4cdae6 100644--- a/crates/openhuman-core/src/flows/schemas.rs+++ b/crates/openhuman-core/src/flows/schemas.rs@@ -177,7 +177,8 @@ fn expected_version_input() -> FieldSchema {FieldSchema {name: "expected_version",ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Optimistic-concurrency token: the flow's `updated_at` as last observed. If the \+ comment:+ "Optimistic-concurrency token: the flow's `updated_at` as last observed. If the \flow has changed since, the write is refused with a structured version_conflict \error carrying the current flow, instead of clobbering. Omit for last-write-wins.",required: false,diff --git a/crates/openhuman-core/src/flows/schemas/builder_schemas.rs b/crates/openhuman-core/src/flows/schemas/builder_schemas.rsindex 1293ce60dc..17577eb63a 100644--- a/crates/openhuman-core/src/flows/schemas/builder_schemas.rs+++ b/crates/openhuman-core/src/flows/schemas/builder_schemas.rs@@ -2,8 +2,8 @@//! catalog it browses, and workflow discovery suggestions.use super::{- ControllerSchema, FieldSchema, TypeSchema, id_input, stream_request_id_input,- stream_thread_id_input, suggestions_output,+ id_input, stream_request_id_input, stream_thread_id_input, suggestions_output,+ ControllerSchema, FieldSchema, TypeSchema,};/// Builds the schema for `function` when this group owns it.@@ -166,20 +166,17 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {comment: "The exact Composio action slug (e.g. `GMAIL_SEND_EMAIL`).",required: true,}],- outputs: vec![- FieldSchema {- name: "contract",- ty: TypeSchema::Json,- comment: "The action contract: { slug, toolkit, description, required_args, input_schema, output_fields, output_schema, primary_array_path, is_curated }.",- required: true,- },- FieldSchema {- name: "runtime_gate",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Present when this real action is outside the toolkit's curated runtime allowlist and will be rejected on every real run.",- required: false,- },- ],+ outputs: vec![FieldSchema {+ name: "contract",+ ty: TypeSchema::Json,+ comment: "The action contract: { slug, toolkit, description, required_args, input_schema, output_fields, output_schema, primary_array_path, is_curated }.",+ required: true,+ }, FieldSchema {+ name: "runtime_gate",+ ty: TypeSchema::Option(Box::new(TypeSchema::String)),+ comment: "Present when this real action is outside the toolkit's curated runtime allowlist and will be rejected on every real run.",+ required: false,+ }],}),"discover" => Some(ControllerSchema {namespace: "flows",diff --git a/crates/openhuman-core/src/flows/schemas/definition_schemas.rs b/crates/openhuman-core/src/flows/schemas/definition_schemas.rsindex 02baf34745..0da7320f84 100644--- a/crates/openhuman-core/src/flows/schemas/definition_schemas.rs+++ b/crates/openhuman-core/src/flows/schemas/definition_schemas.rs@@ -3,8 +3,8 @@//! approval/connection manifests derived from a graph.use super::{- ControllerSchema, FieldSchema, TypeSchema, expected_version_input, flow_connection_fields,- flow_output, id_input, require_approval_input, strict_input,+ expected_version_input, flow_connection_fields, flow_output, id_input, require_approval_input,+ strict_input, ControllerSchema, FieldSchema, TypeSchema,};/// Builds the schema for `function` when this group owns it.@@ -24,7 +24,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {FieldSchema {name: "graph",ty: TypeSchema::Json,- comment: "A tinyflows WorkflowGraph (nodes + edges); validated and migrated on save.",+ comment:+ "A tinyflows WorkflowGraph (nodes + edges); validated and migrated on save.",required: true,},require_approval_input(),@@ -287,7 +288,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {"approval_manifest" => Some(ControllerSchema {namespace: "flows",function: "approval_manifest",- description: "Compute the approval manifest for a saved flow (by id) or a candidate graph: \+ description:+ "Compute the approval manifest for a saved flow (by id) or a candidate graph: \every ApprovalGate permission a run will prompt for, joined against the flow's \existing flow_tool_trust grants — the data behind the consolidated save+enable \pre-authorization card. Entries carry kind approvable|blocked|dynamic|agent.",@@ -309,7 +311,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {FieldSchema {name: "entries",ty: TypeSchema::Array(Box::new(TypeSchema::Json)),- comment: "One per relevant node/tool: {kind: approvable|blocked|dynamic|agent, \+ comment:+ "One per relevant node/tool: {kind: approvable|blocked|dynamic|agent, \node_id, tool_name?, label, class?}.",required: true,},@@ -329,7 +332,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {FieldSchema {name: "gate_installed",ty: TypeSchema::Bool,- comment: "False when the approval gate is disabled — nothing ever prompts, so \+ comment:+ "False when the approval gate is disabled — nothing ever prompts, so \missing is empty by definition.",required: true,},diff --git a/crates/openhuman-core/src/flows/schemas/draft_schemas.rs b/crates/openhuman-core/src/flows/schemas/draft_schemas.rsindex 9bc4e2d78c..0cddc104c0 100644--- a/crates/openhuman-core/src/flows/schemas/draft_schemas.rs+++ b/crates/openhuman-core/src/flows/schemas/draft_schemas.rs@@ -2,8 +2,8 @@//! graph is promoted into a saved flow.use super::{- ControllerSchema, FieldSchema, TypeSchema, draft_output, flow_output, id_input,- require_approval_input,+ draft_output, flow_output, id_input, require_approval_input, ControllerSchema, FieldSchema,+ TypeSchema,};/// Builds the schema for `function` when this group owns it.diff --git a/crates/openhuman-core/src/flows/schemas/run_schemas.rs b/crates/openhuman-core/src/flows/schemas/run_schemas.rsindex 55005dfd44..6d087a6494 100644--- a/crates/openhuman-core/src/flows/schemas/run_schemas.rs+++ b/crates/openhuman-core/src/flows/schemas/run_schemas.rs@@ -1,8 +1,8 @@//! Schemas for executing saved flows and inspecting their run history.use super::{- ControllerSchema, FieldSchema, TypeSchema, id_input, run_detached_output_fields,- run_output_fields,+ id_input, run_detached_output_fields, run_output_fields, ControllerSchema, FieldSchema,+ TypeSchema,};/// Builds the schema for `function` when this group owns it.@@ -11,7 +11,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {"run" => Some(ControllerSchema {namespace: "flows",function: "run",- description: "Run a saved flow to completion (or until it pauses on a human-approval gate).",+ description:+ "Run a saved flow to completion (or until it pauses on a human-approval gate).",inputs: vec![id_input("Identifier of the flow to run."),FieldSchema {@@ -89,7 +90,8 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {FieldSchema {name: "thread_id",ty: TypeSchema::String,- comment: "The checkpoint thread id returned by `flows_run` / a prior `flows_resume`.",+ comment:+ "The checkpoint thread id returned by `flows_run` / a prior `flows_resume`.",required: true,},FieldSchema {@@ -144,13 +146,15 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {FieldSchema {name: "cancelled",ty: TypeSchema::Bool,- comment: "True once the run is cancelled or its cancellation requested.",+ comment:+ "True once the run is cancelled or its cancellation requested.",required: true,},FieldSchema {name: "was_in_flight",ty: TypeSchema::Bool,- comment: "True when a live run task was signalled to abort; false when \+ comment:+ "True when a live run task was signalled to abort; false when \a parked/stale run row was settled directly.",required: true,},@@ -222,9 +226,7 @@ pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {window. Never removes a running or pending_approval run. Pruning also \happens automatically on every new run; this is an explicit on-demand \sweep.",- inputs: vec![id_input(- "Identifier of the flow whose run history to prune.",- )],+ inputs: vec![id_input("Identifier of the flow whose run history to prune.")],outputs: vec![FieldSchema {name: "result",ty: TypeSchema::Object {diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rsindex 766c097772..854a10d4e4 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs@@ -12,14 +12,14 @@ use std::borrow::Cow;use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};use super::*;use crate::config::Config;use crate::flows::agent_route::{- AgentRoute, harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref,+ harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref, AgentRoute,};/// [`AgentRunner`] backing an `agent` node's `agent_ref`. It runs the selecteddiff --git a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs b/crates/openhuman-core/src/flows/tinyflows/caps/code.rsindex 3beaf27008..83b179c481 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/code.rs@@ -9,7 +9,7 @@ use crate::core::runtime::DispatchCtx;use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rsindex ecf919b9b2..8087cc9a1a 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs@@ -12,14 +12,14 @@use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};use super::*;use crate::config::{Config, HttpRequestConfig};-use crate::security::SecurityPolicy;use crate::security::credentials::{HttpCredential, HttpCredentialsStore};+use crate::security::SecurityPolicy;use crate::tools::http_request_tool;use tinybox_bus::CommandClass;use tinytools::Tool as _;diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rsindex cff79e191b..4611d7f543 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http_tests.rs@@ -9,11 +9,9 @@ fn credential_resolution_ignores_absent_and_foreign_refs() {let tmp = tempfile::TempDir::new().unwrap();let store = store(&tmp);assert!(resolve_http_credential(&store, None).unwrap().is_none());- assert!(- resolve_http_credential(&store, Some("composio:x:y"))- .unwrap()- .is_none()- );+ assert!(resolve_http_credential(&store, Some("composio:x:y"))+ .unwrap()+ .is_none());}#[test]diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs b/crates/openhuman-core/src/flows/tinyflows/caps/llm.rsindex 7ec03f8fcb..58b5e453dd 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/llm.rs@@ -8,7 +8,7 @@use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rsindex 3162342e45..9df7c4f112 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs@@ -16,9 +16,9 @@ pub(crate) use crate::integrations::composio::flow_gate::composio_connection_id;use std::sync::Arc;use async_trait::async_trait;-use serde_json::Value;#[cfg(test)]use serde_json::json;+use serde_json::Value;use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};#[cfg(test)]@@ -30,11 +30,11 @@ use crate::config::HttpRequestConfig;#[cfg(test)]use crate::flows;#[cfg(test)]-use crate::security::GateDecision;-use crate::security::SecurityPolicy;-#[cfg(test)]use crate::security::credentials::HttpCredential;use crate::security::credentials::HttpCredentialsStore;+#[cfg(test)]+use crate::security::GateDecision;+use crate::security::SecurityPolicy;use tinybox_bus::CommandClass;use super::*;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.rsindex 8ffe8fa8d1..476f84bcd2 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@@ -27,22 +27,18 @@ fn http_request_node_tier_gate_blocks_readonly_allows_higher() {// Supervised/full do not hard-block — they fall through to the// ApprovalGate (which performs the Prompt round-trip).- assert!(- enforce_node_tier_gate(- &policy(AutonomyLevel::Supervised),- CommandClass::Network,- "http_request"- )- .is_ok()- );- assert!(- enforce_node_tier_gate(- &policy(AutonomyLevel::Full),- CommandClass::Network,- "http_request"- )- .is_ok()- );+ assert!(enforce_node_tier_gate(+ &policy(AutonomyLevel::Supervised),+ CommandClass::Network,+ "http_request"+ )+ .is_ok());+ assert!(enforce_node_tier_gate(+ &policy(AutonomyLevel::Full),+ CommandClass::Network,+ "http_request"+ )+ .is_ok());}/// The tier gate a `code` (Write-class) node calls: BLOCKED under read-only,@@ -51,22 +47,18 @@ fn http_request_node_tier_gate_blocks_readonly_allows_higher() {fn code_node_tier_gate_blocks_readonly_allows_full() {use crate::security::AutonomyLevel;- assert!(- enforce_node_tier_gate(- &policy(AutonomyLevel::ReadOnly),- CommandClass::Write,- "code"- )- .is_err()- );- assert!(- enforce_node_tier_gate(- &policy(AutonomyLevel::Supervised),- CommandClass::Write,- "code"- )- .is_ok()- );+ assert!(enforce_node_tier_gate(+ &policy(AutonomyLevel::ReadOnly),+ CommandClass::Write,+ "code"+ )+ .is_err());+ assert!(enforce_node_tier_gate(+ &policy(AutonomyLevel::Supervised),+ CommandClass::Write,+ "code"+ )+ .is_ok());assert!(enforce_node_tier_gate(&policy(AutonomyLevel::Full), CommandClass::Write, "code").is_ok());@@ -289,20 +281,22 @@ fn prompt_decision_escalates_default_workflow_origin() {/// escalation — it's already forced through the parking flow.#[test]fn prompt_decision_does_not_re_escalate_already_gated_workflow() {- assert!(- escalated_origin_for_prompt(GateDecision::Prompt, Some(workflow_origin("flow-1", true)))- .is_none()- );+ assert!(escalated_origin_for_prompt(+ GateDecision::Prompt,+ Some(workflow_origin("flow-1", true))+ )+ .is_none());}/// An `Allow` tier decision never escalates, regardless of the workflow's/// `require_approval` toggle — Full-tier runs keep running unattended.#[test]fn allow_decision_never_escalates() {- assert!(- escalated_origin_for_prompt(GateDecision::Allow, Some(workflow_origin("flow-1", false)))- .is_none()- );+ assert!(escalated_origin_for_prompt(+ GateDecision::Allow,+ Some(workflow_origin("flow-1", false))+ )+ .is_none());}/// No scoped origin (or a non-Workflow origin) never escalates — there isdiff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rsindex e2ea1f61e9..c786002dc7 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tier_live_config_tests.rs@@ -190,17 +190,15 @@ async fn captured_agent_and_config_fn_tiers_are_not_replaced_by_parent_file() {&captured.workspace_dir,&captured.action_dir,);- assert!(- enforce_current_node_tier_gate(- &captured_ctx,- &captured,- &captured_policy,- CommandClass::Write,- "code"- )- .await- .is_err()- );+ assert!(enforce_current_node_tier_gate(+ &captured_ctx,+ &captured,+ &captured_policy,+ CommandClass::Write,+ "code"+ )+ .await+ .is_err());// A fixed ceiling contributes independently of a disabled file tier.parent_file.autonomy.enabled = false;diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs b/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rsindex f67b0b08d4..8797ee1242 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/prompt.rs@@ -12,13 +12,13 @@use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};use super::*;use crate::config::Config;-use crate::inference::provider::{BilledUsage, is_raw_passthrough_model};+use crate::inference::provider::{is_raw_passthrough_model, BilledUsage};use tinyagents_session::transcript::TranscriptMessage;use tinyflows::nodes::integration::agent_prompt;diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs b/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rsindex 35bd09d23e..7bfb6db87e 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/resolver.rs@@ -7,7 +7,7 @@use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::*;use tinyflows::error::{EngineError, Result};diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs b/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rsindex 31f52bb4da..eaebdf2bb5 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/tools/native.rs@@ -5,7 +5,7 @@ use serde_json::Value;use tinybox_bus::CommandClass;use tinyflows::error::{EngineError, Result};-use super::{NATIVE_TOOL_PREFIX, ToolBackend, ToolCallCtx};+use super::{ToolBackend, ToolCallCtx, NATIVE_TOOL_PREFIX};pub(crate) struct NativeToolBackend;diff --git a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rsindex e3670167e5..1f263bfe7f 100644--- a/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs+++ b/crates/openhuman-core/src/flows/tinyflows/memory_adapter.rs@@ -34,7 +34,7 @@use std::sync::Arc;use async_trait::async_trait;-use serde_json::{Value, json};+use serde_json::{json, Value};use tinyflows::caps::MemoryProvider;use tinyflows::error::{EngineError, Result};@@ -43,15 +43,15 @@ use crate::agent::turn_origin;use crate::agent::turn_origin::{AgentTurnOrigin, TrustedAutomationSource};use crate::config::Config;use crate::flows::{- FLOWS_TAG, cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, forget_matching,- remember_keyed,+ cross_flow_filter, flow_filter, flow_key_of, flow_key_tag, forget_matching, remember_keyed,+ FLOWS_TAG,};-use crate::memory::MemoryError;use crate::memory::types::{FetchParams, RecallParams};-use crate::security::SecurityPolicy;+use crate::memory::MemoryError;use crate::security::approval::{- ApprovalGate, ExecutionOutcome, GateOutcome, redact_args, summarize_action,+ redact_args, summarize_action, ApprovalGate, ExecutionOutcome, GateOutcome,};+use crate::security::SecurityPolicy;use tinybox_bus::CommandClass;use tinymemory_api::wrap_untrusted_for_agent;use tinymemory_api::{Hit, LearningKind, MemoryMeta, MetaFilter, SourceKind};diff --git a/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs b/crates/openhuman-core/src/flows/tinyflows/observability_tests.rsindex 8cce1f390e..b2263a8b1c 100644--- a/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/observability_tests.rs@@ -8,8 +8,8 @@ use super::*;/// silently returns the UI to that state with every other test still green.#[test]fn on_step_start_is_implemented_so_the_running_status_can_reach_the_canvas() {- use std::sync::Arc;use std::sync::atomic::{AtomicBool, Ordering};+ use std::sync::Arc;// A probe observer whose `on_step_start` records that the *trait's*// dispatch reached an override rather than the blanket default.diff --git a/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs b/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rsindex 935abc8fe7..1fa075e43d 100644--- a/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs+++ b/crates/openhuman-core/src/flows/tinyflows/tinyflows_capabilities_tests.rs@@ -1,6 +1,6 @@use super::*;use crate::flows::agent_route::{- AgentRoute, harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref,+ harness_model_default_override, route_custom_entry_lookup, route_for_agent_ref, AgentRoute,};use crate::flows::tinyflows::caps::OpenHumanCode;@@ -421,7 +421,7 @@ fn route_custom_entry_lookup_falls_back_when_no_entry_exists() {/// not cross, even when a third context is ambient.#[tokio::test]async fn adapters_act_for_the_context_they_were_handed_not_the_ambient_one() {- use crate::core::runtime::{ComponentSet, DispatchCtx, DomainSet, context::CoreContext};+ use crate::core::runtime::{context::CoreContext, ComponentSet, DispatchCtx, DomainSet};let tmp = TempDir::new().unwrap();let config = test_config(&tmp);diff --git a/crates/openhuman-core/src/modules/tinyflows.rs b/crates/openhuman-core/src/modules/tinyflows.rsindex 5ee74430ca..fd525a9a5f 100644--- a/crates/openhuman-core/src/modules/tinyflows.rs+++ b/crates/openhuman-core/src/modules/tinyflows.rs@@ -53,7 +53,7 @@ pub(crate) fn disabled_message() -> String {mod imp {#[cfg(not(test))]use super::MODULE_ID;- use super::{HOST_BUS_NAME, ServedObjectRegistration, disabled_message};+ use super::{disabled_message, ServedObjectRegistration, HOST_BUS_NAME};use crate::config::Config;#[cfg(not(test))]use crate::modules::ops;@@ -131,11 +131,7 @@ 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}"))}@@ -148,11 +144,7 @@ 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}"))}@@ -304,13 +296,12 @@ 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"))]mod imp {- use super::{ServedObjectRegistration, disabled_message};+ use super::{disabled_message, ServedObjectRegistration};use crate::config::Config;fn unavailable(config: &Config) -> String {@@ -366,8 +357,7 @@ 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 switchdiff --git a/crates/openhuman-core/src/modules/tinyflows_fixture.rs b/crates/openhuman-core/src/modules/tinyflows_fixture.rsindex ab94e8cf2d..f1c2a78ae7 100644--- a/crates/openhuman-core/src/modules/tinyflows_fixture.rs+++ b/crates/openhuman-core/src/modules/tinyflows_fixture.rs@@ -1,8 +1,8 @@//! The tinyflows module linked into the test binary: the `static-link` build of//! `tinyflows-module`, attached once to the process-wide module host.-use crate::config::Config;use crate::config::schema::ModuleSourceMode;+use crate::config::Config;use crate::modules::{linked::register_linked, ops};use tokio::sync::OnceCell;