Skip to content

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

refactor(storage): validate collection owners without merging them

Steven Enamakel5d1cff3d77a9
diff --git a/crates/openhuman-core/src/storage/README.md b/crates/openhuman-core/src/storage/README.md
index 04d3737c36..6186a21b4f 100644
--- a/crates/openhuman-core/src/storage/README.md
+++ b/crates/openhuman-core/src/storage/README.md
@@ -370,7 +370,7 @@ storage itself.
## Schema, scopes and boot
- `scope.rs`: the one scope grammar (`tenant_scope`, `scope_for_profile`, `scope_for_agent`, `scope_for_module`), built on tsd's `Scope::tenant/local/agent/module`.
-- `schema.rs`: `owner_collections()` composes and validates the linked owners' `CollectionSpec` declarations; `module_collections(owner)` feeds module grants.
+- `schema.rs`: `collection_owners()` validates linked crates' `CollectionSpec` declarations without merging owners; `module_collections(owner)` feeds module grants.
- `boot.rs`: `prepare_and_migrate`, called by `open`, ensures the composed collections in the host's local and cluster scopes. Tenant, agent and module scopes are prepared by their owners when opened.
- `scope_move.rs`: the resumable copy of v1 scopes (`profile:`, `<profile>~<agent>`, raw agent ids, `module:<id>@<base>`, the `*-sha256:` fallbacks) into the v2 scopes.
- The generated reference is `docs/storage-schema.md`; `node scripts/ci/check-storage-schema.mjs` lints the current collection names, indexes, expiry fields and search fields.
diff --git a/crates/openhuman-core/src/storage/boot.rs b/crates/openhuman-core/src/storage/boot.rs
index 4143ad495a..45684265ae 100644
--- a/crates/openhuman-core/src/storage/boot.rs
+++ b/crates/openhuman-core/src/storage/boot.rs
@@ -1,10 +1,9 @@
//! Prepare the host's known storage scopes before installing a backend.
//!
//! Tiny Storage Drivers v2 has no global schema registry or scope enumerator.
-//! Collection declarations belong to each record owner and are composed by
-//! [`super::schema::owner_collections`]. The host prepares the shared local
-//! and cluster scopes here; tenant scopes are prepared when their owner is
-//! created, using the same declarations.
+//! Collection declarations belong to each record owner. The host asks each
+//! linked crate for its declarations and prepares them on the shared local and
+//! cluster scopes; tenant scopes are prepared when their owner is created.
use std::sync::Arc;
@@ -19,25 +18,27 @@ pub struct BootReport {
pub collections: usize,
}
-/// Ensures every composed owner collection in the host's shared scopes.
+/// Ensures each linked crate's collections in the host's shared scopes.
///
/// Per-profile and per-agent scopes are prepared when their owner is created;
/// no driver-specific scope enumeration is required or used.
///
/// # Errors
-/// Returns a schema composition, scope binding, or collection preparation
-/// error. Preparation is idempotent and may be retried on the next boot.
+/// Returns a collection validation, scope binding, or preparation error.
+/// Preparation is idempotent and may be retried on the next boot.
pub async fn prepare_and_migrate(
backend: &Arc<dyn StorageBackend>,
) -> Result<BootReport, StorageError> {
- let collections = super::schema::owner_collections()?;
+ let owners = super::schema::collection_owners()?;
let scopes = [Scope::new("local")?, Scope::new("cluster")?];
let mut report = BootReport::default();
for scope in scopes {
let storage = backend.for_scope(&scope)?;
- for collection in &collections {
- storage.ensure_collection(collection).await?;
- report.collections += 1;
+ for owner in &owners {
+ for collection in &owner.collections {
+ storage.ensure_collection(collection).await?;
+ report.collections += 1;
+ }
}
report.scopes += 1;
}
@@ -55,11 +56,15 @@ pub async fn prepare_and_migrate(
/// # Errors
/// Returns the first owner declaration or backend error.
pub async fn prepare_scope(storage: &Storage) -> Result<usize, StorageError> {
- let collections = super::schema::owner_collections()?;
- for collection in &collections {
- storage.ensure_collection(collection).await?;
+ let owners = super::schema::collection_owners()?;
+ let mut count = 0;
+ for owner in &owners {
+ for collection in &owner.collections {
+ storage.ensure_collection(collection).await?;
+ count += 1;
+ }
}
- Ok(collections.len())
+ Ok(count)
}
#[cfg(test)]
diff --git a/crates/openhuman-core/src/storage/boot_tests.rs b/crates/openhuman-core/src/storage/boot_tests.rs
index 3b965045c3..9705adac0b 100644
--- a/crates/openhuman-core/src/storage/boot_tests.rs
+++ b/crates/openhuman-core/src/storage/boot_tests.rs
@@ -1,31 +1,32 @@
use super::*;
#[tokio::test]
-async fn boot_prepares_the_composed_owner_collections_on_host_scopes() {
+async fn boot_prepares_each_linked_crates_collections_on_host_scopes() {
let backend: Arc<dyn StorageBackend> =
Arc::new(tinystoragedrivers_testkit::MemoryBackend::new());
let report = prepare_and_migrate(&backend).await.unwrap();
- let declared = super::super::schema::owner_collections().unwrap();
+ let owners = super::super::schema::collection_owners().unwrap();
+ let declared = owners.iter().map(|owner| owner.collections.len()).sum::<usize>();
assert_eq!(report.scopes, 2);
- assert_eq!(report.collections, declared.len() * report.scopes);
+ assert_eq!(report.collections, declared * report.scopes);
- // Owner declarations are idempotent: a retry after an interrupted boot
- // may safely ensure every collection again.
+ // Each owner's declarations are ensured again after an interrupted boot.
let retry = prepare_and_migrate(&backend).await.unwrap();
assert_eq!(retry, report);
}
#[tokio::test]
-async fn tenant_scopes_use_the_same_owner_collection_declarations() {
+async fn tenant_scopes_use_each_linked_crates_collections() {
let backend = tinystoragedrivers_testkit::MemoryBackend::new();
let scope = super::super::scope::scope_for_profile("profile-a");
let storage = backend.for_scope(&scope).unwrap();
let prepared = prepare_scope(&storage).await.unwrap();
-
- assert_eq!(
- prepared,
- super::super::schema::owner_collections().unwrap().len()
- );
+ let declared = super::super::schema::collection_owners()
+ .unwrap()
+ .iter()
+ .map(|owner| owner.collections.len())
+ .sum::<usize>();
+ assert_eq!(prepared, declared);
}
diff --git a/crates/openhuman-core/src/storage/host_migration_tests.rs b/crates/openhuman-core/src/storage/host_migration_tests.rs
index e26af84718..2b7e6b3aa3 100644
--- a/crates/openhuman-core/src/storage/host_migration_tests.rs
+++ b/crates/openhuman-core/src/storage/host_migration_tests.rs
@@ -1,31 +1,35 @@
-//! Boot prepares only the host's composed owner collections.
+//! Boot prepares each linked crate's declarations without a global registry.
//!
//! Record conversion is tested beside each typed owner importer. Seeding
//! arbitrary v1-named collections into a v2 backend did not exercise those
-//! source readers or prove a migration; it only relied on the retired global
-//! schema registry.
+//! source readers or prove a migration.
-use super::{boot::prepare_and_migrate, schema::owner_collections};
+use super::{boot::prepare_and_migrate, schema::collection_owners};
use crate::storage::{DocumentStoreExt, Scope};
#[tokio::test]
-async fn boot_prepares_every_composed_owner_collection_in_shared_scopes() {
+async fn boot_prepares_every_linked_owner_collection_in_shared_scopes() {
let backend = crate::storage::test_support::memory_backend();
- let expected = owner_collections().unwrap();
+ let owners = collection_owners().unwrap();
let report = prepare_and_migrate(&backend).await.unwrap();
assert_eq!(report.scopes, 2);
- assert_eq!(report.collections, expected.len() * report.scopes);
+ let expected = owners.iter().map(|owner| owner.collections.len()).sum::<usize>();
+ assert_eq!(report.collections, expected * report.scopes);
for scope in [Scope::local(), Scope::new("cluster").unwrap()] {
let storage = backend.for_scope(&scope).unwrap();
- for collection in &expected {
- // A query fails if boot did not ensure the owner declaration.
- storage
- .documents()
- .query_all(&collection.name, &tinystoragedrivers_types::Query::all())
- .await
- .unwrap_or_else(|error| panic!("{} in {scope}: {error}", collection.name));
+ for owner in &owners {
+ for collection in &owner.collections {
+ // A query fails if boot did not ensure the owner declaration.
+ storage
+ .documents()
+ .query_all(&collection.name, &tinystoragedrivers_types::Query::all())
+ .await
+ .unwrap_or_else(|error| {
+ panic!("{} from {} in {scope}: {error}", collection.name, owner.crate_name)
+ });
+ }
}
}
}
diff --git a/crates/openhuman-core/src/storage/schema.rs b/crates/openhuman-core/src/storage/schema.rs
index 352615ab8c..959024a9eb 100644
--- a/crates/openhuman-core/src/storage/schema.rs
+++ b/crates/openhuman-core/src/storage/schema.rs
@@ -1,93 +1,125 @@
-//! The host's composed v2 owner collection declarations.
+//! Collection declarations grouped by the crate that owns each record.
//!
-//! Owner crates expose pure `CollectionSpec` values. The host prepares those
-//! declarations on each known scope before installing module grants; the
-//! owner remains responsible for its own record shapes and migrations.
+//! Storage v2 has no global schema registry. At startup the host asks every
+//! linked owner for its declarations and calls `ensure_collection` for each
+//! one. Owners retain control of their record shapes and migrations.
-use std::collections::BTreeMap;
+use tinystoragedrivers::{CollectionSpec, StorageError};
-use tinystoragedrivers::CollectionSpec;
-
-use super::StorageError;
+/// One linked crate's collection declarations.
+#[derive(Clone, Debug)]
+pub struct CollectionOwner {
+ /// Cargo package that declared these collections.
+ pub crate_name: &'static str,
+ /// The owner's complete collection declarations.
+ pub collections: Vec<CollectionSpec>,
+}
-/// Every collection this build links, with duplicate declarations merged and
-/// validated before any backend is touched.
-pub fn owner_collections() -> Result<Vec<CollectionSpec>, StorageError> {
- let mut collections = BTreeMap::<String, CollectionSpec>::new();
- for spec in declared_collections() {
- if let Some(existing) = collections.get(&spec.name) {
- let merged = existing.merge(&spec)?;
- collections.insert(spec.name.clone(), merged);
- } else {
- spec.validate()?;
- collections.insert(spec.name.clone(), spec);
+/// Every linked owner's declarations, validated without combining owners.
+pub fn collection_owners() -> Result<Vec<CollectionOwner>, StorageError> {
+ let mut owners = declared_collections();
+ for owner in &owners {
+ for collection in &owner.collections {
+ collection.validate()?;
}
}
- Ok(collections.into_values().collect())
+ owners.sort_by_key(|owner| owner.crate_name);
+ Ok(owners)
}
-fn declared_collections() -> Vec<CollectionSpec> {
- let mut collections = Vec::new();
- collections.extend(tinyagents_harness::storage::collections());
- collections.extend(tinyagents_session::port::collections());
- collections.extend(tinyagents_graph::storage::collections());
- collections.extend(tinyagents_tasks::collections());
- collections.extend(crate::security::approval::collection_specs());
- collections.extend(crate::security::devices::collection_specs());
- collections.extend(crate::desktop::notifications::collection_specs());
- collections.extend(crate::integrations::task_sources::collection_specs());
- collections.extend(crate::artifacts::collection_specs());
- collections.extend(crate::platform::cost::collection_specs());
- collections.extend(crate::config::schema::config_storage_collections());
- collections.extend(crate::profiles::collection_specs());
- collections.extend(crate::threads::store::collection_specs());
- collections.extend(crate::agent::orchestration::subagent_sessions::collection_specs());
- collections.extend(super::agents::collection_specs());
- collections.extend(super::journal_maintenance::collection_specs());
+fn declared_collections() -> Vec<CollectionOwner> {
+ let mut owners = vec![
+ owner("tinyagents-harness", tinyagents_harness::storage::collections()),
+ owner("tinyagents-session", tinyagents_session::port::collections()),
+ owner("tinyagents-graph", tinyagents_graph::storage::collections()),
+ owner("tinyagents-tasks", tinyagents_tasks::collections()),
+ owner("openhuman-core", host_collections()),
+ ];
#[cfg(feature = "skills")]
- collections.extend(tinyskills_drivers::collections());
+ owners.push(owner("tinyskills-drivers", tinyskills_drivers::collections()));
+
#[cfg(feature = "modules")]
{
- collections.extend(tinymcp_bus::storage::collection_specs());
- collections.extend(
+ owners.push(owner("tinymcp-bus", tinymcp_bus::storage::collection_specs()));
+ owners.push(owner(
+ "tinychannels-bus",
tinychannels_bus::storage::collections()
.into_iter()
- .map(CollectionSpec::new),
- );
- collections.extend(
+ .map(CollectionSpec::new)
+ .collect(),
+ ));
+ owners.push(owner(
+ "tinyconnectors-bus",
tinyconnectors_bus::storage::collections()
.into_iter()
- .map(|collection| CollectionSpec::new(collection.name)),
- );
- collections.extend(
+ .map(|collection| CollectionSpec::new(collection.name))
+ .collect(),
+ ));
+ owners.push(owner(
+ "tinybox-bus",
tinybox_bus::storage::collections()
.into_iter()
- .map(CollectionSpec::new),
- );
- collections.extend(tinyjuice_bus::storage::collections());
+ .map(CollectionSpec::new)
+ .collect(),
+ ));
+ owners.push(owner("tinyjuice-bus", tinyjuice_bus::storage::collections()));
}
+
#[cfg(feature = "web3")]
- collections.extend(
+ owners.push(owner(
+ "tinywallet-bus",
tinywallet_bus::storage::collections()
.into_iter()
- .map(|collection| CollectionSpec::new(collection.name)),
- );
+ .map(|collection| CollectionSpec::new(collection.name))
+ .collect(),
+ ));
+
#[cfg(feature = "tinymemes")]
- collections.extend(
+ owners.push(owner(
+ "tinymemes-bus",
tinymemes_bus::storage::collections()
.into_iter()
- .map(CollectionSpec::new),
- );
+ .map(CollectionSpec::new)
+ .collect(),
+ ));
+
#[cfg(feature = "inbound-queues")]
{
- collections.extend(tinyeventqueues_bus::storage::collection_specs());
- collections.extend(crate::inbound::results::collection_specs());
+ owners.push(owner(
+ "tinyeventqueues-bus",
+ tinyeventqueues_bus::storage::collection_specs(),
+ ));
+ owners.push(owner(
+ "openhuman-core-inbound",
+ crate::inbound::results::collection_specs(),
+ ));
}
+ owners
+}
+
+fn host_collections() -> Vec<CollectionSpec> {
+ let mut collections = Vec::new();
+ collections.extend(crate::security::approval::collection_specs());
+ collections.extend(crate::security::devices::collection_specs());
+ collections.extend(crate::desktop::notifications::collection_specs());
+ collections.extend(crate::integrations::task_sources::collection_specs());
+ collections.extend(crate::artifacts::collection_specs());
+ collections.extend(crate::platform::cost::collection_specs());
+ collections.extend(crate::config::schema::config_storage_collections());
+ collections.extend(crate::profiles::collection_specs());
+ collections.extend(crate::threads::store::collection_specs());
+ collections.extend(crate::agent::orchestration::subagent_sessions::collection_specs());
+ collections.extend(super::agents::collection_specs());
+ collections.extend(super::journal_maintenance::collection_specs());
collections
}
+fn owner(crate_name: &'static str, collections: Vec<CollectionSpec>) -> CollectionOwner {
+ CollectionOwner { crate_name, collections }
+}
+
/// Collections declared by one loadable module owner.
pub fn module_collections(owner: &str) -> Vec<CollectionSpec> {
#[cfg(feature = "modules")]
diff --git a/crates/openhuman-core/src/storage/schema_tests.rs b/crates/openhuman-core/src/storage/schema_tests.rs
index ffa1207cdc..8b04264062 100644
--- a/crates/openhuman-core/src/storage/schema_tests.rs
+++ b/crates/openhuman-core/src/storage/schema_tests.rs
@@ -1,28 +1,37 @@
use super::*;
#[test]
-fn every_linked_owner_collection_is_valid_and_unique() {
- let collections = owner_collections().expect("owner collection declarations compose");
+fn every_linked_crate_exposes_its_valid_collection_declarations() {
+ let owners = collection_owners().expect("owner collection declarations are valid");
+ let mut crates = std::collections::HashSet::new();
let mut names = std::collections::HashSet::new();
- for spec in &collections {
- spec.validate().expect("owner collection is valid");
- assert!(names.insert(spec.name.as_str()), "duplicate {}", spec.name);
+ for owner in &owners {
+ assert!(crates.insert(owner.crate_name), "duplicate crate {}", owner.crate_name);
+ for spec in &owner.collections {
+ spec.validate().expect("owner collection is valid");
+ assert!(
+ names.insert((owner.crate_name, spec.name.as_str())),
+ "duplicate {} collection in {}",
+ spec.name,
+ owner.crate_name
+ );
+ }
}
for expected in [
- "harness.run_status",
- "conversations.threads",
- "approvals.requests",
- "devices.paired",
- "notifications.integration",
- "task_sources.sources",
- "artifacts.records",
- "cost.records",
- "config.documents",
- "profiles.registry",
- "threads.transcript_keys",
- "subagents.sessions",
+ ("tinyagents-harness", "harness.run_status"),
+ ("tinyagents-session", "conversations.threads"),
+ ("openhuman-core", "approvals.requests"),
+ ("openhuman-core", "devices.paired"),
+ ("openhuman-core", "notifications.integration"),
+ ("openhuman-core", "task_sources.sources"),
+ ("openhuman-core", "artifacts.records"),
+ ("openhuman-core", "cost.records"),
+ ("openhuman-core", "config.documents"),
+ ("openhuman-core", "profiles.registry"),
+ ("openhuman-core", "threads.transcript_keys"),
+ ("openhuman-core", "subagents.sessions"),
] {
- assert!(names.contains(expected), "{expected} missing: {names:?}");
+ assert!(names.contains(expected), "{expected:?} missing: {names:?}");
}
}
diff --git a/examples/storage_schema_dump.rs b/examples/storage_schema_dump.rs
index 5f74ac407e..177bf3e7b3 100644
--- a/examples/storage_schema_dump.rs
+++ b/examples/storage_schema_dump.rs
@@ -1,20 +1,25 @@
-//! Prints the composed v2 collection declarations as JSON for the storage
+//! Prints the per-crate v2 collection declarations as JSON for the storage
//! schema documentation check.
//!
-//! The dump reflects the `CollectionSpec` values the host prepares: names,
-//! indexes, expiry fields, and search fields. Record shapes and migrations
-//! remain owned by their domains.
+//! The dump reflects each crate's `CollectionSpec` values: names, indexes,
+//! expiry fields, and search fields. Record shapes and migrations remain
+//! owned by their domains.
//!
//! Run: `cargo run -p openhuman-cli --example storage_schema_dump`
//! Feature: `web3` adds the wallet owner's collections.
-use openhuman_core::storage::schema::owner_collections;
+use openhuman_core::storage::schema::collection_owners;
use serde_json::json;
fn main() {
- let collections = owner_collections().expect("owner collection declarations compose");
+ let owners = collection_owners().expect("owner collection declarations are valid");
println!(
"{}",
- serde_json::to_string_pretty(&json!({ "collections": collections })).unwrap()
+ serde_json::to_string_pretty(&json!({
+ "owners": owners.iter().map(|owner| json!({
+ "crate": owner.crate_name,
+ "collections": owner.collections,
+ })).collect::<Vec<_>>(),
+ })).unwrap()
);
}
diff --git a/scripts/ci/check-storage-schema.mjs b/scripts/ci/check-storage-schema.mjs
index 3fc014307c..343fbc11e8 100644
--- a/scripts/ci/check-storage-schema.mjs
+++ b/scripts/ci/check-storage-schema.mjs
@@ -1,11 +1,11 @@
#!/usr/bin/env node
// Storage-schema gate (tinyhumansai/openhuman#7992, part of #7973).
//
-// Owners expose v2 `CollectionSpec` values; the host composes them
-// (`crates/openhuman-core/src/storage/schema.rs`). This check dumps those
-// declarations as JSON (the `storage_schema_dump` example of `openhuman-cli`),
-// lints them, and keeps `docs/storage-schema.md` in step. The doc groups each
-// spec by the owner namespace in its collection name.
+// Crates expose v2 `CollectionSpec` values; the host ensures each owner's
+// declarations separately (`crates/openhuman-core/src/storage/schema.rs`).
+// This check dumps those declarations by crate (the `storage_schema_dump`
+// example of `openhuman-cli`), lints them, and keeps `docs/storage-schema.md`
+// in step.
//
// Lint rules (the spec is docs/specs/schema-v2.md in tinystoragedrivers):
// 1. collection names are `<owner>.<entity>` with a snake_case entity
@@ -88,14 +88,21 @@ export function dumpSchema(root = REPO_ROOT, { run: spawn = spawnSync, env = pro
/** @returns {string[]} one message per violation */
export function lint(dump) {
const problems = [];
+ const crates = new Set();
const names = new Set();
- for (const collection of dump.collections ?? []) {
+ for (const owner of dump.owners ?? []) {
+ if (!owner.crate || crates.has(owner.crate)) {
+ problems.push(`crate name "${owner.crate}" is empty or declared more than once`);
+ }
+ crates.add(owner.crate);
+ for (const collection of owner.collections ?? []) {
const { name, indexes = [], ttl_field: ttlField, search } = collection;
if (!COLLECTION.test(name) && !LEGACY_COLLECTIONS.has(name)) {
problems.push(`collection "${name}" must be <owner>.<entity> with a snake_case entity`);
}
- if (names.has(name)) problems.push(`collection "${name}" is declared more than once`);
- names.add(name);
+ const key = `${owner.crate}\0${name}`;
+ if (names.has(key)) problems.push(`${owner.crate}: collection "${name}" is declared more than once`);
+ names.add(key);
const indexNames = new Set();
for (const index of indexes) {
if (!index.name || indexNames.has(index.name)) {
@@ -114,38 +121,30 @@ export function lint(dump) {
for (const field of search?.fields ?? []) {
if (!field) problems.push(`${name}: search fields must not be empty`);
}
+ }
}
return problems;
}
const compare = (left, right) => (left < right ? -1 : left > right ? 1 : 0);
-/** Renders docs/storage-schema.md from stable owner-grouped CollectionSpecs. */
+/** Renders docs/storage-schema.md from stable crate-grouped CollectionSpecs. */
export function render(dump) {
- const owners = new Map();
- for (const collection of dump.collections ?? []) {
- const owner = collection.name.includes('.')
- ? collection.name.split('.', 1)[0]
- : 'legacy (unqualified names)';
- if (!owners.has(owner)) owners.set(owner, []);
- owners.get(owner).push(collection);
- }
-
const out = [
'# Storage schema',
'',
'<!-- Generated by `pnpm docs:generate` (scripts/ci/check-storage-schema.mjs) from the',
- 'host-composed owner `CollectionSpec` values (`crates/openhuman-core/src/storage/schema.rs`). Do not edit by hand. -->',
+ 'per-crate `CollectionSpec` values (`crates/openhuman-core/src/storage/schema.rs`). Do not edit by hand. -->',
'',
- 'Record owners declare collections with `CollectionSpec`; the host composes and prepares',
- 'those declarations at boot. Each section lists the specs by the owner namespace in the',
- 'collection name, including indexes, expiry fields, and full-text search fields.',
+ 'Each crate declares its collections with `CollectionSpec`; the host calls',
+ '`ensure_collection` for every declaration at boot. Sections preserve the declaring',
+ 'crate, including when two crates use the same collection name.',
'Record shapes and migrations stay with their owners.',
'',
];
- for (const owner of [...owners.keys()].sort(compare)) {
- out.push(`## ${owner}`, '', '| Collection | Indexes | Expiry field | Search fields |', '| --- | --- | --- | --- |');
- for (const collection of owners.get(owner).sort((a, b) => compare(a.name, b.name))) {
+ for (const owner of [...(dump.owners ?? [])].sort((a, b) => compare(a.crate, b.crate))) {
+ out.push(`## ${owner.crate}`, '', '| Collection | Indexes | Expiry field | Search fields |', '| --- | --- | --- | --- |');
+ for (const collection of [...(owner.collections ?? [])].sort((a, b) => compare(a.name, b.name))) {
const indexes = (collection.indexes ?? []).map(index =>
`\`${index.name}\` (${index.fields.map(field => `\`${field}\``).join(', ')})${index.unique ? ' unique' : ''}`
).sort(compare).join('<br>');
diff --git a/tests/storage_desktop_upgrade_e2e.rs b/tests/storage_desktop_upgrade_e2e.rs
index 46e8bf3d90..f944a236aa 100644
--- a/tests/storage_desktop_upgrade_e2e.rs
+++ b/tests/storage_desktop_upgrade_e2e.rs
@@ -412,11 +412,12 @@ async fn host_documents(backend: &dyn StorageBackend) -> usize {
let docs = backend.for_scope(&Scope::local()).unwrap();
let mut total = 0;
// The importers write the v2 collections of the owners behind each source.
- let collections = openhuman_core::storage::schema::owner_collections().unwrap();
+ let owners = openhuman_core::storage::schema::collection_owners().unwrap();
for source in import::sources() {
let prefix = format!("{}.", source.owner);
- for spec in collections
+ for spec in owners
.iter()
+ .flat_map(|owner| &owner.collections)
.filter(|spec| spec.name.starts_with(&prefix))
{
docs.documents().ensure_collection(spec).await.unwrap();
diff --git a/vendor/tinyagents b/vendor/tinyagents
index 0c5ad3cd69..29a0c6482b 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit 0c5ad3cd692ee91b2c77ee9f41e52ae95a698eee
+Subproject commit 29a0c6482b63f2b95da9bec86bb596263c99bc18