@signetai/connector-gemini 0.221.10 → 0.221.11
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 +630 -606
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11389,6 +11389,12 @@ function up(db) {
|
|
|
11389
11389
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
11390
11390
|
`);
|
|
11391
11391
|
}
|
|
11392
|
+
function up2(db) {
|
|
11393
|
+
db.exec(`
|
|
11394
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
11395
|
+
CREATE INDEX idx_memory_artifacts_agent_sha ON memory_artifacts(agent_id, source_sha256, COALESCE(source_id, ''), COALESCE(is_deleted, 0), captured_at DESC, source_path)
|
|
11396
|
+
`);
|
|
11397
|
+
}
|
|
11392
11398
|
var MEMORIES_FTS_TOKENIZER = "unicode61";
|
|
11393
11399
|
var FTS_STATE_TABLE = "memories_fts_state";
|
|
11394
11400
|
function normalizeSql(sql) {
|
|
@@ -11504,7 +11510,7 @@ function memoriesFtsNeedsTokenizerRepair(sql) {
|
|
|
11504
11510
|
return true;
|
|
11505
11511
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER}'`);
|
|
11506
11512
|
}
|
|
11507
|
-
function
|
|
11513
|
+
function up3(db) {
|
|
11508
11514
|
db.exec(`
|
|
11509
11515
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
11510
11516
|
version INTEGER PRIMARY KEY,
|
|
@@ -11602,7 +11608,7 @@ function addColumnIfMissing(db, table, column, definition) {
|
|
|
11602
11608
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11603
11609
|
}
|
|
11604
11610
|
}
|
|
11605
|
-
function
|
|
11611
|
+
function up4(db) {
|
|
11606
11612
|
addColumnIfMissing(db, "memories", "content_hash", "TEXT");
|
|
11607
11613
|
addColumnIfMissing(db, "memories", "normalized_content", "TEXT");
|
|
11608
11614
|
addColumnIfMissing(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -11720,7 +11726,7 @@ function addColumnIfMissing2(db, table, column, definition) {
|
|
|
11720
11726
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11721
11727
|
return true;
|
|
11722
11728
|
}
|
|
11723
|
-
function
|
|
11729
|
+
function up5(db) {
|
|
11724
11730
|
addColumnIfMissing2(db, "memories", "why", "TEXT");
|
|
11725
11731
|
addColumnIfMissing2(db, "memories", "project", "TEXT");
|
|
11726
11732
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -11757,7 +11763,7 @@ function addColumnIfMissing3(db, table, column, definition) {
|
|
|
11757
11763
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11758
11764
|
}
|
|
11759
11765
|
}
|
|
11760
|
-
function
|
|
11766
|
+
function up6(db) {
|
|
11761
11767
|
addColumnIfMissing3(db, "memory_history", "actor_type", "TEXT");
|
|
11762
11768
|
addColumnIfMissing3(db, "memory_history", "session_id", "TEXT");
|
|
11763
11769
|
addColumnIfMissing3(db, "memory_history", "request_id", "TEXT");
|
|
@@ -11790,7 +11796,7 @@ function addColumnIfMissing4(db, table, column, definition) {
|
|
|
11790
11796
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11791
11797
|
}
|
|
11792
11798
|
}
|
|
11793
|
-
function
|
|
11799
|
+
function up7(db) {
|
|
11794
11800
|
addColumnIfMissing4(db, "entities", "canonical_name", "TEXT");
|
|
11795
11801
|
addColumnIfMissing4(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
11796
11802
|
addColumnIfMissing4(db, "entities", "embedding", "BLOB");
|
|
@@ -11807,7 +11813,7 @@ function hasColumn4(db, table, column) {
|
|
|
11807
11813
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11808
11814
|
return rows.some((r2) => r2.name === column);
|
|
11809
11815
|
}
|
|
11810
|
-
function
|
|
11816
|
+
function up8(db) {
|
|
11811
11817
|
if (!hasColumn4(db, "memories", "idempotency_key")) {
|
|
11812
11818
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
11813
11819
|
}
|
|
@@ -11822,7 +11828,7 @@ function hasColumn5(db, table, column) {
|
|
|
11822
11828
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11823
11829
|
return rows.some((r2) => r2.name === column);
|
|
11824
11830
|
}
|
|
11825
|
-
function
|
|
11831
|
+
function up9(db) {
|
|
11826
11832
|
db.exec(`
|
|
11827
11833
|
CREATE TABLE IF NOT EXISTS documents (
|
|
11828
11834
|
id TEXT PRIMARY KEY,
|
|
@@ -11879,7 +11885,7 @@ function up8(db) {
|
|
|
11879
11885
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
11880
11886
|
}
|
|
11881
11887
|
}
|
|
11882
|
-
function
|
|
11888
|
+
function up10(db) {
|
|
11883
11889
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
11884
11890
|
if (tables.length === 0)
|
|
11885
11891
|
return;
|
|
@@ -11896,7 +11902,7 @@ function up9(db) {
|
|
|
11896
11902
|
ON embeddings(content_hash)
|
|
11897
11903
|
`);
|
|
11898
11904
|
}
|
|
11899
|
-
function
|
|
11905
|
+
function up11(db) {
|
|
11900
11906
|
db.exec(`
|
|
11901
11907
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
11902
11908
|
id TEXT PRIMARY KEY,
|
|
@@ -11916,7 +11922,7 @@ function up10(db) {
|
|
|
11916
11922
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
11917
11923
|
ON summary_jobs(status)`);
|
|
11918
11924
|
}
|
|
11919
|
-
function
|
|
11925
|
+
function up12(db) {
|
|
11920
11926
|
db.exec(`
|
|
11921
11927
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
11922
11928
|
id INTEGER PRIMARY KEY,
|
|
@@ -11927,7 +11933,7 @@ function up11(db) {
|
|
|
11927
11933
|
)
|
|
11928
11934
|
`);
|
|
11929
11935
|
}
|
|
11930
|
-
function
|
|
11936
|
+
function up13(db) {
|
|
11931
11937
|
db.exec(`
|
|
11932
11938
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
11933
11939
|
id TEXT PRIMARY KEY,
|
|
@@ -11947,7 +11953,7 @@ function up12(db) {
|
|
|
11947
11953
|
ON session_scores(session_key);
|
|
11948
11954
|
`);
|
|
11949
11955
|
}
|
|
11950
|
-
function
|
|
11956
|
+
function up14(db) {
|
|
11951
11957
|
db.exec(`
|
|
11952
11958
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
11953
11959
|
id TEXT PRIMARY KEY,
|
|
@@ -11988,7 +11994,7 @@ function addColumnIfMissing5(db, table, column, definition) {
|
|
|
11988
11994
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11989
11995
|
}
|
|
11990
11996
|
}
|
|
11991
|
-
function
|
|
11997
|
+
function up15(db) {
|
|
11992
11998
|
db.exec(`
|
|
11993
11999
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
11994
12000
|
id TEXT PRIMARY KEY,
|
|
@@ -12014,7 +12020,7 @@ function up14(db) {
|
|
|
12014
12020
|
addColumnIfMissing5(db, "memories", "source_path", "TEXT");
|
|
12015
12021
|
addColumnIfMissing5(db, "memories", "source_section", "TEXT");
|
|
12016
12022
|
}
|
|
12017
|
-
function
|
|
12023
|
+
function up16(db) {
|
|
12018
12024
|
db.exec(`
|
|
12019
12025
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
12020
12026
|
id TEXT PRIMARY KEY,
|
|
@@ -12039,7 +12045,7 @@ function addColumnIfMissing6(db, table, column, definition) {
|
|
|
12039
12045
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12040
12046
|
}
|
|
12041
12047
|
}
|
|
12042
|
-
function
|
|
12048
|
+
function up17(db) {
|
|
12043
12049
|
db.exec(`
|
|
12044
12050
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
12045
12051
|
id TEXT PRIMARY KEY,
|
|
@@ -12066,7 +12072,7 @@ function up16(db) {
|
|
|
12066
12072
|
addColumnIfMissing6(db, "session_scores", "confidence", "REAL");
|
|
12067
12073
|
addColumnIfMissing6(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
12068
12074
|
}
|
|
12069
|
-
function
|
|
12075
|
+
function up18(db) {
|
|
12070
12076
|
db.exec(`
|
|
12071
12077
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
12072
12078
|
id TEXT PRIMARY KEY,
|
|
@@ -12088,7 +12094,7 @@ function up17(db) {
|
|
|
12088
12094
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
12089
12095
|
`);
|
|
12090
12096
|
}
|
|
12091
|
-
function
|
|
12097
|
+
function up19(db) {
|
|
12092
12098
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
12093
12099
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12094
12100
|
if (!colNames.has("skill_name")) {
|
|
@@ -12099,7 +12105,7 @@ function up18(db) {
|
|
|
12099
12105
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
12100
12106
|
}
|
|
12101
12107
|
}
|
|
12102
|
-
function
|
|
12108
|
+
function up20(db) {
|
|
12103
12109
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
12104
12110
|
if (existing)
|
|
12105
12111
|
return;
|
|
@@ -12131,7 +12137,7 @@ function up19(db) {
|
|
|
12131
12137
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
12132
12138
|
`);
|
|
12133
12139
|
}
|
|
12134
|
-
function
|
|
12140
|
+
function up21(db) {
|
|
12135
12141
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
12136
12142
|
const entityColNames = new Set(entityCols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12137
12143
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -12216,13 +12222,13 @@ function addColumnIfMissing7(db, table, column, definition) {
|
|
|
12216
12222
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12217
12223
|
}
|
|
12218
12224
|
}
|
|
12219
|
-
function
|
|
12225
|
+
function up22(db) {
|
|
12220
12226
|
addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
|
|
12221
12227
|
addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12222
12228
|
addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
12223
12229
|
addColumnIfMissing7(db, "session_memories", "structural_density", "INTEGER");
|
|
12224
12230
|
}
|
|
12225
|
-
function
|
|
12231
|
+
function up23(db) {
|
|
12226
12232
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
12227
12233
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
12228
12234
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -12247,25 +12253,25 @@ function addColumnIfMissing8(db, table, column, definition) {
|
|
|
12247
12253
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12248
12254
|
}
|
|
12249
12255
|
}
|
|
12250
|
-
function
|
|
12256
|
+
function up24(db) {
|
|
12251
12257
|
addColumnIfMissing8(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
12252
12258
|
addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
|
|
12253
12259
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
12254
12260
|
}
|
|
12255
|
-
function up24(_db) {}
|
|
12256
12261
|
function up25(_db) {}
|
|
12262
|
+
function up26(_db) {}
|
|
12257
12263
|
function addColumnIfMissing9(db, table, column, definition) {
|
|
12258
12264
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
12259
12265
|
if (!cols.some((c2) => c2.name === column)) {
|
|
12260
12266
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12261
12267
|
}
|
|
12262
12268
|
}
|
|
12263
|
-
function
|
|
12269
|
+
function up27(db) {
|
|
12264
12270
|
addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
|
|
12265
12271
|
addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
12266
12272
|
}
|
|
12267
|
-
function
|
|
12268
|
-
function
|
|
12273
|
+
function up28(_db) {}
|
|
12274
|
+
function up29(db) {
|
|
12269
12275
|
db.exec(`
|
|
12270
12276
|
UPDATE entities
|
|
12271
12277
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -12274,7 +12280,7 @@ function up28(db) {
|
|
|
12274
12280
|
WHERE canonical_name IS NULL
|
|
12275
12281
|
`);
|
|
12276
12282
|
}
|
|
12277
|
-
function
|
|
12283
|
+
function up30(db) {
|
|
12278
12284
|
db.exec(`
|
|
12279
12285
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
12280
12286
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -12311,7 +12317,7 @@ function up29(db) {
|
|
|
12311
12317
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
12312
12318
|
`);
|
|
12313
12319
|
}
|
|
12314
|
-
function
|
|
12320
|
+
function up31(db) {
|
|
12315
12321
|
db.exec(`
|
|
12316
12322
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
12317
12323
|
id TEXT PRIMARY KEY,
|
|
@@ -12356,7 +12362,7 @@ function up30(db) {
|
|
|
12356
12362
|
WHERE session_key IS NOT NULL;
|
|
12357
12363
|
`);
|
|
12358
12364
|
}
|
|
12359
|
-
function
|
|
12365
|
+
function up32(db) {
|
|
12360
12366
|
db.exec(`
|
|
12361
12367
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
12362
12368
|
id TEXT PRIMARY KEY,
|
|
@@ -12401,7 +12407,7 @@ function up31(db) {
|
|
|
12401
12407
|
ON memory_jobs(failed_at);
|
|
12402
12408
|
`);
|
|
12403
12409
|
}
|
|
12404
|
-
function
|
|
12410
|
+
function up33(db) {
|
|
12405
12411
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12406
12412
|
if (!depCols.some((c2) => c2.name === "reason")) {
|
|
12407
12413
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -12411,7 +12417,7 @@ function up32(db) {
|
|
|
12411
12417
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
12412
12418
|
}
|
|
12413
12419
|
}
|
|
12414
|
-
function
|
|
12420
|
+
function up34(db) {
|
|
12415
12421
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
12416
12422
|
if (cols.length === 0)
|
|
12417
12423
|
return;
|
|
@@ -12419,14 +12425,14 @@ function up33(db) {
|
|
|
12419
12425
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
12420
12426
|
}
|
|
12421
12427
|
}
|
|
12422
|
-
function
|
|
12428
|
+
function up35(db) {
|
|
12423
12429
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
12424
12430
|
if (!cols.some((c2) => c2.name === "scope")) {
|
|
12425
12431
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
12426
12432
|
}
|
|
12427
12433
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
12428
12434
|
}
|
|
12429
|
-
function
|
|
12435
|
+
function up36(db) {
|
|
12430
12436
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
12431
12437
|
db.exec(`
|
|
12432
12438
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -12434,7 +12440,7 @@ function up35(db) {
|
|
|
12434
12440
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
12435
12441
|
`);
|
|
12436
12442
|
}
|
|
12437
|
-
function
|
|
12443
|
+
function up37(db) {
|
|
12438
12444
|
db.exec(`
|
|
12439
12445
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
12440
12446
|
name, canonical_name,
|
|
@@ -12466,13 +12472,13 @@ function up36(db) {
|
|
|
12466
12472
|
END
|
|
12467
12473
|
`);
|
|
12468
12474
|
}
|
|
12469
|
-
function
|
|
12475
|
+
function up38(db) {
|
|
12470
12476
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12471
12477
|
if (!cols.some((c2) => c2.name === "confidence")) {
|
|
12472
12478
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
12473
12479
|
}
|
|
12474
12480
|
}
|
|
12475
|
-
function
|
|
12481
|
+
function up39(db) {
|
|
12476
12482
|
db.exec(`
|
|
12477
12483
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
12478
12484
|
id TEXT PRIMARY KEY,
|
|
@@ -12490,7 +12496,7 @@ function up38(db) {
|
|
|
12490
12496
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
12491
12497
|
}
|
|
12492
12498
|
}
|
|
12493
|
-
function
|
|
12499
|
+
function up40(db) {
|
|
12494
12500
|
db.exec(`
|
|
12495
12501
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
12496
12502
|
id TEXT PRIMARY KEY,
|
|
@@ -12530,7 +12536,7 @@ function up39(db) {
|
|
|
12530
12536
|
END
|
|
12531
12537
|
`);
|
|
12532
12538
|
}
|
|
12533
|
-
function
|
|
12539
|
+
function up41(db) {
|
|
12534
12540
|
db.exec(`
|
|
12535
12541
|
DELETE FROM entity_dependencies
|
|
12536
12542
|
WHERE id NOT IN (
|
|
@@ -12548,7 +12554,7 @@ function up40(db) {
|
|
|
12548
12554
|
)
|
|
12549
12555
|
`);
|
|
12550
12556
|
}
|
|
12551
|
-
function
|
|
12557
|
+
function up42(db) {
|
|
12552
12558
|
db.exec(`
|
|
12553
12559
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
12554
12560
|
session_key TEXT PRIMARY KEY,
|
|
@@ -12571,7 +12577,7 @@ function addColumnIfMissing10(db, table, column, definition) {
|
|
|
12571
12577
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12572
12578
|
}
|
|
12573
12579
|
}
|
|
12574
|
-
function
|
|
12580
|
+
function up43(db) {
|
|
12575
12581
|
addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
|
|
12576
12582
|
db.exec(`
|
|
12577
12583
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -12646,7 +12652,7 @@ function addColumnIfMissing11(db, table, column, definition) {
|
|
|
12646
12652
|
return;
|
|
12647
12653
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12648
12654
|
}
|
|
12649
|
-
function
|
|
12655
|
+
function up44(db) {
|
|
12650
12656
|
addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
|
|
12651
12657
|
addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12652
12658
|
addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -12734,7 +12740,7 @@ function addColumnIfMissing12(db, table, column, definition) {
|
|
|
12734
12740
|
return;
|
|
12735
12741
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12736
12742
|
}
|
|
12737
|
-
function
|
|
12743
|
+
function up45(db) {
|
|
12738
12744
|
db.exec(`
|
|
12739
12745
|
CREATE TABLE IF NOT EXISTS agents (
|
|
12740
12746
|
id TEXT PRIMARY KEY,
|
|
@@ -12763,7 +12769,7 @@ function addColumnIfMissing13(db, table, column, definition) {
|
|
|
12763
12769
|
return;
|
|
12764
12770
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12765
12771
|
}
|
|
12766
|
-
function
|
|
12772
|
+
function up46(db) {
|
|
12767
12773
|
addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
|
|
12768
12774
|
addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
|
|
12769
12775
|
addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -12789,7 +12795,7 @@ function addColumnIfMissing14(db, table, column, definition) {
|
|
|
12789
12795
|
return;
|
|
12790
12796
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12791
12797
|
}
|
|
12792
|
-
function
|
|
12798
|
+
function up47(db) {
|
|
12793
12799
|
addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
|
|
12794
12800
|
addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
12795
12801
|
addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -12860,7 +12866,7 @@ function up46(db) {
|
|
|
12860
12866
|
ON memory_md_heads(lease_expires_at);
|
|
12861
12867
|
`);
|
|
12862
12868
|
}
|
|
12863
|
-
function
|
|
12869
|
+
function up48(db) {
|
|
12864
12870
|
db.exec(`
|
|
12865
12871
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
12866
12872
|
|
|
@@ -12921,7 +12927,7 @@ function up47(db) {
|
|
|
12921
12927
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
12922
12928
|
`);
|
|
12923
12929
|
}
|
|
12924
|
-
function
|
|
12930
|
+
function up49(db) {
|
|
12925
12931
|
db.exec(`
|
|
12926
12932
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
12927
12933
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -13019,7 +13025,7 @@ function up48(db) {
|
|
|
13019
13025
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
13020
13026
|
`);
|
|
13021
13027
|
}
|
|
13022
|
-
function
|
|
13028
|
+
function up50(db) {
|
|
13023
13029
|
db.exec(`
|
|
13024
13030
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
13025
13031
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -13137,7 +13143,7 @@ function up49(db) {
|
|
|
13137
13143
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
13138
13144
|
`);
|
|
13139
13145
|
}
|
|
13140
|
-
function
|
|
13146
|
+
function up51(db) {
|
|
13141
13147
|
db.exec(`
|
|
13142
13148
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
13143
13149
|
session_key TEXT NOT NULL,
|
|
@@ -13154,7 +13160,7 @@ function hasTable(db, name) {
|
|
|
13154
13160
|
WHERE type = 'table' AND name = ?
|
|
13155
13161
|
LIMIT 1`).get(name) !== undefined;
|
|
13156
13162
|
}
|
|
13157
|
-
function
|
|
13163
|
+
function up52(db) {
|
|
13158
13164
|
db.exec(`
|
|
13159
13165
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
13160
13166
|
id TEXT PRIMARY KEY,
|
|
@@ -13324,7 +13330,7 @@ function addColumnIfMissing15(db, table, column, definition) {
|
|
|
13324
13330
|
return;
|
|
13325
13331
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13326
13332
|
}
|
|
13327
|
-
function
|
|
13333
|
+
function up53(db) {
|
|
13328
13334
|
addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
|
|
13329
13335
|
addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
13330
13336
|
addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -13416,7 +13422,7 @@ function up52(db) {
|
|
|
13416
13422
|
VALUES ('rebuild');
|
|
13417
13423
|
`);
|
|
13418
13424
|
}
|
|
13419
|
-
function
|
|
13425
|
+
function up54(db) {
|
|
13420
13426
|
db.exec(`
|
|
13421
13427
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
13422
13428
|
id TEXT PRIMARY KEY,
|
|
@@ -13433,7 +13439,7 @@ function up53(db) {
|
|
|
13433
13439
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
13434
13440
|
`);
|
|
13435
13441
|
}
|
|
13436
|
-
function
|
|
13442
|
+
function up55(db) {
|
|
13437
13443
|
db.exec(`
|
|
13438
13444
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
13439
13445
|
id TEXT PRIMARY KEY,
|
|
@@ -13449,7 +13455,7 @@ function up54(db) {
|
|
|
13449
13455
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
13450
13456
|
`);
|
|
13451
13457
|
}
|
|
13452
|
-
function
|
|
13458
|
+
function up56(db) {
|
|
13453
13459
|
db.exec(`
|
|
13454
13460
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
13455
13461
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -13480,7 +13486,7 @@ function up55(db) {
|
|
|
13480
13486
|
ON task_scope_hints(agent_id, updated_at);
|
|
13481
13487
|
`);
|
|
13482
13488
|
}
|
|
13483
|
-
function
|
|
13489
|
+
function up57(db) {
|
|
13484
13490
|
db.exec(`
|
|
13485
13491
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
13486
13492
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -13523,7 +13529,7 @@ function ensureMemoriesScopeColumns(db) {
|
|
|
13523
13529
|
if (!names.has("scope"))
|
|
13524
13530
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
13525
13531
|
}
|
|
13526
|
-
function
|
|
13532
|
+
function up58(db) {
|
|
13527
13533
|
ensureMemoriesScopeColumns(db);
|
|
13528
13534
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
13529
13535
|
db.exec(`
|
|
@@ -13536,20 +13542,20 @@ function up57(db) {
|
|
|
13536
13542
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
13537
13543
|
`);
|
|
13538
13544
|
}
|
|
13539
|
-
function
|
|
13545
|
+
function up59(db) {
|
|
13540
13546
|
const sql = readMemoriesFtsSql(db);
|
|
13541
13547
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair(sql))
|
|
13542
13548
|
return;
|
|
13543
13549
|
recreateMemoriesFts(db);
|
|
13544
13550
|
}
|
|
13545
|
-
function
|
|
13551
|
+
function up60(db) {
|
|
13546
13552
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
13547
13553
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
13548
13554
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
13549
13555
|
ON entities(entity_type, mentions)
|
|
13550
13556
|
WHERE entity_type = 'extracted'`);
|
|
13551
13557
|
}
|
|
13552
|
-
function
|
|
13558
|
+
function up61(db) {
|
|
13553
13559
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13554
13560
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
13555
13561
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -13558,7 +13564,7 @@ function up60(db) {
|
|
|
13558
13564
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
13559
13565
|
WHERE claim_key IS NOT NULL`);
|
|
13560
13566
|
}
|
|
13561
|
-
function
|
|
13567
|
+
function up62(db) {
|
|
13562
13568
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13563
13569
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
13564
13570
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -13570,13 +13576,13 @@ function up61(db) {
|
|
|
13570
13576
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
13571
13577
|
WHERE claim_key IS NOT NULL`);
|
|
13572
13578
|
}
|
|
13573
|
-
function
|
|
13579
|
+
function up63(db) {
|
|
13574
13580
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13575
13581
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
13576
13582
|
return;
|
|
13577
13583
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
13578
13584
|
}
|
|
13579
|
-
function
|
|
13585
|
+
function up64(db) {
|
|
13580
13586
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13581
13587
|
const names = new Set(cols.map((col) => col.name));
|
|
13582
13588
|
if (!names.has("is_deleted")) {
|
|
@@ -13590,7 +13596,7 @@ function up63(db) {
|
|
|
13590
13596
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
13591
13597
|
`);
|
|
13592
13598
|
}
|
|
13593
|
-
function
|
|
13599
|
+
function up65(db) {
|
|
13594
13600
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
13595
13601
|
db.exec(`
|
|
13596
13602
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -13608,7 +13614,7 @@ function addColumnIfMissing16(db, table, column, definition) {
|
|
|
13608
13614
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13609
13615
|
}
|
|
13610
13616
|
}
|
|
13611
|
-
function
|
|
13617
|
+
function up66(db) {
|
|
13612
13618
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
13613
13619
|
addColumnIfMissing16(db, table, "source_id", "TEXT");
|
|
13614
13620
|
addColumnIfMissing16(db, table, "source_kind", "TEXT");
|
|
@@ -13628,7 +13634,7 @@ function hasColumn7(db, table, column) {
|
|
|
13628
13634
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
13629
13635
|
return rows.some((row) => row.name === column);
|
|
13630
13636
|
}
|
|
13631
|
-
function
|
|
13637
|
+
function up67(db) {
|
|
13632
13638
|
if (!hasTable2(db, "embeddings"))
|
|
13633
13639
|
return;
|
|
13634
13640
|
if (!hasColumn7(db, "embeddings", "agent_id")) {
|
|
@@ -13636,7 +13642,7 @@ function up66(db) {
|
|
|
13636
13642
|
}
|
|
13637
13643
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
13638
13644
|
}
|
|
13639
|
-
function
|
|
13645
|
+
function up68(db) {
|
|
13640
13646
|
db.exec(`
|
|
13641
13647
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
13642
13648
|
id TEXT PRIMARY KEY,
|
|
@@ -13677,7 +13683,7 @@ function addColumnIfMissing17(db, table, column, definition) {
|
|
|
13677
13683
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13678
13684
|
}
|
|
13679
13685
|
}
|
|
13680
|
-
function
|
|
13686
|
+
function up69(db) {
|
|
13681
13687
|
db.exec(`
|
|
13682
13688
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
13683
13689
|
id TEXT PRIMARY KEY,
|
|
@@ -13720,7 +13726,7 @@ function up68(db) {
|
|
|
13720
13726
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
13721
13727
|
}
|
|
13722
13728
|
}
|
|
13723
|
-
function
|
|
13729
|
+
function up70(db) {
|
|
13724
13730
|
db.exec(`
|
|
13725
13731
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
13726
13732
|
id TEXT PRIMARY KEY,
|
|
@@ -13747,7 +13753,7 @@ function up69(db) {
|
|
|
13747
13753
|
WHERE content_key IS NOT NULL;
|
|
13748
13754
|
`);
|
|
13749
13755
|
}
|
|
13750
|
-
function
|
|
13756
|
+
function up71(db) {
|
|
13751
13757
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
13752
13758
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
13753
13759
|
if (!colNames.has("content_key")) {
|
|
@@ -13784,7 +13790,7 @@ function backfillVersionRoots(db) {
|
|
|
13784
13790
|
WHERE version_root_id IS NULL
|
|
13785
13791
|
`);
|
|
13786
13792
|
}
|
|
13787
|
-
function
|
|
13793
|
+
function up72(db) {
|
|
13788
13794
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
13789
13795
|
addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
13790
13796
|
addColumnIfMissing18(db, table, "archived_at", "TEXT");
|
|
@@ -13819,7 +13825,7 @@ function up71(db) {
|
|
|
13819
13825
|
ON entity_aspects(agent_id, proposal_id);
|
|
13820
13826
|
`);
|
|
13821
13827
|
}
|
|
13822
|
-
function
|
|
13828
|
+
function up73(db) {
|
|
13823
13829
|
db.exec(`
|
|
13824
13830
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
13825
13831
|
id TEXT PRIMARY KEY,
|
|
@@ -13875,7 +13881,7 @@ function ensureMemoriesScopeColumns2(db) {
|
|
|
13875
13881
|
if (!names.has("runtime_path"))
|
|
13876
13882
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
13877
13883
|
}
|
|
13878
|
-
function
|
|
13884
|
+
function up74(db) {
|
|
13879
13885
|
ensureMemoriesScopeColumns2(db);
|
|
13880
13886
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
13881
13887
|
db.exec(`
|
|
@@ -13889,7 +13895,7 @@ function up73(db) {
|
|
|
13889
13895
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
13890
13896
|
`);
|
|
13891
13897
|
}
|
|
13892
|
-
function
|
|
13898
|
+
function up75(db) {
|
|
13893
13899
|
db.exec(`
|
|
13894
13900
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
13895
13901
|
session_key TEXT NOT NULL,
|
|
@@ -13924,7 +13930,7 @@ function up74(db) {
|
|
|
13924
13930
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
13925
13931
|
`);
|
|
13926
13932
|
}
|
|
13927
|
-
function
|
|
13933
|
+
function up76(db) {
|
|
13928
13934
|
db.exec(`
|
|
13929
13935
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
13930
13936
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -13943,7 +13949,7 @@ function addColumnIfMissing19(db, table, column, definition) {
|
|
|
13943
13949
|
return;
|
|
13944
13950
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13945
13951
|
}
|
|
13946
|
-
function
|
|
13952
|
+
function up77(db) {
|
|
13947
13953
|
addColumnIfMissing19(db, "memory_artifacts", "source_id", "TEXT");
|
|
13948
13954
|
addColumnIfMissing19(db, "memory_artifacts", "source_root", "TEXT");
|
|
13949
13955
|
addColumnIfMissing19(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -13956,7 +13962,7 @@ function up76(db) {
|
|
|
13956
13962
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
13957
13963
|
`);
|
|
13958
13964
|
}
|
|
13959
|
-
function
|
|
13965
|
+
function up78(db) {
|
|
13960
13966
|
db.exec(`
|
|
13961
13967
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
13962
13968
|
id TEXT PRIMARY KEY,
|
|
@@ -13979,7 +13985,7 @@ function up77(db) {
|
|
|
13979
13985
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
13980
13986
|
`);
|
|
13981
13987
|
}
|
|
13982
|
-
function
|
|
13988
|
+
function up79(db) {
|
|
13983
13989
|
db.exec(`
|
|
13984
13990
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
13985
13991
|
id TEXT PRIMARY KEY,
|
|
@@ -14003,7 +14009,7 @@ function up78(db) {
|
|
|
14003
14009
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
14004
14010
|
`);
|
|
14005
14011
|
}
|
|
14006
|
-
function
|
|
14012
|
+
function up80(db) {
|
|
14007
14013
|
db.exec(`
|
|
14008
14014
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
14009
14015
|
id TEXT PRIMARY KEY,
|
|
@@ -14031,7 +14037,7 @@ function up79(db) {
|
|
|
14031
14037
|
ON api_keys(connector, harness);
|
|
14032
14038
|
`);
|
|
14033
14039
|
}
|
|
14034
|
-
function
|
|
14040
|
+
function up81(db) {
|
|
14035
14041
|
db.exec(`
|
|
14036
14042
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
14037
14043
|
id TEXT PRIMARY KEY,
|
|
@@ -14066,7 +14072,7 @@ function hasColumn10(db, table, column) {
|
|
|
14066
14072
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14067
14073
|
return rows.some((row) => row.name === column);
|
|
14068
14074
|
}
|
|
14069
|
-
function
|
|
14075
|
+
function up82(db) {
|
|
14070
14076
|
if (!hasColumn10(db, "documents", "agent_id")) {
|
|
14071
14077
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
14072
14078
|
}
|
|
@@ -14152,7 +14158,7 @@ function up81(db) {
|
|
|
14152
14158
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
14153
14159
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
14154
14160
|
}
|
|
14155
|
-
function
|
|
14161
|
+
function up83(db) {
|
|
14156
14162
|
db.exec(`
|
|
14157
14163
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
14158
14164
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -14174,7 +14180,7 @@ function hasColumn11(db, table, column) {
|
|
|
14174
14180
|
return rows.some((row) => row.name === column);
|
|
14175
14181
|
}
|
|
14176
14182
|
var COLUMNS = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
14177
|
-
function
|
|
14183
|
+
function up84(db) {
|
|
14178
14184
|
for (const column of COLUMNS) {
|
|
14179
14185
|
if (!hasColumn11(db, "skill_invocations", column)) {
|
|
14180
14186
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -14255,7 +14261,7 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14255
14261
|
`);
|
|
14256
14262
|
}
|
|
14257
14263
|
try {
|
|
14258
|
-
|
|
14264
|
+
up82(db);
|
|
14259
14265
|
if (preserveAgentId) {
|
|
14260
14266
|
db.exec(`
|
|
14261
14267
|
UPDATE documents
|
|
@@ -14275,12 +14281,12 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14275
14281
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
14276
14282
|
}
|
|
14277
14283
|
}
|
|
14278
|
-
function
|
|
14279
|
-
|
|
14284
|
+
function up85(db) {
|
|
14285
|
+
up81(db);
|
|
14280
14286
|
if (hasTable3(db, "documents")) {
|
|
14281
14287
|
documentScopeColumnsPreservingExisting(db);
|
|
14282
14288
|
}
|
|
14283
|
-
|
|
14289
|
+
up83(db);
|
|
14284
14290
|
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
14285
14291
|
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
14286
14292
|
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -14337,7 +14343,7 @@ function up84(db) {
|
|
|
14337
14343
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
14338
14344
|
`);
|
|
14339
14345
|
}
|
|
14340
|
-
function
|
|
14346
|
+
function up86(db) {
|
|
14341
14347
|
db.exec(`
|
|
14342
14348
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
14343
14349
|
path TEXT PRIMARY KEY,
|
|
@@ -14367,7 +14373,7 @@ function up85(db) {
|
|
|
14367
14373
|
ON legacy_markdown_chunks(memory_id);
|
|
14368
14374
|
`);
|
|
14369
14375
|
}
|
|
14370
|
-
function
|
|
14376
|
+
function up87(db) {
|
|
14371
14377
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
14372
14378
|
const tableNames = new Set(tables.map((r2) => String(r2.name)));
|
|
14373
14379
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -14426,7 +14432,7 @@ function addColumnIfMissing21(db, table, column, definition) {
|
|
|
14426
14432
|
return;
|
|
14427
14433
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14428
14434
|
}
|
|
14429
|
-
function
|
|
14435
|
+
function up88(db) {
|
|
14430
14436
|
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
14431
14437
|
db.exec(`
|
|
14432
14438
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -14439,14 +14445,14 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
14439
14445
|
return;
|
|
14440
14446
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14441
14447
|
}
|
|
14442
|
-
function
|
|
14448
|
+
function up89(db) {
|
|
14443
14449
|
addColumnIfMissing22(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
14444
14450
|
db.exec(`
|
|
14445
14451
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
14446
14452
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
14447
14453
|
`);
|
|
14448
14454
|
}
|
|
14449
|
-
function
|
|
14455
|
+
function up90(db) {
|
|
14450
14456
|
db.exec(`
|
|
14451
14457
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
14452
14458
|
agent_id TEXT NOT NULL,
|
|
@@ -14464,7 +14470,7 @@ function up89(db) {
|
|
|
14464
14470
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
14465
14471
|
`);
|
|
14466
14472
|
}
|
|
14467
|
-
function
|
|
14473
|
+
function up91(db) {
|
|
14468
14474
|
db.exec(`
|
|
14469
14475
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
14470
14476
|
id TEXT PRIMARY KEY,
|
|
@@ -14492,7 +14498,7 @@ function indexExists(db, table, indexName) {
|
|
|
14492
14498
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14493
14499
|
return rows.some((row) => row.name === indexName);
|
|
14494
14500
|
}
|
|
14495
|
-
function
|
|
14501
|
+
function up92(db) {
|
|
14496
14502
|
db.exec(`
|
|
14497
14503
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
14498
14504
|
id TEXT PRIMARY KEY,
|
|
@@ -14519,7 +14525,7 @@ function indexExists2(db, table, indexName) {
|
|
|
14519
14525
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14520
14526
|
return rows.some((row) => row.name === indexName);
|
|
14521
14527
|
}
|
|
14522
|
-
function
|
|
14528
|
+
function up93(db) {
|
|
14523
14529
|
db.exec(`
|
|
14524
14530
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
14525
14531
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -14532,7 +14538,7 @@ function up92(db) {
|
|
|
14532
14538
|
)
|
|
14533
14539
|
`);
|
|
14534
14540
|
}
|
|
14535
|
-
function
|
|
14541
|
+
function up94(db) {
|
|
14536
14542
|
db.exec(`
|
|
14537
14543
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
14538
14544
|
id TEXT PRIMARY KEY,
|
|
@@ -14551,7 +14557,7 @@ function up93(db) {
|
|
|
14551
14557
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
14552
14558
|
`);
|
|
14553
14559
|
}
|
|
14554
|
-
function
|
|
14560
|
+
function up95(db) {
|
|
14555
14561
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14556
14562
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
14557
14563
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -14562,7 +14568,7 @@ function hasColumn13(db, table, column) {
|
|
|
14562
14568
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14563
14569
|
return rows.some((r2) => r2.name === column);
|
|
14564
14570
|
}
|
|
14565
|
-
function
|
|
14571
|
+
function up96(db) {
|
|
14566
14572
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
14567
14573
|
if (tables.length === 0)
|
|
14568
14574
|
return;
|
|
@@ -14587,23 +14593,23 @@ function up95(db) {
|
|
|
14587
14593
|
function hasColumn14(db, table, column) {
|
|
14588
14594
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14589
14595
|
}
|
|
14590
|
-
function
|
|
14596
|
+
function up97(db) {
|
|
14591
14597
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
14592
14598
|
if (!hasMemories || !hasColumn14(db, "memories", "memory_kind") || !hasColumn14(db, "memories", "type"))
|
|
14593
14599
|
return;
|
|
14594
14600
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
14595
14601
|
}
|
|
14596
|
-
function
|
|
14602
|
+
function up98(db) {
|
|
14597
14603
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
14598
14604
|
}
|
|
14599
|
-
function
|
|
14605
|
+
function up99(db) {
|
|
14600
14606
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14601
14607
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
14602
14608
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
14603
14609
|
}
|
|
14604
14610
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
14605
14611
|
}
|
|
14606
|
-
function
|
|
14612
|
+
function up100(db) {
|
|
14607
14613
|
db.exec(`
|
|
14608
14614
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
14609
14615
|
agent_id TEXT NOT NULL,
|
|
@@ -14620,7 +14626,7 @@ function up99(db) {
|
|
|
14620
14626
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
14621
14627
|
`);
|
|
14622
14628
|
}
|
|
14623
|
-
function
|
|
14629
|
+
function up101(db) {
|
|
14624
14630
|
db.exec(`
|
|
14625
14631
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
14626
14632
|
id TEXT PRIMARY KEY,
|
|
@@ -14640,7 +14646,7 @@ function up100(db) {
|
|
|
14640
14646
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
14641
14647
|
`);
|
|
14642
14648
|
}
|
|
14643
|
-
function
|
|
14649
|
+
function up102(db) {
|
|
14644
14650
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
14645
14651
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
14646
14652
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -14649,7 +14655,7 @@ function up101(db) {
|
|
|
14649
14655
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
14650
14656
|
}
|
|
14651
14657
|
}
|
|
14652
|
-
function
|
|
14658
|
+
function up103(db) {
|
|
14653
14659
|
db.exec(`
|
|
14654
14660
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
14655
14661
|
id TEXT PRIMARY KEY,
|
|
@@ -14671,7 +14677,7 @@ function up102(db) {
|
|
|
14671
14677
|
function hasColumn15(db, table, column) {
|
|
14672
14678
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14673
14679
|
}
|
|
14674
|
-
function
|
|
14680
|
+
function up104(db) {
|
|
14675
14681
|
const requiredMemoryColumns = [
|
|
14676
14682
|
"content_hash",
|
|
14677
14683
|
"normalized_content",
|
|
@@ -14722,7 +14728,7 @@ function up103(db) {
|
|
|
14722
14728
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
14723
14729
|
`);
|
|
14724
14730
|
}
|
|
14725
|
-
function
|
|
14731
|
+
function up105(db) {
|
|
14726
14732
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
14727
14733
|
if (tables.length !== 2)
|
|
14728
14734
|
return;
|
|
@@ -14745,7 +14751,7 @@ function tableExists(db, table) {
|
|
|
14745
14751
|
function hasColumn16(db, table, column) {
|
|
14746
14752
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14747
14753
|
}
|
|
14748
|
-
function
|
|
14754
|
+
function up106(db) {
|
|
14749
14755
|
db.exec(`
|
|
14750
14756
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
14751
14757
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -14788,7 +14794,7 @@ function up105(db) {
|
|
|
14788
14794
|
`);
|
|
14789
14795
|
}
|
|
14790
14796
|
}
|
|
14791
|
-
function
|
|
14797
|
+
function up107(db) {
|
|
14792
14798
|
db.exec(`
|
|
14793
14799
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
14794
14800
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -14877,7 +14883,7 @@ function up106(db) {
|
|
|
14877
14883
|
function hasColumn17(db, table, column) {
|
|
14878
14884
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14879
14885
|
}
|
|
14880
|
-
function
|
|
14886
|
+
function up108(db) {
|
|
14881
14887
|
if (!hasColumn17(db, "memories", "review_after")) {
|
|
14882
14888
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
14883
14889
|
}
|
|
@@ -14893,14 +14899,14 @@ var TOKEN_COLUMNS = [
|
|
|
14893
14899
|
["tokens_cache_write", "INTEGER"],
|
|
14894
14900
|
["tokens_cost", "REAL"]
|
|
14895
14901
|
];
|
|
14896
|
-
function
|
|
14902
|
+
function up109(db) {
|
|
14897
14903
|
for (const [column, type] of TOKEN_COLUMNS) {
|
|
14898
14904
|
if (!hasColumn18(db, "dreaming_passes", column)) {
|
|
14899
14905
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
14900
14906
|
}
|
|
14901
14907
|
}
|
|
14902
14908
|
}
|
|
14903
|
-
function
|
|
14909
|
+
function up110(db) {
|
|
14904
14910
|
db.exec(`
|
|
14905
14911
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
14906
14912
|
day TEXT NOT NULL,
|
|
@@ -14913,7 +14919,7 @@ function up109(db) {
|
|
|
14913
14919
|
);
|
|
14914
14920
|
`);
|
|
14915
14921
|
}
|
|
14916
|
-
function
|
|
14922
|
+
function up111(db) {
|
|
14917
14923
|
db.exec(`
|
|
14918
14924
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
14919
14925
|
id TEXT PRIMARY KEY,
|
|
@@ -14921,7 +14927,7 @@ function up110(db) {
|
|
|
14921
14927
|
);
|
|
14922
14928
|
`);
|
|
14923
14929
|
}
|
|
14924
|
-
function
|
|
14930
|
+
function up112(db) {
|
|
14925
14931
|
db.exec(`
|
|
14926
14932
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
14927
14933
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -14932,7 +14938,7 @@ function hasColumn19(db, table, column) {
|
|
|
14932
14938
|
return rows.some((row) => row.name === column);
|
|
14933
14939
|
}
|
|
14934
14940
|
var COLUMNS2 = ["first_remember_at", "first_recall_at"];
|
|
14935
|
-
function
|
|
14941
|
+
function up113(db) {
|
|
14936
14942
|
for (const column of COLUMNS2) {
|
|
14937
14943
|
if (!hasColumn19(db, "telemetry_install", column)) {
|
|
14938
14944
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -14948,7 +14954,7 @@ function addColumnIfMissing23(db, column, definition) {
|
|
|
14948
14954
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
14949
14955
|
}
|
|
14950
14956
|
}
|
|
14951
|
-
function
|
|
14957
|
+
function up114(db) {
|
|
14952
14958
|
addColumnIfMissing23(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
14953
14959
|
addColumnIfMissing23(db, "claim_token", "TEXT");
|
|
14954
14960
|
addColumnIfMissing23(db, "claimed_at", "TEXT");
|
|
@@ -14957,7 +14963,7 @@ function up113(db) {
|
|
|
14957
14963
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
14958
14964
|
`);
|
|
14959
14965
|
}
|
|
14960
|
-
function
|
|
14966
|
+
function up115(db) {
|
|
14961
14967
|
db.exec(`
|
|
14962
14968
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
14963
14969
|
session_key TEXT NOT NULL,
|
|
@@ -14978,7 +14984,7 @@ function up114(db) {
|
|
|
14978
14984
|
ON session_claims(agent_id, state, expires_at);
|
|
14979
14985
|
`);
|
|
14980
14986
|
}
|
|
14981
|
-
function
|
|
14987
|
+
function up116(db) {
|
|
14982
14988
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
14983
14989
|
if (table == null)
|
|
14984
14990
|
return;
|
|
@@ -14987,7 +14993,7 @@ function up115(db) {
|
|
|
14987
14993
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
14988
14994
|
`);
|
|
14989
14995
|
}
|
|
14990
|
-
function
|
|
14996
|
+
function up117(db) {
|
|
14991
14997
|
db.exec(`
|
|
14992
14998
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
14993
14999
|
id TEXT PRIMARY KEY,
|
|
@@ -15044,7 +15050,7 @@ function addColumnIfMissing24(db, column, definition) {
|
|
|
15044
15050
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
15045
15051
|
}
|
|
15046
15052
|
}
|
|
15047
|
-
function
|
|
15053
|
+
function up118(db) {
|
|
15048
15054
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
15049
15055
|
if (table == null)
|
|
15050
15056
|
return;
|
|
@@ -15245,7 +15251,7 @@ function backfillTranscriptsFromSummaryJobs(db) {
|
|
|
15245
15251
|
insert.run(...values);
|
|
15246
15252
|
}
|
|
15247
15253
|
}
|
|
15248
|
-
function
|
|
15254
|
+
function up119(db) {
|
|
15249
15255
|
if (!hasTable4(db, "session_transcripts"))
|
|
15250
15256
|
return;
|
|
15251
15257
|
addColumnIfMissing25(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -15298,7 +15304,7 @@ function up118(db) {
|
|
|
15298
15304
|
ON session_transcripts(agent_id, content_hash);
|
|
15299
15305
|
`);
|
|
15300
15306
|
}
|
|
15301
|
-
function
|
|
15307
|
+
function up120(db) {
|
|
15302
15308
|
db.exec(`
|
|
15303
15309
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
15304
15310
|
ON memory_jobs(status)
|
|
@@ -15317,12 +15323,12 @@ function up119(db) {
|
|
|
15317
15323
|
function hasColumn22(db, table, column) {
|
|
15318
15324
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
15319
15325
|
}
|
|
15320
|
-
function
|
|
15326
|
+
function up121(db) {
|
|
15321
15327
|
if (!hasColumn22(db, "telemetry_install", "last_seen_version")) {
|
|
15322
15328
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
15323
15329
|
}
|
|
15324
15330
|
}
|
|
15325
|
-
function
|
|
15331
|
+
function up122(db) {
|
|
15326
15332
|
db.exec(`
|
|
15327
15333
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
15328
15334
|
agent_id TEXT NOT NULL,
|
|
@@ -15351,7 +15357,7 @@ function addColumnIfMissing26(db, column, definition) {
|
|
|
15351
15357
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
15352
15358
|
}
|
|
15353
15359
|
}
|
|
15354
|
-
function
|
|
15360
|
+
function up123(db) {
|
|
15355
15361
|
addColumnIfMissing26(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
15356
15362
|
addColumnIfMissing26(db, "last_attempt_at", "TEXT");
|
|
15357
15363
|
addColumnIfMissing26(db, "sent_at", "TEXT");
|
|
@@ -15372,7 +15378,7 @@ function up122(db) {
|
|
|
15372
15378
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
15373
15379
|
`);
|
|
15374
15380
|
}
|
|
15375
|
-
function
|
|
15381
|
+
function up124(db) {
|
|
15376
15382
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
15377
15383
|
const names = new Set(columns.map((column) => column.name));
|
|
15378
15384
|
if (!names.has("failure_class")) {
|
|
@@ -15389,7 +15395,7 @@ function up123(db) {
|
|
|
15389
15395
|
}
|
|
15390
15396
|
db.exec("CREATE INDEX IF NOT EXISTS idx_dreaming_evidence_exclusions_retry ON dreaming_evidence_exclusions (resolved_at, requeue_requested_at, failure_class, retry_count, last_requeued_at)");
|
|
15391
15397
|
}
|
|
15392
|
-
function
|
|
15398
|
+
function up125(db) {
|
|
15393
15399
|
db.exec(`
|
|
15394
15400
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
15395
15401
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -15413,7 +15419,7 @@ function up124(db) {
|
|
|
15413
15419
|
ON embedding_index_failures(source_type, source_id);
|
|
15414
15420
|
`);
|
|
15415
15421
|
}
|
|
15416
|
-
function
|
|
15422
|
+
function up126(db) {
|
|
15417
15423
|
db.exec(`
|
|
15418
15424
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
15419
15425
|
id TEXT PRIMARY KEY,
|
|
@@ -15463,7 +15469,7 @@ function backfillTable(db, params) {
|
|
|
15463
15469
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
15464
15470
|
backfill(db, rows, params.sourceKind, params.scannedAt);
|
|
15465
15471
|
}
|
|
15466
|
-
function
|
|
15472
|
+
function up127(db) {
|
|
15467
15473
|
db.exec(`
|
|
15468
15474
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
15469
15475
|
agent_id TEXT NOT NULL,
|
|
@@ -15520,7 +15526,7 @@ function up126(db) {
|
|
|
15520
15526
|
scannedAt
|
|
15521
15527
|
});
|
|
15522
15528
|
}
|
|
15523
|
-
function
|
|
15529
|
+
function up128(db) {
|
|
15524
15530
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
15525
15531
|
if (!table)
|
|
15526
15532
|
return;
|
|
@@ -15554,7 +15560,7 @@ function up127(db) {
|
|
|
15554
15560
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
15555
15561
|
`);
|
|
15556
15562
|
}
|
|
15557
|
-
function
|
|
15563
|
+
function up129(db) {
|
|
15558
15564
|
db.exec(`
|
|
15559
15565
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
15560
15566
|
id TEXT PRIMARY KEY,
|
|
@@ -15610,7 +15616,7 @@ function up128(db) {
|
|
|
15610
15616
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
15611
15617
|
`);
|
|
15612
15618
|
}
|
|
15613
|
-
function
|
|
15619
|
+
function up130(db) {
|
|
15614
15620
|
db.exec(`
|
|
15615
15621
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
15616
15622
|
ON memory_jobs(status, created_at)
|
|
@@ -15625,7 +15631,7 @@ function up129(db) {
|
|
|
15625
15631
|
function tableExists3(db, table) {
|
|
15626
15632
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
15627
15633
|
}
|
|
15628
|
-
function
|
|
15634
|
+
function up131(db) {
|
|
15629
15635
|
if (!tableExists3(db, "memory_jobs"))
|
|
15630
15636
|
return;
|
|
15631
15637
|
if (!tableExists3(db, "job_cancellations")) {
|
|
@@ -15674,7 +15680,7 @@ function up130(db) {
|
|
|
15674
15680
|
AND status IN ('pending', 'leased');
|
|
15675
15681
|
`);
|
|
15676
15682
|
}
|
|
15677
|
-
function
|
|
15683
|
+
function up132(db) {
|
|
15678
15684
|
db.exec(`
|
|
15679
15685
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
15680
15686
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -15714,7 +15720,7 @@ function up131(db) {
|
|
|
15714
15720
|
END;
|
|
15715
15721
|
`);
|
|
15716
15722
|
}
|
|
15717
|
-
function
|
|
15723
|
+
function up133(db) {
|
|
15718
15724
|
db.exec(`
|
|
15719
15725
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
15720
15726
|
agent_id TEXT NOT NULL,
|
|
@@ -15737,13 +15743,13 @@ function up132(db) {
|
|
|
15737
15743
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
15738
15744
|
`);
|
|
15739
15745
|
}
|
|
15740
|
-
function
|
|
15746
|
+
function up134(db) {
|
|
15741
15747
|
db.exec(`
|
|
15742
15748
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
15743
15749
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
15744
15750
|
`);
|
|
15745
15751
|
}
|
|
15746
|
-
function
|
|
15752
|
+
function up135(db) {
|
|
15747
15753
|
db.exec(`
|
|
15748
15754
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
15749
15755
|
id TEXT PRIMARY KEY,
|
|
@@ -15795,7 +15801,7 @@ function up134(db) {
|
|
|
15795
15801
|
if (!names.has("format_version"))
|
|
15796
15802
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
15797
15803
|
}
|
|
15798
|
-
function
|
|
15804
|
+
function up136(db) {
|
|
15799
15805
|
db.exec(`
|
|
15800
15806
|
CREATE TABLE memory_head_entries_v134 (
|
|
15801
15807
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -15813,7 +15819,7 @@ function up135(db) {
|
|
|
15813
15819
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
15814
15820
|
`);
|
|
15815
15821
|
}
|
|
15816
|
-
function
|
|
15822
|
+
function up137(db) {
|
|
15817
15823
|
db.exec(`
|
|
15818
15824
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
15819
15825
|
agent_id TEXT NOT NULL,
|
|
@@ -15829,7 +15835,7 @@ function up136(db) {
|
|
|
15829
15835
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
15830
15836
|
`);
|
|
15831
15837
|
}
|
|
15832
|
-
function
|
|
15838
|
+
function up138(db) {
|
|
15833
15839
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
|
|
15834
15840
|
for (const [name, type] of [
|
|
15835
15841
|
["entry_id", "TEXT"],
|
|
@@ -15843,7 +15849,7 @@ function up137(db) {
|
|
|
15843
15849
|
}
|
|
15844
15850
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
15845
15851
|
}
|
|
15846
|
-
function
|
|
15852
|
+
function up139(db) {
|
|
15847
15853
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
|
|
15848
15854
|
for (const [name, type] of [
|
|
15849
15855
|
["head_revision", "INTEGER"],
|
|
@@ -15865,7 +15871,7 @@ function addColumnIfMissing27(db, table, column, definition) {
|
|
|
15865
15871
|
if (!hasColumn25(db, table, column))
|
|
15866
15872
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
15867
15873
|
}
|
|
15868
|
-
function
|
|
15874
|
+
function up140(db) {
|
|
15869
15875
|
addColumnIfMissing27(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
15870
15876
|
db.exec(`
|
|
15871
15877
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -16170,7 +16176,7 @@ function up139(db) {
|
|
|
16170
16176
|
GROUP BY j.agent_id;
|
|
16171
16177
|
`);
|
|
16172
16178
|
}
|
|
16173
|
-
function
|
|
16179
|
+
function up141(db) {
|
|
16174
16180
|
db.exec(`
|
|
16175
16181
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
16176
16182
|
agent_id TEXT NOT NULL,
|
|
@@ -16186,7 +16192,7 @@ function up140(db) {
|
|
|
16186
16192
|
ON native_source_sync_state(agent_id, status);
|
|
16187
16193
|
`);
|
|
16188
16194
|
}
|
|
16189
|
-
function
|
|
16195
|
+
function up142(db) {
|
|
16190
16196
|
db.exec(`
|
|
16191
16197
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
16192
16198
|
agent_id TEXT NOT NULL,
|
|
@@ -16198,7 +16204,7 @@ function up141(db) {
|
|
|
16198
16204
|
);
|
|
16199
16205
|
`);
|
|
16200
16206
|
}
|
|
16201
|
-
function
|
|
16207
|
+
function up143(db) {
|
|
16202
16208
|
db.exec(`
|
|
16203
16209
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
16204
16210
|
agent_id TEXT NOT NULL,
|
|
@@ -16212,13 +16218,13 @@ function up142(db) {
|
|
|
16212
16218
|
);
|
|
16213
16219
|
`);
|
|
16214
16220
|
}
|
|
16215
|
-
function
|
|
16221
|
+
function up144(db) {
|
|
16216
16222
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
16217
16223
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
16218
16224
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
16219
16225
|
}
|
|
16220
16226
|
}
|
|
16221
|
-
function
|
|
16227
|
+
function up145(db) {
|
|
16222
16228
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16223
16229
|
const additions = [
|
|
16224
16230
|
["migration_phase", "TEXT"],
|
|
@@ -16253,13 +16259,13 @@ function up144(db) {
|
|
|
16253
16259
|
`);
|
|
16254
16260
|
}
|
|
16255
16261
|
}
|
|
16256
|
-
function
|
|
16262
|
+
function up146(db) {
|
|
16257
16263
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16258
16264
|
if (!columns.has("lease_token")) {
|
|
16259
16265
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
16260
16266
|
}
|
|
16261
16267
|
}
|
|
16262
|
-
function
|
|
16268
|
+
function up147(db) {
|
|
16263
16269
|
db.exec(`
|
|
16264
16270
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
16265
16271
|
agent_id TEXT NOT NULL,
|
|
@@ -16277,7 +16283,7 @@ function up146(db) {
|
|
|
16277
16283
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
16278
16284
|
`);
|
|
16279
16285
|
}
|
|
16280
|
-
function
|
|
16286
|
+
function up148(db) {
|
|
16281
16287
|
db.exec(`
|
|
16282
16288
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
16283
16289
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -16344,16 +16350,16 @@ function up147(db) {
|
|
|
16344
16350
|
}
|
|
16345
16351
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
16346
16352
|
}
|
|
16347
|
-
function
|
|
16353
|
+
function up149(db) {
|
|
16348
16354
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
16349
16355
|
}
|
|
16350
|
-
function
|
|
16356
|
+
function up150(db) {
|
|
16351
16357
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
16352
16358
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
16353
16359
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
16354
16360
|
}
|
|
16355
16361
|
}
|
|
16356
|
-
function
|
|
16362
|
+
function up151(db) {
|
|
16357
16363
|
const addColumn = (table, column, definition) => {
|
|
16358
16364
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
16359
16365
|
let exists;
|
|
@@ -16374,7 +16380,7 @@ function addColumnIfMissing28(db, table, column, definition) {
|
|
|
16374
16380
|
if (!columns.some((row) => row.name === column))
|
|
16375
16381
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
16376
16382
|
}
|
|
16377
|
-
function
|
|
16383
|
+
function up152(db) {
|
|
16378
16384
|
addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
16379
16385
|
addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
16380
16386
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -16528,13 +16534,13 @@ var MIGRATIONS = [
|
|
|
16528
16534
|
{
|
|
16529
16535
|
version: 1,
|
|
16530
16536
|
name: "baseline",
|
|
16531
|
-
up:
|
|
16537
|
+
up: up3,
|
|
16532
16538
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
16533
16539
|
},
|
|
16534
16540
|
{
|
|
16535
16541
|
version: 2,
|
|
16536
16542
|
name: "pipeline-v2",
|
|
16537
|
-
up:
|
|
16543
|
+
up: up4,
|
|
16538
16544
|
artifacts: {
|
|
16539
16545
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
16540
16546
|
}
|
|
@@ -16542,12 +16548,12 @@ var MIGRATIONS = [
|
|
|
16542
16548
|
{
|
|
16543
16549
|
version: 3,
|
|
16544
16550
|
name: "unique-content-hash",
|
|
16545
|
-
up:
|
|
16551
|
+
up: up5
|
|
16546
16552
|
},
|
|
16547
16553
|
{
|
|
16548
16554
|
version: 4,
|
|
16549
16555
|
name: "history-actor-and-retention",
|
|
16550
|
-
up:
|
|
16556
|
+
up: up6,
|
|
16551
16557
|
artifacts: {
|
|
16552
16558
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
16553
16559
|
}
|
|
@@ -16555,7 +16561,7 @@ var MIGRATIONS = [
|
|
|
16555
16561
|
{
|
|
16556
16562
|
version: 5,
|
|
16557
16563
|
name: "graph-extended",
|
|
16558
|
-
up:
|
|
16564
|
+
up: up7,
|
|
16559
16565
|
artifacts: {
|
|
16560
16566
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
16561
16567
|
}
|
|
@@ -16563,7 +16569,7 @@ var MIGRATIONS = [
|
|
|
16563
16569
|
{
|
|
16564
16570
|
version: 6,
|
|
16565
16571
|
name: "idempotency-key",
|
|
16566
|
-
up:
|
|
16572
|
+
up: up8,
|
|
16567
16573
|
artifacts: {
|
|
16568
16574
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
16569
16575
|
}
|
|
@@ -16571,42 +16577,42 @@ var MIGRATIONS = [
|
|
|
16571
16577
|
{
|
|
16572
16578
|
version: 7,
|
|
16573
16579
|
name: "documents-and-connectors",
|
|
16574
|
-
up:
|
|
16580
|
+
up: up9,
|
|
16575
16581
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
16576
16582
|
},
|
|
16577
16583
|
{
|
|
16578
16584
|
version: 8,
|
|
16579
16585
|
name: "embeddings-unique-hash",
|
|
16580
|
-
up:
|
|
16586
|
+
up: up10
|
|
16581
16587
|
},
|
|
16582
16588
|
{
|
|
16583
16589
|
version: 9,
|
|
16584
16590
|
name: "summary-jobs",
|
|
16585
|
-
up:
|
|
16591
|
+
up: up11,
|
|
16586
16592
|
artifacts: { tables: ["summary_jobs"] }
|
|
16587
16593
|
},
|
|
16588
16594
|
{
|
|
16589
16595
|
version: 10,
|
|
16590
16596
|
name: "umap-cache",
|
|
16591
|
-
up:
|
|
16597
|
+
up: up12,
|
|
16592
16598
|
artifacts: { tables: ["umap_cache"] }
|
|
16593
16599
|
},
|
|
16594
16600
|
{
|
|
16595
16601
|
version: 11,
|
|
16596
16602
|
name: "session-scores",
|
|
16597
|
-
up:
|
|
16603
|
+
up: up13,
|
|
16598
16604
|
artifacts: { tables: ["session_scores"] }
|
|
16599
16605
|
},
|
|
16600
16606
|
{
|
|
16601
16607
|
version: 12,
|
|
16602
16608
|
name: "scheduled-tasks",
|
|
16603
|
-
up:
|
|
16609
|
+
up: up14,
|
|
16604
16610
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
16605
16611
|
},
|
|
16606
16612
|
{
|
|
16607
16613
|
version: 13,
|
|
16608
16614
|
name: "ingestion-tracking",
|
|
16609
|
-
up:
|
|
16615
|
+
up: up15,
|
|
16610
16616
|
artifacts: {
|
|
16611
16617
|
columns: [
|
|
16612
16618
|
{ table: "memories", column: "source_path" },
|
|
@@ -16617,13 +16623,13 @@ var MIGRATIONS = [
|
|
|
16617
16623
|
{
|
|
16618
16624
|
version: 14,
|
|
16619
16625
|
name: "telemetry",
|
|
16620
|
-
up:
|
|
16626
|
+
up: up16,
|
|
16621
16627
|
artifacts: { tables: ["telemetry_events"] }
|
|
16622
16628
|
},
|
|
16623
16629
|
{
|
|
16624
16630
|
version: 15,
|
|
16625
16631
|
name: "session-memories",
|
|
16626
|
-
up:
|
|
16632
|
+
up: up17,
|
|
16627
16633
|
artifacts: {
|
|
16628
16634
|
tables: ["session_memories"],
|
|
16629
16635
|
columns: [
|
|
@@ -16635,13 +16641,13 @@ var MIGRATIONS = [
|
|
|
16635
16641
|
{
|
|
16636
16642
|
version: 16,
|
|
16637
16643
|
name: "session-checkpoints",
|
|
16638
|
-
up:
|
|
16644
|
+
up: up18,
|
|
16639
16645
|
artifacts: { tables: ["session_checkpoints"] }
|
|
16640
16646
|
},
|
|
16641
16647
|
{
|
|
16642
16648
|
version: 17,
|
|
16643
16649
|
name: "task-skills",
|
|
16644
|
-
up:
|
|
16650
|
+
up: up19,
|
|
16645
16651
|
artifacts: {
|
|
16646
16652
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
16647
16653
|
}
|
|
@@ -16649,13 +16655,13 @@ var MIGRATIONS = [
|
|
|
16649
16655
|
{
|
|
16650
16656
|
version: 18,
|
|
16651
16657
|
name: "skill-meta",
|
|
16652
|
-
up:
|
|
16658
|
+
up: up20,
|
|
16653
16659
|
artifacts: { tables: ["skill_meta"] }
|
|
16654
16660
|
},
|
|
16655
16661
|
{
|
|
16656
16662
|
version: 19,
|
|
16657
16663
|
name: "knowledge-structure",
|
|
16658
|
-
up:
|
|
16664
|
+
up: up21,
|
|
16659
16665
|
artifacts: {
|
|
16660
16666
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
16661
16667
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -16664,7 +16670,7 @@ var MIGRATIONS = [
|
|
|
16664
16670
|
{
|
|
16665
16671
|
version: 20,
|
|
16666
16672
|
name: "session-structural-columns",
|
|
16667
|
-
up:
|
|
16673
|
+
up: up22,
|
|
16668
16674
|
artifacts: {
|
|
16669
16675
|
columns: [
|
|
16670
16676
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -16677,7 +16683,7 @@ var MIGRATIONS = [
|
|
|
16677
16683
|
{
|
|
16678
16684
|
version: 21,
|
|
16679
16685
|
name: "checkpoint-structural",
|
|
16680
|
-
up:
|
|
16686
|
+
up: up23,
|
|
16681
16687
|
artifacts: {
|
|
16682
16688
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
16683
16689
|
}
|
|
@@ -16685,7 +16691,7 @@ var MIGRATIONS = [
|
|
|
16685
16691
|
{
|
|
16686
16692
|
version: 22,
|
|
16687
16693
|
name: "entity-pinning",
|
|
16688
|
-
up:
|
|
16694
|
+
up: up24,
|
|
16689
16695
|
artifacts: {
|
|
16690
16696
|
columns: [
|
|
16691
16697
|
{ table: "entities", column: "pinned" },
|
|
@@ -16696,17 +16702,17 @@ var MIGRATIONS = [
|
|
|
16696
16702
|
{
|
|
16697
16703
|
version: 23,
|
|
16698
16704
|
name: "retired-scorer-gap",
|
|
16699
|
-
up:
|
|
16705
|
+
up: up25
|
|
16700
16706
|
},
|
|
16701
16707
|
{
|
|
16702
16708
|
version: 24,
|
|
16703
16709
|
name: "retired-scorer-gap",
|
|
16704
|
-
up:
|
|
16710
|
+
up: up26
|
|
16705
16711
|
},
|
|
16706
16712
|
{
|
|
16707
16713
|
version: 25,
|
|
16708
16714
|
name: "agent-feedback",
|
|
16709
|
-
up:
|
|
16715
|
+
up: up27,
|
|
16710
16716
|
artifacts: {
|
|
16711
16717
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
16712
16718
|
}
|
|
@@ -16714,32 +16720,32 @@ var MIGRATIONS = [
|
|
|
16714
16720
|
{
|
|
16715
16721
|
version: 26,
|
|
16716
16722
|
name: "retired-scorer-gap",
|
|
16717
|
-
up:
|
|
16723
|
+
up: up28
|
|
16718
16724
|
},
|
|
16719
16725
|
{
|
|
16720
16726
|
version: 27,
|
|
16721
16727
|
name: "backfill-canonical-names",
|
|
16722
|
-
up:
|
|
16728
|
+
up: up29
|
|
16723
16729
|
},
|
|
16724
16730
|
{
|
|
16725
16731
|
version: 28,
|
|
16726
16732
|
name: "lossless-retention",
|
|
16727
|
-
up:
|
|
16733
|
+
up: up30
|
|
16728
16734
|
},
|
|
16729
16735
|
{
|
|
16730
16736
|
version: 29,
|
|
16731
16737
|
name: "session-summary-dag",
|
|
16732
|
-
up:
|
|
16738
|
+
up: up31
|
|
16733
16739
|
},
|
|
16734
16740
|
{
|
|
16735
16741
|
version: 30,
|
|
16736
16742
|
name: "nullable-memory-job-memory-id",
|
|
16737
|
-
up:
|
|
16743
|
+
up: up32
|
|
16738
16744
|
},
|
|
16739
16745
|
{
|
|
16740
16746
|
version: 31,
|
|
16741
16747
|
name: "dependency-reason",
|
|
16742
|
-
up:
|
|
16748
|
+
up: up33,
|
|
16743
16749
|
artifacts: {
|
|
16744
16750
|
columns: [
|
|
16745
16751
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -16750,7 +16756,7 @@ var MIGRATIONS = [
|
|
|
16750
16756
|
{
|
|
16751
16757
|
version: 32,
|
|
16752
16758
|
name: "embeddings-vector-column",
|
|
16753
|
-
up:
|
|
16759
|
+
up: up34,
|
|
16754
16760
|
artifacts: {
|
|
16755
16761
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
16756
16762
|
}
|
|
@@ -16758,7 +16764,7 @@ var MIGRATIONS = [
|
|
|
16758
16764
|
{
|
|
16759
16765
|
version: 33,
|
|
16760
16766
|
name: "scope",
|
|
16761
|
-
up:
|
|
16767
|
+
up: up35,
|
|
16762
16768
|
artifacts: {
|
|
16763
16769
|
columns: [{ table: "memories", column: "scope" }]
|
|
16764
16770
|
}
|
|
@@ -16766,17 +16772,17 @@ var MIGRATIONS = [
|
|
|
16766
16772
|
{
|
|
16767
16773
|
version: 34,
|
|
16768
16774
|
name: "scope-aware-dedup",
|
|
16769
|
-
up:
|
|
16775
|
+
up: up36
|
|
16770
16776
|
},
|
|
16771
16777
|
{
|
|
16772
16778
|
version: 35,
|
|
16773
16779
|
name: "entity-fts",
|
|
16774
|
-
up:
|
|
16780
|
+
up: up37
|
|
16775
16781
|
},
|
|
16776
16782
|
{
|
|
16777
16783
|
version: 36,
|
|
16778
16784
|
name: "dependency-confidence",
|
|
16779
|
-
up:
|
|
16785
|
+
up: up38,
|
|
16780
16786
|
artifacts: {
|
|
16781
16787
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
16782
16788
|
}
|
|
@@ -16784,7 +16790,7 @@ var MIGRATIONS = [
|
|
|
16784
16790
|
{
|
|
16785
16791
|
version: 37,
|
|
16786
16792
|
name: "entity-communities",
|
|
16787
|
-
up:
|
|
16793
|
+
up: up39,
|
|
16788
16794
|
artifacts: {
|
|
16789
16795
|
tables: ["entity_communities"],
|
|
16790
16796
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -16793,24 +16799,24 @@ var MIGRATIONS = [
|
|
|
16793
16799
|
{
|
|
16794
16800
|
version: 38,
|
|
16795
16801
|
name: "memory-hints",
|
|
16796
|
-
up:
|
|
16802
|
+
up: up40,
|
|
16797
16803
|
artifacts: { tables: ["memory_hints"] }
|
|
16798
16804
|
},
|
|
16799
16805
|
{
|
|
16800
16806
|
version: 39,
|
|
16801
16807
|
name: "dedup-entity-dependencies",
|
|
16802
|
-
up:
|
|
16808
|
+
up: up41
|
|
16803
16809
|
},
|
|
16804
16810
|
{
|
|
16805
16811
|
version: 40,
|
|
16806
16812
|
name: "session-transcripts",
|
|
16807
|
-
up:
|
|
16813
|
+
up: up42,
|
|
16808
16814
|
artifacts: { tables: ["session_transcripts"] }
|
|
16809
16815
|
},
|
|
16810
16816
|
{
|
|
16811
16817
|
version: 41,
|
|
16812
16818
|
name: "path-feedback",
|
|
16813
|
-
up:
|
|
16819
|
+
up: up43,
|
|
16814
16820
|
artifacts: {
|
|
16815
16821
|
tables: [
|
|
16816
16822
|
"path_feedback_events",
|
|
@@ -16825,7 +16831,7 @@ var MIGRATIONS = [
|
|
|
16825
16831
|
{
|
|
16826
16832
|
version: 42,
|
|
16827
16833
|
name: "session-memories-agent-id",
|
|
16828
|
-
up:
|
|
16834
|
+
up: up44,
|
|
16829
16835
|
artifacts: {
|
|
16830
16836
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
16831
16837
|
}
|
|
@@ -16833,7 +16839,7 @@ var MIGRATIONS = [
|
|
|
16833
16839
|
{
|
|
16834
16840
|
version: 43,
|
|
16835
16841
|
name: "agents-table",
|
|
16836
|
-
up:
|
|
16842
|
+
up: up45,
|
|
16837
16843
|
artifacts: {
|
|
16838
16844
|
tables: ["agents"],
|
|
16839
16845
|
columns: [
|
|
@@ -16845,7 +16851,7 @@ var MIGRATIONS = [
|
|
|
16845
16851
|
{
|
|
16846
16852
|
version: 44,
|
|
16847
16853
|
name: "memory-md-temporal-head",
|
|
16848
|
-
up:
|
|
16854
|
+
up: up46,
|
|
16849
16855
|
artifacts: {
|
|
16850
16856
|
columns: [
|
|
16851
16857
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -16857,7 +16863,7 @@ var MIGRATIONS = [
|
|
|
16857
16863
|
{
|
|
16858
16864
|
version: 45,
|
|
16859
16865
|
name: "lossless-working-memory-hardening",
|
|
16860
|
-
up:
|
|
16866
|
+
up: up47,
|
|
16861
16867
|
artifacts: {
|
|
16862
16868
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
16863
16869
|
columns: [
|
|
@@ -16870,17 +16876,17 @@ var MIGRATIONS = [
|
|
|
16870
16876
|
{
|
|
16871
16877
|
version: 46,
|
|
16872
16878
|
name: "session-summary-uniqueness",
|
|
16873
|
-
up:
|
|
16879
|
+
up: up48
|
|
16874
16880
|
},
|
|
16875
16881
|
{
|
|
16876
16882
|
version: 47,
|
|
16877
16883
|
name: "agent-scoped-temporal-uniqueness",
|
|
16878
|
-
up:
|
|
16884
|
+
up: up49
|
|
16879
16885
|
},
|
|
16880
16886
|
{
|
|
16881
16887
|
version: 48,
|
|
16882
16888
|
name: "thread-heads",
|
|
16883
|
-
up:
|
|
16889
|
+
up: up50,
|
|
16884
16890
|
artifacts: {
|
|
16885
16891
|
tables: ["memory_thread_heads"]
|
|
16886
16892
|
}
|
|
@@ -16888,7 +16894,7 @@ var MIGRATIONS = [
|
|
|
16888
16894
|
{
|
|
16889
16895
|
version: 49,
|
|
16890
16896
|
name: "session-extract-cursors",
|
|
16891
|
-
up:
|
|
16897
|
+
up: up51,
|
|
16892
16898
|
artifacts: {
|
|
16893
16899
|
tables: ["session_extract_cursors"]
|
|
16894
16900
|
}
|
|
@@ -16896,7 +16902,7 @@ var MIGRATIONS = [
|
|
|
16896
16902
|
{
|
|
16897
16903
|
version: 50,
|
|
16898
16904
|
name: "related-to-audit",
|
|
16899
|
-
up:
|
|
16905
|
+
up: up52,
|
|
16900
16906
|
artifacts: {
|
|
16901
16907
|
tables: ["entity_dependency_history"]
|
|
16902
16908
|
}
|
|
@@ -16904,7 +16910,7 @@ var MIGRATIONS = [
|
|
|
16904
16910
|
{
|
|
16905
16911
|
version: 51,
|
|
16906
16912
|
name: "memory-md-rolling-window-lineage",
|
|
16907
|
-
up:
|
|
16913
|
+
up: up53,
|
|
16908
16914
|
artifacts: {
|
|
16909
16915
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
16910
16916
|
columns: [
|
|
@@ -16919,7 +16925,7 @@ var MIGRATIONS = [
|
|
|
16919
16925
|
{
|
|
16920
16926
|
version: 52,
|
|
16921
16927
|
name: "mcp-invocations",
|
|
16922
|
-
up:
|
|
16928
|
+
up: up54,
|
|
16923
16929
|
artifacts: {
|
|
16924
16930
|
tables: ["mcp_invocations"]
|
|
16925
16931
|
}
|
|
@@ -16927,7 +16933,7 @@ var MIGRATIONS = [
|
|
|
16927
16933
|
{
|
|
16928
16934
|
version: 53,
|
|
16929
16935
|
name: "skill-invocations",
|
|
16930
|
-
up:
|
|
16936
|
+
up: up55,
|
|
16931
16937
|
artifacts: {
|
|
16932
16938
|
tables: ["skill_invocations"]
|
|
16933
16939
|
}
|
|
@@ -16935,7 +16941,7 @@ var MIGRATIONS = [
|
|
|
16935
16941
|
{
|
|
16936
16942
|
version: 54,
|
|
16937
16943
|
name: "task-agent-scope",
|
|
16938
|
-
up:
|
|
16944
|
+
up: up56,
|
|
16939
16945
|
artifacts: {
|
|
16940
16946
|
tables: ["task_scope_hints"]
|
|
16941
16947
|
}
|
|
@@ -16943,7 +16949,7 @@ var MIGRATIONS = [
|
|
|
16943
16949
|
{
|
|
16944
16950
|
version: 55,
|
|
16945
16951
|
name: "dreaming-state",
|
|
16946
|
-
up:
|
|
16952
|
+
up: up57,
|
|
16947
16953
|
artifacts: {
|
|
16948
16954
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
16949
16955
|
}
|
|
@@ -16951,22 +16957,22 @@ var MIGRATIONS = [
|
|
|
16951
16957
|
{
|
|
16952
16958
|
version: 56,
|
|
16953
16959
|
name: "agent-scoped-content-hash",
|
|
16954
|
-
up:
|
|
16960
|
+
up: up58
|
|
16955
16961
|
},
|
|
16956
16962
|
{
|
|
16957
16963
|
version: 57,
|
|
16958
16964
|
name: "memories-fts-tokenizer-repair",
|
|
16959
|
-
up:
|
|
16965
|
+
up: up59
|
|
16960
16966
|
},
|
|
16961
16967
|
{
|
|
16962
16968
|
version: 58,
|
|
16963
16969
|
name: "knowledge-graph-indices",
|
|
16964
|
-
up:
|
|
16970
|
+
up: up60
|
|
16965
16971
|
},
|
|
16966
16972
|
{
|
|
16967
16973
|
version: 59,
|
|
16968
16974
|
name: "entity-attribute-claim-key",
|
|
16969
|
-
up:
|
|
16975
|
+
up: up61,
|
|
16970
16976
|
artifacts: {
|
|
16971
16977
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
16972
16978
|
}
|
|
@@ -16974,7 +16980,7 @@ var MIGRATIONS = [
|
|
|
16974
16980
|
{
|
|
16975
16981
|
version: 60,
|
|
16976
16982
|
name: "entity-attribute-group-key",
|
|
16977
|
-
up:
|
|
16983
|
+
up: up62,
|
|
16978
16984
|
artifacts: {
|
|
16979
16985
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
16980
16986
|
}
|
|
@@ -16982,7 +16988,7 @@ var MIGRATIONS = [
|
|
|
16982
16988
|
{
|
|
16983
16989
|
version: 61,
|
|
16984
16990
|
name: "memory-artifact-source-mtime",
|
|
16985
|
-
up:
|
|
16991
|
+
up: up63,
|
|
16986
16992
|
artifacts: {
|
|
16987
16993
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
16988
16994
|
}
|
|
@@ -16990,7 +16996,7 @@ var MIGRATIONS = [
|
|
|
16990
16996
|
{
|
|
16991
16997
|
version: 62,
|
|
16992
16998
|
name: "memory-artifact-soft-delete",
|
|
16993
|
-
up:
|
|
16999
|
+
up: up64,
|
|
16994
17000
|
artifacts: {
|
|
16995
17001
|
columns: [
|
|
16996
17002
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -17001,12 +17007,12 @@ var MIGRATIONS = [
|
|
|
17001
17007
|
{
|
|
17002
17008
|
version: 63,
|
|
17003
17009
|
name: "content-only-memories-fts-update",
|
|
17004
|
-
up:
|
|
17010
|
+
up: up65
|
|
17005
17011
|
},
|
|
17006
17012
|
{
|
|
17007
17013
|
version: 64,
|
|
17008
17014
|
name: "source-graph-provenance",
|
|
17009
|
-
up:
|
|
17015
|
+
up: up66,
|
|
17010
17016
|
artifacts: {
|
|
17011
17017
|
columns: [
|
|
17012
17018
|
{ table: "entities", column: "source_path" },
|
|
@@ -17019,7 +17025,7 @@ var MIGRATIONS = [
|
|
|
17019
17025
|
{
|
|
17020
17026
|
version: 65,
|
|
17021
17027
|
name: "source-embedding-agent-scope",
|
|
17022
|
-
up:
|
|
17028
|
+
up: up67,
|
|
17023
17029
|
artifacts: {
|
|
17024
17030
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
17025
17031
|
}
|
|
@@ -17027,7 +17033,7 @@ var MIGRATIONS = [
|
|
|
17027
17033
|
{
|
|
17028
17034
|
version: 66,
|
|
17029
17035
|
name: "memory-search-telemetry",
|
|
17030
|
-
up:
|
|
17036
|
+
up: up68,
|
|
17031
17037
|
artifacts: {
|
|
17032
17038
|
tables: ["memory_search_telemetry"]
|
|
17033
17039
|
}
|
|
@@ -17035,7 +17041,7 @@ var MIGRATIONS = [
|
|
|
17035
17041
|
{
|
|
17036
17042
|
version: 67,
|
|
17037
17043
|
name: "ontology-proposals",
|
|
17038
|
-
up:
|
|
17044
|
+
up: up69,
|
|
17039
17045
|
artifacts: {
|
|
17040
17046
|
tables: ["ontology_proposals"],
|
|
17041
17047
|
columns: [
|
|
@@ -17049,7 +17055,7 @@ var MIGRATIONS = [
|
|
|
17049
17055
|
{
|
|
17050
17056
|
version: 68,
|
|
17051
17057
|
name: "daily-reflections",
|
|
17052
|
-
up:
|
|
17058
|
+
up: up70,
|
|
17053
17059
|
artifacts: {
|
|
17054
17060
|
tables: ["daily_reflections"]
|
|
17055
17061
|
}
|
|
@@ -17057,7 +17063,7 @@ var MIGRATIONS = [
|
|
|
17057
17063
|
{
|
|
17058
17064
|
version: 69,
|
|
17059
17065
|
name: "daily-reflections-multiple-insights",
|
|
17060
|
-
up:
|
|
17066
|
+
up: up71,
|
|
17061
17067
|
artifacts: {
|
|
17062
17068
|
tables: ["daily_reflections"]
|
|
17063
17069
|
}
|
|
@@ -17065,7 +17071,7 @@ var MIGRATIONS = [
|
|
|
17065
17071
|
{
|
|
17066
17072
|
version: 70,
|
|
17067
17073
|
name: "ontology-control-plane-state",
|
|
17068
|
-
up:
|
|
17074
|
+
up: up72,
|
|
17069
17075
|
artifacts: {
|
|
17070
17076
|
columns: [
|
|
17071
17077
|
{ table: "entities", column: "status" },
|
|
@@ -17080,7 +17086,7 @@ var MIGRATIONS = [
|
|
|
17080
17086
|
{
|
|
17081
17087
|
version: 71,
|
|
17082
17088
|
name: "epistemic-assertions",
|
|
17083
|
-
up:
|
|
17089
|
+
up: up73,
|
|
17084
17090
|
artifacts: {
|
|
17085
17091
|
tables: ["epistemic_assertions"]
|
|
17086
17092
|
}
|
|
@@ -17088,7 +17094,7 @@ var MIGRATIONS = [
|
|
|
17088
17094
|
{
|
|
17089
17095
|
version: 72,
|
|
17090
17096
|
name: "agent-scoped-idempotency-key",
|
|
17091
|
-
up:
|
|
17097
|
+
up: up74,
|
|
17092
17098
|
artifacts: {
|
|
17093
17099
|
columns: [
|
|
17094
17100
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -17099,7 +17105,7 @@ var MIGRATIONS = [
|
|
|
17099
17105
|
{
|
|
17100
17106
|
version: 73,
|
|
17101
17107
|
name: "recall-context-dedupe",
|
|
17102
|
-
up:
|
|
17108
|
+
up: up75,
|
|
17103
17109
|
artifacts: {
|
|
17104
17110
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
17105
17111
|
}
|
|
@@ -17107,7 +17113,7 @@ var MIGRATIONS = [
|
|
|
17107
17113
|
{
|
|
17108
17114
|
version: 74,
|
|
17109
17115
|
name: "aggregate-memory-links",
|
|
17110
|
-
up:
|
|
17116
|
+
up: up76,
|
|
17111
17117
|
artifacts: {
|
|
17112
17118
|
tables: ["aggregate_memory_sources"]
|
|
17113
17119
|
}
|
|
@@ -17115,7 +17121,7 @@ var MIGRATIONS = [
|
|
|
17115
17121
|
{
|
|
17116
17122
|
version: 75,
|
|
17117
17123
|
name: "memory-artifact-source-provenance",
|
|
17118
|
-
up:
|
|
17124
|
+
up: up77,
|
|
17119
17125
|
artifacts: {
|
|
17120
17126
|
columns: [
|
|
17121
17127
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -17129,7 +17135,7 @@ var MIGRATIONS = [
|
|
|
17129
17135
|
{
|
|
17130
17136
|
version: 76,
|
|
17131
17137
|
name: "temporal-edges",
|
|
17132
|
-
up:
|
|
17138
|
+
up: up78,
|
|
17133
17139
|
artifacts: {
|
|
17134
17140
|
tables: ["temporal_edges"]
|
|
17135
17141
|
}
|
|
@@ -17137,7 +17143,7 @@ var MIGRATIONS = [
|
|
|
17137
17143
|
{
|
|
17138
17144
|
version: 77,
|
|
17139
17145
|
name: "entity-aliases",
|
|
17140
|
-
up:
|
|
17146
|
+
up: up79,
|
|
17141
17147
|
artifacts: {
|
|
17142
17148
|
tables: ["entity_aliases"]
|
|
17143
17149
|
}
|
|
@@ -17145,7 +17151,7 @@ var MIGRATIONS = [
|
|
|
17145
17151
|
{
|
|
17146
17152
|
version: 78,
|
|
17147
17153
|
name: "api-keys",
|
|
17148
|
-
up:
|
|
17154
|
+
up: up80,
|
|
17149
17155
|
artifacts: {
|
|
17150
17156
|
tables: ["api_keys"]
|
|
17151
17157
|
}
|
|
@@ -17153,7 +17159,7 @@ var MIGRATIONS = [
|
|
|
17153
17159
|
{
|
|
17154
17160
|
version: 79,
|
|
17155
17161
|
name: "transcript-capture-jobs",
|
|
17156
|
-
up:
|
|
17162
|
+
up: up81,
|
|
17157
17163
|
artifacts: {
|
|
17158
17164
|
tables: ["transcript_capture_jobs"]
|
|
17159
17165
|
}
|
|
@@ -17161,7 +17167,7 @@ var MIGRATIONS = [
|
|
|
17161
17167
|
{
|
|
17162
17168
|
version: 80,
|
|
17163
17169
|
name: "document-scope-columns",
|
|
17164
|
-
up:
|
|
17170
|
+
up: up82,
|
|
17165
17171
|
artifacts: {
|
|
17166
17172
|
columns: [
|
|
17167
17173
|
{ table: "documents", column: "agent_id" },
|
|
@@ -17172,7 +17178,7 @@ var MIGRATIONS = [
|
|
|
17172
17178
|
{
|
|
17173
17179
|
version: 81,
|
|
17174
17180
|
name: "aggregate-evidence-sources",
|
|
17175
|
-
up:
|
|
17181
|
+
up: up83,
|
|
17176
17182
|
artifacts: {
|
|
17177
17183
|
tables: ["aggregate_evidence_sources"]
|
|
17178
17184
|
}
|
|
@@ -17180,7 +17186,7 @@ var MIGRATIONS = [
|
|
|
17180
17186
|
{
|
|
17181
17187
|
version: 82,
|
|
17182
17188
|
name: "skill-invocations-harness",
|
|
17183
|
-
up:
|
|
17189
|
+
up: up84,
|
|
17184
17190
|
artifacts: {
|
|
17185
17191
|
columns: [
|
|
17186
17192
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -17191,7 +17197,7 @@ var MIGRATIONS = [
|
|
|
17191
17197
|
{
|
|
17192
17198
|
version: 83,
|
|
17193
17199
|
name: "memory-lifecycle-repair",
|
|
17194
|
-
up:
|
|
17200
|
+
up: up85,
|
|
17195
17201
|
artifacts: {
|
|
17196
17202
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
17197
17203
|
columns: [
|
|
@@ -17206,7 +17212,7 @@ var MIGRATIONS = [
|
|
|
17206
17212
|
{
|
|
17207
17213
|
version: 84,
|
|
17208
17214
|
name: "legacy-markdown-import-state",
|
|
17209
|
-
up:
|
|
17215
|
+
up: up86,
|
|
17210
17216
|
artifacts: {
|
|
17211
17217
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
17212
17218
|
}
|
|
@@ -17214,7 +17220,7 @@ var MIGRATIONS = [
|
|
|
17214
17220
|
{
|
|
17215
17221
|
version: 85,
|
|
17216
17222
|
name: "backfill-relations-to-dependencies",
|
|
17217
|
-
up:
|
|
17223
|
+
up: up87,
|
|
17218
17224
|
artifacts: {
|
|
17219
17225
|
tables: ["entity_dependencies"]
|
|
17220
17226
|
}
|
|
@@ -17222,7 +17228,7 @@ var MIGRATIONS = [
|
|
|
17222
17228
|
{
|
|
17223
17229
|
version: 86,
|
|
17224
17230
|
name: "summary-jobs-content-hash",
|
|
17225
|
-
up:
|
|
17231
|
+
up: up88,
|
|
17226
17232
|
artifacts: {
|
|
17227
17233
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
17228
17234
|
}
|
|
@@ -17230,7 +17236,7 @@ var MIGRATIONS = [
|
|
|
17230
17236
|
{
|
|
17231
17237
|
version: 87,
|
|
17232
17238
|
name: "summary-jobs-boundary-reason",
|
|
17233
|
-
up:
|
|
17239
|
+
up: up89,
|
|
17234
17240
|
artifacts: {
|
|
17235
17241
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
17236
17242
|
}
|
|
@@ -17238,7 +17244,7 @@ var MIGRATIONS = [
|
|
|
17238
17244
|
{
|
|
17239
17245
|
version: 88,
|
|
17240
17246
|
name: "transcript-recovery-files",
|
|
17241
|
-
up:
|
|
17247
|
+
up: up90,
|
|
17242
17248
|
artifacts: {
|
|
17243
17249
|
tables: ["transcript_recovery_files"]
|
|
17244
17250
|
}
|
|
@@ -17246,7 +17252,7 @@ var MIGRATIONS = [
|
|
|
17246
17252
|
{
|
|
17247
17253
|
version: 89,
|
|
17248
17254
|
name: "job-cancellations",
|
|
17249
|
-
up:
|
|
17255
|
+
up: up91,
|
|
17250
17256
|
artifacts: {
|
|
17251
17257
|
tables: ["job_cancellations"]
|
|
17252
17258
|
}
|
|
@@ -17254,7 +17260,7 @@ var MIGRATIONS = [
|
|
|
17254
17260
|
{
|
|
17255
17261
|
version: 90,
|
|
17256
17262
|
name: "job-archive",
|
|
17257
|
-
up:
|
|
17263
|
+
up: up92,
|
|
17258
17264
|
artifacts: {
|
|
17259
17265
|
tables: ["job_archive"]
|
|
17260
17266
|
}
|
|
@@ -17262,25 +17268,25 @@ var MIGRATIONS = [
|
|
|
17262
17268
|
{
|
|
17263
17269
|
version: 91,
|
|
17264
17270
|
name: "embedding-index-generations",
|
|
17265
|
-
up:
|
|
17271
|
+
up: up93,
|
|
17266
17272
|
artifacts: { tables: ["embedding_index_state"] }
|
|
17267
17273
|
},
|
|
17268
17274
|
{
|
|
17269
17275
|
version: 92,
|
|
17270
17276
|
name: "embedding-staging-store",
|
|
17271
|
-
up:
|
|
17277
|
+
up: up94,
|
|
17272
17278
|
artifacts: { tables: ["embeddings_staging"] }
|
|
17273
17279
|
},
|
|
17274
17280
|
{
|
|
17275
17281
|
version: 93,
|
|
17276
17282
|
name: "dreaming-evidence-cursor",
|
|
17277
|
-
up:
|
|
17283
|
+
up: up95,
|
|
17278
17284
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
17279
17285
|
},
|
|
17280
17286
|
{
|
|
17281
17287
|
version: 94,
|
|
17282
17288
|
name: "memory-kind",
|
|
17283
|
-
up:
|
|
17289
|
+
up: up96,
|
|
17284
17290
|
artifacts: {
|
|
17285
17291
|
columns: [
|
|
17286
17292
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -17291,35 +17297,35 @@ var MIGRATIONS = [
|
|
|
17291
17297
|
{
|
|
17292
17298
|
version: 95,
|
|
17293
17299
|
name: "compaction-recall-projections",
|
|
17294
|
-
up:
|
|
17300
|
+
up: up97
|
|
17295
17301
|
},
|
|
17296
17302
|
{
|
|
17297
17303
|
version: 96,
|
|
17298
17304
|
name: "retire-legacy-ingestion",
|
|
17299
|
-
up:
|
|
17305
|
+
up: up98
|
|
17300
17306
|
},
|
|
17301
17307
|
{
|
|
17302
17308
|
version: 97,
|
|
17303
17309
|
name: "dreaming-failure-backoff",
|
|
17304
|
-
up:
|
|
17310
|
+
up: up99,
|
|
17305
17311
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
17306
17312
|
},
|
|
17307
17313
|
{
|
|
17308
17314
|
version: 98,
|
|
17309
17315
|
name: "dreaming-evidence-exclusions",
|
|
17310
|
-
up:
|
|
17316
|
+
up: up100,
|
|
17311
17317
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
17312
17318
|
},
|
|
17313
17319
|
{
|
|
17314
17320
|
version: 99,
|
|
17315
17321
|
name: "dreaming-tool-calls",
|
|
17316
|
-
up:
|
|
17322
|
+
up: up101,
|
|
17317
17323
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
17318
17324
|
},
|
|
17319
17325
|
{
|
|
17320
17326
|
version: 100,
|
|
17321
17327
|
name: "dreaming-runbook",
|
|
17322
|
-
up:
|
|
17328
|
+
up: up102,
|
|
17323
17329
|
artifacts: {
|
|
17324
17330
|
columns: [
|
|
17325
17331
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -17330,23 +17336,23 @@ var MIGRATIONS = [
|
|
|
17330
17336
|
{
|
|
17331
17337
|
version: 101,
|
|
17332
17338
|
name: "dreaming-attention",
|
|
17333
|
-
up:
|
|
17339
|
+
up: up103,
|
|
17334
17340
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17335
17341
|
},
|
|
17336
17342
|
{
|
|
17337
17343
|
version: 102,
|
|
17338
17344
|
name: "attribute-semantic-memories",
|
|
17339
|
-
up:
|
|
17345
|
+
up: up104
|
|
17340
17346
|
},
|
|
17341
17347
|
{
|
|
17342
17348
|
version: 103,
|
|
17343
17349
|
name: "semantic-memory-kind",
|
|
17344
|
-
up:
|
|
17350
|
+
up: up105
|
|
17345
17351
|
},
|
|
17346
17352
|
{
|
|
17347
17353
|
version: 104,
|
|
17348
17354
|
name: "derived-memory-provenance",
|
|
17349
|
-
up:
|
|
17355
|
+
up: up106,
|
|
17350
17356
|
artifacts: {
|
|
17351
17357
|
tables: ["derived_memory_sources"],
|
|
17352
17358
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -17355,12 +17361,12 @@ var MIGRATIONS = [
|
|
|
17355
17361
|
{
|
|
17356
17362
|
version: 105,
|
|
17357
17363
|
name: "agent-scoped-entity-name",
|
|
17358
|
-
up:
|
|
17364
|
+
up: up107
|
|
17359
17365
|
},
|
|
17360
17366
|
{
|
|
17361
17367
|
version: 106,
|
|
17362
17368
|
name: "memory-review-after",
|
|
17363
|
-
up:
|
|
17369
|
+
up: up108,
|
|
17364
17370
|
artifacts: {
|
|
17365
17371
|
columns: [{ table: "memories", column: "review_after" }]
|
|
17366
17372
|
}
|
|
@@ -17368,7 +17374,7 @@ var MIGRATIONS = [
|
|
|
17368
17374
|
{
|
|
17369
17375
|
version: 107,
|
|
17370
17376
|
name: "dreaming-pass-usage",
|
|
17371
|
-
up:
|
|
17377
|
+
up: up109,
|
|
17372
17378
|
artifacts: {
|
|
17373
17379
|
columns: [
|
|
17374
17380
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -17382,7 +17388,7 @@ var MIGRATIONS = [
|
|
|
17382
17388
|
{
|
|
17383
17389
|
version: 108,
|
|
17384
17390
|
name: "embedding-usage",
|
|
17385
|
-
up:
|
|
17391
|
+
up: up110,
|
|
17386
17392
|
artifacts: {
|
|
17387
17393
|
tables: ["embedding_usage"]
|
|
17388
17394
|
}
|
|
@@ -17390,7 +17396,7 @@ var MIGRATIONS = [
|
|
|
17390
17396
|
{
|
|
17391
17397
|
version: 109,
|
|
17392
17398
|
name: "telemetry-install",
|
|
17393
|
-
up:
|
|
17399
|
+
up: up111,
|
|
17394
17400
|
artifacts: {
|
|
17395
17401
|
tables: ["telemetry_install"]
|
|
17396
17402
|
}
|
|
@@ -17398,12 +17404,12 @@ var MIGRATIONS = [
|
|
|
17398
17404
|
{
|
|
17399
17405
|
version: 110,
|
|
17400
17406
|
name: "memory-mention-join-index",
|
|
17401
|
-
up:
|
|
17407
|
+
up: up112
|
|
17402
17408
|
},
|
|
17403
17409
|
{
|
|
17404
17410
|
version: 111,
|
|
17405
17411
|
name: "telemetry-first-use",
|
|
17406
|
-
up:
|
|
17412
|
+
up: up113,
|
|
17407
17413
|
artifacts: {
|
|
17408
17414
|
columns: [
|
|
17409
17415
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -17414,7 +17420,7 @@ var MIGRATIONS = [
|
|
|
17414
17420
|
{
|
|
17415
17421
|
version: 112,
|
|
17416
17422
|
name: "telemetry-queue-ownership",
|
|
17417
|
-
up:
|
|
17423
|
+
up: up114,
|
|
17418
17424
|
artifacts: {
|
|
17419
17425
|
columns: [
|
|
17420
17426
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -17426,7 +17432,7 @@ var MIGRATIONS = [
|
|
|
17426
17432
|
{
|
|
17427
17433
|
version: 113,
|
|
17428
17434
|
name: "session-claims",
|
|
17429
|
-
up:
|
|
17435
|
+
up: up115,
|
|
17430
17436
|
artifacts: {
|
|
17431
17437
|
tables: ["session_claims"],
|
|
17432
17438
|
columns: [
|
|
@@ -17440,12 +17446,12 @@ var MIGRATIONS = [
|
|
|
17440
17446
|
{
|
|
17441
17447
|
version: 114,
|
|
17442
17448
|
name: "memory-traversal-hydration-index",
|
|
17443
|
-
up:
|
|
17449
|
+
up: up116
|
|
17444
17450
|
},
|
|
17445
17451
|
{
|
|
17446
17452
|
version: 115,
|
|
17447
17453
|
name: "cross-agent-message-notifications",
|
|
17448
|
-
up:
|
|
17454
|
+
up: up117,
|
|
17449
17455
|
artifacts: {
|
|
17450
17456
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
17451
17457
|
}
|
|
@@ -17453,7 +17459,7 @@ var MIGRATIONS = [
|
|
|
17453
17459
|
{
|
|
17454
17460
|
version: 116,
|
|
17455
17461
|
name: "acp-delivery-reconciliation",
|
|
17456
|
-
up:
|
|
17462
|
+
up: up118,
|
|
17457
17463
|
artifacts: {
|
|
17458
17464
|
columns: [
|
|
17459
17465
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -17467,7 +17473,7 @@ var MIGRATIONS = [
|
|
|
17467
17473
|
{
|
|
17468
17474
|
version: 117,
|
|
17469
17475
|
name: "retire-summary-worker",
|
|
17470
|
-
up:
|
|
17476
|
+
up: up119,
|
|
17471
17477
|
artifacts: {
|
|
17472
17478
|
columns: [
|
|
17473
17479
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -17478,24 +17484,24 @@ var MIGRATIONS = [
|
|
|
17478
17484
|
{
|
|
17479
17485
|
version: 118,
|
|
17480
17486
|
name: "queue-pressure-indices",
|
|
17481
|
-
up:
|
|
17487
|
+
up: up120
|
|
17482
17488
|
},
|
|
17483
17489
|
{
|
|
17484
17490
|
version: 119,
|
|
17485
17491
|
name: "telemetry-version-observation",
|
|
17486
|
-
up:
|
|
17492
|
+
up: up121,
|
|
17487
17493
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
17488
17494
|
},
|
|
17489
17495
|
{
|
|
17490
17496
|
version: 120,
|
|
17491
17497
|
name: "source-lifecycle-telemetry",
|
|
17492
|
-
up:
|
|
17498
|
+
up: up122,
|
|
17493
17499
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
17494
17500
|
},
|
|
17495
17501
|
{
|
|
17496
17502
|
version: 121,
|
|
17497
17503
|
name: "telemetry-delivery-health",
|
|
17498
|
-
up:
|
|
17504
|
+
up: up123,
|
|
17499
17505
|
artifacts: {
|
|
17500
17506
|
tables: ["telemetry_delivery_state"],
|
|
17501
17507
|
columns: [
|
|
@@ -17509,7 +17515,7 @@ var MIGRATIONS = [
|
|
|
17509
17515
|
{
|
|
17510
17516
|
version: 122,
|
|
17511
17517
|
name: "dreaming-evidence-retry",
|
|
17512
|
-
up:
|
|
17518
|
+
up: up124,
|
|
17513
17519
|
artifacts: {
|
|
17514
17520
|
columns: [
|
|
17515
17521
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -17522,13 +17528,13 @@ var MIGRATIONS = [
|
|
|
17522
17528
|
{
|
|
17523
17529
|
version: 123,
|
|
17524
17530
|
name: "embedding-index-failures",
|
|
17525
|
-
up:
|
|
17531
|
+
up: up125,
|
|
17526
17532
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
17527
17533
|
},
|
|
17528
17534
|
{
|
|
17529
17535
|
version: 124,
|
|
17530
17536
|
name: "import-derived-lifecycle",
|
|
17531
|
-
up:
|
|
17537
|
+
up: up126,
|
|
17532
17538
|
artifacts: {
|
|
17533
17539
|
tables: ["imported_source_lifecycle"]
|
|
17534
17540
|
}
|
|
@@ -17536,77 +17542,77 @@ var MIGRATIONS = [
|
|
|
17536
17542
|
{
|
|
17537
17543
|
version: 125,
|
|
17538
17544
|
name: "memory-content-safety",
|
|
17539
|
-
up:
|
|
17545
|
+
up: up127,
|
|
17540
17546
|
artifacts: { tables: ["memory_content_safety"] }
|
|
17541
17547
|
},
|
|
17542
17548
|
{
|
|
17543
17549
|
version: 126,
|
|
17544
17550
|
name: "dreaming-surprisal-attention",
|
|
17545
|
-
up:
|
|
17551
|
+
up: up128,
|
|
17546
17552
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17547
17553
|
},
|
|
17548
17554
|
{
|
|
17549
17555
|
version: 127,
|
|
17550
17556
|
name: "ontology-contradictions",
|
|
17551
|
-
up:
|
|
17557
|
+
up: up129,
|
|
17552
17558
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
17553
17559
|
},
|
|
17554
17560
|
{
|
|
17555
17561
|
version: 128,
|
|
17556
17562
|
name: "bounded-queue-diagnostics",
|
|
17557
|
-
up:
|
|
17563
|
+
up: up130
|
|
17558
17564
|
},
|
|
17559
17565
|
{
|
|
17560
17566
|
version: 129,
|
|
17561
17567
|
name: "retire-structural-jobs",
|
|
17562
|
-
up:
|
|
17568
|
+
up: up131
|
|
17563
17569
|
},
|
|
17564
17570
|
{
|
|
17565
17571
|
version: 130,
|
|
17566
17572
|
name: "embedding-repair-state",
|
|
17567
|
-
up:
|
|
17573
|
+
up: up132,
|
|
17568
17574
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
17569
17575
|
},
|
|
17570
17576
|
{
|
|
17571
17577
|
version: 131,
|
|
17572
17578
|
name: "dreaming-evidence-consumption",
|
|
17573
|
-
up:
|
|
17579
|
+
up: up133,
|
|
17574
17580
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
17575
17581
|
},
|
|
17576
17582
|
{
|
|
17577
17583
|
version: 132,
|
|
17578
17584
|
name: "observer-scoped-epistemic-assertions",
|
|
17579
|
-
up:
|
|
17585
|
+
up: up134,
|
|
17580
17586
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
17581
17587
|
},
|
|
17582
17588
|
{
|
|
17583
17589
|
version: 133,
|
|
17584
17590
|
name: "dreaming-memory-head",
|
|
17585
|
-
up:
|
|
17591
|
+
up: up135,
|
|
17586
17592
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
17587
17593
|
},
|
|
17588
17594
|
{
|
|
17589
17595
|
version: 134,
|
|
17590
17596
|
name: "scope-memory-head-entries",
|
|
17591
|
-
up:
|
|
17597
|
+
up: up136,
|
|
17592
17598
|
artifacts: { tables: ["memory_head_entries"] }
|
|
17593
17599
|
},
|
|
17594
17600
|
{
|
|
17595
17601
|
version: 135,
|
|
17596
17602
|
name: "memory-head-publication",
|
|
17597
|
-
up:
|
|
17603
|
+
up: up137,
|
|
17598
17604
|
artifacts: { tables: ["memory_head_publications"] }
|
|
17599
17605
|
},
|
|
17600
17606
|
{
|
|
17601
17607
|
version: 136,
|
|
17602
17608
|
name: "memory-head-revisions",
|
|
17603
|
-
up:
|
|
17609
|
+
up: up138,
|
|
17604
17610
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
17605
17611
|
},
|
|
17606
17612
|
{
|
|
17607
17613
|
version: 137,
|
|
17608
17614
|
name: "dreaming-head-manifest",
|
|
17609
|
-
up:
|
|
17615
|
+
up: up139,
|
|
17610
17616
|
artifacts: {
|
|
17611
17617
|
columns: [
|
|
17612
17618
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -17617,7 +17623,7 @@ var MIGRATIONS = [
|
|
|
17617
17623
|
{
|
|
17618
17624
|
version: 138,
|
|
17619
17625
|
name: "bounded-status-projections",
|
|
17620
|
-
up:
|
|
17626
|
+
up: up140,
|
|
17621
17627
|
artifacts: {
|
|
17622
17628
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
17623
17629
|
}
|
|
@@ -17625,31 +17631,31 @@ var MIGRATIONS = [
|
|
|
17625
17631
|
{
|
|
17626
17632
|
version: 139,
|
|
17627
17633
|
name: "native-source-sync-state",
|
|
17628
|
-
up:
|
|
17634
|
+
up: up141,
|
|
17629
17635
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
17630
17636
|
},
|
|
17631
17637
|
{
|
|
17632
17638
|
version: 140,
|
|
17633
17639
|
name: "transcript-recovery-frontier",
|
|
17634
|
-
up:
|
|
17640
|
+
up: up142,
|
|
17635
17641
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
17636
17642
|
},
|
|
17637
17643
|
{
|
|
17638
17644
|
version: 141,
|
|
17639
17645
|
name: "source-sync-checkpoints",
|
|
17640
|
-
up:
|
|
17646
|
+
up: up143,
|
|
17641
17647
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
17642
17648
|
},
|
|
17643
17649
|
{
|
|
17644
17650
|
version: 142,
|
|
17645
17651
|
name: "source-sync-frontier",
|
|
17646
|
-
up:
|
|
17652
|
+
up: up144,
|
|
17647
17653
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
17648
17654
|
},
|
|
17649
17655
|
{
|
|
17650
17656
|
version: 143,
|
|
17651
17657
|
name: "embedding-index-progress",
|
|
17652
|
-
up:
|
|
17658
|
+
up: up145,
|
|
17653
17659
|
artifacts: {
|
|
17654
17660
|
columns: [
|
|
17655
17661
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -17665,19 +17671,19 @@ var MIGRATIONS = [
|
|
|
17665
17671
|
{
|
|
17666
17672
|
version: 144,
|
|
17667
17673
|
name: "memory-job-lease-token",
|
|
17668
|
-
up:
|
|
17674
|
+
up: up146,
|
|
17669
17675
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
17670
17676
|
},
|
|
17671
17677
|
{
|
|
17672
17678
|
version: 145,
|
|
17673
17679
|
name: "dreaming-evidence-reviews",
|
|
17674
|
-
up:
|
|
17680
|
+
up: up147,
|
|
17675
17681
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
17676
17682
|
},
|
|
17677
17683
|
{
|
|
17678
17684
|
version: 146,
|
|
17679
17685
|
name: "source-transcript-import",
|
|
17680
|
-
up:
|
|
17686
|
+
up: up148,
|
|
17681
17687
|
artifacts: {
|
|
17682
17688
|
tables: [
|
|
17683
17689
|
"source_import_jobs",
|
|
@@ -17696,19 +17702,19 @@ var MIGRATIONS = [
|
|
|
17696
17702
|
{
|
|
17697
17703
|
version: 147,
|
|
17698
17704
|
name: "source-import-replay-file-slots",
|
|
17699
|
-
up:
|
|
17705
|
+
up: up149,
|
|
17700
17706
|
artifacts: { tables: ["source_import_files"] }
|
|
17701
17707
|
},
|
|
17702
17708
|
{
|
|
17703
17709
|
version: 148,
|
|
17704
17710
|
name: "source-import-attempt-provenance",
|
|
17705
|
-
up:
|
|
17711
|
+
up: up150,
|
|
17706
17712
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
17707
17713
|
},
|
|
17708
17714
|
{
|
|
17709
17715
|
version: 149,
|
|
17710
17716
|
name: "transcript-import-state-machine",
|
|
17711
|
-
up:
|
|
17717
|
+
up: up151,
|
|
17712
17718
|
artifacts: {
|
|
17713
17719
|
columns: [
|
|
17714
17720
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -17720,7 +17726,7 @@ var MIGRATIONS = [
|
|
|
17720
17726
|
{
|
|
17721
17727
|
version: 150,
|
|
17722
17728
|
name: "memory-head-freshness",
|
|
17723
|
-
up:
|
|
17729
|
+
up: up152,
|
|
17724
17730
|
artifacts: {
|
|
17725
17731
|
columns: [
|
|
17726
17732
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -17756,6 +17762,12 @@ var MIGRATIONS = [
|
|
|
17756
17762
|
}))
|
|
17757
17763
|
]
|
|
17758
17764
|
}
|
|
17765
|
+
},
|
|
17766
|
+
{
|
|
17767
|
+
version: 152,
|
|
17768
|
+
name: "memory-artifact-sha-index",
|
|
17769
|
+
up: up2,
|
|
17770
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
17759
17771
|
}
|
|
17760
17772
|
];
|
|
17761
17773
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -29654,7 +29666,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
|
|
|
29654
29666
|
"checkpoint",
|
|
29655
29667
|
"dreaming"
|
|
29656
29668
|
];
|
|
29657
|
-
function
|
|
29669
|
+
function up153(db) {
|
|
29658
29670
|
const hasColumn26 = (table, column) => {
|
|
29659
29671
|
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
29660
29672
|
try {
|
|
@@ -29714,6 +29726,12 @@ function up152(db) {
|
|
|
29714
29726
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
29715
29727
|
`);
|
|
29716
29728
|
}
|
|
29729
|
+
function up210(db) {
|
|
29730
|
+
db.exec(`
|
|
29731
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
29732
|
+
CREATE INDEX idx_memory_artifacts_agent_sha ON memory_artifacts(agent_id, source_sha256, COALESCE(source_id, ''), COALESCE(is_deleted, 0), captured_at DESC, source_path)
|
|
29733
|
+
`);
|
|
29734
|
+
}
|
|
29717
29735
|
var MEMORIES_FTS_TOKENIZER2 = "unicode61";
|
|
29718
29736
|
var FTS_STATE_TABLE2 = "memories_fts_state";
|
|
29719
29737
|
function normalizeSql2(sql) {
|
|
@@ -29829,7 +29847,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
29829
29847
|
return true;
|
|
29830
29848
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
29831
29849
|
}
|
|
29832
|
-
function
|
|
29850
|
+
function up310(db) {
|
|
29833
29851
|
db.exec(`
|
|
29834
29852
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
29835
29853
|
version INTEGER PRIMARY KEY,
|
|
@@ -29927,7 +29945,7 @@ function addColumnIfMissing29(db, table, column, definition) {
|
|
|
29927
29945
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29928
29946
|
}
|
|
29929
29947
|
}
|
|
29930
|
-
function
|
|
29948
|
+
function up410(db) {
|
|
29931
29949
|
addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
|
|
29932
29950
|
addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
|
|
29933
29951
|
addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -30045,7 +30063,7 @@ function addColumnIfMissing210(db, table, column, definition) {
|
|
|
30045
30063
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30046
30064
|
return true;
|
|
30047
30065
|
}
|
|
30048
|
-
function
|
|
30066
|
+
function up510(db) {
|
|
30049
30067
|
addColumnIfMissing210(db, "memories", "why", "TEXT");
|
|
30050
30068
|
addColumnIfMissing210(db, "memories", "project", "TEXT");
|
|
30051
30069
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -30082,7 +30100,7 @@ function addColumnIfMissing32(db, table, column, definition) {
|
|
|
30082
30100
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30083
30101
|
}
|
|
30084
30102
|
}
|
|
30085
|
-
function
|
|
30103
|
+
function up610(db) {
|
|
30086
30104
|
addColumnIfMissing32(db, "memory_history", "actor_type", "TEXT");
|
|
30087
30105
|
addColumnIfMissing32(db, "memory_history", "session_id", "TEXT");
|
|
30088
30106
|
addColumnIfMissing32(db, "memory_history", "request_id", "TEXT");
|
|
@@ -30115,7 +30133,7 @@ function addColumnIfMissing42(db, table, column, definition) {
|
|
|
30115
30133
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30116
30134
|
}
|
|
30117
30135
|
}
|
|
30118
|
-
function
|
|
30136
|
+
function up710(db) {
|
|
30119
30137
|
addColumnIfMissing42(db, "entities", "canonical_name", "TEXT");
|
|
30120
30138
|
addColumnIfMissing42(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
30121
30139
|
addColumnIfMissing42(db, "entities", "embedding", "BLOB");
|
|
@@ -30132,7 +30150,7 @@ function hasColumn42(db, table, column) {
|
|
|
30132
30150
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30133
30151
|
return rows.some((r3) => r3.name === column);
|
|
30134
30152
|
}
|
|
30135
|
-
function
|
|
30153
|
+
function up810(db) {
|
|
30136
30154
|
if (!hasColumn42(db, "memories", "idempotency_key")) {
|
|
30137
30155
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
30138
30156
|
}
|
|
@@ -30147,7 +30165,7 @@ function hasColumn52(db, table, column) {
|
|
|
30147
30165
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30148
30166
|
return rows.some((r3) => r3.name === column);
|
|
30149
30167
|
}
|
|
30150
|
-
function
|
|
30168
|
+
function up910(db) {
|
|
30151
30169
|
db.exec(`
|
|
30152
30170
|
CREATE TABLE IF NOT EXISTS documents (
|
|
30153
30171
|
id TEXT PRIMARY KEY,
|
|
@@ -30204,7 +30222,7 @@ function up810(db) {
|
|
|
30204
30222
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
30205
30223
|
}
|
|
30206
30224
|
}
|
|
30207
|
-
function
|
|
30225
|
+
function up1010(db) {
|
|
30208
30226
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
30209
30227
|
if (tables.length === 0)
|
|
30210
30228
|
return;
|
|
@@ -30221,7 +30239,7 @@ function up910(db) {
|
|
|
30221
30239
|
ON embeddings(content_hash)
|
|
30222
30240
|
`);
|
|
30223
30241
|
}
|
|
30224
|
-
function
|
|
30242
|
+
function up1110(db) {
|
|
30225
30243
|
db.exec(`
|
|
30226
30244
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
30227
30245
|
id TEXT PRIMARY KEY,
|
|
@@ -30241,7 +30259,7 @@ function up1010(db) {
|
|
|
30241
30259
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
30242
30260
|
ON summary_jobs(status)`);
|
|
30243
30261
|
}
|
|
30244
|
-
function
|
|
30262
|
+
function up1210(db) {
|
|
30245
30263
|
db.exec(`
|
|
30246
30264
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
30247
30265
|
id INTEGER PRIMARY KEY,
|
|
@@ -30252,7 +30270,7 @@ function up1110(db) {
|
|
|
30252
30270
|
)
|
|
30253
30271
|
`);
|
|
30254
30272
|
}
|
|
30255
|
-
function
|
|
30273
|
+
function up1310(db) {
|
|
30256
30274
|
db.exec(`
|
|
30257
30275
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
30258
30276
|
id TEXT PRIMARY KEY,
|
|
@@ -30272,7 +30290,7 @@ function up1210(db) {
|
|
|
30272
30290
|
ON session_scores(session_key);
|
|
30273
30291
|
`);
|
|
30274
30292
|
}
|
|
30275
|
-
function
|
|
30293
|
+
function up1410(db) {
|
|
30276
30294
|
db.exec(`
|
|
30277
30295
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
30278
30296
|
id TEXT PRIMARY KEY,
|
|
@@ -30313,7 +30331,7 @@ function addColumnIfMissing52(db, table, column, definition) {
|
|
|
30313
30331
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30314
30332
|
}
|
|
30315
30333
|
}
|
|
30316
|
-
function
|
|
30334
|
+
function up154(db) {
|
|
30317
30335
|
db.exec(`
|
|
30318
30336
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
30319
30337
|
id TEXT PRIMARY KEY,
|
|
@@ -30339,7 +30357,7 @@ function up1410(db) {
|
|
|
30339
30357
|
addColumnIfMissing52(db, "memories", "source_path", "TEXT");
|
|
30340
30358
|
addColumnIfMissing52(db, "memories", "source_section", "TEXT");
|
|
30341
30359
|
}
|
|
30342
|
-
function
|
|
30360
|
+
function up162(db) {
|
|
30343
30361
|
db.exec(`
|
|
30344
30362
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
30345
30363
|
id TEXT PRIMARY KEY,
|
|
@@ -30364,7 +30382,7 @@ function addColumnIfMissing62(db, table, column, definition) {
|
|
|
30364
30382
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30365
30383
|
}
|
|
30366
30384
|
}
|
|
30367
|
-
function
|
|
30385
|
+
function up172(db) {
|
|
30368
30386
|
db.exec(`
|
|
30369
30387
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
30370
30388
|
id TEXT PRIMARY KEY,
|
|
@@ -30391,7 +30409,7 @@ function up162(db) {
|
|
|
30391
30409
|
addColumnIfMissing62(db, "session_scores", "confidence", "REAL");
|
|
30392
30410
|
addColumnIfMissing62(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
30393
30411
|
}
|
|
30394
|
-
function
|
|
30412
|
+
function up182(db) {
|
|
30395
30413
|
db.exec(`
|
|
30396
30414
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
30397
30415
|
id TEXT PRIMARY KEY,
|
|
@@ -30413,7 +30431,7 @@ function up172(db) {
|
|
|
30413
30431
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
30414
30432
|
`);
|
|
30415
30433
|
}
|
|
30416
|
-
function
|
|
30434
|
+
function up192(db) {
|
|
30417
30435
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
30418
30436
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
30419
30437
|
if (!colNames.has("skill_name")) {
|
|
@@ -30424,7 +30442,7 @@ function up182(db) {
|
|
|
30424
30442
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
30425
30443
|
}
|
|
30426
30444
|
}
|
|
30427
|
-
function
|
|
30445
|
+
function up202(db) {
|
|
30428
30446
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
30429
30447
|
if (existing)
|
|
30430
30448
|
return;
|
|
@@ -30456,7 +30474,7 @@ function up192(db) {
|
|
|
30456
30474
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
30457
30475
|
`);
|
|
30458
30476
|
}
|
|
30459
|
-
function
|
|
30477
|
+
function up212(db) {
|
|
30460
30478
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
30461
30479
|
const entityColNames = new Set(entityCols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
30462
30480
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -30541,13 +30559,13 @@ function addColumnIfMissing72(db, table, column, definition) {
|
|
|
30541
30559
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30542
30560
|
}
|
|
30543
30561
|
}
|
|
30544
|
-
function
|
|
30562
|
+
function up222(db) {
|
|
30545
30563
|
addColumnIfMissing72(db, "session_memories", "entity_slot", "INTEGER");
|
|
30546
30564
|
addColumnIfMissing72(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30547
30565
|
addColumnIfMissing72(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
30548
30566
|
addColumnIfMissing72(db, "session_memories", "structural_density", "INTEGER");
|
|
30549
30567
|
}
|
|
30550
|
-
function
|
|
30568
|
+
function up232(db) {
|
|
30551
30569
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
30552
30570
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
30553
30571
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -30572,25 +30590,25 @@ function addColumnIfMissing82(db, table, column, definition) {
|
|
|
30572
30590
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30573
30591
|
}
|
|
30574
30592
|
}
|
|
30575
|
-
function
|
|
30593
|
+
function up242(db) {
|
|
30576
30594
|
addColumnIfMissing82(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
30577
30595
|
addColumnIfMissing82(db, "entities", "pinned_at", "TEXT");
|
|
30578
30596
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
30579
30597
|
}
|
|
30580
|
-
function up242(_db) {}
|
|
30581
30598
|
function up252(_db) {}
|
|
30599
|
+
function up262(_db) {}
|
|
30582
30600
|
function addColumnIfMissing92(db, table, column, definition) {
|
|
30583
30601
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30584
30602
|
if (!cols.some((c3) => c3.name === column)) {
|
|
30585
30603
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30586
30604
|
}
|
|
30587
30605
|
}
|
|
30588
|
-
function
|
|
30606
|
+
function up272(db) {
|
|
30589
30607
|
addColumnIfMissing92(db, "session_memories", "agent_relevance_score", "REAL");
|
|
30590
30608
|
addColumnIfMissing92(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
30591
30609
|
}
|
|
30592
|
-
function
|
|
30593
|
-
function
|
|
30610
|
+
function up282(_db) {}
|
|
30611
|
+
function up292(db) {
|
|
30594
30612
|
db.exec(`
|
|
30595
30613
|
UPDATE entities
|
|
30596
30614
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -30599,7 +30617,7 @@ function up282(db) {
|
|
|
30599
30617
|
WHERE canonical_name IS NULL
|
|
30600
30618
|
`);
|
|
30601
30619
|
}
|
|
30602
|
-
function
|
|
30620
|
+
function up302(db) {
|
|
30603
30621
|
db.exec(`
|
|
30604
30622
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
30605
30623
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -30636,7 +30654,7 @@ function up292(db) {
|
|
|
30636
30654
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
30637
30655
|
`);
|
|
30638
30656
|
}
|
|
30639
|
-
function
|
|
30657
|
+
function up312(db) {
|
|
30640
30658
|
db.exec(`
|
|
30641
30659
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
30642
30660
|
id TEXT PRIMARY KEY,
|
|
@@ -30681,7 +30699,7 @@ function up302(db) {
|
|
|
30681
30699
|
WHERE session_key IS NOT NULL;
|
|
30682
30700
|
`);
|
|
30683
30701
|
}
|
|
30684
|
-
function
|
|
30702
|
+
function up322(db) {
|
|
30685
30703
|
db.exec(`
|
|
30686
30704
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
30687
30705
|
id TEXT PRIMARY KEY,
|
|
@@ -30726,7 +30744,7 @@ function up312(db) {
|
|
|
30726
30744
|
ON memory_jobs(failed_at);
|
|
30727
30745
|
`);
|
|
30728
30746
|
}
|
|
30729
|
-
function
|
|
30747
|
+
function up332(db) {
|
|
30730
30748
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30731
30749
|
if (!depCols.some((c3) => c3.name === "reason")) {
|
|
30732
30750
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -30736,7 +30754,7 @@ function up322(db) {
|
|
|
30736
30754
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
30737
30755
|
}
|
|
30738
30756
|
}
|
|
30739
|
-
function
|
|
30757
|
+
function up342(db) {
|
|
30740
30758
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
30741
30759
|
if (cols.length === 0)
|
|
30742
30760
|
return;
|
|
@@ -30744,14 +30762,14 @@ function up332(db) {
|
|
|
30744
30762
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
30745
30763
|
}
|
|
30746
30764
|
}
|
|
30747
|
-
function
|
|
30765
|
+
function up352(db) {
|
|
30748
30766
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
30749
30767
|
if (!cols.some((c3) => c3.name === "scope")) {
|
|
30750
30768
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
30751
30769
|
}
|
|
30752
30770
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
30753
30771
|
}
|
|
30754
|
-
function
|
|
30772
|
+
function up362(db) {
|
|
30755
30773
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
30756
30774
|
db.exec(`
|
|
30757
30775
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -30759,7 +30777,7 @@ function up352(db) {
|
|
|
30759
30777
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
30760
30778
|
`);
|
|
30761
30779
|
}
|
|
30762
|
-
function
|
|
30780
|
+
function up372(db) {
|
|
30763
30781
|
db.exec(`
|
|
30764
30782
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
30765
30783
|
name, canonical_name,
|
|
@@ -30791,13 +30809,13 @@ function up362(db) {
|
|
|
30791
30809
|
END
|
|
30792
30810
|
`);
|
|
30793
30811
|
}
|
|
30794
|
-
function
|
|
30812
|
+
function up382(db) {
|
|
30795
30813
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30796
30814
|
if (!cols.some((c3) => c3.name === "confidence")) {
|
|
30797
30815
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
30798
30816
|
}
|
|
30799
30817
|
}
|
|
30800
|
-
function
|
|
30818
|
+
function up392(db) {
|
|
30801
30819
|
db.exec(`
|
|
30802
30820
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
30803
30821
|
id TEXT PRIMARY KEY,
|
|
@@ -30815,7 +30833,7 @@ function up382(db) {
|
|
|
30815
30833
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
30816
30834
|
}
|
|
30817
30835
|
}
|
|
30818
|
-
function
|
|
30836
|
+
function up402(db) {
|
|
30819
30837
|
db.exec(`
|
|
30820
30838
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
30821
30839
|
id TEXT PRIMARY KEY,
|
|
@@ -30855,7 +30873,7 @@ function up392(db) {
|
|
|
30855
30873
|
END
|
|
30856
30874
|
`);
|
|
30857
30875
|
}
|
|
30858
|
-
function
|
|
30876
|
+
function up412(db) {
|
|
30859
30877
|
db.exec(`
|
|
30860
30878
|
DELETE FROM entity_dependencies
|
|
30861
30879
|
WHERE id NOT IN (
|
|
@@ -30873,7 +30891,7 @@ function up402(db) {
|
|
|
30873
30891
|
)
|
|
30874
30892
|
`);
|
|
30875
30893
|
}
|
|
30876
|
-
function
|
|
30894
|
+
function up422(db) {
|
|
30877
30895
|
db.exec(`
|
|
30878
30896
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
30879
30897
|
session_key TEXT PRIMARY KEY,
|
|
@@ -30896,7 +30914,7 @@ function addColumnIfMissing102(db, table, column, definition) {
|
|
|
30896
30914
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30897
30915
|
}
|
|
30898
30916
|
}
|
|
30899
|
-
function
|
|
30917
|
+
function up432(db) {
|
|
30900
30918
|
addColumnIfMissing102(db, "session_memories", "path_json", "TEXT");
|
|
30901
30919
|
db.exec(`
|
|
30902
30920
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -30971,7 +30989,7 @@ function addColumnIfMissing112(db, table, column, definition) {
|
|
|
30971
30989
|
return;
|
|
30972
30990
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30973
30991
|
}
|
|
30974
|
-
function
|
|
30992
|
+
function up442(db) {
|
|
30975
30993
|
addColumnIfMissing112(db, "session_memories", "entity_slot", "INTEGER");
|
|
30976
30994
|
addColumnIfMissing112(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30977
30995
|
addColumnIfMissing112(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -31059,7 +31077,7 @@ function addColumnIfMissing122(db, table, column, definition) {
|
|
|
31059
31077
|
return;
|
|
31060
31078
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31061
31079
|
}
|
|
31062
|
-
function
|
|
31080
|
+
function up452(db) {
|
|
31063
31081
|
db.exec(`
|
|
31064
31082
|
CREATE TABLE IF NOT EXISTS agents (
|
|
31065
31083
|
id TEXT PRIMARY KEY,
|
|
@@ -31088,7 +31106,7 @@ function addColumnIfMissing132(db, table, column, definition) {
|
|
|
31088
31106
|
return;
|
|
31089
31107
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31090
31108
|
}
|
|
31091
|
-
function
|
|
31109
|
+
function up462(db) {
|
|
31092
31110
|
addColumnIfMissing132(db, "session_summaries", "source_type", "TEXT");
|
|
31093
31111
|
addColumnIfMissing132(db, "session_summaries", "source_ref", "TEXT");
|
|
31094
31112
|
addColumnIfMissing132(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -31114,7 +31132,7 @@ function addColumnIfMissing142(db, table, column, definition) {
|
|
|
31114
31132
|
return;
|
|
31115
31133
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31116
31134
|
}
|
|
31117
|
-
function
|
|
31135
|
+
function up472(db) {
|
|
31118
31136
|
addColumnIfMissing142(db, "session_transcripts", "updated_at", "TEXT");
|
|
31119
31137
|
addColumnIfMissing142(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
31120
31138
|
addColumnIfMissing142(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -31185,7 +31203,7 @@ function up462(db) {
|
|
|
31185
31203
|
ON memory_md_heads(lease_expires_at);
|
|
31186
31204
|
`);
|
|
31187
31205
|
}
|
|
31188
|
-
function
|
|
31206
|
+
function up482(db) {
|
|
31189
31207
|
db.exec(`
|
|
31190
31208
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
31191
31209
|
|
|
@@ -31246,7 +31264,7 @@ function up472(db) {
|
|
|
31246
31264
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31247
31265
|
`);
|
|
31248
31266
|
}
|
|
31249
|
-
function
|
|
31267
|
+
function up492(db) {
|
|
31250
31268
|
db.exec(`
|
|
31251
31269
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
31252
31270
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -31344,7 +31362,7 @@ function up482(db) {
|
|
|
31344
31362
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31345
31363
|
`);
|
|
31346
31364
|
}
|
|
31347
|
-
function
|
|
31365
|
+
function up502(db) {
|
|
31348
31366
|
db.exec(`
|
|
31349
31367
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
31350
31368
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -31462,7 +31480,7 @@ function up492(db) {
|
|
|
31462
31480
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
31463
31481
|
`);
|
|
31464
31482
|
}
|
|
31465
|
-
function
|
|
31483
|
+
function up512(db) {
|
|
31466
31484
|
db.exec(`
|
|
31467
31485
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
31468
31486
|
session_key TEXT NOT NULL,
|
|
@@ -31479,7 +31497,7 @@ function hasTable5(db, name) {
|
|
|
31479
31497
|
WHERE type = 'table' AND name = ?
|
|
31480
31498
|
LIMIT 1`).get(name) !== undefined;
|
|
31481
31499
|
}
|
|
31482
|
-
function
|
|
31500
|
+
function up522(db) {
|
|
31483
31501
|
db.exec(`
|
|
31484
31502
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
31485
31503
|
id TEXT PRIMARY KEY,
|
|
@@ -31649,7 +31667,7 @@ function addColumnIfMissing152(db, table, column, definition) {
|
|
|
31649
31667
|
return;
|
|
31650
31668
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31651
31669
|
}
|
|
31652
|
-
function
|
|
31670
|
+
function up532(db) {
|
|
31653
31671
|
addColumnIfMissing152(db, "summary_jobs", "session_id", "TEXT");
|
|
31654
31672
|
addColumnIfMissing152(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
31655
31673
|
addColumnIfMissing152(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -31741,7 +31759,7 @@ function up522(db) {
|
|
|
31741
31759
|
VALUES ('rebuild');
|
|
31742
31760
|
`);
|
|
31743
31761
|
}
|
|
31744
|
-
function
|
|
31762
|
+
function up542(db) {
|
|
31745
31763
|
db.exec(`
|
|
31746
31764
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
31747
31765
|
id TEXT PRIMARY KEY,
|
|
@@ -31758,7 +31776,7 @@ function up532(db) {
|
|
|
31758
31776
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
31759
31777
|
`);
|
|
31760
31778
|
}
|
|
31761
|
-
function
|
|
31779
|
+
function up552(db) {
|
|
31762
31780
|
db.exec(`
|
|
31763
31781
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
31764
31782
|
id TEXT PRIMARY KEY,
|
|
@@ -31774,7 +31792,7 @@ function up542(db) {
|
|
|
31774
31792
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
31775
31793
|
`);
|
|
31776
31794
|
}
|
|
31777
|
-
function
|
|
31795
|
+
function up562(db) {
|
|
31778
31796
|
db.exec(`
|
|
31779
31797
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
31780
31798
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -31805,7 +31823,7 @@ function up552(db) {
|
|
|
31805
31823
|
ON task_scope_hints(agent_id, updated_at);
|
|
31806
31824
|
`);
|
|
31807
31825
|
}
|
|
31808
|
-
function
|
|
31826
|
+
function up572(db) {
|
|
31809
31827
|
db.exec(`
|
|
31810
31828
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
31811
31829
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -31848,7 +31866,7 @@ function ensureMemoriesScopeColumns3(db) {
|
|
|
31848
31866
|
if (!names.has("scope"))
|
|
31849
31867
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
31850
31868
|
}
|
|
31851
|
-
function
|
|
31869
|
+
function up582(db) {
|
|
31852
31870
|
ensureMemoriesScopeColumns3(db);
|
|
31853
31871
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
31854
31872
|
db.exec(`
|
|
@@ -31861,20 +31879,20 @@ function up572(db) {
|
|
|
31861
31879
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
31862
31880
|
`);
|
|
31863
31881
|
}
|
|
31864
|
-
function
|
|
31882
|
+
function up592(db) {
|
|
31865
31883
|
const sql = readMemoriesFtsSql2(db);
|
|
31866
31884
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair2(sql))
|
|
31867
31885
|
return;
|
|
31868
31886
|
recreateMemoriesFts2(db);
|
|
31869
31887
|
}
|
|
31870
|
-
function
|
|
31888
|
+
function up602(db) {
|
|
31871
31889
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
31872
31890
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
31873
31891
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
31874
31892
|
ON entities(entity_type, mentions)
|
|
31875
31893
|
WHERE entity_type = 'extracted'`);
|
|
31876
31894
|
}
|
|
31877
|
-
function
|
|
31895
|
+
function up612(db) {
|
|
31878
31896
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
31879
31897
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
31880
31898
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -31883,7 +31901,7 @@ function up602(db) {
|
|
|
31883
31901
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
31884
31902
|
WHERE claim_key IS NOT NULL`);
|
|
31885
31903
|
}
|
|
31886
|
-
function
|
|
31904
|
+
function up622(db) {
|
|
31887
31905
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
31888
31906
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
31889
31907
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -31895,13 +31913,13 @@ function up612(db) {
|
|
|
31895
31913
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
31896
31914
|
WHERE claim_key IS NOT NULL`);
|
|
31897
31915
|
}
|
|
31898
|
-
function
|
|
31916
|
+
function up632(db) {
|
|
31899
31917
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
31900
31918
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
31901
31919
|
return;
|
|
31902
31920
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
31903
31921
|
}
|
|
31904
|
-
function
|
|
31922
|
+
function up642(db) {
|
|
31905
31923
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
31906
31924
|
const names = new Set(cols.map((col) => col.name));
|
|
31907
31925
|
if (!names.has("is_deleted")) {
|
|
@@ -31915,7 +31933,7 @@ function up632(db) {
|
|
|
31915
31933
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
31916
31934
|
`);
|
|
31917
31935
|
}
|
|
31918
|
-
function
|
|
31936
|
+
function up652(db) {
|
|
31919
31937
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
31920
31938
|
db.exec(`
|
|
31921
31939
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -31933,7 +31951,7 @@ function addColumnIfMissing162(db, table, column, definition) {
|
|
|
31933
31951
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31934
31952
|
}
|
|
31935
31953
|
}
|
|
31936
|
-
function
|
|
31954
|
+
function up662(db) {
|
|
31937
31955
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
31938
31956
|
addColumnIfMissing162(db, table, "source_id", "TEXT");
|
|
31939
31957
|
addColumnIfMissing162(db, table, "source_kind", "TEXT");
|
|
@@ -31953,7 +31971,7 @@ function hasColumn72(db, table, column) {
|
|
|
31953
31971
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
31954
31972
|
return rows.some((row) => row.name === column);
|
|
31955
31973
|
}
|
|
31956
|
-
function
|
|
31974
|
+
function up672(db) {
|
|
31957
31975
|
if (!hasTable22(db, "embeddings"))
|
|
31958
31976
|
return;
|
|
31959
31977
|
if (!hasColumn72(db, "embeddings", "agent_id")) {
|
|
@@ -31961,7 +31979,7 @@ function up662(db) {
|
|
|
31961
31979
|
}
|
|
31962
31980
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
31963
31981
|
}
|
|
31964
|
-
function
|
|
31982
|
+
function up682(db) {
|
|
31965
31983
|
db.exec(`
|
|
31966
31984
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
31967
31985
|
id TEXT PRIMARY KEY,
|
|
@@ -32002,7 +32020,7 @@ function addColumnIfMissing172(db, table, column, definition) {
|
|
|
32002
32020
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32003
32021
|
}
|
|
32004
32022
|
}
|
|
32005
|
-
function
|
|
32023
|
+
function up692(db) {
|
|
32006
32024
|
db.exec(`
|
|
32007
32025
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
32008
32026
|
id TEXT PRIMARY KEY,
|
|
@@ -32045,7 +32063,7 @@ function up682(db) {
|
|
|
32045
32063
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
32046
32064
|
}
|
|
32047
32065
|
}
|
|
32048
|
-
function
|
|
32066
|
+
function up702(db) {
|
|
32049
32067
|
db.exec(`
|
|
32050
32068
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
32051
32069
|
id TEXT PRIMARY KEY,
|
|
@@ -32072,7 +32090,7 @@ function up692(db) {
|
|
|
32072
32090
|
WHERE content_key IS NOT NULL;
|
|
32073
32091
|
`);
|
|
32074
32092
|
}
|
|
32075
|
-
function
|
|
32093
|
+
function up712(db) {
|
|
32076
32094
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
32077
32095
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
32078
32096
|
if (!colNames.has("content_key")) {
|
|
@@ -32109,7 +32127,7 @@ function backfillVersionRoots2(db) {
|
|
|
32109
32127
|
WHERE version_root_id IS NULL
|
|
32110
32128
|
`);
|
|
32111
32129
|
}
|
|
32112
|
-
function
|
|
32130
|
+
function up722(db) {
|
|
32113
32131
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
32114
32132
|
addColumnIfMissing182(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
32115
32133
|
addColumnIfMissing182(db, table, "archived_at", "TEXT");
|
|
@@ -32144,7 +32162,7 @@ function up712(db) {
|
|
|
32144
32162
|
ON entity_aspects(agent_id, proposal_id);
|
|
32145
32163
|
`);
|
|
32146
32164
|
}
|
|
32147
|
-
function
|
|
32165
|
+
function up732(db) {
|
|
32148
32166
|
db.exec(`
|
|
32149
32167
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
32150
32168
|
id TEXT PRIMARY KEY,
|
|
@@ -32200,7 +32218,7 @@ function ensureMemoriesScopeColumns22(db) {
|
|
|
32200
32218
|
if (!names.has("runtime_path"))
|
|
32201
32219
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
32202
32220
|
}
|
|
32203
|
-
function
|
|
32221
|
+
function up742(db) {
|
|
32204
32222
|
ensureMemoriesScopeColumns22(db);
|
|
32205
32223
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
32206
32224
|
db.exec(`
|
|
@@ -32214,7 +32232,7 @@ function up732(db) {
|
|
|
32214
32232
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
32215
32233
|
`);
|
|
32216
32234
|
}
|
|
32217
|
-
function
|
|
32235
|
+
function up752(db) {
|
|
32218
32236
|
db.exec(`
|
|
32219
32237
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
32220
32238
|
session_key TEXT NOT NULL,
|
|
@@ -32249,7 +32267,7 @@ function up742(db) {
|
|
|
32249
32267
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
32250
32268
|
`);
|
|
32251
32269
|
}
|
|
32252
|
-
function
|
|
32270
|
+
function up762(db) {
|
|
32253
32271
|
db.exec(`
|
|
32254
32272
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
32255
32273
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32268,7 +32286,7 @@ function addColumnIfMissing192(db, table, column, definition) {
|
|
|
32268
32286
|
return;
|
|
32269
32287
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32270
32288
|
}
|
|
32271
|
-
function
|
|
32289
|
+
function up772(db) {
|
|
32272
32290
|
addColumnIfMissing192(db, "memory_artifacts", "source_id", "TEXT");
|
|
32273
32291
|
addColumnIfMissing192(db, "memory_artifacts", "source_root", "TEXT");
|
|
32274
32292
|
addColumnIfMissing192(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -32281,7 +32299,7 @@ function up762(db) {
|
|
|
32281
32299
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
32282
32300
|
`);
|
|
32283
32301
|
}
|
|
32284
|
-
function
|
|
32302
|
+
function up782(db) {
|
|
32285
32303
|
db.exec(`
|
|
32286
32304
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
32287
32305
|
id TEXT PRIMARY KEY,
|
|
@@ -32304,7 +32322,7 @@ function up772(db) {
|
|
|
32304
32322
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
32305
32323
|
`);
|
|
32306
32324
|
}
|
|
32307
|
-
function
|
|
32325
|
+
function up792(db) {
|
|
32308
32326
|
db.exec(`
|
|
32309
32327
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
32310
32328
|
id TEXT PRIMARY KEY,
|
|
@@ -32328,7 +32346,7 @@ function up782(db) {
|
|
|
32328
32346
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
32329
32347
|
`);
|
|
32330
32348
|
}
|
|
32331
|
-
function
|
|
32349
|
+
function up802(db) {
|
|
32332
32350
|
db.exec(`
|
|
32333
32351
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
32334
32352
|
id TEXT PRIMARY KEY,
|
|
@@ -32356,7 +32374,7 @@ function up792(db) {
|
|
|
32356
32374
|
ON api_keys(connector, harness);
|
|
32357
32375
|
`);
|
|
32358
32376
|
}
|
|
32359
|
-
function
|
|
32377
|
+
function up812(db) {
|
|
32360
32378
|
db.exec(`
|
|
32361
32379
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
32362
32380
|
id TEXT PRIMARY KEY,
|
|
@@ -32391,7 +32409,7 @@ function hasColumn102(db, table, column) {
|
|
|
32391
32409
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32392
32410
|
return rows.some((row) => row.name === column);
|
|
32393
32411
|
}
|
|
32394
|
-
function
|
|
32412
|
+
function up822(db) {
|
|
32395
32413
|
if (!hasColumn102(db, "documents", "agent_id")) {
|
|
32396
32414
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
32397
32415
|
}
|
|
@@ -32477,7 +32495,7 @@ function up812(db) {
|
|
|
32477
32495
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
32478
32496
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
32479
32497
|
}
|
|
32480
|
-
function
|
|
32498
|
+
function up832(db) {
|
|
32481
32499
|
db.exec(`
|
|
32482
32500
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
32483
32501
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32499,7 +32517,7 @@ function hasColumn112(db, table, column) {
|
|
|
32499
32517
|
return rows.some((row) => row.name === column);
|
|
32500
32518
|
}
|
|
32501
32519
|
var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
32502
|
-
function
|
|
32520
|
+
function up842(db) {
|
|
32503
32521
|
for (const column of COLUMNS3) {
|
|
32504
32522
|
if (!hasColumn112(db, "skill_invocations", column)) {
|
|
32505
32523
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -32580,7 +32598,7 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32580
32598
|
`);
|
|
32581
32599
|
}
|
|
32582
32600
|
try {
|
|
32583
|
-
|
|
32601
|
+
up822(db);
|
|
32584
32602
|
if (preserveAgentId) {
|
|
32585
32603
|
db.exec(`
|
|
32586
32604
|
UPDATE documents
|
|
@@ -32600,12 +32618,12 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32600
32618
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
32601
32619
|
}
|
|
32602
32620
|
}
|
|
32603
|
-
function
|
|
32604
|
-
|
|
32621
|
+
function up852(db) {
|
|
32622
|
+
up812(db);
|
|
32605
32623
|
if (hasTable32(db, "documents")) {
|
|
32606
32624
|
documentScopeColumnsPreservingExisting2(db);
|
|
32607
32625
|
}
|
|
32608
|
-
|
|
32626
|
+
up832(db);
|
|
32609
32627
|
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
32610
32628
|
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
32611
32629
|
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -32662,7 +32680,7 @@ function up842(db) {
|
|
|
32662
32680
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
32663
32681
|
`);
|
|
32664
32682
|
}
|
|
32665
|
-
function
|
|
32683
|
+
function up862(db) {
|
|
32666
32684
|
db.exec(`
|
|
32667
32685
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
32668
32686
|
path TEXT PRIMARY KEY,
|
|
@@ -32692,7 +32710,7 @@ function up852(db) {
|
|
|
32692
32710
|
ON legacy_markdown_chunks(memory_id);
|
|
32693
32711
|
`);
|
|
32694
32712
|
}
|
|
32695
|
-
function
|
|
32713
|
+
function up872(db) {
|
|
32696
32714
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
32697
32715
|
const tableNames = new Set(tables.map((r3) => String(r3.name)));
|
|
32698
32716
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -32751,7 +32769,7 @@ function addColumnIfMissing212(db, table, column, definition) {
|
|
|
32751
32769
|
return;
|
|
32752
32770
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32753
32771
|
}
|
|
32754
|
-
function
|
|
32772
|
+
function up882(db) {
|
|
32755
32773
|
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
32756
32774
|
db.exec(`
|
|
32757
32775
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -32764,14 +32782,14 @@ function addColumnIfMissing222(db, table, column, definition) {
|
|
|
32764
32782
|
return;
|
|
32765
32783
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32766
32784
|
}
|
|
32767
|
-
function
|
|
32785
|
+
function up892(db) {
|
|
32768
32786
|
addColumnIfMissing222(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
32769
32787
|
db.exec(`
|
|
32770
32788
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
32771
32789
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
32772
32790
|
`);
|
|
32773
32791
|
}
|
|
32774
|
-
function
|
|
32792
|
+
function up902(db) {
|
|
32775
32793
|
db.exec(`
|
|
32776
32794
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
32777
32795
|
agent_id TEXT NOT NULL,
|
|
@@ -32789,7 +32807,7 @@ function up892(db) {
|
|
|
32789
32807
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
32790
32808
|
`);
|
|
32791
32809
|
}
|
|
32792
|
-
function
|
|
32810
|
+
function up912(db) {
|
|
32793
32811
|
db.exec(`
|
|
32794
32812
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
32795
32813
|
id TEXT PRIMARY KEY,
|
|
@@ -32817,7 +32835,7 @@ function indexExists3(db, table, indexName) {
|
|
|
32817
32835
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32818
32836
|
return rows.some((row) => row.name === indexName);
|
|
32819
32837
|
}
|
|
32820
|
-
function
|
|
32838
|
+
function up922(db) {
|
|
32821
32839
|
db.exec(`
|
|
32822
32840
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
32823
32841
|
id TEXT PRIMARY KEY,
|
|
@@ -32844,7 +32862,7 @@ function indexExists22(db, table, indexName) {
|
|
|
32844
32862
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32845
32863
|
return rows.some((row) => row.name === indexName);
|
|
32846
32864
|
}
|
|
32847
|
-
function
|
|
32865
|
+
function up932(db) {
|
|
32848
32866
|
db.exec(`
|
|
32849
32867
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
32850
32868
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -32857,7 +32875,7 @@ function up922(db) {
|
|
|
32857
32875
|
)
|
|
32858
32876
|
`);
|
|
32859
32877
|
}
|
|
32860
|
-
function
|
|
32878
|
+
function up942(db) {
|
|
32861
32879
|
db.exec(`
|
|
32862
32880
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
32863
32881
|
id TEXT PRIMARY KEY,
|
|
@@ -32876,7 +32894,7 @@ function up932(db) {
|
|
|
32876
32894
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
32877
32895
|
`);
|
|
32878
32896
|
}
|
|
32879
|
-
function
|
|
32897
|
+
function up952(db) {
|
|
32880
32898
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
32881
32899
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
32882
32900
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -32887,7 +32905,7 @@ function hasColumn132(db, table, column) {
|
|
|
32887
32905
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32888
32906
|
return rows.some((r3) => r3.name === column);
|
|
32889
32907
|
}
|
|
32890
|
-
function
|
|
32908
|
+
function up962(db) {
|
|
32891
32909
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
32892
32910
|
if (tables.length === 0)
|
|
32893
32911
|
return;
|
|
@@ -32912,23 +32930,23 @@ function up952(db) {
|
|
|
32912
32930
|
function hasColumn142(db, table, column) {
|
|
32913
32931
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32914
32932
|
}
|
|
32915
|
-
function
|
|
32933
|
+
function up972(db) {
|
|
32916
32934
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
32917
32935
|
if (!hasMemories || !hasColumn142(db, "memories", "memory_kind") || !hasColumn142(db, "memories", "type"))
|
|
32918
32936
|
return;
|
|
32919
32937
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
32920
32938
|
}
|
|
32921
|
-
function
|
|
32939
|
+
function up982(db) {
|
|
32922
32940
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
32923
32941
|
}
|
|
32924
|
-
function
|
|
32942
|
+
function up992(db) {
|
|
32925
32943
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
32926
32944
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
32927
32945
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
32928
32946
|
}
|
|
32929
32947
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
32930
32948
|
}
|
|
32931
|
-
function
|
|
32949
|
+
function up1002(db) {
|
|
32932
32950
|
db.exec(`
|
|
32933
32951
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
32934
32952
|
agent_id TEXT NOT NULL,
|
|
@@ -32945,7 +32963,7 @@ function up992(db) {
|
|
|
32945
32963
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
32946
32964
|
`);
|
|
32947
32965
|
}
|
|
32948
|
-
function
|
|
32966
|
+
function up1012(db) {
|
|
32949
32967
|
db.exec(`
|
|
32950
32968
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
32951
32969
|
id TEXT PRIMARY KEY,
|
|
@@ -32965,7 +32983,7 @@ function up1002(db) {
|
|
|
32965
32983
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
32966
32984
|
`);
|
|
32967
32985
|
}
|
|
32968
|
-
function
|
|
32986
|
+
function up1022(db) {
|
|
32969
32987
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
32970
32988
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
32971
32989
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -32974,7 +32992,7 @@ function up1012(db) {
|
|
|
32974
32992
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
32975
32993
|
}
|
|
32976
32994
|
}
|
|
32977
|
-
function
|
|
32995
|
+
function up1032(db) {
|
|
32978
32996
|
db.exec(`
|
|
32979
32997
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
32980
32998
|
id TEXT PRIMARY KEY,
|
|
@@ -32996,7 +33014,7 @@ function up1022(db) {
|
|
|
32996
33014
|
function hasColumn152(db, table, column) {
|
|
32997
33015
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32998
33016
|
}
|
|
32999
|
-
function
|
|
33017
|
+
function up1042(db) {
|
|
33000
33018
|
const requiredMemoryColumns = [
|
|
33001
33019
|
"content_hash",
|
|
33002
33020
|
"normalized_content",
|
|
@@ -33047,7 +33065,7 @@ function up1032(db) {
|
|
|
33047
33065
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
33048
33066
|
`);
|
|
33049
33067
|
}
|
|
33050
|
-
function
|
|
33068
|
+
function up1052(db) {
|
|
33051
33069
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
33052
33070
|
if (tables.length !== 2)
|
|
33053
33071
|
return;
|
|
@@ -33070,7 +33088,7 @@ function tableExists4(db, table) {
|
|
|
33070
33088
|
function hasColumn162(db, table, column) {
|
|
33071
33089
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33072
33090
|
}
|
|
33073
|
-
function
|
|
33091
|
+
function up1062(db) {
|
|
33074
33092
|
db.exec(`
|
|
33075
33093
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
33076
33094
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -33113,7 +33131,7 @@ function up1052(db) {
|
|
|
33113
33131
|
`);
|
|
33114
33132
|
}
|
|
33115
33133
|
}
|
|
33116
|
-
function
|
|
33134
|
+
function up1072(db) {
|
|
33117
33135
|
db.exec(`
|
|
33118
33136
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
33119
33137
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -33202,7 +33220,7 @@ function up1062(db) {
|
|
|
33202
33220
|
function hasColumn172(db, table, column) {
|
|
33203
33221
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33204
33222
|
}
|
|
33205
|
-
function
|
|
33223
|
+
function up1082(db) {
|
|
33206
33224
|
if (!hasColumn172(db, "memories", "review_after")) {
|
|
33207
33225
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
33208
33226
|
}
|
|
@@ -33218,14 +33236,14 @@ var TOKEN_COLUMNS2 = [
|
|
|
33218
33236
|
["tokens_cache_write", "INTEGER"],
|
|
33219
33237
|
["tokens_cost", "REAL"]
|
|
33220
33238
|
];
|
|
33221
|
-
function
|
|
33239
|
+
function up1092(db) {
|
|
33222
33240
|
for (const [column, type] of TOKEN_COLUMNS2) {
|
|
33223
33241
|
if (!hasColumn182(db, "dreaming_passes", column)) {
|
|
33224
33242
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
33225
33243
|
}
|
|
33226
33244
|
}
|
|
33227
33245
|
}
|
|
33228
|
-
function
|
|
33246
|
+
function up1102(db) {
|
|
33229
33247
|
db.exec(`
|
|
33230
33248
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
33231
33249
|
day TEXT NOT NULL,
|
|
@@ -33238,7 +33256,7 @@ function up1092(db) {
|
|
|
33238
33256
|
);
|
|
33239
33257
|
`);
|
|
33240
33258
|
}
|
|
33241
|
-
function
|
|
33259
|
+
function up1112(db) {
|
|
33242
33260
|
db.exec(`
|
|
33243
33261
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
33244
33262
|
id TEXT PRIMARY KEY,
|
|
@@ -33246,7 +33264,7 @@ function up1102(db) {
|
|
|
33246
33264
|
);
|
|
33247
33265
|
`);
|
|
33248
33266
|
}
|
|
33249
|
-
function
|
|
33267
|
+
function up1122(db) {
|
|
33250
33268
|
db.exec(`
|
|
33251
33269
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
33252
33270
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -33257,7 +33275,7 @@ function hasColumn192(db, table, column) {
|
|
|
33257
33275
|
return rows.some((row) => row.name === column);
|
|
33258
33276
|
}
|
|
33259
33277
|
var COLUMNS22 = ["first_remember_at", "first_recall_at"];
|
|
33260
|
-
function
|
|
33278
|
+
function up1132(db) {
|
|
33261
33279
|
for (const column of COLUMNS22) {
|
|
33262
33280
|
if (!hasColumn192(db, "telemetry_install", column)) {
|
|
33263
33281
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -33273,7 +33291,7 @@ function addColumnIfMissing232(db, column, definition) {
|
|
|
33273
33291
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33274
33292
|
}
|
|
33275
33293
|
}
|
|
33276
|
-
function
|
|
33294
|
+
function up1142(db) {
|
|
33277
33295
|
addColumnIfMissing232(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
33278
33296
|
addColumnIfMissing232(db, "claim_token", "TEXT");
|
|
33279
33297
|
addColumnIfMissing232(db, "claimed_at", "TEXT");
|
|
@@ -33282,7 +33300,7 @@ function up1132(db) {
|
|
|
33282
33300
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
33283
33301
|
`);
|
|
33284
33302
|
}
|
|
33285
|
-
function
|
|
33303
|
+
function up1152(db) {
|
|
33286
33304
|
db.exec(`
|
|
33287
33305
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
33288
33306
|
session_key TEXT NOT NULL,
|
|
@@ -33303,7 +33321,7 @@ function up1142(db) {
|
|
|
33303
33321
|
ON session_claims(agent_id, state, expires_at);
|
|
33304
33322
|
`);
|
|
33305
33323
|
}
|
|
33306
|
-
function
|
|
33324
|
+
function up1162(db) {
|
|
33307
33325
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
33308
33326
|
if (table == null)
|
|
33309
33327
|
return;
|
|
@@ -33312,7 +33330,7 @@ function up1152(db) {
|
|
|
33312
33330
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
33313
33331
|
`);
|
|
33314
33332
|
}
|
|
33315
|
-
function
|
|
33333
|
+
function up1172(db) {
|
|
33316
33334
|
db.exec(`
|
|
33317
33335
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
33318
33336
|
id TEXT PRIMARY KEY,
|
|
@@ -33369,7 +33387,7 @@ function addColumnIfMissing242(db, column, definition) {
|
|
|
33369
33387
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
33370
33388
|
}
|
|
33371
33389
|
}
|
|
33372
|
-
function
|
|
33390
|
+
function up1182(db) {
|
|
33373
33391
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
33374
33392
|
if (table == null)
|
|
33375
33393
|
return;
|
|
@@ -33570,7 +33588,7 @@ function backfillTranscriptsFromSummaryJobs2(db) {
|
|
|
33570
33588
|
insert.run(...values);
|
|
33571
33589
|
}
|
|
33572
33590
|
}
|
|
33573
|
-
function
|
|
33591
|
+
function up1192(db) {
|
|
33574
33592
|
if (!hasTable42(db, "session_transcripts"))
|
|
33575
33593
|
return;
|
|
33576
33594
|
addColumnIfMissing252(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -33623,7 +33641,7 @@ function up1182(db) {
|
|
|
33623
33641
|
ON session_transcripts(agent_id, content_hash);
|
|
33624
33642
|
`);
|
|
33625
33643
|
}
|
|
33626
|
-
function
|
|
33644
|
+
function up1202(db) {
|
|
33627
33645
|
db.exec(`
|
|
33628
33646
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
33629
33647
|
ON memory_jobs(status)
|
|
@@ -33642,12 +33660,12 @@ function up1192(db) {
|
|
|
33642
33660
|
function hasColumn222(db, table, column) {
|
|
33643
33661
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33644
33662
|
}
|
|
33645
|
-
function
|
|
33663
|
+
function up1212(db) {
|
|
33646
33664
|
if (!hasColumn222(db, "telemetry_install", "last_seen_version")) {
|
|
33647
33665
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
33648
33666
|
}
|
|
33649
33667
|
}
|
|
33650
|
-
function
|
|
33668
|
+
function up1222(db) {
|
|
33651
33669
|
db.exec(`
|
|
33652
33670
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
33653
33671
|
agent_id TEXT NOT NULL,
|
|
@@ -33676,7 +33694,7 @@ function addColumnIfMissing262(db, column, definition) {
|
|
|
33676
33694
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33677
33695
|
}
|
|
33678
33696
|
}
|
|
33679
|
-
function
|
|
33697
|
+
function up1232(db) {
|
|
33680
33698
|
addColumnIfMissing262(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
33681
33699
|
addColumnIfMissing262(db, "last_attempt_at", "TEXT");
|
|
33682
33700
|
addColumnIfMissing262(db, "sent_at", "TEXT");
|
|
@@ -33697,7 +33715,7 @@ function up1222(db) {
|
|
|
33697
33715
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
33698
33716
|
`);
|
|
33699
33717
|
}
|
|
33700
|
-
function
|
|
33718
|
+
function up1242(db) {
|
|
33701
33719
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
33702
33720
|
const names = new Set(columns.map((column) => column.name));
|
|
33703
33721
|
if (!names.has("failure_class")) {
|
|
@@ -33714,7 +33732,7 @@ function up1232(db) {
|
|
|
33714
33732
|
}
|
|
33715
33733
|
db.exec("CREATE INDEX IF NOT EXISTS idx_dreaming_evidence_exclusions_retry ON dreaming_evidence_exclusions (resolved_at, requeue_requested_at, failure_class, retry_count, last_requeued_at)");
|
|
33716
33734
|
}
|
|
33717
|
-
function
|
|
33735
|
+
function up1252(db) {
|
|
33718
33736
|
db.exec(`
|
|
33719
33737
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
33720
33738
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -33738,7 +33756,7 @@ function up1242(db) {
|
|
|
33738
33756
|
ON embedding_index_failures(source_type, source_id);
|
|
33739
33757
|
`);
|
|
33740
33758
|
}
|
|
33741
|
-
function
|
|
33759
|
+
function up1262(db) {
|
|
33742
33760
|
db.exec(`
|
|
33743
33761
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
33744
33762
|
id TEXT PRIMARY KEY,
|
|
@@ -33788,7 +33806,7 @@ function backfillTable2(db, params) {
|
|
|
33788
33806
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
33789
33807
|
backfill2(db, rows, params.sourceKind, params.scannedAt);
|
|
33790
33808
|
}
|
|
33791
|
-
function
|
|
33809
|
+
function up1272(db) {
|
|
33792
33810
|
db.exec(`
|
|
33793
33811
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
33794
33812
|
agent_id TEXT NOT NULL,
|
|
@@ -33845,7 +33863,7 @@ function up1262(db) {
|
|
|
33845
33863
|
scannedAt
|
|
33846
33864
|
});
|
|
33847
33865
|
}
|
|
33848
|
-
function
|
|
33866
|
+
function up1282(db) {
|
|
33849
33867
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
33850
33868
|
if (!table)
|
|
33851
33869
|
return;
|
|
@@ -33879,7 +33897,7 @@ function up1272(db) {
|
|
|
33879
33897
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
33880
33898
|
`);
|
|
33881
33899
|
}
|
|
33882
|
-
function
|
|
33900
|
+
function up1292(db) {
|
|
33883
33901
|
db.exec(`
|
|
33884
33902
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
33885
33903
|
id TEXT PRIMARY KEY,
|
|
@@ -33935,7 +33953,7 @@ function up1282(db) {
|
|
|
33935
33953
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
33936
33954
|
`);
|
|
33937
33955
|
}
|
|
33938
|
-
function
|
|
33956
|
+
function up1302(db) {
|
|
33939
33957
|
db.exec(`
|
|
33940
33958
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
33941
33959
|
ON memory_jobs(status, created_at)
|
|
@@ -33950,7 +33968,7 @@ function up1292(db) {
|
|
|
33950
33968
|
function tableExists32(db, table) {
|
|
33951
33969
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
33952
33970
|
}
|
|
33953
|
-
function
|
|
33971
|
+
function up1312(db) {
|
|
33954
33972
|
if (!tableExists32(db, "memory_jobs"))
|
|
33955
33973
|
return;
|
|
33956
33974
|
if (!tableExists32(db, "job_cancellations")) {
|
|
@@ -33999,7 +34017,7 @@ function up1302(db) {
|
|
|
33999
34017
|
AND status IN ('pending', 'leased');
|
|
34000
34018
|
`);
|
|
34001
34019
|
}
|
|
34002
|
-
function
|
|
34020
|
+
function up1322(db) {
|
|
34003
34021
|
db.exec(`
|
|
34004
34022
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
34005
34023
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -34039,7 +34057,7 @@ function up1312(db) {
|
|
|
34039
34057
|
END;
|
|
34040
34058
|
`);
|
|
34041
34059
|
}
|
|
34042
|
-
function
|
|
34060
|
+
function up1332(db) {
|
|
34043
34061
|
db.exec(`
|
|
34044
34062
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
34045
34063
|
agent_id TEXT NOT NULL,
|
|
@@ -34062,13 +34080,13 @@ function up1322(db) {
|
|
|
34062
34080
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
34063
34081
|
`);
|
|
34064
34082
|
}
|
|
34065
|
-
function
|
|
34083
|
+
function up1342(db) {
|
|
34066
34084
|
db.exec(`
|
|
34067
34085
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
34068
34086
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
34069
34087
|
`);
|
|
34070
34088
|
}
|
|
34071
|
-
function
|
|
34089
|
+
function up1352(db) {
|
|
34072
34090
|
db.exec(`
|
|
34073
34091
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
34074
34092
|
id TEXT PRIMARY KEY,
|
|
@@ -34120,7 +34138,7 @@ function up1342(db) {
|
|
|
34120
34138
|
if (!names.has("format_version"))
|
|
34121
34139
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
34122
34140
|
}
|
|
34123
|
-
function
|
|
34141
|
+
function up1362(db) {
|
|
34124
34142
|
db.exec(`
|
|
34125
34143
|
CREATE TABLE memory_head_entries_v134 (
|
|
34126
34144
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -34138,7 +34156,7 @@ function up1352(db) {
|
|
|
34138
34156
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
34139
34157
|
`);
|
|
34140
34158
|
}
|
|
34141
|
-
function
|
|
34159
|
+
function up1372(db) {
|
|
34142
34160
|
db.exec(`
|
|
34143
34161
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
34144
34162
|
agent_id TEXT NOT NULL,
|
|
@@ -34154,7 +34172,7 @@ function up1362(db) {
|
|
|
34154
34172
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
34155
34173
|
`);
|
|
34156
34174
|
}
|
|
34157
|
-
function
|
|
34175
|
+
function up1382(db) {
|
|
34158
34176
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r3) => r3.name));
|
|
34159
34177
|
for (const [name, type] of [
|
|
34160
34178
|
["entry_id", "TEXT"],
|
|
@@ -34168,7 +34186,7 @@ function up1372(db) {
|
|
|
34168
34186
|
}
|
|
34169
34187
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
34170
34188
|
}
|
|
34171
|
-
function
|
|
34189
|
+
function up1392(db) {
|
|
34172
34190
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r3) => r3.name));
|
|
34173
34191
|
for (const [name, type] of [
|
|
34174
34192
|
["head_revision", "INTEGER"],
|
|
@@ -34190,7 +34208,7 @@ function addColumnIfMissing272(db, table, column, definition) {
|
|
|
34190
34208
|
if (!hasColumn252(db, table, column))
|
|
34191
34209
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34192
34210
|
}
|
|
34193
|
-
function
|
|
34211
|
+
function up1402(db) {
|
|
34194
34212
|
addColumnIfMissing272(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
34195
34213
|
db.exec(`
|
|
34196
34214
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -34495,7 +34513,7 @@ function up1392(db) {
|
|
|
34495
34513
|
GROUP BY j.agent_id;
|
|
34496
34514
|
`);
|
|
34497
34515
|
}
|
|
34498
|
-
function
|
|
34516
|
+
function up1412(db) {
|
|
34499
34517
|
db.exec(`
|
|
34500
34518
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
34501
34519
|
agent_id TEXT NOT NULL,
|
|
@@ -34511,7 +34529,7 @@ function up1402(db) {
|
|
|
34511
34529
|
ON native_source_sync_state(agent_id, status);
|
|
34512
34530
|
`);
|
|
34513
34531
|
}
|
|
34514
|
-
function
|
|
34532
|
+
function up1422(db) {
|
|
34515
34533
|
db.exec(`
|
|
34516
34534
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
34517
34535
|
agent_id TEXT NOT NULL,
|
|
@@ -34523,7 +34541,7 @@ function up1412(db) {
|
|
|
34523
34541
|
);
|
|
34524
34542
|
`);
|
|
34525
34543
|
}
|
|
34526
|
-
function
|
|
34544
|
+
function up1432(db) {
|
|
34527
34545
|
db.exec(`
|
|
34528
34546
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
34529
34547
|
agent_id TEXT NOT NULL,
|
|
@@ -34537,13 +34555,13 @@ function up1422(db) {
|
|
|
34537
34555
|
);
|
|
34538
34556
|
`);
|
|
34539
34557
|
}
|
|
34540
|
-
function
|
|
34558
|
+
function up1442(db) {
|
|
34541
34559
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
34542
34560
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
34543
34561
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
34544
34562
|
}
|
|
34545
34563
|
}
|
|
34546
|
-
function
|
|
34564
|
+
function up1452(db) {
|
|
34547
34565
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34548
34566
|
const additions = [
|
|
34549
34567
|
["migration_phase", "TEXT"],
|
|
@@ -34578,13 +34596,13 @@ function up1442(db) {
|
|
|
34578
34596
|
`);
|
|
34579
34597
|
}
|
|
34580
34598
|
}
|
|
34581
|
-
function
|
|
34599
|
+
function up1462(db) {
|
|
34582
34600
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34583
34601
|
if (!columns.has("lease_token")) {
|
|
34584
34602
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
34585
34603
|
}
|
|
34586
34604
|
}
|
|
34587
|
-
function
|
|
34605
|
+
function up1472(db) {
|
|
34588
34606
|
db.exec(`
|
|
34589
34607
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
34590
34608
|
agent_id TEXT NOT NULL,
|
|
@@ -34602,7 +34620,7 @@ function up1462(db) {
|
|
|
34602
34620
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
34603
34621
|
`);
|
|
34604
34622
|
}
|
|
34605
|
-
function
|
|
34623
|
+
function up1482(db) {
|
|
34606
34624
|
db.exec(`
|
|
34607
34625
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
34608
34626
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -34669,16 +34687,16 @@ function up1472(db) {
|
|
|
34669
34687
|
}
|
|
34670
34688
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
34671
34689
|
}
|
|
34672
|
-
function
|
|
34690
|
+
function up1492(db) {
|
|
34673
34691
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
34674
34692
|
}
|
|
34675
|
-
function
|
|
34693
|
+
function up1502(db) {
|
|
34676
34694
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
34677
34695
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
34678
34696
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
34679
34697
|
}
|
|
34680
34698
|
}
|
|
34681
|
-
function
|
|
34699
|
+
function up1512(db) {
|
|
34682
34700
|
const addColumn = (table, column, definition) => {
|
|
34683
34701
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
34684
34702
|
let exists;
|
|
@@ -34699,7 +34717,7 @@ function addColumnIfMissing282(db, table, column, definition) {
|
|
|
34699
34717
|
if (!columns.some((row) => row.name === column))
|
|
34700
34718
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34701
34719
|
}
|
|
34702
|
-
function
|
|
34720
|
+
function up1522(db) {
|
|
34703
34721
|
addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
34704
34722
|
addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
34705
34723
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -34853,13 +34871,13 @@ var MIGRATIONS2 = [
|
|
|
34853
34871
|
{
|
|
34854
34872
|
version: 1,
|
|
34855
34873
|
name: "baseline",
|
|
34856
|
-
up:
|
|
34874
|
+
up: up310,
|
|
34857
34875
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
34858
34876
|
},
|
|
34859
34877
|
{
|
|
34860
34878
|
version: 2,
|
|
34861
34879
|
name: "pipeline-v2",
|
|
34862
|
-
up:
|
|
34880
|
+
up: up410,
|
|
34863
34881
|
artifacts: {
|
|
34864
34882
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
34865
34883
|
}
|
|
@@ -34867,12 +34885,12 @@ var MIGRATIONS2 = [
|
|
|
34867
34885
|
{
|
|
34868
34886
|
version: 3,
|
|
34869
34887
|
name: "unique-content-hash",
|
|
34870
|
-
up:
|
|
34888
|
+
up: up510
|
|
34871
34889
|
},
|
|
34872
34890
|
{
|
|
34873
34891
|
version: 4,
|
|
34874
34892
|
name: "history-actor-and-retention",
|
|
34875
|
-
up:
|
|
34893
|
+
up: up610,
|
|
34876
34894
|
artifacts: {
|
|
34877
34895
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
34878
34896
|
}
|
|
@@ -34880,7 +34898,7 @@ var MIGRATIONS2 = [
|
|
|
34880
34898
|
{
|
|
34881
34899
|
version: 5,
|
|
34882
34900
|
name: "graph-extended",
|
|
34883
|
-
up:
|
|
34901
|
+
up: up710,
|
|
34884
34902
|
artifacts: {
|
|
34885
34903
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
34886
34904
|
}
|
|
@@ -34888,7 +34906,7 @@ var MIGRATIONS2 = [
|
|
|
34888
34906
|
{
|
|
34889
34907
|
version: 6,
|
|
34890
34908
|
name: "idempotency-key",
|
|
34891
|
-
up:
|
|
34909
|
+
up: up810,
|
|
34892
34910
|
artifacts: {
|
|
34893
34911
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
34894
34912
|
}
|
|
@@ -34896,42 +34914,42 @@ var MIGRATIONS2 = [
|
|
|
34896
34914
|
{
|
|
34897
34915
|
version: 7,
|
|
34898
34916
|
name: "documents-and-connectors",
|
|
34899
|
-
up:
|
|
34917
|
+
up: up910,
|
|
34900
34918
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
34901
34919
|
},
|
|
34902
34920
|
{
|
|
34903
34921
|
version: 8,
|
|
34904
34922
|
name: "embeddings-unique-hash",
|
|
34905
|
-
up:
|
|
34923
|
+
up: up1010
|
|
34906
34924
|
},
|
|
34907
34925
|
{
|
|
34908
34926
|
version: 9,
|
|
34909
34927
|
name: "summary-jobs",
|
|
34910
|
-
up:
|
|
34928
|
+
up: up1110,
|
|
34911
34929
|
artifacts: { tables: ["summary_jobs"] }
|
|
34912
34930
|
},
|
|
34913
34931
|
{
|
|
34914
34932
|
version: 10,
|
|
34915
34933
|
name: "umap-cache",
|
|
34916
|
-
up:
|
|
34934
|
+
up: up1210,
|
|
34917
34935
|
artifacts: { tables: ["umap_cache"] }
|
|
34918
34936
|
},
|
|
34919
34937
|
{
|
|
34920
34938
|
version: 11,
|
|
34921
34939
|
name: "session-scores",
|
|
34922
|
-
up:
|
|
34940
|
+
up: up1310,
|
|
34923
34941
|
artifacts: { tables: ["session_scores"] }
|
|
34924
34942
|
},
|
|
34925
34943
|
{
|
|
34926
34944
|
version: 12,
|
|
34927
34945
|
name: "scheduled-tasks",
|
|
34928
|
-
up:
|
|
34946
|
+
up: up1410,
|
|
34929
34947
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
34930
34948
|
},
|
|
34931
34949
|
{
|
|
34932
34950
|
version: 13,
|
|
34933
34951
|
name: "ingestion-tracking",
|
|
34934
|
-
up:
|
|
34952
|
+
up: up154,
|
|
34935
34953
|
artifacts: {
|
|
34936
34954
|
columns: [
|
|
34937
34955
|
{ table: "memories", column: "source_path" },
|
|
@@ -34942,13 +34960,13 @@ var MIGRATIONS2 = [
|
|
|
34942
34960
|
{
|
|
34943
34961
|
version: 14,
|
|
34944
34962
|
name: "telemetry",
|
|
34945
|
-
up:
|
|
34963
|
+
up: up162,
|
|
34946
34964
|
artifacts: { tables: ["telemetry_events"] }
|
|
34947
34965
|
},
|
|
34948
34966
|
{
|
|
34949
34967
|
version: 15,
|
|
34950
34968
|
name: "session-memories",
|
|
34951
|
-
up:
|
|
34969
|
+
up: up172,
|
|
34952
34970
|
artifacts: {
|
|
34953
34971
|
tables: ["session_memories"],
|
|
34954
34972
|
columns: [
|
|
@@ -34960,13 +34978,13 @@ var MIGRATIONS2 = [
|
|
|
34960
34978
|
{
|
|
34961
34979
|
version: 16,
|
|
34962
34980
|
name: "session-checkpoints",
|
|
34963
|
-
up:
|
|
34981
|
+
up: up182,
|
|
34964
34982
|
artifacts: { tables: ["session_checkpoints"] }
|
|
34965
34983
|
},
|
|
34966
34984
|
{
|
|
34967
34985
|
version: 17,
|
|
34968
34986
|
name: "task-skills",
|
|
34969
|
-
up:
|
|
34987
|
+
up: up192,
|
|
34970
34988
|
artifacts: {
|
|
34971
34989
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
34972
34990
|
}
|
|
@@ -34974,13 +34992,13 @@ var MIGRATIONS2 = [
|
|
|
34974
34992
|
{
|
|
34975
34993
|
version: 18,
|
|
34976
34994
|
name: "skill-meta",
|
|
34977
|
-
up:
|
|
34995
|
+
up: up202,
|
|
34978
34996
|
artifacts: { tables: ["skill_meta"] }
|
|
34979
34997
|
},
|
|
34980
34998
|
{
|
|
34981
34999
|
version: 19,
|
|
34982
35000
|
name: "knowledge-structure",
|
|
34983
|
-
up:
|
|
35001
|
+
up: up212,
|
|
34984
35002
|
artifacts: {
|
|
34985
35003
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
34986
35004
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -34989,7 +35007,7 @@ var MIGRATIONS2 = [
|
|
|
34989
35007
|
{
|
|
34990
35008
|
version: 20,
|
|
34991
35009
|
name: "session-structural-columns",
|
|
34992
|
-
up:
|
|
35010
|
+
up: up222,
|
|
34993
35011
|
artifacts: {
|
|
34994
35012
|
columns: [
|
|
34995
35013
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -35002,7 +35020,7 @@ var MIGRATIONS2 = [
|
|
|
35002
35020
|
{
|
|
35003
35021
|
version: 21,
|
|
35004
35022
|
name: "checkpoint-structural",
|
|
35005
|
-
up:
|
|
35023
|
+
up: up232,
|
|
35006
35024
|
artifacts: {
|
|
35007
35025
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
35008
35026
|
}
|
|
@@ -35010,7 +35028,7 @@ var MIGRATIONS2 = [
|
|
|
35010
35028
|
{
|
|
35011
35029
|
version: 22,
|
|
35012
35030
|
name: "entity-pinning",
|
|
35013
|
-
up:
|
|
35031
|
+
up: up242,
|
|
35014
35032
|
artifacts: {
|
|
35015
35033
|
columns: [
|
|
35016
35034
|
{ table: "entities", column: "pinned" },
|
|
@@ -35021,17 +35039,17 @@ var MIGRATIONS2 = [
|
|
|
35021
35039
|
{
|
|
35022
35040
|
version: 23,
|
|
35023
35041
|
name: "retired-scorer-gap",
|
|
35024
|
-
up:
|
|
35042
|
+
up: up252
|
|
35025
35043
|
},
|
|
35026
35044
|
{
|
|
35027
35045
|
version: 24,
|
|
35028
35046
|
name: "retired-scorer-gap",
|
|
35029
|
-
up:
|
|
35047
|
+
up: up262
|
|
35030
35048
|
},
|
|
35031
35049
|
{
|
|
35032
35050
|
version: 25,
|
|
35033
35051
|
name: "agent-feedback",
|
|
35034
|
-
up:
|
|
35052
|
+
up: up272,
|
|
35035
35053
|
artifacts: {
|
|
35036
35054
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
35037
35055
|
}
|
|
@@ -35039,32 +35057,32 @@ var MIGRATIONS2 = [
|
|
|
35039
35057
|
{
|
|
35040
35058
|
version: 26,
|
|
35041
35059
|
name: "retired-scorer-gap",
|
|
35042
|
-
up:
|
|
35060
|
+
up: up282
|
|
35043
35061
|
},
|
|
35044
35062
|
{
|
|
35045
35063
|
version: 27,
|
|
35046
35064
|
name: "backfill-canonical-names",
|
|
35047
|
-
up:
|
|
35065
|
+
up: up292
|
|
35048
35066
|
},
|
|
35049
35067
|
{
|
|
35050
35068
|
version: 28,
|
|
35051
35069
|
name: "lossless-retention",
|
|
35052
|
-
up:
|
|
35070
|
+
up: up302
|
|
35053
35071
|
},
|
|
35054
35072
|
{
|
|
35055
35073
|
version: 29,
|
|
35056
35074
|
name: "session-summary-dag",
|
|
35057
|
-
up:
|
|
35075
|
+
up: up312
|
|
35058
35076
|
},
|
|
35059
35077
|
{
|
|
35060
35078
|
version: 30,
|
|
35061
35079
|
name: "nullable-memory-job-memory-id",
|
|
35062
|
-
up:
|
|
35080
|
+
up: up322
|
|
35063
35081
|
},
|
|
35064
35082
|
{
|
|
35065
35083
|
version: 31,
|
|
35066
35084
|
name: "dependency-reason",
|
|
35067
|
-
up:
|
|
35085
|
+
up: up332,
|
|
35068
35086
|
artifacts: {
|
|
35069
35087
|
columns: [
|
|
35070
35088
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -35075,7 +35093,7 @@ var MIGRATIONS2 = [
|
|
|
35075
35093
|
{
|
|
35076
35094
|
version: 32,
|
|
35077
35095
|
name: "embeddings-vector-column",
|
|
35078
|
-
up:
|
|
35096
|
+
up: up342,
|
|
35079
35097
|
artifacts: {
|
|
35080
35098
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
35081
35099
|
}
|
|
@@ -35083,7 +35101,7 @@ var MIGRATIONS2 = [
|
|
|
35083
35101
|
{
|
|
35084
35102
|
version: 33,
|
|
35085
35103
|
name: "scope",
|
|
35086
|
-
up:
|
|
35104
|
+
up: up352,
|
|
35087
35105
|
artifacts: {
|
|
35088
35106
|
columns: [{ table: "memories", column: "scope" }]
|
|
35089
35107
|
}
|
|
@@ -35091,17 +35109,17 @@ var MIGRATIONS2 = [
|
|
|
35091
35109
|
{
|
|
35092
35110
|
version: 34,
|
|
35093
35111
|
name: "scope-aware-dedup",
|
|
35094
|
-
up:
|
|
35112
|
+
up: up362
|
|
35095
35113
|
},
|
|
35096
35114
|
{
|
|
35097
35115
|
version: 35,
|
|
35098
35116
|
name: "entity-fts",
|
|
35099
|
-
up:
|
|
35117
|
+
up: up372
|
|
35100
35118
|
},
|
|
35101
35119
|
{
|
|
35102
35120
|
version: 36,
|
|
35103
35121
|
name: "dependency-confidence",
|
|
35104
|
-
up:
|
|
35122
|
+
up: up382,
|
|
35105
35123
|
artifacts: {
|
|
35106
35124
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
35107
35125
|
}
|
|
@@ -35109,7 +35127,7 @@ var MIGRATIONS2 = [
|
|
|
35109
35127
|
{
|
|
35110
35128
|
version: 37,
|
|
35111
35129
|
name: "entity-communities",
|
|
35112
|
-
up:
|
|
35130
|
+
up: up392,
|
|
35113
35131
|
artifacts: {
|
|
35114
35132
|
tables: ["entity_communities"],
|
|
35115
35133
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -35118,24 +35136,24 @@ var MIGRATIONS2 = [
|
|
|
35118
35136
|
{
|
|
35119
35137
|
version: 38,
|
|
35120
35138
|
name: "memory-hints",
|
|
35121
|
-
up:
|
|
35139
|
+
up: up402,
|
|
35122
35140
|
artifacts: { tables: ["memory_hints"] }
|
|
35123
35141
|
},
|
|
35124
35142
|
{
|
|
35125
35143
|
version: 39,
|
|
35126
35144
|
name: "dedup-entity-dependencies",
|
|
35127
|
-
up:
|
|
35145
|
+
up: up412
|
|
35128
35146
|
},
|
|
35129
35147
|
{
|
|
35130
35148
|
version: 40,
|
|
35131
35149
|
name: "session-transcripts",
|
|
35132
|
-
up:
|
|
35150
|
+
up: up422,
|
|
35133
35151
|
artifacts: { tables: ["session_transcripts"] }
|
|
35134
35152
|
},
|
|
35135
35153
|
{
|
|
35136
35154
|
version: 41,
|
|
35137
35155
|
name: "path-feedback",
|
|
35138
|
-
up:
|
|
35156
|
+
up: up432,
|
|
35139
35157
|
artifacts: {
|
|
35140
35158
|
tables: [
|
|
35141
35159
|
"path_feedback_events",
|
|
@@ -35150,7 +35168,7 @@ var MIGRATIONS2 = [
|
|
|
35150
35168
|
{
|
|
35151
35169
|
version: 42,
|
|
35152
35170
|
name: "session-memories-agent-id",
|
|
35153
|
-
up:
|
|
35171
|
+
up: up442,
|
|
35154
35172
|
artifacts: {
|
|
35155
35173
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
35156
35174
|
}
|
|
@@ -35158,7 +35176,7 @@ var MIGRATIONS2 = [
|
|
|
35158
35176
|
{
|
|
35159
35177
|
version: 43,
|
|
35160
35178
|
name: "agents-table",
|
|
35161
|
-
up:
|
|
35179
|
+
up: up452,
|
|
35162
35180
|
artifacts: {
|
|
35163
35181
|
tables: ["agents"],
|
|
35164
35182
|
columns: [
|
|
@@ -35170,7 +35188,7 @@ var MIGRATIONS2 = [
|
|
|
35170
35188
|
{
|
|
35171
35189
|
version: 44,
|
|
35172
35190
|
name: "memory-md-temporal-head",
|
|
35173
|
-
up:
|
|
35191
|
+
up: up462,
|
|
35174
35192
|
artifacts: {
|
|
35175
35193
|
columns: [
|
|
35176
35194
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -35182,7 +35200,7 @@ var MIGRATIONS2 = [
|
|
|
35182
35200
|
{
|
|
35183
35201
|
version: 45,
|
|
35184
35202
|
name: "lossless-working-memory-hardening",
|
|
35185
|
-
up:
|
|
35203
|
+
up: up472,
|
|
35186
35204
|
artifacts: {
|
|
35187
35205
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
35188
35206
|
columns: [
|
|
@@ -35195,17 +35213,17 @@ var MIGRATIONS2 = [
|
|
|
35195
35213
|
{
|
|
35196
35214
|
version: 46,
|
|
35197
35215
|
name: "session-summary-uniqueness",
|
|
35198
|
-
up:
|
|
35216
|
+
up: up482
|
|
35199
35217
|
},
|
|
35200
35218
|
{
|
|
35201
35219
|
version: 47,
|
|
35202
35220
|
name: "agent-scoped-temporal-uniqueness",
|
|
35203
|
-
up:
|
|
35221
|
+
up: up492
|
|
35204
35222
|
},
|
|
35205
35223
|
{
|
|
35206
35224
|
version: 48,
|
|
35207
35225
|
name: "thread-heads",
|
|
35208
|
-
up:
|
|
35226
|
+
up: up502,
|
|
35209
35227
|
artifacts: {
|
|
35210
35228
|
tables: ["memory_thread_heads"]
|
|
35211
35229
|
}
|
|
@@ -35213,7 +35231,7 @@ var MIGRATIONS2 = [
|
|
|
35213
35231
|
{
|
|
35214
35232
|
version: 49,
|
|
35215
35233
|
name: "session-extract-cursors",
|
|
35216
|
-
up:
|
|
35234
|
+
up: up512,
|
|
35217
35235
|
artifacts: {
|
|
35218
35236
|
tables: ["session_extract_cursors"]
|
|
35219
35237
|
}
|
|
@@ -35221,7 +35239,7 @@ var MIGRATIONS2 = [
|
|
|
35221
35239
|
{
|
|
35222
35240
|
version: 50,
|
|
35223
35241
|
name: "related-to-audit",
|
|
35224
|
-
up:
|
|
35242
|
+
up: up522,
|
|
35225
35243
|
artifacts: {
|
|
35226
35244
|
tables: ["entity_dependency_history"]
|
|
35227
35245
|
}
|
|
@@ -35229,7 +35247,7 @@ var MIGRATIONS2 = [
|
|
|
35229
35247
|
{
|
|
35230
35248
|
version: 51,
|
|
35231
35249
|
name: "memory-md-rolling-window-lineage",
|
|
35232
|
-
up:
|
|
35250
|
+
up: up532,
|
|
35233
35251
|
artifacts: {
|
|
35234
35252
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
35235
35253
|
columns: [
|
|
@@ -35244,7 +35262,7 @@ var MIGRATIONS2 = [
|
|
|
35244
35262
|
{
|
|
35245
35263
|
version: 52,
|
|
35246
35264
|
name: "mcp-invocations",
|
|
35247
|
-
up:
|
|
35265
|
+
up: up542,
|
|
35248
35266
|
artifacts: {
|
|
35249
35267
|
tables: ["mcp_invocations"]
|
|
35250
35268
|
}
|
|
@@ -35252,7 +35270,7 @@ var MIGRATIONS2 = [
|
|
|
35252
35270
|
{
|
|
35253
35271
|
version: 53,
|
|
35254
35272
|
name: "skill-invocations",
|
|
35255
|
-
up:
|
|
35273
|
+
up: up552,
|
|
35256
35274
|
artifacts: {
|
|
35257
35275
|
tables: ["skill_invocations"]
|
|
35258
35276
|
}
|
|
@@ -35260,7 +35278,7 @@ var MIGRATIONS2 = [
|
|
|
35260
35278
|
{
|
|
35261
35279
|
version: 54,
|
|
35262
35280
|
name: "task-agent-scope",
|
|
35263
|
-
up:
|
|
35281
|
+
up: up562,
|
|
35264
35282
|
artifacts: {
|
|
35265
35283
|
tables: ["task_scope_hints"]
|
|
35266
35284
|
}
|
|
@@ -35268,7 +35286,7 @@ var MIGRATIONS2 = [
|
|
|
35268
35286
|
{
|
|
35269
35287
|
version: 55,
|
|
35270
35288
|
name: "dreaming-state",
|
|
35271
|
-
up:
|
|
35289
|
+
up: up572,
|
|
35272
35290
|
artifacts: {
|
|
35273
35291
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
35274
35292
|
}
|
|
@@ -35276,22 +35294,22 @@ var MIGRATIONS2 = [
|
|
|
35276
35294
|
{
|
|
35277
35295
|
version: 56,
|
|
35278
35296
|
name: "agent-scoped-content-hash",
|
|
35279
|
-
up:
|
|
35297
|
+
up: up582
|
|
35280
35298
|
},
|
|
35281
35299
|
{
|
|
35282
35300
|
version: 57,
|
|
35283
35301
|
name: "memories-fts-tokenizer-repair",
|
|
35284
|
-
up:
|
|
35302
|
+
up: up592
|
|
35285
35303
|
},
|
|
35286
35304
|
{
|
|
35287
35305
|
version: 58,
|
|
35288
35306
|
name: "knowledge-graph-indices",
|
|
35289
|
-
up:
|
|
35307
|
+
up: up602
|
|
35290
35308
|
},
|
|
35291
35309
|
{
|
|
35292
35310
|
version: 59,
|
|
35293
35311
|
name: "entity-attribute-claim-key",
|
|
35294
|
-
up:
|
|
35312
|
+
up: up612,
|
|
35295
35313
|
artifacts: {
|
|
35296
35314
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
35297
35315
|
}
|
|
@@ -35299,7 +35317,7 @@ var MIGRATIONS2 = [
|
|
|
35299
35317
|
{
|
|
35300
35318
|
version: 60,
|
|
35301
35319
|
name: "entity-attribute-group-key",
|
|
35302
|
-
up:
|
|
35320
|
+
up: up622,
|
|
35303
35321
|
artifacts: {
|
|
35304
35322
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
35305
35323
|
}
|
|
@@ -35307,7 +35325,7 @@ var MIGRATIONS2 = [
|
|
|
35307
35325
|
{
|
|
35308
35326
|
version: 61,
|
|
35309
35327
|
name: "memory-artifact-source-mtime",
|
|
35310
|
-
up:
|
|
35328
|
+
up: up632,
|
|
35311
35329
|
artifacts: {
|
|
35312
35330
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
35313
35331
|
}
|
|
@@ -35315,7 +35333,7 @@ var MIGRATIONS2 = [
|
|
|
35315
35333
|
{
|
|
35316
35334
|
version: 62,
|
|
35317
35335
|
name: "memory-artifact-soft-delete",
|
|
35318
|
-
up:
|
|
35336
|
+
up: up642,
|
|
35319
35337
|
artifacts: {
|
|
35320
35338
|
columns: [
|
|
35321
35339
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -35326,12 +35344,12 @@ var MIGRATIONS2 = [
|
|
|
35326
35344
|
{
|
|
35327
35345
|
version: 63,
|
|
35328
35346
|
name: "content-only-memories-fts-update",
|
|
35329
|
-
up:
|
|
35347
|
+
up: up652
|
|
35330
35348
|
},
|
|
35331
35349
|
{
|
|
35332
35350
|
version: 64,
|
|
35333
35351
|
name: "source-graph-provenance",
|
|
35334
|
-
up:
|
|
35352
|
+
up: up662,
|
|
35335
35353
|
artifacts: {
|
|
35336
35354
|
columns: [
|
|
35337
35355
|
{ table: "entities", column: "source_path" },
|
|
@@ -35344,7 +35362,7 @@ var MIGRATIONS2 = [
|
|
|
35344
35362
|
{
|
|
35345
35363
|
version: 65,
|
|
35346
35364
|
name: "source-embedding-agent-scope",
|
|
35347
|
-
up:
|
|
35365
|
+
up: up672,
|
|
35348
35366
|
artifacts: {
|
|
35349
35367
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
35350
35368
|
}
|
|
@@ -35352,7 +35370,7 @@ var MIGRATIONS2 = [
|
|
|
35352
35370
|
{
|
|
35353
35371
|
version: 66,
|
|
35354
35372
|
name: "memory-search-telemetry",
|
|
35355
|
-
up:
|
|
35373
|
+
up: up682,
|
|
35356
35374
|
artifacts: {
|
|
35357
35375
|
tables: ["memory_search_telemetry"]
|
|
35358
35376
|
}
|
|
@@ -35360,7 +35378,7 @@ var MIGRATIONS2 = [
|
|
|
35360
35378
|
{
|
|
35361
35379
|
version: 67,
|
|
35362
35380
|
name: "ontology-proposals",
|
|
35363
|
-
up:
|
|
35381
|
+
up: up692,
|
|
35364
35382
|
artifacts: {
|
|
35365
35383
|
tables: ["ontology_proposals"],
|
|
35366
35384
|
columns: [
|
|
@@ -35374,7 +35392,7 @@ var MIGRATIONS2 = [
|
|
|
35374
35392
|
{
|
|
35375
35393
|
version: 68,
|
|
35376
35394
|
name: "daily-reflections",
|
|
35377
|
-
up:
|
|
35395
|
+
up: up702,
|
|
35378
35396
|
artifacts: {
|
|
35379
35397
|
tables: ["daily_reflections"]
|
|
35380
35398
|
}
|
|
@@ -35382,7 +35400,7 @@ var MIGRATIONS2 = [
|
|
|
35382
35400
|
{
|
|
35383
35401
|
version: 69,
|
|
35384
35402
|
name: "daily-reflections-multiple-insights",
|
|
35385
|
-
up:
|
|
35403
|
+
up: up712,
|
|
35386
35404
|
artifacts: {
|
|
35387
35405
|
tables: ["daily_reflections"]
|
|
35388
35406
|
}
|
|
@@ -35390,7 +35408,7 @@ var MIGRATIONS2 = [
|
|
|
35390
35408
|
{
|
|
35391
35409
|
version: 70,
|
|
35392
35410
|
name: "ontology-control-plane-state",
|
|
35393
|
-
up:
|
|
35411
|
+
up: up722,
|
|
35394
35412
|
artifacts: {
|
|
35395
35413
|
columns: [
|
|
35396
35414
|
{ table: "entities", column: "status" },
|
|
@@ -35405,7 +35423,7 @@ var MIGRATIONS2 = [
|
|
|
35405
35423
|
{
|
|
35406
35424
|
version: 71,
|
|
35407
35425
|
name: "epistemic-assertions",
|
|
35408
|
-
up:
|
|
35426
|
+
up: up732,
|
|
35409
35427
|
artifacts: {
|
|
35410
35428
|
tables: ["epistemic_assertions"]
|
|
35411
35429
|
}
|
|
@@ -35413,7 +35431,7 @@ var MIGRATIONS2 = [
|
|
|
35413
35431
|
{
|
|
35414
35432
|
version: 72,
|
|
35415
35433
|
name: "agent-scoped-idempotency-key",
|
|
35416
|
-
up:
|
|
35434
|
+
up: up742,
|
|
35417
35435
|
artifacts: {
|
|
35418
35436
|
columns: [
|
|
35419
35437
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -35424,7 +35442,7 @@ var MIGRATIONS2 = [
|
|
|
35424
35442
|
{
|
|
35425
35443
|
version: 73,
|
|
35426
35444
|
name: "recall-context-dedupe",
|
|
35427
|
-
up:
|
|
35445
|
+
up: up752,
|
|
35428
35446
|
artifacts: {
|
|
35429
35447
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
35430
35448
|
}
|
|
@@ -35432,7 +35450,7 @@ var MIGRATIONS2 = [
|
|
|
35432
35450
|
{
|
|
35433
35451
|
version: 74,
|
|
35434
35452
|
name: "aggregate-memory-links",
|
|
35435
|
-
up:
|
|
35453
|
+
up: up762,
|
|
35436
35454
|
artifacts: {
|
|
35437
35455
|
tables: ["aggregate_memory_sources"]
|
|
35438
35456
|
}
|
|
@@ -35440,7 +35458,7 @@ var MIGRATIONS2 = [
|
|
|
35440
35458
|
{
|
|
35441
35459
|
version: 75,
|
|
35442
35460
|
name: "memory-artifact-source-provenance",
|
|
35443
|
-
up:
|
|
35461
|
+
up: up772,
|
|
35444
35462
|
artifacts: {
|
|
35445
35463
|
columns: [
|
|
35446
35464
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -35454,7 +35472,7 @@ var MIGRATIONS2 = [
|
|
|
35454
35472
|
{
|
|
35455
35473
|
version: 76,
|
|
35456
35474
|
name: "temporal-edges",
|
|
35457
|
-
up:
|
|
35475
|
+
up: up782,
|
|
35458
35476
|
artifacts: {
|
|
35459
35477
|
tables: ["temporal_edges"]
|
|
35460
35478
|
}
|
|
@@ -35462,7 +35480,7 @@ var MIGRATIONS2 = [
|
|
|
35462
35480
|
{
|
|
35463
35481
|
version: 77,
|
|
35464
35482
|
name: "entity-aliases",
|
|
35465
|
-
up:
|
|
35483
|
+
up: up792,
|
|
35466
35484
|
artifacts: {
|
|
35467
35485
|
tables: ["entity_aliases"]
|
|
35468
35486
|
}
|
|
@@ -35470,7 +35488,7 @@ var MIGRATIONS2 = [
|
|
|
35470
35488
|
{
|
|
35471
35489
|
version: 78,
|
|
35472
35490
|
name: "api-keys",
|
|
35473
|
-
up:
|
|
35491
|
+
up: up802,
|
|
35474
35492
|
artifacts: {
|
|
35475
35493
|
tables: ["api_keys"]
|
|
35476
35494
|
}
|
|
@@ -35478,7 +35496,7 @@ var MIGRATIONS2 = [
|
|
|
35478
35496
|
{
|
|
35479
35497
|
version: 79,
|
|
35480
35498
|
name: "transcript-capture-jobs",
|
|
35481
|
-
up:
|
|
35499
|
+
up: up812,
|
|
35482
35500
|
artifacts: {
|
|
35483
35501
|
tables: ["transcript_capture_jobs"]
|
|
35484
35502
|
}
|
|
@@ -35486,7 +35504,7 @@ var MIGRATIONS2 = [
|
|
|
35486
35504
|
{
|
|
35487
35505
|
version: 80,
|
|
35488
35506
|
name: "document-scope-columns",
|
|
35489
|
-
up:
|
|
35507
|
+
up: up822,
|
|
35490
35508
|
artifacts: {
|
|
35491
35509
|
columns: [
|
|
35492
35510
|
{ table: "documents", column: "agent_id" },
|
|
@@ -35497,7 +35515,7 @@ var MIGRATIONS2 = [
|
|
|
35497
35515
|
{
|
|
35498
35516
|
version: 81,
|
|
35499
35517
|
name: "aggregate-evidence-sources",
|
|
35500
|
-
up:
|
|
35518
|
+
up: up832,
|
|
35501
35519
|
artifacts: {
|
|
35502
35520
|
tables: ["aggregate_evidence_sources"]
|
|
35503
35521
|
}
|
|
@@ -35505,7 +35523,7 @@ var MIGRATIONS2 = [
|
|
|
35505
35523
|
{
|
|
35506
35524
|
version: 82,
|
|
35507
35525
|
name: "skill-invocations-harness",
|
|
35508
|
-
up:
|
|
35526
|
+
up: up842,
|
|
35509
35527
|
artifacts: {
|
|
35510
35528
|
columns: [
|
|
35511
35529
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -35516,7 +35534,7 @@ var MIGRATIONS2 = [
|
|
|
35516
35534
|
{
|
|
35517
35535
|
version: 83,
|
|
35518
35536
|
name: "memory-lifecycle-repair",
|
|
35519
|
-
up:
|
|
35537
|
+
up: up852,
|
|
35520
35538
|
artifacts: {
|
|
35521
35539
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
35522
35540
|
columns: [
|
|
@@ -35531,7 +35549,7 @@ var MIGRATIONS2 = [
|
|
|
35531
35549
|
{
|
|
35532
35550
|
version: 84,
|
|
35533
35551
|
name: "legacy-markdown-import-state",
|
|
35534
|
-
up:
|
|
35552
|
+
up: up862,
|
|
35535
35553
|
artifacts: {
|
|
35536
35554
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
35537
35555
|
}
|
|
@@ -35539,7 +35557,7 @@ var MIGRATIONS2 = [
|
|
|
35539
35557
|
{
|
|
35540
35558
|
version: 85,
|
|
35541
35559
|
name: "backfill-relations-to-dependencies",
|
|
35542
|
-
up:
|
|
35560
|
+
up: up872,
|
|
35543
35561
|
artifacts: {
|
|
35544
35562
|
tables: ["entity_dependencies"]
|
|
35545
35563
|
}
|
|
@@ -35547,7 +35565,7 @@ var MIGRATIONS2 = [
|
|
|
35547
35565
|
{
|
|
35548
35566
|
version: 86,
|
|
35549
35567
|
name: "summary-jobs-content-hash",
|
|
35550
|
-
up:
|
|
35568
|
+
up: up882,
|
|
35551
35569
|
artifacts: {
|
|
35552
35570
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
35553
35571
|
}
|
|
@@ -35555,7 +35573,7 @@ var MIGRATIONS2 = [
|
|
|
35555
35573
|
{
|
|
35556
35574
|
version: 87,
|
|
35557
35575
|
name: "summary-jobs-boundary-reason",
|
|
35558
|
-
up:
|
|
35576
|
+
up: up892,
|
|
35559
35577
|
artifacts: {
|
|
35560
35578
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
35561
35579
|
}
|
|
@@ -35563,7 +35581,7 @@ var MIGRATIONS2 = [
|
|
|
35563
35581
|
{
|
|
35564
35582
|
version: 88,
|
|
35565
35583
|
name: "transcript-recovery-files",
|
|
35566
|
-
up:
|
|
35584
|
+
up: up902,
|
|
35567
35585
|
artifacts: {
|
|
35568
35586
|
tables: ["transcript_recovery_files"]
|
|
35569
35587
|
}
|
|
@@ -35571,7 +35589,7 @@ var MIGRATIONS2 = [
|
|
|
35571
35589
|
{
|
|
35572
35590
|
version: 89,
|
|
35573
35591
|
name: "job-cancellations",
|
|
35574
|
-
up:
|
|
35592
|
+
up: up912,
|
|
35575
35593
|
artifacts: {
|
|
35576
35594
|
tables: ["job_cancellations"]
|
|
35577
35595
|
}
|
|
@@ -35579,7 +35597,7 @@ var MIGRATIONS2 = [
|
|
|
35579
35597
|
{
|
|
35580
35598
|
version: 90,
|
|
35581
35599
|
name: "job-archive",
|
|
35582
|
-
up:
|
|
35600
|
+
up: up922,
|
|
35583
35601
|
artifacts: {
|
|
35584
35602
|
tables: ["job_archive"]
|
|
35585
35603
|
}
|
|
@@ -35587,25 +35605,25 @@ var MIGRATIONS2 = [
|
|
|
35587
35605
|
{
|
|
35588
35606
|
version: 91,
|
|
35589
35607
|
name: "embedding-index-generations",
|
|
35590
|
-
up:
|
|
35608
|
+
up: up932,
|
|
35591
35609
|
artifacts: { tables: ["embedding_index_state"] }
|
|
35592
35610
|
},
|
|
35593
35611
|
{
|
|
35594
35612
|
version: 92,
|
|
35595
35613
|
name: "embedding-staging-store",
|
|
35596
|
-
up:
|
|
35614
|
+
up: up942,
|
|
35597
35615
|
artifacts: { tables: ["embeddings_staging"] }
|
|
35598
35616
|
},
|
|
35599
35617
|
{
|
|
35600
35618
|
version: 93,
|
|
35601
35619
|
name: "dreaming-evidence-cursor",
|
|
35602
|
-
up:
|
|
35620
|
+
up: up952,
|
|
35603
35621
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
35604
35622
|
},
|
|
35605
35623
|
{
|
|
35606
35624
|
version: 94,
|
|
35607
35625
|
name: "memory-kind",
|
|
35608
|
-
up:
|
|
35626
|
+
up: up962,
|
|
35609
35627
|
artifacts: {
|
|
35610
35628
|
columns: [
|
|
35611
35629
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -35616,35 +35634,35 @@ var MIGRATIONS2 = [
|
|
|
35616
35634
|
{
|
|
35617
35635
|
version: 95,
|
|
35618
35636
|
name: "compaction-recall-projections",
|
|
35619
|
-
up:
|
|
35637
|
+
up: up972
|
|
35620
35638
|
},
|
|
35621
35639
|
{
|
|
35622
35640
|
version: 96,
|
|
35623
35641
|
name: "retire-legacy-ingestion",
|
|
35624
|
-
up:
|
|
35642
|
+
up: up982
|
|
35625
35643
|
},
|
|
35626
35644
|
{
|
|
35627
35645
|
version: 97,
|
|
35628
35646
|
name: "dreaming-failure-backoff",
|
|
35629
|
-
up:
|
|
35647
|
+
up: up992,
|
|
35630
35648
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
35631
35649
|
},
|
|
35632
35650
|
{
|
|
35633
35651
|
version: 98,
|
|
35634
35652
|
name: "dreaming-evidence-exclusions",
|
|
35635
|
-
up:
|
|
35653
|
+
up: up1002,
|
|
35636
35654
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
35637
35655
|
},
|
|
35638
35656
|
{
|
|
35639
35657
|
version: 99,
|
|
35640
35658
|
name: "dreaming-tool-calls",
|
|
35641
|
-
up:
|
|
35659
|
+
up: up1012,
|
|
35642
35660
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
35643
35661
|
},
|
|
35644
35662
|
{
|
|
35645
35663
|
version: 100,
|
|
35646
35664
|
name: "dreaming-runbook",
|
|
35647
|
-
up:
|
|
35665
|
+
up: up1022,
|
|
35648
35666
|
artifacts: {
|
|
35649
35667
|
columns: [
|
|
35650
35668
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -35655,23 +35673,23 @@ var MIGRATIONS2 = [
|
|
|
35655
35673
|
{
|
|
35656
35674
|
version: 101,
|
|
35657
35675
|
name: "dreaming-attention",
|
|
35658
|
-
up:
|
|
35676
|
+
up: up1032,
|
|
35659
35677
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35660
35678
|
},
|
|
35661
35679
|
{
|
|
35662
35680
|
version: 102,
|
|
35663
35681
|
name: "attribute-semantic-memories",
|
|
35664
|
-
up:
|
|
35682
|
+
up: up1042
|
|
35665
35683
|
},
|
|
35666
35684
|
{
|
|
35667
35685
|
version: 103,
|
|
35668
35686
|
name: "semantic-memory-kind",
|
|
35669
|
-
up:
|
|
35687
|
+
up: up1052
|
|
35670
35688
|
},
|
|
35671
35689
|
{
|
|
35672
35690
|
version: 104,
|
|
35673
35691
|
name: "derived-memory-provenance",
|
|
35674
|
-
up:
|
|
35692
|
+
up: up1062,
|
|
35675
35693
|
artifacts: {
|
|
35676
35694
|
tables: ["derived_memory_sources"],
|
|
35677
35695
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -35680,12 +35698,12 @@ var MIGRATIONS2 = [
|
|
|
35680
35698
|
{
|
|
35681
35699
|
version: 105,
|
|
35682
35700
|
name: "agent-scoped-entity-name",
|
|
35683
|
-
up:
|
|
35701
|
+
up: up1072
|
|
35684
35702
|
},
|
|
35685
35703
|
{
|
|
35686
35704
|
version: 106,
|
|
35687
35705
|
name: "memory-review-after",
|
|
35688
|
-
up:
|
|
35706
|
+
up: up1082,
|
|
35689
35707
|
artifacts: {
|
|
35690
35708
|
columns: [{ table: "memories", column: "review_after" }]
|
|
35691
35709
|
}
|
|
@@ -35693,7 +35711,7 @@ var MIGRATIONS2 = [
|
|
|
35693
35711
|
{
|
|
35694
35712
|
version: 107,
|
|
35695
35713
|
name: "dreaming-pass-usage",
|
|
35696
|
-
up:
|
|
35714
|
+
up: up1092,
|
|
35697
35715
|
artifacts: {
|
|
35698
35716
|
columns: [
|
|
35699
35717
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -35707,7 +35725,7 @@ var MIGRATIONS2 = [
|
|
|
35707
35725
|
{
|
|
35708
35726
|
version: 108,
|
|
35709
35727
|
name: "embedding-usage",
|
|
35710
|
-
up:
|
|
35728
|
+
up: up1102,
|
|
35711
35729
|
artifacts: {
|
|
35712
35730
|
tables: ["embedding_usage"]
|
|
35713
35731
|
}
|
|
@@ -35715,7 +35733,7 @@ var MIGRATIONS2 = [
|
|
|
35715
35733
|
{
|
|
35716
35734
|
version: 109,
|
|
35717
35735
|
name: "telemetry-install",
|
|
35718
|
-
up:
|
|
35736
|
+
up: up1112,
|
|
35719
35737
|
artifacts: {
|
|
35720
35738
|
tables: ["telemetry_install"]
|
|
35721
35739
|
}
|
|
@@ -35723,12 +35741,12 @@ var MIGRATIONS2 = [
|
|
|
35723
35741
|
{
|
|
35724
35742
|
version: 110,
|
|
35725
35743
|
name: "memory-mention-join-index",
|
|
35726
|
-
up:
|
|
35744
|
+
up: up1122
|
|
35727
35745
|
},
|
|
35728
35746
|
{
|
|
35729
35747
|
version: 111,
|
|
35730
35748
|
name: "telemetry-first-use",
|
|
35731
|
-
up:
|
|
35749
|
+
up: up1132,
|
|
35732
35750
|
artifacts: {
|
|
35733
35751
|
columns: [
|
|
35734
35752
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -35739,7 +35757,7 @@ var MIGRATIONS2 = [
|
|
|
35739
35757
|
{
|
|
35740
35758
|
version: 112,
|
|
35741
35759
|
name: "telemetry-queue-ownership",
|
|
35742
|
-
up:
|
|
35760
|
+
up: up1142,
|
|
35743
35761
|
artifacts: {
|
|
35744
35762
|
columns: [
|
|
35745
35763
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -35751,7 +35769,7 @@ var MIGRATIONS2 = [
|
|
|
35751
35769
|
{
|
|
35752
35770
|
version: 113,
|
|
35753
35771
|
name: "session-claims",
|
|
35754
|
-
up:
|
|
35772
|
+
up: up1152,
|
|
35755
35773
|
artifacts: {
|
|
35756
35774
|
tables: ["session_claims"],
|
|
35757
35775
|
columns: [
|
|
@@ -35765,12 +35783,12 @@ var MIGRATIONS2 = [
|
|
|
35765
35783
|
{
|
|
35766
35784
|
version: 114,
|
|
35767
35785
|
name: "memory-traversal-hydration-index",
|
|
35768
|
-
up:
|
|
35786
|
+
up: up1162
|
|
35769
35787
|
},
|
|
35770
35788
|
{
|
|
35771
35789
|
version: 115,
|
|
35772
35790
|
name: "cross-agent-message-notifications",
|
|
35773
|
-
up:
|
|
35791
|
+
up: up1172,
|
|
35774
35792
|
artifacts: {
|
|
35775
35793
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
35776
35794
|
}
|
|
@@ -35778,7 +35796,7 @@ var MIGRATIONS2 = [
|
|
|
35778
35796
|
{
|
|
35779
35797
|
version: 116,
|
|
35780
35798
|
name: "acp-delivery-reconciliation",
|
|
35781
|
-
up:
|
|
35799
|
+
up: up1182,
|
|
35782
35800
|
artifacts: {
|
|
35783
35801
|
columns: [
|
|
35784
35802
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -35792,7 +35810,7 @@ var MIGRATIONS2 = [
|
|
|
35792
35810
|
{
|
|
35793
35811
|
version: 117,
|
|
35794
35812
|
name: "retire-summary-worker",
|
|
35795
|
-
up:
|
|
35813
|
+
up: up1192,
|
|
35796
35814
|
artifacts: {
|
|
35797
35815
|
columns: [
|
|
35798
35816
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -35803,24 +35821,24 @@ var MIGRATIONS2 = [
|
|
|
35803
35821
|
{
|
|
35804
35822
|
version: 118,
|
|
35805
35823
|
name: "queue-pressure-indices",
|
|
35806
|
-
up:
|
|
35824
|
+
up: up1202
|
|
35807
35825
|
},
|
|
35808
35826
|
{
|
|
35809
35827
|
version: 119,
|
|
35810
35828
|
name: "telemetry-version-observation",
|
|
35811
|
-
up:
|
|
35829
|
+
up: up1212,
|
|
35812
35830
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
35813
35831
|
},
|
|
35814
35832
|
{
|
|
35815
35833
|
version: 120,
|
|
35816
35834
|
name: "source-lifecycle-telemetry",
|
|
35817
|
-
up:
|
|
35835
|
+
up: up1222,
|
|
35818
35836
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
35819
35837
|
},
|
|
35820
35838
|
{
|
|
35821
35839
|
version: 121,
|
|
35822
35840
|
name: "telemetry-delivery-health",
|
|
35823
|
-
up:
|
|
35841
|
+
up: up1232,
|
|
35824
35842
|
artifacts: {
|
|
35825
35843
|
tables: ["telemetry_delivery_state"],
|
|
35826
35844
|
columns: [
|
|
@@ -35834,7 +35852,7 @@ var MIGRATIONS2 = [
|
|
|
35834
35852
|
{
|
|
35835
35853
|
version: 122,
|
|
35836
35854
|
name: "dreaming-evidence-retry",
|
|
35837
|
-
up:
|
|
35855
|
+
up: up1242,
|
|
35838
35856
|
artifacts: {
|
|
35839
35857
|
columns: [
|
|
35840
35858
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -35847,13 +35865,13 @@ var MIGRATIONS2 = [
|
|
|
35847
35865
|
{
|
|
35848
35866
|
version: 123,
|
|
35849
35867
|
name: "embedding-index-failures",
|
|
35850
|
-
up:
|
|
35868
|
+
up: up1252,
|
|
35851
35869
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
35852
35870
|
},
|
|
35853
35871
|
{
|
|
35854
35872
|
version: 124,
|
|
35855
35873
|
name: "import-derived-lifecycle",
|
|
35856
|
-
up:
|
|
35874
|
+
up: up1262,
|
|
35857
35875
|
artifacts: {
|
|
35858
35876
|
tables: ["imported_source_lifecycle"]
|
|
35859
35877
|
}
|
|
@@ -35861,77 +35879,77 @@ var MIGRATIONS2 = [
|
|
|
35861
35879
|
{
|
|
35862
35880
|
version: 125,
|
|
35863
35881
|
name: "memory-content-safety",
|
|
35864
|
-
up:
|
|
35882
|
+
up: up1272,
|
|
35865
35883
|
artifacts: { tables: ["memory_content_safety"] }
|
|
35866
35884
|
},
|
|
35867
35885
|
{
|
|
35868
35886
|
version: 126,
|
|
35869
35887
|
name: "dreaming-surprisal-attention",
|
|
35870
|
-
up:
|
|
35888
|
+
up: up1282,
|
|
35871
35889
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35872
35890
|
},
|
|
35873
35891
|
{
|
|
35874
35892
|
version: 127,
|
|
35875
35893
|
name: "ontology-contradictions",
|
|
35876
|
-
up:
|
|
35894
|
+
up: up1292,
|
|
35877
35895
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
35878
35896
|
},
|
|
35879
35897
|
{
|
|
35880
35898
|
version: 128,
|
|
35881
35899
|
name: "bounded-queue-diagnostics",
|
|
35882
|
-
up:
|
|
35900
|
+
up: up1302
|
|
35883
35901
|
},
|
|
35884
35902
|
{
|
|
35885
35903
|
version: 129,
|
|
35886
35904
|
name: "retire-structural-jobs",
|
|
35887
|
-
up:
|
|
35905
|
+
up: up1312
|
|
35888
35906
|
},
|
|
35889
35907
|
{
|
|
35890
35908
|
version: 130,
|
|
35891
35909
|
name: "embedding-repair-state",
|
|
35892
|
-
up:
|
|
35910
|
+
up: up1322,
|
|
35893
35911
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
35894
35912
|
},
|
|
35895
35913
|
{
|
|
35896
35914
|
version: 131,
|
|
35897
35915
|
name: "dreaming-evidence-consumption",
|
|
35898
|
-
up:
|
|
35916
|
+
up: up1332,
|
|
35899
35917
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
35900
35918
|
},
|
|
35901
35919
|
{
|
|
35902
35920
|
version: 132,
|
|
35903
35921
|
name: "observer-scoped-epistemic-assertions",
|
|
35904
|
-
up:
|
|
35922
|
+
up: up1342,
|
|
35905
35923
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
35906
35924
|
},
|
|
35907
35925
|
{
|
|
35908
35926
|
version: 133,
|
|
35909
35927
|
name: "dreaming-memory-head",
|
|
35910
|
-
up:
|
|
35928
|
+
up: up1352,
|
|
35911
35929
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
35912
35930
|
},
|
|
35913
35931
|
{
|
|
35914
35932
|
version: 134,
|
|
35915
35933
|
name: "scope-memory-head-entries",
|
|
35916
|
-
up:
|
|
35934
|
+
up: up1362,
|
|
35917
35935
|
artifacts: { tables: ["memory_head_entries"] }
|
|
35918
35936
|
},
|
|
35919
35937
|
{
|
|
35920
35938
|
version: 135,
|
|
35921
35939
|
name: "memory-head-publication",
|
|
35922
|
-
up:
|
|
35940
|
+
up: up1372,
|
|
35923
35941
|
artifacts: { tables: ["memory_head_publications"] }
|
|
35924
35942
|
},
|
|
35925
35943
|
{
|
|
35926
35944
|
version: 136,
|
|
35927
35945
|
name: "memory-head-revisions",
|
|
35928
|
-
up:
|
|
35946
|
+
up: up1382,
|
|
35929
35947
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
35930
35948
|
},
|
|
35931
35949
|
{
|
|
35932
35950
|
version: 137,
|
|
35933
35951
|
name: "dreaming-head-manifest",
|
|
35934
|
-
up:
|
|
35952
|
+
up: up1392,
|
|
35935
35953
|
artifacts: {
|
|
35936
35954
|
columns: [
|
|
35937
35955
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -35942,7 +35960,7 @@ var MIGRATIONS2 = [
|
|
|
35942
35960
|
{
|
|
35943
35961
|
version: 138,
|
|
35944
35962
|
name: "bounded-status-projections",
|
|
35945
|
-
up:
|
|
35963
|
+
up: up1402,
|
|
35946
35964
|
artifacts: {
|
|
35947
35965
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
35948
35966
|
}
|
|
@@ -35950,31 +35968,31 @@ var MIGRATIONS2 = [
|
|
|
35950
35968
|
{
|
|
35951
35969
|
version: 139,
|
|
35952
35970
|
name: "native-source-sync-state",
|
|
35953
|
-
up:
|
|
35971
|
+
up: up1412,
|
|
35954
35972
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
35955
35973
|
},
|
|
35956
35974
|
{
|
|
35957
35975
|
version: 140,
|
|
35958
35976
|
name: "transcript-recovery-frontier",
|
|
35959
|
-
up:
|
|
35977
|
+
up: up1422,
|
|
35960
35978
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
35961
35979
|
},
|
|
35962
35980
|
{
|
|
35963
35981
|
version: 141,
|
|
35964
35982
|
name: "source-sync-checkpoints",
|
|
35965
|
-
up:
|
|
35983
|
+
up: up1432,
|
|
35966
35984
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
35967
35985
|
},
|
|
35968
35986
|
{
|
|
35969
35987
|
version: 142,
|
|
35970
35988
|
name: "source-sync-frontier",
|
|
35971
|
-
up:
|
|
35989
|
+
up: up1442,
|
|
35972
35990
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
35973
35991
|
},
|
|
35974
35992
|
{
|
|
35975
35993
|
version: 143,
|
|
35976
35994
|
name: "embedding-index-progress",
|
|
35977
|
-
up:
|
|
35995
|
+
up: up1452,
|
|
35978
35996
|
artifacts: {
|
|
35979
35997
|
columns: [
|
|
35980
35998
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -35990,19 +36008,19 @@ var MIGRATIONS2 = [
|
|
|
35990
36008
|
{
|
|
35991
36009
|
version: 144,
|
|
35992
36010
|
name: "memory-job-lease-token",
|
|
35993
|
-
up:
|
|
36011
|
+
up: up1462,
|
|
35994
36012
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
35995
36013
|
},
|
|
35996
36014
|
{
|
|
35997
36015
|
version: 145,
|
|
35998
36016
|
name: "dreaming-evidence-reviews",
|
|
35999
|
-
up:
|
|
36017
|
+
up: up1472,
|
|
36000
36018
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
36001
36019
|
},
|
|
36002
36020
|
{
|
|
36003
36021
|
version: 146,
|
|
36004
36022
|
name: "source-transcript-import",
|
|
36005
|
-
up:
|
|
36023
|
+
up: up1482,
|
|
36006
36024
|
artifacts: {
|
|
36007
36025
|
tables: [
|
|
36008
36026
|
"source_import_jobs",
|
|
@@ -36021,19 +36039,19 @@ var MIGRATIONS2 = [
|
|
|
36021
36039
|
{
|
|
36022
36040
|
version: 147,
|
|
36023
36041
|
name: "source-import-replay-file-slots",
|
|
36024
|
-
up:
|
|
36042
|
+
up: up1492,
|
|
36025
36043
|
artifacts: { tables: ["source_import_files"] }
|
|
36026
36044
|
},
|
|
36027
36045
|
{
|
|
36028
36046
|
version: 148,
|
|
36029
36047
|
name: "source-import-attempt-provenance",
|
|
36030
|
-
up:
|
|
36048
|
+
up: up1502,
|
|
36031
36049
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
36032
36050
|
},
|
|
36033
36051
|
{
|
|
36034
36052
|
version: 149,
|
|
36035
36053
|
name: "transcript-import-state-machine",
|
|
36036
|
-
up:
|
|
36054
|
+
up: up1512,
|
|
36037
36055
|
artifacts: {
|
|
36038
36056
|
columns: [
|
|
36039
36057
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -36045,7 +36063,7 @@ var MIGRATIONS2 = [
|
|
|
36045
36063
|
{
|
|
36046
36064
|
version: 150,
|
|
36047
36065
|
name: "memory-head-freshness",
|
|
36048
|
-
up:
|
|
36066
|
+
up: up1522,
|
|
36049
36067
|
artifacts: {
|
|
36050
36068
|
columns: [
|
|
36051
36069
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -36056,7 +36074,7 @@ var MIGRATIONS2 = [
|
|
|
36056
36074
|
{
|
|
36057
36075
|
version: 151,
|
|
36058
36076
|
name: "transcript-import-bytes",
|
|
36059
|
-
up:
|
|
36077
|
+
up: up153,
|
|
36060
36078
|
artifacts: {
|
|
36061
36079
|
tables: [
|
|
36062
36080
|
"source_import_chunks",
|
|
@@ -36081,6 +36099,12 @@ var MIGRATIONS2 = [
|
|
|
36081
36099
|
}))
|
|
36082
36100
|
]
|
|
36083
36101
|
}
|
|
36102
|
+
},
|
|
36103
|
+
{
|
|
36104
|
+
version: 152,
|
|
36105
|
+
name: "memory-artifact-sha-index",
|
|
36106
|
+
up: up210,
|
|
36107
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
36084
36108
|
}
|
|
36085
36109
|
];
|
|
36086
36110
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|