@automagik/genie 4.260405.4 → 4.260405.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@
10
10
  "plugins": [
11
11
  {
12
12
  "name": "genie",
13
- "version": "4.260405.4",
13
+ "version": "4.260405.5",
14
14
  "source": "./plugins/genie",
15
15
  "description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, wish them into plans, make with parallel agents, ship as one team. A coding genie that grows with your project."
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automagik/genie",
3
- "version": "4.260405.4",
3
+ "version": "4.260405.5",
4
4
  "description": "Collaborative terminal toolkit for human + AI workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genie",
3
- "version": "4.260405.4",
3
+ "version": "4.260405.5",
4
4
  "description": "Human-AI partnership for Claude Code. Share a terminal, orchestrate workers, evolve together. Brainstorm ideas, turn them into wishes, execute with /work, validate with /review, and ship as one team.",
5
5
  "author": {
6
6
  "name": "Namastex Labs"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genie-plugin",
3
- "version": "4.260405.4",
3
+ "version": "4.260405.5",
4
4
  "private": true,
5
5
  "description": "Runtime dependencies for genie bundled CLIs",
6
6
  "type": "module",
@@ -86,6 +86,13 @@ export async function setupTestSchema(): Promise<() => Promise<void>> {
86
86
  await adminSql.unsafe(`CREATE SCHEMA IF NOT EXISTS "${schemaName}"`);
87
87
  await adminSql.unsafe(`SET search_path TO "${schemaName}"`);
88
88
  await runMigrations(adminSql);
89
+
90
+ // Drop all NOTIFY triggers from the test schema.
91
+ // PG NOTIFY is instance-scoped (not schema-scoped), so triggers firing in
92
+ // test schemas leak events to the production event router. Dropping them
93
+ // after migration keeps test data isolated without modifying migration SQL.
94
+ await dropNotifyTriggers(adminSql, schemaName);
95
+
89
96
  await adminSql.end({ timeout: 5 });
90
97
  } catch {
91
98
  // Schema creation or migration race under concurrent test load — skip gracefully
@@ -131,6 +138,30 @@ export async function setupTestSchema(): Promise<() => Promise<void>> {
131
138
  };
132
139
  }
133
140
 
141
+ /**
142
+ * Drop all NOTIFY triggers from a test schema.
143
+ *
144
+ * PG NOTIFY is instance-scoped — a trigger firing in schema "test_123_456"
145
+ * broadcasts to every listener on that channel, including the production
146
+ * event router. Dropping these triggers after migration prevents test
147
+ * state changes from leaking as real events.
148
+ */
149
+ async function dropNotifyTriggers(sql: Sql, schemaName: string): Promise<void> {
150
+ try {
151
+ const triggers = await sql`
152
+ SELECT trigger_name, event_object_table
153
+ FROM information_schema.triggers
154
+ WHERE trigger_schema = ${schemaName}
155
+ AND trigger_name LIKE 'trg_notify_%'
156
+ `;
157
+ for (const { trigger_name, event_object_table } of triggers) {
158
+ await sql.unsafe(`DROP TRIGGER IF EXISTS "${trigger_name}" ON "${schemaName}"."${event_object_table}"`);
159
+ }
160
+ } catch {
161
+ // Best effort — don't block test setup if trigger cleanup fails
162
+ }
163
+ }
164
+
134
165
  /**
135
166
  * Drop test schemas older than STALE_SCHEMA_AGE_MS.
136
167
  * Schema names encode a timestamp: test_<pid>_<timestamp>.