@signetai/core 0.198.0 → 0.198.1
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
|
@@ -11998,6 +11998,48 @@ function up129(db) {
|
|
|
11998
11998
|
`);
|
|
11999
11999
|
}
|
|
12000
12000
|
|
|
12001
|
+
// src/migrations/130-embedding-repair-state.ts
|
|
12002
|
+
function up130(db) {
|
|
12003
|
+
db.exec(`
|
|
12004
|
+
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
12005
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
12006
|
+
window_started_at TEXT NOT NULL,
|
|
12007
|
+
batches_started INTEGER NOT NULL DEFAULT 0 CHECK (batches_started >= 0),
|
|
12008
|
+
last_completed_at TEXT,
|
|
12009
|
+
last_affected INTEGER NOT NULL DEFAULT 0 CHECK (last_affected >= 0),
|
|
12010
|
+
lease_id TEXT,
|
|
12011
|
+
lease_expires_at TEXT,
|
|
12012
|
+
last_error TEXT,
|
|
12013
|
+
updated_at TEXT NOT NULL
|
|
12014
|
+
);
|
|
12015
|
+
|
|
12016
|
+
CREATE TABLE IF NOT EXISTS embedding_repair_backoff (
|
|
12017
|
+
memory_id TEXT NOT NULL,
|
|
12018
|
+
content_hash TEXT NOT NULL,
|
|
12019
|
+
model TEXT NOT NULL,
|
|
12020
|
+
attempts INTEGER NOT NULL DEFAULT 1 CHECK (attempts > 0),
|
|
12021
|
+
retry_at TEXT NOT NULL,
|
|
12022
|
+
updated_at TEXT NOT NULL,
|
|
12023
|
+
PRIMARY KEY (memory_id, content_hash, model)
|
|
12024
|
+
);
|
|
12025
|
+
CREATE INDEX IF NOT EXISTS idx_embedding_repair_backoff_retry
|
|
12026
|
+
ON embedding_repair_backoff(model, retry_at);
|
|
12027
|
+
|
|
12028
|
+
-- Backoff is derived state. Retire it when the source memory disappears
|
|
12029
|
+
-- or moves to a new hash so stale retry keys cannot accumulate forever.
|
|
12030
|
+
CREATE TRIGGER IF NOT EXISTS embedding_repair_backoff_memory_deleted
|
|
12031
|
+
AFTER DELETE ON memories BEGIN
|
|
12032
|
+
DELETE FROM embedding_repair_backoff WHERE memory_id = OLD.id;
|
|
12033
|
+
END;
|
|
12034
|
+
CREATE TRIGGER IF NOT EXISTS embedding_repair_backoff_content_hash_changed
|
|
12035
|
+
AFTER UPDATE OF content_hash ON memories
|
|
12036
|
+
WHEN OLD.content_hash IS NOT NEW.content_hash BEGIN
|
|
12037
|
+
DELETE FROM embedding_repair_backoff
|
|
12038
|
+
WHERE memory_id = OLD.id AND content_hash IS NOT NEW.content_hash;
|
|
12039
|
+
END;
|
|
12040
|
+
`);
|
|
12041
|
+
}
|
|
12042
|
+
|
|
12001
12043
|
// src/migrations/index.ts
|
|
12002
12044
|
var MIGRATIONS = [
|
|
12003
12045
|
{
|
|
@@ -13035,6 +13077,12 @@ var MIGRATIONS = [
|
|
|
13035
13077
|
version: 129,
|
|
13036
13078
|
name: "retire-structural-jobs",
|
|
13037
13079
|
up: up129
|
|
13080
|
+
},
|
|
13081
|
+
{
|
|
13082
|
+
version: 130,
|
|
13083
|
+
name: "embedding-repair-state",
|
|
13084
|
+
up: up130,
|
|
13085
|
+
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
13038
13086
|
}
|
|
13039
13087
|
];
|
|
13040
13088
|
function checksum(m) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MigrationDb } from "./index";
|
|
2
|
+
/**
|
|
3
|
+
* Migration 129: durable admission and retry state for incremental embedding
|
|
4
|
+
* repair. The tracker is intentionally a singleton budget plus per-memory
|
|
5
|
+
* backoff rows, not a second queue or owner for embedding writes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function up(db: MigrationDb): void;
|
|
8
|
+
//# sourceMappingURL=130-embedding-repair-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"130-embedding-repair-state.d.ts","sourceRoot":"","sources":["../../src/migrations/130-embedding-repair-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;GAIG;AACH,wBAAgB,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAuCxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuIH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QACrB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC9B,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;QAC7D,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;KACnD,CAAC;CACF;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS;QAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,6FAA6F;QAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;KAC5B,EAAE,CAAC;CACJ;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM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