The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
chore(security): tidy imports and formatting
Steven Enamakel0fd6b5fb39d3
diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rsindex ef8d66aac6..4cd173f819 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate.rs@@ -84,8 +84,8 @@ use tinyagents_harness::host::security_gate::{GateDecision, ToolCallRequest};use crate::agent::tinyagents::policy_denial::PolicyDenial;use crate::security::approval::{redact_args, summarize_action, ApprovalGate, GateOutcome};use crate::security::policy::{GateDecision as PolicyGateDecision, SecurityPolicy};-use tinybox_bus::CommandClass;use crate::tools::agent_policy::{ToolPolicyAction, ToolPolicySession};+use tinybox_bus::CommandClass;use tinytools::{PermissionLevel, Tool};#[path = "security_gate_shell_analysis.rs"]diff --git a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rsindex 113b19b5b7..e1ff57e8bf 100644--- a/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/host/security_gate_tests.rs@@ -386,11 +386,7 @@ fn the_declared_category_can_only_raise_the_command_class() {OpenHumanSecurityGate::shell_decision(&full,&json!({ "command": "touch f" }),- &shell_analysis(- tinybox_bus::CommandClass::Write,- false,- &["touch", "f"],- ),+ &shell_analysis(tinybox_bus::CommandClass::Write, false, &["touch", "f"],),),Ok(PolicyGateDecision::Allow));@@ -399,11 +395,7 @@ fn the_declared_category_can_only_raise_the_command_class() {OpenHumanSecurityGate::shell_decision(&full,&json!({ "command": "touch f", "category": "destructive" }),- &shell_analysis(- tinybox_bus::CommandClass::Write,- false,- &["touch", "f"],- )+ &shell_analysis(tinybox_bus::CommandClass::Write, false, &["touch", "f"],)),Ok(PolicyGateDecision::Prompt));@@ -431,11 +423,7 @@ fn a_missing_command_argument_classifies_as_read_rather_than_panicking() {OpenHumanSecurityGate::shell_decision(&supervised,&json!({}),- &shell_analysis(- tinybox_bus::CommandClass::Read,- false,- &[],- ),+ &shell_analysis(tinybox_bus::CommandClass::Read, false, &[],),),Ok(PolicyGateDecision::Allow));diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs b/crates/openhuman-core/src/flows/tinyflows/caps/code.rsindex 4f7e4e0a8c..abe5c82f08 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/code.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/code.rs@@ -16,7 +16,7 @@ use super::*;use crate::agent::harness::definition::SandboxMode;use crate::config::Config;use crate::sandbox::{execute_in_sandbox, resolve_sandbox_policy};-use crate::security::{SecurityPolicy};+use crate::security::SecurityPolicy;use tinybox_bus::CommandClass;/// [`CodeRunner`] adapter running sandboxed user code viadiff --git a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs b/crates/openhuman-core/src/flows/tinyflows/caps/http.rsindex ea5ef3eafc..d7ba629b68 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/http.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/http.rs@@ -19,9 +19,9 @@ use tinyflows::error::{EngineError, Result};use super::*;use crate::config::{Config, HttpRequestConfig};use crate::security::credentials::{HttpCredential, HttpCredentialsStore};-use crate::security::{SecurityPolicy};-use tinybox_bus::CommandClass;+use crate::security::SecurityPolicy;use crate::tools::http_request_tool;+use tinybox_bus::CommandClass;use tinytools::Tool as _;/// [`HttpClient`] adapter over `HttpRequestTool`diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rsindex 817ba81023..c421e2d614 100644--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops.rs@@ -27,10 +27,10 @@ use crate::flows;#[cfg(test)]use crate::security::credentials::HttpCredential;use crate::security::credentials::HttpCredentialsStore;-use crate::security::{SecurityPolicy};-use tinybox_bus::CommandClass;+use crate::security::SecurityPolicy;#[cfg(test)]use crate::security::{GateDecision, POLICY_BLOCKED_MARKER};+use tinybox_bus::CommandClass;// The live Composio catalog and probe moved to `composio::catalog` -- the domain// that owns Composio's vocabulary. This import is the edge pointing the rightdiff --git a/crates/openhuman-core/src/modules/tinybox_tests.rs b/crates/openhuman-core/src/modules/tinybox_tests.rsindex d715f4920c..4e63e3cbd0 100644--- a/crates/openhuman-core/src/modules/tinybox_tests.rs+++ b/crates/openhuman-core/src/modules/tinybox_tests.rs@@ -525,7 +525,11 @@ fn every_member_the_host_calls_is_named_in_the_pinned_contract() {let mut unique = called.to_vec();unique.sort_unstable();unique.dedup();- assert_eq!(unique.len(), called.len(), "host member names must be distinct");+ assert_eq!(+ unique.len(),+ called.len(),+ "host member names must be distinct"+ );}#[tokio::test]diff --git a/crates/openhuman-core/src/security/mod.rs b/crates/openhuman-core/src/security/mod.rsindex d6d4483946..fdb24074a4 100644--- a/crates/openhuman-core/src/security/mod.rs+++ b/crates/openhuman-core/src/security/mod.rs@@ -40,12 +40,12 @@ pub use ops::*;pub use policy::validate_path_within_root;#[allow(unused_imports)]pub use policy::AutonomyLevel;+#[allow(unused_imports)]+pub use policy::GateDecision;pub use policy::SecurityPolicy;pub use policy::ToolOperation;pub use policy::{ensure_openhuman_scratch_dir, openhuman_scratch_dir};#[allow(unused_imports)]-pub use policy::GateDecision;-#[allow(unused_imports)]pub use policy::{TrustedAccess, TrustedRoot};pub use policy::{POLICY_BLOCKED_MARKER, POLICY_DENIED_MARKER};#[allow(unused_imports)]diff --git a/crates/openhuman-core/src/security/policy/mod.rs b/crates/openhuman-core/src/security/policy/mod.rsindex c2f07b85d7..f411af440d 100644--- a/crates/openhuman-core/src/security/policy/mod.rs+++ b/crates/openhuman-core/src/security/policy/mod.rs@@ -15,8 +15,8 @@ pub(crate) use path_checks::{ALWAYS_FORBIDDEN_PREFIXES, SENSITIVE_COMPONENTS, SENSITIVE_FILES, SENSITIVE_PAIRS,};pub use types::{- tool_result_artifacts_dir, ActionTracker, AutonomyLevel, CommandRiskLevel,- GateDecision, SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot, POLICY_BLOCKED_MARKER,+ tool_result_artifacts_dir, ActionTracker, AutonomyLevel, CommandRiskLevel, GateDecision,+ SecurityPolicy, ToolOperation, TrustedAccess, TrustedRoot, POLICY_BLOCKED_MARKER,POLICY_DENIED_MARKER,};diff --git a/crates/openhuman-core/src/security/policy/policy_disabled_tests.rs b/crates/openhuman-core/src/security/policy/policy_disabled_tests.rsindex 340128e2e0..1cdfe90366 100644--- a/crates/openhuman-core/src/security/policy/policy_disabled_tests.rs+++ b/crates/openhuman-core/src/security/policy/policy_disabled_tests.rs@@ -6,8 +6,8 @@//! likely to break, so it is asserted here beside the first.use super::*;-use tinybox_bus::CommandClass;use std::path::PathBuf;+use tinybox_bus::CommandClass;fn disabled_policy() -> SecurityPolicy {SecurityPolicy {diff --git a/crates/openhuman-core/src/security/policy/policy_paths_and_risk_tests.rs b/crates/openhuman-core/src/security/policy/policy_paths_and_risk_tests.rsindex cae73a281e..d501648f38 100644--- a/crates/openhuman-core/src/security/policy/policy_paths_and_risk_tests.rs+++ b/crates/openhuman-core/src/security/policy/policy_paths_and_risk_tests.rs@@ -73,9 +73,7 @@ fn parse_declared_class_maps_known_and_rejects_unknown() {#[cfg(feature = "modules")]#[test]fn tinybox_command_facts_drive_policy_and_keep_the_path_floor_when_disabled() {- use crate::modules::tinybox::contract::{- CommandAnalysis, CommandSegment,- };+ use crate::modules::tinybox::contract::{CommandAnalysis, CommandSegment};let write_segment = CommandSegment {source: "ls -la".into(),@@ -156,9 +154,7 @@ fn tinybox_command_facts_drive_policy_and_keep_the_path_floor_when_disabled() {#[cfg(feature = "modules")]#[test]fn tinybox_fact_allowlist_treats_heredoc_as_data_and_unknown_commands_as_writes() {- use crate::modules::tinybox::contract::{- CommandAnalysis, CommandSegment,- };+ use crate::modules::tinybox::contract::{CommandAnalysis, CommandSegment};let policy = SecurityPolicy {enabled: true,diff --git a/crates/openhuman-core/src/security/policy/proptest_tests.rs b/crates/openhuman-core/src/security/policy/proptest_tests.rsindex 8cc891c7ae..481deeeeff 100644--- a/crates/openhuman-core/src/security/policy/proptest_tests.rs+++ b/crates/openhuman-core/src/security/policy/proptest_tests.rs@@ -6,8 +6,8 @@//! the hand-enumerated cases in `policy_tests.rs`.use super::types::SecurityPolicy;-use tinybox_bus::CommandClass;use proptest::prelude::*;+use tinybox_bus::CommandClass;proptest! {#![proptest_config(ProptestConfig {diff --git a/crates/openhuman-core/src/tools/impl/filesystem/gate.rs b/crates/openhuman-core/src/tools/impl/filesystem/gate.rsindex 85b3f6c675..0bfaca8dab 100644--- a/crates/openhuman-core/src/tools/impl/filesystem/gate.rs+++ b/crates/openhuman-core/src/tools/impl/filesystem/gate.rs@@ -11,8 +11,8 @@ use async_trait::async_trait;use tinytools_std::filesystem::FsGate;use crate::security::policy::{TrustedAccess, TrustedRoot};-use tinybox_bus::CommandClass;use crate::security::{AutonomyLevel, GateDecision, SecurityPolicy};+use tinybox_bus::CommandClass;/// Clone `security` and scope it to `root`, a run's workspace descriptor root.///diff --git a/crates/openhuman-core/src/tools/native_ops.rs b/crates/openhuman-core/src/tools/native_ops.rsindex d62fbc977b..5bfcbb72bc 100644--- a/crates/openhuman-core/src/tools/native_ops.rs+++ b/crates/openhuman-core/src/tools/native_ops.rs@@ -5,10 +5,10 @@ use crate::agent::host_runtime::{NativeRuntime, RuntimeAdapter};use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::security::{SecurityPolicy};-use tinybox_bus::CommandClass;+use crate::security::SecurityPolicy;use crate::tools;use crate::tools::native_ops_types::{ExecuteToolOutcome, RuntimeToolSummary};+use tinybox_bus::CommandClass;use tinytools::{PermissionLevel, Tool, ToolCallOptions, ToolScope};use tracing::{debug, trace};