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
fix: correct test module paths in approval redact and store persistence tests
Steven Enamakel5d4562a785d3
diff --git a/crates/openhuman-core/src/security/approval/redact_tests.rs b/crates/openhuman-core/src/security/approval/redact_tests.rsindex d2bf06ce90..7a050efc7b 100644--- a/crates/openhuman-core/src/security/approval/redact_tests.rs+++ b/crates/openhuman-core/src/security/approval/redact_tests.rs@@ -336,3 +336,58 @@ fn summarize_action_skill_install_without_entry_id_falls_back() {assert!(summary.contains("skill_registry_install"));assert!(summary.contains("bytes"));}++#[test]+fn non_string_sensitive_values_redact_to_kind_markers_and_nested_values_recurse() {+ let args = json!({+ "metadata": {+ "Subject": "Confidential subject",+ "auth": true,+ "message": 42,+ "password": null,+ "user": { "id": "user-123", "name": "Alice" },+ "attempts": 3,+ "safe_list": [+ "open /Users/frank/Desktop/report.txt",+ { "content": "nested secret" }+ ]+ }+ });+ let red = redact_args(&args);+ assert_eq!(+ red.pointer("/metadata/Subject"),+ Some(&json!("<redacted: string (20 chars)>"))+ );+ assert_eq!(red.pointer("/metadata/attempts"), Some(&json!(3)));+ assert_eq!(+ red.pointer("/metadata/auth"),+ Some(&json!("<redacted: bool>"))+ );+ assert_eq!(+ red.pointer("/metadata/message"),+ Some(&json!("<redacted: number>"))+ );+ assert_eq!(+ red.pointer("/metadata/password"),+ Some(&serde_json::Value::Null)+ );+ assert_eq!(+ red.pointer("/metadata/user"),+ Some(&json!("<redacted: object (2 keys)>"))+ );+ assert_eq!(+ red.pointer("/metadata/safe_list/0"),+ Some(&json!("open <HOME>/Desktop/report.txt"))+ );+ assert_eq!(+ red.pointer("/metadata/safe_list/1/content"),+ Some(&json!("<redacted: string (13 chars)>"))+ );+ assert_eq!(+ redact_args(&json!(+ "open /home/carol/report.md and C:\\Users\\dave\\x.txt"+ )),+ json!("open <HOME>/report.md and <HOME>\\x.txt")+ );+ assert_eq!(redact_args(&json!("/Users/erin")), json!("<HOME>"));+}diff --git a/crates/openhuman-core/src/security/approval/store_persistence_tests.rs b/crates/openhuman-core/src/security/approval/store_persistence_tests.rsindex 68705ba15b..96f251e990 100644--- a/crates/openhuman-core/src/security/approval/store_persistence_tests.rs+++ b/crates/openhuman-core/src/security/approval/store_persistence_tests.rs@@ -633,3 +633,34 @@ fn list_pending_for_flow_run_filters_to_the_matching_flow_and_run() {assert_eq!(rows.len(), 1);assert_eq!(rows[0].request_id, "a");}++#[test]+fn list_recent_decisions_marks_unparseable_args_instead_of_failing() {+ let (config, _dir) = test_config();+ insert_pending(&config, &sample("corrupt-json", "sess-A"), "sess-A").unwrap();+ with_connection(&config, |conn| {+ conn.execute(+ "UPDATE pending_approvals+ SET args_redacted = ?1, decided_at = ?2, decision = ?3+ WHERE request_id = ?4",+ params![+ "{not valid json",+ Utc::now().to_rfc3339(),+ ApprovalDecision::Deny.as_str(),+ "corrupt-json"+ ],+ )?;+ Ok(())+ })+ .unwrap();++ let rows = list_recent_decisions(&config, 10).unwrap();+ let row = rows+ .iter()+ .find(|row| row.request_id == "corrupt-json")+ .expect("corrupt audit row is still listed");+ assert_eq!(+ row.args_redacted,+ json!({ "_error": "args_redacted not valid JSON" })+ );+}