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: files changed crates/openhuman-core/src/storage/fenced_backend_tests.rs
Steven Enamakel7f8eeb7e9b11
diff --git a/crates/openhuman-core/src/storage/fenced_backend_tests.rs b/crates/openhuman-core/src/storage/fenced_backend_tests.rsindex 72e365248f..733a4b6e20 100644--- a/crates/openhuman-core/src/storage/fenced_backend_tests.rs+++ b/crates/openhuman-core/src/storage/fenced_backend_tests.rs@@ -422,3 +422,60 @@ impl StorageBackend for NoFencing {self.0.database(name)}}++/// The run ledger claims team tasks with `atomic_batch_checked`. The fenced+/// view must pass it through to a driver that supports it (the default trait+/// method answers `Unsupported`), and still refuse it for a stale lease.+#[tokio::test]+async fn a_checked_batch_reaches_the_driver_through_the_fenced_view() {+ use tinystoragedrivers::{ExpectedDocument, ReadCheck};++ let shared: Arc<dyn StorageBackend> = Arc::new(MemoryStorage::new());+ let a = Node::new("a", &shared);+ let docs = Arc::clone(a.scoped("plain").documents());+ docs.ensure_collection(&CollectionSpec::new("things"))+ .await+ .unwrap();++ let applied = docs+ .atomic_batch_checked(+ vec![ReadCheck {+ collection: "things".into(),+ id: "dependency".into(),+ expected: ExpectedDocument::Absent,+ }],+ vec![WriteOp::Put {+ collection: "things".into(),+ id: "claimed".into(),+ doc: json!({ "by": "a" }),+ precondition: Precondition::Absent,+ }],+ )+ .await+ .expect("the checked batch is not answered Unsupported");+ assert_eq!(applied.len(), 1);+ assert!(docs.get("things", "claimed").await.unwrap().is_some());++ // The dependency is validated: a check that no longer holds writes nothing.+ docs.put("things", "dependency", json!({}), Precondition::Absent)+ .await+ .unwrap();+ let conflict = docs+ .atomic_batch_checked(+ vec![ReadCheck {+ collection: "things".into(),+ id: "dependency".into(),+ expected: ExpectedDocument::Absent,+ }],+ vec![WriteOp::Put {+ collection: "things".into(),+ id: "second".into(),+ doc: json!({}),+ precondition: Precondition::Absent,+ }],+ )+ .await+ .unwrap_err();+ assert_eq!(conflict.kind(), ErrorKind::Conflict);+ assert!(docs.get("things", "second").await.unwrap().is_none());+}