Skip to content

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

fix(storage): attribute inbound queue collections to the host

Steven Enamakelcec1f91c4326
diff --git a/crates/openhuman-core/src/storage/schema.rs b/crates/openhuman-core/src/storage/schema.rs
index 959024a9eb..17182417cf 100644
--- a/crates/openhuman-core/src/storage/schema.rs
+++ b/crates/openhuman-core/src/storage/schema.rs
@@ -85,16 +85,10 @@ fn declared_collections() -> Vec<CollectionOwner> {
));
#[cfg(feature = "inbound-queues")]
- {
- owners.push(owner(
- "tinyeventqueues-bus",
- tinyeventqueues_bus::storage::collection_specs(),
- ));
- owners.push(owner(
- "openhuman-core-inbound",
- crate::inbound::results::collection_specs(),
- ));
- }
+ owners.push(owner(
+ "tinyeventqueues-bus",
+ tinyeventqueues_bus::storage::collection_specs(),
+ ));
owners
}
@@ -113,6 +107,8 @@ fn host_collections() -> Vec<CollectionSpec> {
collections.extend(crate::agent::orchestration::subagent_sessions::collection_specs());
collections.extend(super::agents::collection_specs());
collections.extend(super::journal_maintenance::collection_specs());
+ #[cfg(feature = "inbound-queues")]
+ collections.extend(crate::inbound::results::collection_specs());
collections
}
diff --git a/scripts/ci/check-storage-schema.mjs b/scripts/ci/check-storage-schema.mjs
index 343fbc11e8..4f92b96055 100644
--- a/scripts/ci/check-storage-schema.mjs
+++ b/scripts/ci/check-storage-schema.mjs
@@ -96,31 +96,31 @@ export function lint(dump) {
}
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`);
- }
- 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)) {
- problems.push(`${name}: index name "${index.name}" is empty or duplicated`);
+ const { name, indexes = [], ttl_field: ttlField, search } = collection;
+ if (!COLLECTION.test(name) && !LEGACY_COLLECTIONS.has(name)) {
+ problems.push(`${owner.crate}: collection "${name}" must be <owner>.<entity> with a snake_case entity`);
}
- indexNames.add(index.name);
- for (const field of index.fields ?? []) {
- if (TIME_SUFFIX.test(field)) {
- problems.push(`${name}: indexed field "${field}" holds a time and must be named *_ms`);
+ 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)) {
+ problems.push(`${owner.crate}: ${name}: index name "${index.name}" is empty or duplicated`);
+ }
+ indexNames.add(index.name);
+ for (const field of index.fields ?? []) {
+ if (TIME_SUFFIX.test(field)) {
+ problems.push(`${owner.crate}: ${name}: indexed field "${field}" holds a time and must be named *_ms`);
+ }
}
}
- }
- if (ttlField && TIME_SUFFIX.test(ttlField)) {
- problems.push(`${name}: expiry field "${ttlField}" holds a time and must be named *_ms`);
- }
- for (const field of search?.fields ?? []) {
- if (!field) problems.push(`${name}: search fields must not be empty`);
- }
+ if (ttlField && TIME_SUFFIX.test(ttlField)) {
+ problems.push(`${owner.crate}: ${name}: expiry field "${ttlField}" holds a time and must be named *_ms`);
+ }
+ for (const field of search?.fields ?? []) {
+ if (!field) problems.push(`${owner.crate}: ${name}: search fields must not be empty`);
+ }
}
}
return problems;
@@ -195,8 +195,8 @@ function main(argv) {
console.error(`${docPath} is out of date. Run \`pnpm docs:generate\` and commit the result.`);
return 1;
}
- const owners = new Set((dump.collections ?? []).map(collection => collection.name.split('.', 1)[0]));
- console.log(`storage schema ok: ${owners.size} owners, ${(dump.collections ?? []).length} collections`);
+ const collectionCount = (dump.owners ?? []).reduce((total, owner) => total + (owner.collections ?? []).length, 0);
+ console.log(`storage schema ok: ${(dump.owners ?? []).length} crates, ${collectionCount} collections`);
return 0;
}