@signetai/core 0.197.7 → 0.197.8

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.
package/dist/index.js CHANGED
@@ -11944,6 +11944,60 @@ function up128(db) {
11944
11944
  `);
11945
11945
  }
11946
11946
 
11947
+ // src/migrations/129-retire-structural-jobs.ts
11948
+ function tableExists3(db, table) {
11949
+ return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
11950
+ }
11951
+ function up129(db) {
11952
+ if (!tableExists3(db, "memory_jobs"))
11953
+ return;
11954
+ if (!tableExists3(db, "job_cancellations")) {
11955
+ throw new Error("job_cancellations table missing; cannot retire structural jobs without an audit trail");
11956
+ }
11957
+ db.prepare(`
11958
+ INSERT INTO job_cancellations (
11959
+ id, source_table, source_id, status_before, payload_json,
11960
+ reason, actor, actor_type, request_id, created_at
11961
+ )
11962
+ SELECT
11963
+ 'retire-structural-jobs-129:' || id,
11964
+ 'memory_jobs',
11965
+ id,
11966
+ status,
11967
+ json_object(
11968
+ 'id', id,
11969
+ 'memory_id', memory_id,
11970
+ 'document_id', document_id,
11971
+ 'job_type', job_type,
11972
+ 'status', status,
11973
+ 'payload', payload,
11974
+ 'result', result,
11975
+ 'attempts', attempts,
11976
+ 'max_attempts', max_attempts,
11977
+ 'leased_at', leased_at,
11978
+ 'completed_at', completed_at,
11979
+ 'failed_at', failed_at,
11980
+ 'error', error,
11981
+ 'created_at', created_at,
11982
+ 'updated_at', updated_at
11983
+ ),
11984
+ 'retired structural queue after Dreaming cutover',
11985
+ 'migration:129',
11986
+ 'system',
11987
+ NULL,
11988
+ strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
11989
+ FROM memory_jobs
11990
+ WHERE job_type IN ('structural_classify', 'structural_dependency')
11991
+ AND status IN ('pending', 'leased');
11992
+ `).run();
11993
+ db.exec(`
11994
+ UPDATE memory_jobs
11995
+ SET status = 'cancelled', updated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
11996
+ WHERE job_type IN ('structural_classify', 'structural_dependency')
11997
+ AND status IN ('pending', 'leased');
11998
+ `);
11999
+ }
12000
+
11947
12001
  // src/migrations/index.ts
11948
12002
  var MIGRATIONS = [
11949
12003
  {
@@ -12976,6 +13030,11 @@ var MIGRATIONS = [
12976
13030
  version: 128,
12977
13031
  name: "bounded-queue-diagnostics",
12978
13032
  up: up128
13033
+ },
13034
+ {
13035
+ version: 129,
13036
+ name: "retire-structural-jobs",
13037
+ up: up129
12979
13038
  }
12980
13039
  ];
12981
13040
  function checksum(m) {
@@ -0,0 +1,17 @@
1
+ import type { MigrationDb } from "./index";
2
+ /**
3
+ * Migration 129: retire the structural queues removed by the Dreaming cutover
4
+ * (#1391).
5
+ *
6
+ * `structural_classify` and `structural_dependency` no longer have workers or
7
+ * producers. Pending and leased rows cannot make progress, but they still make
8
+ * queue health look unhealthy and indefinitely defer automatic Dreaming. Keep
9
+ * the source rows for operator provenance: copy each original row into the
10
+ * existing cancellation audit before marking it cancelled. Terminal rows and
11
+ * every other job type are intentionally untouched.
12
+ *
13
+ * The migration runner wraps this complete audit-and-cancel operation in one
14
+ * savepoint, so an audit write failure rolls back the status change too.
15
+ */
16
+ export declare function up(db: MigrationDb): void;
17
+ //# sourceMappingURL=129-retire-structural-jobs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"129-retire-structural-jobs.d.ts","sourceRoot":"","sources":["../../src/migrations/129-retire-structural-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAoDxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqIH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,GAA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AM,qBAAqB,QAAkD,CAAC;AAsBrF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAiDnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signetai/core",
3
- "version": "0.197.7",
3
+ "version": "0.197.8",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Core library for Signet - portable AI agent identity",
6
6
  "type": "module",