@signetai/connector-hermes-agent 0.221.10 → 0.221.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +630 -606
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11371,6 +11371,12 @@ function up(db) {
|
|
|
11371
11371
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
11372
11372
|
`);
|
|
11373
11373
|
}
|
|
11374
|
+
function up2(db) {
|
|
11375
|
+
db.exec(`
|
|
11376
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
11377
|
+
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)
|
|
11378
|
+
`);
|
|
11379
|
+
}
|
|
11374
11380
|
var MEMORIES_FTS_TOKENIZER = "unicode61";
|
|
11375
11381
|
var FTS_STATE_TABLE = "memories_fts_state";
|
|
11376
11382
|
function normalizeSql(sql) {
|
|
@@ -11486,7 +11492,7 @@ function memoriesFtsNeedsTokenizerRepair(sql) {
|
|
|
11486
11492
|
return true;
|
|
11487
11493
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER}'`);
|
|
11488
11494
|
}
|
|
11489
|
-
function
|
|
11495
|
+
function up3(db) {
|
|
11490
11496
|
db.exec(`
|
|
11491
11497
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
11492
11498
|
version INTEGER PRIMARY KEY,
|
|
@@ -11584,7 +11590,7 @@ function addColumnIfMissing(db, table, column, definition) {
|
|
|
11584
11590
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11585
11591
|
}
|
|
11586
11592
|
}
|
|
11587
|
-
function
|
|
11593
|
+
function up4(db) {
|
|
11588
11594
|
addColumnIfMissing(db, "memories", "content_hash", "TEXT");
|
|
11589
11595
|
addColumnIfMissing(db, "memories", "normalized_content", "TEXT");
|
|
11590
11596
|
addColumnIfMissing(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -11702,7 +11708,7 @@ function addColumnIfMissing2(db, table, column, definition) {
|
|
|
11702
11708
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11703
11709
|
return true;
|
|
11704
11710
|
}
|
|
11705
|
-
function
|
|
11711
|
+
function up5(db) {
|
|
11706
11712
|
addColumnIfMissing2(db, "memories", "why", "TEXT");
|
|
11707
11713
|
addColumnIfMissing2(db, "memories", "project", "TEXT");
|
|
11708
11714
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -11739,7 +11745,7 @@ function addColumnIfMissing3(db, table, column, definition) {
|
|
|
11739
11745
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11740
11746
|
}
|
|
11741
11747
|
}
|
|
11742
|
-
function
|
|
11748
|
+
function up6(db) {
|
|
11743
11749
|
addColumnIfMissing3(db, "memory_history", "actor_type", "TEXT");
|
|
11744
11750
|
addColumnIfMissing3(db, "memory_history", "session_id", "TEXT");
|
|
11745
11751
|
addColumnIfMissing3(db, "memory_history", "request_id", "TEXT");
|
|
@@ -11772,7 +11778,7 @@ function addColumnIfMissing4(db, table, column, definition) {
|
|
|
11772
11778
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11773
11779
|
}
|
|
11774
11780
|
}
|
|
11775
|
-
function
|
|
11781
|
+
function up7(db) {
|
|
11776
11782
|
addColumnIfMissing4(db, "entities", "canonical_name", "TEXT");
|
|
11777
11783
|
addColumnIfMissing4(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
11778
11784
|
addColumnIfMissing4(db, "entities", "embedding", "BLOB");
|
|
@@ -11789,7 +11795,7 @@ function hasColumn4(db, table, column) {
|
|
|
11789
11795
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11790
11796
|
return rows.some((r2) => r2.name === column);
|
|
11791
11797
|
}
|
|
11792
|
-
function
|
|
11798
|
+
function up8(db) {
|
|
11793
11799
|
if (!hasColumn4(db, "memories", "idempotency_key")) {
|
|
11794
11800
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
11795
11801
|
}
|
|
@@ -11804,7 +11810,7 @@ function hasColumn5(db, table, column) {
|
|
|
11804
11810
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11805
11811
|
return rows.some((r2) => r2.name === column);
|
|
11806
11812
|
}
|
|
11807
|
-
function
|
|
11813
|
+
function up9(db) {
|
|
11808
11814
|
db.exec(`
|
|
11809
11815
|
CREATE TABLE IF NOT EXISTS documents (
|
|
11810
11816
|
id TEXT PRIMARY KEY,
|
|
@@ -11861,7 +11867,7 @@ function up8(db) {
|
|
|
11861
11867
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
11862
11868
|
}
|
|
11863
11869
|
}
|
|
11864
|
-
function
|
|
11870
|
+
function up10(db) {
|
|
11865
11871
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
11866
11872
|
if (tables.length === 0)
|
|
11867
11873
|
return;
|
|
@@ -11878,7 +11884,7 @@ function up9(db) {
|
|
|
11878
11884
|
ON embeddings(content_hash)
|
|
11879
11885
|
`);
|
|
11880
11886
|
}
|
|
11881
|
-
function
|
|
11887
|
+
function up11(db) {
|
|
11882
11888
|
db.exec(`
|
|
11883
11889
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
11884
11890
|
id TEXT PRIMARY KEY,
|
|
@@ -11898,7 +11904,7 @@ function up10(db) {
|
|
|
11898
11904
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
11899
11905
|
ON summary_jobs(status)`);
|
|
11900
11906
|
}
|
|
11901
|
-
function
|
|
11907
|
+
function up12(db) {
|
|
11902
11908
|
db.exec(`
|
|
11903
11909
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
11904
11910
|
id INTEGER PRIMARY KEY,
|
|
@@ -11909,7 +11915,7 @@ function up11(db) {
|
|
|
11909
11915
|
)
|
|
11910
11916
|
`);
|
|
11911
11917
|
}
|
|
11912
|
-
function
|
|
11918
|
+
function up13(db) {
|
|
11913
11919
|
db.exec(`
|
|
11914
11920
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
11915
11921
|
id TEXT PRIMARY KEY,
|
|
@@ -11929,7 +11935,7 @@ function up12(db) {
|
|
|
11929
11935
|
ON session_scores(session_key);
|
|
11930
11936
|
`);
|
|
11931
11937
|
}
|
|
11932
|
-
function
|
|
11938
|
+
function up14(db) {
|
|
11933
11939
|
db.exec(`
|
|
11934
11940
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
11935
11941
|
id TEXT PRIMARY KEY,
|
|
@@ -11970,7 +11976,7 @@ function addColumnIfMissing5(db, table, column, definition) {
|
|
|
11970
11976
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11971
11977
|
}
|
|
11972
11978
|
}
|
|
11973
|
-
function
|
|
11979
|
+
function up15(db) {
|
|
11974
11980
|
db.exec(`
|
|
11975
11981
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
11976
11982
|
id TEXT PRIMARY KEY,
|
|
@@ -11996,7 +12002,7 @@ function up14(db) {
|
|
|
11996
12002
|
addColumnIfMissing5(db, "memories", "source_path", "TEXT");
|
|
11997
12003
|
addColumnIfMissing5(db, "memories", "source_section", "TEXT");
|
|
11998
12004
|
}
|
|
11999
|
-
function
|
|
12005
|
+
function up16(db) {
|
|
12000
12006
|
db.exec(`
|
|
12001
12007
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
12002
12008
|
id TEXT PRIMARY KEY,
|
|
@@ -12021,7 +12027,7 @@ function addColumnIfMissing6(db, table, column, definition) {
|
|
|
12021
12027
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12022
12028
|
}
|
|
12023
12029
|
}
|
|
12024
|
-
function
|
|
12030
|
+
function up17(db) {
|
|
12025
12031
|
db.exec(`
|
|
12026
12032
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
12027
12033
|
id TEXT PRIMARY KEY,
|
|
@@ -12048,7 +12054,7 @@ function up16(db) {
|
|
|
12048
12054
|
addColumnIfMissing6(db, "session_scores", "confidence", "REAL");
|
|
12049
12055
|
addColumnIfMissing6(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
12050
12056
|
}
|
|
12051
|
-
function
|
|
12057
|
+
function up18(db) {
|
|
12052
12058
|
db.exec(`
|
|
12053
12059
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
12054
12060
|
id TEXT PRIMARY KEY,
|
|
@@ -12070,7 +12076,7 @@ function up17(db) {
|
|
|
12070
12076
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
12071
12077
|
`);
|
|
12072
12078
|
}
|
|
12073
|
-
function
|
|
12079
|
+
function up19(db) {
|
|
12074
12080
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
12075
12081
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12076
12082
|
if (!colNames.has("skill_name")) {
|
|
@@ -12081,7 +12087,7 @@ function up18(db) {
|
|
|
12081
12087
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
12082
12088
|
}
|
|
12083
12089
|
}
|
|
12084
|
-
function
|
|
12090
|
+
function up20(db) {
|
|
12085
12091
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
12086
12092
|
if (existing)
|
|
12087
12093
|
return;
|
|
@@ -12113,7 +12119,7 @@ function up19(db) {
|
|
|
12113
12119
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
12114
12120
|
`);
|
|
12115
12121
|
}
|
|
12116
|
-
function
|
|
12122
|
+
function up21(db) {
|
|
12117
12123
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
12118
12124
|
const entityColNames = new Set(entityCols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12119
12125
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -12198,13 +12204,13 @@ function addColumnIfMissing7(db, table, column, definition) {
|
|
|
12198
12204
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12199
12205
|
}
|
|
12200
12206
|
}
|
|
12201
|
-
function
|
|
12207
|
+
function up22(db) {
|
|
12202
12208
|
addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
|
|
12203
12209
|
addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12204
12210
|
addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
12205
12211
|
addColumnIfMissing7(db, "session_memories", "structural_density", "INTEGER");
|
|
12206
12212
|
}
|
|
12207
|
-
function
|
|
12213
|
+
function up23(db) {
|
|
12208
12214
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
12209
12215
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
12210
12216
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -12229,25 +12235,25 @@ function addColumnIfMissing8(db, table, column, definition) {
|
|
|
12229
12235
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12230
12236
|
}
|
|
12231
12237
|
}
|
|
12232
|
-
function
|
|
12238
|
+
function up24(db) {
|
|
12233
12239
|
addColumnIfMissing8(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
12234
12240
|
addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
|
|
12235
12241
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
12236
12242
|
}
|
|
12237
|
-
function up24(_db) {}
|
|
12238
12243
|
function up25(_db) {}
|
|
12244
|
+
function up26(_db) {}
|
|
12239
12245
|
function addColumnIfMissing9(db, table, column, definition) {
|
|
12240
12246
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
12241
12247
|
if (!cols.some((c2) => c2.name === column)) {
|
|
12242
12248
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12243
12249
|
}
|
|
12244
12250
|
}
|
|
12245
|
-
function
|
|
12251
|
+
function up27(db) {
|
|
12246
12252
|
addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
|
|
12247
12253
|
addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
12248
12254
|
}
|
|
12249
|
-
function
|
|
12250
|
-
function
|
|
12255
|
+
function up28(_db) {}
|
|
12256
|
+
function up29(db) {
|
|
12251
12257
|
db.exec(`
|
|
12252
12258
|
UPDATE entities
|
|
12253
12259
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -12256,7 +12262,7 @@ function up28(db) {
|
|
|
12256
12262
|
WHERE canonical_name IS NULL
|
|
12257
12263
|
`);
|
|
12258
12264
|
}
|
|
12259
|
-
function
|
|
12265
|
+
function up30(db) {
|
|
12260
12266
|
db.exec(`
|
|
12261
12267
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
12262
12268
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -12293,7 +12299,7 @@ function up29(db) {
|
|
|
12293
12299
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
12294
12300
|
`);
|
|
12295
12301
|
}
|
|
12296
|
-
function
|
|
12302
|
+
function up31(db) {
|
|
12297
12303
|
db.exec(`
|
|
12298
12304
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
12299
12305
|
id TEXT PRIMARY KEY,
|
|
@@ -12338,7 +12344,7 @@ function up30(db) {
|
|
|
12338
12344
|
WHERE session_key IS NOT NULL;
|
|
12339
12345
|
`);
|
|
12340
12346
|
}
|
|
12341
|
-
function
|
|
12347
|
+
function up32(db) {
|
|
12342
12348
|
db.exec(`
|
|
12343
12349
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
12344
12350
|
id TEXT PRIMARY KEY,
|
|
@@ -12383,7 +12389,7 @@ function up31(db) {
|
|
|
12383
12389
|
ON memory_jobs(failed_at);
|
|
12384
12390
|
`);
|
|
12385
12391
|
}
|
|
12386
|
-
function
|
|
12392
|
+
function up33(db) {
|
|
12387
12393
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12388
12394
|
if (!depCols.some((c2) => c2.name === "reason")) {
|
|
12389
12395
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -12393,7 +12399,7 @@ function up32(db) {
|
|
|
12393
12399
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
12394
12400
|
}
|
|
12395
12401
|
}
|
|
12396
|
-
function
|
|
12402
|
+
function up34(db) {
|
|
12397
12403
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
12398
12404
|
if (cols.length === 0)
|
|
12399
12405
|
return;
|
|
@@ -12401,14 +12407,14 @@ function up33(db) {
|
|
|
12401
12407
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
12402
12408
|
}
|
|
12403
12409
|
}
|
|
12404
|
-
function
|
|
12410
|
+
function up35(db) {
|
|
12405
12411
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
12406
12412
|
if (!cols.some((c2) => c2.name === "scope")) {
|
|
12407
12413
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
12408
12414
|
}
|
|
12409
12415
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
12410
12416
|
}
|
|
12411
|
-
function
|
|
12417
|
+
function up36(db) {
|
|
12412
12418
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
12413
12419
|
db.exec(`
|
|
12414
12420
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -12416,7 +12422,7 @@ function up35(db) {
|
|
|
12416
12422
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
12417
12423
|
`);
|
|
12418
12424
|
}
|
|
12419
|
-
function
|
|
12425
|
+
function up37(db) {
|
|
12420
12426
|
db.exec(`
|
|
12421
12427
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
12422
12428
|
name, canonical_name,
|
|
@@ -12448,13 +12454,13 @@ function up36(db) {
|
|
|
12448
12454
|
END
|
|
12449
12455
|
`);
|
|
12450
12456
|
}
|
|
12451
|
-
function
|
|
12457
|
+
function up38(db) {
|
|
12452
12458
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12453
12459
|
if (!cols.some((c2) => c2.name === "confidence")) {
|
|
12454
12460
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
12455
12461
|
}
|
|
12456
12462
|
}
|
|
12457
|
-
function
|
|
12463
|
+
function up39(db) {
|
|
12458
12464
|
db.exec(`
|
|
12459
12465
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
12460
12466
|
id TEXT PRIMARY KEY,
|
|
@@ -12472,7 +12478,7 @@ function up38(db) {
|
|
|
12472
12478
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
12473
12479
|
}
|
|
12474
12480
|
}
|
|
12475
|
-
function
|
|
12481
|
+
function up40(db) {
|
|
12476
12482
|
db.exec(`
|
|
12477
12483
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
12478
12484
|
id TEXT PRIMARY KEY,
|
|
@@ -12512,7 +12518,7 @@ function up39(db) {
|
|
|
12512
12518
|
END
|
|
12513
12519
|
`);
|
|
12514
12520
|
}
|
|
12515
|
-
function
|
|
12521
|
+
function up41(db) {
|
|
12516
12522
|
db.exec(`
|
|
12517
12523
|
DELETE FROM entity_dependencies
|
|
12518
12524
|
WHERE id NOT IN (
|
|
@@ -12530,7 +12536,7 @@ function up40(db) {
|
|
|
12530
12536
|
)
|
|
12531
12537
|
`);
|
|
12532
12538
|
}
|
|
12533
|
-
function
|
|
12539
|
+
function up42(db) {
|
|
12534
12540
|
db.exec(`
|
|
12535
12541
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
12536
12542
|
session_key TEXT PRIMARY KEY,
|
|
@@ -12553,7 +12559,7 @@ function addColumnIfMissing10(db, table, column, definition) {
|
|
|
12553
12559
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12554
12560
|
}
|
|
12555
12561
|
}
|
|
12556
|
-
function
|
|
12562
|
+
function up43(db) {
|
|
12557
12563
|
addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
|
|
12558
12564
|
db.exec(`
|
|
12559
12565
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -12628,7 +12634,7 @@ function addColumnIfMissing11(db, table, column, definition) {
|
|
|
12628
12634
|
return;
|
|
12629
12635
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12630
12636
|
}
|
|
12631
|
-
function
|
|
12637
|
+
function up44(db) {
|
|
12632
12638
|
addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
|
|
12633
12639
|
addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12634
12640
|
addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -12716,7 +12722,7 @@ function addColumnIfMissing12(db, table, column, definition) {
|
|
|
12716
12722
|
return;
|
|
12717
12723
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12718
12724
|
}
|
|
12719
|
-
function
|
|
12725
|
+
function up45(db) {
|
|
12720
12726
|
db.exec(`
|
|
12721
12727
|
CREATE TABLE IF NOT EXISTS agents (
|
|
12722
12728
|
id TEXT PRIMARY KEY,
|
|
@@ -12745,7 +12751,7 @@ function addColumnIfMissing13(db, table, column, definition) {
|
|
|
12745
12751
|
return;
|
|
12746
12752
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12747
12753
|
}
|
|
12748
|
-
function
|
|
12754
|
+
function up46(db) {
|
|
12749
12755
|
addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
|
|
12750
12756
|
addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
|
|
12751
12757
|
addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -12771,7 +12777,7 @@ function addColumnIfMissing14(db, table, column, definition) {
|
|
|
12771
12777
|
return;
|
|
12772
12778
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12773
12779
|
}
|
|
12774
|
-
function
|
|
12780
|
+
function up47(db) {
|
|
12775
12781
|
addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
|
|
12776
12782
|
addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
12777
12783
|
addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -12842,7 +12848,7 @@ function up46(db) {
|
|
|
12842
12848
|
ON memory_md_heads(lease_expires_at);
|
|
12843
12849
|
`);
|
|
12844
12850
|
}
|
|
12845
|
-
function
|
|
12851
|
+
function up48(db) {
|
|
12846
12852
|
db.exec(`
|
|
12847
12853
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
12848
12854
|
|
|
@@ -12903,7 +12909,7 @@ function up47(db) {
|
|
|
12903
12909
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
12904
12910
|
`);
|
|
12905
12911
|
}
|
|
12906
|
-
function
|
|
12912
|
+
function up49(db) {
|
|
12907
12913
|
db.exec(`
|
|
12908
12914
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
12909
12915
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -13001,7 +13007,7 @@ function up48(db) {
|
|
|
13001
13007
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
13002
13008
|
`);
|
|
13003
13009
|
}
|
|
13004
|
-
function
|
|
13010
|
+
function up50(db) {
|
|
13005
13011
|
db.exec(`
|
|
13006
13012
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
13007
13013
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -13119,7 +13125,7 @@ function up49(db) {
|
|
|
13119
13125
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
13120
13126
|
`);
|
|
13121
13127
|
}
|
|
13122
|
-
function
|
|
13128
|
+
function up51(db) {
|
|
13123
13129
|
db.exec(`
|
|
13124
13130
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
13125
13131
|
session_key TEXT NOT NULL,
|
|
@@ -13136,7 +13142,7 @@ function hasTable(db, name) {
|
|
|
13136
13142
|
WHERE type = 'table' AND name = ?
|
|
13137
13143
|
LIMIT 1`).get(name) !== undefined;
|
|
13138
13144
|
}
|
|
13139
|
-
function
|
|
13145
|
+
function up52(db) {
|
|
13140
13146
|
db.exec(`
|
|
13141
13147
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
13142
13148
|
id TEXT PRIMARY KEY,
|
|
@@ -13306,7 +13312,7 @@ function addColumnIfMissing15(db, table, column, definition) {
|
|
|
13306
13312
|
return;
|
|
13307
13313
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13308
13314
|
}
|
|
13309
|
-
function
|
|
13315
|
+
function up53(db) {
|
|
13310
13316
|
addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
|
|
13311
13317
|
addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
13312
13318
|
addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -13398,7 +13404,7 @@ function up52(db) {
|
|
|
13398
13404
|
VALUES ('rebuild');
|
|
13399
13405
|
`);
|
|
13400
13406
|
}
|
|
13401
|
-
function
|
|
13407
|
+
function up54(db) {
|
|
13402
13408
|
db.exec(`
|
|
13403
13409
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
13404
13410
|
id TEXT PRIMARY KEY,
|
|
@@ -13415,7 +13421,7 @@ function up53(db) {
|
|
|
13415
13421
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
13416
13422
|
`);
|
|
13417
13423
|
}
|
|
13418
|
-
function
|
|
13424
|
+
function up55(db) {
|
|
13419
13425
|
db.exec(`
|
|
13420
13426
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
13421
13427
|
id TEXT PRIMARY KEY,
|
|
@@ -13431,7 +13437,7 @@ function up54(db) {
|
|
|
13431
13437
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
13432
13438
|
`);
|
|
13433
13439
|
}
|
|
13434
|
-
function
|
|
13440
|
+
function up56(db) {
|
|
13435
13441
|
db.exec(`
|
|
13436
13442
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
13437
13443
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -13462,7 +13468,7 @@ function up55(db) {
|
|
|
13462
13468
|
ON task_scope_hints(agent_id, updated_at);
|
|
13463
13469
|
`);
|
|
13464
13470
|
}
|
|
13465
|
-
function
|
|
13471
|
+
function up57(db) {
|
|
13466
13472
|
db.exec(`
|
|
13467
13473
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
13468
13474
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -13505,7 +13511,7 @@ function ensureMemoriesScopeColumns(db) {
|
|
|
13505
13511
|
if (!names.has("scope"))
|
|
13506
13512
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
13507
13513
|
}
|
|
13508
|
-
function
|
|
13514
|
+
function up58(db) {
|
|
13509
13515
|
ensureMemoriesScopeColumns(db);
|
|
13510
13516
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
13511
13517
|
db.exec(`
|
|
@@ -13518,20 +13524,20 @@ function up57(db) {
|
|
|
13518
13524
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
13519
13525
|
`);
|
|
13520
13526
|
}
|
|
13521
|
-
function
|
|
13527
|
+
function up59(db) {
|
|
13522
13528
|
const sql = readMemoriesFtsSql(db);
|
|
13523
13529
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair(sql))
|
|
13524
13530
|
return;
|
|
13525
13531
|
recreateMemoriesFts(db);
|
|
13526
13532
|
}
|
|
13527
|
-
function
|
|
13533
|
+
function up60(db) {
|
|
13528
13534
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
13529
13535
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
13530
13536
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
13531
13537
|
ON entities(entity_type, mentions)
|
|
13532
13538
|
WHERE entity_type = 'extracted'`);
|
|
13533
13539
|
}
|
|
13534
|
-
function
|
|
13540
|
+
function up61(db) {
|
|
13535
13541
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13536
13542
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
13537
13543
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -13540,7 +13546,7 @@ function up60(db) {
|
|
|
13540
13546
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
13541
13547
|
WHERE claim_key IS NOT NULL`);
|
|
13542
13548
|
}
|
|
13543
|
-
function
|
|
13549
|
+
function up62(db) {
|
|
13544
13550
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13545
13551
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
13546
13552
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -13552,13 +13558,13 @@ function up61(db) {
|
|
|
13552
13558
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
13553
13559
|
WHERE claim_key IS NOT NULL`);
|
|
13554
13560
|
}
|
|
13555
|
-
function
|
|
13561
|
+
function up63(db) {
|
|
13556
13562
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13557
13563
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
13558
13564
|
return;
|
|
13559
13565
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
13560
13566
|
}
|
|
13561
|
-
function
|
|
13567
|
+
function up64(db) {
|
|
13562
13568
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13563
13569
|
const names = new Set(cols.map((col) => col.name));
|
|
13564
13570
|
if (!names.has("is_deleted")) {
|
|
@@ -13572,7 +13578,7 @@ function up63(db) {
|
|
|
13572
13578
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
13573
13579
|
`);
|
|
13574
13580
|
}
|
|
13575
|
-
function
|
|
13581
|
+
function up65(db) {
|
|
13576
13582
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
13577
13583
|
db.exec(`
|
|
13578
13584
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -13590,7 +13596,7 @@ function addColumnIfMissing16(db, table, column, definition) {
|
|
|
13590
13596
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13591
13597
|
}
|
|
13592
13598
|
}
|
|
13593
|
-
function
|
|
13599
|
+
function up66(db) {
|
|
13594
13600
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
13595
13601
|
addColumnIfMissing16(db, table, "source_id", "TEXT");
|
|
13596
13602
|
addColumnIfMissing16(db, table, "source_kind", "TEXT");
|
|
@@ -13610,7 +13616,7 @@ function hasColumn7(db, table, column) {
|
|
|
13610
13616
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
13611
13617
|
return rows.some((row) => row.name === column);
|
|
13612
13618
|
}
|
|
13613
|
-
function
|
|
13619
|
+
function up67(db) {
|
|
13614
13620
|
if (!hasTable2(db, "embeddings"))
|
|
13615
13621
|
return;
|
|
13616
13622
|
if (!hasColumn7(db, "embeddings", "agent_id")) {
|
|
@@ -13618,7 +13624,7 @@ function up66(db) {
|
|
|
13618
13624
|
}
|
|
13619
13625
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
13620
13626
|
}
|
|
13621
|
-
function
|
|
13627
|
+
function up68(db) {
|
|
13622
13628
|
db.exec(`
|
|
13623
13629
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
13624
13630
|
id TEXT PRIMARY KEY,
|
|
@@ -13659,7 +13665,7 @@ function addColumnIfMissing17(db, table, column, definition) {
|
|
|
13659
13665
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13660
13666
|
}
|
|
13661
13667
|
}
|
|
13662
|
-
function
|
|
13668
|
+
function up69(db) {
|
|
13663
13669
|
db.exec(`
|
|
13664
13670
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
13665
13671
|
id TEXT PRIMARY KEY,
|
|
@@ -13702,7 +13708,7 @@ function up68(db) {
|
|
|
13702
13708
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
13703
13709
|
}
|
|
13704
13710
|
}
|
|
13705
|
-
function
|
|
13711
|
+
function up70(db) {
|
|
13706
13712
|
db.exec(`
|
|
13707
13713
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
13708
13714
|
id TEXT PRIMARY KEY,
|
|
@@ -13729,7 +13735,7 @@ function up69(db) {
|
|
|
13729
13735
|
WHERE content_key IS NOT NULL;
|
|
13730
13736
|
`);
|
|
13731
13737
|
}
|
|
13732
|
-
function
|
|
13738
|
+
function up71(db) {
|
|
13733
13739
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
13734
13740
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
13735
13741
|
if (!colNames.has("content_key")) {
|
|
@@ -13766,7 +13772,7 @@ function backfillVersionRoots(db) {
|
|
|
13766
13772
|
WHERE version_root_id IS NULL
|
|
13767
13773
|
`);
|
|
13768
13774
|
}
|
|
13769
|
-
function
|
|
13775
|
+
function up72(db) {
|
|
13770
13776
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
13771
13777
|
addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
13772
13778
|
addColumnIfMissing18(db, table, "archived_at", "TEXT");
|
|
@@ -13801,7 +13807,7 @@ function up71(db) {
|
|
|
13801
13807
|
ON entity_aspects(agent_id, proposal_id);
|
|
13802
13808
|
`);
|
|
13803
13809
|
}
|
|
13804
|
-
function
|
|
13810
|
+
function up73(db) {
|
|
13805
13811
|
db.exec(`
|
|
13806
13812
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
13807
13813
|
id TEXT PRIMARY KEY,
|
|
@@ -13857,7 +13863,7 @@ function ensureMemoriesScopeColumns2(db) {
|
|
|
13857
13863
|
if (!names.has("runtime_path"))
|
|
13858
13864
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
13859
13865
|
}
|
|
13860
|
-
function
|
|
13866
|
+
function up74(db) {
|
|
13861
13867
|
ensureMemoriesScopeColumns2(db);
|
|
13862
13868
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
13863
13869
|
db.exec(`
|
|
@@ -13871,7 +13877,7 @@ function up73(db) {
|
|
|
13871
13877
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
13872
13878
|
`);
|
|
13873
13879
|
}
|
|
13874
|
-
function
|
|
13880
|
+
function up75(db) {
|
|
13875
13881
|
db.exec(`
|
|
13876
13882
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
13877
13883
|
session_key TEXT NOT NULL,
|
|
@@ -13906,7 +13912,7 @@ function up74(db) {
|
|
|
13906
13912
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
13907
13913
|
`);
|
|
13908
13914
|
}
|
|
13909
|
-
function
|
|
13915
|
+
function up76(db) {
|
|
13910
13916
|
db.exec(`
|
|
13911
13917
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
13912
13918
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -13925,7 +13931,7 @@ function addColumnIfMissing19(db, table, column, definition) {
|
|
|
13925
13931
|
return;
|
|
13926
13932
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13927
13933
|
}
|
|
13928
|
-
function
|
|
13934
|
+
function up77(db) {
|
|
13929
13935
|
addColumnIfMissing19(db, "memory_artifacts", "source_id", "TEXT");
|
|
13930
13936
|
addColumnIfMissing19(db, "memory_artifacts", "source_root", "TEXT");
|
|
13931
13937
|
addColumnIfMissing19(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -13938,7 +13944,7 @@ function up76(db) {
|
|
|
13938
13944
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
13939
13945
|
`);
|
|
13940
13946
|
}
|
|
13941
|
-
function
|
|
13947
|
+
function up78(db) {
|
|
13942
13948
|
db.exec(`
|
|
13943
13949
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
13944
13950
|
id TEXT PRIMARY KEY,
|
|
@@ -13961,7 +13967,7 @@ function up77(db) {
|
|
|
13961
13967
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
13962
13968
|
`);
|
|
13963
13969
|
}
|
|
13964
|
-
function
|
|
13970
|
+
function up79(db) {
|
|
13965
13971
|
db.exec(`
|
|
13966
13972
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
13967
13973
|
id TEXT PRIMARY KEY,
|
|
@@ -13985,7 +13991,7 @@ function up78(db) {
|
|
|
13985
13991
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
13986
13992
|
`);
|
|
13987
13993
|
}
|
|
13988
|
-
function
|
|
13994
|
+
function up80(db) {
|
|
13989
13995
|
db.exec(`
|
|
13990
13996
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
13991
13997
|
id TEXT PRIMARY KEY,
|
|
@@ -14013,7 +14019,7 @@ function up79(db) {
|
|
|
14013
14019
|
ON api_keys(connector, harness);
|
|
14014
14020
|
`);
|
|
14015
14021
|
}
|
|
14016
|
-
function
|
|
14022
|
+
function up81(db) {
|
|
14017
14023
|
db.exec(`
|
|
14018
14024
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
14019
14025
|
id TEXT PRIMARY KEY,
|
|
@@ -14048,7 +14054,7 @@ function hasColumn10(db, table, column) {
|
|
|
14048
14054
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14049
14055
|
return rows.some((row) => row.name === column);
|
|
14050
14056
|
}
|
|
14051
|
-
function
|
|
14057
|
+
function up82(db) {
|
|
14052
14058
|
if (!hasColumn10(db, "documents", "agent_id")) {
|
|
14053
14059
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
14054
14060
|
}
|
|
@@ -14134,7 +14140,7 @@ function up81(db) {
|
|
|
14134
14140
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
14135
14141
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
14136
14142
|
}
|
|
14137
|
-
function
|
|
14143
|
+
function up83(db) {
|
|
14138
14144
|
db.exec(`
|
|
14139
14145
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
14140
14146
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -14156,7 +14162,7 @@ function hasColumn11(db, table, column) {
|
|
|
14156
14162
|
return rows.some((row) => row.name === column);
|
|
14157
14163
|
}
|
|
14158
14164
|
var COLUMNS = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
14159
|
-
function
|
|
14165
|
+
function up84(db) {
|
|
14160
14166
|
for (const column of COLUMNS) {
|
|
14161
14167
|
if (!hasColumn11(db, "skill_invocations", column)) {
|
|
14162
14168
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -14237,7 +14243,7 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14237
14243
|
`);
|
|
14238
14244
|
}
|
|
14239
14245
|
try {
|
|
14240
|
-
|
|
14246
|
+
up82(db);
|
|
14241
14247
|
if (preserveAgentId) {
|
|
14242
14248
|
db.exec(`
|
|
14243
14249
|
UPDATE documents
|
|
@@ -14257,12 +14263,12 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14257
14263
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
14258
14264
|
}
|
|
14259
14265
|
}
|
|
14260
|
-
function
|
|
14261
|
-
|
|
14266
|
+
function up85(db) {
|
|
14267
|
+
up81(db);
|
|
14262
14268
|
if (hasTable3(db, "documents")) {
|
|
14263
14269
|
documentScopeColumnsPreservingExisting(db);
|
|
14264
14270
|
}
|
|
14265
|
-
|
|
14271
|
+
up83(db);
|
|
14266
14272
|
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
14267
14273
|
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
14268
14274
|
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -14319,7 +14325,7 @@ function up84(db) {
|
|
|
14319
14325
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
14320
14326
|
`);
|
|
14321
14327
|
}
|
|
14322
|
-
function
|
|
14328
|
+
function up86(db) {
|
|
14323
14329
|
db.exec(`
|
|
14324
14330
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
14325
14331
|
path TEXT PRIMARY KEY,
|
|
@@ -14349,7 +14355,7 @@ function up85(db) {
|
|
|
14349
14355
|
ON legacy_markdown_chunks(memory_id);
|
|
14350
14356
|
`);
|
|
14351
14357
|
}
|
|
14352
|
-
function
|
|
14358
|
+
function up87(db) {
|
|
14353
14359
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
14354
14360
|
const tableNames = new Set(tables.map((r2) => String(r2.name)));
|
|
14355
14361
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -14408,7 +14414,7 @@ function addColumnIfMissing21(db, table, column, definition) {
|
|
|
14408
14414
|
return;
|
|
14409
14415
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14410
14416
|
}
|
|
14411
|
-
function
|
|
14417
|
+
function up88(db) {
|
|
14412
14418
|
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
14413
14419
|
db.exec(`
|
|
14414
14420
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -14421,14 +14427,14 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
14421
14427
|
return;
|
|
14422
14428
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14423
14429
|
}
|
|
14424
|
-
function
|
|
14430
|
+
function up89(db) {
|
|
14425
14431
|
addColumnIfMissing22(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
14426
14432
|
db.exec(`
|
|
14427
14433
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
14428
14434
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
14429
14435
|
`);
|
|
14430
14436
|
}
|
|
14431
|
-
function
|
|
14437
|
+
function up90(db) {
|
|
14432
14438
|
db.exec(`
|
|
14433
14439
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
14434
14440
|
agent_id TEXT NOT NULL,
|
|
@@ -14446,7 +14452,7 @@ function up89(db) {
|
|
|
14446
14452
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
14447
14453
|
`);
|
|
14448
14454
|
}
|
|
14449
|
-
function
|
|
14455
|
+
function up91(db) {
|
|
14450
14456
|
db.exec(`
|
|
14451
14457
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
14452
14458
|
id TEXT PRIMARY KEY,
|
|
@@ -14474,7 +14480,7 @@ function indexExists(db, table, indexName) {
|
|
|
14474
14480
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14475
14481
|
return rows.some((row) => row.name === indexName);
|
|
14476
14482
|
}
|
|
14477
|
-
function
|
|
14483
|
+
function up92(db) {
|
|
14478
14484
|
db.exec(`
|
|
14479
14485
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
14480
14486
|
id TEXT PRIMARY KEY,
|
|
@@ -14501,7 +14507,7 @@ function indexExists2(db, table, indexName) {
|
|
|
14501
14507
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14502
14508
|
return rows.some((row) => row.name === indexName);
|
|
14503
14509
|
}
|
|
14504
|
-
function
|
|
14510
|
+
function up93(db) {
|
|
14505
14511
|
db.exec(`
|
|
14506
14512
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
14507
14513
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -14514,7 +14520,7 @@ function up92(db) {
|
|
|
14514
14520
|
)
|
|
14515
14521
|
`);
|
|
14516
14522
|
}
|
|
14517
|
-
function
|
|
14523
|
+
function up94(db) {
|
|
14518
14524
|
db.exec(`
|
|
14519
14525
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
14520
14526
|
id TEXT PRIMARY KEY,
|
|
@@ -14533,7 +14539,7 @@ function up93(db) {
|
|
|
14533
14539
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
14534
14540
|
`);
|
|
14535
14541
|
}
|
|
14536
|
-
function
|
|
14542
|
+
function up95(db) {
|
|
14537
14543
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14538
14544
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
14539
14545
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -14544,7 +14550,7 @@ function hasColumn13(db, table, column) {
|
|
|
14544
14550
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14545
14551
|
return rows.some((r2) => r2.name === column);
|
|
14546
14552
|
}
|
|
14547
|
-
function
|
|
14553
|
+
function up96(db) {
|
|
14548
14554
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
14549
14555
|
if (tables.length === 0)
|
|
14550
14556
|
return;
|
|
@@ -14569,23 +14575,23 @@ function up95(db) {
|
|
|
14569
14575
|
function hasColumn14(db, table, column) {
|
|
14570
14576
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14571
14577
|
}
|
|
14572
|
-
function
|
|
14578
|
+
function up97(db) {
|
|
14573
14579
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
14574
14580
|
if (!hasMemories || !hasColumn14(db, "memories", "memory_kind") || !hasColumn14(db, "memories", "type"))
|
|
14575
14581
|
return;
|
|
14576
14582
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
14577
14583
|
}
|
|
14578
|
-
function
|
|
14584
|
+
function up98(db) {
|
|
14579
14585
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
14580
14586
|
}
|
|
14581
|
-
function
|
|
14587
|
+
function up99(db) {
|
|
14582
14588
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14583
14589
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
14584
14590
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
14585
14591
|
}
|
|
14586
14592
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
14587
14593
|
}
|
|
14588
|
-
function
|
|
14594
|
+
function up100(db) {
|
|
14589
14595
|
db.exec(`
|
|
14590
14596
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
14591
14597
|
agent_id TEXT NOT NULL,
|
|
@@ -14602,7 +14608,7 @@ function up99(db) {
|
|
|
14602
14608
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
14603
14609
|
`);
|
|
14604
14610
|
}
|
|
14605
|
-
function
|
|
14611
|
+
function up101(db) {
|
|
14606
14612
|
db.exec(`
|
|
14607
14613
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
14608
14614
|
id TEXT PRIMARY KEY,
|
|
@@ -14622,7 +14628,7 @@ function up100(db) {
|
|
|
14622
14628
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
14623
14629
|
`);
|
|
14624
14630
|
}
|
|
14625
|
-
function
|
|
14631
|
+
function up102(db) {
|
|
14626
14632
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
14627
14633
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
14628
14634
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -14631,7 +14637,7 @@ function up101(db) {
|
|
|
14631
14637
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
14632
14638
|
}
|
|
14633
14639
|
}
|
|
14634
|
-
function
|
|
14640
|
+
function up103(db) {
|
|
14635
14641
|
db.exec(`
|
|
14636
14642
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
14637
14643
|
id TEXT PRIMARY KEY,
|
|
@@ -14653,7 +14659,7 @@ function up102(db) {
|
|
|
14653
14659
|
function hasColumn15(db, table, column) {
|
|
14654
14660
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14655
14661
|
}
|
|
14656
|
-
function
|
|
14662
|
+
function up104(db) {
|
|
14657
14663
|
const requiredMemoryColumns = [
|
|
14658
14664
|
"content_hash",
|
|
14659
14665
|
"normalized_content",
|
|
@@ -14704,7 +14710,7 @@ function up103(db) {
|
|
|
14704
14710
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
14705
14711
|
`);
|
|
14706
14712
|
}
|
|
14707
|
-
function
|
|
14713
|
+
function up105(db) {
|
|
14708
14714
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
14709
14715
|
if (tables.length !== 2)
|
|
14710
14716
|
return;
|
|
@@ -14727,7 +14733,7 @@ function tableExists(db, table) {
|
|
|
14727
14733
|
function hasColumn16(db, table, column) {
|
|
14728
14734
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14729
14735
|
}
|
|
14730
|
-
function
|
|
14736
|
+
function up106(db) {
|
|
14731
14737
|
db.exec(`
|
|
14732
14738
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
14733
14739
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -14770,7 +14776,7 @@ function up105(db) {
|
|
|
14770
14776
|
`);
|
|
14771
14777
|
}
|
|
14772
14778
|
}
|
|
14773
|
-
function
|
|
14779
|
+
function up107(db) {
|
|
14774
14780
|
db.exec(`
|
|
14775
14781
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
14776
14782
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -14859,7 +14865,7 @@ function up106(db) {
|
|
|
14859
14865
|
function hasColumn17(db, table, column) {
|
|
14860
14866
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14861
14867
|
}
|
|
14862
|
-
function
|
|
14868
|
+
function up108(db) {
|
|
14863
14869
|
if (!hasColumn17(db, "memories", "review_after")) {
|
|
14864
14870
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
14865
14871
|
}
|
|
@@ -14875,14 +14881,14 @@ var TOKEN_COLUMNS = [
|
|
|
14875
14881
|
["tokens_cache_write", "INTEGER"],
|
|
14876
14882
|
["tokens_cost", "REAL"]
|
|
14877
14883
|
];
|
|
14878
|
-
function
|
|
14884
|
+
function up109(db) {
|
|
14879
14885
|
for (const [column, type] of TOKEN_COLUMNS) {
|
|
14880
14886
|
if (!hasColumn18(db, "dreaming_passes", column)) {
|
|
14881
14887
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
14882
14888
|
}
|
|
14883
14889
|
}
|
|
14884
14890
|
}
|
|
14885
|
-
function
|
|
14891
|
+
function up110(db) {
|
|
14886
14892
|
db.exec(`
|
|
14887
14893
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
14888
14894
|
day TEXT NOT NULL,
|
|
@@ -14895,7 +14901,7 @@ function up109(db) {
|
|
|
14895
14901
|
);
|
|
14896
14902
|
`);
|
|
14897
14903
|
}
|
|
14898
|
-
function
|
|
14904
|
+
function up111(db) {
|
|
14899
14905
|
db.exec(`
|
|
14900
14906
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
14901
14907
|
id TEXT PRIMARY KEY,
|
|
@@ -14903,7 +14909,7 @@ function up110(db) {
|
|
|
14903
14909
|
);
|
|
14904
14910
|
`);
|
|
14905
14911
|
}
|
|
14906
|
-
function
|
|
14912
|
+
function up112(db) {
|
|
14907
14913
|
db.exec(`
|
|
14908
14914
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
14909
14915
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -14914,7 +14920,7 @@ function hasColumn19(db, table, column) {
|
|
|
14914
14920
|
return rows.some((row) => row.name === column);
|
|
14915
14921
|
}
|
|
14916
14922
|
var COLUMNS2 = ["first_remember_at", "first_recall_at"];
|
|
14917
|
-
function
|
|
14923
|
+
function up113(db) {
|
|
14918
14924
|
for (const column of COLUMNS2) {
|
|
14919
14925
|
if (!hasColumn19(db, "telemetry_install", column)) {
|
|
14920
14926
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -14930,7 +14936,7 @@ function addColumnIfMissing23(db, column, definition) {
|
|
|
14930
14936
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
14931
14937
|
}
|
|
14932
14938
|
}
|
|
14933
|
-
function
|
|
14939
|
+
function up114(db) {
|
|
14934
14940
|
addColumnIfMissing23(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
14935
14941
|
addColumnIfMissing23(db, "claim_token", "TEXT");
|
|
14936
14942
|
addColumnIfMissing23(db, "claimed_at", "TEXT");
|
|
@@ -14939,7 +14945,7 @@ function up113(db) {
|
|
|
14939
14945
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
14940
14946
|
`);
|
|
14941
14947
|
}
|
|
14942
|
-
function
|
|
14948
|
+
function up115(db) {
|
|
14943
14949
|
db.exec(`
|
|
14944
14950
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
14945
14951
|
session_key TEXT NOT NULL,
|
|
@@ -14960,7 +14966,7 @@ function up114(db) {
|
|
|
14960
14966
|
ON session_claims(agent_id, state, expires_at);
|
|
14961
14967
|
`);
|
|
14962
14968
|
}
|
|
14963
|
-
function
|
|
14969
|
+
function up116(db) {
|
|
14964
14970
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
14965
14971
|
if (table == null)
|
|
14966
14972
|
return;
|
|
@@ -14969,7 +14975,7 @@ function up115(db) {
|
|
|
14969
14975
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
14970
14976
|
`);
|
|
14971
14977
|
}
|
|
14972
|
-
function
|
|
14978
|
+
function up117(db) {
|
|
14973
14979
|
db.exec(`
|
|
14974
14980
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
14975
14981
|
id TEXT PRIMARY KEY,
|
|
@@ -15026,7 +15032,7 @@ function addColumnIfMissing24(db, column, definition) {
|
|
|
15026
15032
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
15027
15033
|
}
|
|
15028
15034
|
}
|
|
15029
|
-
function
|
|
15035
|
+
function up118(db) {
|
|
15030
15036
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
15031
15037
|
if (table == null)
|
|
15032
15038
|
return;
|
|
@@ -15227,7 +15233,7 @@ function backfillTranscriptsFromSummaryJobs(db) {
|
|
|
15227
15233
|
insert.run(...values);
|
|
15228
15234
|
}
|
|
15229
15235
|
}
|
|
15230
|
-
function
|
|
15236
|
+
function up119(db) {
|
|
15231
15237
|
if (!hasTable4(db, "session_transcripts"))
|
|
15232
15238
|
return;
|
|
15233
15239
|
addColumnIfMissing25(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -15280,7 +15286,7 @@ function up118(db) {
|
|
|
15280
15286
|
ON session_transcripts(agent_id, content_hash);
|
|
15281
15287
|
`);
|
|
15282
15288
|
}
|
|
15283
|
-
function
|
|
15289
|
+
function up120(db) {
|
|
15284
15290
|
db.exec(`
|
|
15285
15291
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
15286
15292
|
ON memory_jobs(status)
|
|
@@ -15299,12 +15305,12 @@ function up119(db) {
|
|
|
15299
15305
|
function hasColumn22(db, table, column) {
|
|
15300
15306
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
15301
15307
|
}
|
|
15302
|
-
function
|
|
15308
|
+
function up121(db) {
|
|
15303
15309
|
if (!hasColumn22(db, "telemetry_install", "last_seen_version")) {
|
|
15304
15310
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
15305
15311
|
}
|
|
15306
15312
|
}
|
|
15307
|
-
function
|
|
15313
|
+
function up122(db) {
|
|
15308
15314
|
db.exec(`
|
|
15309
15315
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
15310
15316
|
agent_id TEXT NOT NULL,
|
|
@@ -15333,7 +15339,7 @@ function addColumnIfMissing26(db, column, definition) {
|
|
|
15333
15339
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
15334
15340
|
}
|
|
15335
15341
|
}
|
|
15336
|
-
function
|
|
15342
|
+
function up123(db) {
|
|
15337
15343
|
addColumnIfMissing26(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
15338
15344
|
addColumnIfMissing26(db, "last_attempt_at", "TEXT");
|
|
15339
15345
|
addColumnIfMissing26(db, "sent_at", "TEXT");
|
|
@@ -15354,7 +15360,7 @@ function up122(db) {
|
|
|
15354
15360
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
15355
15361
|
`);
|
|
15356
15362
|
}
|
|
15357
|
-
function
|
|
15363
|
+
function up124(db) {
|
|
15358
15364
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
15359
15365
|
const names = new Set(columns.map((column) => column.name));
|
|
15360
15366
|
if (!names.has("failure_class")) {
|
|
@@ -15371,7 +15377,7 @@ function up123(db) {
|
|
|
15371
15377
|
}
|
|
15372
15378
|
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)");
|
|
15373
15379
|
}
|
|
15374
|
-
function
|
|
15380
|
+
function up125(db) {
|
|
15375
15381
|
db.exec(`
|
|
15376
15382
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
15377
15383
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -15395,7 +15401,7 @@ function up124(db) {
|
|
|
15395
15401
|
ON embedding_index_failures(source_type, source_id);
|
|
15396
15402
|
`);
|
|
15397
15403
|
}
|
|
15398
|
-
function
|
|
15404
|
+
function up126(db) {
|
|
15399
15405
|
db.exec(`
|
|
15400
15406
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
15401
15407
|
id TEXT PRIMARY KEY,
|
|
@@ -15445,7 +15451,7 @@ function backfillTable(db, params) {
|
|
|
15445
15451
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
15446
15452
|
backfill(db, rows, params.sourceKind, params.scannedAt);
|
|
15447
15453
|
}
|
|
15448
|
-
function
|
|
15454
|
+
function up127(db) {
|
|
15449
15455
|
db.exec(`
|
|
15450
15456
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
15451
15457
|
agent_id TEXT NOT NULL,
|
|
@@ -15502,7 +15508,7 @@ function up126(db) {
|
|
|
15502
15508
|
scannedAt
|
|
15503
15509
|
});
|
|
15504
15510
|
}
|
|
15505
|
-
function
|
|
15511
|
+
function up128(db) {
|
|
15506
15512
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
15507
15513
|
if (!table)
|
|
15508
15514
|
return;
|
|
@@ -15536,7 +15542,7 @@ function up127(db) {
|
|
|
15536
15542
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
15537
15543
|
`);
|
|
15538
15544
|
}
|
|
15539
|
-
function
|
|
15545
|
+
function up129(db) {
|
|
15540
15546
|
db.exec(`
|
|
15541
15547
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
15542
15548
|
id TEXT PRIMARY KEY,
|
|
@@ -15592,7 +15598,7 @@ function up128(db) {
|
|
|
15592
15598
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
15593
15599
|
`);
|
|
15594
15600
|
}
|
|
15595
|
-
function
|
|
15601
|
+
function up130(db) {
|
|
15596
15602
|
db.exec(`
|
|
15597
15603
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
15598
15604
|
ON memory_jobs(status, created_at)
|
|
@@ -15607,7 +15613,7 @@ function up129(db) {
|
|
|
15607
15613
|
function tableExists3(db, table) {
|
|
15608
15614
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
15609
15615
|
}
|
|
15610
|
-
function
|
|
15616
|
+
function up131(db) {
|
|
15611
15617
|
if (!tableExists3(db, "memory_jobs"))
|
|
15612
15618
|
return;
|
|
15613
15619
|
if (!tableExists3(db, "job_cancellations")) {
|
|
@@ -15656,7 +15662,7 @@ function up130(db) {
|
|
|
15656
15662
|
AND status IN ('pending', 'leased');
|
|
15657
15663
|
`);
|
|
15658
15664
|
}
|
|
15659
|
-
function
|
|
15665
|
+
function up132(db) {
|
|
15660
15666
|
db.exec(`
|
|
15661
15667
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
15662
15668
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -15696,7 +15702,7 @@ function up131(db) {
|
|
|
15696
15702
|
END;
|
|
15697
15703
|
`);
|
|
15698
15704
|
}
|
|
15699
|
-
function
|
|
15705
|
+
function up133(db) {
|
|
15700
15706
|
db.exec(`
|
|
15701
15707
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
15702
15708
|
agent_id TEXT NOT NULL,
|
|
@@ -15719,13 +15725,13 @@ function up132(db) {
|
|
|
15719
15725
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
15720
15726
|
`);
|
|
15721
15727
|
}
|
|
15722
|
-
function
|
|
15728
|
+
function up134(db) {
|
|
15723
15729
|
db.exec(`
|
|
15724
15730
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
15725
15731
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
15726
15732
|
`);
|
|
15727
15733
|
}
|
|
15728
|
-
function
|
|
15734
|
+
function up135(db) {
|
|
15729
15735
|
db.exec(`
|
|
15730
15736
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
15731
15737
|
id TEXT PRIMARY KEY,
|
|
@@ -15777,7 +15783,7 @@ function up134(db) {
|
|
|
15777
15783
|
if (!names.has("format_version"))
|
|
15778
15784
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
15779
15785
|
}
|
|
15780
|
-
function
|
|
15786
|
+
function up136(db) {
|
|
15781
15787
|
db.exec(`
|
|
15782
15788
|
CREATE TABLE memory_head_entries_v134 (
|
|
15783
15789
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -15795,7 +15801,7 @@ function up135(db) {
|
|
|
15795
15801
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
15796
15802
|
`);
|
|
15797
15803
|
}
|
|
15798
|
-
function
|
|
15804
|
+
function up137(db) {
|
|
15799
15805
|
db.exec(`
|
|
15800
15806
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
15801
15807
|
agent_id TEXT NOT NULL,
|
|
@@ -15811,7 +15817,7 @@ function up136(db) {
|
|
|
15811
15817
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
15812
15818
|
`);
|
|
15813
15819
|
}
|
|
15814
|
-
function
|
|
15820
|
+
function up138(db) {
|
|
15815
15821
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
|
|
15816
15822
|
for (const [name, type] of [
|
|
15817
15823
|
["entry_id", "TEXT"],
|
|
@@ -15825,7 +15831,7 @@ function up137(db) {
|
|
|
15825
15831
|
}
|
|
15826
15832
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
15827
15833
|
}
|
|
15828
|
-
function
|
|
15834
|
+
function up139(db) {
|
|
15829
15835
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
|
|
15830
15836
|
for (const [name, type] of [
|
|
15831
15837
|
["head_revision", "INTEGER"],
|
|
@@ -15847,7 +15853,7 @@ function addColumnIfMissing27(db, table, column, definition) {
|
|
|
15847
15853
|
if (!hasColumn25(db, table, column))
|
|
15848
15854
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
15849
15855
|
}
|
|
15850
|
-
function
|
|
15856
|
+
function up140(db) {
|
|
15851
15857
|
addColumnIfMissing27(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
15852
15858
|
db.exec(`
|
|
15853
15859
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -16152,7 +16158,7 @@ function up139(db) {
|
|
|
16152
16158
|
GROUP BY j.agent_id;
|
|
16153
16159
|
`);
|
|
16154
16160
|
}
|
|
16155
|
-
function
|
|
16161
|
+
function up141(db) {
|
|
16156
16162
|
db.exec(`
|
|
16157
16163
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
16158
16164
|
agent_id TEXT NOT NULL,
|
|
@@ -16168,7 +16174,7 @@ function up140(db) {
|
|
|
16168
16174
|
ON native_source_sync_state(agent_id, status);
|
|
16169
16175
|
`);
|
|
16170
16176
|
}
|
|
16171
|
-
function
|
|
16177
|
+
function up142(db) {
|
|
16172
16178
|
db.exec(`
|
|
16173
16179
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
16174
16180
|
agent_id TEXT NOT NULL,
|
|
@@ -16180,7 +16186,7 @@ function up141(db) {
|
|
|
16180
16186
|
);
|
|
16181
16187
|
`);
|
|
16182
16188
|
}
|
|
16183
|
-
function
|
|
16189
|
+
function up143(db) {
|
|
16184
16190
|
db.exec(`
|
|
16185
16191
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
16186
16192
|
agent_id TEXT NOT NULL,
|
|
@@ -16194,13 +16200,13 @@ function up142(db) {
|
|
|
16194
16200
|
);
|
|
16195
16201
|
`);
|
|
16196
16202
|
}
|
|
16197
|
-
function
|
|
16203
|
+
function up144(db) {
|
|
16198
16204
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
16199
16205
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
16200
16206
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
16201
16207
|
}
|
|
16202
16208
|
}
|
|
16203
|
-
function
|
|
16209
|
+
function up145(db) {
|
|
16204
16210
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16205
16211
|
const additions = [
|
|
16206
16212
|
["migration_phase", "TEXT"],
|
|
@@ -16235,13 +16241,13 @@ function up144(db) {
|
|
|
16235
16241
|
`);
|
|
16236
16242
|
}
|
|
16237
16243
|
}
|
|
16238
|
-
function
|
|
16244
|
+
function up146(db) {
|
|
16239
16245
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16240
16246
|
if (!columns.has("lease_token")) {
|
|
16241
16247
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
16242
16248
|
}
|
|
16243
16249
|
}
|
|
16244
|
-
function
|
|
16250
|
+
function up147(db) {
|
|
16245
16251
|
db.exec(`
|
|
16246
16252
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
16247
16253
|
agent_id TEXT NOT NULL,
|
|
@@ -16259,7 +16265,7 @@ function up146(db) {
|
|
|
16259
16265
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
16260
16266
|
`);
|
|
16261
16267
|
}
|
|
16262
|
-
function
|
|
16268
|
+
function up148(db) {
|
|
16263
16269
|
db.exec(`
|
|
16264
16270
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
16265
16271
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -16326,16 +16332,16 @@ function up147(db) {
|
|
|
16326
16332
|
}
|
|
16327
16333
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
16328
16334
|
}
|
|
16329
|
-
function
|
|
16335
|
+
function up149(db) {
|
|
16330
16336
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
16331
16337
|
}
|
|
16332
|
-
function
|
|
16338
|
+
function up150(db) {
|
|
16333
16339
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
16334
16340
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
16335
16341
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
16336
16342
|
}
|
|
16337
16343
|
}
|
|
16338
|
-
function
|
|
16344
|
+
function up151(db) {
|
|
16339
16345
|
const addColumn = (table, column, definition) => {
|
|
16340
16346
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
16341
16347
|
let exists;
|
|
@@ -16356,7 +16362,7 @@ function addColumnIfMissing28(db, table, column, definition) {
|
|
|
16356
16362
|
if (!columns.some((row) => row.name === column))
|
|
16357
16363
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
16358
16364
|
}
|
|
16359
|
-
function
|
|
16365
|
+
function up152(db) {
|
|
16360
16366
|
addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
16361
16367
|
addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
16362
16368
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -16510,13 +16516,13 @@ var MIGRATIONS = [
|
|
|
16510
16516
|
{
|
|
16511
16517
|
version: 1,
|
|
16512
16518
|
name: "baseline",
|
|
16513
|
-
up:
|
|
16519
|
+
up: up3,
|
|
16514
16520
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
16515
16521
|
},
|
|
16516
16522
|
{
|
|
16517
16523
|
version: 2,
|
|
16518
16524
|
name: "pipeline-v2",
|
|
16519
|
-
up:
|
|
16525
|
+
up: up4,
|
|
16520
16526
|
artifacts: {
|
|
16521
16527
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
16522
16528
|
}
|
|
@@ -16524,12 +16530,12 @@ var MIGRATIONS = [
|
|
|
16524
16530
|
{
|
|
16525
16531
|
version: 3,
|
|
16526
16532
|
name: "unique-content-hash",
|
|
16527
|
-
up:
|
|
16533
|
+
up: up5
|
|
16528
16534
|
},
|
|
16529
16535
|
{
|
|
16530
16536
|
version: 4,
|
|
16531
16537
|
name: "history-actor-and-retention",
|
|
16532
|
-
up:
|
|
16538
|
+
up: up6,
|
|
16533
16539
|
artifacts: {
|
|
16534
16540
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
16535
16541
|
}
|
|
@@ -16537,7 +16543,7 @@ var MIGRATIONS = [
|
|
|
16537
16543
|
{
|
|
16538
16544
|
version: 5,
|
|
16539
16545
|
name: "graph-extended",
|
|
16540
|
-
up:
|
|
16546
|
+
up: up7,
|
|
16541
16547
|
artifacts: {
|
|
16542
16548
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
16543
16549
|
}
|
|
@@ -16545,7 +16551,7 @@ var MIGRATIONS = [
|
|
|
16545
16551
|
{
|
|
16546
16552
|
version: 6,
|
|
16547
16553
|
name: "idempotency-key",
|
|
16548
|
-
up:
|
|
16554
|
+
up: up8,
|
|
16549
16555
|
artifacts: {
|
|
16550
16556
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
16551
16557
|
}
|
|
@@ -16553,42 +16559,42 @@ var MIGRATIONS = [
|
|
|
16553
16559
|
{
|
|
16554
16560
|
version: 7,
|
|
16555
16561
|
name: "documents-and-connectors",
|
|
16556
|
-
up:
|
|
16562
|
+
up: up9,
|
|
16557
16563
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
16558
16564
|
},
|
|
16559
16565
|
{
|
|
16560
16566
|
version: 8,
|
|
16561
16567
|
name: "embeddings-unique-hash",
|
|
16562
|
-
up:
|
|
16568
|
+
up: up10
|
|
16563
16569
|
},
|
|
16564
16570
|
{
|
|
16565
16571
|
version: 9,
|
|
16566
16572
|
name: "summary-jobs",
|
|
16567
|
-
up:
|
|
16573
|
+
up: up11,
|
|
16568
16574
|
artifacts: { tables: ["summary_jobs"] }
|
|
16569
16575
|
},
|
|
16570
16576
|
{
|
|
16571
16577
|
version: 10,
|
|
16572
16578
|
name: "umap-cache",
|
|
16573
|
-
up:
|
|
16579
|
+
up: up12,
|
|
16574
16580
|
artifacts: { tables: ["umap_cache"] }
|
|
16575
16581
|
},
|
|
16576
16582
|
{
|
|
16577
16583
|
version: 11,
|
|
16578
16584
|
name: "session-scores",
|
|
16579
|
-
up:
|
|
16585
|
+
up: up13,
|
|
16580
16586
|
artifacts: { tables: ["session_scores"] }
|
|
16581
16587
|
},
|
|
16582
16588
|
{
|
|
16583
16589
|
version: 12,
|
|
16584
16590
|
name: "scheduled-tasks",
|
|
16585
|
-
up:
|
|
16591
|
+
up: up14,
|
|
16586
16592
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
16587
16593
|
},
|
|
16588
16594
|
{
|
|
16589
16595
|
version: 13,
|
|
16590
16596
|
name: "ingestion-tracking",
|
|
16591
|
-
up:
|
|
16597
|
+
up: up15,
|
|
16592
16598
|
artifacts: {
|
|
16593
16599
|
columns: [
|
|
16594
16600
|
{ table: "memories", column: "source_path" },
|
|
@@ -16599,13 +16605,13 @@ var MIGRATIONS = [
|
|
|
16599
16605
|
{
|
|
16600
16606
|
version: 14,
|
|
16601
16607
|
name: "telemetry",
|
|
16602
|
-
up:
|
|
16608
|
+
up: up16,
|
|
16603
16609
|
artifacts: { tables: ["telemetry_events"] }
|
|
16604
16610
|
},
|
|
16605
16611
|
{
|
|
16606
16612
|
version: 15,
|
|
16607
16613
|
name: "session-memories",
|
|
16608
|
-
up:
|
|
16614
|
+
up: up17,
|
|
16609
16615
|
artifacts: {
|
|
16610
16616
|
tables: ["session_memories"],
|
|
16611
16617
|
columns: [
|
|
@@ -16617,13 +16623,13 @@ var MIGRATIONS = [
|
|
|
16617
16623
|
{
|
|
16618
16624
|
version: 16,
|
|
16619
16625
|
name: "session-checkpoints",
|
|
16620
|
-
up:
|
|
16626
|
+
up: up18,
|
|
16621
16627
|
artifacts: { tables: ["session_checkpoints"] }
|
|
16622
16628
|
},
|
|
16623
16629
|
{
|
|
16624
16630
|
version: 17,
|
|
16625
16631
|
name: "task-skills",
|
|
16626
|
-
up:
|
|
16632
|
+
up: up19,
|
|
16627
16633
|
artifacts: {
|
|
16628
16634
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
16629
16635
|
}
|
|
@@ -16631,13 +16637,13 @@ var MIGRATIONS = [
|
|
|
16631
16637
|
{
|
|
16632
16638
|
version: 18,
|
|
16633
16639
|
name: "skill-meta",
|
|
16634
|
-
up:
|
|
16640
|
+
up: up20,
|
|
16635
16641
|
artifacts: { tables: ["skill_meta"] }
|
|
16636
16642
|
},
|
|
16637
16643
|
{
|
|
16638
16644
|
version: 19,
|
|
16639
16645
|
name: "knowledge-structure",
|
|
16640
|
-
up:
|
|
16646
|
+
up: up21,
|
|
16641
16647
|
artifacts: {
|
|
16642
16648
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
16643
16649
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -16646,7 +16652,7 @@ var MIGRATIONS = [
|
|
|
16646
16652
|
{
|
|
16647
16653
|
version: 20,
|
|
16648
16654
|
name: "session-structural-columns",
|
|
16649
|
-
up:
|
|
16655
|
+
up: up22,
|
|
16650
16656
|
artifacts: {
|
|
16651
16657
|
columns: [
|
|
16652
16658
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -16659,7 +16665,7 @@ var MIGRATIONS = [
|
|
|
16659
16665
|
{
|
|
16660
16666
|
version: 21,
|
|
16661
16667
|
name: "checkpoint-structural",
|
|
16662
|
-
up:
|
|
16668
|
+
up: up23,
|
|
16663
16669
|
artifacts: {
|
|
16664
16670
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
16665
16671
|
}
|
|
@@ -16667,7 +16673,7 @@ var MIGRATIONS = [
|
|
|
16667
16673
|
{
|
|
16668
16674
|
version: 22,
|
|
16669
16675
|
name: "entity-pinning",
|
|
16670
|
-
up:
|
|
16676
|
+
up: up24,
|
|
16671
16677
|
artifacts: {
|
|
16672
16678
|
columns: [
|
|
16673
16679
|
{ table: "entities", column: "pinned" },
|
|
@@ -16678,17 +16684,17 @@ var MIGRATIONS = [
|
|
|
16678
16684
|
{
|
|
16679
16685
|
version: 23,
|
|
16680
16686
|
name: "retired-scorer-gap",
|
|
16681
|
-
up:
|
|
16687
|
+
up: up25
|
|
16682
16688
|
},
|
|
16683
16689
|
{
|
|
16684
16690
|
version: 24,
|
|
16685
16691
|
name: "retired-scorer-gap",
|
|
16686
|
-
up:
|
|
16692
|
+
up: up26
|
|
16687
16693
|
},
|
|
16688
16694
|
{
|
|
16689
16695
|
version: 25,
|
|
16690
16696
|
name: "agent-feedback",
|
|
16691
|
-
up:
|
|
16697
|
+
up: up27,
|
|
16692
16698
|
artifacts: {
|
|
16693
16699
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
16694
16700
|
}
|
|
@@ -16696,32 +16702,32 @@ var MIGRATIONS = [
|
|
|
16696
16702
|
{
|
|
16697
16703
|
version: 26,
|
|
16698
16704
|
name: "retired-scorer-gap",
|
|
16699
|
-
up:
|
|
16705
|
+
up: up28
|
|
16700
16706
|
},
|
|
16701
16707
|
{
|
|
16702
16708
|
version: 27,
|
|
16703
16709
|
name: "backfill-canonical-names",
|
|
16704
|
-
up:
|
|
16710
|
+
up: up29
|
|
16705
16711
|
},
|
|
16706
16712
|
{
|
|
16707
16713
|
version: 28,
|
|
16708
16714
|
name: "lossless-retention",
|
|
16709
|
-
up:
|
|
16715
|
+
up: up30
|
|
16710
16716
|
},
|
|
16711
16717
|
{
|
|
16712
16718
|
version: 29,
|
|
16713
16719
|
name: "session-summary-dag",
|
|
16714
|
-
up:
|
|
16720
|
+
up: up31
|
|
16715
16721
|
},
|
|
16716
16722
|
{
|
|
16717
16723
|
version: 30,
|
|
16718
16724
|
name: "nullable-memory-job-memory-id",
|
|
16719
|
-
up:
|
|
16725
|
+
up: up32
|
|
16720
16726
|
},
|
|
16721
16727
|
{
|
|
16722
16728
|
version: 31,
|
|
16723
16729
|
name: "dependency-reason",
|
|
16724
|
-
up:
|
|
16730
|
+
up: up33,
|
|
16725
16731
|
artifacts: {
|
|
16726
16732
|
columns: [
|
|
16727
16733
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -16732,7 +16738,7 @@ var MIGRATIONS = [
|
|
|
16732
16738
|
{
|
|
16733
16739
|
version: 32,
|
|
16734
16740
|
name: "embeddings-vector-column",
|
|
16735
|
-
up:
|
|
16741
|
+
up: up34,
|
|
16736
16742
|
artifacts: {
|
|
16737
16743
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
16738
16744
|
}
|
|
@@ -16740,7 +16746,7 @@ var MIGRATIONS = [
|
|
|
16740
16746
|
{
|
|
16741
16747
|
version: 33,
|
|
16742
16748
|
name: "scope",
|
|
16743
|
-
up:
|
|
16749
|
+
up: up35,
|
|
16744
16750
|
artifacts: {
|
|
16745
16751
|
columns: [{ table: "memories", column: "scope" }]
|
|
16746
16752
|
}
|
|
@@ -16748,17 +16754,17 @@ var MIGRATIONS = [
|
|
|
16748
16754
|
{
|
|
16749
16755
|
version: 34,
|
|
16750
16756
|
name: "scope-aware-dedup",
|
|
16751
|
-
up:
|
|
16757
|
+
up: up36
|
|
16752
16758
|
},
|
|
16753
16759
|
{
|
|
16754
16760
|
version: 35,
|
|
16755
16761
|
name: "entity-fts",
|
|
16756
|
-
up:
|
|
16762
|
+
up: up37
|
|
16757
16763
|
},
|
|
16758
16764
|
{
|
|
16759
16765
|
version: 36,
|
|
16760
16766
|
name: "dependency-confidence",
|
|
16761
|
-
up:
|
|
16767
|
+
up: up38,
|
|
16762
16768
|
artifacts: {
|
|
16763
16769
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
16764
16770
|
}
|
|
@@ -16766,7 +16772,7 @@ var MIGRATIONS = [
|
|
|
16766
16772
|
{
|
|
16767
16773
|
version: 37,
|
|
16768
16774
|
name: "entity-communities",
|
|
16769
|
-
up:
|
|
16775
|
+
up: up39,
|
|
16770
16776
|
artifacts: {
|
|
16771
16777
|
tables: ["entity_communities"],
|
|
16772
16778
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -16775,24 +16781,24 @@ var MIGRATIONS = [
|
|
|
16775
16781
|
{
|
|
16776
16782
|
version: 38,
|
|
16777
16783
|
name: "memory-hints",
|
|
16778
|
-
up:
|
|
16784
|
+
up: up40,
|
|
16779
16785
|
artifacts: { tables: ["memory_hints"] }
|
|
16780
16786
|
},
|
|
16781
16787
|
{
|
|
16782
16788
|
version: 39,
|
|
16783
16789
|
name: "dedup-entity-dependencies",
|
|
16784
|
-
up:
|
|
16790
|
+
up: up41
|
|
16785
16791
|
},
|
|
16786
16792
|
{
|
|
16787
16793
|
version: 40,
|
|
16788
16794
|
name: "session-transcripts",
|
|
16789
|
-
up:
|
|
16795
|
+
up: up42,
|
|
16790
16796
|
artifacts: { tables: ["session_transcripts"] }
|
|
16791
16797
|
},
|
|
16792
16798
|
{
|
|
16793
16799
|
version: 41,
|
|
16794
16800
|
name: "path-feedback",
|
|
16795
|
-
up:
|
|
16801
|
+
up: up43,
|
|
16796
16802
|
artifacts: {
|
|
16797
16803
|
tables: [
|
|
16798
16804
|
"path_feedback_events",
|
|
@@ -16807,7 +16813,7 @@ var MIGRATIONS = [
|
|
|
16807
16813
|
{
|
|
16808
16814
|
version: 42,
|
|
16809
16815
|
name: "session-memories-agent-id",
|
|
16810
|
-
up:
|
|
16816
|
+
up: up44,
|
|
16811
16817
|
artifacts: {
|
|
16812
16818
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
16813
16819
|
}
|
|
@@ -16815,7 +16821,7 @@ var MIGRATIONS = [
|
|
|
16815
16821
|
{
|
|
16816
16822
|
version: 43,
|
|
16817
16823
|
name: "agents-table",
|
|
16818
|
-
up:
|
|
16824
|
+
up: up45,
|
|
16819
16825
|
artifacts: {
|
|
16820
16826
|
tables: ["agents"],
|
|
16821
16827
|
columns: [
|
|
@@ -16827,7 +16833,7 @@ var MIGRATIONS = [
|
|
|
16827
16833
|
{
|
|
16828
16834
|
version: 44,
|
|
16829
16835
|
name: "memory-md-temporal-head",
|
|
16830
|
-
up:
|
|
16836
|
+
up: up46,
|
|
16831
16837
|
artifacts: {
|
|
16832
16838
|
columns: [
|
|
16833
16839
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -16839,7 +16845,7 @@ var MIGRATIONS = [
|
|
|
16839
16845
|
{
|
|
16840
16846
|
version: 45,
|
|
16841
16847
|
name: "lossless-working-memory-hardening",
|
|
16842
|
-
up:
|
|
16848
|
+
up: up47,
|
|
16843
16849
|
artifacts: {
|
|
16844
16850
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
16845
16851
|
columns: [
|
|
@@ -16852,17 +16858,17 @@ var MIGRATIONS = [
|
|
|
16852
16858
|
{
|
|
16853
16859
|
version: 46,
|
|
16854
16860
|
name: "session-summary-uniqueness",
|
|
16855
|
-
up:
|
|
16861
|
+
up: up48
|
|
16856
16862
|
},
|
|
16857
16863
|
{
|
|
16858
16864
|
version: 47,
|
|
16859
16865
|
name: "agent-scoped-temporal-uniqueness",
|
|
16860
|
-
up:
|
|
16866
|
+
up: up49
|
|
16861
16867
|
},
|
|
16862
16868
|
{
|
|
16863
16869
|
version: 48,
|
|
16864
16870
|
name: "thread-heads",
|
|
16865
|
-
up:
|
|
16871
|
+
up: up50,
|
|
16866
16872
|
artifacts: {
|
|
16867
16873
|
tables: ["memory_thread_heads"]
|
|
16868
16874
|
}
|
|
@@ -16870,7 +16876,7 @@ var MIGRATIONS = [
|
|
|
16870
16876
|
{
|
|
16871
16877
|
version: 49,
|
|
16872
16878
|
name: "session-extract-cursors",
|
|
16873
|
-
up:
|
|
16879
|
+
up: up51,
|
|
16874
16880
|
artifacts: {
|
|
16875
16881
|
tables: ["session_extract_cursors"]
|
|
16876
16882
|
}
|
|
@@ -16878,7 +16884,7 @@ var MIGRATIONS = [
|
|
|
16878
16884
|
{
|
|
16879
16885
|
version: 50,
|
|
16880
16886
|
name: "related-to-audit",
|
|
16881
|
-
up:
|
|
16887
|
+
up: up52,
|
|
16882
16888
|
artifacts: {
|
|
16883
16889
|
tables: ["entity_dependency_history"]
|
|
16884
16890
|
}
|
|
@@ -16886,7 +16892,7 @@ var MIGRATIONS = [
|
|
|
16886
16892
|
{
|
|
16887
16893
|
version: 51,
|
|
16888
16894
|
name: "memory-md-rolling-window-lineage",
|
|
16889
|
-
up:
|
|
16895
|
+
up: up53,
|
|
16890
16896
|
artifacts: {
|
|
16891
16897
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
16892
16898
|
columns: [
|
|
@@ -16901,7 +16907,7 @@ var MIGRATIONS = [
|
|
|
16901
16907
|
{
|
|
16902
16908
|
version: 52,
|
|
16903
16909
|
name: "mcp-invocations",
|
|
16904
|
-
up:
|
|
16910
|
+
up: up54,
|
|
16905
16911
|
artifacts: {
|
|
16906
16912
|
tables: ["mcp_invocations"]
|
|
16907
16913
|
}
|
|
@@ -16909,7 +16915,7 @@ var MIGRATIONS = [
|
|
|
16909
16915
|
{
|
|
16910
16916
|
version: 53,
|
|
16911
16917
|
name: "skill-invocations",
|
|
16912
|
-
up:
|
|
16918
|
+
up: up55,
|
|
16913
16919
|
artifacts: {
|
|
16914
16920
|
tables: ["skill_invocations"]
|
|
16915
16921
|
}
|
|
@@ -16917,7 +16923,7 @@ var MIGRATIONS = [
|
|
|
16917
16923
|
{
|
|
16918
16924
|
version: 54,
|
|
16919
16925
|
name: "task-agent-scope",
|
|
16920
|
-
up:
|
|
16926
|
+
up: up56,
|
|
16921
16927
|
artifacts: {
|
|
16922
16928
|
tables: ["task_scope_hints"]
|
|
16923
16929
|
}
|
|
@@ -16925,7 +16931,7 @@ var MIGRATIONS = [
|
|
|
16925
16931
|
{
|
|
16926
16932
|
version: 55,
|
|
16927
16933
|
name: "dreaming-state",
|
|
16928
|
-
up:
|
|
16934
|
+
up: up57,
|
|
16929
16935
|
artifacts: {
|
|
16930
16936
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
16931
16937
|
}
|
|
@@ -16933,22 +16939,22 @@ var MIGRATIONS = [
|
|
|
16933
16939
|
{
|
|
16934
16940
|
version: 56,
|
|
16935
16941
|
name: "agent-scoped-content-hash",
|
|
16936
|
-
up:
|
|
16942
|
+
up: up58
|
|
16937
16943
|
},
|
|
16938
16944
|
{
|
|
16939
16945
|
version: 57,
|
|
16940
16946
|
name: "memories-fts-tokenizer-repair",
|
|
16941
|
-
up:
|
|
16947
|
+
up: up59
|
|
16942
16948
|
},
|
|
16943
16949
|
{
|
|
16944
16950
|
version: 58,
|
|
16945
16951
|
name: "knowledge-graph-indices",
|
|
16946
|
-
up:
|
|
16952
|
+
up: up60
|
|
16947
16953
|
},
|
|
16948
16954
|
{
|
|
16949
16955
|
version: 59,
|
|
16950
16956
|
name: "entity-attribute-claim-key",
|
|
16951
|
-
up:
|
|
16957
|
+
up: up61,
|
|
16952
16958
|
artifacts: {
|
|
16953
16959
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
16954
16960
|
}
|
|
@@ -16956,7 +16962,7 @@ var MIGRATIONS = [
|
|
|
16956
16962
|
{
|
|
16957
16963
|
version: 60,
|
|
16958
16964
|
name: "entity-attribute-group-key",
|
|
16959
|
-
up:
|
|
16965
|
+
up: up62,
|
|
16960
16966
|
artifacts: {
|
|
16961
16967
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
16962
16968
|
}
|
|
@@ -16964,7 +16970,7 @@ var MIGRATIONS = [
|
|
|
16964
16970
|
{
|
|
16965
16971
|
version: 61,
|
|
16966
16972
|
name: "memory-artifact-source-mtime",
|
|
16967
|
-
up:
|
|
16973
|
+
up: up63,
|
|
16968
16974
|
artifacts: {
|
|
16969
16975
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
16970
16976
|
}
|
|
@@ -16972,7 +16978,7 @@ var MIGRATIONS = [
|
|
|
16972
16978
|
{
|
|
16973
16979
|
version: 62,
|
|
16974
16980
|
name: "memory-artifact-soft-delete",
|
|
16975
|
-
up:
|
|
16981
|
+
up: up64,
|
|
16976
16982
|
artifacts: {
|
|
16977
16983
|
columns: [
|
|
16978
16984
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -16983,12 +16989,12 @@ var MIGRATIONS = [
|
|
|
16983
16989
|
{
|
|
16984
16990
|
version: 63,
|
|
16985
16991
|
name: "content-only-memories-fts-update",
|
|
16986
|
-
up:
|
|
16992
|
+
up: up65
|
|
16987
16993
|
},
|
|
16988
16994
|
{
|
|
16989
16995
|
version: 64,
|
|
16990
16996
|
name: "source-graph-provenance",
|
|
16991
|
-
up:
|
|
16997
|
+
up: up66,
|
|
16992
16998
|
artifacts: {
|
|
16993
16999
|
columns: [
|
|
16994
17000
|
{ table: "entities", column: "source_path" },
|
|
@@ -17001,7 +17007,7 @@ var MIGRATIONS = [
|
|
|
17001
17007
|
{
|
|
17002
17008
|
version: 65,
|
|
17003
17009
|
name: "source-embedding-agent-scope",
|
|
17004
|
-
up:
|
|
17010
|
+
up: up67,
|
|
17005
17011
|
artifacts: {
|
|
17006
17012
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
17007
17013
|
}
|
|
@@ -17009,7 +17015,7 @@ var MIGRATIONS = [
|
|
|
17009
17015
|
{
|
|
17010
17016
|
version: 66,
|
|
17011
17017
|
name: "memory-search-telemetry",
|
|
17012
|
-
up:
|
|
17018
|
+
up: up68,
|
|
17013
17019
|
artifacts: {
|
|
17014
17020
|
tables: ["memory_search_telemetry"]
|
|
17015
17021
|
}
|
|
@@ -17017,7 +17023,7 @@ var MIGRATIONS = [
|
|
|
17017
17023
|
{
|
|
17018
17024
|
version: 67,
|
|
17019
17025
|
name: "ontology-proposals",
|
|
17020
|
-
up:
|
|
17026
|
+
up: up69,
|
|
17021
17027
|
artifacts: {
|
|
17022
17028
|
tables: ["ontology_proposals"],
|
|
17023
17029
|
columns: [
|
|
@@ -17031,7 +17037,7 @@ var MIGRATIONS = [
|
|
|
17031
17037
|
{
|
|
17032
17038
|
version: 68,
|
|
17033
17039
|
name: "daily-reflections",
|
|
17034
|
-
up:
|
|
17040
|
+
up: up70,
|
|
17035
17041
|
artifacts: {
|
|
17036
17042
|
tables: ["daily_reflections"]
|
|
17037
17043
|
}
|
|
@@ -17039,7 +17045,7 @@ var MIGRATIONS = [
|
|
|
17039
17045
|
{
|
|
17040
17046
|
version: 69,
|
|
17041
17047
|
name: "daily-reflections-multiple-insights",
|
|
17042
|
-
up:
|
|
17048
|
+
up: up71,
|
|
17043
17049
|
artifacts: {
|
|
17044
17050
|
tables: ["daily_reflections"]
|
|
17045
17051
|
}
|
|
@@ -17047,7 +17053,7 @@ var MIGRATIONS = [
|
|
|
17047
17053
|
{
|
|
17048
17054
|
version: 70,
|
|
17049
17055
|
name: "ontology-control-plane-state",
|
|
17050
|
-
up:
|
|
17056
|
+
up: up72,
|
|
17051
17057
|
artifacts: {
|
|
17052
17058
|
columns: [
|
|
17053
17059
|
{ table: "entities", column: "status" },
|
|
@@ -17062,7 +17068,7 @@ var MIGRATIONS = [
|
|
|
17062
17068
|
{
|
|
17063
17069
|
version: 71,
|
|
17064
17070
|
name: "epistemic-assertions",
|
|
17065
|
-
up:
|
|
17071
|
+
up: up73,
|
|
17066
17072
|
artifacts: {
|
|
17067
17073
|
tables: ["epistemic_assertions"]
|
|
17068
17074
|
}
|
|
@@ -17070,7 +17076,7 @@ var MIGRATIONS = [
|
|
|
17070
17076
|
{
|
|
17071
17077
|
version: 72,
|
|
17072
17078
|
name: "agent-scoped-idempotency-key",
|
|
17073
|
-
up:
|
|
17079
|
+
up: up74,
|
|
17074
17080
|
artifacts: {
|
|
17075
17081
|
columns: [
|
|
17076
17082
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -17081,7 +17087,7 @@ var MIGRATIONS = [
|
|
|
17081
17087
|
{
|
|
17082
17088
|
version: 73,
|
|
17083
17089
|
name: "recall-context-dedupe",
|
|
17084
|
-
up:
|
|
17090
|
+
up: up75,
|
|
17085
17091
|
artifacts: {
|
|
17086
17092
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
17087
17093
|
}
|
|
@@ -17089,7 +17095,7 @@ var MIGRATIONS = [
|
|
|
17089
17095
|
{
|
|
17090
17096
|
version: 74,
|
|
17091
17097
|
name: "aggregate-memory-links",
|
|
17092
|
-
up:
|
|
17098
|
+
up: up76,
|
|
17093
17099
|
artifacts: {
|
|
17094
17100
|
tables: ["aggregate_memory_sources"]
|
|
17095
17101
|
}
|
|
@@ -17097,7 +17103,7 @@ var MIGRATIONS = [
|
|
|
17097
17103
|
{
|
|
17098
17104
|
version: 75,
|
|
17099
17105
|
name: "memory-artifact-source-provenance",
|
|
17100
|
-
up:
|
|
17106
|
+
up: up77,
|
|
17101
17107
|
artifacts: {
|
|
17102
17108
|
columns: [
|
|
17103
17109
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -17111,7 +17117,7 @@ var MIGRATIONS = [
|
|
|
17111
17117
|
{
|
|
17112
17118
|
version: 76,
|
|
17113
17119
|
name: "temporal-edges",
|
|
17114
|
-
up:
|
|
17120
|
+
up: up78,
|
|
17115
17121
|
artifacts: {
|
|
17116
17122
|
tables: ["temporal_edges"]
|
|
17117
17123
|
}
|
|
@@ -17119,7 +17125,7 @@ var MIGRATIONS = [
|
|
|
17119
17125
|
{
|
|
17120
17126
|
version: 77,
|
|
17121
17127
|
name: "entity-aliases",
|
|
17122
|
-
up:
|
|
17128
|
+
up: up79,
|
|
17123
17129
|
artifacts: {
|
|
17124
17130
|
tables: ["entity_aliases"]
|
|
17125
17131
|
}
|
|
@@ -17127,7 +17133,7 @@ var MIGRATIONS = [
|
|
|
17127
17133
|
{
|
|
17128
17134
|
version: 78,
|
|
17129
17135
|
name: "api-keys",
|
|
17130
|
-
up:
|
|
17136
|
+
up: up80,
|
|
17131
17137
|
artifacts: {
|
|
17132
17138
|
tables: ["api_keys"]
|
|
17133
17139
|
}
|
|
@@ -17135,7 +17141,7 @@ var MIGRATIONS = [
|
|
|
17135
17141
|
{
|
|
17136
17142
|
version: 79,
|
|
17137
17143
|
name: "transcript-capture-jobs",
|
|
17138
|
-
up:
|
|
17144
|
+
up: up81,
|
|
17139
17145
|
artifacts: {
|
|
17140
17146
|
tables: ["transcript_capture_jobs"]
|
|
17141
17147
|
}
|
|
@@ -17143,7 +17149,7 @@ var MIGRATIONS = [
|
|
|
17143
17149
|
{
|
|
17144
17150
|
version: 80,
|
|
17145
17151
|
name: "document-scope-columns",
|
|
17146
|
-
up:
|
|
17152
|
+
up: up82,
|
|
17147
17153
|
artifacts: {
|
|
17148
17154
|
columns: [
|
|
17149
17155
|
{ table: "documents", column: "agent_id" },
|
|
@@ -17154,7 +17160,7 @@ var MIGRATIONS = [
|
|
|
17154
17160
|
{
|
|
17155
17161
|
version: 81,
|
|
17156
17162
|
name: "aggregate-evidence-sources",
|
|
17157
|
-
up:
|
|
17163
|
+
up: up83,
|
|
17158
17164
|
artifacts: {
|
|
17159
17165
|
tables: ["aggregate_evidence_sources"]
|
|
17160
17166
|
}
|
|
@@ -17162,7 +17168,7 @@ var MIGRATIONS = [
|
|
|
17162
17168
|
{
|
|
17163
17169
|
version: 82,
|
|
17164
17170
|
name: "skill-invocations-harness",
|
|
17165
|
-
up:
|
|
17171
|
+
up: up84,
|
|
17166
17172
|
artifacts: {
|
|
17167
17173
|
columns: [
|
|
17168
17174
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -17173,7 +17179,7 @@ var MIGRATIONS = [
|
|
|
17173
17179
|
{
|
|
17174
17180
|
version: 83,
|
|
17175
17181
|
name: "memory-lifecycle-repair",
|
|
17176
|
-
up:
|
|
17182
|
+
up: up85,
|
|
17177
17183
|
artifacts: {
|
|
17178
17184
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
17179
17185
|
columns: [
|
|
@@ -17188,7 +17194,7 @@ var MIGRATIONS = [
|
|
|
17188
17194
|
{
|
|
17189
17195
|
version: 84,
|
|
17190
17196
|
name: "legacy-markdown-import-state",
|
|
17191
|
-
up:
|
|
17197
|
+
up: up86,
|
|
17192
17198
|
artifacts: {
|
|
17193
17199
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
17194
17200
|
}
|
|
@@ -17196,7 +17202,7 @@ var MIGRATIONS = [
|
|
|
17196
17202
|
{
|
|
17197
17203
|
version: 85,
|
|
17198
17204
|
name: "backfill-relations-to-dependencies",
|
|
17199
|
-
up:
|
|
17205
|
+
up: up87,
|
|
17200
17206
|
artifacts: {
|
|
17201
17207
|
tables: ["entity_dependencies"]
|
|
17202
17208
|
}
|
|
@@ -17204,7 +17210,7 @@ var MIGRATIONS = [
|
|
|
17204
17210
|
{
|
|
17205
17211
|
version: 86,
|
|
17206
17212
|
name: "summary-jobs-content-hash",
|
|
17207
|
-
up:
|
|
17213
|
+
up: up88,
|
|
17208
17214
|
artifacts: {
|
|
17209
17215
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
17210
17216
|
}
|
|
@@ -17212,7 +17218,7 @@ var MIGRATIONS = [
|
|
|
17212
17218
|
{
|
|
17213
17219
|
version: 87,
|
|
17214
17220
|
name: "summary-jobs-boundary-reason",
|
|
17215
|
-
up:
|
|
17221
|
+
up: up89,
|
|
17216
17222
|
artifacts: {
|
|
17217
17223
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
17218
17224
|
}
|
|
@@ -17220,7 +17226,7 @@ var MIGRATIONS = [
|
|
|
17220
17226
|
{
|
|
17221
17227
|
version: 88,
|
|
17222
17228
|
name: "transcript-recovery-files",
|
|
17223
|
-
up:
|
|
17229
|
+
up: up90,
|
|
17224
17230
|
artifacts: {
|
|
17225
17231
|
tables: ["transcript_recovery_files"]
|
|
17226
17232
|
}
|
|
@@ -17228,7 +17234,7 @@ var MIGRATIONS = [
|
|
|
17228
17234
|
{
|
|
17229
17235
|
version: 89,
|
|
17230
17236
|
name: "job-cancellations",
|
|
17231
|
-
up:
|
|
17237
|
+
up: up91,
|
|
17232
17238
|
artifacts: {
|
|
17233
17239
|
tables: ["job_cancellations"]
|
|
17234
17240
|
}
|
|
@@ -17236,7 +17242,7 @@ var MIGRATIONS = [
|
|
|
17236
17242
|
{
|
|
17237
17243
|
version: 90,
|
|
17238
17244
|
name: "job-archive",
|
|
17239
|
-
up:
|
|
17245
|
+
up: up92,
|
|
17240
17246
|
artifacts: {
|
|
17241
17247
|
tables: ["job_archive"]
|
|
17242
17248
|
}
|
|
@@ -17244,25 +17250,25 @@ var MIGRATIONS = [
|
|
|
17244
17250
|
{
|
|
17245
17251
|
version: 91,
|
|
17246
17252
|
name: "embedding-index-generations",
|
|
17247
|
-
up:
|
|
17253
|
+
up: up93,
|
|
17248
17254
|
artifacts: { tables: ["embedding_index_state"] }
|
|
17249
17255
|
},
|
|
17250
17256
|
{
|
|
17251
17257
|
version: 92,
|
|
17252
17258
|
name: "embedding-staging-store",
|
|
17253
|
-
up:
|
|
17259
|
+
up: up94,
|
|
17254
17260
|
artifacts: { tables: ["embeddings_staging"] }
|
|
17255
17261
|
},
|
|
17256
17262
|
{
|
|
17257
17263
|
version: 93,
|
|
17258
17264
|
name: "dreaming-evidence-cursor",
|
|
17259
|
-
up:
|
|
17265
|
+
up: up95,
|
|
17260
17266
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
17261
17267
|
},
|
|
17262
17268
|
{
|
|
17263
17269
|
version: 94,
|
|
17264
17270
|
name: "memory-kind",
|
|
17265
|
-
up:
|
|
17271
|
+
up: up96,
|
|
17266
17272
|
artifacts: {
|
|
17267
17273
|
columns: [
|
|
17268
17274
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -17273,35 +17279,35 @@ var MIGRATIONS = [
|
|
|
17273
17279
|
{
|
|
17274
17280
|
version: 95,
|
|
17275
17281
|
name: "compaction-recall-projections",
|
|
17276
|
-
up:
|
|
17282
|
+
up: up97
|
|
17277
17283
|
},
|
|
17278
17284
|
{
|
|
17279
17285
|
version: 96,
|
|
17280
17286
|
name: "retire-legacy-ingestion",
|
|
17281
|
-
up:
|
|
17287
|
+
up: up98
|
|
17282
17288
|
},
|
|
17283
17289
|
{
|
|
17284
17290
|
version: 97,
|
|
17285
17291
|
name: "dreaming-failure-backoff",
|
|
17286
|
-
up:
|
|
17292
|
+
up: up99,
|
|
17287
17293
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
17288
17294
|
},
|
|
17289
17295
|
{
|
|
17290
17296
|
version: 98,
|
|
17291
17297
|
name: "dreaming-evidence-exclusions",
|
|
17292
|
-
up:
|
|
17298
|
+
up: up100,
|
|
17293
17299
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
17294
17300
|
},
|
|
17295
17301
|
{
|
|
17296
17302
|
version: 99,
|
|
17297
17303
|
name: "dreaming-tool-calls",
|
|
17298
|
-
up:
|
|
17304
|
+
up: up101,
|
|
17299
17305
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
17300
17306
|
},
|
|
17301
17307
|
{
|
|
17302
17308
|
version: 100,
|
|
17303
17309
|
name: "dreaming-runbook",
|
|
17304
|
-
up:
|
|
17310
|
+
up: up102,
|
|
17305
17311
|
artifacts: {
|
|
17306
17312
|
columns: [
|
|
17307
17313
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -17312,23 +17318,23 @@ var MIGRATIONS = [
|
|
|
17312
17318
|
{
|
|
17313
17319
|
version: 101,
|
|
17314
17320
|
name: "dreaming-attention",
|
|
17315
|
-
up:
|
|
17321
|
+
up: up103,
|
|
17316
17322
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17317
17323
|
},
|
|
17318
17324
|
{
|
|
17319
17325
|
version: 102,
|
|
17320
17326
|
name: "attribute-semantic-memories",
|
|
17321
|
-
up:
|
|
17327
|
+
up: up104
|
|
17322
17328
|
},
|
|
17323
17329
|
{
|
|
17324
17330
|
version: 103,
|
|
17325
17331
|
name: "semantic-memory-kind",
|
|
17326
|
-
up:
|
|
17332
|
+
up: up105
|
|
17327
17333
|
},
|
|
17328
17334
|
{
|
|
17329
17335
|
version: 104,
|
|
17330
17336
|
name: "derived-memory-provenance",
|
|
17331
|
-
up:
|
|
17337
|
+
up: up106,
|
|
17332
17338
|
artifacts: {
|
|
17333
17339
|
tables: ["derived_memory_sources"],
|
|
17334
17340
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -17337,12 +17343,12 @@ var MIGRATIONS = [
|
|
|
17337
17343
|
{
|
|
17338
17344
|
version: 105,
|
|
17339
17345
|
name: "agent-scoped-entity-name",
|
|
17340
|
-
up:
|
|
17346
|
+
up: up107
|
|
17341
17347
|
},
|
|
17342
17348
|
{
|
|
17343
17349
|
version: 106,
|
|
17344
17350
|
name: "memory-review-after",
|
|
17345
|
-
up:
|
|
17351
|
+
up: up108,
|
|
17346
17352
|
artifacts: {
|
|
17347
17353
|
columns: [{ table: "memories", column: "review_after" }]
|
|
17348
17354
|
}
|
|
@@ -17350,7 +17356,7 @@ var MIGRATIONS = [
|
|
|
17350
17356
|
{
|
|
17351
17357
|
version: 107,
|
|
17352
17358
|
name: "dreaming-pass-usage",
|
|
17353
|
-
up:
|
|
17359
|
+
up: up109,
|
|
17354
17360
|
artifacts: {
|
|
17355
17361
|
columns: [
|
|
17356
17362
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -17364,7 +17370,7 @@ var MIGRATIONS = [
|
|
|
17364
17370
|
{
|
|
17365
17371
|
version: 108,
|
|
17366
17372
|
name: "embedding-usage",
|
|
17367
|
-
up:
|
|
17373
|
+
up: up110,
|
|
17368
17374
|
artifacts: {
|
|
17369
17375
|
tables: ["embedding_usage"]
|
|
17370
17376
|
}
|
|
@@ -17372,7 +17378,7 @@ var MIGRATIONS = [
|
|
|
17372
17378
|
{
|
|
17373
17379
|
version: 109,
|
|
17374
17380
|
name: "telemetry-install",
|
|
17375
|
-
up:
|
|
17381
|
+
up: up111,
|
|
17376
17382
|
artifacts: {
|
|
17377
17383
|
tables: ["telemetry_install"]
|
|
17378
17384
|
}
|
|
@@ -17380,12 +17386,12 @@ var MIGRATIONS = [
|
|
|
17380
17386
|
{
|
|
17381
17387
|
version: 110,
|
|
17382
17388
|
name: "memory-mention-join-index",
|
|
17383
|
-
up:
|
|
17389
|
+
up: up112
|
|
17384
17390
|
},
|
|
17385
17391
|
{
|
|
17386
17392
|
version: 111,
|
|
17387
17393
|
name: "telemetry-first-use",
|
|
17388
|
-
up:
|
|
17394
|
+
up: up113,
|
|
17389
17395
|
artifacts: {
|
|
17390
17396
|
columns: [
|
|
17391
17397
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -17396,7 +17402,7 @@ var MIGRATIONS = [
|
|
|
17396
17402
|
{
|
|
17397
17403
|
version: 112,
|
|
17398
17404
|
name: "telemetry-queue-ownership",
|
|
17399
|
-
up:
|
|
17405
|
+
up: up114,
|
|
17400
17406
|
artifacts: {
|
|
17401
17407
|
columns: [
|
|
17402
17408
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -17408,7 +17414,7 @@ var MIGRATIONS = [
|
|
|
17408
17414
|
{
|
|
17409
17415
|
version: 113,
|
|
17410
17416
|
name: "session-claims",
|
|
17411
|
-
up:
|
|
17417
|
+
up: up115,
|
|
17412
17418
|
artifacts: {
|
|
17413
17419
|
tables: ["session_claims"],
|
|
17414
17420
|
columns: [
|
|
@@ -17422,12 +17428,12 @@ var MIGRATIONS = [
|
|
|
17422
17428
|
{
|
|
17423
17429
|
version: 114,
|
|
17424
17430
|
name: "memory-traversal-hydration-index",
|
|
17425
|
-
up:
|
|
17431
|
+
up: up116
|
|
17426
17432
|
},
|
|
17427
17433
|
{
|
|
17428
17434
|
version: 115,
|
|
17429
17435
|
name: "cross-agent-message-notifications",
|
|
17430
|
-
up:
|
|
17436
|
+
up: up117,
|
|
17431
17437
|
artifacts: {
|
|
17432
17438
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
17433
17439
|
}
|
|
@@ -17435,7 +17441,7 @@ var MIGRATIONS = [
|
|
|
17435
17441
|
{
|
|
17436
17442
|
version: 116,
|
|
17437
17443
|
name: "acp-delivery-reconciliation",
|
|
17438
|
-
up:
|
|
17444
|
+
up: up118,
|
|
17439
17445
|
artifacts: {
|
|
17440
17446
|
columns: [
|
|
17441
17447
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -17449,7 +17455,7 @@ var MIGRATIONS = [
|
|
|
17449
17455
|
{
|
|
17450
17456
|
version: 117,
|
|
17451
17457
|
name: "retire-summary-worker",
|
|
17452
|
-
up:
|
|
17458
|
+
up: up119,
|
|
17453
17459
|
artifacts: {
|
|
17454
17460
|
columns: [
|
|
17455
17461
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -17460,24 +17466,24 @@ var MIGRATIONS = [
|
|
|
17460
17466
|
{
|
|
17461
17467
|
version: 118,
|
|
17462
17468
|
name: "queue-pressure-indices",
|
|
17463
|
-
up:
|
|
17469
|
+
up: up120
|
|
17464
17470
|
},
|
|
17465
17471
|
{
|
|
17466
17472
|
version: 119,
|
|
17467
17473
|
name: "telemetry-version-observation",
|
|
17468
|
-
up:
|
|
17474
|
+
up: up121,
|
|
17469
17475
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
17470
17476
|
},
|
|
17471
17477
|
{
|
|
17472
17478
|
version: 120,
|
|
17473
17479
|
name: "source-lifecycle-telemetry",
|
|
17474
|
-
up:
|
|
17480
|
+
up: up122,
|
|
17475
17481
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
17476
17482
|
},
|
|
17477
17483
|
{
|
|
17478
17484
|
version: 121,
|
|
17479
17485
|
name: "telemetry-delivery-health",
|
|
17480
|
-
up:
|
|
17486
|
+
up: up123,
|
|
17481
17487
|
artifacts: {
|
|
17482
17488
|
tables: ["telemetry_delivery_state"],
|
|
17483
17489
|
columns: [
|
|
@@ -17491,7 +17497,7 @@ var MIGRATIONS = [
|
|
|
17491
17497
|
{
|
|
17492
17498
|
version: 122,
|
|
17493
17499
|
name: "dreaming-evidence-retry",
|
|
17494
|
-
up:
|
|
17500
|
+
up: up124,
|
|
17495
17501
|
artifacts: {
|
|
17496
17502
|
columns: [
|
|
17497
17503
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -17504,13 +17510,13 @@ var MIGRATIONS = [
|
|
|
17504
17510
|
{
|
|
17505
17511
|
version: 123,
|
|
17506
17512
|
name: "embedding-index-failures",
|
|
17507
|
-
up:
|
|
17513
|
+
up: up125,
|
|
17508
17514
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
17509
17515
|
},
|
|
17510
17516
|
{
|
|
17511
17517
|
version: 124,
|
|
17512
17518
|
name: "import-derived-lifecycle",
|
|
17513
|
-
up:
|
|
17519
|
+
up: up126,
|
|
17514
17520
|
artifacts: {
|
|
17515
17521
|
tables: ["imported_source_lifecycle"]
|
|
17516
17522
|
}
|
|
@@ -17518,77 +17524,77 @@ var MIGRATIONS = [
|
|
|
17518
17524
|
{
|
|
17519
17525
|
version: 125,
|
|
17520
17526
|
name: "memory-content-safety",
|
|
17521
|
-
up:
|
|
17527
|
+
up: up127,
|
|
17522
17528
|
artifacts: { tables: ["memory_content_safety"] }
|
|
17523
17529
|
},
|
|
17524
17530
|
{
|
|
17525
17531
|
version: 126,
|
|
17526
17532
|
name: "dreaming-surprisal-attention",
|
|
17527
|
-
up:
|
|
17533
|
+
up: up128,
|
|
17528
17534
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17529
17535
|
},
|
|
17530
17536
|
{
|
|
17531
17537
|
version: 127,
|
|
17532
17538
|
name: "ontology-contradictions",
|
|
17533
|
-
up:
|
|
17539
|
+
up: up129,
|
|
17534
17540
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
17535
17541
|
},
|
|
17536
17542
|
{
|
|
17537
17543
|
version: 128,
|
|
17538
17544
|
name: "bounded-queue-diagnostics",
|
|
17539
|
-
up:
|
|
17545
|
+
up: up130
|
|
17540
17546
|
},
|
|
17541
17547
|
{
|
|
17542
17548
|
version: 129,
|
|
17543
17549
|
name: "retire-structural-jobs",
|
|
17544
|
-
up:
|
|
17550
|
+
up: up131
|
|
17545
17551
|
},
|
|
17546
17552
|
{
|
|
17547
17553
|
version: 130,
|
|
17548
17554
|
name: "embedding-repair-state",
|
|
17549
|
-
up:
|
|
17555
|
+
up: up132,
|
|
17550
17556
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
17551
17557
|
},
|
|
17552
17558
|
{
|
|
17553
17559
|
version: 131,
|
|
17554
17560
|
name: "dreaming-evidence-consumption",
|
|
17555
|
-
up:
|
|
17561
|
+
up: up133,
|
|
17556
17562
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
17557
17563
|
},
|
|
17558
17564
|
{
|
|
17559
17565
|
version: 132,
|
|
17560
17566
|
name: "observer-scoped-epistemic-assertions",
|
|
17561
|
-
up:
|
|
17567
|
+
up: up134,
|
|
17562
17568
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
17563
17569
|
},
|
|
17564
17570
|
{
|
|
17565
17571
|
version: 133,
|
|
17566
17572
|
name: "dreaming-memory-head",
|
|
17567
|
-
up:
|
|
17573
|
+
up: up135,
|
|
17568
17574
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
17569
17575
|
},
|
|
17570
17576
|
{
|
|
17571
17577
|
version: 134,
|
|
17572
17578
|
name: "scope-memory-head-entries",
|
|
17573
|
-
up:
|
|
17579
|
+
up: up136,
|
|
17574
17580
|
artifacts: { tables: ["memory_head_entries"] }
|
|
17575
17581
|
},
|
|
17576
17582
|
{
|
|
17577
17583
|
version: 135,
|
|
17578
17584
|
name: "memory-head-publication",
|
|
17579
|
-
up:
|
|
17585
|
+
up: up137,
|
|
17580
17586
|
artifacts: { tables: ["memory_head_publications"] }
|
|
17581
17587
|
},
|
|
17582
17588
|
{
|
|
17583
17589
|
version: 136,
|
|
17584
17590
|
name: "memory-head-revisions",
|
|
17585
|
-
up:
|
|
17591
|
+
up: up138,
|
|
17586
17592
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
17587
17593
|
},
|
|
17588
17594
|
{
|
|
17589
17595
|
version: 137,
|
|
17590
17596
|
name: "dreaming-head-manifest",
|
|
17591
|
-
up:
|
|
17597
|
+
up: up139,
|
|
17592
17598
|
artifacts: {
|
|
17593
17599
|
columns: [
|
|
17594
17600
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -17599,7 +17605,7 @@ var MIGRATIONS = [
|
|
|
17599
17605
|
{
|
|
17600
17606
|
version: 138,
|
|
17601
17607
|
name: "bounded-status-projections",
|
|
17602
|
-
up:
|
|
17608
|
+
up: up140,
|
|
17603
17609
|
artifacts: {
|
|
17604
17610
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
17605
17611
|
}
|
|
@@ -17607,31 +17613,31 @@ var MIGRATIONS = [
|
|
|
17607
17613
|
{
|
|
17608
17614
|
version: 139,
|
|
17609
17615
|
name: "native-source-sync-state",
|
|
17610
|
-
up:
|
|
17616
|
+
up: up141,
|
|
17611
17617
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
17612
17618
|
},
|
|
17613
17619
|
{
|
|
17614
17620
|
version: 140,
|
|
17615
17621
|
name: "transcript-recovery-frontier",
|
|
17616
|
-
up:
|
|
17622
|
+
up: up142,
|
|
17617
17623
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
17618
17624
|
},
|
|
17619
17625
|
{
|
|
17620
17626
|
version: 141,
|
|
17621
17627
|
name: "source-sync-checkpoints",
|
|
17622
|
-
up:
|
|
17628
|
+
up: up143,
|
|
17623
17629
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
17624
17630
|
},
|
|
17625
17631
|
{
|
|
17626
17632
|
version: 142,
|
|
17627
17633
|
name: "source-sync-frontier",
|
|
17628
|
-
up:
|
|
17634
|
+
up: up144,
|
|
17629
17635
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
17630
17636
|
},
|
|
17631
17637
|
{
|
|
17632
17638
|
version: 143,
|
|
17633
17639
|
name: "embedding-index-progress",
|
|
17634
|
-
up:
|
|
17640
|
+
up: up145,
|
|
17635
17641
|
artifacts: {
|
|
17636
17642
|
columns: [
|
|
17637
17643
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -17647,19 +17653,19 @@ var MIGRATIONS = [
|
|
|
17647
17653
|
{
|
|
17648
17654
|
version: 144,
|
|
17649
17655
|
name: "memory-job-lease-token",
|
|
17650
|
-
up:
|
|
17656
|
+
up: up146,
|
|
17651
17657
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
17652
17658
|
},
|
|
17653
17659
|
{
|
|
17654
17660
|
version: 145,
|
|
17655
17661
|
name: "dreaming-evidence-reviews",
|
|
17656
|
-
up:
|
|
17662
|
+
up: up147,
|
|
17657
17663
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
17658
17664
|
},
|
|
17659
17665
|
{
|
|
17660
17666
|
version: 146,
|
|
17661
17667
|
name: "source-transcript-import",
|
|
17662
|
-
up:
|
|
17668
|
+
up: up148,
|
|
17663
17669
|
artifacts: {
|
|
17664
17670
|
tables: [
|
|
17665
17671
|
"source_import_jobs",
|
|
@@ -17678,19 +17684,19 @@ var MIGRATIONS = [
|
|
|
17678
17684
|
{
|
|
17679
17685
|
version: 147,
|
|
17680
17686
|
name: "source-import-replay-file-slots",
|
|
17681
|
-
up:
|
|
17687
|
+
up: up149,
|
|
17682
17688
|
artifacts: { tables: ["source_import_files"] }
|
|
17683
17689
|
},
|
|
17684
17690
|
{
|
|
17685
17691
|
version: 148,
|
|
17686
17692
|
name: "source-import-attempt-provenance",
|
|
17687
|
-
up:
|
|
17693
|
+
up: up150,
|
|
17688
17694
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
17689
17695
|
},
|
|
17690
17696
|
{
|
|
17691
17697
|
version: 149,
|
|
17692
17698
|
name: "transcript-import-state-machine",
|
|
17693
|
-
up:
|
|
17699
|
+
up: up151,
|
|
17694
17700
|
artifacts: {
|
|
17695
17701
|
columns: [
|
|
17696
17702
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -17702,7 +17708,7 @@ var MIGRATIONS = [
|
|
|
17702
17708
|
{
|
|
17703
17709
|
version: 150,
|
|
17704
17710
|
name: "memory-head-freshness",
|
|
17705
|
-
up:
|
|
17711
|
+
up: up152,
|
|
17706
17712
|
artifacts: {
|
|
17707
17713
|
columns: [
|
|
17708
17714
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -17738,6 +17744,12 @@ var MIGRATIONS = [
|
|
|
17738
17744
|
}))
|
|
17739
17745
|
]
|
|
17740
17746
|
}
|
|
17747
|
+
},
|
|
17748
|
+
{
|
|
17749
|
+
version: 152,
|
|
17750
|
+
name: "memory-artifact-sha-index",
|
|
17751
|
+
up: up2,
|
|
17752
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
17741
17753
|
}
|
|
17742
17754
|
];
|
|
17743
17755
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -29394,7 +29406,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
|
|
|
29394
29406
|
"checkpoint",
|
|
29395
29407
|
"dreaming"
|
|
29396
29408
|
];
|
|
29397
|
-
function
|
|
29409
|
+
function up153(db) {
|
|
29398
29410
|
const hasColumn26 = (table, column) => {
|
|
29399
29411
|
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
29400
29412
|
try {
|
|
@@ -29454,6 +29466,12 @@ function up152(db) {
|
|
|
29454
29466
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
29455
29467
|
`);
|
|
29456
29468
|
}
|
|
29469
|
+
function up210(db) {
|
|
29470
|
+
db.exec(`
|
|
29471
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
29472
|
+
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)
|
|
29473
|
+
`);
|
|
29474
|
+
}
|
|
29457
29475
|
var MEMORIES_FTS_TOKENIZER2 = "unicode61";
|
|
29458
29476
|
var FTS_STATE_TABLE2 = "memories_fts_state";
|
|
29459
29477
|
function normalizeSql2(sql) {
|
|
@@ -29569,7 +29587,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
29569
29587
|
return true;
|
|
29570
29588
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
29571
29589
|
}
|
|
29572
|
-
function
|
|
29590
|
+
function up310(db) {
|
|
29573
29591
|
db.exec(`
|
|
29574
29592
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
29575
29593
|
version INTEGER PRIMARY KEY,
|
|
@@ -29667,7 +29685,7 @@ function addColumnIfMissing29(db, table, column, definition) {
|
|
|
29667
29685
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29668
29686
|
}
|
|
29669
29687
|
}
|
|
29670
|
-
function
|
|
29688
|
+
function up410(db) {
|
|
29671
29689
|
addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
|
|
29672
29690
|
addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
|
|
29673
29691
|
addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -29785,7 +29803,7 @@ function addColumnIfMissing210(db, table, column, definition) {
|
|
|
29785
29803
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29786
29804
|
return true;
|
|
29787
29805
|
}
|
|
29788
|
-
function
|
|
29806
|
+
function up510(db) {
|
|
29789
29807
|
addColumnIfMissing210(db, "memories", "why", "TEXT");
|
|
29790
29808
|
addColumnIfMissing210(db, "memories", "project", "TEXT");
|
|
29791
29809
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -29822,7 +29840,7 @@ function addColumnIfMissing32(db, table, column, definition) {
|
|
|
29822
29840
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29823
29841
|
}
|
|
29824
29842
|
}
|
|
29825
|
-
function
|
|
29843
|
+
function up610(db) {
|
|
29826
29844
|
addColumnIfMissing32(db, "memory_history", "actor_type", "TEXT");
|
|
29827
29845
|
addColumnIfMissing32(db, "memory_history", "session_id", "TEXT");
|
|
29828
29846
|
addColumnIfMissing32(db, "memory_history", "request_id", "TEXT");
|
|
@@ -29855,7 +29873,7 @@ function addColumnIfMissing42(db, table, column, definition) {
|
|
|
29855
29873
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29856
29874
|
}
|
|
29857
29875
|
}
|
|
29858
|
-
function
|
|
29876
|
+
function up710(db) {
|
|
29859
29877
|
addColumnIfMissing42(db, "entities", "canonical_name", "TEXT");
|
|
29860
29878
|
addColumnIfMissing42(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
29861
29879
|
addColumnIfMissing42(db, "entities", "embedding", "BLOB");
|
|
@@ -29872,7 +29890,7 @@ function hasColumn42(db, table, column) {
|
|
|
29872
29890
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
29873
29891
|
return rows.some((r22) => r22.name === column);
|
|
29874
29892
|
}
|
|
29875
|
-
function
|
|
29893
|
+
function up810(db) {
|
|
29876
29894
|
if (!hasColumn42(db, "memories", "idempotency_key")) {
|
|
29877
29895
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
29878
29896
|
}
|
|
@@ -29887,7 +29905,7 @@ function hasColumn52(db, table, column) {
|
|
|
29887
29905
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
29888
29906
|
return rows.some((r22) => r22.name === column);
|
|
29889
29907
|
}
|
|
29890
|
-
function
|
|
29908
|
+
function up910(db) {
|
|
29891
29909
|
db.exec(`
|
|
29892
29910
|
CREATE TABLE IF NOT EXISTS documents (
|
|
29893
29911
|
id TEXT PRIMARY KEY,
|
|
@@ -29944,7 +29962,7 @@ function up810(db) {
|
|
|
29944
29962
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
29945
29963
|
}
|
|
29946
29964
|
}
|
|
29947
|
-
function
|
|
29965
|
+
function up1010(db) {
|
|
29948
29966
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
29949
29967
|
if (tables.length === 0)
|
|
29950
29968
|
return;
|
|
@@ -29961,7 +29979,7 @@ function up910(db) {
|
|
|
29961
29979
|
ON embeddings(content_hash)
|
|
29962
29980
|
`);
|
|
29963
29981
|
}
|
|
29964
|
-
function
|
|
29982
|
+
function up1110(db) {
|
|
29965
29983
|
db.exec(`
|
|
29966
29984
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
29967
29985
|
id TEXT PRIMARY KEY,
|
|
@@ -29981,7 +29999,7 @@ function up1010(db) {
|
|
|
29981
29999
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
29982
30000
|
ON summary_jobs(status)`);
|
|
29983
30001
|
}
|
|
29984
|
-
function
|
|
30002
|
+
function up1210(db) {
|
|
29985
30003
|
db.exec(`
|
|
29986
30004
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
29987
30005
|
id INTEGER PRIMARY KEY,
|
|
@@ -29992,7 +30010,7 @@ function up1110(db) {
|
|
|
29992
30010
|
)
|
|
29993
30011
|
`);
|
|
29994
30012
|
}
|
|
29995
|
-
function
|
|
30013
|
+
function up1310(db) {
|
|
29996
30014
|
db.exec(`
|
|
29997
30015
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
29998
30016
|
id TEXT PRIMARY KEY,
|
|
@@ -30012,7 +30030,7 @@ function up1210(db) {
|
|
|
30012
30030
|
ON session_scores(session_key);
|
|
30013
30031
|
`);
|
|
30014
30032
|
}
|
|
30015
|
-
function
|
|
30033
|
+
function up1410(db) {
|
|
30016
30034
|
db.exec(`
|
|
30017
30035
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
30018
30036
|
id TEXT PRIMARY KEY,
|
|
@@ -30053,7 +30071,7 @@ function addColumnIfMissing52(db, table, column, definition) {
|
|
|
30053
30071
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30054
30072
|
}
|
|
30055
30073
|
}
|
|
30056
|
-
function
|
|
30074
|
+
function up154(db) {
|
|
30057
30075
|
db.exec(`
|
|
30058
30076
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
30059
30077
|
id TEXT PRIMARY KEY,
|
|
@@ -30079,7 +30097,7 @@ function up1410(db) {
|
|
|
30079
30097
|
addColumnIfMissing52(db, "memories", "source_path", "TEXT");
|
|
30080
30098
|
addColumnIfMissing52(db, "memories", "source_section", "TEXT");
|
|
30081
30099
|
}
|
|
30082
|
-
function
|
|
30100
|
+
function up162(db) {
|
|
30083
30101
|
db.exec(`
|
|
30084
30102
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
30085
30103
|
id TEXT PRIMARY KEY,
|
|
@@ -30104,7 +30122,7 @@ function addColumnIfMissing62(db, table, column, definition) {
|
|
|
30104
30122
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30105
30123
|
}
|
|
30106
30124
|
}
|
|
30107
|
-
function
|
|
30125
|
+
function up172(db) {
|
|
30108
30126
|
db.exec(`
|
|
30109
30127
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
30110
30128
|
id TEXT PRIMARY KEY,
|
|
@@ -30131,7 +30149,7 @@ function up162(db) {
|
|
|
30131
30149
|
addColumnIfMissing62(db, "session_scores", "confidence", "REAL");
|
|
30132
30150
|
addColumnIfMissing62(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
30133
30151
|
}
|
|
30134
|
-
function
|
|
30152
|
+
function up182(db) {
|
|
30135
30153
|
db.exec(`
|
|
30136
30154
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
30137
30155
|
id TEXT PRIMARY KEY,
|
|
@@ -30153,7 +30171,7 @@ function up172(db) {
|
|
|
30153
30171
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
30154
30172
|
`);
|
|
30155
30173
|
}
|
|
30156
|
-
function
|
|
30174
|
+
function up192(db) {
|
|
30157
30175
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
30158
30176
|
const colNames = new Set(cols.flatMap((c22) => typeof c22.name === "string" ? [c22.name] : []));
|
|
30159
30177
|
if (!colNames.has("skill_name")) {
|
|
@@ -30164,7 +30182,7 @@ function up182(db) {
|
|
|
30164
30182
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
30165
30183
|
}
|
|
30166
30184
|
}
|
|
30167
|
-
function
|
|
30185
|
+
function up202(db) {
|
|
30168
30186
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
30169
30187
|
if (existing)
|
|
30170
30188
|
return;
|
|
@@ -30196,7 +30214,7 @@ function up192(db) {
|
|
|
30196
30214
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
30197
30215
|
`);
|
|
30198
30216
|
}
|
|
30199
|
-
function
|
|
30217
|
+
function up212(db) {
|
|
30200
30218
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
30201
30219
|
const entityColNames = new Set(entityCols.flatMap((c22) => typeof c22.name === "string" ? [c22.name] : []));
|
|
30202
30220
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -30281,13 +30299,13 @@ function addColumnIfMissing72(db, table, column, definition) {
|
|
|
30281
30299
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30282
30300
|
}
|
|
30283
30301
|
}
|
|
30284
|
-
function
|
|
30302
|
+
function up222(db) {
|
|
30285
30303
|
addColumnIfMissing72(db, "session_memories", "entity_slot", "INTEGER");
|
|
30286
30304
|
addColumnIfMissing72(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30287
30305
|
addColumnIfMissing72(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
30288
30306
|
addColumnIfMissing72(db, "session_memories", "structural_density", "INTEGER");
|
|
30289
30307
|
}
|
|
30290
|
-
function
|
|
30308
|
+
function up232(db) {
|
|
30291
30309
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
30292
30310
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
30293
30311
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -30312,25 +30330,25 @@ function addColumnIfMissing82(db, table, column, definition) {
|
|
|
30312
30330
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30313
30331
|
}
|
|
30314
30332
|
}
|
|
30315
|
-
function
|
|
30333
|
+
function up242(db) {
|
|
30316
30334
|
addColumnIfMissing82(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
30317
30335
|
addColumnIfMissing82(db, "entities", "pinned_at", "TEXT");
|
|
30318
30336
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
30319
30337
|
}
|
|
30320
|
-
function up242(_db) {}
|
|
30321
30338
|
function up252(_db) {}
|
|
30339
|
+
function up262(_db) {}
|
|
30322
30340
|
function addColumnIfMissing92(db, table, column, definition) {
|
|
30323
30341
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30324
30342
|
if (!cols.some((c22) => c22.name === column)) {
|
|
30325
30343
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30326
30344
|
}
|
|
30327
30345
|
}
|
|
30328
|
-
function
|
|
30346
|
+
function up272(db) {
|
|
30329
30347
|
addColumnIfMissing92(db, "session_memories", "agent_relevance_score", "REAL");
|
|
30330
30348
|
addColumnIfMissing92(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
30331
30349
|
}
|
|
30332
|
-
function
|
|
30333
|
-
function
|
|
30350
|
+
function up282(_db) {}
|
|
30351
|
+
function up292(db) {
|
|
30334
30352
|
db.exec(`
|
|
30335
30353
|
UPDATE entities
|
|
30336
30354
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -30339,7 +30357,7 @@ function up282(db) {
|
|
|
30339
30357
|
WHERE canonical_name IS NULL
|
|
30340
30358
|
`);
|
|
30341
30359
|
}
|
|
30342
|
-
function
|
|
30360
|
+
function up302(db) {
|
|
30343
30361
|
db.exec(`
|
|
30344
30362
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
30345
30363
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -30376,7 +30394,7 @@ function up292(db) {
|
|
|
30376
30394
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
30377
30395
|
`);
|
|
30378
30396
|
}
|
|
30379
|
-
function
|
|
30397
|
+
function up312(db) {
|
|
30380
30398
|
db.exec(`
|
|
30381
30399
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
30382
30400
|
id TEXT PRIMARY KEY,
|
|
@@ -30421,7 +30439,7 @@ function up302(db) {
|
|
|
30421
30439
|
WHERE session_key IS NOT NULL;
|
|
30422
30440
|
`);
|
|
30423
30441
|
}
|
|
30424
|
-
function
|
|
30442
|
+
function up322(db) {
|
|
30425
30443
|
db.exec(`
|
|
30426
30444
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
30427
30445
|
id TEXT PRIMARY KEY,
|
|
@@ -30466,7 +30484,7 @@ function up312(db) {
|
|
|
30466
30484
|
ON memory_jobs(failed_at);
|
|
30467
30485
|
`);
|
|
30468
30486
|
}
|
|
30469
|
-
function
|
|
30487
|
+
function up332(db) {
|
|
30470
30488
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30471
30489
|
if (!depCols.some((c22) => c22.name === "reason")) {
|
|
30472
30490
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -30476,7 +30494,7 @@ function up322(db) {
|
|
|
30476
30494
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
30477
30495
|
}
|
|
30478
30496
|
}
|
|
30479
|
-
function
|
|
30497
|
+
function up342(db) {
|
|
30480
30498
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
30481
30499
|
if (cols.length === 0)
|
|
30482
30500
|
return;
|
|
@@ -30484,14 +30502,14 @@ function up332(db) {
|
|
|
30484
30502
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
30485
30503
|
}
|
|
30486
30504
|
}
|
|
30487
|
-
function
|
|
30505
|
+
function up352(db) {
|
|
30488
30506
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
30489
30507
|
if (!cols.some((c22) => c22.name === "scope")) {
|
|
30490
30508
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
30491
30509
|
}
|
|
30492
30510
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
30493
30511
|
}
|
|
30494
|
-
function
|
|
30512
|
+
function up362(db) {
|
|
30495
30513
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
30496
30514
|
db.exec(`
|
|
30497
30515
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -30499,7 +30517,7 @@ function up352(db) {
|
|
|
30499
30517
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
30500
30518
|
`);
|
|
30501
30519
|
}
|
|
30502
|
-
function
|
|
30520
|
+
function up372(db) {
|
|
30503
30521
|
db.exec(`
|
|
30504
30522
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
30505
30523
|
name, canonical_name,
|
|
@@ -30531,13 +30549,13 @@ function up362(db) {
|
|
|
30531
30549
|
END
|
|
30532
30550
|
`);
|
|
30533
30551
|
}
|
|
30534
|
-
function
|
|
30552
|
+
function up382(db) {
|
|
30535
30553
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30536
30554
|
if (!cols.some((c22) => c22.name === "confidence")) {
|
|
30537
30555
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
30538
30556
|
}
|
|
30539
30557
|
}
|
|
30540
|
-
function
|
|
30558
|
+
function up392(db) {
|
|
30541
30559
|
db.exec(`
|
|
30542
30560
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
30543
30561
|
id TEXT PRIMARY KEY,
|
|
@@ -30555,7 +30573,7 @@ function up382(db) {
|
|
|
30555
30573
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
30556
30574
|
}
|
|
30557
30575
|
}
|
|
30558
|
-
function
|
|
30576
|
+
function up402(db) {
|
|
30559
30577
|
db.exec(`
|
|
30560
30578
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
30561
30579
|
id TEXT PRIMARY KEY,
|
|
@@ -30595,7 +30613,7 @@ function up392(db) {
|
|
|
30595
30613
|
END
|
|
30596
30614
|
`);
|
|
30597
30615
|
}
|
|
30598
|
-
function
|
|
30616
|
+
function up412(db) {
|
|
30599
30617
|
db.exec(`
|
|
30600
30618
|
DELETE FROM entity_dependencies
|
|
30601
30619
|
WHERE id NOT IN (
|
|
@@ -30613,7 +30631,7 @@ function up402(db) {
|
|
|
30613
30631
|
)
|
|
30614
30632
|
`);
|
|
30615
30633
|
}
|
|
30616
|
-
function
|
|
30634
|
+
function up422(db) {
|
|
30617
30635
|
db.exec(`
|
|
30618
30636
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
30619
30637
|
session_key TEXT PRIMARY KEY,
|
|
@@ -30636,7 +30654,7 @@ function addColumnIfMissing102(db, table, column, definition) {
|
|
|
30636
30654
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30637
30655
|
}
|
|
30638
30656
|
}
|
|
30639
|
-
function
|
|
30657
|
+
function up432(db) {
|
|
30640
30658
|
addColumnIfMissing102(db, "session_memories", "path_json", "TEXT");
|
|
30641
30659
|
db.exec(`
|
|
30642
30660
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -30711,7 +30729,7 @@ function addColumnIfMissing112(db, table, column, definition) {
|
|
|
30711
30729
|
return;
|
|
30712
30730
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30713
30731
|
}
|
|
30714
|
-
function
|
|
30732
|
+
function up442(db) {
|
|
30715
30733
|
addColumnIfMissing112(db, "session_memories", "entity_slot", "INTEGER");
|
|
30716
30734
|
addColumnIfMissing112(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30717
30735
|
addColumnIfMissing112(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -30799,7 +30817,7 @@ function addColumnIfMissing122(db, table, column, definition) {
|
|
|
30799
30817
|
return;
|
|
30800
30818
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30801
30819
|
}
|
|
30802
|
-
function
|
|
30820
|
+
function up452(db) {
|
|
30803
30821
|
db.exec(`
|
|
30804
30822
|
CREATE TABLE IF NOT EXISTS agents (
|
|
30805
30823
|
id TEXT PRIMARY KEY,
|
|
@@ -30828,7 +30846,7 @@ function addColumnIfMissing132(db, table, column, definition) {
|
|
|
30828
30846
|
return;
|
|
30829
30847
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30830
30848
|
}
|
|
30831
|
-
function
|
|
30849
|
+
function up462(db) {
|
|
30832
30850
|
addColumnIfMissing132(db, "session_summaries", "source_type", "TEXT");
|
|
30833
30851
|
addColumnIfMissing132(db, "session_summaries", "source_ref", "TEXT");
|
|
30834
30852
|
addColumnIfMissing132(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -30854,7 +30872,7 @@ function addColumnIfMissing142(db, table, column, definition) {
|
|
|
30854
30872
|
return;
|
|
30855
30873
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30856
30874
|
}
|
|
30857
|
-
function
|
|
30875
|
+
function up472(db) {
|
|
30858
30876
|
addColumnIfMissing142(db, "session_transcripts", "updated_at", "TEXT");
|
|
30859
30877
|
addColumnIfMissing142(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
30860
30878
|
addColumnIfMissing142(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -30925,7 +30943,7 @@ function up462(db) {
|
|
|
30925
30943
|
ON memory_md_heads(lease_expires_at);
|
|
30926
30944
|
`);
|
|
30927
30945
|
}
|
|
30928
|
-
function
|
|
30946
|
+
function up482(db) {
|
|
30929
30947
|
db.exec(`
|
|
30930
30948
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
30931
30949
|
|
|
@@ -30986,7 +31004,7 @@ function up472(db) {
|
|
|
30986
31004
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
30987
31005
|
`);
|
|
30988
31006
|
}
|
|
30989
|
-
function
|
|
31007
|
+
function up492(db) {
|
|
30990
31008
|
db.exec(`
|
|
30991
31009
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
30992
31010
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -31084,7 +31102,7 @@ function up482(db) {
|
|
|
31084
31102
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31085
31103
|
`);
|
|
31086
31104
|
}
|
|
31087
|
-
function
|
|
31105
|
+
function up502(db) {
|
|
31088
31106
|
db.exec(`
|
|
31089
31107
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
31090
31108
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -31202,7 +31220,7 @@ function up492(db) {
|
|
|
31202
31220
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
31203
31221
|
`);
|
|
31204
31222
|
}
|
|
31205
|
-
function
|
|
31223
|
+
function up512(db) {
|
|
31206
31224
|
db.exec(`
|
|
31207
31225
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
31208
31226
|
session_key TEXT NOT NULL,
|
|
@@ -31219,7 +31237,7 @@ function hasTable5(db, name) {
|
|
|
31219
31237
|
WHERE type = 'table' AND name = ?
|
|
31220
31238
|
LIMIT 1`).get(name) !== undefined;
|
|
31221
31239
|
}
|
|
31222
|
-
function
|
|
31240
|
+
function up522(db) {
|
|
31223
31241
|
db.exec(`
|
|
31224
31242
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
31225
31243
|
id TEXT PRIMARY KEY,
|
|
@@ -31389,7 +31407,7 @@ function addColumnIfMissing152(db, table, column, definition) {
|
|
|
31389
31407
|
return;
|
|
31390
31408
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31391
31409
|
}
|
|
31392
|
-
function
|
|
31410
|
+
function up532(db) {
|
|
31393
31411
|
addColumnIfMissing152(db, "summary_jobs", "session_id", "TEXT");
|
|
31394
31412
|
addColumnIfMissing152(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
31395
31413
|
addColumnIfMissing152(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -31481,7 +31499,7 @@ function up522(db) {
|
|
|
31481
31499
|
VALUES ('rebuild');
|
|
31482
31500
|
`);
|
|
31483
31501
|
}
|
|
31484
|
-
function
|
|
31502
|
+
function up542(db) {
|
|
31485
31503
|
db.exec(`
|
|
31486
31504
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
31487
31505
|
id TEXT PRIMARY KEY,
|
|
@@ -31498,7 +31516,7 @@ function up532(db) {
|
|
|
31498
31516
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
31499
31517
|
`);
|
|
31500
31518
|
}
|
|
31501
|
-
function
|
|
31519
|
+
function up552(db) {
|
|
31502
31520
|
db.exec(`
|
|
31503
31521
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
31504
31522
|
id TEXT PRIMARY KEY,
|
|
@@ -31514,7 +31532,7 @@ function up542(db) {
|
|
|
31514
31532
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
31515
31533
|
`);
|
|
31516
31534
|
}
|
|
31517
|
-
function
|
|
31535
|
+
function up562(db) {
|
|
31518
31536
|
db.exec(`
|
|
31519
31537
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
31520
31538
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -31545,7 +31563,7 @@ function up552(db) {
|
|
|
31545
31563
|
ON task_scope_hints(agent_id, updated_at);
|
|
31546
31564
|
`);
|
|
31547
31565
|
}
|
|
31548
|
-
function
|
|
31566
|
+
function up572(db) {
|
|
31549
31567
|
db.exec(`
|
|
31550
31568
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
31551
31569
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -31588,7 +31606,7 @@ function ensureMemoriesScopeColumns3(db) {
|
|
|
31588
31606
|
if (!names.has("scope"))
|
|
31589
31607
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
31590
31608
|
}
|
|
31591
|
-
function
|
|
31609
|
+
function up582(db) {
|
|
31592
31610
|
ensureMemoriesScopeColumns3(db);
|
|
31593
31611
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
31594
31612
|
db.exec(`
|
|
@@ -31601,20 +31619,20 @@ function up572(db) {
|
|
|
31601
31619
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
31602
31620
|
`);
|
|
31603
31621
|
}
|
|
31604
|
-
function
|
|
31622
|
+
function up592(db) {
|
|
31605
31623
|
const sql = readMemoriesFtsSql2(db);
|
|
31606
31624
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair2(sql))
|
|
31607
31625
|
return;
|
|
31608
31626
|
recreateMemoriesFts2(db);
|
|
31609
31627
|
}
|
|
31610
|
-
function
|
|
31628
|
+
function up602(db) {
|
|
31611
31629
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
31612
31630
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
31613
31631
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
31614
31632
|
ON entities(entity_type, mentions)
|
|
31615
31633
|
WHERE entity_type = 'extracted'`);
|
|
31616
31634
|
}
|
|
31617
|
-
function
|
|
31635
|
+
function up612(db) {
|
|
31618
31636
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
31619
31637
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
31620
31638
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -31623,7 +31641,7 @@ function up602(db) {
|
|
|
31623
31641
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
31624
31642
|
WHERE claim_key IS NOT NULL`);
|
|
31625
31643
|
}
|
|
31626
|
-
function
|
|
31644
|
+
function up622(db) {
|
|
31627
31645
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
31628
31646
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
31629
31647
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -31635,13 +31653,13 @@ function up612(db) {
|
|
|
31635
31653
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
31636
31654
|
WHERE claim_key IS NOT NULL`);
|
|
31637
31655
|
}
|
|
31638
|
-
function
|
|
31656
|
+
function up632(db) {
|
|
31639
31657
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
31640
31658
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
31641
31659
|
return;
|
|
31642
31660
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
31643
31661
|
}
|
|
31644
|
-
function
|
|
31662
|
+
function up642(db) {
|
|
31645
31663
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
31646
31664
|
const names = new Set(cols.map((col) => col.name));
|
|
31647
31665
|
if (!names.has("is_deleted")) {
|
|
@@ -31655,7 +31673,7 @@ function up632(db) {
|
|
|
31655
31673
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
31656
31674
|
`);
|
|
31657
31675
|
}
|
|
31658
|
-
function
|
|
31676
|
+
function up652(db) {
|
|
31659
31677
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
31660
31678
|
db.exec(`
|
|
31661
31679
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -31673,7 +31691,7 @@ function addColumnIfMissing162(db, table, column, definition) {
|
|
|
31673
31691
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31674
31692
|
}
|
|
31675
31693
|
}
|
|
31676
|
-
function
|
|
31694
|
+
function up662(db) {
|
|
31677
31695
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
31678
31696
|
addColumnIfMissing162(db, table, "source_id", "TEXT");
|
|
31679
31697
|
addColumnIfMissing162(db, table, "source_kind", "TEXT");
|
|
@@ -31693,7 +31711,7 @@ function hasColumn72(db, table, column) {
|
|
|
31693
31711
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
31694
31712
|
return rows.some((row) => row.name === column);
|
|
31695
31713
|
}
|
|
31696
|
-
function
|
|
31714
|
+
function up672(db) {
|
|
31697
31715
|
if (!hasTable22(db, "embeddings"))
|
|
31698
31716
|
return;
|
|
31699
31717
|
if (!hasColumn72(db, "embeddings", "agent_id")) {
|
|
@@ -31701,7 +31719,7 @@ function up662(db) {
|
|
|
31701
31719
|
}
|
|
31702
31720
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
31703
31721
|
}
|
|
31704
|
-
function
|
|
31722
|
+
function up682(db) {
|
|
31705
31723
|
db.exec(`
|
|
31706
31724
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
31707
31725
|
id TEXT PRIMARY KEY,
|
|
@@ -31742,7 +31760,7 @@ function addColumnIfMissing172(db, table, column, definition) {
|
|
|
31742
31760
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31743
31761
|
}
|
|
31744
31762
|
}
|
|
31745
|
-
function
|
|
31763
|
+
function up692(db) {
|
|
31746
31764
|
db.exec(`
|
|
31747
31765
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
31748
31766
|
id TEXT PRIMARY KEY,
|
|
@@ -31785,7 +31803,7 @@ function up682(db) {
|
|
|
31785
31803
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
31786
31804
|
}
|
|
31787
31805
|
}
|
|
31788
|
-
function
|
|
31806
|
+
function up702(db) {
|
|
31789
31807
|
db.exec(`
|
|
31790
31808
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
31791
31809
|
id TEXT PRIMARY KEY,
|
|
@@ -31812,7 +31830,7 @@ function up692(db) {
|
|
|
31812
31830
|
WHERE content_key IS NOT NULL;
|
|
31813
31831
|
`);
|
|
31814
31832
|
}
|
|
31815
|
-
function
|
|
31833
|
+
function up712(db) {
|
|
31816
31834
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
31817
31835
|
const colNames = new Set(cols.flatMap((c22) => typeof c22.name === "string" ? [c22.name] : []));
|
|
31818
31836
|
if (!colNames.has("content_key")) {
|
|
@@ -31849,7 +31867,7 @@ function backfillVersionRoots2(db) {
|
|
|
31849
31867
|
WHERE version_root_id IS NULL
|
|
31850
31868
|
`);
|
|
31851
31869
|
}
|
|
31852
|
-
function
|
|
31870
|
+
function up722(db) {
|
|
31853
31871
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
31854
31872
|
addColumnIfMissing182(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
31855
31873
|
addColumnIfMissing182(db, table, "archived_at", "TEXT");
|
|
@@ -31884,7 +31902,7 @@ function up712(db) {
|
|
|
31884
31902
|
ON entity_aspects(agent_id, proposal_id);
|
|
31885
31903
|
`);
|
|
31886
31904
|
}
|
|
31887
|
-
function
|
|
31905
|
+
function up732(db) {
|
|
31888
31906
|
db.exec(`
|
|
31889
31907
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
31890
31908
|
id TEXT PRIMARY KEY,
|
|
@@ -31940,7 +31958,7 @@ function ensureMemoriesScopeColumns22(db) {
|
|
|
31940
31958
|
if (!names.has("runtime_path"))
|
|
31941
31959
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
31942
31960
|
}
|
|
31943
|
-
function
|
|
31961
|
+
function up742(db) {
|
|
31944
31962
|
ensureMemoriesScopeColumns22(db);
|
|
31945
31963
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
31946
31964
|
db.exec(`
|
|
@@ -31954,7 +31972,7 @@ function up732(db) {
|
|
|
31954
31972
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
31955
31973
|
`);
|
|
31956
31974
|
}
|
|
31957
|
-
function
|
|
31975
|
+
function up752(db) {
|
|
31958
31976
|
db.exec(`
|
|
31959
31977
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
31960
31978
|
session_key TEXT NOT NULL,
|
|
@@ -31989,7 +32007,7 @@ function up742(db) {
|
|
|
31989
32007
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
31990
32008
|
`);
|
|
31991
32009
|
}
|
|
31992
|
-
function
|
|
32010
|
+
function up762(db) {
|
|
31993
32011
|
db.exec(`
|
|
31994
32012
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
31995
32013
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32008,7 +32026,7 @@ function addColumnIfMissing192(db, table, column, definition) {
|
|
|
32008
32026
|
return;
|
|
32009
32027
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32010
32028
|
}
|
|
32011
|
-
function
|
|
32029
|
+
function up772(db) {
|
|
32012
32030
|
addColumnIfMissing192(db, "memory_artifacts", "source_id", "TEXT");
|
|
32013
32031
|
addColumnIfMissing192(db, "memory_artifacts", "source_root", "TEXT");
|
|
32014
32032
|
addColumnIfMissing192(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -32021,7 +32039,7 @@ function up762(db) {
|
|
|
32021
32039
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
32022
32040
|
`);
|
|
32023
32041
|
}
|
|
32024
|
-
function
|
|
32042
|
+
function up782(db) {
|
|
32025
32043
|
db.exec(`
|
|
32026
32044
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
32027
32045
|
id TEXT PRIMARY KEY,
|
|
@@ -32044,7 +32062,7 @@ function up772(db) {
|
|
|
32044
32062
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
32045
32063
|
`);
|
|
32046
32064
|
}
|
|
32047
|
-
function
|
|
32065
|
+
function up792(db) {
|
|
32048
32066
|
db.exec(`
|
|
32049
32067
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
32050
32068
|
id TEXT PRIMARY KEY,
|
|
@@ -32068,7 +32086,7 @@ function up782(db) {
|
|
|
32068
32086
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
32069
32087
|
`);
|
|
32070
32088
|
}
|
|
32071
|
-
function
|
|
32089
|
+
function up802(db) {
|
|
32072
32090
|
db.exec(`
|
|
32073
32091
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
32074
32092
|
id TEXT PRIMARY KEY,
|
|
@@ -32096,7 +32114,7 @@ function up792(db) {
|
|
|
32096
32114
|
ON api_keys(connector, harness);
|
|
32097
32115
|
`);
|
|
32098
32116
|
}
|
|
32099
|
-
function
|
|
32117
|
+
function up812(db) {
|
|
32100
32118
|
db.exec(`
|
|
32101
32119
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
32102
32120
|
id TEXT PRIMARY KEY,
|
|
@@ -32131,7 +32149,7 @@ function hasColumn102(db, table, column) {
|
|
|
32131
32149
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32132
32150
|
return rows.some((row) => row.name === column);
|
|
32133
32151
|
}
|
|
32134
|
-
function
|
|
32152
|
+
function up822(db) {
|
|
32135
32153
|
if (!hasColumn102(db, "documents", "agent_id")) {
|
|
32136
32154
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
32137
32155
|
}
|
|
@@ -32217,7 +32235,7 @@ function up812(db) {
|
|
|
32217
32235
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
32218
32236
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
32219
32237
|
}
|
|
32220
|
-
function
|
|
32238
|
+
function up832(db) {
|
|
32221
32239
|
db.exec(`
|
|
32222
32240
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
32223
32241
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32239,7 +32257,7 @@ function hasColumn112(db, table, column) {
|
|
|
32239
32257
|
return rows.some((row) => row.name === column);
|
|
32240
32258
|
}
|
|
32241
32259
|
var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
32242
|
-
function
|
|
32260
|
+
function up842(db) {
|
|
32243
32261
|
for (const column of COLUMNS3) {
|
|
32244
32262
|
if (!hasColumn112(db, "skill_invocations", column)) {
|
|
32245
32263
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -32320,7 +32338,7 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32320
32338
|
`);
|
|
32321
32339
|
}
|
|
32322
32340
|
try {
|
|
32323
|
-
|
|
32341
|
+
up822(db);
|
|
32324
32342
|
if (preserveAgentId) {
|
|
32325
32343
|
db.exec(`
|
|
32326
32344
|
UPDATE documents
|
|
@@ -32340,12 +32358,12 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32340
32358
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
32341
32359
|
}
|
|
32342
32360
|
}
|
|
32343
|
-
function
|
|
32344
|
-
|
|
32361
|
+
function up852(db) {
|
|
32362
|
+
up812(db);
|
|
32345
32363
|
if (hasTable32(db, "documents")) {
|
|
32346
32364
|
documentScopeColumnsPreservingExisting2(db);
|
|
32347
32365
|
}
|
|
32348
|
-
|
|
32366
|
+
up832(db);
|
|
32349
32367
|
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
32350
32368
|
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
32351
32369
|
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -32402,7 +32420,7 @@ function up842(db) {
|
|
|
32402
32420
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
32403
32421
|
`);
|
|
32404
32422
|
}
|
|
32405
|
-
function
|
|
32423
|
+
function up862(db) {
|
|
32406
32424
|
db.exec(`
|
|
32407
32425
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
32408
32426
|
path TEXT PRIMARY KEY,
|
|
@@ -32432,7 +32450,7 @@ function up852(db) {
|
|
|
32432
32450
|
ON legacy_markdown_chunks(memory_id);
|
|
32433
32451
|
`);
|
|
32434
32452
|
}
|
|
32435
|
-
function
|
|
32453
|
+
function up872(db) {
|
|
32436
32454
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
32437
32455
|
const tableNames = new Set(tables.map((r22) => String(r22.name)));
|
|
32438
32456
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -32491,7 +32509,7 @@ function addColumnIfMissing212(db, table, column, definition) {
|
|
|
32491
32509
|
return;
|
|
32492
32510
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32493
32511
|
}
|
|
32494
|
-
function
|
|
32512
|
+
function up882(db) {
|
|
32495
32513
|
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
32496
32514
|
db.exec(`
|
|
32497
32515
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -32504,14 +32522,14 @@ function addColumnIfMissing222(db, table, column, definition) {
|
|
|
32504
32522
|
return;
|
|
32505
32523
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32506
32524
|
}
|
|
32507
|
-
function
|
|
32525
|
+
function up892(db) {
|
|
32508
32526
|
addColumnIfMissing222(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
32509
32527
|
db.exec(`
|
|
32510
32528
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
32511
32529
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
32512
32530
|
`);
|
|
32513
32531
|
}
|
|
32514
|
-
function
|
|
32532
|
+
function up902(db) {
|
|
32515
32533
|
db.exec(`
|
|
32516
32534
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
32517
32535
|
agent_id TEXT NOT NULL,
|
|
@@ -32529,7 +32547,7 @@ function up892(db) {
|
|
|
32529
32547
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
32530
32548
|
`);
|
|
32531
32549
|
}
|
|
32532
|
-
function
|
|
32550
|
+
function up912(db) {
|
|
32533
32551
|
db.exec(`
|
|
32534
32552
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
32535
32553
|
id TEXT PRIMARY KEY,
|
|
@@ -32557,7 +32575,7 @@ function indexExists3(db, table, indexName) {
|
|
|
32557
32575
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32558
32576
|
return rows.some((row) => row.name === indexName);
|
|
32559
32577
|
}
|
|
32560
|
-
function
|
|
32578
|
+
function up922(db) {
|
|
32561
32579
|
db.exec(`
|
|
32562
32580
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
32563
32581
|
id TEXT PRIMARY KEY,
|
|
@@ -32584,7 +32602,7 @@ function indexExists22(db, table, indexName) {
|
|
|
32584
32602
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32585
32603
|
return rows.some((row) => row.name === indexName);
|
|
32586
32604
|
}
|
|
32587
|
-
function
|
|
32605
|
+
function up932(db) {
|
|
32588
32606
|
db.exec(`
|
|
32589
32607
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
32590
32608
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -32597,7 +32615,7 @@ function up922(db) {
|
|
|
32597
32615
|
)
|
|
32598
32616
|
`);
|
|
32599
32617
|
}
|
|
32600
|
-
function
|
|
32618
|
+
function up942(db) {
|
|
32601
32619
|
db.exec(`
|
|
32602
32620
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
32603
32621
|
id TEXT PRIMARY KEY,
|
|
@@ -32616,7 +32634,7 @@ function up932(db) {
|
|
|
32616
32634
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
32617
32635
|
`);
|
|
32618
32636
|
}
|
|
32619
|
-
function
|
|
32637
|
+
function up952(db) {
|
|
32620
32638
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
32621
32639
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
32622
32640
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -32627,7 +32645,7 @@ function hasColumn132(db, table, column) {
|
|
|
32627
32645
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32628
32646
|
return rows.some((r22) => r22.name === column);
|
|
32629
32647
|
}
|
|
32630
|
-
function
|
|
32648
|
+
function up962(db) {
|
|
32631
32649
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
32632
32650
|
if (tables.length === 0)
|
|
32633
32651
|
return;
|
|
@@ -32652,23 +32670,23 @@ function up952(db) {
|
|
|
32652
32670
|
function hasColumn142(db, table, column) {
|
|
32653
32671
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32654
32672
|
}
|
|
32655
|
-
function
|
|
32673
|
+
function up972(db) {
|
|
32656
32674
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
32657
32675
|
if (!hasMemories || !hasColumn142(db, "memories", "memory_kind") || !hasColumn142(db, "memories", "type"))
|
|
32658
32676
|
return;
|
|
32659
32677
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
32660
32678
|
}
|
|
32661
|
-
function
|
|
32679
|
+
function up982(db) {
|
|
32662
32680
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
32663
32681
|
}
|
|
32664
|
-
function
|
|
32682
|
+
function up992(db) {
|
|
32665
32683
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
32666
32684
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
32667
32685
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
32668
32686
|
}
|
|
32669
32687
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
32670
32688
|
}
|
|
32671
|
-
function
|
|
32689
|
+
function up1002(db) {
|
|
32672
32690
|
db.exec(`
|
|
32673
32691
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
32674
32692
|
agent_id TEXT NOT NULL,
|
|
@@ -32685,7 +32703,7 @@ function up992(db) {
|
|
|
32685
32703
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
32686
32704
|
`);
|
|
32687
32705
|
}
|
|
32688
|
-
function
|
|
32706
|
+
function up1012(db) {
|
|
32689
32707
|
db.exec(`
|
|
32690
32708
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
32691
32709
|
id TEXT PRIMARY KEY,
|
|
@@ -32705,7 +32723,7 @@ function up1002(db) {
|
|
|
32705
32723
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
32706
32724
|
`);
|
|
32707
32725
|
}
|
|
32708
|
-
function
|
|
32726
|
+
function up1022(db) {
|
|
32709
32727
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
32710
32728
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
32711
32729
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -32714,7 +32732,7 @@ function up1012(db) {
|
|
|
32714
32732
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
32715
32733
|
}
|
|
32716
32734
|
}
|
|
32717
|
-
function
|
|
32735
|
+
function up1032(db) {
|
|
32718
32736
|
db.exec(`
|
|
32719
32737
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
32720
32738
|
id TEXT PRIMARY KEY,
|
|
@@ -32736,7 +32754,7 @@ function up1022(db) {
|
|
|
32736
32754
|
function hasColumn152(db, table, column) {
|
|
32737
32755
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32738
32756
|
}
|
|
32739
|
-
function
|
|
32757
|
+
function up1042(db) {
|
|
32740
32758
|
const requiredMemoryColumns = [
|
|
32741
32759
|
"content_hash",
|
|
32742
32760
|
"normalized_content",
|
|
@@ -32787,7 +32805,7 @@ function up1032(db) {
|
|
|
32787
32805
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
32788
32806
|
`);
|
|
32789
32807
|
}
|
|
32790
|
-
function
|
|
32808
|
+
function up1052(db) {
|
|
32791
32809
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
32792
32810
|
if (tables.length !== 2)
|
|
32793
32811
|
return;
|
|
@@ -32810,7 +32828,7 @@ function tableExists4(db, table) {
|
|
|
32810
32828
|
function hasColumn162(db, table, column) {
|
|
32811
32829
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32812
32830
|
}
|
|
32813
|
-
function
|
|
32831
|
+
function up1062(db) {
|
|
32814
32832
|
db.exec(`
|
|
32815
32833
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
32816
32834
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -32853,7 +32871,7 @@ function up1052(db) {
|
|
|
32853
32871
|
`);
|
|
32854
32872
|
}
|
|
32855
32873
|
}
|
|
32856
|
-
function
|
|
32874
|
+
function up1072(db) {
|
|
32857
32875
|
db.exec(`
|
|
32858
32876
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
32859
32877
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -32942,7 +32960,7 @@ function up1062(db) {
|
|
|
32942
32960
|
function hasColumn172(db, table, column) {
|
|
32943
32961
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32944
32962
|
}
|
|
32945
|
-
function
|
|
32963
|
+
function up1082(db) {
|
|
32946
32964
|
if (!hasColumn172(db, "memories", "review_after")) {
|
|
32947
32965
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
32948
32966
|
}
|
|
@@ -32958,14 +32976,14 @@ var TOKEN_COLUMNS2 = [
|
|
|
32958
32976
|
["tokens_cache_write", "INTEGER"],
|
|
32959
32977
|
["tokens_cost", "REAL"]
|
|
32960
32978
|
];
|
|
32961
|
-
function
|
|
32979
|
+
function up1092(db) {
|
|
32962
32980
|
for (const [column, type] of TOKEN_COLUMNS2) {
|
|
32963
32981
|
if (!hasColumn182(db, "dreaming_passes", column)) {
|
|
32964
32982
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
32965
32983
|
}
|
|
32966
32984
|
}
|
|
32967
32985
|
}
|
|
32968
|
-
function
|
|
32986
|
+
function up1102(db) {
|
|
32969
32987
|
db.exec(`
|
|
32970
32988
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
32971
32989
|
day TEXT NOT NULL,
|
|
@@ -32978,7 +32996,7 @@ function up1092(db) {
|
|
|
32978
32996
|
);
|
|
32979
32997
|
`);
|
|
32980
32998
|
}
|
|
32981
|
-
function
|
|
32999
|
+
function up1112(db) {
|
|
32982
33000
|
db.exec(`
|
|
32983
33001
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
32984
33002
|
id TEXT PRIMARY KEY,
|
|
@@ -32986,7 +33004,7 @@ function up1102(db) {
|
|
|
32986
33004
|
);
|
|
32987
33005
|
`);
|
|
32988
33006
|
}
|
|
32989
|
-
function
|
|
33007
|
+
function up1122(db) {
|
|
32990
33008
|
db.exec(`
|
|
32991
33009
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
32992
33010
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -32997,7 +33015,7 @@ function hasColumn192(db, table, column) {
|
|
|
32997
33015
|
return rows.some((row) => row.name === column);
|
|
32998
33016
|
}
|
|
32999
33017
|
var COLUMNS22 = ["first_remember_at", "first_recall_at"];
|
|
33000
|
-
function
|
|
33018
|
+
function up1132(db) {
|
|
33001
33019
|
for (const column of COLUMNS22) {
|
|
33002
33020
|
if (!hasColumn192(db, "telemetry_install", column)) {
|
|
33003
33021
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -33013,7 +33031,7 @@ function addColumnIfMissing232(db, column, definition) {
|
|
|
33013
33031
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33014
33032
|
}
|
|
33015
33033
|
}
|
|
33016
|
-
function
|
|
33034
|
+
function up1142(db) {
|
|
33017
33035
|
addColumnIfMissing232(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
33018
33036
|
addColumnIfMissing232(db, "claim_token", "TEXT");
|
|
33019
33037
|
addColumnIfMissing232(db, "claimed_at", "TEXT");
|
|
@@ -33022,7 +33040,7 @@ function up1132(db) {
|
|
|
33022
33040
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
33023
33041
|
`);
|
|
33024
33042
|
}
|
|
33025
|
-
function
|
|
33043
|
+
function up1152(db) {
|
|
33026
33044
|
db.exec(`
|
|
33027
33045
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
33028
33046
|
session_key TEXT NOT NULL,
|
|
@@ -33043,7 +33061,7 @@ function up1142(db) {
|
|
|
33043
33061
|
ON session_claims(agent_id, state, expires_at);
|
|
33044
33062
|
`);
|
|
33045
33063
|
}
|
|
33046
|
-
function
|
|
33064
|
+
function up1162(db) {
|
|
33047
33065
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
33048
33066
|
if (table == null)
|
|
33049
33067
|
return;
|
|
@@ -33052,7 +33070,7 @@ function up1152(db) {
|
|
|
33052
33070
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
33053
33071
|
`);
|
|
33054
33072
|
}
|
|
33055
|
-
function
|
|
33073
|
+
function up1172(db) {
|
|
33056
33074
|
db.exec(`
|
|
33057
33075
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
33058
33076
|
id TEXT PRIMARY KEY,
|
|
@@ -33109,7 +33127,7 @@ function addColumnIfMissing242(db, column, definition) {
|
|
|
33109
33127
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
33110
33128
|
}
|
|
33111
33129
|
}
|
|
33112
|
-
function
|
|
33130
|
+
function up1182(db) {
|
|
33113
33131
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
33114
33132
|
if (table == null)
|
|
33115
33133
|
return;
|
|
@@ -33310,7 +33328,7 @@ function backfillTranscriptsFromSummaryJobs2(db) {
|
|
|
33310
33328
|
insert.run(...values);
|
|
33311
33329
|
}
|
|
33312
33330
|
}
|
|
33313
|
-
function
|
|
33331
|
+
function up1192(db) {
|
|
33314
33332
|
if (!hasTable42(db, "session_transcripts"))
|
|
33315
33333
|
return;
|
|
33316
33334
|
addColumnIfMissing252(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -33363,7 +33381,7 @@ function up1182(db) {
|
|
|
33363
33381
|
ON session_transcripts(agent_id, content_hash);
|
|
33364
33382
|
`);
|
|
33365
33383
|
}
|
|
33366
|
-
function
|
|
33384
|
+
function up1202(db) {
|
|
33367
33385
|
db.exec(`
|
|
33368
33386
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
33369
33387
|
ON memory_jobs(status)
|
|
@@ -33382,12 +33400,12 @@ function up1192(db) {
|
|
|
33382
33400
|
function hasColumn222(db, table, column) {
|
|
33383
33401
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33384
33402
|
}
|
|
33385
|
-
function
|
|
33403
|
+
function up1212(db) {
|
|
33386
33404
|
if (!hasColumn222(db, "telemetry_install", "last_seen_version")) {
|
|
33387
33405
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
33388
33406
|
}
|
|
33389
33407
|
}
|
|
33390
|
-
function
|
|
33408
|
+
function up1222(db) {
|
|
33391
33409
|
db.exec(`
|
|
33392
33410
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
33393
33411
|
agent_id TEXT NOT NULL,
|
|
@@ -33416,7 +33434,7 @@ function addColumnIfMissing262(db, column, definition) {
|
|
|
33416
33434
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33417
33435
|
}
|
|
33418
33436
|
}
|
|
33419
|
-
function
|
|
33437
|
+
function up1232(db) {
|
|
33420
33438
|
addColumnIfMissing262(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
33421
33439
|
addColumnIfMissing262(db, "last_attempt_at", "TEXT");
|
|
33422
33440
|
addColumnIfMissing262(db, "sent_at", "TEXT");
|
|
@@ -33437,7 +33455,7 @@ function up1222(db) {
|
|
|
33437
33455
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
33438
33456
|
`);
|
|
33439
33457
|
}
|
|
33440
|
-
function
|
|
33458
|
+
function up1242(db) {
|
|
33441
33459
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
33442
33460
|
const names = new Set(columns.map((column) => column.name));
|
|
33443
33461
|
if (!names.has("failure_class")) {
|
|
@@ -33454,7 +33472,7 @@ function up1232(db) {
|
|
|
33454
33472
|
}
|
|
33455
33473
|
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)");
|
|
33456
33474
|
}
|
|
33457
|
-
function
|
|
33475
|
+
function up1252(db) {
|
|
33458
33476
|
db.exec(`
|
|
33459
33477
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
33460
33478
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -33478,7 +33496,7 @@ function up1242(db) {
|
|
|
33478
33496
|
ON embedding_index_failures(source_type, source_id);
|
|
33479
33497
|
`);
|
|
33480
33498
|
}
|
|
33481
|
-
function
|
|
33499
|
+
function up1262(db) {
|
|
33482
33500
|
db.exec(`
|
|
33483
33501
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
33484
33502
|
id TEXT PRIMARY KEY,
|
|
@@ -33528,7 +33546,7 @@ function backfillTable2(db, params) {
|
|
|
33528
33546
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
33529
33547
|
backfill2(db, rows, params.sourceKind, params.scannedAt);
|
|
33530
33548
|
}
|
|
33531
|
-
function
|
|
33549
|
+
function up1272(db) {
|
|
33532
33550
|
db.exec(`
|
|
33533
33551
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
33534
33552
|
agent_id TEXT NOT NULL,
|
|
@@ -33585,7 +33603,7 @@ function up1262(db) {
|
|
|
33585
33603
|
scannedAt
|
|
33586
33604
|
});
|
|
33587
33605
|
}
|
|
33588
|
-
function
|
|
33606
|
+
function up1282(db) {
|
|
33589
33607
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
33590
33608
|
if (!table)
|
|
33591
33609
|
return;
|
|
@@ -33619,7 +33637,7 @@ function up1272(db) {
|
|
|
33619
33637
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
33620
33638
|
`);
|
|
33621
33639
|
}
|
|
33622
|
-
function
|
|
33640
|
+
function up1292(db) {
|
|
33623
33641
|
db.exec(`
|
|
33624
33642
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
33625
33643
|
id TEXT PRIMARY KEY,
|
|
@@ -33675,7 +33693,7 @@ function up1282(db) {
|
|
|
33675
33693
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
33676
33694
|
`);
|
|
33677
33695
|
}
|
|
33678
|
-
function
|
|
33696
|
+
function up1302(db) {
|
|
33679
33697
|
db.exec(`
|
|
33680
33698
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
33681
33699
|
ON memory_jobs(status, created_at)
|
|
@@ -33690,7 +33708,7 @@ function up1292(db) {
|
|
|
33690
33708
|
function tableExists32(db, table) {
|
|
33691
33709
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
33692
33710
|
}
|
|
33693
|
-
function
|
|
33711
|
+
function up1312(db) {
|
|
33694
33712
|
if (!tableExists32(db, "memory_jobs"))
|
|
33695
33713
|
return;
|
|
33696
33714
|
if (!tableExists32(db, "job_cancellations")) {
|
|
@@ -33739,7 +33757,7 @@ function up1302(db) {
|
|
|
33739
33757
|
AND status IN ('pending', 'leased');
|
|
33740
33758
|
`);
|
|
33741
33759
|
}
|
|
33742
|
-
function
|
|
33760
|
+
function up1322(db) {
|
|
33743
33761
|
db.exec(`
|
|
33744
33762
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
33745
33763
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -33779,7 +33797,7 @@ function up1312(db) {
|
|
|
33779
33797
|
END;
|
|
33780
33798
|
`);
|
|
33781
33799
|
}
|
|
33782
|
-
function
|
|
33800
|
+
function up1332(db) {
|
|
33783
33801
|
db.exec(`
|
|
33784
33802
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
33785
33803
|
agent_id TEXT NOT NULL,
|
|
@@ -33802,13 +33820,13 @@ function up1322(db) {
|
|
|
33802
33820
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
33803
33821
|
`);
|
|
33804
33822
|
}
|
|
33805
|
-
function
|
|
33823
|
+
function up1342(db) {
|
|
33806
33824
|
db.exec(`
|
|
33807
33825
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
33808
33826
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
33809
33827
|
`);
|
|
33810
33828
|
}
|
|
33811
|
-
function
|
|
33829
|
+
function up1352(db) {
|
|
33812
33830
|
db.exec(`
|
|
33813
33831
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
33814
33832
|
id TEXT PRIMARY KEY,
|
|
@@ -33860,7 +33878,7 @@ function up1342(db) {
|
|
|
33860
33878
|
if (!names.has("format_version"))
|
|
33861
33879
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
33862
33880
|
}
|
|
33863
|
-
function
|
|
33881
|
+
function up1362(db) {
|
|
33864
33882
|
db.exec(`
|
|
33865
33883
|
CREATE TABLE memory_head_entries_v134 (
|
|
33866
33884
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -33878,7 +33896,7 @@ function up1352(db) {
|
|
|
33878
33896
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
33879
33897
|
`);
|
|
33880
33898
|
}
|
|
33881
|
-
function
|
|
33899
|
+
function up1372(db) {
|
|
33882
33900
|
db.exec(`
|
|
33883
33901
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
33884
33902
|
agent_id TEXT NOT NULL,
|
|
@@ -33894,7 +33912,7 @@ function up1362(db) {
|
|
|
33894
33912
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
33895
33913
|
`);
|
|
33896
33914
|
}
|
|
33897
|
-
function
|
|
33915
|
+
function up1382(db) {
|
|
33898
33916
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r22) => r22.name));
|
|
33899
33917
|
for (const [name, type] of [
|
|
33900
33918
|
["entry_id", "TEXT"],
|
|
@@ -33908,7 +33926,7 @@ function up1372(db) {
|
|
|
33908
33926
|
}
|
|
33909
33927
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
33910
33928
|
}
|
|
33911
|
-
function
|
|
33929
|
+
function up1392(db) {
|
|
33912
33930
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r22) => r22.name));
|
|
33913
33931
|
for (const [name, type] of [
|
|
33914
33932
|
["head_revision", "INTEGER"],
|
|
@@ -33930,7 +33948,7 @@ function addColumnIfMissing272(db, table, column, definition) {
|
|
|
33930
33948
|
if (!hasColumn252(db, table, column))
|
|
33931
33949
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
33932
33950
|
}
|
|
33933
|
-
function
|
|
33951
|
+
function up1402(db) {
|
|
33934
33952
|
addColumnIfMissing272(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
33935
33953
|
db.exec(`
|
|
33936
33954
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -34235,7 +34253,7 @@ function up1392(db) {
|
|
|
34235
34253
|
GROUP BY j.agent_id;
|
|
34236
34254
|
`);
|
|
34237
34255
|
}
|
|
34238
|
-
function
|
|
34256
|
+
function up1412(db) {
|
|
34239
34257
|
db.exec(`
|
|
34240
34258
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
34241
34259
|
agent_id TEXT NOT NULL,
|
|
@@ -34251,7 +34269,7 @@ function up1402(db) {
|
|
|
34251
34269
|
ON native_source_sync_state(agent_id, status);
|
|
34252
34270
|
`);
|
|
34253
34271
|
}
|
|
34254
|
-
function
|
|
34272
|
+
function up1422(db) {
|
|
34255
34273
|
db.exec(`
|
|
34256
34274
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
34257
34275
|
agent_id TEXT NOT NULL,
|
|
@@ -34263,7 +34281,7 @@ function up1412(db) {
|
|
|
34263
34281
|
);
|
|
34264
34282
|
`);
|
|
34265
34283
|
}
|
|
34266
|
-
function
|
|
34284
|
+
function up1432(db) {
|
|
34267
34285
|
db.exec(`
|
|
34268
34286
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
34269
34287
|
agent_id TEXT NOT NULL,
|
|
@@ -34277,13 +34295,13 @@ function up1422(db) {
|
|
|
34277
34295
|
);
|
|
34278
34296
|
`);
|
|
34279
34297
|
}
|
|
34280
|
-
function
|
|
34298
|
+
function up1442(db) {
|
|
34281
34299
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
34282
34300
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
34283
34301
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
34284
34302
|
}
|
|
34285
34303
|
}
|
|
34286
|
-
function
|
|
34304
|
+
function up1452(db) {
|
|
34287
34305
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34288
34306
|
const additions = [
|
|
34289
34307
|
["migration_phase", "TEXT"],
|
|
@@ -34318,13 +34336,13 @@ function up1442(db) {
|
|
|
34318
34336
|
`);
|
|
34319
34337
|
}
|
|
34320
34338
|
}
|
|
34321
|
-
function
|
|
34339
|
+
function up1462(db) {
|
|
34322
34340
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34323
34341
|
if (!columns.has("lease_token")) {
|
|
34324
34342
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
34325
34343
|
}
|
|
34326
34344
|
}
|
|
34327
|
-
function
|
|
34345
|
+
function up1472(db) {
|
|
34328
34346
|
db.exec(`
|
|
34329
34347
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
34330
34348
|
agent_id TEXT NOT NULL,
|
|
@@ -34342,7 +34360,7 @@ function up1462(db) {
|
|
|
34342
34360
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
34343
34361
|
`);
|
|
34344
34362
|
}
|
|
34345
|
-
function
|
|
34363
|
+
function up1482(db) {
|
|
34346
34364
|
db.exec(`
|
|
34347
34365
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
34348
34366
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -34409,16 +34427,16 @@ function up1472(db) {
|
|
|
34409
34427
|
}
|
|
34410
34428
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
34411
34429
|
}
|
|
34412
|
-
function
|
|
34430
|
+
function up1492(db) {
|
|
34413
34431
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
34414
34432
|
}
|
|
34415
|
-
function
|
|
34433
|
+
function up1502(db) {
|
|
34416
34434
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
34417
34435
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
34418
34436
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
34419
34437
|
}
|
|
34420
34438
|
}
|
|
34421
|
-
function
|
|
34439
|
+
function up1512(db) {
|
|
34422
34440
|
const addColumn = (table, column, definition) => {
|
|
34423
34441
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
34424
34442
|
let exists;
|
|
@@ -34439,7 +34457,7 @@ function addColumnIfMissing282(db, table, column, definition) {
|
|
|
34439
34457
|
if (!columns.some((row) => row.name === column))
|
|
34440
34458
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34441
34459
|
}
|
|
34442
|
-
function
|
|
34460
|
+
function up1522(db) {
|
|
34443
34461
|
addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
34444
34462
|
addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
34445
34463
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -34593,13 +34611,13 @@ var MIGRATIONS2 = [
|
|
|
34593
34611
|
{
|
|
34594
34612
|
version: 1,
|
|
34595
34613
|
name: "baseline",
|
|
34596
|
-
up:
|
|
34614
|
+
up: up310,
|
|
34597
34615
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
34598
34616
|
},
|
|
34599
34617
|
{
|
|
34600
34618
|
version: 2,
|
|
34601
34619
|
name: "pipeline-v2",
|
|
34602
|
-
up:
|
|
34620
|
+
up: up410,
|
|
34603
34621
|
artifacts: {
|
|
34604
34622
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
34605
34623
|
}
|
|
@@ -34607,12 +34625,12 @@ var MIGRATIONS2 = [
|
|
|
34607
34625
|
{
|
|
34608
34626
|
version: 3,
|
|
34609
34627
|
name: "unique-content-hash",
|
|
34610
|
-
up:
|
|
34628
|
+
up: up510
|
|
34611
34629
|
},
|
|
34612
34630
|
{
|
|
34613
34631
|
version: 4,
|
|
34614
34632
|
name: "history-actor-and-retention",
|
|
34615
|
-
up:
|
|
34633
|
+
up: up610,
|
|
34616
34634
|
artifacts: {
|
|
34617
34635
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
34618
34636
|
}
|
|
@@ -34620,7 +34638,7 @@ var MIGRATIONS2 = [
|
|
|
34620
34638
|
{
|
|
34621
34639
|
version: 5,
|
|
34622
34640
|
name: "graph-extended",
|
|
34623
|
-
up:
|
|
34641
|
+
up: up710,
|
|
34624
34642
|
artifacts: {
|
|
34625
34643
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
34626
34644
|
}
|
|
@@ -34628,7 +34646,7 @@ var MIGRATIONS2 = [
|
|
|
34628
34646
|
{
|
|
34629
34647
|
version: 6,
|
|
34630
34648
|
name: "idempotency-key",
|
|
34631
|
-
up:
|
|
34649
|
+
up: up810,
|
|
34632
34650
|
artifacts: {
|
|
34633
34651
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
34634
34652
|
}
|
|
@@ -34636,42 +34654,42 @@ var MIGRATIONS2 = [
|
|
|
34636
34654
|
{
|
|
34637
34655
|
version: 7,
|
|
34638
34656
|
name: "documents-and-connectors",
|
|
34639
|
-
up:
|
|
34657
|
+
up: up910,
|
|
34640
34658
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
34641
34659
|
},
|
|
34642
34660
|
{
|
|
34643
34661
|
version: 8,
|
|
34644
34662
|
name: "embeddings-unique-hash",
|
|
34645
|
-
up:
|
|
34663
|
+
up: up1010
|
|
34646
34664
|
},
|
|
34647
34665
|
{
|
|
34648
34666
|
version: 9,
|
|
34649
34667
|
name: "summary-jobs",
|
|
34650
|
-
up:
|
|
34668
|
+
up: up1110,
|
|
34651
34669
|
artifacts: { tables: ["summary_jobs"] }
|
|
34652
34670
|
},
|
|
34653
34671
|
{
|
|
34654
34672
|
version: 10,
|
|
34655
34673
|
name: "umap-cache",
|
|
34656
|
-
up:
|
|
34674
|
+
up: up1210,
|
|
34657
34675
|
artifacts: { tables: ["umap_cache"] }
|
|
34658
34676
|
},
|
|
34659
34677
|
{
|
|
34660
34678
|
version: 11,
|
|
34661
34679
|
name: "session-scores",
|
|
34662
|
-
up:
|
|
34680
|
+
up: up1310,
|
|
34663
34681
|
artifacts: { tables: ["session_scores"] }
|
|
34664
34682
|
},
|
|
34665
34683
|
{
|
|
34666
34684
|
version: 12,
|
|
34667
34685
|
name: "scheduled-tasks",
|
|
34668
|
-
up:
|
|
34686
|
+
up: up1410,
|
|
34669
34687
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
34670
34688
|
},
|
|
34671
34689
|
{
|
|
34672
34690
|
version: 13,
|
|
34673
34691
|
name: "ingestion-tracking",
|
|
34674
|
-
up:
|
|
34692
|
+
up: up154,
|
|
34675
34693
|
artifacts: {
|
|
34676
34694
|
columns: [
|
|
34677
34695
|
{ table: "memories", column: "source_path" },
|
|
@@ -34682,13 +34700,13 @@ var MIGRATIONS2 = [
|
|
|
34682
34700
|
{
|
|
34683
34701
|
version: 14,
|
|
34684
34702
|
name: "telemetry",
|
|
34685
|
-
up:
|
|
34703
|
+
up: up162,
|
|
34686
34704
|
artifacts: { tables: ["telemetry_events"] }
|
|
34687
34705
|
},
|
|
34688
34706
|
{
|
|
34689
34707
|
version: 15,
|
|
34690
34708
|
name: "session-memories",
|
|
34691
|
-
up:
|
|
34709
|
+
up: up172,
|
|
34692
34710
|
artifacts: {
|
|
34693
34711
|
tables: ["session_memories"],
|
|
34694
34712
|
columns: [
|
|
@@ -34700,13 +34718,13 @@ var MIGRATIONS2 = [
|
|
|
34700
34718
|
{
|
|
34701
34719
|
version: 16,
|
|
34702
34720
|
name: "session-checkpoints",
|
|
34703
|
-
up:
|
|
34721
|
+
up: up182,
|
|
34704
34722
|
artifacts: { tables: ["session_checkpoints"] }
|
|
34705
34723
|
},
|
|
34706
34724
|
{
|
|
34707
34725
|
version: 17,
|
|
34708
34726
|
name: "task-skills",
|
|
34709
|
-
up:
|
|
34727
|
+
up: up192,
|
|
34710
34728
|
artifacts: {
|
|
34711
34729
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
34712
34730
|
}
|
|
@@ -34714,13 +34732,13 @@ var MIGRATIONS2 = [
|
|
|
34714
34732
|
{
|
|
34715
34733
|
version: 18,
|
|
34716
34734
|
name: "skill-meta",
|
|
34717
|
-
up:
|
|
34735
|
+
up: up202,
|
|
34718
34736
|
artifacts: { tables: ["skill_meta"] }
|
|
34719
34737
|
},
|
|
34720
34738
|
{
|
|
34721
34739
|
version: 19,
|
|
34722
34740
|
name: "knowledge-structure",
|
|
34723
|
-
up:
|
|
34741
|
+
up: up212,
|
|
34724
34742
|
artifacts: {
|
|
34725
34743
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
34726
34744
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -34729,7 +34747,7 @@ var MIGRATIONS2 = [
|
|
|
34729
34747
|
{
|
|
34730
34748
|
version: 20,
|
|
34731
34749
|
name: "session-structural-columns",
|
|
34732
|
-
up:
|
|
34750
|
+
up: up222,
|
|
34733
34751
|
artifacts: {
|
|
34734
34752
|
columns: [
|
|
34735
34753
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -34742,7 +34760,7 @@ var MIGRATIONS2 = [
|
|
|
34742
34760
|
{
|
|
34743
34761
|
version: 21,
|
|
34744
34762
|
name: "checkpoint-structural",
|
|
34745
|
-
up:
|
|
34763
|
+
up: up232,
|
|
34746
34764
|
artifacts: {
|
|
34747
34765
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
34748
34766
|
}
|
|
@@ -34750,7 +34768,7 @@ var MIGRATIONS2 = [
|
|
|
34750
34768
|
{
|
|
34751
34769
|
version: 22,
|
|
34752
34770
|
name: "entity-pinning",
|
|
34753
|
-
up:
|
|
34771
|
+
up: up242,
|
|
34754
34772
|
artifacts: {
|
|
34755
34773
|
columns: [
|
|
34756
34774
|
{ table: "entities", column: "pinned" },
|
|
@@ -34761,17 +34779,17 @@ var MIGRATIONS2 = [
|
|
|
34761
34779
|
{
|
|
34762
34780
|
version: 23,
|
|
34763
34781
|
name: "retired-scorer-gap",
|
|
34764
|
-
up:
|
|
34782
|
+
up: up252
|
|
34765
34783
|
},
|
|
34766
34784
|
{
|
|
34767
34785
|
version: 24,
|
|
34768
34786
|
name: "retired-scorer-gap",
|
|
34769
|
-
up:
|
|
34787
|
+
up: up262
|
|
34770
34788
|
},
|
|
34771
34789
|
{
|
|
34772
34790
|
version: 25,
|
|
34773
34791
|
name: "agent-feedback",
|
|
34774
|
-
up:
|
|
34792
|
+
up: up272,
|
|
34775
34793
|
artifacts: {
|
|
34776
34794
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
34777
34795
|
}
|
|
@@ -34779,32 +34797,32 @@ var MIGRATIONS2 = [
|
|
|
34779
34797
|
{
|
|
34780
34798
|
version: 26,
|
|
34781
34799
|
name: "retired-scorer-gap",
|
|
34782
|
-
up:
|
|
34800
|
+
up: up282
|
|
34783
34801
|
},
|
|
34784
34802
|
{
|
|
34785
34803
|
version: 27,
|
|
34786
34804
|
name: "backfill-canonical-names",
|
|
34787
|
-
up:
|
|
34805
|
+
up: up292
|
|
34788
34806
|
},
|
|
34789
34807
|
{
|
|
34790
34808
|
version: 28,
|
|
34791
34809
|
name: "lossless-retention",
|
|
34792
|
-
up:
|
|
34810
|
+
up: up302
|
|
34793
34811
|
},
|
|
34794
34812
|
{
|
|
34795
34813
|
version: 29,
|
|
34796
34814
|
name: "session-summary-dag",
|
|
34797
|
-
up:
|
|
34815
|
+
up: up312
|
|
34798
34816
|
},
|
|
34799
34817
|
{
|
|
34800
34818
|
version: 30,
|
|
34801
34819
|
name: "nullable-memory-job-memory-id",
|
|
34802
|
-
up:
|
|
34820
|
+
up: up322
|
|
34803
34821
|
},
|
|
34804
34822
|
{
|
|
34805
34823
|
version: 31,
|
|
34806
34824
|
name: "dependency-reason",
|
|
34807
|
-
up:
|
|
34825
|
+
up: up332,
|
|
34808
34826
|
artifacts: {
|
|
34809
34827
|
columns: [
|
|
34810
34828
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -34815,7 +34833,7 @@ var MIGRATIONS2 = [
|
|
|
34815
34833
|
{
|
|
34816
34834
|
version: 32,
|
|
34817
34835
|
name: "embeddings-vector-column",
|
|
34818
|
-
up:
|
|
34836
|
+
up: up342,
|
|
34819
34837
|
artifacts: {
|
|
34820
34838
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
34821
34839
|
}
|
|
@@ -34823,7 +34841,7 @@ var MIGRATIONS2 = [
|
|
|
34823
34841
|
{
|
|
34824
34842
|
version: 33,
|
|
34825
34843
|
name: "scope",
|
|
34826
|
-
up:
|
|
34844
|
+
up: up352,
|
|
34827
34845
|
artifacts: {
|
|
34828
34846
|
columns: [{ table: "memories", column: "scope" }]
|
|
34829
34847
|
}
|
|
@@ -34831,17 +34849,17 @@ var MIGRATIONS2 = [
|
|
|
34831
34849
|
{
|
|
34832
34850
|
version: 34,
|
|
34833
34851
|
name: "scope-aware-dedup",
|
|
34834
|
-
up:
|
|
34852
|
+
up: up362
|
|
34835
34853
|
},
|
|
34836
34854
|
{
|
|
34837
34855
|
version: 35,
|
|
34838
34856
|
name: "entity-fts",
|
|
34839
|
-
up:
|
|
34857
|
+
up: up372
|
|
34840
34858
|
},
|
|
34841
34859
|
{
|
|
34842
34860
|
version: 36,
|
|
34843
34861
|
name: "dependency-confidence",
|
|
34844
|
-
up:
|
|
34862
|
+
up: up382,
|
|
34845
34863
|
artifacts: {
|
|
34846
34864
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
34847
34865
|
}
|
|
@@ -34849,7 +34867,7 @@ var MIGRATIONS2 = [
|
|
|
34849
34867
|
{
|
|
34850
34868
|
version: 37,
|
|
34851
34869
|
name: "entity-communities",
|
|
34852
|
-
up:
|
|
34870
|
+
up: up392,
|
|
34853
34871
|
artifacts: {
|
|
34854
34872
|
tables: ["entity_communities"],
|
|
34855
34873
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -34858,24 +34876,24 @@ var MIGRATIONS2 = [
|
|
|
34858
34876
|
{
|
|
34859
34877
|
version: 38,
|
|
34860
34878
|
name: "memory-hints",
|
|
34861
|
-
up:
|
|
34879
|
+
up: up402,
|
|
34862
34880
|
artifacts: { tables: ["memory_hints"] }
|
|
34863
34881
|
},
|
|
34864
34882
|
{
|
|
34865
34883
|
version: 39,
|
|
34866
34884
|
name: "dedup-entity-dependencies",
|
|
34867
|
-
up:
|
|
34885
|
+
up: up412
|
|
34868
34886
|
},
|
|
34869
34887
|
{
|
|
34870
34888
|
version: 40,
|
|
34871
34889
|
name: "session-transcripts",
|
|
34872
|
-
up:
|
|
34890
|
+
up: up422,
|
|
34873
34891
|
artifacts: { tables: ["session_transcripts"] }
|
|
34874
34892
|
},
|
|
34875
34893
|
{
|
|
34876
34894
|
version: 41,
|
|
34877
34895
|
name: "path-feedback",
|
|
34878
|
-
up:
|
|
34896
|
+
up: up432,
|
|
34879
34897
|
artifacts: {
|
|
34880
34898
|
tables: [
|
|
34881
34899
|
"path_feedback_events",
|
|
@@ -34890,7 +34908,7 @@ var MIGRATIONS2 = [
|
|
|
34890
34908
|
{
|
|
34891
34909
|
version: 42,
|
|
34892
34910
|
name: "session-memories-agent-id",
|
|
34893
|
-
up:
|
|
34911
|
+
up: up442,
|
|
34894
34912
|
artifacts: {
|
|
34895
34913
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
34896
34914
|
}
|
|
@@ -34898,7 +34916,7 @@ var MIGRATIONS2 = [
|
|
|
34898
34916
|
{
|
|
34899
34917
|
version: 43,
|
|
34900
34918
|
name: "agents-table",
|
|
34901
|
-
up:
|
|
34919
|
+
up: up452,
|
|
34902
34920
|
artifacts: {
|
|
34903
34921
|
tables: ["agents"],
|
|
34904
34922
|
columns: [
|
|
@@ -34910,7 +34928,7 @@ var MIGRATIONS2 = [
|
|
|
34910
34928
|
{
|
|
34911
34929
|
version: 44,
|
|
34912
34930
|
name: "memory-md-temporal-head",
|
|
34913
|
-
up:
|
|
34931
|
+
up: up462,
|
|
34914
34932
|
artifacts: {
|
|
34915
34933
|
columns: [
|
|
34916
34934
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -34922,7 +34940,7 @@ var MIGRATIONS2 = [
|
|
|
34922
34940
|
{
|
|
34923
34941
|
version: 45,
|
|
34924
34942
|
name: "lossless-working-memory-hardening",
|
|
34925
|
-
up:
|
|
34943
|
+
up: up472,
|
|
34926
34944
|
artifacts: {
|
|
34927
34945
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
34928
34946
|
columns: [
|
|
@@ -34935,17 +34953,17 @@ var MIGRATIONS2 = [
|
|
|
34935
34953
|
{
|
|
34936
34954
|
version: 46,
|
|
34937
34955
|
name: "session-summary-uniqueness",
|
|
34938
|
-
up:
|
|
34956
|
+
up: up482
|
|
34939
34957
|
},
|
|
34940
34958
|
{
|
|
34941
34959
|
version: 47,
|
|
34942
34960
|
name: "agent-scoped-temporal-uniqueness",
|
|
34943
|
-
up:
|
|
34961
|
+
up: up492
|
|
34944
34962
|
},
|
|
34945
34963
|
{
|
|
34946
34964
|
version: 48,
|
|
34947
34965
|
name: "thread-heads",
|
|
34948
|
-
up:
|
|
34966
|
+
up: up502,
|
|
34949
34967
|
artifacts: {
|
|
34950
34968
|
tables: ["memory_thread_heads"]
|
|
34951
34969
|
}
|
|
@@ -34953,7 +34971,7 @@ var MIGRATIONS2 = [
|
|
|
34953
34971
|
{
|
|
34954
34972
|
version: 49,
|
|
34955
34973
|
name: "session-extract-cursors",
|
|
34956
|
-
up:
|
|
34974
|
+
up: up512,
|
|
34957
34975
|
artifacts: {
|
|
34958
34976
|
tables: ["session_extract_cursors"]
|
|
34959
34977
|
}
|
|
@@ -34961,7 +34979,7 @@ var MIGRATIONS2 = [
|
|
|
34961
34979
|
{
|
|
34962
34980
|
version: 50,
|
|
34963
34981
|
name: "related-to-audit",
|
|
34964
|
-
up:
|
|
34982
|
+
up: up522,
|
|
34965
34983
|
artifacts: {
|
|
34966
34984
|
tables: ["entity_dependency_history"]
|
|
34967
34985
|
}
|
|
@@ -34969,7 +34987,7 @@ var MIGRATIONS2 = [
|
|
|
34969
34987
|
{
|
|
34970
34988
|
version: 51,
|
|
34971
34989
|
name: "memory-md-rolling-window-lineage",
|
|
34972
|
-
up:
|
|
34990
|
+
up: up532,
|
|
34973
34991
|
artifacts: {
|
|
34974
34992
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
34975
34993
|
columns: [
|
|
@@ -34984,7 +35002,7 @@ var MIGRATIONS2 = [
|
|
|
34984
35002
|
{
|
|
34985
35003
|
version: 52,
|
|
34986
35004
|
name: "mcp-invocations",
|
|
34987
|
-
up:
|
|
35005
|
+
up: up542,
|
|
34988
35006
|
artifacts: {
|
|
34989
35007
|
tables: ["mcp_invocations"]
|
|
34990
35008
|
}
|
|
@@ -34992,7 +35010,7 @@ var MIGRATIONS2 = [
|
|
|
34992
35010
|
{
|
|
34993
35011
|
version: 53,
|
|
34994
35012
|
name: "skill-invocations",
|
|
34995
|
-
up:
|
|
35013
|
+
up: up552,
|
|
34996
35014
|
artifacts: {
|
|
34997
35015
|
tables: ["skill_invocations"]
|
|
34998
35016
|
}
|
|
@@ -35000,7 +35018,7 @@ var MIGRATIONS2 = [
|
|
|
35000
35018
|
{
|
|
35001
35019
|
version: 54,
|
|
35002
35020
|
name: "task-agent-scope",
|
|
35003
|
-
up:
|
|
35021
|
+
up: up562,
|
|
35004
35022
|
artifacts: {
|
|
35005
35023
|
tables: ["task_scope_hints"]
|
|
35006
35024
|
}
|
|
@@ -35008,7 +35026,7 @@ var MIGRATIONS2 = [
|
|
|
35008
35026
|
{
|
|
35009
35027
|
version: 55,
|
|
35010
35028
|
name: "dreaming-state",
|
|
35011
|
-
up:
|
|
35029
|
+
up: up572,
|
|
35012
35030
|
artifacts: {
|
|
35013
35031
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
35014
35032
|
}
|
|
@@ -35016,22 +35034,22 @@ var MIGRATIONS2 = [
|
|
|
35016
35034
|
{
|
|
35017
35035
|
version: 56,
|
|
35018
35036
|
name: "agent-scoped-content-hash",
|
|
35019
|
-
up:
|
|
35037
|
+
up: up582
|
|
35020
35038
|
},
|
|
35021
35039
|
{
|
|
35022
35040
|
version: 57,
|
|
35023
35041
|
name: "memories-fts-tokenizer-repair",
|
|
35024
|
-
up:
|
|
35042
|
+
up: up592
|
|
35025
35043
|
},
|
|
35026
35044
|
{
|
|
35027
35045
|
version: 58,
|
|
35028
35046
|
name: "knowledge-graph-indices",
|
|
35029
|
-
up:
|
|
35047
|
+
up: up602
|
|
35030
35048
|
},
|
|
35031
35049
|
{
|
|
35032
35050
|
version: 59,
|
|
35033
35051
|
name: "entity-attribute-claim-key",
|
|
35034
|
-
up:
|
|
35052
|
+
up: up612,
|
|
35035
35053
|
artifacts: {
|
|
35036
35054
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
35037
35055
|
}
|
|
@@ -35039,7 +35057,7 @@ var MIGRATIONS2 = [
|
|
|
35039
35057
|
{
|
|
35040
35058
|
version: 60,
|
|
35041
35059
|
name: "entity-attribute-group-key",
|
|
35042
|
-
up:
|
|
35060
|
+
up: up622,
|
|
35043
35061
|
artifacts: {
|
|
35044
35062
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
35045
35063
|
}
|
|
@@ -35047,7 +35065,7 @@ var MIGRATIONS2 = [
|
|
|
35047
35065
|
{
|
|
35048
35066
|
version: 61,
|
|
35049
35067
|
name: "memory-artifact-source-mtime",
|
|
35050
|
-
up:
|
|
35068
|
+
up: up632,
|
|
35051
35069
|
artifacts: {
|
|
35052
35070
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
35053
35071
|
}
|
|
@@ -35055,7 +35073,7 @@ var MIGRATIONS2 = [
|
|
|
35055
35073
|
{
|
|
35056
35074
|
version: 62,
|
|
35057
35075
|
name: "memory-artifact-soft-delete",
|
|
35058
|
-
up:
|
|
35076
|
+
up: up642,
|
|
35059
35077
|
artifacts: {
|
|
35060
35078
|
columns: [
|
|
35061
35079
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -35066,12 +35084,12 @@ var MIGRATIONS2 = [
|
|
|
35066
35084
|
{
|
|
35067
35085
|
version: 63,
|
|
35068
35086
|
name: "content-only-memories-fts-update",
|
|
35069
|
-
up:
|
|
35087
|
+
up: up652
|
|
35070
35088
|
},
|
|
35071
35089
|
{
|
|
35072
35090
|
version: 64,
|
|
35073
35091
|
name: "source-graph-provenance",
|
|
35074
|
-
up:
|
|
35092
|
+
up: up662,
|
|
35075
35093
|
artifacts: {
|
|
35076
35094
|
columns: [
|
|
35077
35095
|
{ table: "entities", column: "source_path" },
|
|
@@ -35084,7 +35102,7 @@ var MIGRATIONS2 = [
|
|
|
35084
35102
|
{
|
|
35085
35103
|
version: 65,
|
|
35086
35104
|
name: "source-embedding-agent-scope",
|
|
35087
|
-
up:
|
|
35105
|
+
up: up672,
|
|
35088
35106
|
artifacts: {
|
|
35089
35107
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
35090
35108
|
}
|
|
@@ -35092,7 +35110,7 @@ var MIGRATIONS2 = [
|
|
|
35092
35110
|
{
|
|
35093
35111
|
version: 66,
|
|
35094
35112
|
name: "memory-search-telemetry",
|
|
35095
|
-
up:
|
|
35113
|
+
up: up682,
|
|
35096
35114
|
artifacts: {
|
|
35097
35115
|
tables: ["memory_search_telemetry"]
|
|
35098
35116
|
}
|
|
@@ -35100,7 +35118,7 @@ var MIGRATIONS2 = [
|
|
|
35100
35118
|
{
|
|
35101
35119
|
version: 67,
|
|
35102
35120
|
name: "ontology-proposals",
|
|
35103
|
-
up:
|
|
35121
|
+
up: up692,
|
|
35104
35122
|
artifacts: {
|
|
35105
35123
|
tables: ["ontology_proposals"],
|
|
35106
35124
|
columns: [
|
|
@@ -35114,7 +35132,7 @@ var MIGRATIONS2 = [
|
|
|
35114
35132
|
{
|
|
35115
35133
|
version: 68,
|
|
35116
35134
|
name: "daily-reflections",
|
|
35117
|
-
up:
|
|
35135
|
+
up: up702,
|
|
35118
35136
|
artifacts: {
|
|
35119
35137
|
tables: ["daily_reflections"]
|
|
35120
35138
|
}
|
|
@@ -35122,7 +35140,7 @@ var MIGRATIONS2 = [
|
|
|
35122
35140
|
{
|
|
35123
35141
|
version: 69,
|
|
35124
35142
|
name: "daily-reflections-multiple-insights",
|
|
35125
|
-
up:
|
|
35143
|
+
up: up712,
|
|
35126
35144
|
artifacts: {
|
|
35127
35145
|
tables: ["daily_reflections"]
|
|
35128
35146
|
}
|
|
@@ -35130,7 +35148,7 @@ var MIGRATIONS2 = [
|
|
|
35130
35148
|
{
|
|
35131
35149
|
version: 70,
|
|
35132
35150
|
name: "ontology-control-plane-state",
|
|
35133
|
-
up:
|
|
35151
|
+
up: up722,
|
|
35134
35152
|
artifacts: {
|
|
35135
35153
|
columns: [
|
|
35136
35154
|
{ table: "entities", column: "status" },
|
|
@@ -35145,7 +35163,7 @@ var MIGRATIONS2 = [
|
|
|
35145
35163
|
{
|
|
35146
35164
|
version: 71,
|
|
35147
35165
|
name: "epistemic-assertions",
|
|
35148
|
-
up:
|
|
35166
|
+
up: up732,
|
|
35149
35167
|
artifacts: {
|
|
35150
35168
|
tables: ["epistemic_assertions"]
|
|
35151
35169
|
}
|
|
@@ -35153,7 +35171,7 @@ var MIGRATIONS2 = [
|
|
|
35153
35171
|
{
|
|
35154
35172
|
version: 72,
|
|
35155
35173
|
name: "agent-scoped-idempotency-key",
|
|
35156
|
-
up:
|
|
35174
|
+
up: up742,
|
|
35157
35175
|
artifacts: {
|
|
35158
35176
|
columns: [
|
|
35159
35177
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -35164,7 +35182,7 @@ var MIGRATIONS2 = [
|
|
|
35164
35182
|
{
|
|
35165
35183
|
version: 73,
|
|
35166
35184
|
name: "recall-context-dedupe",
|
|
35167
|
-
up:
|
|
35185
|
+
up: up752,
|
|
35168
35186
|
artifacts: {
|
|
35169
35187
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
35170
35188
|
}
|
|
@@ -35172,7 +35190,7 @@ var MIGRATIONS2 = [
|
|
|
35172
35190
|
{
|
|
35173
35191
|
version: 74,
|
|
35174
35192
|
name: "aggregate-memory-links",
|
|
35175
|
-
up:
|
|
35193
|
+
up: up762,
|
|
35176
35194
|
artifacts: {
|
|
35177
35195
|
tables: ["aggregate_memory_sources"]
|
|
35178
35196
|
}
|
|
@@ -35180,7 +35198,7 @@ var MIGRATIONS2 = [
|
|
|
35180
35198
|
{
|
|
35181
35199
|
version: 75,
|
|
35182
35200
|
name: "memory-artifact-source-provenance",
|
|
35183
|
-
up:
|
|
35201
|
+
up: up772,
|
|
35184
35202
|
artifacts: {
|
|
35185
35203
|
columns: [
|
|
35186
35204
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -35194,7 +35212,7 @@ var MIGRATIONS2 = [
|
|
|
35194
35212
|
{
|
|
35195
35213
|
version: 76,
|
|
35196
35214
|
name: "temporal-edges",
|
|
35197
|
-
up:
|
|
35215
|
+
up: up782,
|
|
35198
35216
|
artifacts: {
|
|
35199
35217
|
tables: ["temporal_edges"]
|
|
35200
35218
|
}
|
|
@@ -35202,7 +35220,7 @@ var MIGRATIONS2 = [
|
|
|
35202
35220
|
{
|
|
35203
35221
|
version: 77,
|
|
35204
35222
|
name: "entity-aliases",
|
|
35205
|
-
up:
|
|
35223
|
+
up: up792,
|
|
35206
35224
|
artifacts: {
|
|
35207
35225
|
tables: ["entity_aliases"]
|
|
35208
35226
|
}
|
|
@@ -35210,7 +35228,7 @@ var MIGRATIONS2 = [
|
|
|
35210
35228
|
{
|
|
35211
35229
|
version: 78,
|
|
35212
35230
|
name: "api-keys",
|
|
35213
|
-
up:
|
|
35231
|
+
up: up802,
|
|
35214
35232
|
artifacts: {
|
|
35215
35233
|
tables: ["api_keys"]
|
|
35216
35234
|
}
|
|
@@ -35218,7 +35236,7 @@ var MIGRATIONS2 = [
|
|
|
35218
35236
|
{
|
|
35219
35237
|
version: 79,
|
|
35220
35238
|
name: "transcript-capture-jobs",
|
|
35221
|
-
up:
|
|
35239
|
+
up: up812,
|
|
35222
35240
|
artifacts: {
|
|
35223
35241
|
tables: ["transcript_capture_jobs"]
|
|
35224
35242
|
}
|
|
@@ -35226,7 +35244,7 @@ var MIGRATIONS2 = [
|
|
|
35226
35244
|
{
|
|
35227
35245
|
version: 80,
|
|
35228
35246
|
name: "document-scope-columns",
|
|
35229
|
-
up:
|
|
35247
|
+
up: up822,
|
|
35230
35248
|
artifacts: {
|
|
35231
35249
|
columns: [
|
|
35232
35250
|
{ table: "documents", column: "agent_id" },
|
|
@@ -35237,7 +35255,7 @@ var MIGRATIONS2 = [
|
|
|
35237
35255
|
{
|
|
35238
35256
|
version: 81,
|
|
35239
35257
|
name: "aggregate-evidence-sources",
|
|
35240
|
-
up:
|
|
35258
|
+
up: up832,
|
|
35241
35259
|
artifacts: {
|
|
35242
35260
|
tables: ["aggregate_evidence_sources"]
|
|
35243
35261
|
}
|
|
@@ -35245,7 +35263,7 @@ var MIGRATIONS2 = [
|
|
|
35245
35263
|
{
|
|
35246
35264
|
version: 82,
|
|
35247
35265
|
name: "skill-invocations-harness",
|
|
35248
|
-
up:
|
|
35266
|
+
up: up842,
|
|
35249
35267
|
artifacts: {
|
|
35250
35268
|
columns: [
|
|
35251
35269
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -35256,7 +35274,7 @@ var MIGRATIONS2 = [
|
|
|
35256
35274
|
{
|
|
35257
35275
|
version: 83,
|
|
35258
35276
|
name: "memory-lifecycle-repair",
|
|
35259
|
-
up:
|
|
35277
|
+
up: up852,
|
|
35260
35278
|
artifacts: {
|
|
35261
35279
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
35262
35280
|
columns: [
|
|
@@ -35271,7 +35289,7 @@ var MIGRATIONS2 = [
|
|
|
35271
35289
|
{
|
|
35272
35290
|
version: 84,
|
|
35273
35291
|
name: "legacy-markdown-import-state",
|
|
35274
|
-
up:
|
|
35292
|
+
up: up862,
|
|
35275
35293
|
artifacts: {
|
|
35276
35294
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
35277
35295
|
}
|
|
@@ -35279,7 +35297,7 @@ var MIGRATIONS2 = [
|
|
|
35279
35297
|
{
|
|
35280
35298
|
version: 85,
|
|
35281
35299
|
name: "backfill-relations-to-dependencies",
|
|
35282
|
-
up:
|
|
35300
|
+
up: up872,
|
|
35283
35301
|
artifacts: {
|
|
35284
35302
|
tables: ["entity_dependencies"]
|
|
35285
35303
|
}
|
|
@@ -35287,7 +35305,7 @@ var MIGRATIONS2 = [
|
|
|
35287
35305
|
{
|
|
35288
35306
|
version: 86,
|
|
35289
35307
|
name: "summary-jobs-content-hash",
|
|
35290
|
-
up:
|
|
35308
|
+
up: up882,
|
|
35291
35309
|
artifacts: {
|
|
35292
35310
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
35293
35311
|
}
|
|
@@ -35295,7 +35313,7 @@ var MIGRATIONS2 = [
|
|
|
35295
35313
|
{
|
|
35296
35314
|
version: 87,
|
|
35297
35315
|
name: "summary-jobs-boundary-reason",
|
|
35298
|
-
up:
|
|
35316
|
+
up: up892,
|
|
35299
35317
|
artifacts: {
|
|
35300
35318
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
35301
35319
|
}
|
|
@@ -35303,7 +35321,7 @@ var MIGRATIONS2 = [
|
|
|
35303
35321
|
{
|
|
35304
35322
|
version: 88,
|
|
35305
35323
|
name: "transcript-recovery-files",
|
|
35306
|
-
up:
|
|
35324
|
+
up: up902,
|
|
35307
35325
|
artifacts: {
|
|
35308
35326
|
tables: ["transcript_recovery_files"]
|
|
35309
35327
|
}
|
|
@@ -35311,7 +35329,7 @@ var MIGRATIONS2 = [
|
|
|
35311
35329
|
{
|
|
35312
35330
|
version: 89,
|
|
35313
35331
|
name: "job-cancellations",
|
|
35314
|
-
up:
|
|
35332
|
+
up: up912,
|
|
35315
35333
|
artifacts: {
|
|
35316
35334
|
tables: ["job_cancellations"]
|
|
35317
35335
|
}
|
|
@@ -35319,7 +35337,7 @@ var MIGRATIONS2 = [
|
|
|
35319
35337
|
{
|
|
35320
35338
|
version: 90,
|
|
35321
35339
|
name: "job-archive",
|
|
35322
|
-
up:
|
|
35340
|
+
up: up922,
|
|
35323
35341
|
artifacts: {
|
|
35324
35342
|
tables: ["job_archive"]
|
|
35325
35343
|
}
|
|
@@ -35327,25 +35345,25 @@ var MIGRATIONS2 = [
|
|
|
35327
35345
|
{
|
|
35328
35346
|
version: 91,
|
|
35329
35347
|
name: "embedding-index-generations",
|
|
35330
|
-
up:
|
|
35348
|
+
up: up932,
|
|
35331
35349
|
artifacts: { tables: ["embedding_index_state"] }
|
|
35332
35350
|
},
|
|
35333
35351
|
{
|
|
35334
35352
|
version: 92,
|
|
35335
35353
|
name: "embedding-staging-store",
|
|
35336
|
-
up:
|
|
35354
|
+
up: up942,
|
|
35337
35355
|
artifacts: { tables: ["embeddings_staging"] }
|
|
35338
35356
|
},
|
|
35339
35357
|
{
|
|
35340
35358
|
version: 93,
|
|
35341
35359
|
name: "dreaming-evidence-cursor",
|
|
35342
|
-
up:
|
|
35360
|
+
up: up952,
|
|
35343
35361
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
35344
35362
|
},
|
|
35345
35363
|
{
|
|
35346
35364
|
version: 94,
|
|
35347
35365
|
name: "memory-kind",
|
|
35348
|
-
up:
|
|
35366
|
+
up: up962,
|
|
35349
35367
|
artifacts: {
|
|
35350
35368
|
columns: [
|
|
35351
35369
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -35356,35 +35374,35 @@ var MIGRATIONS2 = [
|
|
|
35356
35374
|
{
|
|
35357
35375
|
version: 95,
|
|
35358
35376
|
name: "compaction-recall-projections",
|
|
35359
|
-
up:
|
|
35377
|
+
up: up972
|
|
35360
35378
|
},
|
|
35361
35379
|
{
|
|
35362
35380
|
version: 96,
|
|
35363
35381
|
name: "retire-legacy-ingestion",
|
|
35364
|
-
up:
|
|
35382
|
+
up: up982
|
|
35365
35383
|
},
|
|
35366
35384
|
{
|
|
35367
35385
|
version: 97,
|
|
35368
35386
|
name: "dreaming-failure-backoff",
|
|
35369
|
-
up:
|
|
35387
|
+
up: up992,
|
|
35370
35388
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
35371
35389
|
},
|
|
35372
35390
|
{
|
|
35373
35391
|
version: 98,
|
|
35374
35392
|
name: "dreaming-evidence-exclusions",
|
|
35375
|
-
up:
|
|
35393
|
+
up: up1002,
|
|
35376
35394
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
35377
35395
|
},
|
|
35378
35396
|
{
|
|
35379
35397
|
version: 99,
|
|
35380
35398
|
name: "dreaming-tool-calls",
|
|
35381
|
-
up:
|
|
35399
|
+
up: up1012,
|
|
35382
35400
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
35383
35401
|
},
|
|
35384
35402
|
{
|
|
35385
35403
|
version: 100,
|
|
35386
35404
|
name: "dreaming-runbook",
|
|
35387
|
-
up:
|
|
35405
|
+
up: up1022,
|
|
35388
35406
|
artifacts: {
|
|
35389
35407
|
columns: [
|
|
35390
35408
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -35395,23 +35413,23 @@ var MIGRATIONS2 = [
|
|
|
35395
35413
|
{
|
|
35396
35414
|
version: 101,
|
|
35397
35415
|
name: "dreaming-attention",
|
|
35398
|
-
up:
|
|
35416
|
+
up: up1032,
|
|
35399
35417
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35400
35418
|
},
|
|
35401
35419
|
{
|
|
35402
35420
|
version: 102,
|
|
35403
35421
|
name: "attribute-semantic-memories",
|
|
35404
|
-
up:
|
|
35422
|
+
up: up1042
|
|
35405
35423
|
},
|
|
35406
35424
|
{
|
|
35407
35425
|
version: 103,
|
|
35408
35426
|
name: "semantic-memory-kind",
|
|
35409
|
-
up:
|
|
35427
|
+
up: up1052
|
|
35410
35428
|
},
|
|
35411
35429
|
{
|
|
35412
35430
|
version: 104,
|
|
35413
35431
|
name: "derived-memory-provenance",
|
|
35414
|
-
up:
|
|
35432
|
+
up: up1062,
|
|
35415
35433
|
artifacts: {
|
|
35416
35434
|
tables: ["derived_memory_sources"],
|
|
35417
35435
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -35420,12 +35438,12 @@ var MIGRATIONS2 = [
|
|
|
35420
35438
|
{
|
|
35421
35439
|
version: 105,
|
|
35422
35440
|
name: "agent-scoped-entity-name",
|
|
35423
|
-
up:
|
|
35441
|
+
up: up1072
|
|
35424
35442
|
},
|
|
35425
35443
|
{
|
|
35426
35444
|
version: 106,
|
|
35427
35445
|
name: "memory-review-after",
|
|
35428
|
-
up:
|
|
35446
|
+
up: up1082,
|
|
35429
35447
|
artifacts: {
|
|
35430
35448
|
columns: [{ table: "memories", column: "review_after" }]
|
|
35431
35449
|
}
|
|
@@ -35433,7 +35451,7 @@ var MIGRATIONS2 = [
|
|
|
35433
35451
|
{
|
|
35434
35452
|
version: 107,
|
|
35435
35453
|
name: "dreaming-pass-usage",
|
|
35436
|
-
up:
|
|
35454
|
+
up: up1092,
|
|
35437
35455
|
artifacts: {
|
|
35438
35456
|
columns: [
|
|
35439
35457
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -35447,7 +35465,7 @@ var MIGRATIONS2 = [
|
|
|
35447
35465
|
{
|
|
35448
35466
|
version: 108,
|
|
35449
35467
|
name: "embedding-usage",
|
|
35450
|
-
up:
|
|
35468
|
+
up: up1102,
|
|
35451
35469
|
artifacts: {
|
|
35452
35470
|
tables: ["embedding_usage"]
|
|
35453
35471
|
}
|
|
@@ -35455,7 +35473,7 @@ var MIGRATIONS2 = [
|
|
|
35455
35473
|
{
|
|
35456
35474
|
version: 109,
|
|
35457
35475
|
name: "telemetry-install",
|
|
35458
|
-
up:
|
|
35476
|
+
up: up1112,
|
|
35459
35477
|
artifacts: {
|
|
35460
35478
|
tables: ["telemetry_install"]
|
|
35461
35479
|
}
|
|
@@ -35463,12 +35481,12 @@ var MIGRATIONS2 = [
|
|
|
35463
35481
|
{
|
|
35464
35482
|
version: 110,
|
|
35465
35483
|
name: "memory-mention-join-index",
|
|
35466
|
-
up:
|
|
35484
|
+
up: up1122
|
|
35467
35485
|
},
|
|
35468
35486
|
{
|
|
35469
35487
|
version: 111,
|
|
35470
35488
|
name: "telemetry-first-use",
|
|
35471
|
-
up:
|
|
35489
|
+
up: up1132,
|
|
35472
35490
|
artifacts: {
|
|
35473
35491
|
columns: [
|
|
35474
35492
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -35479,7 +35497,7 @@ var MIGRATIONS2 = [
|
|
|
35479
35497
|
{
|
|
35480
35498
|
version: 112,
|
|
35481
35499
|
name: "telemetry-queue-ownership",
|
|
35482
|
-
up:
|
|
35500
|
+
up: up1142,
|
|
35483
35501
|
artifacts: {
|
|
35484
35502
|
columns: [
|
|
35485
35503
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -35491,7 +35509,7 @@ var MIGRATIONS2 = [
|
|
|
35491
35509
|
{
|
|
35492
35510
|
version: 113,
|
|
35493
35511
|
name: "session-claims",
|
|
35494
|
-
up:
|
|
35512
|
+
up: up1152,
|
|
35495
35513
|
artifacts: {
|
|
35496
35514
|
tables: ["session_claims"],
|
|
35497
35515
|
columns: [
|
|
@@ -35505,12 +35523,12 @@ var MIGRATIONS2 = [
|
|
|
35505
35523
|
{
|
|
35506
35524
|
version: 114,
|
|
35507
35525
|
name: "memory-traversal-hydration-index",
|
|
35508
|
-
up:
|
|
35526
|
+
up: up1162
|
|
35509
35527
|
},
|
|
35510
35528
|
{
|
|
35511
35529
|
version: 115,
|
|
35512
35530
|
name: "cross-agent-message-notifications",
|
|
35513
|
-
up:
|
|
35531
|
+
up: up1172,
|
|
35514
35532
|
artifacts: {
|
|
35515
35533
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
35516
35534
|
}
|
|
@@ -35518,7 +35536,7 @@ var MIGRATIONS2 = [
|
|
|
35518
35536
|
{
|
|
35519
35537
|
version: 116,
|
|
35520
35538
|
name: "acp-delivery-reconciliation",
|
|
35521
|
-
up:
|
|
35539
|
+
up: up1182,
|
|
35522
35540
|
artifacts: {
|
|
35523
35541
|
columns: [
|
|
35524
35542
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -35532,7 +35550,7 @@ var MIGRATIONS2 = [
|
|
|
35532
35550
|
{
|
|
35533
35551
|
version: 117,
|
|
35534
35552
|
name: "retire-summary-worker",
|
|
35535
|
-
up:
|
|
35553
|
+
up: up1192,
|
|
35536
35554
|
artifacts: {
|
|
35537
35555
|
columns: [
|
|
35538
35556
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -35543,24 +35561,24 @@ var MIGRATIONS2 = [
|
|
|
35543
35561
|
{
|
|
35544
35562
|
version: 118,
|
|
35545
35563
|
name: "queue-pressure-indices",
|
|
35546
|
-
up:
|
|
35564
|
+
up: up1202
|
|
35547
35565
|
},
|
|
35548
35566
|
{
|
|
35549
35567
|
version: 119,
|
|
35550
35568
|
name: "telemetry-version-observation",
|
|
35551
|
-
up:
|
|
35569
|
+
up: up1212,
|
|
35552
35570
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
35553
35571
|
},
|
|
35554
35572
|
{
|
|
35555
35573
|
version: 120,
|
|
35556
35574
|
name: "source-lifecycle-telemetry",
|
|
35557
|
-
up:
|
|
35575
|
+
up: up1222,
|
|
35558
35576
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
35559
35577
|
},
|
|
35560
35578
|
{
|
|
35561
35579
|
version: 121,
|
|
35562
35580
|
name: "telemetry-delivery-health",
|
|
35563
|
-
up:
|
|
35581
|
+
up: up1232,
|
|
35564
35582
|
artifacts: {
|
|
35565
35583
|
tables: ["telemetry_delivery_state"],
|
|
35566
35584
|
columns: [
|
|
@@ -35574,7 +35592,7 @@ var MIGRATIONS2 = [
|
|
|
35574
35592
|
{
|
|
35575
35593
|
version: 122,
|
|
35576
35594
|
name: "dreaming-evidence-retry",
|
|
35577
|
-
up:
|
|
35595
|
+
up: up1242,
|
|
35578
35596
|
artifacts: {
|
|
35579
35597
|
columns: [
|
|
35580
35598
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -35587,13 +35605,13 @@ var MIGRATIONS2 = [
|
|
|
35587
35605
|
{
|
|
35588
35606
|
version: 123,
|
|
35589
35607
|
name: "embedding-index-failures",
|
|
35590
|
-
up:
|
|
35608
|
+
up: up1252,
|
|
35591
35609
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
35592
35610
|
},
|
|
35593
35611
|
{
|
|
35594
35612
|
version: 124,
|
|
35595
35613
|
name: "import-derived-lifecycle",
|
|
35596
|
-
up:
|
|
35614
|
+
up: up1262,
|
|
35597
35615
|
artifacts: {
|
|
35598
35616
|
tables: ["imported_source_lifecycle"]
|
|
35599
35617
|
}
|
|
@@ -35601,77 +35619,77 @@ var MIGRATIONS2 = [
|
|
|
35601
35619
|
{
|
|
35602
35620
|
version: 125,
|
|
35603
35621
|
name: "memory-content-safety",
|
|
35604
|
-
up:
|
|
35622
|
+
up: up1272,
|
|
35605
35623
|
artifacts: { tables: ["memory_content_safety"] }
|
|
35606
35624
|
},
|
|
35607
35625
|
{
|
|
35608
35626
|
version: 126,
|
|
35609
35627
|
name: "dreaming-surprisal-attention",
|
|
35610
|
-
up:
|
|
35628
|
+
up: up1282,
|
|
35611
35629
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35612
35630
|
},
|
|
35613
35631
|
{
|
|
35614
35632
|
version: 127,
|
|
35615
35633
|
name: "ontology-contradictions",
|
|
35616
|
-
up:
|
|
35634
|
+
up: up1292,
|
|
35617
35635
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
35618
35636
|
},
|
|
35619
35637
|
{
|
|
35620
35638
|
version: 128,
|
|
35621
35639
|
name: "bounded-queue-diagnostics",
|
|
35622
|
-
up:
|
|
35640
|
+
up: up1302
|
|
35623
35641
|
},
|
|
35624
35642
|
{
|
|
35625
35643
|
version: 129,
|
|
35626
35644
|
name: "retire-structural-jobs",
|
|
35627
|
-
up:
|
|
35645
|
+
up: up1312
|
|
35628
35646
|
},
|
|
35629
35647
|
{
|
|
35630
35648
|
version: 130,
|
|
35631
35649
|
name: "embedding-repair-state",
|
|
35632
|
-
up:
|
|
35650
|
+
up: up1322,
|
|
35633
35651
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
35634
35652
|
},
|
|
35635
35653
|
{
|
|
35636
35654
|
version: 131,
|
|
35637
35655
|
name: "dreaming-evidence-consumption",
|
|
35638
|
-
up:
|
|
35656
|
+
up: up1332,
|
|
35639
35657
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
35640
35658
|
},
|
|
35641
35659
|
{
|
|
35642
35660
|
version: 132,
|
|
35643
35661
|
name: "observer-scoped-epistemic-assertions",
|
|
35644
|
-
up:
|
|
35662
|
+
up: up1342,
|
|
35645
35663
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
35646
35664
|
},
|
|
35647
35665
|
{
|
|
35648
35666
|
version: 133,
|
|
35649
35667
|
name: "dreaming-memory-head",
|
|
35650
|
-
up:
|
|
35668
|
+
up: up1352,
|
|
35651
35669
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
35652
35670
|
},
|
|
35653
35671
|
{
|
|
35654
35672
|
version: 134,
|
|
35655
35673
|
name: "scope-memory-head-entries",
|
|
35656
|
-
up:
|
|
35674
|
+
up: up1362,
|
|
35657
35675
|
artifacts: { tables: ["memory_head_entries"] }
|
|
35658
35676
|
},
|
|
35659
35677
|
{
|
|
35660
35678
|
version: 135,
|
|
35661
35679
|
name: "memory-head-publication",
|
|
35662
|
-
up:
|
|
35680
|
+
up: up1372,
|
|
35663
35681
|
artifacts: { tables: ["memory_head_publications"] }
|
|
35664
35682
|
},
|
|
35665
35683
|
{
|
|
35666
35684
|
version: 136,
|
|
35667
35685
|
name: "memory-head-revisions",
|
|
35668
|
-
up:
|
|
35686
|
+
up: up1382,
|
|
35669
35687
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
35670
35688
|
},
|
|
35671
35689
|
{
|
|
35672
35690
|
version: 137,
|
|
35673
35691
|
name: "dreaming-head-manifest",
|
|
35674
|
-
up:
|
|
35692
|
+
up: up1392,
|
|
35675
35693
|
artifacts: {
|
|
35676
35694
|
columns: [
|
|
35677
35695
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -35682,7 +35700,7 @@ var MIGRATIONS2 = [
|
|
|
35682
35700
|
{
|
|
35683
35701
|
version: 138,
|
|
35684
35702
|
name: "bounded-status-projections",
|
|
35685
|
-
up:
|
|
35703
|
+
up: up1402,
|
|
35686
35704
|
artifacts: {
|
|
35687
35705
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
35688
35706
|
}
|
|
@@ -35690,31 +35708,31 @@ var MIGRATIONS2 = [
|
|
|
35690
35708
|
{
|
|
35691
35709
|
version: 139,
|
|
35692
35710
|
name: "native-source-sync-state",
|
|
35693
|
-
up:
|
|
35711
|
+
up: up1412,
|
|
35694
35712
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
35695
35713
|
},
|
|
35696
35714
|
{
|
|
35697
35715
|
version: 140,
|
|
35698
35716
|
name: "transcript-recovery-frontier",
|
|
35699
|
-
up:
|
|
35717
|
+
up: up1422,
|
|
35700
35718
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
35701
35719
|
},
|
|
35702
35720
|
{
|
|
35703
35721
|
version: 141,
|
|
35704
35722
|
name: "source-sync-checkpoints",
|
|
35705
|
-
up:
|
|
35723
|
+
up: up1432,
|
|
35706
35724
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
35707
35725
|
},
|
|
35708
35726
|
{
|
|
35709
35727
|
version: 142,
|
|
35710
35728
|
name: "source-sync-frontier",
|
|
35711
|
-
up:
|
|
35729
|
+
up: up1442,
|
|
35712
35730
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
35713
35731
|
},
|
|
35714
35732
|
{
|
|
35715
35733
|
version: 143,
|
|
35716
35734
|
name: "embedding-index-progress",
|
|
35717
|
-
up:
|
|
35735
|
+
up: up1452,
|
|
35718
35736
|
artifacts: {
|
|
35719
35737
|
columns: [
|
|
35720
35738
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -35730,19 +35748,19 @@ var MIGRATIONS2 = [
|
|
|
35730
35748
|
{
|
|
35731
35749
|
version: 144,
|
|
35732
35750
|
name: "memory-job-lease-token",
|
|
35733
|
-
up:
|
|
35751
|
+
up: up1462,
|
|
35734
35752
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
35735
35753
|
},
|
|
35736
35754
|
{
|
|
35737
35755
|
version: 145,
|
|
35738
35756
|
name: "dreaming-evidence-reviews",
|
|
35739
|
-
up:
|
|
35757
|
+
up: up1472,
|
|
35740
35758
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
35741
35759
|
},
|
|
35742
35760
|
{
|
|
35743
35761
|
version: 146,
|
|
35744
35762
|
name: "source-transcript-import",
|
|
35745
|
-
up:
|
|
35763
|
+
up: up1482,
|
|
35746
35764
|
artifacts: {
|
|
35747
35765
|
tables: [
|
|
35748
35766
|
"source_import_jobs",
|
|
@@ -35761,19 +35779,19 @@ var MIGRATIONS2 = [
|
|
|
35761
35779
|
{
|
|
35762
35780
|
version: 147,
|
|
35763
35781
|
name: "source-import-replay-file-slots",
|
|
35764
|
-
up:
|
|
35782
|
+
up: up1492,
|
|
35765
35783
|
artifacts: { tables: ["source_import_files"] }
|
|
35766
35784
|
},
|
|
35767
35785
|
{
|
|
35768
35786
|
version: 148,
|
|
35769
35787
|
name: "source-import-attempt-provenance",
|
|
35770
|
-
up:
|
|
35788
|
+
up: up1502,
|
|
35771
35789
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
35772
35790
|
},
|
|
35773
35791
|
{
|
|
35774
35792
|
version: 149,
|
|
35775
35793
|
name: "transcript-import-state-machine",
|
|
35776
|
-
up:
|
|
35794
|
+
up: up1512,
|
|
35777
35795
|
artifacts: {
|
|
35778
35796
|
columns: [
|
|
35779
35797
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -35785,7 +35803,7 @@ var MIGRATIONS2 = [
|
|
|
35785
35803
|
{
|
|
35786
35804
|
version: 150,
|
|
35787
35805
|
name: "memory-head-freshness",
|
|
35788
|
-
up:
|
|
35806
|
+
up: up1522,
|
|
35789
35807
|
artifacts: {
|
|
35790
35808
|
columns: [
|
|
35791
35809
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -35796,7 +35814,7 @@ var MIGRATIONS2 = [
|
|
|
35796
35814
|
{
|
|
35797
35815
|
version: 151,
|
|
35798
35816
|
name: "transcript-import-bytes",
|
|
35799
|
-
up:
|
|
35817
|
+
up: up153,
|
|
35800
35818
|
artifacts: {
|
|
35801
35819
|
tables: [
|
|
35802
35820
|
"source_import_chunks",
|
|
@@ -35821,6 +35839,12 @@ var MIGRATIONS2 = [
|
|
|
35821
35839
|
}))
|
|
35822
35840
|
]
|
|
35823
35841
|
}
|
|
35842
|
+
},
|
|
35843
|
+
{
|
|
35844
|
+
version: 152,
|
|
35845
|
+
name: "memory-artifact-sha-index",
|
|
35846
|
+
up: up210,
|
|
35847
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
35824
35848
|
}
|
|
35825
35849
|
];
|
|
35826
35850
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|