@signetai/connector-forge 0.221.9 → 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;
|
|
@@ -29783,7 +29795,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
|
|
|
29783
29795
|
"checkpoint",
|
|
29784
29796
|
"dreaming"
|
|
29785
29797
|
];
|
|
29786
|
-
function
|
|
29798
|
+
function up153(db) {
|
|
29787
29799
|
const hasColumn26 = (table, column) => {
|
|
29788
29800
|
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
29789
29801
|
try {
|
|
@@ -29843,6 +29855,12 @@ function up152(db) {
|
|
|
29843
29855
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
29844
29856
|
`);
|
|
29845
29857
|
}
|
|
29858
|
+
function up210(db) {
|
|
29859
|
+
db.exec(`
|
|
29860
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
29861
|
+
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)
|
|
29862
|
+
`);
|
|
29863
|
+
}
|
|
29846
29864
|
var MEMORIES_FTS_TOKENIZER2 = "unicode61";
|
|
29847
29865
|
var FTS_STATE_TABLE2 = "memories_fts_state";
|
|
29848
29866
|
function normalizeSql2(sql) {
|
|
@@ -29958,7 +29976,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
29958
29976
|
return true;
|
|
29959
29977
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
29960
29978
|
}
|
|
29961
|
-
function
|
|
29979
|
+
function up310(db) {
|
|
29962
29980
|
db.exec(`
|
|
29963
29981
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
29964
29982
|
version INTEGER PRIMARY KEY,
|
|
@@ -30056,7 +30074,7 @@ function addColumnIfMissing29(db, table, column, definition) {
|
|
|
30056
30074
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30057
30075
|
}
|
|
30058
30076
|
}
|
|
30059
|
-
function
|
|
30077
|
+
function up410(db) {
|
|
30060
30078
|
addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
|
|
30061
30079
|
addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
|
|
30062
30080
|
addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -30174,7 +30192,7 @@ function addColumnIfMissing210(db, table, column, definition) {
|
|
|
30174
30192
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30175
30193
|
return true;
|
|
30176
30194
|
}
|
|
30177
|
-
function
|
|
30195
|
+
function up510(db) {
|
|
30178
30196
|
addColumnIfMissing210(db, "memories", "why", "TEXT");
|
|
30179
30197
|
addColumnIfMissing210(db, "memories", "project", "TEXT");
|
|
30180
30198
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -30211,7 +30229,7 @@ function addColumnIfMissing32(db, table, column, definition) {
|
|
|
30211
30229
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30212
30230
|
}
|
|
30213
30231
|
}
|
|
30214
|
-
function
|
|
30232
|
+
function up610(db) {
|
|
30215
30233
|
addColumnIfMissing32(db, "memory_history", "actor_type", "TEXT");
|
|
30216
30234
|
addColumnIfMissing32(db, "memory_history", "session_id", "TEXT");
|
|
30217
30235
|
addColumnIfMissing32(db, "memory_history", "request_id", "TEXT");
|
|
@@ -30244,7 +30262,7 @@ function addColumnIfMissing42(db, table, column, definition) {
|
|
|
30244
30262
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30245
30263
|
}
|
|
30246
30264
|
}
|
|
30247
|
-
function
|
|
30265
|
+
function up710(db) {
|
|
30248
30266
|
addColumnIfMissing42(db, "entities", "canonical_name", "TEXT");
|
|
30249
30267
|
addColumnIfMissing42(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
30250
30268
|
addColumnIfMissing42(db, "entities", "embedding", "BLOB");
|
|
@@ -30261,7 +30279,7 @@ function hasColumn42(db, table, column) {
|
|
|
30261
30279
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30262
30280
|
return rows.some((r3) => r3.name === column);
|
|
30263
30281
|
}
|
|
30264
|
-
function
|
|
30282
|
+
function up810(db) {
|
|
30265
30283
|
if (!hasColumn42(db, "memories", "idempotency_key")) {
|
|
30266
30284
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
30267
30285
|
}
|
|
@@ -30276,7 +30294,7 @@ function hasColumn52(db, table, column) {
|
|
|
30276
30294
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30277
30295
|
return rows.some((r3) => r3.name === column);
|
|
30278
30296
|
}
|
|
30279
|
-
function
|
|
30297
|
+
function up910(db) {
|
|
30280
30298
|
db.exec(`
|
|
30281
30299
|
CREATE TABLE IF NOT EXISTS documents (
|
|
30282
30300
|
id TEXT PRIMARY KEY,
|
|
@@ -30333,7 +30351,7 @@ function up810(db) {
|
|
|
30333
30351
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
30334
30352
|
}
|
|
30335
30353
|
}
|
|
30336
|
-
function
|
|
30354
|
+
function up1010(db) {
|
|
30337
30355
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
30338
30356
|
if (tables.length === 0)
|
|
30339
30357
|
return;
|
|
@@ -30350,7 +30368,7 @@ function up910(db) {
|
|
|
30350
30368
|
ON embeddings(content_hash)
|
|
30351
30369
|
`);
|
|
30352
30370
|
}
|
|
30353
|
-
function
|
|
30371
|
+
function up1110(db) {
|
|
30354
30372
|
db.exec(`
|
|
30355
30373
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
30356
30374
|
id TEXT PRIMARY KEY,
|
|
@@ -30370,7 +30388,7 @@ function up1010(db) {
|
|
|
30370
30388
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
30371
30389
|
ON summary_jobs(status)`);
|
|
30372
30390
|
}
|
|
30373
|
-
function
|
|
30391
|
+
function up1210(db) {
|
|
30374
30392
|
db.exec(`
|
|
30375
30393
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
30376
30394
|
id INTEGER PRIMARY KEY,
|
|
@@ -30381,7 +30399,7 @@ function up1110(db) {
|
|
|
30381
30399
|
)
|
|
30382
30400
|
`);
|
|
30383
30401
|
}
|
|
30384
|
-
function
|
|
30402
|
+
function up1310(db) {
|
|
30385
30403
|
db.exec(`
|
|
30386
30404
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
30387
30405
|
id TEXT PRIMARY KEY,
|
|
@@ -30401,7 +30419,7 @@ function up1210(db) {
|
|
|
30401
30419
|
ON session_scores(session_key);
|
|
30402
30420
|
`);
|
|
30403
30421
|
}
|
|
30404
|
-
function
|
|
30422
|
+
function up1410(db) {
|
|
30405
30423
|
db.exec(`
|
|
30406
30424
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
30407
30425
|
id TEXT PRIMARY KEY,
|
|
@@ -30442,7 +30460,7 @@ function addColumnIfMissing52(db, table, column, definition) {
|
|
|
30442
30460
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30443
30461
|
}
|
|
30444
30462
|
}
|
|
30445
|
-
function
|
|
30463
|
+
function up154(db) {
|
|
30446
30464
|
db.exec(`
|
|
30447
30465
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
30448
30466
|
id TEXT PRIMARY KEY,
|
|
@@ -30468,7 +30486,7 @@ function up1410(db) {
|
|
|
30468
30486
|
addColumnIfMissing52(db, "memories", "source_path", "TEXT");
|
|
30469
30487
|
addColumnIfMissing52(db, "memories", "source_section", "TEXT");
|
|
30470
30488
|
}
|
|
30471
|
-
function
|
|
30489
|
+
function up162(db) {
|
|
30472
30490
|
db.exec(`
|
|
30473
30491
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
30474
30492
|
id TEXT PRIMARY KEY,
|
|
@@ -30493,7 +30511,7 @@ function addColumnIfMissing62(db, table, column, definition) {
|
|
|
30493
30511
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30494
30512
|
}
|
|
30495
30513
|
}
|
|
30496
|
-
function
|
|
30514
|
+
function up172(db) {
|
|
30497
30515
|
db.exec(`
|
|
30498
30516
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
30499
30517
|
id TEXT PRIMARY KEY,
|
|
@@ -30520,7 +30538,7 @@ function up162(db) {
|
|
|
30520
30538
|
addColumnIfMissing62(db, "session_scores", "confidence", "REAL");
|
|
30521
30539
|
addColumnIfMissing62(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
30522
30540
|
}
|
|
30523
|
-
function
|
|
30541
|
+
function up182(db) {
|
|
30524
30542
|
db.exec(`
|
|
30525
30543
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
30526
30544
|
id TEXT PRIMARY KEY,
|
|
@@ -30542,7 +30560,7 @@ function up172(db) {
|
|
|
30542
30560
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
30543
30561
|
`);
|
|
30544
30562
|
}
|
|
30545
|
-
function
|
|
30563
|
+
function up192(db) {
|
|
30546
30564
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
30547
30565
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
30548
30566
|
if (!colNames.has("skill_name")) {
|
|
@@ -30553,7 +30571,7 @@ function up182(db) {
|
|
|
30553
30571
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
30554
30572
|
}
|
|
30555
30573
|
}
|
|
30556
|
-
function
|
|
30574
|
+
function up202(db) {
|
|
30557
30575
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
30558
30576
|
if (existing)
|
|
30559
30577
|
return;
|
|
@@ -30585,7 +30603,7 @@ function up192(db) {
|
|
|
30585
30603
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
30586
30604
|
`);
|
|
30587
30605
|
}
|
|
30588
|
-
function
|
|
30606
|
+
function up212(db) {
|
|
30589
30607
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
30590
30608
|
const entityColNames = new Set(entityCols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
30591
30609
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -30670,13 +30688,13 @@ function addColumnIfMissing72(db, table, column, definition) {
|
|
|
30670
30688
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30671
30689
|
}
|
|
30672
30690
|
}
|
|
30673
|
-
function
|
|
30691
|
+
function up222(db) {
|
|
30674
30692
|
addColumnIfMissing72(db, "session_memories", "entity_slot", "INTEGER");
|
|
30675
30693
|
addColumnIfMissing72(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30676
30694
|
addColumnIfMissing72(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
30677
30695
|
addColumnIfMissing72(db, "session_memories", "structural_density", "INTEGER");
|
|
30678
30696
|
}
|
|
30679
|
-
function
|
|
30697
|
+
function up232(db) {
|
|
30680
30698
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
30681
30699
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
30682
30700
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -30701,25 +30719,25 @@ function addColumnIfMissing82(db, table, column, definition) {
|
|
|
30701
30719
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30702
30720
|
}
|
|
30703
30721
|
}
|
|
30704
|
-
function
|
|
30722
|
+
function up242(db) {
|
|
30705
30723
|
addColumnIfMissing82(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
30706
30724
|
addColumnIfMissing82(db, "entities", "pinned_at", "TEXT");
|
|
30707
30725
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
30708
30726
|
}
|
|
30709
|
-
function up242(_db) {}
|
|
30710
30727
|
function up252(_db) {}
|
|
30728
|
+
function up262(_db) {}
|
|
30711
30729
|
function addColumnIfMissing92(db, table, column, definition) {
|
|
30712
30730
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30713
30731
|
if (!cols.some((c3) => c3.name === column)) {
|
|
30714
30732
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30715
30733
|
}
|
|
30716
30734
|
}
|
|
30717
|
-
function
|
|
30735
|
+
function up272(db) {
|
|
30718
30736
|
addColumnIfMissing92(db, "session_memories", "agent_relevance_score", "REAL");
|
|
30719
30737
|
addColumnIfMissing92(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
30720
30738
|
}
|
|
30721
|
-
function
|
|
30722
|
-
function
|
|
30739
|
+
function up282(_db) {}
|
|
30740
|
+
function up292(db) {
|
|
30723
30741
|
db.exec(`
|
|
30724
30742
|
UPDATE entities
|
|
30725
30743
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -30728,7 +30746,7 @@ function up282(db) {
|
|
|
30728
30746
|
WHERE canonical_name IS NULL
|
|
30729
30747
|
`);
|
|
30730
30748
|
}
|
|
30731
|
-
function
|
|
30749
|
+
function up302(db) {
|
|
30732
30750
|
db.exec(`
|
|
30733
30751
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
30734
30752
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -30765,7 +30783,7 @@ function up292(db) {
|
|
|
30765
30783
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
30766
30784
|
`);
|
|
30767
30785
|
}
|
|
30768
|
-
function
|
|
30786
|
+
function up312(db) {
|
|
30769
30787
|
db.exec(`
|
|
30770
30788
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
30771
30789
|
id TEXT PRIMARY KEY,
|
|
@@ -30810,7 +30828,7 @@ function up302(db) {
|
|
|
30810
30828
|
WHERE session_key IS NOT NULL;
|
|
30811
30829
|
`);
|
|
30812
30830
|
}
|
|
30813
|
-
function
|
|
30831
|
+
function up322(db) {
|
|
30814
30832
|
db.exec(`
|
|
30815
30833
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
30816
30834
|
id TEXT PRIMARY KEY,
|
|
@@ -30855,7 +30873,7 @@ function up312(db) {
|
|
|
30855
30873
|
ON memory_jobs(failed_at);
|
|
30856
30874
|
`);
|
|
30857
30875
|
}
|
|
30858
|
-
function
|
|
30876
|
+
function up332(db) {
|
|
30859
30877
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30860
30878
|
if (!depCols.some((c3) => c3.name === "reason")) {
|
|
30861
30879
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -30865,7 +30883,7 @@ function up322(db) {
|
|
|
30865
30883
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
30866
30884
|
}
|
|
30867
30885
|
}
|
|
30868
|
-
function
|
|
30886
|
+
function up342(db) {
|
|
30869
30887
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
30870
30888
|
if (cols.length === 0)
|
|
30871
30889
|
return;
|
|
@@ -30873,14 +30891,14 @@ function up332(db) {
|
|
|
30873
30891
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
30874
30892
|
}
|
|
30875
30893
|
}
|
|
30876
|
-
function
|
|
30894
|
+
function up352(db) {
|
|
30877
30895
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
30878
30896
|
if (!cols.some((c3) => c3.name === "scope")) {
|
|
30879
30897
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
30880
30898
|
}
|
|
30881
30899
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
30882
30900
|
}
|
|
30883
|
-
function
|
|
30901
|
+
function up362(db) {
|
|
30884
30902
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
30885
30903
|
db.exec(`
|
|
30886
30904
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -30888,7 +30906,7 @@ function up352(db) {
|
|
|
30888
30906
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
30889
30907
|
`);
|
|
30890
30908
|
}
|
|
30891
|
-
function
|
|
30909
|
+
function up372(db) {
|
|
30892
30910
|
db.exec(`
|
|
30893
30911
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
30894
30912
|
name, canonical_name,
|
|
@@ -30920,13 +30938,13 @@ function up362(db) {
|
|
|
30920
30938
|
END
|
|
30921
30939
|
`);
|
|
30922
30940
|
}
|
|
30923
|
-
function
|
|
30941
|
+
function up382(db) {
|
|
30924
30942
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30925
30943
|
if (!cols.some((c3) => c3.name === "confidence")) {
|
|
30926
30944
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
30927
30945
|
}
|
|
30928
30946
|
}
|
|
30929
|
-
function
|
|
30947
|
+
function up392(db) {
|
|
30930
30948
|
db.exec(`
|
|
30931
30949
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
30932
30950
|
id TEXT PRIMARY KEY,
|
|
@@ -30944,7 +30962,7 @@ function up382(db) {
|
|
|
30944
30962
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
30945
30963
|
}
|
|
30946
30964
|
}
|
|
30947
|
-
function
|
|
30965
|
+
function up402(db) {
|
|
30948
30966
|
db.exec(`
|
|
30949
30967
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
30950
30968
|
id TEXT PRIMARY KEY,
|
|
@@ -30984,7 +31002,7 @@ function up392(db) {
|
|
|
30984
31002
|
END
|
|
30985
31003
|
`);
|
|
30986
31004
|
}
|
|
30987
|
-
function
|
|
31005
|
+
function up412(db) {
|
|
30988
31006
|
db.exec(`
|
|
30989
31007
|
DELETE FROM entity_dependencies
|
|
30990
31008
|
WHERE id NOT IN (
|
|
@@ -31002,7 +31020,7 @@ function up402(db) {
|
|
|
31002
31020
|
)
|
|
31003
31021
|
`);
|
|
31004
31022
|
}
|
|
31005
|
-
function
|
|
31023
|
+
function up422(db) {
|
|
31006
31024
|
db.exec(`
|
|
31007
31025
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
31008
31026
|
session_key TEXT PRIMARY KEY,
|
|
@@ -31025,7 +31043,7 @@ function addColumnIfMissing102(db, table, column, definition) {
|
|
|
31025
31043
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31026
31044
|
}
|
|
31027
31045
|
}
|
|
31028
|
-
function
|
|
31046
|
+
function up432(db) {
|
|
31029
31047
|
addColumnIfMissing102(db, "session_memories", "path_json", "TEXT");
|
|
31030
31048
|
db.exec(`
|
|
31031
31049
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -31100,7 +31118,7 @@ function addColumnIfMissing112(db, table, column, definition) {
|
|
|
31100
31118
|
return;
|
|
31101
31119
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31102
31120
|
}
|
|
31103
|
-
function
|
|
31121
|
+
function up442(db) {
|
|
31104
31122
|
addColumnIfMissing112(db, "session_memories", "entity_slot", "INTEGER");
|
|
31105
31123
|
addColumnIfMissing112(db, "session_memories", "aspect_slot", "INTEGER");
|
|
31106
31124
|
addColumnIfMissing112(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -31188,7 +31206,7 @@ function addColumnIfMissing122(db, table, column, definition) {
|
|
|
31188
31206
|
return;
|
|
31189
31207
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31190
31208
|
}
|
|
31191
|
-
function
|
|
31209
|
+
function up452(db) {
|
|
31192
31210
|
db.exec(`
|
|
31193
31211
|
CREATE TABLE IF NOT EXISTS agents (
|
|
31194
31212
|
id TEXT PRIMARY KEY,
|
|
@@ -31217,7 +31235,7 @@ function addColumnIfMissing132(db, table, column, definition) {
|
|
|
31217
31235
|
return;
|
|
31218
31236
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31219
31237
|
}
|
|
31220
|
-
function
|
|
31238
|
+
function up462(db) {
|
|
31221
31239
|
addColumnIfMissing132(db, "session_summaries", "source_type", "TEXT");
|
|
31222
31240
|
addColumnIfMissing132(db, "session_summaries", "source_ref", "TEXT");
|
|
31223
31241
|
addColumnIfMissing132(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -31243,7 +31261,7 @@ function addColumnIfMissing142(db, table, column, definition) {
|
|
|
31243
31261
|
return;
|
|
31244
31262
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31245
31263
|
}
|
|
31246
|
-
function
|
|
31264
|
+
function up472(db) {
|
|
31247
31265
|
addColumnIfMissing142(db, "session_transcripts", "updated_at", "TEXT");
|
|
31248
31266
|
addColumnIfMissing142(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
31249
31267
|
addColumnIfMissing142(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -31314,7 +31332,7 @@ function up462(db) {
|
|
|
31314
31332
|
ON memory_md_heads(lease_expires_at);
|
|
31315
31333
|
`);
|
|
31316
31334
|
}
|
|
31317
|
-
function
|
|
31335
|
+
function up482(db) {
|
|
31318
31336
|
db.exec(`
|
|
31319
31337
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
31320
31338
|
|
|
@@ -31375,7 +31393,7 @@ function up472(db) {
|
|
|
31375
31393
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31376
31394
|
`);
|
|
31377
31395
|
}
|
|
31378
|
-
function
|
|
31396
|
+
function up492(db) {
|
|
31379
31397
|
db.exec(`
|
|
31380
31398
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
31381
31399
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -31473,7 +31491,7 @@ function up482(db) {
|
|
|
31473
31491
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31474
31492
|
`);
|
|
31475
31493
|
}
|
|
31476
|
-
function
|
|
31494
|
+
function up502(db) {
|
|
31477
31495
|
db.exec(`
|
|
31478
31496
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
31479
31497
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -31591,7 +31609,7 @@ function up492(db) {
|
|
|
31591
31609
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
31592
31610
|
`);
|
|
31593
31611
|
}
|
|
31594
|
-
function
|
|
31612
|
+
function up512(db) {
|
|
31595
31613
|
db.exec(`
|
|
31596
31614
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
31597
31615
|
session_key TEXT NOT NULL,
|
|
@@ -31608,7 +31626,7 @@ function hasTable5(db, name) {
|
|
|
31608
31626
|
WHERE type = 'table' AND name = ?
|
|
31609
31627
|
LIMIT 1`).get(name) !== undefined;
|
|
31610
31628
|
}
|
|
31611
|
-
function
|
|
31629
|
+
function up522(db) {
|
|
31612
31630
|
db.exec(`
|
|
31613
31631
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
31614
31632
|
id TEXT PRIMARY KEY,
|
|
@@ -31778,7 +31796,7 @@ function addColumnIfMissing152(db, table, column, definition) {
|
|
|
31778
31796
|
return;
|
|
31779
31797
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31780
31798
|
}
|
|
31781
|
-
function
|
|
31799
|
+
function up532(db) {
|
|
31782
31800
|
addColumnIfMissing152(db, "summary_jobs", "session_id", "TEXT");
|
|
31783
31801
|
addColumnIfMissing152(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
31784
31802
|
addColumnIfMissing152(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -31870,7 +31888,7 @@ function up522(db) {
|
|
|
31870
31888
|
VALUES ('rebuild');
|
|
31871
31889
|
`);
|
|
31872
31890
|
}
|
|
31873
|
-
function
|
|
31891
|
+
function up542(db) {
|
|
31874
31892
|
db.exec(`
|
|
31875
31893
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
31876
31894
|
id TEXT PRIMARY KEY,
|
|
@@ -31887,7 +31905,7 @@ function up532(db) {
|
|
|
31887
31905
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
31888
31906
|
`);
|
|
31889
31907
|
}
|
|
31890
|
-
function
|
|
31908
|
+
function up552(db) {
|
|
31891
31909
|
db.exec(`
|
|
31892
31910
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
31893
31911
|
id TEXT PRIMARY KEY,
|
|
@@ -31903,7 +31921,7 @@ function up542(db) {
|
|
|
31903
31921
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
31904
31922
|
`);
|
|
31905
31923
|
}
|
|
31906
|
-
function
|
|
31924
|
+
function up562(db) {
|
|
31907
31925
|
db.exec(`
|
|
31908
31926
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
31909
31927
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -31934,7 +31952,7 @@ function up552(db) {
|
|
|
31934
31952
|
ON task_scope_hints(agent_id, updated_at);
|
|
31935
31953
|
`);
|
|
31936
31954
|
}
|
|
31937
|
-
function
|
|
31955
|
+
function up572(db) {
|
|
31938
31956
|
db.exec(`
|
|
31939
31957
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
31940
31958
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -31977,7 +31995,7 @@ function ensureMemoriesScopeColumns3(db) {
|
|
|
31977
31995
|
if (!names.has("scope"))
|
|
31978
31996
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
31979
31997
|
}
|
|
31980
|
-
function
|
|
31998
|
+
function up582(db) {
|
|
31981
31999
|
ensureMemoriesScopeColumns3(db);
|
|
31982
32000
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
31983
32001
|
db.exec(`
|
|
@@ -31990,20 +32008,20 @@ function up572(db) {
|
|
|
31990
32008
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
31991
32009
|
`);
|
|
31992
32010
|
}
|
|
31993
|
-
function
|
|
32011
|
+
function up592(db) {
|
|
31994
32012
|
const sql = readMemoriesFtsSql2(db);
|
|
31995
32013
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair2(sql))
|
|
31996
32014
|
return;
|
|
31997
32015
|
recreateMemoriesFts2(db);
|
|
31998
32016
|
}
|
|
31999
|
-
function
|
|
32017
|
+
function up602(db) {
|
|
32000
32018
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
32001
32019
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
32002
32020
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
32003
32021
|
ON entities(entity_type, mentions)
|
|
32004
32022
|
WHERE entity_type = 'extracted'`);
|
|
32005
32023
|
}
|
|
32006
|
-
function
|
|
32024
|
+
function up612(db) {
|
|
32007
32025
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
32008
32026
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
32009
32027
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -32012,7 +32030,7 @@ function up602(db) {
|
|
|
32012
32030
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
32013
32031
|
WHERE claim_key IS NOT NULL`);
|
|
32014
32032
|
}
|
|
32015
|
-
function
|
|
32033
|
+
function up622(db) {
|
|
32016
32034
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
32017
32035
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
32018
32036
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -32024,13 +32042,13 @@ function up612(db) {
|
|
|
32024
32042
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
32025
32043
|
WHERE claim_key IS NOT NULL`);
|
|
32026
32044
|
}
|
|
32027
|
-
function
|
|
32045
|
+
function up632(db) {
|
|
32028
32046
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
32029
32047
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
32030
32048
|
return;
|
|
32031
32049
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
32032
32050
|
}
|
|
32033
|
-
function
|
|
32051
|
+
function up642(db) {
|
|
32034
32052
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
32035
32053
|
const names = new Set(cols.map((col) => col.name));
|
|
32036
32054
|
if (!names.has("is_deleted")) {
|
|
@@ -32044,7 +32062,7 @@ function up632(db) {
|
|
|
32044
32062
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
32045
32063
|
`);
|
|
32046
32064
|
}
|
|
32047
|
-
function
|
|
32065
|
+
function up652(db) {
|
|
32048
32066
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
32049
32067
|
db.exec(`
|
|
32050
32068
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -32062,7 +32080,7 @@ function addColumnIfMissing162(db, table, column, definition) {
|
|
|
32062
32080
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32063
32081
|
}
|
|
32064
32082
|
}
|
|
32065
|
-
function
|
|
32083
|
+
function up662(db) {
|
|
32066
32084
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
32067
32085
|
addColumnIfMissing162(db, table, "source_id", "TEXT");
|
|
32068
32086
|
addColumnIfMissing162(db, table, "source_kind", "TEXT");
|
|
@@ -32082,7 +32100,7 @@ function hasColumn72(db, table, column) {
|
|
|
32082
32100
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32083
32101
|
return rows.some((row) => row.name === column);
|
|
32084
32102
|
}
|
|
32085
|
-
function
|
|
32103
|
+
function up672(db) {
|
|
32086
32104
|
if (!hasTable22(db, "embeddings"))
|
|
32087
32105
|
return;
|
|
32088
32106
|
if (!hasColumn72(db, "embeddings", "agent_id")) {
|
|
@@ -32090,7 +32108,7 @@ function up662(db) {
|
|
|
32090
32108
|
}
|
|
32091
32109
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
32092
32110
|
}
|
|
32093
|
-
function
|
|
32111
|
+
function up682(db) {
|
|
32094
32112
|
db.exec(`
|
|
32095
32113
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
32096
32114
|
id TEXT PRIMARY KEY,
|
|
@@ -32131,7 +32149,7 @@ function addColumnIfMissing172(db, table, column, definition) {
|
|
|
32131
32149
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32132
32150
|
}
|
|
32133
32151
|
}
|
|
32134
|
-
function
|
|
32152
|
+
function up692(db) {
|
|
32135
32153
|
db.exec(`
|
|
32136
32154
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
32137
32155
|
id TEXT PRIMARY KEY,
|
|
@@ -32174,7 +32192,7 @@ function up682(db) {
|
|
|
32174
32192
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
32175
32193
|
}
|
|
32176
32194
|
}
|
|
32177
|
-
function
|
|
32195
|
+
function up702(db) {
|
|
32178
32196
|
db.exec(`
|
|
32179
32197
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
32180
32198
|
id TEXT PRIMARY KEY,
|
|
@@ -32201,7 +32219,7 @@ function up692(db) {
|
|
|
32201
32219
|
WHERE content_key IS NOT NULL;
|
|
32202
32220
|
`);
|
|
32203
32221
|
}
|
|
32204
|
-
function
|
|
32222
|
+
function up712(db) {
|
|
32205
32223
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
32206
32224
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
32207
32225
|
if (!colNames.has("content_key")) {
|
|
@@ -32238,7 +32256,7 @@ function backfillVersionRoots2(db) {
|
|
|
32238
32256
|
WHERE version_root_id IS NULL
|
|
32239
32257
|
`);
|
|
32240
32258
|
}
|
|
32241
|
-
function
|
|
32259
|
+
function up722(db) {
|
|
32242
32260
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
32243
32261
|
addColumnIfMissing182(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
32244
32262
|
addColumnIfMissing182(db, table, "archived_at", "TEXT");
|
|
@@ -32273,7 +32291,7 @@ function up712(db) {
|
|
|
32273
32291
|
ON entity_aspects(agent_id, proposal_id);
|
|
32274
32292
|
`);
|
|
32275
32293
|
}
|
|
32276
|
-
function
|
|
32294
|
+
function up732(db) {
|
|
32277
32295
|
db.exec(`
|
|
32278
32296
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
32279
32297
|
id TEXT PRIMARY KEY,
|
|
@@ -32329,7 +32347,7 @@ function ensureMemoriesScopeColumns22(db) {
|
|
|
32329
32347
|
if (!names.has("runtime_path"))
|
|
32330
32348
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
32331
32349
|
}
|
|
32332
|
-
function
|
|
32350
|
+
function up742(db) {
|
|
32333
32351
|
ensureMemoriesScopeColumns22(db);
|
|
32334
32352
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
32335
32353
|
db.exec(`
|
|
@@ -32343,7 +32361,7 @@ function up732(db) {
|
|
|
32343
32361
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
32344
32362
|
`);
|
|
32345
32363
|
}
|
|
32346
|
-
function
|
|
32364
|
+
function up752(db) {
|
|
32347
32365
|
db.exec(`
|
|
32348
32366
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
32349
32367
|
session_key TEXT NOT NULL,
|
|
@@ -32378,7 +32396,7 @@ function up742(db) {
|
|
|
32378
32396
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
32379
32397
|
`);
|
|
32380
32398
|
}
|
|
32381
|
-
function
|
|
32399
|
+
function up762(db) {
|
|
32382
32400
|
db.exec(`
|
|
32383
32401
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
32384
32402
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32397,7 +32415,7 @@ function addColumnIfMissing192(db, table, column, definition) {
|
|
|
32397
32415
|
return;
|
|
32398
32416
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32399
32417
|
}
|
|
32400
|
-
function
|
|
32418
|
+
function up772(db) {
|
|
32401
32419
|
addColumnIfMissing192(db, "memory_artifacts", "source_id", "TEXT");
|
|
32402
32420
|
addColumnIfMissing192(db, "memory_artifacts", "source_root", "TEXT");
|
|
32403
32421
|
addColumnIfMissing192(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -32410,7 +32428,7 @@ function up762(db) {
|
|
|
32410
32428
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
32411
32429
|
`);
|
|
32412
32430
|
}
|
|
32413
|
-
function
|
|
32431
|
+
function up782(db) {
|
|
32414
32432
|
db.exec(`
|
|
32415
32433
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
32416
32434
|
id TEXT PRIMARY KEY,
|
|
@@ -32433,7 +32451,7 @@ function up772(db) {
|
|
|
32433
32451
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
32434
32452
|
`);
|
|
32435
32453
|
}
|
|
32436
|
-
function
|
|
32454
|
+
function up792(db) {
|
|
32437
32455
|
db.exec(`
|
|
32438
32456
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
32439
32457
|
id TEXT PRIMARY KEY,
|
|
@@ -32457,7 +32475,7 @@ function up782(db) {
|
|
|
32457
32475
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
32458
32476
|
`);
|
|
32459
32477
|
}
|
|
32460
|
-
function
|
|
32478
|
+
function up802(db) {
|
|
32461
32479
|
db.exec(`
|
|
32462
32480
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
32463
32481
|
id TEXT PRIMARY KEY,
|
|
@@ -32485,7 +32503,7 @@ function up792(db) {
|
|
|
32485
32503
|
ON api_keys(connector, harness);
|
|
32486
32504
|
`);
|
|
32487
32505
|
}
|
|
32488
|
-
function
|
|
32506
|
+
function up812(db) {
|
|
32489
32507
|
db.exec(`
|
|
32490
32508
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
32491
32509
|
id TEXT PRIMARY KEY,
|
|
@@ -32520,7 +32538,7 @@ function hasColumn102(db, table, column) {
|
|
|
32520
32538
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32521
32539
|
return rows.some((row) => row.name === column);
|
|
32522
32540
|
}
|
|
32523
|
-
function
|
|
32541
|
+
function up822(db) {
|
|
32524
32542
|
if (!hasColumn102(db, "documents", "agent_id")) {
|
|
32525
32543
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
32526
32544
|
}
|
|
@@ -32606,7 +32624,7 @@ function up812(db) {
|
|
|
32606
32624
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
32607
32625
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
32608
32626
|
}
|
|
32609
|
-
function
|
|
32627
|
+
function up832(db) {
|
|
32610
32628
|
db.exec(`
|
|
32611
32629
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
32612
32630
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32628,7 +32646,7 @@ function hasColumn112(db, table, column) {
|
|
|
32628
32646
|
return rows.some((row) => row.name === column);
|
|
32629
32647
|
}
|
|
32630
32648
|
var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
32631
|
-
function
|
|
32649
|
+
function up842(db) {
|
|
32632
32650
|
for (const column of COLUMNS3) {
|
|
32633
32651
|
if (!hasColumn112(db, "skill_invocations", column)) {
|
|
32634
32652
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -32709,7 +32727,7 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32709
32727
|
`);
|
|
32710
32728
|
}
|
|
32711
32729
|
try {
|
|
32712
|
-
|
|
32730
|
+
up822(db);
|
|
32713
32731
|
if (preserveAgentId) {
|
|
32714
32732
|
db.exec(`
|
|
32715
32733
|
UPDATE documents
|
|
@@ -32729,12 +32747,12 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32729
32747
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
32730
32748
|
}
|
|
32731
32749
|
}
|
|
32732
|
-
function
|
|
32733
|
-
|
|
32750
|
+
function up852(db) {
|
|
32751
|
+
up812(db);
|
|
32734
32752
|
if (hasTable32(db, "documents")) {
|
|
32735
32753
|
documentScopeColumnsPreservingExisting2(db);
|
|
32736
32754
|
}
|
|
32737
|
-
|
|
32755
|
+
up832(db);
|
|
32738
32756
|
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
32739
32757
|
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
32740
32758
|
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -32791,7 +32809,7 @@ function up842(db) {
|
|
|
32791
32809
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
32792
32810
|
`);
|
|
32793
32811
|
}
|
|
32794
|
-
function
|
|
32812
|
+
function up862(db) {
|
|
32795
32813
|
db.exec(`
|
|
32796
32814
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
32797
32815
|
path TEXT PRIMARY KEY,
|
|
@@ -32821,7 +32839,7 @@ function up852(db) {
|
|
|
32821
32839
|
ON legacy_markdown_chunks(memory_id);
|
|
32822
32840
|
`);
|
|
32823
32841
|
}
|
|
32824
|
-
function
|
|
32842
|
+
function up872(db) {
|
|
32825
32843
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
32826
32844
|
const tableNames = new Set(tables.map((r3) => String(r3.name)));
|
|
32827
32845
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -32880,7 +32898,7 @@ function addColumnIfMissing212(db, table, column, definition) {
|
|
|
32880
32898
|
return;
|
|
32881
32899
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32882
32900
|
}
|
|
32883
|
-
function
|
|
32901
|
+
function up882(db) {
|
|
32884
32902
|
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
32885
32903
|
db.exec(`
|
|
32886
32904
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -32893,14 +32911,14 @@ function addColumnIfMissing222(db, table, column, definition) {
|
|
|
32893
32911
|
return;
|
|
32894
32912
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32895
32913
|
}
|
|
32896
|
-
function
|
|
32914
|
+
function up892(db) {
|
|
32897
32915
|
addColumnIfMissing222(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
32898
32916
|
db.exec(`
|
|
32899
32917
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
32900
32918
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
32901
32919
|
`);
|
|
32902
32920
|
}
|
|
32903
|
-
function
|
|
32921
|
+
function up902(db) {
|
|
32904
32922
|
db.exec(`
|
|
32905
32923
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
32906
32924
|
agent_id TEXT NOT NULL,
|
|
@@ -32918,7 +32936,7 @@ function up892(db) {
|
|
|
32918
32936
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
32919
32937
|
`);
|
|
32920
32938
|
}
|
|
32921
|
-
function
|
|
32939
|
+
function up912(db) {
|
|
32922
32940
|
db.exec(`
|
|
32923
32941
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
32924
32942
|
id TEXT PRIMARY KEY,
|
|
@@ -32946,7 +32964,7 @@ function indexExists3(db, table, indexName) {
|
|
|
32946
32964
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32947
32965
|
return rows.some((row) => row.name === indexName);
|
|
32948
32966
|
}
|
|
32949
|
-
function
|
|
32967
|
+
function up922(db) {
|
|
32950
32968
|
db.exec(`
|
|
32951
32969
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
32952
32970
|
id TEXT PRIMARY KEY,
|
|
@@ -32973,7 +32991,7 @@ function indexExists22(db, table, indexName) {
|
|
|
32973
32991
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32974
32992
|
return rows.some((row) => row.name === indexName);
|
|
32975
32993
|
}
|
|
32976
|
-
function
|
|
32994
|
+
function up932(db) {
|
|
32977
32995
|
db.exec(`
|
|
32978
32996
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
32979
32997
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -32986,7 +33004,7 @@ function up922(db) {
|
|
|
32986
33004
|
)
|
|
32987
33005
|
`);
|
|
32988
33006
|
}
|
|
32989
|
-
function
|
|
33007
|
+
function up942(db) {
|
|
32990
33008
|
db.exec(`
|
|
32991
33009
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
32992
33010
|
id TEXT PRIMARY KEY,
|
|
@@ -33005,7 +33023,7 @@ function up932(db) {
|
|
|
33005
33023
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
33006
33024
|
`);
|
|
33007
33025
|
}
|
|
33008
|
-
function
|
|
33026
|
+
function up952(db) {
|
|
33009
33027
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
33010
33028
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
33011
33029
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -33016,7 +33034,7 @@ function hasColumn132(db, table, column) {
|
|
|
33016
33034
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
33017
33035
|
return rows.some((r3) => r3.name === column);
|
|
33018
33036
|
}
|
|
33019
|
-
function
|
|
33037
|
+
function up962(db) {
|
|
33020
33038
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
33021
33039
|
if (tables.length === 0)
|
|
33022
33040
|
return;
|
|
@@ -33041,23 +33059,23 @@ function up952(db) {
|
|
|
33041
33059
|
function hasColumn142(db, table, column) {
|
|
33042
33060
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33043
33061
|
}
|
|
33044
|
-
function
|
|
33062
|
+
function up972(db) {
|
|
33045
33063
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
33046
33064
|
if (!hasMemories || !hasColumn142(db, "memories", "memory_kind") || !hasColumn142(db, "memories", "type"))
|
|
33047
33065
|
return;
|
|
33048
33066
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
33049
33067
|
}
|
|
33050
|
-
function
|
|
33068
|
+
function up982(db) {
|
|
33051
33069
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
33052
33070
|
}
|
|
33053
|
-
function
|
|
33071
|
+
function up992(db) {
|
|
33054
33072
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
33055
33073
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
33056
33074
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
33057
33075
|
}
|
|
33058
33076
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
33059
33077
|
}
|
|
33060
|
-
function
|
|
33078
|
+
function up1002(db) {
|
|
33061
33079
|
db.exec(`
|
|
33062
33080
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
33063
33081
|
agent_id TEXT NOT NULL,
|
|
@@ -33074,7 +33092,7 @@ function up992(db) {
|
|
|
33074
33092
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
33075
33093
|
`);
|
|
33076
33094
|
}
|
|
33077
|
-
function
|
|
33095
|
+
function up1012(db) {
|
|
33078
33096
|
db.exec(`
|
|
33079
33097
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
33080
33098
|
id TEXT PRIMARY KEY,
|
|
@@ -33094,7 +33112,7 @@ function up1002(db) {
|
|
|
33094
33112
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
33095
33113
|
`);
|
|
33096
33114
|
}
|
|
33097
|
-
function
|
|
33115
|
+
function up1022(db) {
|
|
33098
33116
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
33099
33117
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
33100
33118
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -33103,7 +33121,7 @@ function up1012(db) {
|
|
|
33103
33121
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
33104
33122
|
}
|
|
33105
33123
|
}
|
|
33106
|
-
function
|
|
33124
|
+
function up1032(db) {
|
|
33107
33125
|
db.exec(`
|
|
33108
33126
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
33109
33127
|
id TEXT PRIMARY KEY,
|
|
@@ -33125,7 +33143,7 @@ function up1022(db) {
|
|
|
33125
33143
|
function hasColumn152(db, table, column) {
|
|
33126
33144
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33127
33145
|
}
|
|
33128
|
-
function
|
|
33146
|
+
function up1042(db) {
|
|
33129
33147
|
const requiredMemoryColumns = [
|
|
33130
33148
|
"content_hash",
|
|
33131
33149
|
"normalized_content",
|
|
@@ -33176,7 +33194,7 @@ function up1032(db) {
|
|
|
33176
33194
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
33177
33195
|
`);
|
|
33178
33196
|
}
|
|
33179
|
-
function
|
|
33197
|
+
function up1052(db) {
|
|
33180
33198
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
33181
33199
|
if (tables.length !== 2)
|
|
33182
33200
|
return;
|
|
@@ -33199,7 +33217,7 @@ function tableExists4(db, table) {
|
|
|
33199
33217
|
function hasColumn162(db, table, column) {
|
|
33200
33218
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33201
33219
|
}
|
|
33202
|
-
function
|
|
33220
|
+
function up1062(db) {
|
|
33203
33221
|
db.exec(`
|
|
33204
33222
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
33205
33223
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -33242,7 +33260,7 @@ function up1052(db) {
|
|
|
33242
33260
|
`);
|
|
33243
33261
|
}
|
|
33244
33262
|
}
|
|
33245
|
-
function
|
|
33263
|
+
function up1072(db) {
|
|
33246
33264
|
db.exec(`
|
|
33247
33265
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
33248
33266
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -33331,7 +33349,7 @@ function up1062(db) {
|
|
|
33331
33349
|
function hasColumn172(db, table, column) {
|
|
33332
33350
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33333
33351
|
}
|
|
33334
|
-
function
|
|
33352
|
+
function up1082(db) {
|
|
33335
33353
|
if (!hasColumn172(db, "memories", "review_after")) {
|
|
33336
33354
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
33337
33355
|
}
|
|
@@ -33347,14 +33365,14 @@ var TOKEN_COLUMNS2 = [
|
|
|
33347
33365
|
["tokens_cache_write", "INTEGER"],
|
|
33348
33366
|
["tokens_cost", "REAL"]
|
|
33349
33367
|
];
|
|
33350
|
-
function
|
|
33368
|
+
function up1092(db) {
|
|
33351
33369
|
for (const [column, type] of TOKEN_COLUMNS2) {
|
|
33352
33370
|
if (!hasColumn182(db, "dreaming_passes", column)) {
|
|
33353
33371
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
33354
33372
|
}
|
|
33355
33373
|
}
|
|
33356
33374
|
}
|
|
33357
|
-
function
|
|
33375
|
+
function up1102(db) {
|
|
33358
33376
|
db.exec(`
|
|
33359
33377
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
33360
33378
|
day TEXT NOT NULL,
|
|
@@ -33367,7 +33385,7 @@ function up1092(db) {
|
|
|
33367
33385
|
);
|
|
33368
33386
|
`);
|
|
33369
33387
|
}
|
|
33370
|
-
function
|
|
33388
|
+
function up1112(db) {
|
|
33371
33389
|
db.exec(`
|
|
33372
33390
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
33373
33391
|
id TEXT PRIMARY KEY,
|
|
@@ -33375,7 +33393,7 @@ function up1102(db) {
|
|
|
33375
33393
|
);
|
|
33376
33394
|
`);
|
|
33377
33395
|
}
|
|
33378
|
-
function
|
|
33396
|
+
function up1122(db) {
|
|
33379
33397
|
db.exec(`
|
|
33380
33398
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
33381
33399
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -33386,7 +33404,7 @@ function hasColumn192(db, table, column) {
|
|
|
33386
33404
|
return rows.some((row) => row.name === column);
|
|
33387
33405
|
}
|
|
33388
33406
|
var COLUMNS22 = ["first_remember_at", "first_recall_at"];
|
|
33389
|
-
function
|
|
33407
|
+
function up1132(db) {
|
|
33390
33408
|
for (const column of COLUMNS22) {
|
|
33391
33409
|
if (!hasColumn192(db, "telemetry_install", column)) {
|
|
33392
33410
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -33402,7 +33420,7 @@ function addColumnIfMissing232(db, column, definition) {
|
|
|
33402
33420
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33403
33421
|
}
|
|
33404
33422
|
}
|
|
33405
|
-
function
|
|
33423
|
+
function up1142(db) {
|
|
33406
33424
|
addColumnIfMissing232(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
33407
33425
|
addColumnIfMissing232(db, "claim_token", "TEXT");
|
|
33408
33426
|
addColumnIfMissing232(db, "claimed_at", "TEXT");
|
|
@@ -33411,7 +33429,7 @@ function up1132(db) {
|
|
|
33411
33429
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
33412
33430
|
`);
|
|
33413
33431
|
}
|
|
33414
|
-
function
|
|
33432
|
+
function up1152(db) {
|
|
33415
33433
|
db.exec(`
|
|
33416
33434
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
33417
33435
|
session_key TEXT NOT NULL,
|
|
@@ -33432,7 +33450,7 @@ function up1142(db) {
|
|
|
33432
33450
|
ON session_claims(agent_id, state, expires_at);
|
|
33433
33451
|
`);
|
|
33434
33452
|
}
|
|
33435
|
-
function
|
|
33453
|
+
function up1162(db) {
|
|
33436
33454
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
33437
33455
|
if (table == null)
|
|
33438
33456
|
return;
|
|
@@ -33441,7 +33459,7 @@ function up1152(db) {
|
|
|
33441
33459
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
33442
33460
|
`);
|
|
33443
33461
|
}
|
|
33444
|
-
function
|
|
33462
|
+
function up1172(db) {
|
|
33445
33463
|
db.exec(`
|
|
33446
33464
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
33447
33465
|
id TEXT PRIMARY KEY,
|
|
@@ -33498,7 +33516,7 @@ function addColumnIfMissing242(db, column, definition) {
|
|
|
33498
33516
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
33499
33517
|
}
|
|
33500
33518
|
}
|
|
33501
|
-
function
|
|
33519
|
+
function up1182(db) {
|
|
33502
33520
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
33503
33521
|
if (table == null)
|
|
33504
33522
|
return;
|
|
@@ -33699,7 +33717,7 @@ function backfillTranscriptsFromSummaryJobs2(db) {
|
|
|
33699
33717
|
insert.run(...values);
|
|
33700
33718
|
}
|
|
33701
33719
|
}
|
|
33702
|
-
function
|
|
33720
|
+
function up1192(db) {
|
|
33703
33721
|
if (!hasTable42(db, "session_transcripts"))
|
|
33704
33722
|
return;
|
|
33705
33723
|
addColumnIfMissing252(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -33752,7 +33770,7 @@ function up1182(db) {
|
|
|
33752
33770
|
ON session_transcripts(agent_id, content_hash);
|
|
33753
33771
|
`);
|
|
33754
33772
|
}
|
|
33755
|
-
function
|
|
33773
|
+
function up1202(db) {
|
|
33756
33774
|
db.exec(`
|
|
33757
33775
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
33758
33776
|
ON memory_jobs(status)
|
|
@@ -33771,12 +33789,12 @@ function up1192(db) {
|
|
|
33771
33789
|
function hasColumn222(db, table, column) {
|
|
33772
33790
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33773
33791
|
}
|
|
33774
|
-
function
|
|
33792
|
+
function up1212(db) {
|
|
33775
33793
|
if (!hasColumn222(db, "telemetry_install", "last_seen_version")) {
|
|
33776
33794
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
33777
33795
|
}
|
|
33778
33796
|
}
|
|
33779
|
-
function
|
|
33797
|
+
function up1222(db) {
|
|
33780
33798
|
db.exec(`
|
|
33781
33799
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
33782
33800
|
agent_id TEXT NOT NULL,
|
|
@@ -33805,7 +33823,7 @@ function addColumnIfMissing262(db, column, definition) {
|
|
|
33805
33823
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33806
33824
|
}
|
|
33807
33825
|
}
|
|
33808
|
-
function
|
|
33826
|
+
function up1232(db) {
|
|
33809
33827
|
addColumnIfMissing262(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
33810
33828
|
addColumnIfMissing262(db, "last_attempt_at", "TEXT");
|
|
33811
33829
|
addColumnIfMissing262(db, "sent_at", "TEXT");
|
|
@@ -33826,7 +33844,7 @@ function up1222(db) {
|
|
|
33826
33844
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
33827
33845
|
`);
|
|
33828
33846
|
}
|
|
33829
|
-
function
|
|
33847
|
+
function up1242(db) {
|
|
33830
33848
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
33831
33849
|
const names = new Set(columns.map((column) => column.name));
|
|
33832
33850
|
if (!names.has("failure_class")) {
|
|
@@ -33843,7 +33861,7 @@ function up1232(db) {
|
|
|
33843
33861
|
}
|
|
33844
33862
|
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)");
|
|
33845
33863
|
}
|
|
33846
|
-
function
|
|
33864
|
+
function up1252(db) {
|
|
33847
33865
|
db.exec(`
|
|
33848
33866
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
33849
33867
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -33867,7 +33885,7 @@ function up1242(db) {
|
|
|
33867
33885
|
ON embedding_index_failures(source_type, source_id);
|
|
33868
33886
|
`);
|
|
33869
33887
|
}
|
|
33870
|
-
function
|
|
33888
|
+
function up1262(db) {
|
|
33871
33889
|
db.exec(`
|
|
33872
33890
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
33873
33891
|
id TEXT PRIMARY KEY,
|
|
@@ -33917,7 +33935,7 @@ function backfillTable2(db, params) {
|
|
|
33917
33935
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
33918
33936
|
backfill2(db, rows, params.sourceKind, params.scannedAt);
|
|
33919
33937
|
}
|
|
33920
|
-
function
|
|
33938
|
+
function up1272(db) {
|
|
33921
33939
|
db.exec(`
|
|
33922
33940
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
33923
33941
|
agent_id TEXT NOT NULL,
|
|
@@ -33974,7 +33992,7 @@ function up1262(db) {
|
|
|
33974
33992
|
scannedAt
|
|
33975
33993
|
});
|
|
33976
33994
|
}
|
|
33977
|
-
function
|
|
33995
|
+
function up1282(db) {
|
|
33978
33996
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
33979
33997
|
if (!table)
|
|
33980
33998
|
return;
|
|
@@ -34008,7 +34026,7 @@ function up1272(db) {
|
|
|
34008
34026
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
34009
34027
|
`);
|
|
34010
34028
|
}
|
|
34011
|
-
function
|
|
34029
|
+
function up1292(db) {
|
|
34012
34030
|
db.exec(`
|
|
34013
34031
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
34014
34032
|
id TEXT PRIMARY KEY,
|
|
@@ -34064,7 +34082,7 @@ function up1282(db) {
|
|
|
34064
34082
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
34065
34083
|
`);
|
|
34066
34084
|
}
|
|
34067
|
-
function
|
|
34085
|
+
function up1302(db) {
|
|
34068
34086
|
db.exec(`
|
|
34069
34087
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
34070
34088
|
ON memory_jobs(status, created_at)
|
|
@@ -34079,7 +34097,7 @@ function up1292(db) {
|
|
|
34079
34097
|
function tableExists32(db, table) {
|
|
34080
34098
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
34081
34099
|
}
|
|
34082
|
-
function
|
|
34100
|
+
function up1312(db) {
|
|
34083
34101
|
if (!tableExists32(db, "memory_jobs"))
|
|
34084
34102
|
return;
|
|
34085
34103
|
if (!tableExists32(db, "job_cancellations")) {
|
|
@@ -34128,7 +34146,7 @@ function up1302(db) {
|
|
|
34128
34146
|
AND status IN ('pending', 'leased');
|
|
34129
34147
|
`);
|
|
34130
34148
|
}
|
|
34131
|
-
function
|
|
34149
|
+
function up1322(db) {
|
|
34132
34150
|
db.exec(`
|
|
34133
34151
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
34134
34152
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -34168,7 +34186,7 @@ function up1312(db) {
|
|
|
34168
34186
|
END;
|
|
34169
34187
|
`);
|
|
34170
34188
|
}
|
|
34171
|
-
function
|
|
34189
|
+
function up1332(db) {
|
|
34172
34190
|
db.exec(`
|
|
34173
34191
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
34174
34192
|
agent_id TEXT NOT NULL,
|
|
@@ -34191,13 +34209,13 @@ function up1322(db) {
|
|
|
34191
34209
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
34192
34210
|
`);
|
|
34193
34211
|
}
|
|
34194
|
-
function
|
|
34212
|
+
function up1342(db) {
|
|
34195
34213
|
db.exec(`
|
|
34196
34214
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
34197
34215
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
34198
34216
|
`);
|
|
34199
34217
|
}
|
|
34200
|
-
function
|
|
34218
|
+
function up1352(db) {
|
|
34201
34219
|
db.exec(`
|
|
34202
34220
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
34203
34221
|
id TEXT PRIMARY KEY,
|
|
@@ -34249,7 +34267,7 @@ function up1342(db) {
|
|
|
34249
34267
|
if (!names.has("format_version"))
|
|
34250
34268
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
34251
34269
|
}
|
|
34252
|
-
function
|
|
34270
|
+
function up1362(db) {
|
|
34253
34271
|
db.exec(`
|
|
34254
34272
|
CREATE TABLE memory_head_entries_v134 (
|
|
34255
34273
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -34267,7 +34285,7 @@ function up1352(db) {
|
|
|
34267
34285
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
34268
34286
|
`);
|
|
34269
34287
|
}
|
|
34270
|
-
function
|
|
34288
|
+
function up1372(db) {
|
|
34271
34289
|
db.exec(`
|
|
34272
34290
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
34273
34291
|
agent_id TEXT NOT NULL,
|
|
@@ -34283,7 +34301,7 @@ function up1362(db) {
|
|
|
34283
34301
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
34284
34302
|
`);
|
|
34285
34303
|
}
|
|
34286
|
-
function
|
|
34304
|
+
function up1382(db) {
|
|
34287
34305
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r3) => r3.name));
|
|
34288
34306
|
for (const [name, type] of [
|
|
34289
34307
|
["entry_id", "TEXT"],
|
|
@@ -34297,7 +34315,7 @@ function up1372(db) {
|
|
|
34297
34315
|
}
|
|
34298
34316
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
34299
34317
|
}
|
|
34300
|
-
function
|
|
34318
|
+
function up1392(db) {
|
|
34301
34319
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r3) => r3.name));
|
|
34302
34320
|
for (const [name, type] of [
|
|
34303
34321
|
["head_revision", "INTEGER"],
|
|
@@ -34319,7 +34337,7 @@ function addColumnIfMissing272(db, table, column, definition) {
|
|
|
34319
34337
|
if (!hasColumn252(db, table, column))
|
|
34320
34338
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34321
34339
|
}
|
|
34322
|
-
function
|
|
34340
|
+
function up1402(db) {
|
|
34323
34341
|
addColumnIfMissing272(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
34324
34342
|
db.exec(`
|
|
34325
34343
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -34624,7 +34642,7 @@ function up1392(db) {
|
|
|
34624
34642
|
GROUP BY j.agent_id;
|
|
34625
34643
|
`);
|
|
34626
34644
|
}
|
|
34627
|
-
function
|
|
34645
|
+
function up1412(db) {
|
|
34628
34646
|
db.exec(`
|
|
34629
34647
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
34630
34648
|
agent_id TEXT NOT NULL,
|
|
@@ -34640,7 +34658,7 @@ function up1402(db) {
|
|
|
34640
34658
|
ON native_source_sync_state(agent_id, status);
|
|
34641
34659
|
`);
|
|
34642
34660
|
}
|
|
34643
|
-
function
|
|
34661
|
+
function up1422(db) {
|
|
34644
34662
|
db.exec(`
|
|
34645
34663
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
34646
34664
|
agent_id TEXT NOT NULL,
|
|
@@ -34652,7 +34670,7 @@ function up1412(db) {
|
|
|
34652
34670
|
);
|
|
34653
34671
|
`);
|
|
34654
34672
|
}
|
|
34655
|
-
function
|
|
34673
|
+
function up1432(db) {
|
|
34656
34674
|
db.exec(`
|
|
34657
34675
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
34658
34676
|
agent_id TEXT NOT NULL,
|
|
@@ -34666,13 +34684,13 @@ function up1422(db) {
|
|
|
34666
34684
|
);
|
|
34667
34685
|
`);
|
|
34668
34686
|
}
|
|
34669
|
-
function
|
|
34687
|
+
function up1442(db) {
|
|
34670
34688
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
34671
34689
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
34672
34690
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
34673
34691
|
}
|
|
34674
34692
|
}
|
|
34675
|
-
function
|
|
34693
|
+
function up1452(db) {
|
|
34676
34694
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34677
34695
|
const additions = [
|
|
34678
34696
|
["migration_phase", "TEXT"],
|
|
@@ -34707,13 +34725,13 @@ function up1442(db) {
|
|
|
34707
34725
|
`);
|
|
34708
34726
|
}
|
|
34709
34727
|
}
|
|
34710
|
-
function
|
|
34728
|
+
function up1462(db) {
|
|
34711
34729
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34712
34730
|
if (!columns.has("lease_token")) {
|
|
34713
34731
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
34714
34732
|
}
|
|
34715
34733
|
}
|
|
34716
|
-
function
|
|
34734
|
+
function up1472(db) {
|
|
34717
34735
|
db.exec(`
|
|
34718
34736
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
34719
34737
|
agent_id TEXT NOT NULL,
|
|
@@ -34731,7 +34749,7 @@ function up1462(db) {
|
|
|
34731
34749
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
34732
34750
|
`);
|
|
34733
34751
|
}
|
|
34734
|
-
function
|
|
34752
|
+
function up1482(db) {
|
|
34735
34753
|
db.exec(`
|
|
34736
34754
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
34737
34755
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -34798,16 +34816,16 @@ function up1472(db) {
|
|
|
34798
34816
|
}
|
|
34799
34817
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
34800
34818
|
}
|
|
34801
|
-
function
|
|
34819
|
+
function up1492(db) {
|
|
34802
34820
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
34803
34821
|
}
|
|
34804
|
-
function
|
|
34822
|
+
function up1502(db) {
|
|
34805
34823
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
34806
34824
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
34807
34825
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
34808
34826
|
}
|
|
34809
34827
|
}
|
|
34810
|
-
function
|
|
34828
|
+
function up1512(db) {
|
|
34811
34829
|
const addColumn = (table, column, definition) => {
|
|
34812
34830
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
34813
34831
|
let exists;
|
|
@@ -34828,7 +34846,7 @@ function addColumnIfMissing282(db, table, column, definition) {
|
|
|
34828
34846
|
if (!columns.some((row) => row.name === column))
|
|
34829
34847
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34830
34848
|
}
|
|
34831
|
-
function
|
|
34849
|
+
function up1522(db) {
|
|
34832
34850
|
addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
34833
34851
|
addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
34834
34852
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -34982,13 +35000,13 @@ var MIGRATIONS2 = [
|
|
|
34982
35000
|
{
|
|
34983
35001
|
version: 1,
|
|
34984
35002
|
name: "baseline",
|
|
34985
|
-
up:
|
|
35003
|
+
up: up310,
|
|
34986
35004
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
34987
35005
|
},
|
|
34988
35006
|
{
|
|
34989
35007
|
version: 2,
|
|
34990
35008
|
name: "pipeline-v2",
|
|
34991
|
-
up:
|
|
35009
|
+
up: up410,
|
|
34992
35010
|
artifacts: {
|
|
34993
35011
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
34994
35012
|
}
|
|
@@ -34996,12 +35014,12 @@ var MIGRATIONS2 = [
|
|
|
34996
35014
|
{
|
|
34997
35015
|
version: 3,
|
|
34998
35016
|
name: "unique-content-hash",
|
|
34999
|
-
up:
|
|
35017
|
+
up: up510
|
|
35000
35018
|
},
|
|
35001
35019
|
{
|
|
35002
35020
|
version: 4,
|
|
35003
35021
|
name: "history-actor-and-retention",
|
|
35004
|
-
up:
|
|
35022
|
+
up: up610,
|
|
35005
35023
|
artifacts: {
|
|
35006
35024
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
35007
35025
|
}
|
|
@@ -35009,7 +35027,7 @@ var MIGRATIONS2 = [
|
|
|
35009
35027
|
{
|
|
35010
35028
|
version: 5,
|
|
35011
35029
|
name: "graph-extended",
|
|
35012
|
-
up:
|
|
35030
|
+
up: up710,
|
|
35013
35031
|
artifacts: {
|
|
35014
35032
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
35015
35033
|
}
|
|
@@ -35017,7 +35035,7 @@ var MIGRATIONS2 = [
|
|
|
35017
35035
|
{
|
|
35018
35036
|
version: 6,
|
|
35019
35037
|
name: "idempotency-key",
|
|
35020
|
-
up:
|
|
35038
|
+
up: up810,
|
|
35021
35039
|
artifacts: {
|
|
35022
35040
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
35023
35041
|
}
|
|
@@ -35025,42 +35043,42 @@ var MIGRATIONS2 = [
|
|
|
35025
35043
|
{
|
|
35026
35044
|
version: 7,
|
|
35027
35045
|
name: "documents-and-connectors",
|
|
35028
|
-
up:
|
|
35046
|
+
up: up910,
|
|
35029
35047
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
35030
35048
|
},
|
|
35031
35049
|
{
|
|
35032
35050
|
version: 8,
|
|
35033
35051
|
name: "embeddings-unique-hash",
|
|
35034
|
-
up:
|
|
35052
|
+
up: up1010
|
|
35035
35053
|
},
|
|
35036
35054
|
{
|
|
35037
35055
|
version: 9,
|
|
35038
35056
|
name: "summary-jobs",
|
|
35039
|
-
up:
|
|
35057
|
+
up: up1110,
|
|
35040
35058
|
artifacts: { tables: ["summary_jobs"] }
|
|
35041
35059
|
},
|
|
35042
35060
|
{
|
|
35043
35061
|
version: 10,
|
|
35044
35062
|
name: "umap-cache",
|
|
35045
|
-
up:
|
|
35063
|
+
up: up1210,
|
|
35046
35064
|
artifacts: { tables: ["umap_cache"] }
|
|
35047
35065
|
},
|
|
35048
35066
|
{
|
|
35049
35067
|
version: 11,
|
|
35050
35068
|
name: "session-scores",
|
|
35051
|
-
up:
|
|
35069
|
+
up: up1310,
|
|
35052
35070
|
artifacts: { tables: ["session_scores"] }
|
|
35053
35071
|
},
|
|
35054
35072
|
{
|
|
35055
35073
|
version: 12,
|
|
35056
35074
|
name: "scheduled-tasks",
|
|
35057
|
-
up:
|
|
35075
|
+
up: up1410,
|
|
35058
35076
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
35059
35077
|
},
|
|
35060
35078
|
{
|
|
35061
35079
|
version: 13,
|
|
35062
35080
|
name: "ingestion-tracking",
|
|
35063
|
-
up:
|
|
35081
|
+
up: up154,
|
|
35064
35082
|
artifacts: {
|
|
35065
35083
|
columns: [
|
|
35066
35084
|
{ table: "memories", column: "source_path" },
|
|
@@ -35071,13 +35089,13 @@ var MIGRATIONS2 = [
|
|
|
35071
35089
|
{
|
|
35072
35090
|
version: 14,
|
|
35073
35091
|
name: "telemetry",
|
|
35074
|
-
up:
|
|
35092
|
+
up: up162,
|
|
35075
35093
|
artifacts: { tables: ["telemetry_events"] }
|
|
35076
35094
|
},
|
|
35077
35095
|
{
|
|
35078
35096
|
version: 15,
|
|
35079
35097
|
name: "session-memories",
|
|
35080
|
-
up:
|
|
35098
|
+
up: up172,
|
|
35081
35099
|
artifacts: {
|
|
35082
35100
|
tables: ["session_memories"],
|
|
35083
35101
|
columns: [
|
|
@@ -35089,13 +35107,13 @@ var MIGRATIONS2 = [
|
|
|
35089
35107
|
{
|
|
35090
35108
|
version: 16,
|
|
35091
35109
|
name: "session-checkpoints",
|
|
35092
|
-
up:
|
|
35110
|
+
up: up182,
|
|
35093
35111
|
artifacts: { tables: ["session_checkpoints"] }
|
|
35094
35112
|
},
|
|
35095
35113
|
{
|
|
35096
35114
|
version: 17,
|
|
35097
35115
|
name: "task-skills",
|
|
35098
|
-
up:
|
|
35116
|
+
up: up192,
|
|
35099
35117
|
artifacts: {
|
|
35100
35118
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
35101
35119
|
}
|
|
@@ -35103,13 +35121,13 @@ var MIGRATIONS2 = [
|
|
|
35103
35121
|
{
|
|
35104
35122
|
version: 18,
|
|
35105
35123
|
name: "skill-meta",
|
|
35106
|
-
up:
|
|
35124
|
+
up: up202,
|
|
35107
35125
|
artifacts: { tables: ["skill_meta"] }
|
|
35108
35126
|
},
|
|
35109
35127
|
{
|
|
35110
35128
|
version: 19,
|
|
35111
35129
|
name: "knowledge-structure",
|
|
35112
|
-
up:
|
|
35130
|
+
up: up212,
|
|
35113
35131
|
artifacts: {
|
|
35114
35132
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
35115
35133
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -35118,7 +35136,7 @@ var MIGRATIONS2 = [
|
|
|
35118
35136
|
{
|
|
35119
35137
|
version: 20,
|
|
35120
35138
|
name: "session-structural-columns",
|
|
35121
|
-
up:
|
|
35139
|
+
up: up222,
|
|
35122
35140
|
artifacts: {
|
|
35123
35141
|
columns: [
|
|
35124
35142
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -35131,7 +35149,7 @@ var MIGRATIONS2 = [
|
|
|
35131
35149
|
{
|
|
35132
35150
|
version: 21,
|
|
35133
35151
|
name: "checkpoint-structural",
|
|
35134
|
-
up:
|
|
35152
|
+
up: up232,
|
|
35135
35153
|
artifacts: {
|
|
35136
35154
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
35137
35155
|
}
|
|
@@ -35139,7 +35157,7 @@ var MIGRATIONS2 = [
|
|
|
35139
35157
|
{
|
|
35140
35158
|
version: 22,
|
|
35141
35159
|
name: "entity-pinning",
|
|
35142
|
-
up:
|
|
35160
|
+
up: up242,
|
|
35143
35161
|
artifacts: {
|
|
35144
35162
|
columns: [
|
|
35145
35163
|
{ table: "entities", column: "pinned" },
|
|
@@ -35150,17 +35168,17 @@ var MIGRATIONS2 = [
|
|
|
35150
35168
|
{
|
|
35151
35169
|
version: 23,
|
|
35152
35170
|
name: "retired-scorer-gap",
|
|
35153
|
-
up:
|
|
35171
|
+
up: up252
|
|
35154
35172
|
},
|
|
35155
35173
|
{
|
|
35156
35174
|
version: 24,
|
|
35157
35175
|
name: "retired-scorer-gap",
|
|
35158
|
-
up:
|
|
35176
|
+
up: up262
|
|
35159
35177
|
},
|
|
35160
35178
|
{
|
|
35161
35179
|
version: 25,
|
|
35162
35180
|
name: "agent-feedback",
|
|
35163
|
-
up:
|
|
35181
|
+
up: up272,
|
|
35164
35182
|
artifacts: {
|
|
35165
35183
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
35166
35184
|
}
|
|
@@ -35168,32 +35186,32 @@ var MIGRATIONS2 = [
|
|
|
35168
35186
|
{
|
|
35169
35187
|
version: 26,
|
|
35170
35188
|
name: "retired-scorer-gap",
|
|
35171
|
-
up:
|
|
35189
|
+
up: up282
|
|
35172
35190
|
},
|
|
35173
35191
|
{
|
|
35174
35192
|
version: 27,
|
|
35175
35193
|
name: "backfill-canonical-names",
|
|
35176
|
-
up:
|
|
35194
|
+
up: up292
|
|
35177
35195
|
},
|
|
35178
35196
|
{
|
|
35179
35197
|
version: 28,
|
|
35180
35198
|
name: "lossless-retention",
|
|
35181
|
-
up:
|
|
35199
|
+
up: up302
|
|
35182
35200
|
},
|
|
35183
35201
|
{
|
|
35184
35202
|
version: 29,
|
|
35185
35203
|
name: "session-summary-dag",
|
|
35186
|
-
up:
|
|
35204
|
+
up: up312
|
|
35187
35205
|
},
|
|
35188
35206
|
{
|
|
35189
35207
|
version: 30,
|
|
35190
35208
|
name: "nullable-memory-job-memory-id",
|
|
35191
|
-
up:
|
|
35209
|
+
up: up322
|
|
35192
35210
|
},
|
|
35193
35211
|
{
|
|
35194
35212
|
version: 31,
|
|
35195
35213
|
name: "dependency-reason",
|
|
35196
|
-
up:
|
|
35214
|
+
up: up332,
|
|
35197
35215
|
artifacts: {
|
|
35198
35216
|
columns: [
|
|
35199
35217
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -35204,7 +35222,7 @@ var MIGRATIONS2 = [
|
|
|
35204
35222
|
{
|
|
35205
35223
|
version: 32,
|
|
35206
35224
|
name: "embeddings-vector-column",
|
|
35207
|
-
up:
|
|
35225
|
+
up: up342,
|
|
35208
35226
|
artifacts: {
|
|
35209
35227
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
35210
35228
|
}
|
|
@@ -35212,7 +35230,7 @@ var MIGRATIONS2 = [
|
|
|
35212
35230
|
{
|
|
35213
35231
|
version: 33,
|
|
35214
35232
|
name: "scope",
|
|
35215
|
-
up:
|
|
35233
|
+
up: up352,
|
|
35216
35234
|
artifacts: {
|
|
35217
35235
|
columns: [{ table: "memories", column: "scope" }]
|
|
35218
35236
|
}
|
|
@@ -35220,17 +35238,17 @@ var MIGRATIONS2 = [
|
|
|
35220
35238
|
{
|
|
35221
35239
|
version: 34,
|
|
35222
35240
|
name: "scope-aware-dedup",
|
|
35223
|
-
up:
|
|
35241
|
+
up: up362
|
|
35224
35242
|
},
|
|
35225
35243
|
{
|
|
35226
35244
|
version: 35,
|
|
35227
35245
|
name: "entity-fts",
|
|
35228
|
-
up:
|
|
35246
|
+
up: up372
|
|
35229
35247
|
},
|
|
35230
35248
|
{
|
|
35231
35249
|
version: 36,
|
|
35232
35250
|
name: "dependency-confidence",
|
|
35233
|
-
up:
|
|
35251
|
+
up: up382,
|
|
35234
35252
|
artifacts: {
|
|
35235
35253
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
35236
35254
|
}
|
|
@@ -35238,7 +35256,7 @@ var MIGRATIONS2 = [
|
|
|
35238
35256
|
{
|
|
35239
35257
|
version: 37,
|
|
35240
35258
|
name: "entity-communities",
|
|
35241
|
-
up:
|
|
35259
|
+
up: up392,
|
|
35242
35260
|
artifacts: {
|
|
35243
35261
|
tables: ["entity_communities"],
|
|
35244
35262
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -35247,24 +35265,24 @@ var MIGRATIONS2 = [
|
|
|
35247
35265
|
{
|
|
35248
35266
|
version: 38,
|
|
35249
35267
|
name: "memory-hints",
|
|
35250
|
-
up:
|
|
35268
|
+
up: up402,
|
|
35251
35269
|
artifacts: { tables: ["memory_hints"] }
|
|
35252
35270
|
},
|
|
35253
35271
|
{
|
|
35254
35272
|
version: 39,
|
|
35255
35273
|
name: "dedup-entity-dependencies",
|
|
35256
|
-
up:
|
|
35274
|
+
up: up412
|
|
35257
35275
|
},
|
|
35258
35276
|
{
|
|
35259
35277
|
version: 40,
|
|
35260
35278
|
name: "session-transcripts",
|
|
35261
|
-
up:
|
|
35279
|
+
up: up422,
|
|
35262
35280
|
artifacts: { tables: ["session_transcripts"] }
|
|
35263
35281
|
},
|
|
35264
35282
|
{
|
|
35265
35283
|
version: 41,
|
|
35266
35284
|
name: "path-feedback",
|
|
35267
|
-
up:
|
|
35285
|
+
up: up432,
|
|
35268
35286
|
artifacts: {
|
|
35269
35287
|
tables: [
|
|
35270
35288
|
"path_feedback_events",
|
|
@@ -35279,7 +35297,7 @@ var MIGRATIONS2 = [
|
|
|
35279
35297
|
{
|
|
35280
35298
|
version: 42,
|
|
35281
35299
|
name: "session-memories-agent-id",
|
|
35282
|
-
up:
|
|
35300
|
+
up: up442,
|
|
35283
35301
|
artifacts: {
|
|
35284
35302
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
35285
35303
|
}
|
|
@@ -35287,7 +35305,7 @@ var MIGRATIONS2 = [
|
|
|
35287
35305
|
{
|
|
35288
35306
|
version: 43,
|
|
35289
35307
|
name: "agents-table",
|
|
35290
|
-
up:
|
|
35308
|
+
up: up452,
|
|
35291
35309
|
artifacts: {
|
|
35292
35310
|
tables: ["agents"],
|
|
35293
35311
|
columns: [
|
|
@@ -35299,7 +35317,7 @@ var MIGRATIONS2 = [
|
|
|
35299
35317
|
{
|
|
35300
35318
|
version: 44,
|
|
35301
35319
|
name: "memory-md-temporal-head",
|
|
35302
|
-
up:
|
|
35320
|
+
up: up462,
|
|
35303
35321
|
artifacts: {
|
|
35304
35322
|
columns: [
|
|
35305
35323
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -35311,7 +35329,7 @@ var MIGRATIONS2 = [
|
|
|
35311
35329
|
{
|
|
35312
35330
|
version: 45,
|
|
35313
35331
|
name: "lossless-working-memory-hardening",
|
|
35314
|
-
up:
|
|
35332
|
+
up: up472,
|
|
35315
35333
|
artifacts: {
|
|
35316
35334
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
35317
35335
|
columns: [
|
|
@@ -35324,17 +35342,17 @@ var MIGRATIONS2 = [
|
|
|
35324
35342
|
{
|
|
35325
35343
|
version: 46,
|
|
35326
35344
|
name: "session-summary-uniqueness",
|
|
35327
|
-
up:
|
|
35345
|
+
up: up482
|
|
35328
35346
|
},
|
|
35329
35347
|
{
|
|
35330
35348
|
version: 47,
|
|
35331
35349
|
name: "agent-scoped-temporal-uniqueness",
|
|
35332
|
-
up:
|
|
35350
|
+
up: up492
|
|
35333
35351
|
},
|
|
35334
35352
|
{
|
|
35335
35353
|
version: 48,
|
|
35336
35354
|
name: "thread-heads",
|
|
35337
|
-
up:
|
|
35355
|
+
up: up502,
|
|
35338
35356
|
artifacts: {
|
|
35339
35357
|
tables: ["memory_thread_heads"]
|
|
35340
35358
|
}
|
|
@@ -35342,7 +35360,7 @@ var MIGRATIONS2 = [
|
|
|
35342
35360
|
{
|
|
35343
35361
|
version: 49,
|
|
35344
35362
|
name: "session-extract-cursors",
|
|
35345
|
-
up:
|
|
35363
|
+
up: up512,
|
|
35346
35364
|
artifacts: {
|
|
35347
35365
|
tables: ["session_extract_cursors"]
|
|
35348
35366
|
}
|
|
@@ -35350,7 +35368,7 @@ var MIGRATIONS2 = [
|
|
|
35350
35368
|
{
|
|
35351
35369
|
version: 50,
|
|
35352
35370
|
name: "related-to-audit",
|
|
35353
|
-
up:
|
|
35371
|
+
up: up522,
|
|
35354
35372
|
artifacts: {
|
|
35355
35373
|
tables: ["entity_dependency_history"]
|
|
35356
35374
|
}
|
|
@@ -35358,7 +35376,7 @@ var MIGRATIONS2 = [
|
|
|
35358
35376
|
{
|
|
35359
35377
|
version: 51,
|
|
35360
35378
|
name: "memory-md-rolling-window-lineage",
|
|
35361
|
-
up:
|
|
35379
|
+
up: up532,
|
|
35362
35380
|
artifacts: {
|
|
35363
35381
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
35364
35382
|
columns: [
|
|
@@ -35373,7 +35391,7 @@ var MIGRATIONS2 = [
|
|
|
35373
35391
|
{
|
|
35374
35392
|
version: 52,
|
|
35375
35393
|
name: "mcp-invocations",
|
|
35376
|
-
up:
|
|
35394
|
+
up: up542,
|
|
35377
35395
|
artifacts: {
|
|
35378
35396
|
tables: ["mcp_invocations"]
|
|
35379
35397
|
}
|
|
@@ -35381,7 +35399,7 @@ var MIGRATIONS2 = [
|
|
|
35381
35399
|
{
|
|
35382
35400
|
version: 53,
|
|
35383
35401
|
name: "skill-invocations",
|
|
35384
|
-
up:
|
|
35402
|
+
up: up552,
|
|
35385
35403
|
artifacts: {
|
|
35386
35404
|
tables: ["skill_invocations"]
|
|
35387
35405
|
}
|
|
@@ -35389,7 +35407,7 @@ var MIGRATIONS2 = [
|
|
|
35389
35407
|
{
|
|
35390
35408
|
version: 54,
|
|
35391
35409
|
name: "task-agent-scope",
|
|
35392
|
-
up:
|
|
35410
|
+
up: up562,
|
|
35393
35411
|
artifacts: {
|
|
35394
35412
|
tables: ["task_scope_hints"]
|
|
35395
35413
|
}
|
|
@@ -35397,7 +35415,7 @@ var MIGRATIONS2 = [
|
|
|
35397
35415
|
{
|
|
35398
35416
|
version: 55,
|
|
35399
35417
|
name: "dreaming-state",
|
|
35400
|
-
up:
|
|
35418
|
+
up: up572,
|
|
35401
35419
|
artifacts: {
|
|
35402
35420
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
35403
35421
|
}
|
|
@@ -35405,22 +35423,22 @@ var MIGRATIONS2 = [
|
|
|
35405
35423
|
{
|
|
35406
35424
|
version: 56,
|
|
35407
35425
|
name: "agent-scoped-content-hash",
|
|
35408
|
-
up:
|
|
35426
|
+
up: up582
|
|
35409
35427
|
},
|
|
35410
35428
|
{
|
|
35411
35429
|
version: 57,
|
|
35412
35430
|
name: "memories-fts-tokenizer-repair",
|
|
35413
|
-
up:
|
|
35431
|
+
up: up592
|
|
35414
35432
|
},
|
|
35415
35433
|
{
|
|
35416
35434
|
version: 58,
|
|
35417
35435
|
name: "knowledge-graph-indices",
|
|
35418
|
-
up:
|
|
35436
|
+
up: up602
|
|
35419
35437
|
},
|
|
35420
35438
|
{
|
|
35421
35439
|
version: 59,
|
|
35422
35440
|
name: "entity-attribute-claim-key",
|
|
35423
|
-
up:
|
|
35441
|
+
up: up612,
|
|
35424
35442
|
artifacts: {
|
|
35425
35443
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
35426
35444
|
}
|
|
@@ -35428,7 +35446,7 @@ var MIGRATIONS2 = [
|
|
|
35428
35446
|
{
|
|
35429
35447
|
version: 60,
|
|
35430
35448
|
name: "entity-attribute-group-key",
|
|
35431
|
-
up:
|
|
35449
|
+
up: up622,
|
|
35432
35450
|
artifacts: {
|
|
35433
35451
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
35434
35452
|
}
|
|
@@ -35436,7 +35454,7 @@ var MIGRATIONS2 = [
|
|
|
35436
35454
|
{
|
|
35437
35455
|
version: 61,
|
|
35438
35456
|
name: "memory-artifact-source-mtime",
|
|
35439
|
-
up:
|
|
35457
|
+
up: up632,
|
|
35440
35458
|
artifacts: {
|
|
35441
35459
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
35442
35460
|
}
|
|
@@ -35444,7 +35462,7 @@ var MIGRATIONS2 = [
|
|
|
35444
35462
|
{
|
|
35445
35463
|
version: 62,
|
|
35446
35464
|
name: "memory-artifact-soft-delete",
|
|
35447
|
-
up:
|
|
35465
|
+
up: up642,
|
|
35448
35466
|
artifacts: {
|
|
35449
35467
|
columns: [
|
|
35450
35468
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -35455,12 +35473,12 @@ var MIGRATIONS2 = [
|
|
|
35455
35473
|
{
|
|
35456
35474
|
version: 63,
|
|
35457
35475
|
name: "content-only-memories-fts-update",
|
|
35458
|
-
up:
|
|
35476
|
+
up: up652
|
|
35459
35477
|
},
|
|
35460
35478
|
{
|
|
35461
35479
|
version: 64,
|
|
35462
35480
|
name: "source-graph-provenance",
|
|
35463
|
-
up:
|
|
35481
|
+
up: up662,
|
|
35464
35482
|
artifacts: {
|
|
35465
35483
|
columns: [
|
|
35466
35484
|
{ table: "entities", column: "source_path" },
|
|
@@ -35473,7 +35491,7 @@ var MIGRATIONS2 = [
|
|
|
35473
35491
|
{
|
|
35474
35492
|
version: 65,
|
|
35475
35493
|
name: "source-embedding-agent-scope",
|
|
35476
|
-
up:
|
|
35494
|
+
up: up672,
|
|
35477
35495
|
artifacts: {
|
|
35478
35496
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
35479
35497
|
}
|
|
@@ -35481,7 +35499,7 @@ var MIGRATIONS2 = [
|
|
|
35481
35499
|
{
|
|
35482
35500
|
version: 66,
|
|
35483
35501
|
name: "memory-search-telemetry",
|
|
35484
|
-
up:
|
|
35502
|
+
up: up682,
|
|
35485
35503
|
artifacts: {
|
|
35486
35504
|
tables: ["memory_search_telemetry"]
|
|
35487
35505
|
}
|
|
@@ -35489,7 +35507,7 @@ var MIGRATIONS2 = [
|
|
|
35489
35507
|
{
|
|
35490
35508
|
version: 67,
|
|
35491
35509
|
name: "ontology-proposals",
|
|
35492
|
-
up:
|
|
35510
|
+
up: up692,
|
|
35493
35511
|
artifacts: {
|
|
35494
35512
|
tables: ["ontology_proposals"],
|
|
35495
35513
|
columns: [
|
|
@@ -35503,7 +35521,7 @@ var MIGRATIONS2 = [
|
|
|
35503
35521
|
{
|
|
35504
35522
|
version: 68,
|
|
35505
35523
|
name: "daily-reflections",
|
|
35506
|
-
up:
|
|
35524
|
+
up: up702,
|
|
35507
35525
|
artifacts: {
|
|
35508
35526
|
tables: ["daily_reflections"]
|
|
35509
35527
|
}
|
|
@@ -35511,7 +35529,7 @@ var MIGRATIONS2 = [
|
|
|
35511
35529
|
{
|
|
35512
35530
|
version: 69,
|
|
35513
35531
|
name: "daily-reflections-multiple-insights",
|
|
35514
|
-
up:
|
|
35532
|
+
up: up712,
|
|
35515
35533
|
artifacts: {
|
|
35516
35534
|
tables: ["daily_reflections"]
|
|
35517
35535
|
}
|
|
@@ -35519,7 +35537,7 @@ var MIGRATIONS2 = [
|
|
|
35519
35537
|
{
|
|
35520
35538
|
version: 70,
|
|
35521
35539
|
name: "ontology-control-plane-state",
|
|
35522
|
-
up:
|
|
35540
|
+
up: up722,
|
|
35523
35541
|
artifacts: {
|
|
35524
35542
|
columns: [
|
|
35525
35543
|
{ table: "entities", column: "status" },
|
|
@@ -35534,7 +35552,7 @@ var MIGRATIONS2 = [
|
|
|
35534
35552
|
{
|
|
35535
35553
|
version: 71,
|
|
35536
35554
|
name: "epistemic-assertions",
|
|
35537
|
-
up:
|
|
35555
|
+
up: up732,
|
|
35538
35556
|
artifacts: {
|
|
35539
35557
|
tables: ["epistemic_assertions"]
|
|
35540
35558
|
}
|
|
@@ -35542,7 +35560,7 @@ var MIGRATIONS2 = [
|
|
|
35542
35560
|
{
|
|
35543
35561
|
version: 72,
|
|
35544
35562
|
name: "agent-scoped-idempotency-key",
|
|
35545
|
-
up:
|
|
35563
|
+
up: up742,
|
|
35546
35564
|
artifacts: {
|
|
35547
35565
|
columns: [
|
|
35548
35566
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -35553,7 +35571,7 @@ var MIGRATIONS2 = [
|
|
|
35553
35571
|
{
|
|
35554
35572
|
version: 73,
|
|
35555
35573
|
name: "recall-context-dedupe",
|
|
35556
|
-
up:
|
|
35574
|
+
up: up752,
|
|
35557
35575
|
artifacts: {
|
|
35558
35576
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
35559
35577
|
}
|
|
@@ -35561,7 +35579,7 @@ var MIGRATIONS2 = [
|
|
|
35561
35579
|
{
|
|
35562
35580
|
version: 74,
|
|
35563
35581
|
name: "aggregate-memory-links",
|
|
35564
|
-
up:
|
|
35582
|
+
up: up762,
|
|
35565
35583
|
artifacts: {
|
|
35566
35584
|
tables: ["aggregate_memory_sources"]
|
|
35567
35585
|
}
|
|
@@ -35569,7 +35587,7 @@ var MIGRATIONS2 = [
|
|
|
35569
35587
|
{
|
|
35570
35588
|
version: 75,
|
|
35571
35589
|
name: "memory-artifact-source-provenance",
|
|
35572
|
-
up:
|
|
35590
|
+
up: up772,
|
|
35573
35591
|
artifacts: {
|
|
35574
35592
|
columns: [
|
|
35575
35593
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -35583,7 +35601,7 @@ var MIGRATIONS2 = [
|
|
|
35583
35601
|
{
|
|
35584
35602
|
version: 76,
|
|
35585
35603
|
name: "temporal-edges",
|
|
35586
|
-
up:
|
|
35604
|
+
up: up782,
|
|
35587
35605
|
artifacts: {
|
|
35588
35606
|
tables: ["temporal_edges"]
|
|
35589
35607
|
}
|
|
@@ -35591,7 +35609,7 @@ var MIGRATIONS2 = [
|
|
|
35591
35609
|
{
|
|
35592
35610
|
version: 77,
|
|
35593
35611
|
name: "entity-aliases",
|
|
35594
|
-
up:
|
|
35612
|
+
up: up792,
|
|
35595
35613
|
artifacts: {
|
|
35596
35614
|
tables: ["entity_aliases"]
|
|
35597
35615
|
}
|
|
@@ -35599,7 +35617,7 @@ var MIGRATIONS2 = [
|
|
|
35599
35617
|
{
|
|
35600
35618
|
version: 78,
|
|
35601
35619
|
name: "api-keys",
|
|
35602
|
-
up:
|
|
35620
|
+
up: up802,
|
|
35603
35621
|
artifacts: {
|
|
35604
35622
|
tables: ["api_keys"]
|
|
35605
35623
|
}
|
|
@@ -35607,7 +35625,7 @@ var MIGRATIONS2 = [
|
|
|
35607
35625
|
{
|
|
35608
35626
|
version: 79,
|
|
35609
35627
|
name: "transcript-capture-jobs",
|
|
35610
|
-
up:
|
|
35628
|
+
up: up812,
|
|
35611
35629
|
artifacts: {
|
|
35612
35630
|
tables: ["transcript_capture_jobs"]
|
|
35613
35631
|
}
|
|
@@ -35615,7 +35633,7 @@ var MIGRATIONS2 = [
|
|
|
35615
35633
|
{
|
|
35616
35634
|
version: 80,
|
|
35617
35635
|
name: "document-scope-columns",
|
|
35618
|
-
up:
|
|
35636
|
+
up: up822,
|
|
35619
35637
|
artifacts: {
|
|
35620
35638
|
columns: [
|
|
35621
35639
|
{ table: "documents", column: "agent_id" },
|
|
@@ -35626,7 +35644,7 @@ var MIGRATIONS2 = [
|
|
|
35626
35644
|
{
|
|
35627
35645
|
version: 81,
|
|
35628
35646
|
name: "aggregate-evidence-sources",
|
|
35629
|
-
up:
|
|
35647
|
+
up: up832,
|
|
35630
35648
|
artifacts: {
|
|
35631
35649
|
tables: ["aggregate_evidence_sources"]
|
|
35632
35650
|
}
|
|
@@ -35634,7 +35652,7 @@ var MIGRATIONS2 = [
|
|
|
35634
35652
|
{
|
|
35635
35653
|
version: 82,
|
|
35636
35654
|
name: "skill-invocations-harness",
|
|
35637
|
-
up:
|
|
35655
|
+
up: up842,
|
|
35638
35656
|
artifacts: {
|
|
35639
35657
|
columns: [
|
|
35640
35658
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -35645,7 +35663,7 @@ var MIGRATIONS2 = [
|
|
|
35645
35663
|
{
|
|
35646
35664
|
version: 83,
|
|
35647
35665
|
name: "memory-lifecycle-repair",
|
|
35648
|
-
up:
|
|
35666
|
+
up: up852,
|
|
35649
35667
|
artifacts: {
|
|
35650
35668
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
35651
35669
|
columns: [
|
|
@@ -35660,7 +35678,7 @@ var MIGRATIONS2 = [
|
|
|
35660
35678
|
{
|
|
35661
35679
|
version: 84,
|
|
35662
35680
|
name: "legacy-markdown-import-state",
|
|
35663
|
-
up:
|
|
35681
|
+
up: up862,
|
|
35664
35682
|
artifacts: {
|
|
35665
35683
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
35666
35684
|
}
|
|
@@ -35668,7 +35686,7 @@ var MIGRATIONS2 = [
|
|
|
35668
35686
|
{
|
|
35669
35687
|
version: 85,
|
|
35670
35688
|
name: "backfill-relations-to-dependencies",
|
|
35671
|
-
up:
|
|
35689
|
+
up: up872,
|
|
35672
35690
|
artifacts: {
|
|
35673
35691
|
tables: ["entity_dependencies"]
|
|
35674
35692
|
}
|
|
@@ -35676,7 +35694,7 @@ var MIGRATIONS2 = [
|
|
|
35676
35694
|
{
|
|
35677
35695
|
version: 86,
|
|
35678
35696
|
name: "summary-jobs-content-hash",
|
|
35679
|
-
up:
|
|
35697
|
+
up: up882,
|
|
35680
35698
|
artifacts: {
|
|
35681
35699
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
35682
35700
|
}
|
|
@@ -35684,7 +35702,7 @@ var MIGRATIONS2 = [
|
|
|
35684
35702
|
{
|
|
35685
35703
|
version: 87,
|
|
35686
35704
|
name: "summary-jobs-boundary-reason",
|
|
35687
|
-
up:
|
|
35705
|
+
up: up892,
|
|
35688
35706
|
artifacts: {
|
|
35689
35707
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
35690
35708
|
}
|
|
@@ -35692,7 +35710,7 @@ var MIGRATIONS2 = [
|
|
|
35692
35710
|
{
|
|
35693
35711
|
version: 88,
|
|
35694
35712
|
name: "transcript-recovery-files",
|
|
35695
|
-
up:
|
|
35713
|
+
up: up902,
|
|
35696
35714
|
artifacts: {
|
|
35697
35715
|
tables: ["transcript_recovery_files"]
|
|
35698
35716
|
}
|
|
@@ -35700,7 +35718,7 @@ var MIGRATIONS2 = [
|
|
|
35700
35718
|
{
|
|
35701
35719
|
version: 89,
|
|
35702
35720
|
name: "job-cancellations",
|
|
35703
|
-
up:
|
|
35721
|
+
up: up912,
|
|
35704
35722
|
artifacts: {
|
|
35705
35723
|
tables: ["job_cancellations"]
|
|
35706
35724
|
}
|
|
@@ -35708,7 +35726,7 @@ var MIGRATIONS2 = [
|
|
|
35708
35726
|
{
|
|
35709
35727
|
version: 90,
|
|
35710
35728
|
name: "job-archive",
|
|
35711
|
-
up:
|
|
35729
|
+
up: up922,
|
|
35712
35730
|
artifacts: {
|
|
35713
35731
|
tables: ["job_archive"]
|
|
35714
35732
|
}
|
|
@@ -35716,25 +35734,25 @@ var MIGRATIONS2 = [
|
|
|
35716
35734
|
{
|
|
35717
35735
|
version: 91,
|
|
35718
35736
|
name: "embedding-index-generations",
|
|
35719
|
-
up:
|
|
35737
|
+
up: up932,
|
|
35720
35738
|
artifacts: { tables: ["embedding_index_state"] }
|
|
35721
35739
|
},
|
|
35722
35740
|
{
|
|
35723
35741
|
version: 92,
|
|
35724
35742
|
name: "embedding-staging-store",
|
|
35725
|
-
up:
|
|
35743
|
+
up: up942,
|
|
35726
35744
|
artifacts: { tables: ["embeddings_staging"] }
|
|
35727
35745
|
},
|
|
35728
35746
|
{
|
|
35729
35747
|
version: 93,
|
|
35730
35748
|
name: "dreaming-evidence-cursor",
|
|
35731
|
-
up:
|
|
35749
|
+
up: up952,
|
|
35732
35750
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
35733
35751
|
},
|
|
35734
35752
|
{
|
|
35735
35753
|
version: 94,
|
|
35736
35754
|
name: "memory-kind",
|
|
35737
|
-
up:
|
|
35755
|
+
up: up962,
|
|
35738
35756
|
artifacts: {
|
|
35739
35757
|
columns: [
|
|
35740
35758
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -35745,35 +35763,35 @@ var MIGRATIONS2 = [
|
|
|
35745
35763
|
{
|
|
35746
35764
|
version: 95,
|
|
35747
35765
|
name: "compaction-recall-projections",
|
|
35748
|
-
up:
|
|
35766
|
+
up: up972
|
|
35749
35767
|
},
|
|
35750
35768
|
{
|
|
35751
35769
|
version: 96,
|
|
35752
35770
|
name: "retire-legacy-ingestion",
|
|
35753
|
-
up:
|
|
35771
|
+
up: up982
|
|
35754
35772
|
},
|
|
35755
35773
|
{
|
|
35756
35774
|
version: 97,
|
|
35757
35775
|
name: "dreaming-failure-backoff",
|
|
35758
|
-
up:
|
|
35776
|
+
up: up992,
|
|
35759
35777
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
35760
35778
|
},
|
|
35761
35779
|
{
|
|
35762
35780
|
version: 98,
|
|
35763
35781
|
name: "dreaming-evidence-exclusions",
|
|
35764
|
-
up:
|
|
35782
|
+
up: up1002,
|
|
35765
35783
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
35766
35784
|
},
|
|
35767
35785
|
{
|
|
35768
35786
|
version: 99,
|
|
35769
35787
|
name: "dreaming-tool-calls",
|
|
35770
|
-
up:
|
|
35788
|
+
up: up1012,
|
|
35771
35789
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
35772
35790
|
},
|
|
35773
35791
|
{
|
|
35774
35792
|
version: 100,
|
|
35775
35793
|
name: "dreaming-runbook",
|
|
35776
|
-
up:
|
|
35794
|
+
up: up1022,
|
|
35777
35795
|
artifacts: {
|
|
35778
35796
|
columns: [
|
|
35779
35797
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -35784,23 +35802,23 @@ var MIGRATIONS2 = [
|
|
|
35784
35802
|
{
|
|
35785
35803
|
version: 101,
|
|
35786
35804
|
name: "dreaming-attention",
|
|
35787
|
-
up:
|
|
35805
|
+
up: up1032,
|
|
35788
35806
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35789
35807
|
},
|
|
35790
35808
|
{
|
|
35791
35809
|
version: 102,
|
|
35792
35810
|
name: "attribute-semantic-memories",
|
|
35793
|
-
up:
|
|
35811
|
+
up: up1042
|
|
35794
35812
|
},
|
|
35795
35813
|
{
|
|
35796
35814
|
version: 103,
|
|
35797
35815
|
name: "semantic-memory-kind",
|
|
35798
|
-
up:
|
|
35816
|
+
up: up1052
|
|
35799
35817
|
},
|
|
35800
35818
|
{
|
|
35801
35819
|
version: 104,
|
|
35802
35820
|
name: "derived-memory-provenance",
|
|
35803
|
-
up:
|
|
35821
|
+
up: up1062,
|
|
35804
35822
|
artifacts: {
|
|
35805
35823
|
tables: ["derived_memory_sources"],
|
|
35806
35824
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -35809,12 +35827,12 @@ var MIGRATIONS2 = [
|
|
|
35809
35827
|
{
|
|
35810
35828
|
version: 105,
|
|
35811
35829
|
name: "agent-scoped-entity-name",
|
|
35812
|
-
up:
|
|
35830
|
+
up: up1072
|
|
35813
35831
|
},
|
|
35814
35832
|
{
|
|
35815
35833
|
version: 106,
|
|
35816
35834
|
name: "memory-review-after",
|
|
35817
|
-
up:
|
|
35835
|
+
up: up1082,
|
|
35818
35836
|
artifacts: {
|
|
35819
35837
|
columns: [{ table: "memories", column: "review_after" }]
|
|
35820
35838
|
}
|
|
@@ -35822,7 +35840,7 @@ var MIGRATIONS2 = [
|
|
|
35822
35840
|
{
|
|
35823
35841
|
version: 107,
|
|
35824
35842
|
name: "dreaming-pass-usage",
|
|
35825
|
-
up:
|
|
35843
|
+
up: up1092,
|
|
35826
35844
|
artifacts: {
|
|
35827
35845
|
columns: [
|
|
35828
35846
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -35836,7 +35854,7 @@ var MIGRATIONS2 = [
|
|
|
35836
35854
|
{
|
|
35837
35855
|
version: 108,
|
|
35838
35856
|
name: "embedding-usage",
|
|
35839
|
-
up:
|
|
35857
|
+
up: up1102,
|
|
35840
35858
|
artifacts: {
|
|
35841
35859
|
tables: ["embedding_usage"]
|
|
35842
35860
|
}
|
|
@@ -35844,7 +35862,7 @@ var MIGRATIONS2 = [
|
|
|
35844
35862
|
{
|
|
35845
35863
|
version: 109,
|
|
35846
35864
|
name: "telemetry-install",
|
|
35847
|
-
up:
|
|
35865
|
+
up: up1112,
|
|
35848
35866
|
artifacts: {
|
|
35849
35867
|
tables: ["telemetry_install"]
|
|
35850
35868
|
}
|
|
@@ -35852,12 +35870,12 @@ var MIGRATIONS2 = [
|
|
|
35852
35870
|
{
|
|
35853
35871
|
version: 110,
|
|
35854
35872
|
name: "memory-mention-join-index",
|
|
35855
|
-
up:
|
|
35873
|
+
up: up1122
|
|
35856
35874
|
},
|
|
35857
35875
|
{
|
|
35858
35876
|
version: 111,
|
|
35859
35877
|
name: "telemetry-first-use",
|
|
35860
|
-
up:
|
|
35878
|
+
up: up1132,
|
|
35861
35879
|
artifacts: {
|
|
35862
35880
|
columns: [
|
|
35863
35881
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -35868,7 +35886,7 @@ var MIGRATIONS2 = [
|
|
|
35868
35886
|
{
|
|
35869
35887
|
version: 112,
|
|
35870
35888
|
name: "telemetry-queue-ownership",
|
|
35871
|
-
up:
|
|
35889
|
+
up: up1142,
|
|
35872
35890
|
artifacts: {
|
|
35873
35891
|
columns: [
|
|
35874
35892
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -35880,7 +35898,7 @@ var MIGRATIONS2 = [
|
|
|
35880
35898
|
{
|
|
35881
35899
|
version: 113,
|
|
35882
35900
|
name: "session-claims",
|
|
35883
|
-
up:
|
|
35901
|
+
up: up1152,
|
|
35884
35902
|
artifacts: {
|
|
35885
35903
|
tables: ["session_claims"],
|
|
35886
35904
|
columns: [
|
|
@@ -35894,12 +35912,12 @@ var MIGRATIONS2 = [
|
|
|
35894
35912
|
{
|
|
35895
35913
|
version: 114,
|
|
35896
35914
|
name: "memory-traversal-hydration-index",
|
|
35897
|
-
up:
|
|
35915
|
+
up: up1162
|
|
35898
35916
|
},
|
|
35899
35917
|
{
|
|
35900
35918
|
version: 115,
|
|
35901
35919
|
name: "cross-agent-message-notifications",
|
|
35902
|
-
up:
|
|
35920
|
+
up: up1172,
|
|
35903
35921
|
artifacts: {
|
|
35904
35922
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
35905
35923
|
}
|
|
@@ -35907,7 +35925,7 @@ var MIGRATIONS2 = [
|
|
|
35907
35925
|
{
|
|
35908
35926
|
version: 116,
|
|
35909
35927
|
name: "acp-delivery-reconciliation",
|
|
35910
|
-
up:
|
|
35928
|
+
up: up1182,
|
|
35911
35929
|
artifacts: {
|
|
35912
35930
|
columns: [
|
|
35913
35931
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -35921,7 +35939,7 @@ var MIGRATIONS2 = [
|
|
|
35921
35939
|
{
|
|
35922
35940
|
version: 117,
|
|
35923
35941
|
name: "retire-summary-worker",
|
|
35924
|
-
up:
|
|
35942
|
+
up: up1192,
|
|
35925
35943
|
artifacts: {
|
|
35926
35944
|
columns: [
|
|
35927
35945
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -35932,24 +35950,24 @@ var MIGRATIONS2 = [
|
|
|
35932
35950
|
{
|
|
35933
35951
|
version: 118,
|
|
35934
35952
|
name: "queue-pressure-indices",
|
|
35935
|
-
up:
|
|
35953
|
+
up: up1202
|
|
35936
35954
|
},
|
|
35937
35955
|
{
|
|
35938
35956
|
version: 119,
|
|
35939
35957
|
name: "telemetry-version-observation",
|
|
35940
|
-
up:
|
|
35958
|
+
up: up1212,
|
|
35941
35959
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
35942
35960
|
},
|
|
35943
35961
|
{
|
|
35944
35962
|
version: 120,
|
|
35945
35963
|
name: "source-lifecycle-telemetry",
|
|
35946
|
-
up:
|
|
35964
|
+
up: up1222,
|
|
35947
35965
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
35948
35966
|
},
|
|
35949
35967
|
{
|
|
35950
35968
|
version: 121,
|
|
35951
35969
|
name: "telemetry-delivery-health",
|
|
35952
|
-
up:
|
|
35970
|
+
up: up1232,
|
|
35953
35971
|
artifacts: {
|
|
35954
35972
|
tables: ["telemetry_delivery_state"],
|
|
35955
35973
|
columns: [
|
|
@@ -35963,7 +35981,7 @@ var MIGRATIONS2 = [
|
|
|
35963
35981
|
{
|
|
35964
35982
|
version: 122,
|
|
35965
35983
|
name: "dreaming-evidence-retry",
|
|
35966
|
-
up:
|
|
35984
|
+
up: up1242,
|
|
35967
35985
|
artifacts: {
|
|
35968
35986
|
columns: [
|
|
35969
35987
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -35976,13 +35994,13 @@ var MIGRATIONS2 = [
|
|
|
35976
35994
|
{
|
|
35977
35995
|
version: 123,
|
|
35978
35996
|
name: "embedding-index-failures",
|
|
35979
|
-
up:
|
|
35997
|
+
up: up1252,
|
|
35980
35998
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
35981
35999
|
},
|
|
35982
36000
|
{
|
|
35983
36001
|
version: 124,
|
|
35984
36002
|
name: "import-derived-lifecycle",
|
|
35985
|
-
up:
|
|
36003
|
+
up: up1262,
|
|
35986
36004
|
artifacts: {
|
|
35987
36005
|
tables: ["imported_source_lifecycle"]
|
|
35988
36006
|
}
|
|
@@ -35990,77 +36008,77 @@ var MIGRATIONS2 = [
|
|
|
35990
36008
|
{
|
|
35991
36009
|
version: 125,
|
|
35992
36010
|
name: "memory-content-safety",
|
|
35993
|
-
up:
|
|
36011
|
+
up: up1272,
|
|
35994
36012
|
artifacts: { tables: ["memory_content_safety"] }
|
|
35995
36013
|
},
|
|
35996
36014
|
{
|
|
35997
36015
|
version: 126,
|
|
35998
36016
|
name: "dreaming-surprisal-attention",
|
|
35999
|
-
up:
|
|
36017
|
+
up: up1282,
|
|
36000
36018
|
artifacts: { tables: ["dreaming_attention"] }
|
|
36001
36019
|
},
|
|
36002
36020
|
{
|
|
36003
36021
|
version: 127,
|
|
36004
36022
|
name: "ontology-contradictions",
|
|
36005
|
-
up:
|
|
36023
|
+
up: up1292,
|
|
36006
36024
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
36007
36025
|
},
|
|
36008
36026
|
{
|
|
36009
36027
|
version: 128,
|
|
36010
36028
|
name: "bounded-queue-diagnostics",
|
|
36011
|
-
up:
|
|
36029
|
+
up: up1302
|
|
36012
36030
|
},
|
|
36013
36031
|
{
|
|
36014
36032
|
version: 129,
|
|
36015
36033
|
name: "retire-structural-jobs",
|
|
36016
|
-
up:
|
|
36034
|
+
up: up1312
|
|
36017
36035
|
},
|
|
36018
36036
|
{
|
|
36019
36037
|
version: 130,
|
|
36020
36038
|
name: "embedding-repair-state",
|
|
36021
|
-
up:
|
|
36039
|
+
up: up1322,
|
|
36022
36040
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
36023
36041
|
},
|
|
36024
36042
|
{
|
|
36025
36043
|
version: 131,
|
|
36026
36044
|
name: "dreaming-evidence-consumption",
|
|
36027
|
-
up:
|
|
36045
|
+
up: up1332,
|
|
36028
36046
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
36029
36047
|
},
|
|
36030
36048
|
{
|
|
36031
36049
|
version: 132,
|
|
36032
36050
|
name: "observer-scoped-epistemic-assertions",
|
|
36033
|
-
up:
|
|
36051
|
+
up: up1342,
|
|
36034
36052
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
36035
36053
|
},
|
|
36036
36054
|
{
|
|
36037
36055
|
version: 133,
|
|
36038
36056
|
name: "dreaming-memory-head",
|
|
36039
|
-
up:
|
|
36057
|
+
up: up1352,
|
|
36040
36058
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
36041
36059
|
},
|
|
36042
36060
|
{
|
|
36043
36061
|
version: 134,
|
|
36044
36062
|
name: "scope-memory-head-entries",
|
|
36045
|
-
up:
|
|
36063
|
+
up: up1362,
|
|
36046
36064
|
artifacts: { tables: ["memory_head_entries"] }
|
|
36047
36065
|
},
|
|
36048
36066
|
{
|
|
36049
36067
|
version: 135,
|
|
36050
36068
|
name: "memory-head-publication",
|
|
36051
|
-
up:
|
|
36069
|
+
up: up1372,
|
|
36052
36070
|
artifacts: { tables: ["memory_head_publications"] }
|
|
36053
36071
|
},
|
|
36054
36072
|
{
|
|
36055
36073
|
version: 136,
|
|
36056
36074
|
name: "memory-head-revisions",
|
|
36057
|
-
up:
|
|
36075
|
+
up: up1382,
|
|
36058
36076
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
36059
36077
|
},
|
|
36060
36078
|
{
|
|
36061
36079
|
version: 137,
|
|
36062
36080
|
name: "dreaming-head-manifest",
|
|
36063
|
-
up:
|
|
36081
|
+
up: up1392,
|
|
36064
36082
|
artifacts: {
|
|
36065
36083
|
columns: [
|
|
36066
36084
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -36071,7 +36089,7 @@ var MIGRATIONS2 = [
|
|
|
36071
36089
|
{
|
|
36072
36090
|
version: 138,
|
|
36073
36091
|
name: "bounded-status-projections",
|
|
36074
|
-
up:
|
|
36092
|
+
up: up1402,
|
|
36075
36093
|
artifacts: {
|
|
36076
36094
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
36077
36095
|
}
|
|
@@ -36079,31 +36097,31 @@ var MIGRATIONS2 = [
|
|
|
36079
36097
|
{
|
|
36080
36098
|
version: 139,
|
|
36081
36099
|
name: "native-source-sync-state",
|
|
36082
|
-
up:
|
|
36100
|
+
up: up1412,
|
|
36083
36101
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
36084
36102
|
},
|
|
36085
36103
|
{
|
|
36086
36104
|
version: 140,
|
|
36087
36105
|
name: "transcript-recovery-frontier",
|
|
36088
|
-
up:
|
|
36106
|
+
up: up1422,
|
|
36089
36107
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
36090
36108
|
},
|
|
36091
36109
|
{
|
|
36092
36110
|
version: 141,
|
|
36093
36111
|
name: "source-sync-checkpoints",
|
|
36094
|
-
up:
|
|
36112
|
+
up: up1432,
|
|
36095
36113
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
36096
36114
|
},
|
|
36097
36115
|
{
|
|
36098
36116
|
version: 142,
|
|
36099
36117
|
name: "source-sync-frontier",
|
|
36100
|
-
up:
|
|
36118
|
+
up: up1442,
|
|
36101
36119
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
36102
36120
|
},
|
|
36103
36121
|
{
|
|
36104
36122
|
version: 143,
|
|
36105
36123
|
name: "embedding-index-progress",
|
|
36106
|
-
up:
|
|
36124
|
+
up: up1452,
|
|
36107
36125
|
artifacts: {
|
|
36108
36126
|
columns: [
|
|
36109
36127
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -36119,19 +36137,19 @@ var MIGRATIONS2 = [
|
|
|
36119
36137
|
{
|
|
36120
36138
|
version: 144,
|
|
36121
36139
|
name: "memory-job-lease-token",
|
|
36122
|
-
up:
|
|
36140
|
+
up: up1462,
|
|
36123
36141
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
36124
36142
|
},
|
|
36125
36143
|
{
|
|
36126
36144
|
version: 145,
|
|
36127
36145
|
name: "dreaming-evidence-reviews",
|
|
36128
|
-
up:
|
|
36146
|
+
up: up1472,
|
|
36129
36147
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
36130
36148
|
},
|
|
36131
36149
|
{
|
|
36132
36150
|
version: 146,
|
|
36133
36151
|
name: "source-transcript-import",
|
|
36134
|
-
up:
|
|
36152
|
+
up: up1482,
|
|
36135
36153
|
artifacts: {
|
|
36136
36154
|
tables: [
|
|
36137
36155
|
"source_import_jobs",
|
|
@@ -36150,19 +36168,19 @@ var MIGRATIONS2 = [
|
|
|
36150
36168
|
{
|
|
36151
36169
|
version: 147,
|
|
36152
36170
|
name: "source-import-replay-file-slots",
|
|
36153
|
-
up:
|
|
36171
|
+
up: up1492,
|
|
36154
36172
|
artifacts: { tables: ["source_import_files"] }
|
|
36155
36173
|
},
|
|
36156
36174
|
{
|
|
36157
36175
|
version: 148,
|
|
36158
36176
|
name: "source-import-attempt-provenance",
|
|
36159
|
-
up:
|
|
36177
|
+
up: up1502,
|
|
36160
36178
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
36161
36179
|
},
|
|
36162
36180
|
{
|
|
36163
36181
|
version: 149,
|
|
36164
36182
|
name: "transcript-import-state-machine",
|
|
36165
|
-
up:
|
|
36183
|
+
up: up1512,
|
|
36166
36184
|
artifacts: {
|
|
36167
36185
|
columns: [
|
|
36168
36186
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -36174,7 +36192,7 @@ var MIGRATIONS2 = [
|
|
|
36174
36192
|
{
|
|
36175
36193
|
version: 150,
|
|
36176
36194
|
name: "memory-head-freshness",
|
|
36177
|
-
up:
|
|
36195
|
+
up: up1522,
|
|
36178
36196
|
artifacts: {
|
|
36179
36197
|
columns: [
|
|
36180
36198
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -36185,7 +36203,7 @@ var MIGRATIONS2 = [
|
|
|
36185
36203
|
{
|
|
36186
36204
|
version: 151,
|
|
36187
36205
|
name: "transcript-import-bytes",
|
|
36188
|
-
up:
|
|
36206
|
+
up: up153,
|
|
36189
36207
|
artifacts: {
|
|
36190
36208
|
tables: [
|
|
36191
36209
|
"source_import_chunks",
|
|
@@ -36210,6 +36228,12 @@ var MIGRATIONS2 = [
|
|
|
36210
36228
|
}))
|
|
36211
36229
|
]
|
|
36212
36230
|
}
|
|
36231
|
+
},
|
|
36232
|
+
{
|
|
36233
|
+
version: 152,
|
|
36234
|
+
name: "memory-artifact-sha-index",
|
|
36235
|
+
up: up210,
|
|
36236
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
36213
36237
|
}
|
|
36214
36238
|
];
|
|
36215
36239
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|