agrs-sequelize-sdk 1.4.44 → 1.4.45

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.
@@ -336,6 +336,25 @@ module.exports = (sequelize, DataTypes) => {
336
336
  `status = 'COMPLETED' AND (details->>'ai_stage') = 'tarzo_materialized_and_adopted'`
337
337
  ),
338
338
  },
339
+ // Partial index for the ai_campaign_queue "queue-flip-to-failed" query
340
+ // in step 3/5 (failStaleAwaitingLogs's third UPDATE). After a V2 log
341
+ // gets flipped to FAILED with ai_stage='tarzo_awaited_but_never_
342
+ // materialized', the corresponding queue row must also flip to
343
+ // 'failed' by joining V2 → ai_campaign_queue via process_id.
344
+ //
345
+ // Without this, the query used the plain status index → scanned 266K
346
+ // FAILED rows → filtered ai_stage in memory (kept 212) → 72.9s and
347
+ // hit 60s statement_timeout (verified 2026-07-19).
348
+ //
349
+ // Same shape as idx_v2_adopted_by_process, mirrored for the FAILED-
350
+ // never-materialized end-state.
351
+ {
352
+ name: "idx_v2_awaited_never_materialized_by_process",
353
+ fields: ["process_id"],
354
+ where: sequelize.literal(
355
+ `status = 'FAILED' AND (details->>'ai_stage') = 'tarzo_awaited_but_never_materialized'`
356
+ ),
357
+ },
339
358
  ],
340
359
  }
341
360
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.4.44",
3
+ "version": "1.4.45",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",