Skip to content

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

fix(ci): allow legacy TinyChannels source names in storage schema check

Steven Enamakel44fb08848430
diff --git a/scripts/__tests__/check-storage-schema.test.mjs b/scripts/__tests__/check-storage-schema.test.mjs
index 3840e4c2ed..952e90b927 100644
--- a/scripts/__tests__/check-storage-schema.test.mjs
+++ b/scripts/__tests__/check-storage-schema.test.mjs
@@ -40,6 +40,18 @@ test('collection names must be <owner>.<entity> in snake_case', () => {
assert.equal(problems.length, 3, problems.join('\n'));
});
+test('legacy migration source names are allowed only for TinyChannels storage reads', () => {
+ assert.deepEqual(lint({
+ owners: [{ crate: 'tinychannels-bus', collections: [collection('channels_delivery_pending')] }],
+ }), []);
+ assert.equal(lint({
+ owners: [{ crate: 'tinychannels-bus', collections: [collection('channels_new_collection')] }],
+ }).length, 1);
+ assert.equal(lint({
+ owners: [{ crate: 'openhuman', collections: [collection('channels_delivery_pending')] }],
+ }).length, 1);
+});
+
test('duplicate collection and index names are refused within one crate', () => {
const problems = lint({
owners: [{ crate: 'tinyflows-scheduler', collections: [
diff --git a/scripts/ci/check-storage-schema.mjs b/scripts/ci/check-storage-schema.mjs
index 71540236a8..79e78cc401 100644
--- a/scripts/ci/check-storage-schema.mjs
+++ b/scripts/ci/check-storage-schema.mjs
@@ -34,6 +34,26 @@ export const DOC_PATH = resolve(REPO_ROOT, 'docs', 'storage-schema.md');
const COLLECTION = /^[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*$/;
const TIME_SUFFIX = /(_at|_ns|_us|_secs|_ts|_time)$/;
+// TinyChannels keeps these historical source names in its collection grants
+// so the owner-local migrations can copy old rows. They are read-only inputs,
+// not v2 collection names; renaming them would orphan persisted data.
+const LEGACY_SOURCE_COLLECTIONS = new Set([
+ 'tinychannels-bus\0channels_delivery_pending',
+ 'tinychannels-bus\0channels_delivery_failed',
+ 'tinychannels-bus\0channels_delivery_results',
+ 'tinychannels-bus\0channel_remote_bindings',
+ 'tinychannels-bus\0channel_remote_busy',
+ 'tinychannels-bus\0channel_remote_meta',
+ 'tinychannels-bus\0whatsapp_device',
+ 'tinychannels-bus\0whatsapp_identity',
+ 'tinychannels-bus\0whatsapp_session',
+ 'tinychannels-bus\0whatsapp_prekey',
+ 'tinychannels-bus\0whatsapp_signed_prekey',
+ 'tinychannels-bus\0whatsapp_sender_key',
+ 'tinychannels-bus\0whatsapp_sync_key',
+ 'tinychannels-bus\0whatsapp_lid_mapping',
+]);
+
/** Features the dump is built with: the contributor set plus the wallet owner. */
export const DUMP_FEATURES = 'web3';
@@ -98,7 +118,7 @@ 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)) {
+ if (!COLLECTION.test(name) && !LEGACY_SOURCE_COLLECTIONS.has(`${owner.crate}\0${name}`)) {
problems.push(`${owner.crate}: collection "${name}" must be <owner>.<entity> with a snake_case entity`);
}
const key = `${owner.crate}\0${name}`;