@signetai/signet-memory-openclaw 0.221.10 → 0.222.0
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 +1 -1
package/dist/index.js
CHANGED
|
@@ -11622,6 +11622,12 @@ function up(db) {
|
|
|
11622
11622
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
11623
11623
|
`);
|
|
11624
11624
|
}
|
|
11625
|
+
function up2(db) {
|
|
11626
|
+
db.exec(`
|
|
11627
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
11628
|
+
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)
|
|
11629
|
+
`);
|
|
11630
|
+
}
|
|
11625
11631
|
var MEMORIES_FTS_TOKENIZER = "unicode61";
|
|
11626
11632
|
var FTS_STATE_TABLE = "memories_fts_state";
|
|
11627
11633
|
function normalizeSql(sql) {
|
|
@@ -11737,7 +11743,7 @@ function memoriesFtsNeedsTokenizerRepair(sql) {
|
|
|
11737
11743
|
return true;
|
|
11738
11744
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER}'`);
|
|
11739
11745
|
}
|
|
11740
|
-
function
|
|
11746
|
+
function up3(db) {
|
|
11741
11747
|
db.exec(`
|
|
11742
11748
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
11743
11749
|
version INTEGER PRIMARY KEY,
|
|
@@ -11835,7 +11841,7 @@ function addColumnIfMissing(db, table, column, definition) {
|
|
|
11835
11841
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11836
11842
|
}
|
|
11837
11843
|
}
|
|
11838
|
-
function
|
|
11844
|
+
function up4(db) {
|
|
11839
11845
|
addColumnIfMissing(db, "memories", "content_hash", "TEXT");
|
|
11840
11846
|
addColumnIfMissing(db, "memories", "normalized_content", "TEXT");
|
|
11841
11847
|
addColumnIfMissing(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -11953,7 +11959,7 @@ function addColumnIfMissing2(db, table, column, definition) {
|
|
|
11953
11959
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11954
11960
|
return true;
|
|
11955
11961
|
}
|
|
11956
|
-
function
|
|
11962
|
+
function up5(db) {
|
|
11957
11963
|
addColumnIfMissing2(db, "memories", "why", "TEXT");
|
|
11958
11964
|
addColumnIfMissing2(db, "memories", "project", "TEXT");
|
|
11959
11965
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -11990,7 +11996,7 @@ function addColumnIfMissing3(db, table, column, definition) {
|
|
|
11990
11996
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11991
11997
|
}
|
|
11992
11998
|
}
|
|
11993
|
-
function
|
|
11999
|
+
function up6(db) {
|
|
11994
12000
|
addColumnIfMissing3(db, "memory_history", "actor_type", "TEXT");
|
|
11995
12001
|
addColumnIfMissing3(db, "memory_history", "session_id", "TEXT");
|
|
11996
12002
|
addColumnIfMissing3(db, "memory_history", "request_id", "TEXT");
|
|
@@ -12023,7 +12029,7 @@ function addColumnIfMissing4(db, table, column, definition) {
|
|
|
12023
12029
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12024
12030
|
}
|
|
12025
12031
|
}
|
|
12026
|
-
function
|
|
12032
|
+
function up7(db) {
|
|
12027
12033
|
addColumnIfMissing4(db, "entities", "canonical_name", "TEXT");
|
|
12028
12034
|
addColumnIfMissing4(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
12029
12035
|
addColumnIfMissing4(db, "entities", "embedding", "BLOB");
|
|
@@ -12040,7 +12046,7 @@ function hasColumn4(db, table, column) {
|
|
|
12040
12046
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
12041
12047
|
return rows.some((r2) => r2.name === column);
|
|
12042
12048
|
}
|
|
12043
|
-
function
|
|
12049
|
+
function up8(db) {
|
|
12044
12050
|
if (!hasColumn4(db, "memories", "idempotency_key")) {
|
|
12045
12051
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
12046
12052
|
}
|
|
@@ -12055,7 +12061,7 @@ function hasColumn5(db, table, column) {
|
|
|
12055
12061
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
12056
12062
|
return rows.some((r2) => r2.name === column);
|
|
12057
12063
|
}
|
|
12058
|
-
function
|
|
12064
|
+
function up9(db) {
|
|
12059
12065
|
db.exec(`
|
|
12060
12066
|
CREATE TABLE IF NOT EXISTS documents (
|
|
12061
12067
|
id TEXT PRIMARY KEY,
|
|
@@ -12112,7 +12118,7 @@ function up8(db) {
|
|
|
12112
12118
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
12113
12119
|
}
|
|
12114
12120
|
}
|
|
12115
|
-
function
|
|
12121
|
+
function up10(db) {
|
|
12116
12122
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
12117
12123
|
if (tables.length === 0)
|
|
12118
12124
|
return;
|
|
@@ -12129,7 +12135,7 @@ function up9(db) {
|
|
|
12129
12135
|
ON embeddings(content_hash)
|
|
12130
12136
|
`);
|
|
12131
12137
|
}
|
|
12132
|
-
function
|
|
12138
|
+
function up11(db) {
|
|
12133
12139
|
db.exec(`
|
|
12134
12140
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
12135
12141
|
id TEXT PRIMARY KEY,
|
|
@@ -12149,7 +12155,7 @@ function up10(db) {
|
|
|
12149
12155
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
12150
12156
|
ON summary_jobs(status)`);
|
|
12151
12157
|
}
|
|
12152
|
-
function
|
|
12158
|
+
function up12(db) {
|
|
12153
12159
|
db.exec(`
|
|
12154
12160
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
12155
12161
|
id INTEGER PRIMARY KEY,
|
|
@@ -12160,7 +12166,7 @@ function up11(db) {
|
|
|
12160
12166
|
)
|
|
12161
12167
|
`);
|
|
12162
12168
|
}
|
|
12163
|
-
function
|
|
12169
|
+
function up13(db) {
|
|
12164
12170
|
db.exec(`
|
|
12165
12171
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
12166
12172
|
id TEXT PRIMARY KEY,
|
|
@@ -12180,7 +12186,7 @@ function up12(db) {
|
|
|
12180
12186
|
ON session_scores(session_key);
|
|
12181
12187
|
`);
|
|
12182
12188
|
}
|
|
12183
|
-
function
|
|
12189
|
+
function up14(db) {
|
|
12184
12190
|
db.exec(`
|
|
12185
12191
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
12186
12192
|
id TEXT PRIMARY KEY,
|
|
@@ -12221,7 +12227,7 @@ function addColumnIfMissing5(db, table, column, definition) {
|
|
|
12221
12227
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12222
12228
|
}
|
|
12223
12229
|
}
|
|
12224
|
-
function
|
|
12230
|
+
function up15(db) {
|
|
12225
12231
|
db.exec(`
|
|
12226
12232
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
12227
12233
|
id TEXT PRIMARY KEY,
|
|
@@ -12247,7 +12253,7 @@ function up14(db) {
|
|
|
12247
12253
|
addColumnIfMissing5(db, "memories", "source_path", "TEXT");
|
|
12248
12254
|
addColumnIfMissing5(db, "memories", "source_section", "TEXT");
|
|
12249
12255
|
}
|
|
12250
|
-
function
|
|
12256
|
+
function up16(db) {
|
|
12251
12257
|
db.exec(`
|
|
12252
12258
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
12253
12259
|
id TEXT PRIMARY KEY,
|
|
@@ -12272,7 +12278,7 @@ function addColumnIfMissing6(db, table, column, definition) {
|
|
|
12272
12278
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12273
12279
|
}
|
|
12274
12280
|
}
|
|
12275
|
-
function
|
|
12281
|
+
function up17(db) {
|
|
12276
12282
|
db.exec(`
|
|
12277
12283
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
12278
12284
|
id TEXT PRIMARY KEY,
|
|
@@ -12299,7 +12305,7 @@ function up16(db) {
|
|
|
12299
12305
|
addColumnIfMissing6(db, "session_scores", "confidence", "REAL");
|
|
12300
12306
|
addColumnIfMissing6(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
12301
12307
|
}
|
|
12302
|
-
function
|
|
12308
|
+
function up18(db) {
|
|
12303
12309
|
db.exec(`
|
|
12304
12310
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
12305
12311
|
id TEXT PRIMARY KEY,
|
|
@@ -12321,7 +12327,7 @@ function up17(db) {
|
|
|
12321
12327
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
12322
12328
|
`);
|
|
12323
12329
|
}
|
|
12324
|
-
function
|
|
12330
|
+
function up19(db) {
|
|
12325
12331
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
12326
12332
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12327
12333
|
if (!colNames.has("skill_name")) {
|
|
@@ -12332,7 +12338,7 @@ function up18(db) {
|
|
|
12332
12338
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
12333
12339
|
}
|
|
12334
12340
|
}
|
|
12335
|
-
function
|
|
12341
|
+
function up20(db) {
|
|
12336
12342
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
12337
12343
|
if (existing)
|
|
12338
12344
|
return;
|
|
@@ -12364,7 +12370,7 @@ function up19(db) {
|
|
|
12364
12370
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
12365
12371
|
`);
|
|
12366
12372
|
}
|
|
12367
|
-
function
|
|
12373
|
+
function up21(db) {
|
|
12368
12374
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
12369
12375
|
const entityColNames = new Set(entityCols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12370
12376
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -12449,13 +12455,13 @@ function addColumnIfMissing7(db, table, column, definition) {
|
|
|
12449
12455
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12450
12456
|
}
|
|
12451
12457
|
}
|
|
12452
|
-
function
|
|
12458
|
+
function up22(db) {
|
|
12453
12459
|
addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
|
|
12454
12460
|
addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12455
12461
|
addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
12456
12462
|
addColumnIfMissing7(db, "session_memories", "structural_density", "INTEGER");
|
|
12457
12463
|
}
|
|
12458
|
-
function
|
|
12464
|
+
function up23(db) {
|
|
12459
12465
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
12460
12466
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
12461
12467
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -12480,25 +12486,25 @@ function addColumnIfMissing8(db, table, column, definition) {
|
|
|
12480
12486
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12481
12487
|
}
|
|
12482
12488
|
}
|
|
12483
|
-
function
|
|
12489
|
+
function up24(db) {
|
|
12484
12490
|
addColumnIfMissing8(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
12485
12491
|
addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
|
|
12486
12492
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
12487
12493
|
}
|
|
12488
|
-
function up24(_db) {}
|
|
12489
12494
|
function up25(_db) {}
|
|
12495
|
+
function up26(_db) {}
|
|
12490
12496
|
function addColumnIfMissing9(db, table, column, definition) {
|
|
12491
12497
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
12492
12498
|
if (!cols.some((c2) => c2.name === column)) {
|
|
12493
12499
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12494
12500
|
}
|
|
12495
12501
|
}
|
|
12496
|
-
function
|
|
12502
|
+
function up27(db) {
|
|
12497
12503
|
addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
|
|
12498
12504
|
addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
12499
12505
|
}
|
|
12500
|
-
function
|
|
12501
|
-
function
|
|
12506
|
+
function up28(_db) {}
|
|
12507
|
+
function up29(db) {
|
|
12502
12508
|
db.exec(`
|
|
12503
12509
|
UPDATE entities
|
|
12504
12510
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -12507,7 +12513,7 @@ function up28(db) {
|
|
|
12507
12513
|
WHERE canonical_name IS NULL
|
|
12508
12514
|
`);
|
|
12509
12515
|
}
|
|
12510
|
-
function
|
|
12516
|
+
function up30(db) {
|
|
12511
12517
|
db.exec(`
|
|
12512
12518
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
12513
12519
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -12544,7 +12550,7 @@ function up29(db) {
|
|
|
12544
12550
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
12545
12551
|
`);
|
|
12546
12552
|
}
|
|
12547
|
-
function
|
|
12553
|
+
function up31(db) {
|
|
12548
12554
|
db.exec(`
|
|
12549
12555
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
12550
12556
|
id TEXT PRIMARY KEY,
|
|
@@ -12589,7 +12595,7 @@ function up30(db) {
|
|
|
12589
12595
|
WHERE session_key IS NOT NULL;
|
|
12590
12596
|
`);
|
|
12591
12597
|
}
|
|
12592
|
-
function
|
|
12598
|
+
function up32(db) {
|
|
12593
12599
|
db.exec(`
|
|
12594
12600
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
12595
12601
|
id TEXT PRIMARY KEY,
|
|
@@ -12634,7 +12640,7 @@ function up31(db) {
|
|
|
12634
12640
|
ON memory_jobs(failed_at);
|
|
12635
12641
|
`);
|
|
12636
12642
|
}
|
|
12637
|
-
function
|
|
12643
|
+
function up33(db) {
|
|
12638
12644
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12639
12645
|
if (!depCols.some((c2) => c2.name === "reason")) {
|
|
12640
12646
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -12644,7 +12650,7 @@ function up32(db) {
|
|
|
12644
12650
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
12645
12651
|
}
|
|
12646
12652
|
}
|
|
12647
|
-
function
|
|
12653
|
+
function up34(db) {
|
|
12648
12654
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
12649
12655
|
if (cols.length === 0)
|
|
12650
12656
|
return;
|
|
@@ -12652,14 +12658,14 @@ function up33(db) {
|
|
|
12652
12658
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
12653
12659
|
}
|
|
12654
12660
|
}
|
|
12655
|
-
function
|
|
12661
|
+
function up35(db) {
|
|
12656
12662
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
12657
12663
|
if (!cols.some((c2) => c2.name === "scope")) {
|
|
12658
12664
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
12659
12665
|
}
|
|
12660
12666
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
12661
12667
|
}
|
|
12662
|
-
function
|
|
12668
|
+
function up36(db) {
|
|
12663
12669
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
12664
12670
|
db.exec(`
|
|
12665
12671
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -12667,7 +12673,7 @@ function up35(db) {
|
|
|
12667
12673
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
12668
12674
|
`);
|
|
12669
12675
|
}
|
|
12670
|
-
function
|
|
12676
|
+
function up37(db) {
|
|
12671
12677
|
db.exec(`
|
|
12672
12678
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
12673
12679
|
name, canonical_name,
|
|
@@ -12699,13 +12705,13 @@ function up36(db) {
|
|
|
12699
12705
|
END
|
|
12700
12706
|
`);
|
|
12701
12707
|
}
|
|
12702
|
-
function
|
|
12708
|
+
function up38(db) {
|
|
12703
12709
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12704
12710
|
if (!cols.some((c2) => c2.name === "confidence")) {
|
|
12705
12711
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
12706
12712
|
}
|
|
12707
12713
|
}
|
|
12708
|
-
function
|
|
12714
|
+
function up39(db) {
|
|
12709
12715
|
db.exec(`
|
|
12710
12716
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
12711
12717
|
id TEXT PRIMARY KEY,
|
|
@@ -12723,7 +12729,7 @@ function up38(db) {
|
|
|
12723
12729
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
12724
12730
|
}
|
|
12725
12731
|
}
|
|
12726
|
-
function
|
|
12732
|
+
function up40(db) {
|
|
12727
12733
|
db.exec(`
|
|
12728
12734
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
12729
12735
|
id TEXT PRIMARY KEY,
|
|
@@ -12763,7 +12769,7 @@ function up39(db) {
|
|
|
12763
12769
|
END
|
|
12764
12770
|
`);
|
|
12765
12771
|
}
|
|
12766
|
-
function
|
|
12772
|
+
function up41(db) {
|
|
12767
12773
|
db.exec(`
|
|
12768
12774
|
DELETE FROM entity_dependencies
|
|
12769
12775
|
WHERE id NOT IN (
|
|
@@ -12781,7 +12787,7 @@ function up40(db) {
|
|
|
12781
12787
|
)
|
|
12782
12788
|
`);
|
|
12783
12789
|
}
|
|
12784
|
-
function
|
|
12790
|
+
function up42(db) {
|
|
12785
12791
|
db.exec(`
|
|
12786
12792
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
12787
12793
|
session_key TEXT PRIMARY KEY,
|
|
@@ -12804,7 +12810,7 @@ function addColumnIfMissing10(db, table, column, definition) {
|
|
|
12804
12810
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12805
12811
|
}
|
|
12806
12812
|
}
|
|
12807
|
-
function
|
|
12813
|
+
function up43(db) {
|
|
12808
12814
|
addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
|
|
12809
12815
|
db.exec(`
|
|
12810
12816
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -12879,7 +12885,7 @@ function addColumnIfMissing11(db, table, column, definition) {
|
|
|
12879
12885
|
return;
|
|
12880
12886
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12881
12887
|
}
|
|
12882
|
-
function
|
|
12888
|
+
function up44(db) {
|
|
12883
12889
|
addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
|
|
12884
12890
|
addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12885
12891
|
addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -12967,7 +12973,7 @@ function addColumnIfMissing12(db, table, column, definition) {
|
|
|
12967
12973
|
return;
|
|
12968
12974
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12969
12975
|
}
|
|
12970
|
-
function
|
|
12976
|
+
function up45(db) {
|
|
12971
12977
|
db.exec(`
|
|
12972
12978
|
CREATE TABLE IF NOT EXISTS agents (
|
|
12973
12979
|
id TEXT PRIMARY KEY,
|
|
@@ -12996,7 +13002,7 @@ function addColumnIfMissing13(db, table, column, definition) {
|
|
|
12996
13002
|
return;
|
|
12997
13003
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12998
13004
|
}
|
|
12999
|
-
function
|
|
13005
|
+
function up46(db) {
|
|
13000
13006
|
addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
|
|
13001
13007
|
addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
|
|
13002
13008
|
addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -13022,7 +13028,7 @@ function addColumnIfMissing14(db, table, column, definition) {
|
|
|
13022
13028
|
return;
|
|
13023
13029
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13024
13030
|
}
|
|
13025
|
-
function
|
|
13031
|
+
function up47(db) {
|
|
13026
13032
|
addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
|
|
13027
13033
|
addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
13028
13034
|
addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -13093,7 +13099,7 @@ function up46(db) {
|
|
|
13093
13099
|
ON memory_md_heads(lease_expires_at);
|
|
13094
13100
|
`);
|
|
13095
13101
|
}
|
|
13096
|
-
function
|
|
13102
|
+
function up48(db) {
|
|
13097
13103
|
db.exec(`
|
|
13098
13104
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
13099
13105
|
|
|
@@ -13154,7 +13160,7 @@ function up47(db) {
|
|
|
13154
13160
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
13155
13161
|
`);
|
|
13156
13162
|
}
|
|
13157
|
-
function
|
|
13163
|
+
function up49(db) {
|
|
13158
13164
|
db.exec(`
|
|
13159
13165
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
13160
13166
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -13252,7 +13258,7 @@ function up48(db) {
|
|
|
13252
13258
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
13253
13259
|
`);
|
|
13254
13260
|
}
|
|
13255
|
-
function
|
|
13261
|
+
function up50(db) {
|
|
13256
13262
|
db.exec(`
|
|
13257
13263
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
13258
13264
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -13370,7 +13376,7 @@ function up49(db) {
|
|
|
13370
13376
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
13371
13377
|
`);
|
|
13372
13378
|
}
|
|
13373
|
-
function
|
|
13379
|
+
function up51(db) {
|
|
13374
13380
|
db.exec(`
|
|
13375
13381
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
13376
13382
|
session_key TEXT NOT NULL,
|
|
@@ -13387,7 +13393,7 @@ function hasTable(db, name) {
|
|
|
13387
13393
|
WHERE type = 'table' AND name = ?
|
|
13388
13394
|
LIMIT 1`).get(name) !== undefined;
|
|
13389
13395
|
}
|
|
13390
|
-
function
|
|
13396
|
+
function up52(db) {
|
|
13391
13397
|
db.exec(`
|
|
13392
13398
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
13393
13399
|
id TEXT PRIMARY KEY,
|
|
@@ -13557,7 +13563,7 @@ function addColumnIfMissing15(db, table, column, definition) {
|
|
|
13557
13563
|
return;
|
|
13558
13564
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13559
13565
|
}
|
|
13560
|
-
function
|
|
13566
|
+
function up53(db) {
|
|
13561
13567
|
addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
|
|
13562
13568
|
addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
13563
13569
|
addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -13649,7 +13655,7 @@ function up52(db) {
|
|
|
13649
13655
|
VALUES ('rebuild');
|
|
13650
13656
|
`);
|
|
13651
13657
|
}
|
|
13652
|
-
function
|
|
13658
|
+
function up54(db) {
|
|
13653
13659
|
db.exec(`
|
|
13654
13660
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
13655
13661
|
id TEXT PRIMARY KEY,
|
|
@@ -13666,7 +13672,7 @@ function up53(db) {
|
|
|
13666
13672
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
13667
13673
|
`);
|
|
13668
13674
|
}
|
|
13669
|
-
function
|
|
13675
|
+
function up55(db) {
|
|
13670
13676
|
db.exec(`
|
|
13671
13677
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
13672
13678
|
id TEXT PRIMARY KEY,
|
|
@@ -13682,7 +13688,7 @@ function up54(db) {
|
|
|
13682
13688
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
13683
13689
|
`);
|
|
13684
13690
|
}
|
|
13685
|
-
function
|
|
13691
|
+
function up56(db) {
|
|
13686
13692
|
db.exec(`
|
|
13687
13693
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
13688
13694
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -13713,7 +13719,7 @@ function up55(db) {
|
|
|
13713
13719
|
ON task_scope_hints(agent_id, updated_at);
|
|
13714
13720
|
`);
|
|
13715
13721
|
}
|
|
13716
|
-
function
|
|
13722
|
+
function up57(db) {
|
|
13717
13723
|
db.exec(`
|
|
13718
13724
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
13719
13725
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -13756,7 +13762,7 @@ function ensureMemoriesScopeColumns(db) {
|
|
|
13756
13762
|
if (!names.has("scope"))
|
|
13757
13763
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
13758
13764
|
}
|
|
13759
|
-
function
|
|
13765
|
+
function up58(db) {
|
|
13760
13766
|
ensureMemoriesScopeColumns(db);
|
|
13761
13767
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
13762
13768
|
db.exec(`
|
|
@@ -13769,20 +13775,20 @@ function up57(db) {
|
|
|
13769
13775
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
13770
13776
|
`);
|
|
13771
13777
|
}
|
|
13772
|
-
function
|
|
13778
|
+
function up59(db) {
|
|
13773
13779
|
const sql = readMemoriesFtsSql(db);
|
|
13774
13780
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair(sql))
|
|
13775
13781
|
return;
|
|
13776
13782
|
recreateMemoriesFts(db);
|
|
13777
13783
|
}
|
|
13778
|
-
function
|
|
13784
|
+
function up60(db) {
|
|
13779
13785
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
13780
13786
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
13781
13787
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
13782
13788
|
ON entities(entity_type, mentions)
|
|
13783
13789
|
WHERE entity_type = 'extracted'`);
|
|
13784
13790
|
}
|
|
13785
|
-
function
|
|
13791
|
+
function up61(db) {
|
|
13786
13792
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13787
13793
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
13788
13794
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -13791,7 +13797,7 @@ function up60(db) {
|
|
|
13791
13797
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
13792
13798
|
WHERE claim_key IS NOT NULL`);
|
|
13793
13799
|
}
|
|
13794
|
-
function
|
|
13800
|
+
function up62(db) {
|
|
13795
13801
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13796
13802
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
13797
13803
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -13803,13 +13809,13 @@ function up61(db) {
|
|
|
13803
13809
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
13804
13810
|
WHERE claim_key IS NOT NULL`);
|
|
13805
13811
|
}
|
|
13806
|
-
function
|
|
13812
|
+
function up63(db) {
|
|
13807
13813
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13808
13814
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
13809
13815
|
return;
|
|
13810
13816
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
13811
13817
|
}
|
|
13812
|
-
function
|
|
13818
|
+
function up64(db) {
|
|
13813
13819
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13814
13820
|
const names = new Set(cols.map((col) => col.name));
|
|
13815
13821
|
if (!names.has("is_deleted")) {
|
|
@@ -13823,7 +13829,7 @@ function up63(db) {
|
|
|
13823
13829
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
13824
13830
|
`);
|
|
13825
13831
|
}
|
|
13826
|
-
function
|
|
13832
|
+
function up65(db) {
|
|
13827
13833
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
13828
13834
|
db.exec(`
|
|
13829
13835
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -13841,7 +13847,7 @@ function addColumnIfMissing16(db, table, column, definition) {
|
|
|
13841
13847
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13842
13848
|
}
|
|
13843
13849
|
}
|
|
13844
|
-
function
|
|
13850
|
+
function up66(db) {
|
|
13845
13851
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
13846
13852
|
addColumnIfMissing16(db, table, "source_id", "TEXT");
|
|
13847
13853
|
addColumnIfMissing16(db, table, "source_kind", "TEXT");
|
|
@@ -13861,7 +13867,7 @@ function hasColumn7(db, table, column) {
|
|
|
13861
13867
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
13862
13868
|
return rows.some((row) => row.name === column);
|
|
13863
13869
|
}
|
|
13864
|
-
function
|
|
13870
|
+
function up67(db) {
|
|
13865
13871
|
if (!hasTable2(db, "embeddings"))
|
|
13866
13872
|
return;
|
|
13867
13873
|
if (!hasColumn7(db, "embeddings", "agent_id")) {
|
|
@@ -13869,7 +13875,7 @@ function up66(db) {
|
|
|
13869
13875
|
}
|
|
13870
13876
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
13871
13877
|
}
|
|
13872
|
-
function
|
|
13878
|
+
function up68(db) {
|
|
13873
13879
|
db.exec(`
|
|
13874
13880
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
13875
13881
|
id TEXT PRIMARY KEY,
|
|
@@ -13910,7 +13916,7 @@ function addColumnIfMissing17(db, table, column, definition) {
|
|
|
13910
13916
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13911
13917
|
}
|
|
13912
13918
|
}
|
|
13913
|
-
function
|
|
13919
|
+
function up69(db) {
|
|
13914
13920
|
db.exec(`
|
|
13915
13921
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
13916
13922
|
id TEXT PRIMARY KEY,
|
|
@@ -13953,7 +13959,7 @@ function up68(db) {
|
|
|
13953
13959
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
13954
13960
|
}
|
|
13955
13961
|
}
|
|
13956
|
-
function
|
|
13962
|
+
function up70(db) {
|
|
13957
13963
|
db.exec(`
|
|
13958
13964
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
13959
13965
|
id TEXT PRIMARY KEY,
|
|
@@ -13980,7 +13986,7 @@ function up69(db) {
|
|
|
13980
13986
|
WHERE content_key IS NOT NULL;
|
|
13981
13987
|
`);
|
|
13982
13988
|
}
|
|
13983
|
-
function
|
|
13989
|
+
function up71(db) {
|
|
13984
13990
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
13985
13991
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
13986
13992
|
if (!colNames.has("content_key")) {
|
|
@@ -14017,7 +14023,7 @@ function backfillVersionRoots(db) {
|
|
|
14017
14023
|
WHERE version_root_id IS NULL
|
|
14018
14024
|
`);
|
|
14019
14025
|
}
|
|
14020
|
-
function
|
|
14026
|
+
function up72(db) {
|
|
14021
14027
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
14022
14028
|
addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
14023
14029
|
addColumnIfMissing18(db, table, "archived_at", "TEXT");
|
|
@@ -14052,7 +14058,7 @@ function up71(db) {
|
|
|
14052
14058
|
ON entity_aspects(agent_id, proposal_id);
|
|
14053
14059
|
`);
|
|
14054
14060
|
}
|
|
14055
|
-
function
|
|
14061
|
+
function up73(db) {
|
|
14056
14062
|
db.exec(`
|
|
14057
14063
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
14058
14064
|
id TEXT PRIMARY KEY,
|
|
@@ -14108,7 +14114,7 @@ function ensureMemoriesScopeColumns2(db) {
|
|
|
14108
14114
|
if (!names.has("runtime_path"))
|
|
14109
14115
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
14110
14116
|
}
|
|
14111
|
-
function
|
|
14117
|
+
function up74(db) {
|
|
14112
14118
|
ensureMemoriesScopeColumns2(db);
|
|
14113
14119
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
14114
14120
|
db.exec(`
|
|
@@ -14122,7 +14128,7 @@ function up73(db) {
|
|
|
14122
14128
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
14123
14129
|
`);
|
|
14124
14130
|
}
|
|
14125
|
-
function
|
|
14131
|
+
function up75(db) {
|
|
14126
14132
|
db.exec(`
|
|
14127
14133
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
14128
14134
|
session_key TEXT NOT NULL,
|
|
@@ -14157,7 +14163,7 @@ function up74(db) {
|
|
|
14157
14163
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
14158
14164
|
`);
|
|
14159
14165
|
}
|
|
14160
|
-
function
|
|
14166
|
+
function up76(db) {
|
|
14161
14167
|
db.exec(`
|
|
14162
14168
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
14163
14169
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -14176,7 +14182,7 @@ function addColumnIfMissing19(db, table, column, definition) {
|
|
|
14176
14182
|
return;
|
|
14177
14183
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14178
14184
|
}
|
|
14179
|
-
function
|
|
14185
|
+
function up77(db) {
|
|
14180
14186
|
addColumnIfMissing19(db, "memory_artifacts", "source_id", "TEXT");
|
|
14181
14187
|
addColumnIfMissing19(db, "memory_artifacts", "source_root", "TEXT");
|
|
14182
14188
|
addColumnIfMissing19(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -14189,7 +14195,7 @@ function up76(db) {
|
|
|
14189
14195
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
14190
14196
|
`);
|
|
14191
14197
|
}
|
|
14192
|
-
function
|
|
14198
|
+
function up78(db) {
|
|
14193
14199
|
db.exec(`
|
|
14194
14200
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
14195
14201
|
id TEXT PRIMARY KEY,
|
|
@@ -14212,7 +14218,7 @@ function up77(db) {
|
|
|
14212
14218
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
14213
14219
|
`);
|
|
14214
14220
|
}
|
|
14215
|
-
function
|
|
14221
|
+
function up79(db) {
|
|
14216
14222
|
db.exec(`
|
|
14217
14223
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
14218
14224
|
id TEXT PRIMARY KEY,
|
|
@@ -14236,7 +14242,7 @@ function up78(db) {
|
|
|
14236
14242
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
14237
14243
|
`);
|
|
14238
14244
|
}
|
|
14239
|
-
function
|
|
14245
|
+
function up80(db) {
|
|
14240
14246
|
db.exec(`
|
|
14241
14247
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
14242
14248
|
id TEXT PRIMARY KEY,
|
|
@@ -14264,7 +14270,7 @@ function up79(db) {
|
|
|
14264
14270
|
ON api_keys(connector, harness);
|
|
14265
14271
|
`);
|
|
14266
14272
|
}
|
|
14267
|
-
function
|
|
14273
|
+
function up81(db) {
|
|
14268
14274
|
db.exec(`
|
|
14269
14275
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
14270
14276
|
id TEXT PRIMARY KEY,
|
|
@@ -14299,7 +14305,7 @@ function hasColumn10(db, table, column) {
|
|
|
14299
14305
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14300
14306
|
return rows.some((row) => row.name === column);
|
|
14301
14307
|
}
|
|
14302
|
-
function
|
|
14308
|
+
function up82(db) {
|
|
14303
14309
|
if (!hasColumn10(db, "documents", "agent_id")) {
|
|
14304
14310
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
14305
14311
|
}
|
|
@@ -14385,7 +14391,7 @@ function up81(db) {
|
|
|
14385
14391
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
14386
14392
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
14387
14393
|
}
|
|
14388
|
-
function
|
|
14394
|
+
function up83(db) {
|
|
14389
14395
|
db.exec(`
|
|
14390
14396
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
14391
14397
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -14407,7 +14413,7 @@ function hasColumn11(db, table, column) {
|
|
|
14407
14413
|
return rows.some((row) => row.name === column);
|
|
14408
14414
|
}
|
|
14409
14415
|
var COLUMNS = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
14410
|
-
function
|
|
14416
|
+
function up84(db) {
|
|
14411
14417
|
for (const column of COLUMNS) {
|
|
14412
14418
|
if (!hasColumn11(db, "skill_invocations", column)) {
|
|
14413
14419
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -14488,7 +14494,7 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14488
14494
|
`);
|
|
14489
14495
|
}
|
|
14490
14496
|
try {
|
|
14491
|
-
|
|
14497
|
+
up82(db);
|
|
14492
14498
|
if (preserveAgentId) {
|
|
14493
14499
|
db.exec(`
|
|
14494
14500
|
UPDATE documents
|
|
@@ -14508,12 +14514,12 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14508
14514
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
14509
14515
|
}
|
|
14510
14516
|
}
|
|
14511
|
-
function
|
|
14512
|
-
|
|
14517
|
+
function up85(db) {
|
|
14518
|
+
up81(db);
|
|
14513
14519
|
if (hasTable3(db, "documents")) {
|
|
14514
14520
|
documentScopeColumnsPreservingExisting(db);
|
|
14515
14521
|
}
|
|
14516
|
-
|
|
14522
|
+
up83(db);
|
|
14517
14523
|
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
14518
14524
|
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
14519
14525
|
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -14570,7 +14576,7 @@ function up84(db) {
|
|
|
14570
14576
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
14571
14577
|
`);
|
|
14572
14578
|
}
|
|
14573
|
-
function
|
|
14579
|
+
function up86(db) {
|
|
14574
14580
|
db.exec(`
|
|
14575
14581
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
14576
14582
|
path TEXT PRIMARY KEY,
|
|
@@ -14600,7 +14606,7 @@ function up85(db) {
|
|
|
14600
14606
|
ON legacy_markdown_chunks(memory_id);
|
|
14601
14607
|
`);
|
|
14602
14608
|
}
|
|
14603
|
-
function
|
|
14609
|
+
function up87(db) {
|
|
14604
14610
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
14605
14611
|
const tableNames = new Set(tables.map((r2) => String(r2.name)));
|
|
14606
14612
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -14659,7 +14665,7 @@ function addColumnIfMissing21(db, table, column, definition) {
|
|
|
14659
14665
|
return;
|
|
14660
14666
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14661
14667
|
}
|
|
14662
|
-
function
|
|
14668
|
+
function up88(db) {
|
|
14663
14669
|
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
14664
14670
|
db.exec(`
|
|
14665
14671
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -14672,14 +14678,14 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
14672
14678
|
return;
|
|
14673
14679
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14674
14680
|
}
|
|
14675
|
-
function
|
|
14681
|
+
function up89(db) {
|
|
14676
14682
|
addColumnIfMissing22(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
14677
14683
|
db.exec(`
|
|
14678
14684
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
14679
14685
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
14680
14686
|
`);
|
|
14681
14687
|
}
|
|
14682
|
-
function
|
|
14688
|
+
function up90(db) {
|
|
14683
14689
|
db.exec(`
|
|
14684
14690
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
14685
14691
|
agent_id TEXT NOT NULL,
|
|
@@ -14697,7 +14703,7 @@ function up89(db) {
|
|
|
14697
14703
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
14698
14704
|
`);
|
|
14699
14705
|
}
|
|
14700
|
-
function
|
|
14706
|
+
function up91(db) {
|
|
14701
14707
|
db.exec(`
|
|
14702
14708
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
14703
14709
|
id TEXT PRIMARY KEY,
|
|
@@ -14725,7 +14731,7 @@ function indexExists(db, table, indexName) {
|
|
|
14725
14731
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14726
14732
|
return rows.some((row) => row.name === indexName);
|
|
14727
14733
|
}
|
|
14728
|
-
function
|
|
14734
|
+
function up92(db) {
|
|
14729
14735
|
db.exec(`
|
|
14730
14736
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
14731
14737
|
id TEXT PRIMARY KEY,
|
|
@@ -14752,7 +14758,7 @@ function indexExists2(db, table, indexName) {
|
|
|
14752
14758
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14753
14759
|
return rows.some((row) => row.name === indexName);
|
|
14754
14760
|
}
|
|
14755
|
-
function
|
|
14761
|
+
function up93(db) {
|
|
14756
14762
|
db.exec(`
|
|
14757
14763
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
14758
14764
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -14765,7 +14771,7 @@ function up92(db) {
|
|
|
14765
14771
|
)
|
|
14766
14772
|
`);
|
|
14767
14773
|
}
|
|
14768
|
-
function
|
|
14774
|
+
function up94(db) {
|
|
14769
14775
|
db.exec(`
|
|
14770
14776
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
14771
14777
|
id TEXT PRIMARY KEY,
|
|
@@ -14784,7 +14790,7 @@ function up93(db) {
|
|
|
14784
14790
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
14785
14791
|
`);
|
|
14786
14792
|
}
|
|
14787
|
-
function
|
|
14793
|
+
function up95(db) {
|
|
14788
14794
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14789
14795
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
14790
14796
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -14795,7 +14801,7 @@ function hasColumn13(db, table, column) {
|
|
|
14795
14801
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14796
14802
|
return rows.some((r2) => r2.name === column);
|
|
14797
14803
|
}
|
|
14798
|
-
function
|
|
14804
|
+
function up96(db) {
|
|
14799
14805
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
14800
14806
|
if (tables.length === 0)
|
|
14801
14807
|
return;
|
|
@@ -14820,23 +14826,23 @@ function up95(db) {
|
|
|
14820
14826
|
function hasColumn14(db, table, column) {
|
|
14821
14827
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14822
14828
|
}
|
|
14823
|
-
function
|
|
14829
|
+
function up97(db) {
|
|
14824
14830
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
14825
14831
|
if (!hasMemories || !hasColumn14(db, "memories", "memory_kind") || !hasColumn14(db, "memories", "type"))
|
|
14826
14832
|
return;
|
|
14827
14833
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
14828
14834
|
}
|
|
14829
|
-
function
|
|
14835
|
+
function up98(db) {
|
|
14830
14836
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
14831
14837
|
}
|
|
14832
|
-
function
|
|
14838
|
+
function up99(db) {
|
|
14833
14839
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14834
14840
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
14835
14841
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
14836
14842
|
}
|
|
14837
14843
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
14838
14844
|
}
|
|
14839
|
-
function
|
|
14845
|
+
function up100(db) {
|
|
14840
14846
|
db.exec(`
|
|
14841
14847
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
14842
14848
|
agent_id TEXT NOT NULL,
|
|
@@ -14853,7 +14859,7 @@ function up99(db) {
|
|
|
14853
14859
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
14854
14860
|
`);
|
|
14855
14861
|
}
|
|
14856
|
-
function
|
|
14862
|
+
function up101(db) {
|
|
14857
14863
|
db.exec(`
|
|
14858
14864
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
14859
14865
|
id TEXT PRIMARY KEY,
|
|
@@ -14873,7 +14879,7 @@ function up100(db) {
|
|
|
14873
14879
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
14874
14880
|
`);
|
|
14875
14881
|
}
|
|
14876
|
-
function
|
|
14882
|
+
function up102(db) {
|
|
14877
14883
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
14878
14884
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
14879
14885
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -14882,7 +14888,7 @@ function up101(db) {
|
|
|
14882
14888
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
14883
14889
|
}
|
|
14884
14890
|
}
|
|
14885
|
-
function
|
|
14891
|
+
function up103(db) {
|
|
14886
14892
|
db.exec(`
|
|
14887
14893
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
14888
14894
|
id TEXT PRIMARY KEY,
|
|
@@ -14904,7 +14910,7 @@ function up102(db) {
|
|
|
14904
14910
|
function hasColumn15(db, table, column) {
|
|
14905
14911
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14906
14912
|
}
|
|
14907
|
-
function
|
|
14913
|
+
function up104(db) {
|
|
14908
14914
|
const requiredMemoryColumns = [
|
|
14909
14915
|
"content_hash",
|
|
14910
14916
|
"normalized_content",
|
|
@@ -14955,7 +14961,7 @@ function up103(db) {
|
|
|
14955
14961
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
14956
14962
|
`);
|
|
14957
14963
|
}
|
|
14958
|
-
function
|
|
14964
|
+
function up105(db) {
|
|
14959
14965
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
14960
14966
|
if (tables.length !== 2)
|
|
14961
14967
|
return;
|
|
@@ -14978,7 +14984,7 @@ function tableExists(db, table) {
|
|
|
14978
14984
|
function hasColumn16(db, table, column) {
|
|
14979
14985
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14980
14986
|
}
|
|
14981
|
-
function
|
|
14987
|
+
function up106(db) {
|
|
14982
14988
|
db.exec(`
|
|
14983
14989
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
14984
14990
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -15021,7 +15027,7 @@ function up105(db) {
|
|
|
15021
15027
|
`);
|
|
15022
15028
|
}
|
|
15023
15029
|
}
|
|
15024
|
-
function
|
|
15030
|
+
function up107(db) {
|
|
15025
15031
|
db.exec(`
|
|
15026
15032
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
15027
15033
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -15110,7 +15116,7 @@ function up106(db) {
|
|
|
15110
15116
|
function hasColumn17(db, table, column) {
|
|
15111
15117
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
15112
15118
|
}
|
|
15113
|
-
function
|
|
15119
|
+
function up108(db) {
|
|
15114
15120
|
if (!hasColumn17(db, "memories", "review_after")) {
|
|
15115
15121
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
15116
15122
|
}
|
|
@@ -15126,14 +15132,14 @@ var TOKEN_COLUMNS = [
|
|
|
15126
15132
|
["tokens_cache_write", "INTEGER"],
|
|
15127
15133
|
["tokens_cost", "REAL"]
|
|
15128
15134
|
];
|
|
15129
|
-
function
|
|
15135
|
+
function up109(db) {
|
|
15130
15136
|
for (const [column, type] of TOKEN_COLUMNS) {
|
|
15131
15137
|
if (!hasColumn18(db, "dreaming_passes", column)) {
|
|
15132
15138
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
15133
15139
|
}
|
|
15134
15140
|
}
|
|
15135
15141
|
}
|
|
15136
|
-
function
|
|
15142
|
+
function up110(db) {
|
|
15137
15143
|
db.exec(`
|
|
15138
15144
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
15139
15145
|
day TEXT NOT NULL,
|
|
@@ -15146,7 +15152,7 @@ function up109(db) {
|
|
|
15146
15152
|
);
|
|
15147
15153
|
`);
|
|
15148
15154
|
}
|
|
15149
|
-
function
|
|
15155
|
+
function up111(db) {
|
|
15150
15156
|
db.exec(`
|
|
15151
15157
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
15152
15158
|
id TEXT PRIMARY KEY,
|
|
@@ -15154,7 +15160,7 @@ function up110(db) {
|
|
|
15154
15160
|
);
|
|
15155
15161
|
`);
|
|
15156
15162
|
}
|
|
15157
|
-
function
|
|
15163
|
+
function up112(db) {
|
|
15158
15164
|
db.exec(`
|
|
15159
15165
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
15160
15166
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -15165,7 +15171,7 @@ function hasColumn19(db, table, column) {
|
|
|
15165
15171
|
return rows.some((row) => row.name === column);
|
|
15166
15172
|
}
|
|
15167
15173
|
var COLUMNS2 = ["first_remember_at", "first_recall_at"];
|
|
15168
|
-
function
|
|
15174
|
+
function up113(db) {
|
|
15169
15175
|
for (const column of COLUMNS2) {
|
|
15170
15176
|
if (!hasColumn19(db, "telemetry_install", column)) {
|
|
15171
15177
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -15181,7 +15187,7 @@ function addColumnIfMissing23(db, column, definition) {
|
|
|
15181
15187
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
15182
15188
|
}
|
|
15183
15189
|
}
|
|
15184
|
-
function
|
|
15190
|
+
function up114(db) {
|
|
15185
15191
|
addColumnIfMissing23(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
15186
15192
|
addColumnIfMissing23(db, "claim_token", "TEXT");
|
|
15187
15193
|
addColumnIfMissing23(db, "claimed_at", "TEXT");
|
|
@@ -15190,7 +15196,7 @@ function up113(db) {
|
|
|
15190
15196
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
15191
15197
|
`);
|
|
15192
15198
|
}
|
|
15193
|
-
function
|
|
15199
|
+
function up115(db) {
|
|
15194
15200
|
db.exec(`
|
|
15195
15201
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
15196
15202
|
session_key TEXT NOT NULL,
|
|
@@ -15211,7 +15217,7 @@ function up114(db) {
|
|
|
15211
15217
|
ON session_claims(agent_id, state, expires_at);
|
|
15212
15218
|
`);
|
|
15213
15219
|
}
|
|
15214
|
-
function
|
|
15220
|
+
function up116(db) {
|
|
15215
15221
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
15216
15222
|
if (table == null)
|
|
15217
15223
|
return;
|
|
@@ -15220,7 +15226,7 @@ function up115(db) {
|
|
|
15220
15226
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
15221
15227
|
`);
|
|
15222
15228
|
}
|
|
15223
|
-
function
|
|
15229
|
+
function up117(db) {
|
|
15224
15230
|
db.exec(`
|
|
15225
15231
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
15226
15232
|
id TEXT PRIMARY KEY,
|
|
@@ -15277,7 +15283,7 @@ function addColumnIfMissing24(db, column, definition) {
|
|
|
15277
15283
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
15278
15284
|
}
|
|
15279
15285
|
}
|
|
15280
|
-
function
|
|
15286
|
+
function up118(db) {
|
|
15281
15287
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
15282
15288
|
if (table == null)
|
|
15283
15289
|
return;
|
|
@@ -15478,7 +15484,7 @@ function backfillTranscriptsFromSummaryJobs(db) {
|
|
|
15478
15484
|
insert.run(...values);
|
|
15479
15485
|
}
|
|
15480
15486
|
}
|
|
15481
|
-
function
|
|
15487
|
+
function up119(db) {
|
|
15482
15488
|
if (!hasTable4(db, "session_transcripts"))
|
|
15483
15489
|
return;
|
|
15484
15490
|
addColumnIfMissing25(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -15531,7 +15537,7 @@ function up118(db) {
|
|
|
15531
15537
|
ON session_transcripts(agent_id, content_hash);
|
|
15532
15538
|
`);
|
|
15533
15539
|
}
|
|
15534
|
-
function
|
|
15540
|
+
function up120(db) {
|
|
15535
15541
|
db.exec(`
|
|
15536
15542
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
15537
15543
|
ON memory_jobs(status)
|
|
@@ -15550,12 +15556,12 @@ function up119(db) {
|
|
|
15550
15556
|
function hasColumn22(db, table, column) {
|
|
15551
15557
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
15552
15558
|
}
|
|
15553
|
-
function
|
|
15559
|
+
function up121(db) {
|
|
15554
15560
|
if (!hasColumn22(db, "telemetry_install", "last_seen_version")) {
|
|
15555
15561
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
15556
15562
|
}
|
|
15557
15563
|
}
|
|
15558
|
-
function
|
|
15564
|
+
function up122(db) {
|
|
15559
15565
|
db.exec(`
|
|
15560
15566
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
15561
15567
|
agent_id TEXT NOT NULL,
|
|
@@ -15584,7 +15590,7 @@ function addColumnIfMissing26(db, column, definition) {
|
|
|
15584
15590
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
15585
15591
|
}
|
|
15586
15592
|
}
|
|
15587
|
-
function
|
|
15593
|
+
function up123(db) {
|
|
15588
15594
|
addColumnIfMissing26(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
15589
15595
|
addColumnIfMissing26(db, "last_attempt_at", "TEXT");
|
|
15590
15596
|
addColumnIfMissing26(db, "sent_at", "TEXT");
|
|
@@ -15605,7 +15611,7 @@ function up122(db) {
|
|
|
15605
15611
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
15606
15612
|
`);
|
|
15607
15613
|
}
|
|
15608
|
-
function
|
|
15614
|
+
function up124(db) {
|
|
15609
15615
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
15610
15616
|
const names = new Set(columns.map((column) => column.name));
|
|
15611
15617
|
if (!names.has("failure_class")) {
|
|
@@ -15622,7 +15628,7 @@ function up123(db) {
|
|
|
15622
15628
|
}
|
|
15623
15629
|
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)");
|
|
15624
15630
|
}
|
|
15625
|
-
function
|
|
15631
|
+
function up125(db) {
|
|
15626
15632
|
db.exec(`
|
|
15627
15633
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
15628
15634
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -15646,7 +15652,7 @@ function up124(db) {
|
|
|
15646
15652
|
ON embedding_index_failures(source_type, source_id);
|
|
15647
15653
|
`);
|
|
15648
15654
|
}
|
|
15649
|
-
function
|
|
15655
|
+
function up126(db) {
|
|
15650
15656
|
db.exec(`
|
|
15651
15657
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
15652
15658
|
id TEXT PRIMARY KEY,
|
|
@@ -15696,7 +15702,7 @@ function backfillTable(db, params) {
|
|
|
15696
15702
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
15697
15703
|
backfill(db, rows, params.sourceKind, params.scannedAt);
|
|
15698
15704
|
}
|
|
15699
|
-
function
|
|
15705
|
+
function up127(db) {
|
|
15700
15706
|
db.exec(`
|
|
15701
15707
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
15702
15708
|
agent_id TEXT NOT NULL,
|
|
@@ -15753,7 +15759,7 @@ function up126(db) {
|
|
|
15753
15759
|
scannedAt
|
|
15754
15760
|
});
|
|
15755
15761
|
}
|
|
15756
|
-
function
|
|
15762
|
+
function up128(db) {
|
|
15757
15763
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
15758
15764
|
if (!table)
|
|
15759
15765
|
return;
|
|
@@ -15787,7 +15793,7 @@ function up127(db) {
|
|
|
15787
15793
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
15788
15794
|
`);
|
|
15789
15795
|
}
|
|
15790
|
-
function
|
|
15796
|
+
function up129(db) {
|
|
15791
15797
|
db.exec(`
|
|
15792
15798
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
15793
15799
|
id TEXT PRIMARY KEY,
|
|
@@ -15843,7 +15849,7 @@ function up128(db) {
|
|
|
15843
15849
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
15844
15850
|
`);
|
|
15845
15851
|
}
|
|
15846
|
-
function
|
|
15852
|
+
function up130(db) {
|
|
15847
15853
|
db.exec(`
|
|
15848
15854
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
15849
15855
|
ON memory_jobs(status, created_at)
|
|
@@ -15858,7 +15864,7 @@ function up129(db) {
|
|
|
15858
15864
|
function tableExists3(db, table) {
|
|
15859
15865
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
15860
15866
|
}
|
|
15861
|
-
function
|
|
15867
|
+
function up131(db) {
|
|
15862
15868
|
if (!tableExists3(db, "memory_jobs"))
|
|
15863
15869
|
return;
|
|
15864
15870
|
if (!tableExists3(db, "job_cancellations")) {
|
|
@@ -15907,7 +15913,7 @@ function up130(db) {
|
|
|
15907
15913
|
AND status IN ('pending', 'leased');
|
|
15908
15914
|
`);
|
|
15909
15915
|
}
|
|
15910
|
-
function
|
|
15916
|
+
function up132(db) {
|
|
15911
15917
|
db.exec(`
|
|
15912
15918
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
15913
15919
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -15947,7 +15953,7 @@ function up131(db) {
|
|
|
15947
15953
|
END;
|
|
15948
15954
|
`);
|
|
15949
15955
|
}
|
|
15950
|
-
function
|
|
15956
|
+
function up133(db) {
|
|
15951
15957
|
db.exec(`
|
|
15952
15958
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
15953
15959
|
agent_id TEXT NOT NULL,
|
|
@@ -15970,13 +15976,13 @@ function up132(db) {
|
|
|
15970
15976
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
15971
15977
|
`);
|
|
15972
15978
|
}
|
|
15973
|
-
function
|
|
15979
|
+
function up134(db) {
|
|
15974
15980
|
db.exec(`
|
|
15975
15981
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
15976
15982
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
15977
15983
|
`);
|
|
15978
15984
|
}
|
|
15979
|
-
function
|
|
15985
|
+
function up135(db) {
|
|
15980
15986
|
db.exec(`
|
|
15981
15987
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
15982
15988
|
id TEXT PRIMARY KEY,
|
|
@@ -16028,7 +16034,7 @@ function up134(db) {
|
|
|
16028
16034
|
if (!names.has("format_version"))
|
|
16029
16035
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
16030
16036
|
}
|
|
16031
|
-
function
|
|
16037
|
+
function up136(db) {
|
|
16032
16038
|
db.exec(`
|
|
16033
16039
|
CREATE TABLE memory_head_entries_v134 (
|
|
16034
16040
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -16046,7 +16052,7 @@ function up135(db) {
|
|
|
16046
16052
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
16047
16053
|
`);
|
|
16048
16054
|
}
|
|
16049
|
-
function
|
|
16055
|
+
function up137(db) {
|
|
16050
16056
|
db.exec(`
|
|
16051
16057
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
16052
16058
|
agent_id TEXT NOT NULL,
|
|
@@ -16062,7 +16068,7 @@ function up136(db) {
|
|
|
16062
16068
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
16063
16069
|
`);
|
|
16064
16070
|
}
|
|
16065
|
-
function
|
|
16071
|
+
function up138(db) {
|
|
16066
16072
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
|
|
16067
16073
|
for (const [name, type] of [
|
|
16068
16074
|
["entry_id", "TEXT"],
|
|
@@ -16076,7 +16082,7 @@ function up137(db) {
|
|
|
16076
16082
|
}
|
|
16077
16083
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
16078
16084
|
}
|
|
16079
|
-
function
|
|
16085
|
+
function up139(db) {
|
|
16080
16086
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
|
|
16081
16087
|
for (const [name, type] of [
|
|
16082
16088
|
["head_revision", "INTEGER"],
|
|
@@ -16098,7 +16104,7 @@ function addColumnIfMissing27(db, table, column, definition) {
|
|
|
16098
16104
|
if (!hasColumn25(db, table, column))
|
|
16099
16105
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
16100
16106
|
}
|
|
16101
|
-
function
|
|
16107
|
+
function up140(db) {
|
|
16102
16108
|
addColumnIfMissing27(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
16103
16109
|
db.exec(`
|
|
16104
16110
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -16403,7 +16409,7 @@ function up139(db) {
|
|
|
16403
16409
|
GROUP BY j.agent_id;
|
|
16404
16410
|
`);
|
|
16405
16411
|
}
|
|
16406
|
-
function
|
|
16412
|
+
function up141(db) {
|
|
16407
16413
|
db.exec(`
|
|
16408
16414
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
16409
16415
|
agent_id TEXT NOT NULL,
|
|
@@ -16419,7 +16425,7 @@ function up140(db) {
|
|
|
16419
16425
|
ON native_source_sync_state(agent_id, status);
|
|
16420
16426
|
`);
|
|
16421
16427
|
}
|
|
16422
|
-
function
|
|
16428
|
+
function up142(db) {
|
|
16423
16429
|
db.exec(`
|
|
16424
16430
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
16425
16431
|
agent_id TEXT NOT NULL,
|
|
@@ -16431,7 +16437,7 @@ function up141(db) {
|
|
|
16431
16437
|
);
|
|
16432
16438
|
`);
|
|
16433
16439
|
}
|
|
16434
|
-
function
|
|
16440
|
+
function up143(db) {
|
|
16435
16441
|
db.exec(`
|
|
16436
16442
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
16437
16443
|
agent_id TEXT NOT NULL,
|
|
@@ -16445,13 +16451,13 @@ function up142(db) {
|
|
|
16445
16451
|
);
|
|
16446
16452
|
`);
|
|
16447
16453
|
}
|
|
16448
|
-
function
|
|
16454
|
+
function up144(db) {
|
|
16449
16455
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
16450
16456
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
16451
16457
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
16452
16458
|
}
|
|
16453
16459
|
}
|
|
16454
|
-
function
|
|
16460
|
+
function up145(db) {
|
|
16455
16461
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16456
16462
|
const additions = [
|
|
16457
16463
|
["migration_phase", "TEXT"],
|
|
@@ -16486,13 +16492,13 @@ function up144(db) {
|
|
|
16486
16492
|
`);
|
|
16487
16493
|
}
|
|
16488
16494
|
}
|
|
16489
|
-
function
|
|
16495
|
+
function up146(db) {
|
|
16490
16496
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16491
16497
|
if (!columns.has("lease_token")) {
|
|
16492
16498
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
16493
16499
|
}
|
|
16494
16500
|
}
|
|
16495
|
-
function
|
|
16501
|
+
function up147(db) {
|
|
16496
16502
|
db.exec(`
|
|
16497
16503
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
16498
16504
|
agent_id TEXT NOT NULL,
|
|
@@ -16510,7 +16516,7 @@ function up146(db) {
|
|
|
16510
16516
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
16511
16517
|
`);
|
|
16512
16518
|
}
|
|
16513
|
-
function
|
|
16519
|
+
function up148(db) {
|
|
16514
16520
|
db.exec(`
|
|
16515
16521
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
16516
16522
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -16577,16 +16583,16 @@ function up147(db) {
|
|
|
16577
16583
|
}
|
|
16578
16584
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
16579
16585
|
}
|
|
16580
|
-
function
|
|
16586
|
+
function up149(db) {
|
|
16581
16587
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
16582
16588
|
}
|
|
16583
|
-
function
|
|
16589
|
+
function up150(db) {
|
|
16584
16590
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
16585
16591
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
16586
16592
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
16587
16593
|
}
|
|
16588
16594
|
}
|
|
16589
|
-
function
|
|
16595
|
+
function up151(db) {
|
|
16590
16596
|
const addColumn = (table, column, definition) => {
|
|
16591
16597
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
16592
16598
|
let exists;
|
|
@@ -16607,7 +16613,7 @@ function addColumnIfMissing28(db, table, column, definition) {
|
|
|
16607
16613
|
if (!columns.some((row) => row.name === column))
|
|
16608
16614
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
16609
16615
|
}
|
|
16610
|
-
function
|
|
16616
|
+
function up152(db) {
|
|
16611
16617
|
addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
16612
16618
|
addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
16613
16619
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -16761,13 +16767,13 @@ var MIGRATIONS = [
|
|
|
16761
16767
|
{
|
|
16762
16768
|
version: 1,
|
|
16763
16769
|
name: "baseline",
|
|
16764
|
-
up:
|
|
16770
|
+
up: up3,
|
|
16765
16771
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
16766
16772
|
},
|
|
16767
16773
|
{
|
|
16768
16774
|
version: 2,
|
|
16769
16775
|
name: "pipeline-v2",
|
|
16770
|
-
up:
|
|
16776
|
+
up: up4,
|
|
16771
16777
|
artifacts: {
|
|
16772
16778
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
16773
16779
|
}
|
|
@@ -16775,12 +16781,12 @@ var MIGRATIONS = [
|
|
|
16775
16781
|
{
|
|
16776
16782
|
version: 3,
|
|
16777
16783
|
name: "unique-content-hash",
|
|
16778
|
-
up:
|
|
16784
|
+
up: up5
|
|
16779
16785
|
},
|
|
16780
16786
|
{
|
|
16781
16787
|
version: 4,
|
|
16782
16788
|
name: "history-actor-and-retention",
|
|
16783
|
-
up:
|
|
16789
|
+
up: up6,
|
|
16784
16790
|
artifacts: {
|
|
16785
16791
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
16786
16792
|
}
|
|
@@ -16788,7 +16794,7 @@ var MIGRATIONS = [
|
|
|
16788
16794
|
{
|
|
16789
16795
|
version: 5,
|
|
16790
16796
|
name: "graph-extended",
|
|
16791
|
-
up:
|
|
16797
|
+
up: up7,
|
|
16792
16798
|
artifacts: {
|
|
16793
16799
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
16794
16800
|
}
|
|
@@ -16796,7 +16802,7 @@ var MIGRATIONS = [
|
|
|
16796
16802
|
{
|
|
16797
16803
|
version: 6,
|
|
16798
16804
|
name: "idempotency-key",
|
|
16799
|
-
up:
|
|
16805
|
+
up: up8,
|
|
16800
16806
|
artifacts: {
|
|
16801
16807
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
16802
16808
|
}
|
|
@@ -16804,42 +16810,42 @@ var MIGRATIONS = [
|
|
|
16804
16810
|
{
|
|
16805
16811
|
version: 7,
|
|
16806
16812
|
name: "documents-and-connectors",
|
|
16807
|
-
up:
|
|
16813
|
+
up: up9,
|
|
16808
16814
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
16809
16815
|
},
|
|
16810
16816
|
{
|
|
16811
16817
|
version: 8,
|
|
16812
16818
|
name: "embeddings-unique-hash",
|
|
16813
|
-
up:
|
|
16819
|
+
up: up10
|
|
16814
16820
|
},
|
|
16815
16821
|
{
|
|
16816
16822
|
version: 9,
|
|
16817
16823
|
name: "summary-jobs",
|
|
16818
|
-
up:
|
|
16824
|
+
up: up11,
|
|
16819
16825
|
artifacts: { tables: ["summary_jobs"] }
|
|
16820
16826
|
},
|
|
16821
16827
|
{
|
|
16822
16828
|
version: 10,
|
|
16823
16829
|
name: "umap-cache",
|
|
16824
|
-
up:
|
|
16830
|
+
up: up12,
|
|
16825
16831
|
artifacts: { tables: ["umap_cache"] }
|
|
16826
16832
|
},
|
|
16827
16833
|
{
|
|
16828
16834
|
version: 11,
|
|
16829
16835
|
name: "session-scores",
|
|
16830
|
-
up:
|
|
16836
|
+
up: up13,
|
|
16831
16837
|
artifacts: { tables: ["session_scores"] }
|
|
16832
16838
|
},
|
|
16833
16839
|
{
|
|
16834
16840
|
version: 12,
|
|
16835
16841
|
name: "scheduled-tasks",
|
|
16836
|
-
up:
|
|
16842
|
+
up: up14,
|
|
16837
16843
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
16838
16844
|
},
|
|
16839
16845
|
{
|
|
16840
16846
|
version: 13,
|
|
16841
16847
|
name: "ingestion-tracking",
|
|
16842
|
-
up:
|
|
16848
|
+
up: up15,
|
|
16843
16849
|
artifacts: {
|
|
16844
16850
|
columns: [
|
|
16845
16851
|
{ table: "memories", column: "source_path" },
|
|
@@ -16850,13 +16856,13 @@ var MIGRATIONS = [
|
|
|
16850
16856
|
{
|
|
16851
16857
|
version: 14,
|
|
16852
16858
|
name: "telemetry",
|
|
16853
|
-
up:
|
|
16859
|
+
up: up16,
|
|
16854
16860
|
artifacts: { tables: ["telemetry_events"] }
|
|
16855
16861
|
},
|
|
16856
16862
|
{
|
|
16857
16863
|
version: 15,
|
|
16858
16864
|
name: "session-memories",
|
|
16859
|
-
up:
|
|
16865
|
+
up: up17,
|
|
16860
16866
|
artifacts: {
|
|
16861
16867
|
tables: ["session_memories"],
|
|
16862
16868
|
columns: [
|
|
@@ -16868,13 +16874,13 @@ var MIGRATIONS = [
|
|
|
16868
16874
|
{
|
|
16869
16875
|
version: 16,
|
|
16870
16876
|
name: "session-checkpoints",
|
|
16871
|
-
up:
|
|
16877
|
+
up: up18,
|
|
16872
16878
|
artifacts: { tables: ["session_checkpoints"] }
|
|
16873
16879
|
},
|
|
16874
16880
|
{
|
|
16875
16881
|
version: 17,
|
|
16876
16882
|
name: "task-skills",
|
|
16877
|
-
up:
|
|
16883
|
+
up: up19,
|
|
16878
16884
|
artifacts: {
|
|
16879
16885
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
16880
16886
|
}
|
|
@@ -16882,13 +16888,13 @@ var MIGRATIONS = [
|
|
|
16882
16888
|
{
|
|
16883
16889
|
version: 18,
|
|
16884
16890
|
name: "skill-meta",
|
|
16885
|
-
up:
|
|
16891
|
+
up: up20,
|
|
16886
16892
|
artifacts: { tables: ["skill_meta"] }
|
|
16887
16893
|
},
|
|
16888
16894
|
{
|
|
16889
16895
|
version: 19,
|
|
16890
16896
|
name: "knowledge-structure",
|
|
16891
|
-
up:
|
|
16897
|
+
up: up21,
|
|
16892
16898
|
artifacts: {
|
|
16893
16899
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
16894
16900
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -16897,7 +16903,7 @@ var MIGRATIONS = [
|
|
|
16897
16903
|
{
|
|
16898
16904
|
version: 20,
|
|
16899
16905
|
name: "session-structural-columns",
|
|
16900
|
-
up:
|
|
16906
|
+
up: up22,
|
|
16901
16907
|
artifacts: {
|
|
16902
16908
|
columns: [
|
|
16903
16909
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -16910,7 +16916,7 @@ var MIGRATIONS = [
|
|
|
16910
16916
|
{
|
|
16911
16917
|
version: 21,
|
|
16912
16918
|
name: "checkpoint-structural",
|
|
16913
|
-
up:
|
|
16919
|
+
up: up23,
|
|
16914
16920
|
artifacts: {
|
|
16915
16921
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
16916
16922
|
}
|
|
@@ -16918,7 +16924,7 @@ var MIGRATIONS = [
|
|
|
16918
16924
|
{
|
|
16919
16925
|
version: 22,
|
|
16920
16926
|
name: "entity-pinning",
|
|
16921
|
-
up:
|
|
16927
|
+
up: up24,
|
|
16922
16928
|
artifacts: {
|
|
16923
16929
|
columns: [
|
|
16924
16930
|
{ table: "entities", column: "pinned" },
|
|
@@ -16929,17 +16935,17 @@ var MIGRATIONS = [
|
|
|
16929
16935
|
{
|
|
16930
16936
|
version: 23,
|
|
16931
16937
|
name: "retired-scorer-gap",
|
|
16932
|
-
up:
|
|
16938
|
+
up: up25
|
|
16933
16939
|
},
|
|
16934
16940
|
{
|
|
16935
16941
|
version: 24,
|
|
16936
16942
|
name: "retired-scorer-gap",
|
|
16937
|
-
up:
|
|
16943
|
+
up: up26
|
|
16938
16944
|
},
|
|
16939
16945
|
{
|
|
16940
16946
|
version: 25,
|
|
16941
16947
|
name: "agent-feedback",
|
|
16942
|
-
up:
|
|
16948
|
+
up: up27,
|
|
16943
16949
|
artifacts: {
|
|
16944
16950
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
16945
16951
|
}
|
|
@@ -16947,32 +16953,32 @@ var MIGRATIONS = [
|
|
|
16947
16953
|
{
|
|
16948
16954
|
version: 26,
|
|
16949
16955
|
name: "retired-scorer-gap",
|
|
16950
|
-
up:
|
|
16956
|
+
up: up28
|
|
16951
16957
|
},
|
|
16952
16958
|
{
|
|
16953
16959
|
version: 27,
|
|
16954
16960
|
name: "backfill-canonical-names",
|
|
16955
|
-
up:
|
|
16961
|
+
up: up29
|
|
16956
16962
|
},
|
|
16957
16963
|
{
|
|
16958
16964
|
version: 28,
|
|
16959
16965
|
name: "lossless-retention",
|
|
16960
|
-
up:
|
|
16966
|
+
up: up30
|
|
16961
16967
|
},
|
|
16962
16968
|
{
|
|
16963
16969
|
version: 29,
|
|
16964
16970
|
name: "session-summary-dag",
|
|
16965
|
-
up:
|
|
16971
|
+
up: up31
|
|
16966
16972
|
},
|
|
16967
16973
|
{
|
|
16968
16974
|
version: 30,
|
|
16969
16975
|
name: "nullable-memory-job-memory-id",
|
|
16970
|
-
up:
|
|
16976
|
+
up: up32
|
|
16971
16977
|
},
|
|
16972
16978
|
{
|
|
16973
16979
|
version: 31,
|
|
16974
16980
|
name: "dependency-reason",
|
|
16975
|
-
up:
|
|
16981
|
+
up: up33,
|
|
16976
16982
|
artifacts: {
|
|
16977
16983
|
columns: [
|
|
16978
16984
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -16983,7 +16989,7 @@ var MIGRATIONS = [
|
|
|
16983
16989
|
{
|
|
16984
16990
|
version: 32,
|
|
16985
16991
|
name: "embeddings-vector-column",
|
|
16986
|
-
up:
|
|
16992
|
+
up: up34,
|
|
16987
16993
|
artifacts: {
|
|
16988
16994
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
16989
16995
|
}
|
|
@@ -16991,7 +16997,7 @@ var MIGRATIONS = [
|
|
|
16991
16997
|
{
|
|
16992
16998
|
version: 33,
|
|
16993
16999
|
name: "scope",
|
|
16994
|
-
up:
|
|
17000
|
+
up: up35,
|
|
16995
17001
|
artifacts: {
|
|
16996
17002
|
columns: [{ table: "memories", column: "scope" }]
|
|
16997
17003
|
}
|
|
@@ -16999,17 +17005,17 @@ var MIGRATIONS = [
|
|
|
16999
17005
|
{
|
|
17000
17006
|
version: 34,
|
|
17001
17007
|
name: "scope-aware-dedup",
|
|
17002
|
-
up:
|
|
17008
|
+
up: up36
|
|
17003
17009
|
},
|
|
17004
17010
|
{
|
|
17005
17011
|
version: 35,
|
|
17006
17012
|
name: "entity-fts",
|
|
17007
|
-
up:
|
|
17013
|
+
up: up37
|
|
17008
17014
|
},
|
|
17009
17015
|
{
|
|
17010
17016
|
version: 36,
|
|
17011
17017
|
name: "dependency-confidence",
|
|
17012
|
-
up:
|
|
17018
|
+
up: up38,
|
|
17013
17019
|
artifacts: {
|
|
17014
17020
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
17015
17021
|
}
|
|
@@ -17017,7 +17023,7 @@ var MIGRATIONS = [
|
|
|
17017
17023
|
{
|
|
17018
17024
|
version: 37,
|
|
17019
17025
|
name: "entity-communities",
|
|
17020
|
-
up:
|
|
17026
|
+
up: up39,
|
|
17021
17027
|
artifacts: {
|
|
17022
17028
|
tables: ["entity_communities"],
|
|
17023
17029
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -17026,24 +17032,24 @@ var MIGRATIONS = [
|
|
|
17026
17032
|
{
|
|
17027
17033
|
version: 38,
|
|
17028
17034
|
name: "memory-hints",
|
|
17029
|
-
up:
|
|
17035
|
+
up: up40,
|
|
17030
17036
|
artifacts: { tables: ["memory_hints"] }
|
|
17031
17037
|
},
|
|
17032
17038
|
{
|
|
17033
17039
|
version: 39,
|
|
17034
17040
|
name: "dedup-entity-dependencies",
|
|
17035
|
-
up:
|
|
17041
|
+
up: up41
|
|
17036
17042
|
},
|
|
17037
17043
|
{
|
|
17038
17044
|
version: 40,
|
|
17039
17045
|
name: "session-transcripts",
|
|
17040
|
-
up:
|
|
17046
|
+
up: up42,
|
|
17041
17047
|
artifacts: { tables: ["session_transcripts"] }
|
|
17042
17048
|
},
|
|
17043
17049
|
{
|
|
17044
17050
|
version: 41,
|
|
17045
17051
|
name: "path-feedback",
|
|
17046
|
-
up:
|
|
17052
|
+
up: up43,
|
|
17047
17053
|
artifacts: {
|
|
17048
17054
|
tables: [
|
|
17049
17055
|
"path_feedback_events",
|
|
@@ -17058,7 +17064,7 @@ var MIGRATIONS = [
|
|
|
17058
17064
|
{
|
|
17059
17065
|
version: 42,
|
|
17060
17066
|
name: "session-memories-agent-id",
|
|
17061
|
-
up:
|
|
17067
|
+
up: up44,
|
|
17062
17068
|
artifacts: {
|
|
17063
17069
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
17064
17070
|
}
|
|
@@ -17066,7 +17072,7 @@ var MIGRATIONS = [
|
|
|
17066
17072
|
{
|
|
17067
17073
|
version: 43,
|
|
17068
17074
|
name: "agents-table",
|
|
17069
|
-
up:
|
|
17075
|
+
up: up45,
|
|
17070
17076
|
artifacts: {
|
|
17071
17077
|
tables: ["agents"],
|
|
17072
17078
|
columns: [
|
|
@@ -17078,7 +17084,7 @@ var MIGRATIONS = [
|
|
|
17078
17084
|
{
|
|
17079
17085
|
version: 44,
|
|
17080
17086
|
name: "memory-md-temporal-head",
|
|
17081
|
-
up:
|
|
17087
|
+
up: up46,
|
|
17082
17088
|
artifacts: {
|
|
17083
17089
|
columns: [
|
|
17084
17090
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -17090,7 +17096,7 @@ var MIGRATIONS = [
|
|
|
17090
17096
|
{
|
|
17091
17097
|
version: 45,
|
|
17092
17098
|
name: "lossless-working-memory-hardening",
|
|
17093
|
-
up:
|
|
17099
|
+
up: up47,
|
|
17094
17100
|
artifacts: {
|
|
17095
17101
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
17096
17102
|
columns: [
|
|
@@ -17103,17 +17109,17 @@ var MIGRATIONS = [
|
|
|
17103
17109
|
{
|
|
17104
17110
|
version: 46,
|
|
17105
17111
|
name: "session-summary-uniqueness",
|
|
17106
|
-
up:
|
|
17112
|
+
up: up48
|
|
17107
17113
|
},
|
|
17108
17114
|
{
|
|
17109
17115
|
version: 47,
|
|
17110
17116
|
name: "agent-scoped-temporal-uniqueness",
|
|
17111
|
-
up:
|
|
17117
|
+
up: up49
|
|
17112
17118
|
},
|
|
17113
17119
|
{
|
|
17114
17120
|
version: 48,
|
|
17115
17121
|
name: "thread-heads",
|
|
17116
|
-
up:
|
|
17122
|
+
up: up50,
|
|
17117
17123
|
artifacts: {
|
|
17118
17124
|
tables: ["memory_thread_heads"]
|
|
17119
17125
|
}
|
|
@@ -17121,7 +17127,7 @@ var MIGRATIONS = [
|
|
|
17121
17127
|
{
|
|
17122
17128
|
version: 49,
|
|
17123
17129
|
name: "session-extract-cursors",
|
|
17124
|
-
up:
|
|
17130
|
+
up: up51,
|
|
17125
17131
|
artifacts: {
|
|
17126
17132
|
tables: ["session_extract_cursors"]
|
|
17127
17133
|
}
|
|
@@ -17129,7 +17135,7 @@ var MIGRATIONS = [
|
|
|
17129
17135
|
{
|
|
17130
17136
|
version: 50,
|
|
17131
17137
|
name: "related-to-audit",
|
|
17132
|
-
up:
|
|
17138
|
+
up: up52,
|
|
17133
17139
|
artifacts: {
|
|
17134
17140
|
tables: ["entity_dependency_history"]
|
|
17135
17141
|
}
|
|
@@ -17137,7 +17143,7 @@ var MIGRATIONS = [
|
|
|
17137
17143
|
{
|
|
17138
17144
|
version: 51,
|
|
17139
17145
|
name: "memory-md-rolling-window-lineage",
|
|
17140
|
-
up:
|
|
17146
|
+
up: up53,
|
|
17141
17147
|
artifacts: {
|
|
17142
17148
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
17143
17149
|
columns: [
|
|
@@ -17152,7 +17158,7 @@ var MIGRATIONS = [
|
|
|
17152
17158
|
{
|
|
17153
17159
|
version: 52,
|
|
17154
17160
|
name: "mcp-invocations",
|
|
17155
|
-
up:
|
|
17161
|
+
up: up54,
|
|
17156
17162
|
artifacts: {
|
|
17157
17163
|
tables: ["mcp_invocations"]
|
|
17158
17164
|
}
|
|
@@ -17160,7 +17166,7 @@ var MIGRATIONS = [
|
|
|
17160
17166
|
{
|
|
17161
17167
|
version: 53,
|
|
17162
17168
|
name: "skill-invocations",
|
|
17163
|
-
up:
|
|
17169
|
+
up: up55,
|
|
17164
17170
|
artifacts: {
|
|
17165
17171
|
tables: ["skill_invocations"]
|
|
17166
17172
|
}
|
|
@@ -17168,7 +17174,7 @@ var MIGRATIONS = [
|
|
|
17168
17174
|
{
|
|
17169
17175
|
version: 54,
|
|
17170
17176
|
name: "task-agent-scope",
|
|
17171
|
-
up:
|
|
17177
|
+
up: up56,
|
|
17172
17178
|
artifacts: {
|
|
17173
17179
|
tables: ["task_scope_hints"]
|
|
17174
17180
|
}
|
|
@@ -17176,7 +17182,7 @@ var MIGRATIONS = [
|
|
|
17176
17182
|
{
|
|
17177
17183
|
version: 55,
|
|
17178
17184
|
name: "dreaming-state",
|
|
17179
|
-
up:
|
|
17185
|
+
up: up57,
|
|
17180
17186
|
artifacts: {
|
|
17181
17187
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
17182
17188
|
}
|
|
@@ -17184,22 +17190,22 @@ var MIGRATIONS = [
|
|
|
17184
17190
|
{
|
|
17185
17191
|
version: 56,
|
|
17186
17192
|
name: "agent-scoped-content-hash",
|
|
17187
|
-
up:
|
|
17193
|
+
up: up58
|
|
17188
17194
|
},
|
|
17189
17195
|
{
|
|
17190
17196
|
version: 57,
|
|
17191
17197
|
name: "memories-fts-tokenizer-repair",
|
|
17192
|
-
up:
|
|
17198
|
+
up: up59
|
|
17193
17199
|
},
|
|
17194
17200
|
{
|
|
17195
17201
|
version: 58,
|
|
17196
17202
|
name: "knowledge-graph-indices",
|
|
17197
|
-
up:
|
|
17203
|
+
up: up60
|
|
17198
17204
|
},
|
|
17199
17205
|
{
|
|
17200
17206
|
version: 59,
|
|
17201
17207
|
name: "entity-attribute-claim-key",
|
|
17202
|
-
up:
|
|
17208
|
+
up: up61,
|
|
17203
17209
|
artifacts: {
|
|
17204
17210
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
17205
17211
|
}
|
|
@@ -17207,7 +17213,7 @@ var MIGRATIONS = [
|
|
|
17207
17213
|
{
|
|
17208
17214
|
version: 60,
|
|
17209
17215
|
name: "entity-attribute-group-key",
|
|
17210
|
-
up:
|
|
17216
|
+
up: up62,
|
|
17211
17217
|
artifacts: {
|
|
17212
17218
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
17213
17219
|
}
|
|
@@ -17215,7 +17221,7 @@ var MIGRATIONS = [
|
|
|
17215
17221
|
{
|
|
17216
17222
|
version: 61,
|
|
17217
17223
|
name: "memory-artifact-source-mtime",
|
|
17218
|
-
up:
|
|
17224
|
+
up: up63,
|
|
17219
17225
|
artifacts: {
|
|
17220
17226
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
17221
17227
|
}
|
|
@@ -17223,7 +17229,7 @@ var MIGRATIONS = [
|
|
|
17223
17229
|
{
|
|
17224
17230
|
version: 62,
|
|
17225
17231
|
name: "memory-artifact-soft-delete",
|
|
17226
|
-
up:
|
|
17232
|
+
up: up64,
|
|
17227
17233
|
artifacts: {
|
|
17228
17234
|
columns: [
|
|
17229
17235
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -17234,12 +17240,12 @@ var MIGRATIONS = [
|
|
|
17234
17240
|
{
|
|
17235
17241
|
version: 63,
|
|
17236
17242
|
name: "content-only-memories-fts-update",
|
|
17237
|
-
up:
|
|
17243
|
+
up: up65
|
|
17238
17244
|
},
|
|
17239
17245
|
{
|
|
17240
17246
|
version: 64,
|
|
17241
17247
|
name: "source-graph-provenance",
|
|
17242
|
-
up:
|
|
17248
|
+
up: up66,
|
|
17243
17249
|
artifacts: {
|
|
17244
17250
|
columns: [
|
|
17245
17251
|
{ table: "entities", column: "source_path" },
|
|
@@ -17252,7 +17258,7 @@ var MIGRATIONS = [
|
|
|
17252
17258
|
{
|
|
17253
17259
|
version: 65,
|
|
17254
17260
|
name: "source-embedding-agent-scope",
|
|
17255
|
-
up:
|
|
17261
|
+
up: up67,
|
|
17256
17262
|
artifacts: {
|
|
17257
17263
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
17258
17264
|
}
|
|
@@ -17260,7 +17266,7 @@ var MIGRATIONS = [
|
|
|
17260
17266
|
{
|
|
17261
17267
|
version: 66,
|
|
17262
17268
|
name: "memory-search-telemetry",
|
|
17263
|
-
up:
|
|
17269
|
+
up: up68,
|
|
17264
17270
|
artifacts: {
|
|
17265
17271
|
tables: ["memory_search_telemetry"]
|
|
17266
17272
|
}
|
|
@@ -17268,7 +17274,7 @@ var MIGRATIONS = [
|
|
|
17268
17274
|
{
|
|
17269
17275
|
version: 67,
|
|
17270
17276
|
name: "ontology-proposals",
|
|
17271
|
-
up:
|
|
17277
|
+
up: up69,
|
|
17272
17278
|
artifacts: {
|
|
17273
17279
|
tables: ["ontology_proposals"],
|
|
17274
17280
|
columns: [
|
|
@@ -17282,7 +17288,7 @@ var MIGRATIONS = [
|
|
|
17282
17288
|
{
|
|
17283
17289
|
version: 68,
|
|
17284
17290
|
name: "daily-reflections",
|
|
17285
|
-
up:
|
|
17291
|
+
up: up70,
|
|
17286
17292
|
artifacts: {
|
|
17287
17293
|
tables: ["daily_reflections"]
|
|
17288
17294
|
}
|
|
@@ -17290,7 +17296,7 @@ var MIGRATIONS = [
|
|
|
17290
17296
|
{
|
|
17291
17297
|
version: 69,
|
|
17292
17298
|
name: "daily-reflections-multiple-insights",
|
|
17293
|
-
up:
|
|
17299
|
+
up: up71,
|
|
17294
17300
|
artifacts: {
|
|
17295
17301
|
tables: ["daily_reflections"]
|
|
17296
17302
|
}
|
|
@@ -17298,7 +17304,7 @@ var MIGRATIONS = [
|
|
|
17298
17304
|
{
|
|
17299
17305
|
version: 70,
|
|
17300
17306
|
name: "ontology-control-plane-state",
|
|
17301
|
-
up:
|
|
17307
|
+
up: up72,
|
|
17302
17308
|
artifacts: {
|
|
17303
17309
|
columns: [
|
|
17304
17310
|
{ table: "entities", column: "status" },
|
|
@@ -17313,7 +17319,7 @@ var MIGRATIONS = [
|
|
|
17313
17319
|
{
|
|
17314
17320
|
version: 71,
|
|
17315
17321
|
name: "epistemic-assertions",
|
|
17316
|
-
up:
|
|
17322
|
+
up: up73,
|
|
17317
17323
|
artifacts: {
|
|
17318
17324
|
tables: ["epistemic_assertions"]
|
|
17319
17325
|
}
|
|
@@ -17321,7 +17327,7 @@ var MIGRATIONS = [
|
|
|
17321
17327
|
{
|
|
17322
17328
|
version: 72,
|
|
17323
17329
|
name: "agent-scoped-idempotency-key",
|
|
17324
|
-
up:
|
|
17330
|
+
up: up74,
|
|
17325
17331
|
artifacts: {
|
|
17326
17332
|
columns: [
|
|
17327
17333
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -17332,7 +17338,7 @@ var MIGRATIONS = [
|
|
|
17332
17338
|
{
|
|
17333
17339
|
version: 73,
|
|
17334
17340
|
name: "recall-context-dedupe",
|
|
17335
|
-
up:
|
|
17341
|
+
up: up75,
|
|
17336
17342
|
artifacts: {
|
|
17337
17343
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
17338
17344
|
}
|
|
@@ -17340,7 +17346,7 @@ var MIGRATIONS = [
|
|
|
17340
17346
|
{
|
|
17341
17347
|
version: 74,
|
|
17342
17348
|
name: "aggregate-memory-links",
|
|
17343
|
-
up:
|
|
17349
|
+
up: up76,
|
|
17344
17350
|
artifacts: {
|
|
17345
17351
|
tables: ["aggregate_memory_sources"]
|
|
17346
17352
|
}
|
|
@@ -17348,7 +17354,7 @@ var MIGRATIONS = [
|
|
|
17348
17354
|
{
|
|
17349
17355
|
version: 75,
|
|
17350
17356
|
name: "memory-artifact-source-provenance",
|
|
17351
|
-
up:
|
|
17357
|
+
up: up77,
|
|
17352
17358
|
artifacts: {
|
|
17353
17359
|
columns: [
|
|
17354
17360
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -17362,7 +17368,7 @@ var MIGRATIONS = [
|
|
|
17362
17368
|
{
|
|
17363
17369
|
version: 76,
|
|
17364
17370
|
name: "temporal-edges",
|
|
17365
|
-
up:
|
|
17371
|
+
up: up78,
|
|
17366
17372
|
artifacts: {
|
|
17367
17373
|
tables: ["temporal_edges"]
|
|
17368
17374
|
}
|
|
@@ -17370,7 +17376,7 @@ var MIGRATIONS = [
|
|
|
17370
17376
|
{
|
|
17371
17377
|
version: 77,
|
|
17372
17378
|
name: "entity-aliases",
|
|
17373
|
-
up:
|
|
17379
|
+
up: up79,
|
|
17374
17380
|
artifacts: {
|
|
17375
17381
|
tables: ["entity_aliases"]
|
|
17376
17382
|
}
|
|
@@ -17378,7 +17384,7 @@ var MIGRATIONS = [
|
|
|
17378
17384
|
{
|
|
17379
17385
|
version: 78,
|
|
17380
17386
|
name: "api-keys",
|
|
17381
|
-
up:
|
|
17387
|
+
up: up80,
|
|
17382
17388
|
artifacts: {
|
|
17383
17389
|
tables: ["api_keys"]
|
|
17384
17390
|
}
|
|
@@ -17386,7 +17392,7 @@ var MIGRATIONS = [
|
|
|
17386
17392
|
{
|
|
17387
17393
|
version: 79,
|
|
17388
17394
|
name: "transcript-capture-jobs",
|
|
17389
|
-
up:
|
|
17395
|
+
up: up81,
|
|
17390
17396
|
artifacts: {
|
|
17391
17397
|
tables: ["transcript_capture_jobs"]
|
|
17392
17398
|
}
|
|
@@ -17394,7 +17400,7 @@ var MIGRATIONS = [
|
|
|
17394
17400
|
{
|
|
17395
17401
|
version: 80,
|
|
17396
17402
|
name: "document-scope-columns",
|
|
17397
|
-
up:
|
|
17403
|
+
up: up82,
|
|
17398
17404
|
artifacts: {
|
|
17399
17405
|
columns: [
|
|
17400
17406
|
{ table: "documents", column: "agent_id" },
|
|
@@ -17405,7 +17411,7 @@ var MIGRATIONS = [
|
|
|
17405
17411
|
{
|
|
17406
17412
|
version: 81,
|
|
17407
17413
|
name: "aggregate-evidence-sources",
|
|
17408
|
-
up:
|
|
17414
|
+
up: up83,
|
|
17409
17415
|
artifacts: {
|
|
17410
17416
|
tables: ["aggregate_evidence_sources"]
|
|
17411
17417
|
}
|
|
@@ -17413,7 +17419,7 @@ var MIGRATIONS = [
|
|
|
17413
17419
|
{
|
|
17414
17420
|
version: 82,
|
|
17415
17421
|
name: "skill-invocations-harness",
|
|
17416
|
-
up:
|
|
17422
|
+
up: up84,
|
|
17417
17423
|
artifacts: {
|
|
17418
17424
|
columns: [
|
|
17419
17425
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -17424,7 +17430,7 @@ var MIGRATIONS = [
|
|
|
17424
17430
|
{
|
|
17425
17431
|
version: 83,
|
|
17426
17432
|
name: "memory-lifecycle-repair",
|
|
17427
|
-
up:
|
|
17433
|
+
up: up85,
|
|
17428
17434
|
artifacts: {
|
|
17429
17435
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
17430
17436
|
columns: [
|
|
@@ -17439,7 +17445,7 @@ var MIGRATIONS = [
|
|
|
17439
17445
|
{
|
|
17440
17446
|
version: 84,
|
|
17441
17447
|
name: "legacy-markdown-import-state",
|
|
17442
|
-
up:
|
|
17448
|
+
up: up86,
|
|
17443
17449
|
artifacts: {
|
|
17444
17450
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
17445
17451
|
}
|
|
@@ -17447,7 +17453,7 @@ var MIGRATIONS = [
|
|
|
17447
17453
|
{
|
|
17448
17454
|
version: 85,
|
|
17449
17455
|
name: "backfill-relations-to-dependencies",
|
|
17450
|
-
up:
|
|
17456
|
+
up: up87,
|
|
17451
17457
|
artifacts: {
|
|
17452
17458
|
tables: ["entity_dependencies"]
|
|
17453
17459
|
}
|
|
@@ -17455,7 +17461,7 @@ var MIGRATIONS = [
|
|
|
17455
17461
|
{
|
|
17456
17462
|
version: 86,
|
|
17457
17463
|
name: "summary-jobs-content-hash",
|
|
17458
|
-
up:
|
|
17464
|
+
up: up88,
|
|
17459
17465
|
artifacts: {
|
|
17460
17466
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
17461
17467
|
}
|
|
@@ -17463,7 +17469,7 @@ var MIGRATIONS = [
|
|
|
17463
17469
|
{
|
|
17464
17470
|
version: 87,
|
|
17465
17471
|
name: "summary-jobs-boundary-reason",
|
|
17466
|
-
up:
|
|
17472
|
+
up: up89,
|
|
17467
17473
|
artifacts: {
|
|
17468
17474
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
17469
17475
|
}
|
|
@@ -17471,7 +17477,7 @@ var MIGRATIONS = [
|
|
|
17471
17477
|
{
|
|
17472
17478
|
version: 88,
|
|
17473
17479
|
name: "transcript-recovery-files",
|
|
17474
|
-
up:
|
|
17480
|
+
up: up90,
|
|
17475
17481
|
artifacts: {
|
|
17476
17482
|
tables: ["transcript_recovery_files"]
|
|
17477
17483
|
}
|
|
@@ -17479,7 +17485,7 @@ var MIGRATIONS = [
|
|
|
17479
17485
|
{
|
|
17480
17486
|
version: 89,
|
|
17481
17487
|
name: "job-cancellations",
|
|
17482
|
-
up:
|
|
17488
|
+
up: up91,
|
|
17483
17489
|
artifacts: {
|
|
17484
17490
|
tables: ["job_cancellations"]
|
|
17485
17491
|
}
|
|
@@ -17487,7 +17493,7 @@ var MIGRATIONS = [
|
|
|
17487
17493
|
{
|
|
17488
17494
|
version: 90,
|
|
17489
17495
|
name: "job-archive",
|
|
17490
|
-
up:
|
|
17496
|
+
up: up92,
|
|
17491
17497
|
artifacts: {
|
|
17492
17498
|
tables: ["job_archive"]
|
|
17493
17499
|
}
|
|
@@ -17495,25 +17501,25 @@ var MIGRATIONS = [
|
|
|
17495
17501
|
{
|
|
17496
17502
|
version: 91,
|
|
17497
17503
|
name: "embedding-index-generations",
|
|
17498
|
-
up:
|
|
17504
|
+
up: up93,
|
|
17499
17505
|
artifacts: { tables: ["embedding_index_state"] }
|
|
17500
17506
|
},
|
|
17501
17507
|
{
|
|
17502
17508
|
version: 92,
|
|
17503
17509
|
name: "embedding-staging-store",
|
|
17504
|
-
up:
|
|
17510
|
+
up: up94,
|
|
17505
17511
|
artifacts: { tables: ["embeddings_staging"] }
|
|
17506
17512
|
},
|
|
17507
17513
|
{
|
|
17508
17514
|
version: 93,
|
|
17509
17515
|
name: "dreaming-evidence-cursor",
|
|
17510
|
-
up:
|
|
17516
|
+
up: up95,
|
|
17511
17517
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
17512
17518
|
},
|
|
17513
17519
|
{
|
|
17514
17520
|
version: 94,
|
|
17515
17521
|
name: "memory-kind",
|
|
17516
|
-
up:
|
|
17522
|
+
up: up96,
|
|
17517
17523
|
artifacts: {
|
|
17518
17524
|
columns: [
|
|
17519
17525
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -17524,35 +17530,35 @@ var MIGRATIONS = [
|
|
|
17524
17530
|
{
|
|
17525
17531
|
version: 95,
|
|
17526
17532
|
name: "compaction-recall-projections",
|
|
17527
|
-
up:
|
|
17533
|
+
up: up97
|
|
17528
17534
|
},
|
|
17529
17535
|
{
|
|
17530
17536
|
version: 96,
|
|
17531
17537
|
name: "retire-legacy-ingestion",
|
|
17532
|
-
up:
|
|
17538
|
+
up: up98
|
|
17533
17539
|
},
|
|
17534
17540
|
{
|
|
17535
17541
|
version: 97,
|
|
17536
17542
|
name: "dreaming-failure-backoff",
|
|
17537
|
-
up:
|
|
17543
|
+
up: up99,
|
|
17538
17544
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
17539
17545
|
},
|
|
17540
17546
|
{
|
|
17541
17547
|
version: 98,
|
|
17542
17548
|
name: "dreaming-evidence-exclusions",
|
|
17543
|
-
up:
|
|
17549
|
+
up: up100,
|
|
17544
17550
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
17545
17551
|
},
|
|
17546
17552
|
{
|
|
17547
17553
|
version: 99,
|
|
17548
17554
|
name: "dreaming-tool-calls",
|
|
17549
|
-
up:
|
|
17555
|
+
up: up101,
|
|
17550
17556
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
17551
17557
|
},
|
|
17552
17558
|
{
|
|
17553
17559
|
version: 100,
|
|
17554
17560
|
name: "dreaming-runbook",
|
|
17555
|
-
up:
|
|
17561
|
+
up: up102,
|
|
17556
17562
|
artifacts: {
|
|
17557
17563
|
columns: [
|
|
17558
17564
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -17563,23 +17569,23 @@ var MIGRATIONS = [
|
|
|
17563
17569
|
{
|
|
17564
17570
|
version: 101,
|
|
17565
17571
|
name: "dreaming-attention",
|
|
17566
|
-
up:
|
|
17572
|
+
up: up103,
|
|
17567
17573
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17568
17574
|
},
|
|
17569
17575
|
{
|
|
17570
17576
|
version: 102,
|
|
17571
17577
|
name: "attribute-semantic-memories",
|
|
17572
|
-
up:
|
|
17578
|
+
up: up104
|
|
17573
17579
|
},
|
|
17574
17580
|
{
|
|
17575
17581
|
version: 103,
|
|
17576
17582
|
name: "semantic-memory-kind",
|
|
17577
|
-
up:
|
|
17583
|
+
up: up105
|
|
17578
17584
|
},
|
|
17579
17585
|
{
|
|
17580
17586
|
version: 104,
|
|
17581
17587
|
name: "derived-memory-provenance",
|
|
17582
|
-
up:
|
|
17588
|
+
up: up106,
|
|
17583
17589
|
artifacts: {
|
|
17584
17590
|
tables: ["derived_memory_sources"],
|
|
17585
17591
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -17588,12 +17594,12 @@ var MIGRATIONS = [
|
|
|
17588
17594
|
{
|
|
17589
17595
|
version: 105,
|
|
17590
17596
|
name: "agent-scoped-entity-name",
|
|
17591
|
-
up:
|
|
17597
|
+
up: up107
|
|
17592
17598
|
},
|
|
17593
17599
|
{
|
|
17594
17600
|
version: 106,
|
|
17595
17601
|
name: "memory-review-after",
|
|
17596
|
-
up:
|
|
17602
|
+
up: up108,
|
|
17597
17603
|
artifacts: {
|
|
17598
17604
|
columns: [{ table: "memories", column: "review_after" }]
|
|
17599
17605
|
}
|
|
@@ -17601,7 +17607,7 @@ var MIGRATIONS = [
|
|
|
17601
17607
|
{
|
|
17602
17608
|
version: 107,
|
|
17603
17609
|
name: "dreaming-pass-usage",
|
|
17604
|
-
up:
|
|
17610
|
+
up: up109,
|
|
17605
17611
|
artifacts: {
|
|
17606
17612
|
columns: [
|
|
17607
17613
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -17615,7 +17621,7 @@ var MIGRATIONS = [
|
|
|
17615
17621
|
{
|
|
17616
17622
|
version: 108,
|
|
17617
17623
|
name: "embedding-usage",
|
|
17618
|
-
up:
|
|
17624
|
+
up: up110,
|
|
17619
17625
|
artifacts: {
|
|
17620
17626
|
tables: ["embedding_usage"]
|
|
17621
17627
|
}
|
|
@@ -17623,7 +17629,7 @@ var MIGRATIONS = [
|
|
|
17623
17629
|
{
|
|
17624
17630
|
version: 109,
|
|
17625
17631
|
name: "telemetry-install",
|
|
17626
|
-
up:
|
|
17632
|
+
up: up111,
|
|
17627
17633
|
artifacts: {
|
|
17628
17634
|
tables: ["telemetry_install"]
|
|
17629
17635
|
}
|
|
@@ -17631,12 +17637,12 @@ var MIGRATIONS = [
|
|
|
17631
17637
|
{
|
|
17632
17638
|
version: 110,
|
|
17633
17639
|
name: "memory-mention-join-index",
|
|
17634
|
-
up:
|
|
17640
|
+
up: up112
|
|
17635
17641
|
},
|
|
17636
17642
|
{
|
|
17637
17643
|
version: 111,
|
|
17638
17644
|
name: "telemetry-first-use",
|
|
17639
|
-
up:
|
|
17645
|
+
up: up113,
|
|
17640
17646
|
artifacts: {
|
|
17641
17647
|
columns: [
|
|
17642
17648
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -17647,7 +17653,7 @@ var MIGRATIONS = [
|
|
|
17647
17653
|
{
|
|
17648
17654
|
version: 112,
|
|
17649
17655
|
name: "telemetry-queue-ownership",
|
|
17650
|
-
up:
|
|
17656
|
+
up: up114,
|
|
17651
17657
|
artifacts: {
|
|
17652
17658
|
columns: [
|
|
17653
17659
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -17659,7 +17665,7 @@ var MIGRATIONS = [
|
|
|
17659
17665
|
{
|
|
17660
17666
|
version: 113,
|
|
17661
17667
|
name: "session-claims",
|
|
17662
|
-
up:
|
|
17668
|
+
up: up115,
|
|
17663
17669
|
artifacts: {
|
|
17664
17670
|
tables: ["session_claims"],
|
|
17665
17671
|
columns: [
|
|
@@ -17673,12 +17679,12 @@ var MIGRATIONS = [
|
|
|
17673
17679
|
{
|
|
17674
17680
|
version: 114,
|
|
17675
17681
|
name: "memory-traversal-hydration-index",
|
|
17676
|
-
up:
|
|
17682
|
+
up: up116
|
|
17677
17683
|
},
|
|
17678
17684
|
{
|
|
17679
17685
|
version: 115,
|
|
17680
17686
|
name: "cross-agent-message-notifications",
|
|
17681
|
-
up:
|
|
17687
|
+
up: up117,
|
|
17682
17688
|
artifacts: {
|
|
17683
17689
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
17684
17690
|
}
|
|
@@ -17686,7 +17692,7 @@ var MIGRATIONS = [
|
|
|
17686
17692
|
{
|
|
17687
17693
|
version: 116,
|
|
17688
17694
|
name: "acp-delivery-reconciliation",
|
|
17689
|
-
up:
|
|
17695
|
+
up: up118,
|
|
17690
17696
|
artifacts: {
|
|
17691
17697
|
columns: [
|
|
17692
17698
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -17700,7 +17706,7 @@ var MIGRATIONS = [
|
|
|
17700
17706
|
{
|
|
17701
17707
|
version: 117,
|
|
17702
17708
|
name: "retire-summary-worker",
|
|
17703
|
-
up:
|
|
17709
|
+
up: up119,
|
|
17704
17710
|
artifacts: {
|
|
17705
17711
|
columns: [
|
|
17706
17712
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -17711,24 +17717,24 @@ var MIGRATIONS = [
|
|
|
17711
17717
|
{
|
|
17712
17718
|
version: 118,
|
|
17713
17719
|
name: "queue-pressure-indices",
|
|
17714
|
-
up:
|
|
17720
|
+
up: up120
|
|
17715
17721
|
},
|
|
17716
17722
|
{
|
|
17717
17723
|
version: 119,
|
|
17718
17724
|
name: "telemetry-version-observation",
|
|
17719
|
-
up:
|
|
17725
|
+
up: up121,
|
|
17720
17726
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
17721
17727
|
},
|
|
17722
17728
|
{
|
|
17723
17729
|
version: 120,
|
|
17724
17730
|
name: "source-lifecycle-telemetry",
|
|
17725
|
-
up:
|
|
17731
|
+
up: up122,
|
|
17726
17732
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
17727
17733
|
},
|
|
17728
17734
|
{
|
|
17729
17735
|
version: 121,
|
|
17730
17736
|
name: "telemetry-delivery-health",
|
|
17731
|
-
up:
|
|
17737
|
+
up: up123,
|
|
17732
17738
|
artifacts: {
|
|
17733
17739
|
tables: ["telemetry_delivery_state"],
|
|
17734
17740
|
columns: [
|
|
@@ -17742,7 +17748,7 @@ var MIGRATIONS = [
|
|
|
17742
17748
|
{
|
|
17743
17749
|
version: 122,
|
|
17744
17750
|
name: "dreaming-evidence-retry",
|
|
17745
|
-
up:
|
|
17751
|
+
up: up124,
|
|
17746
17752
|
artifacts: {
|
|
17747
17753
|
columns: [
|
|
17748
17754
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -17755,13 +17761,13 @@ var MIGRATIONS = [
|
|
|
17755
17761
|
{
|
|
17756
17762
|
version: 123,
|
|
17757
17763
|
name: "embedding-index-failures",
|
|
17758
|
-
up:
|
|
17764
|
+
up: up125,
|
|
17759
17765
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
17760
17766
|
},
|
|
17761
17767
|
{
|
|
17762
17768
|
version: 124,
|
|
17763
17769
|
name: "import-derived-lifecycle",
|
|
17764
|
-
up:
|
|
17770
|
+
up: up126,
|
|
17765
17771
|
artifacts: {
|
|
17766
17772
|
tables: ["imported_source_lifecycle"]
|
|
17767
17773
|
}
|
|
@@ -17769,77 +17775,77 @@ var MIGRATIONS = [
|
|
|
17769
17775
|
{
|
|
17770
17776
|
version: 125,
|
|
17771
17777
|
name: "memory-content-safety",
|
|
17772
|
-
up:
|
|
17778
|
+
up: up127,
|
|
17773
17779
|
artifacts: { tables: ["memory_content_safety"] }
|
|
17774
17780
|
},
|
|
17775
17781
|
{
|
|
17776
17782
|
version: 126,
|
|
17777
17783
|
name: "dreaming-surprisal-attention",
|
|
17778
|
-
up:
|
|
17784
|
+
up: up128,
|
|
17779
17785
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17780
17786
|
},
|
|
17781
17787
|
{
|
|
17782
17788
|
version: 127,
|
|
17783
17789
|
name: "ontology-contradictions",
|
|
17784
|
-
up:
|
|
17790
|
+
up: up129,
|
|
17785
17791
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
17786
17792
|
},
|
|
17787
17793
|
{
|
|
17788
17794
|
version: 128,
|
|
17789
17795
|
name: "bounded-queue-diagnostics",
|
|
17790
|
-
up:
|
|
17796
|
+
up: up130
|
|
17791
17797
|
},
|
|
17792
17798
|
{
|
|
17793
17799
|
version: 129,
|
|
17794
17800
|
name: "retire-structural-jobs",
|
|
17795
|
-
up:
|
|
17801
|
+
up: up131
|
|
17796
17802
|
},
|
|
17797
17803
|
{
|
|
17798
17804
|
version: 130,
|
|
17799
17805
|
name: "embedding-repair-state",
|
|
17800
|
-
up:
|
|
17806
|
+
up: up132,
|
|
17801
17807
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
17802
17808
|
},
|
|
17803
17809
|
{
|
|
17804
17810
|
version: 131,
|
|
17805
17811
|
name: "dreaming-evidence-consumption",
|
|
17806
|
-
up:
|
|
17812
|
+
up: up133,
|
|
17807
17813
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
17808
17814
|
},
|
|
17809
17815
|
{
|
|
17810
17816
|
version: 132,
|
|
17811
17817
|
name: "observer-scoped-epistemic-assertions",
|
|
17812
|
-
up:
|
|
17818
|
+
up: up134,
|
|
17813
17819
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
17814
17820
|
},
|
|
17815
17821
|
{
|
|
17816
17822
|
version: 133,
|
|
17817
17823
|
name: "dreaming-memory-head",
|
|
17818
|
-
up:
|
|
17824
|
+
up: up135,
|
|
17819
17825
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
17820
17826
|
},
|
|
17821
17827
|
{
|
|
17822
17828
|
version: 134,
|
|
17823
17829
|
name: "scope-memory-head-entries",
|
|
17824
|
-
up:
|
|
17830
|
+
up: up136,
|
|
17825
17831
|
artifacts: { tables: ["memory_head_entries"] }
|
|
17826
17832
|
},
|
|
17827
17833
|
{
|
|
17828
17834
|
version: 135,
|
|
17829
17835
|
name: "memory-head-publication",
|
|
17830
|
-
up:
|
|
17836
|
+
up: up137,
|
|
17831
17837
|
artifacts: { tables: ["memory_head_publications"] }
|
|
17832
17838
|
},
|
|
17833
17839
|
{
|
|
17834
17840
|
version: 136,
|
|
17835
17841
|
name: "memory-head-revisions",
|
|
17836
|
-
up:
|
|
17842
|
+
up: up138,
|
|
17837
17843
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
17838
17844
|
},
|
|
17839
17845
|
{
|
|
17840
17846
|
version: 137,
|
|
17841
17847
|
name: "dreaming-head-manifest",
|
|
17842
|
-
up:
|
|
17848
|
+
up: up139,
|
|
17843
17849
|
artifacts: {
|
|
17844
17850
|
columns: [
|
|
17845
17851
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -17850,7 +17856,7 @@ var MIGRATIONS = [
|
|
|
17850
17856
|
{
|
|
17851
17857
|
version: 138,
|
|
17852
17858
|
name: "bounded-status-projections",
|
|
17853
|
-
up:
|
|
17859
|
+
up: up140,
|
|
17854
17860
|
artifacts: {
|
|
17855
17861
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
17856
17862
|
}
|
|
@@ -17858,31 +17864,31 @@ var MIGRATIONS = [
|
|
|
17858
17864
|
{
|
|
17859
17865
|
version: 139,
|
|
17860
17866
|
name: "native-source-sync-state",
|
|
17861
|
-
up:
|
|
17867
|
+
up: up141,
|
|
17862
17868
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
17863
17869
|
},
|
|
17864
17870
|
{
|
|
17865
17871
|
version: 140,
|
|
17866
17872
|
name: "transcript-recovery-frontier",
|
|
17867
|
-
up:
|
|
17873
|
+
up: up142,
|
|
17868
17874
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
17869
17875
|
},
|
|
17870
17876
|
{
|
|
17871
17877
|
version: 141,
|
|
17872
17878
|
name: "source-sync-checkpoints",
|
|
17873
|
-
up:
|
|
17879
|
+
up: up143,
|
|
17874
17880
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
17875
17881
|
},
|
|
17876
17882
|
{
|
|
17877
17883
|
version: 142,
|
|
17878
17884
|
name: "source-sync-frontier",
|
|
17879
|
-
up:
|
|
17885
|
+
up: up144,
|
|
17880
17886
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
17881
17887
|
},
|
|
17882
17888
|
{
|
|
17883
17889
|
version: 143,
|
|
17884
17890
|
name: "embedding-index-progress",
|
|
17885
|
-
up:
|
|
17891
|
+
up: up145,
|
|
17886
17892
|
artifacts: {
|
|
17887
17893
|
columns: [
|
|
17888
17894
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -17898,19 +17904,19 @@ var MIGRATIONS = [
|
|
|
17898
17904
|
{
|
|
17899
17905
|
version: 144,
|
|
17900
17906
|
name: "memory-job-lease-token",
|
|
17901
|
-
up:
|
|
17907
|
+
up: up146,
|
|
17902
17908
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
17903
17909
|
},
|
|
17904
17910
|
{
|
|
17905
17911
|
version: 145,
|
|
17906
17912
|
name: "dreaming-evidence-reviews",
|
|
17907
|
-
up:
|
|
17913
|
+
up: up147,
|
|
17908
17914
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
17909
17915
|
},
|
|
17910
17916
|
{
|
|
17911
17917
|
version: 146,
|
|
17912
17918
|
name: "source-transcript-import",
|
|
17913
|
-
up:
|
|
17919
|
+
up: up148,
|
|
17914
17920
|
artifacts: {
|
|
17915
17921
|
tables: [
|
|
17916
17922
|
"source_import_jobs",
|
|
@@ -17929,19 +17935,19 @@ var MIGRATIONS = [
|
|
|
17929
17935
|
{
|
|
17930
17936
|
version: 147,
|
|
17931
17937
|
name: "source-import-replay-file-slots",
|
|
17932
|
-
up:
|
|
17938
|
+
up: up149,
|
|
17933
17939
|
artifacts: { tables: ["source_import_files"] }
|
|
17934
17940
|
},
|
|
17935
17941
|
{
|
|
17936
17942
|
version: 148,
|
|
17937
17943
|
name: "source-import-attempt-provenance",
|
|
17938
|
-
up:
|
|
17944
|
+
up: up150,
|
|
17939
17945
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
17940
17946
|
},
|
|
17941
17947
|
{
|
|
17942
17948
|
version: 149,
|
|
17943
17949
|
name: "transcript-import-state-machine",
|
|
17944
|
-
up:
|
|
17950
|
+
up: up151,
|
|
17945
17951
|
artifacts: {
|
|
17946
17952
|
columns: [
|
|
17947
17953
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -17953,7 +17959,7 @@ var MIGRATIONS = [
|
|
|
17953
17959
|
{
|
|
17954
17960
|
version: 150,
|
|
17955
17961
|
name: "memory-head-freshness",
|
|
17956
|
-
up:
|
|
17962
|
+
up: up152,
|
|
17957
17963
|
artifacts: {
|
|
17958
17964
|
columns: [
|
|
17959
17965
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -17989,6 +17995,12 @@ var MIGRATIONS = [
|
|
|
17989
17995
|
}))
|
|
17990
17996
|
]
|
|
17991
17997
|
}
|
|
17998
|
+
},
|
|
17999
|
+
{
|
|
18000
|
+
version: 152,
|
|
18001
|
+
name: "memory-artifact-sha-index",
|
|
18002
|
+
up: up2,
|
|
18003
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
17992
18004
|
}
|
|
17993
18005
|
];
|
|
17994
18006
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -29890,7 +29902,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
|
|
|
29890
29902
|
"checkpoint",
|
|
29891
29903
|
"dreaming"
|
|
29892
29904
|
];
|
|
29893
|
-
function
|
|
29905
|
+
function up153(db) {
|
|
29894
29906
|
const hasColumn26 = (table, column) => {
|
|
29895
29907
|
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
29896
29908
|
try {
|
|
@@ -29950,6 +29962,12 @@ function up152(db) {
|
|
|
29950
29962
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
29951
29963
|
`);
|
|
29952
29964
|
}
|
|
29965
|
+
function up210(db) {
|
|
29966
|
+
db.exec(`
|
|
29967
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
29968
|
+
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)
|
|
29969
|
+
`);
|
|
29970
|
+
}
|
|
29953
29971
|
var MEMORIES_FTS_TOKENIZER2 = "unicode61";
|
|
29954
29972
|
var FTS_STATE_TABLE2 = "memories_fts_state";
|
|
29955
29973
|
function normalizeSql2(sql) {
|
|
@@ -30065,7 +30083,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
30065
30083
|
return true;
|
|
30066
30084
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
30067
30085
|
}
|
|
30068
|
-
function
|
|
30086
|
+
function up310(db) {
|
|
30069
30087
|
db.exec(`
|
|
30070
30088
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
30071
30089
|
version INTEGER PRIMARY KEY,
|
|
@@ -30163,7 +30181,7 @@ function addColumnIfMissing29(db, table, column, definition) {
|
|
|
30163
30181
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30164
30182
|
}
|
|
30165
30183
|
}
|
|
30166
|
-
function
|
|
30184
|
+
function up410(db) {
|
|
30167
30185
|
addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
|
|
30168
30186
|
addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
|
|
30169
30187
|
addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -30281,7 +30299,7 @@ function addColumnIfMissing210(db, table, column, definition) {
|
|
|
30281
30299
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30282
30300
|
return true;
|
|
30283
30301
|
}
|
|
30284
|
-
function
|
|
30302
|
+
function up510(db) {
|
|
30285
30303
|
addColumnIfMissing210(db, "memories", "why", "TEXT");
|
|
30286
30304
|
addColumnIfMissing210(db, "memories", "project", "TEXT");
|
|
30287
30305
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -30318,7 +30336,7 @@ function addColumnIfMissing32(db, table, column, definition) {
|
|
|
30318
30336
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30319
30337
|
}
|
|
30320
30338
|
}
|
|
30321
|
-
function
|
|
30339
|
+
function up610(db) {
|
|
30322
30340
|
addColumnIfMissing32(db, "memory_history", "actor_type", "TEXT");
|
|
30323
30341
|
addColumnIfMissing32(db, "memory_history", "session_id", "TEXT");
|
|
30324
30342
|
addColumnIfMissing32(db, "memory_history", "request_id", "TEXT");
|
|
@@ -30351,7 +30369,7 @@ function addColumnIfMissing42(db, table, column, definition) {
|
|
|
30351
30369
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30352
30370
|
}
|
|
30353
30371
|
}
|
|
30354
|
-
function
|
|
30372
|
+
function up710(db) {
|
|
30355
30373
|
addColumnIfMissing42(db, "entities", "canonical_name", "TEXT");
|
|
30356
30374
|
addColumnIfMissing42(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
30357
30375
|
addColumnIfMissing42(db, "entities", "embedding", "BLOB");
|
|
@@ -30368,7 +30386,7 @@ function hasColumn42(db, table, column) {
|
|
|
30368
30386
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30369
30387
|
return rows.some((r22) => r22.name === column);
|
|
30370
30388
|
}
|
|
30371
|
-
function
|
|
30389
|
+
function up810(db) {
|
|
30372
30390
|
if (!hasColumn42(db, "memories", "idempotency_key")) {
|
|
30373
30391
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
30374
30392
|
}
|
|
@@ -30383,7 +30401,7 @@ function hasColumn52(db, table, column) {
|
|
|
30383
30401
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30384
30402
|
return rows.some((r22) => r22.name === column);
|
|
30385
30403
|
}
|
|
30386
|
-
function
|
|
30404
|
+
function up910(db) {
|
|
30387
30405
|
db.exec(`
|
|
30388
30406
|
CREATE TABLE IF NOT EXISTS documents (
|
|
30389
30407
|
id TEXT PRIMARY KEY,
|
|
@@ -30440,7 +30458,7 @@ function up810(db) {
|
|
|
30440
30458
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
30441
30459
|
}
|
|
30442
30460
|
}
|
|
30443
|
-
function
|
|
30461
|
+
function up1010(db) {
|
|
30444
30462
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
30445
30463
|
if (tables.length === 0)
|
|
30446
30464
|
return;
|
|
@@ -30457,7 +30475,7 @@ function up910(db) {
|
|
|
30457
30475
|
ON embeddings(content_hash)
|
|
30458
30476
|
`);
|
|
30459
30477
|
}
|
|
30460
|
-
function
|
|
30478
|
+
function up1110(db) {
|
|
30461
30479
|
db.exec(`
|
|
30462
30480
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
30463
30481
|
id TEXT PRIMARY KEY,
|
|
@@ -30477,7 +30495,7 @@ function up1010(db) {
|
|
|
30477
30495
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
30478
30496
|
ON summary_jobs(status)`);
|
|
30479
30497
|
}
|
|
30480
|
-
function
|
|
30498
|
+
function up1210(db) {
|
|
30481
30499
|
db.exec(`
|
|
30482
30500
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
30483
30501
|
id INTEGER PRIMARY KEY,
|
|
@@ -30488,7 +30506,7 @@ function up1110(db) {
|
|
|
30488
30506
|
)
|
|
30489
30507
|
`);
|
|
30490
30508
|
}
|
|
30491
|
-
function
|
|
30509
|
+
function up1310(db) {
|
|
30492
30510
|
db.exec(`
|
|
30493
30511
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
30494
30512
|
id TEXT PRIMARY KEY,
|
|
@@ -30508,7 +30526,7 @@ function up1210(db) {
|
|
|
30508
30526
|
ON session_scores(session_key);
|
|
30509
30527
|
`);
|
|
30510
30528
|
}
|
|
30511
|
-
function
|
|
30529
|
+
function up1410(db) {
|
|
30512
30530
|
db.exec(`
|
|
30513
30531
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
30514
30532
|
id TEXT PRIMARY KEY,
|
|
@@ -30549,7 +30567,7 @@ function addColumnIfMissing52(db, table, column, definition) {
|
|
|
30549
30567
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30550
30568
|
}
|
|
30551
30569
|
}
|
|
30552
|
-
function
|
|
30570
|
+
function up154(db) {
|
|
30553
30571
|
db.exec(`
|
|
30554
30572
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
30555
30573
|
id TEXT PRIMARY KEY,
|
|
@@ -30575,7 +30593,7 @@ function up1410(db) {
|
|
|
30575
30593
|
addColumnIfMissing52(db, "memories", "source_path", "TEXT");
|
|
30576
30594
|
addColumnIfMissing52(db, "memories", "source_section", "TEXT");
|
|
30577
30595
|
}
|
|
30578
|
-
function
|
|
30596
|
+
function up162(db) {
|
|
30579
30597
|
db.exec(`
|
|
30580
30598
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
30581
30599
|
id TEXT PRIMARY KEY,
|
|
@@ -30600,7 +30618,7 @@ function addColumnIfMissing62(db, table, column, definition) {
|
|
|
30600
30618
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30601
30619
|
}
|
|
30602
30620
|
}
|
|
30603
|
-
function
|
|
30621
|
+
function up172(db) {
|
|
30604
30622
|
db.exec(`
|
|
30605
30623
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
30606
30624
|
id TEXT PRIMARY KEY,
|
|
@@ -30627,7 +30645,7 @@ function up162(db) {
|
|
|
30627
30645
|
addColumnIfMissing62(db, "session_scores", "confidence", "REAL");
|
|
30628
30646
|
addColumnIfMissing62(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
30629
30647
|
}
|
|
30630
|
-
function
|
|
30648
|
+
function up182(db) {
|
|
30631
30649
|
db.exec(`
|
|
30632
30650
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
30633
30651
|
id TEXT PRIMARY KEY,
|
|
@@ -30649,7 +30667,7 @@ function up172(db) {
|
|
|
30649
30667
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
30650
30668
|
`);
|
|
30651
30669
|
}
|
|
30652
|
-
function
|
|
30670
|
+
function up192(db) {
|
|
30653
30671
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
30654
30672
|
const colNames = new Set(cols.flatMap((c22) => typeof c22.name === "string" ? [c22.name] : []));
|
|
30655
30673
|
if (!colNames.has("skill_name")) {
|
|
@@ -30660,7 +30678,7 @@ function up182(db) {
|
|
|
30660
30678
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
30661
30679
|
}
|
|
30662
30680
|
}
|
|
30663
|
-
function
|
|
30681
|
+
function up202(db) {
|
|
30664
30682
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
30665
30683
|
if (existing)
|
|
30666
30684
|
return;
|
|
@@ -30692,7 +30710,7 @@ function up192(db) {
|
|
|
30692
30710
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
30693
30711
|
`);
|
|
30694
30712
|
}
|
|
30695
|
-
function
|
|
30713
|
+
function up212(db) {
|
|
30696
30714
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
30697
30715
|
const entityColNames = new Set(entityCols.flatMap((c22) => typeof c22.name === "string" ? [c22.name] : []));
|
|
30698
30716
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -30777,13 +30795,13 @@ function addColumnIfMissing72(db, table, column, definition) {
|
|
|
30777
30795
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30778
30796
|
}
|
|
30779
30797
|
}
|
|
30780
|
-
function
|
|
30798
|
+
function up222(db) {
|
|
30781
30799
|
addColumnIfMissing72(db, "session_memories", "entity_slot", "INTEGER");
|
|
30782
30800
|
addColumnIfMissing72(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30783
30801
|
addColumnIfMissing72(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
30784
30802
|
addColumnIfMissing72(db, "session_memories", "structural_density", "INTEGER");
|
|
30785
30803
|
}
|
|
30786
|
-
function
|
|
30804
|
+
function up232(db) {
|
|
30787
30805
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
30788
30806
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
30789
30807
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -30808,25 +30826,25 @@ function addColumnIfMissing82(db, table, column, definition) {
|
|
|
30808
30826
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30809
30827
|
}
|
|
30810
30828
|
}
|
|
30811
|
-
function
|
|
30829
|
+
function up242(db) {
|
|
30812
30830
|
addColumnIfMissing82(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
30813
30831
|
addColumnIfMissing82(db, "entities", "pinned_at", "TEXT");
|
|
30814
30832
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
30815
30833
|
}
|
|
30816
|
-
function up242(_db) {}
|
|
30817
30834
|
function up252(_db) {}
|
|
30835
|
+
function up262(_db) {}
|
|
30818
30836
|
function addColumnIfMissing92(db, table, column, definition) {
|
|
30819
30837
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30820
30838
|
if (!cols.some((c22) => c22.name === column)) {
|
|
30821
30839
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30822
30840
|
}
|
|
30823
30841
|
}
|
|
30824
|
-
function
|
|
30842
|
+
function up272(db) {
|
|
30825
30843
|
addColumnIfMissing92(db, "session_memories", "agent_relevance_score", "REAL");
|
|
30826
30844
|
addColumnIfMissing92(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
30827
30845
|
}
|
|
30828
|
-
function
|
|
30829
|
-
function
|
|
30846
|
+
function up282(_db) {}
|
|
30847
|
+
function up292(db) {
|
|
30830
30848
|
db.exec(`
|
|
30831
30849
|
UPDATE entities
|
|
30832
30850
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -30835,7 +30853,7 @@ function up282(db) {
|
|
|
30835
30853
|
WHERE canonical_name IS NULL
|
|
30836
30854
|
`);
|
|
30837
30855
|
}
|
|
30838
|
-
function
|
|
30856
|
+
function up302(db) {
|
|
30839
30857
|
db.exec(`
|
|
30840
30858
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
30841
30859
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -30872,7 +30890,7 @@ function up292(db) {
|
|
|
30872
30890
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
30873
30891
|
`);
|
|
30874
30892
|
}
|
|
30875
|
-
function
|
|
30893
|
+
function up312(db) {
|
|
30876
30894
|
db.exec(`
|
|
30877
30895
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
30878
30896
|
id TEXT PRIMARY KEY,
|
|
@@ -30917,7 +30935,7 @@ function up302(db) {
|
|
|
30917
30935
|
WHERE session_key IS NOT NULL;
|
|
30918
30936
|
`);
|
|
30919
30937
|
}
|
|
30920
|
-
function
|
|
30938
|
+
function up322(db) {
|
|
30921
30939
|
db.exec(`
|
|
30922
30940
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
30923
30941
|
id TEXT PRIMARY KEY,
|
|
@@ -30962,7 +30980,7 @@ function up312(db) {
|
|
|
30962
30980
|
ON memory_jobs(failed_at);
|
|
30963
30981
|
`);
|
|
30964
30982
|
}
|
|
30965
|
-
function
|
|
30983
|
+
function up332(db) {
|
|
30966
30984
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30967
30985
|
if (!depCols.some((c22) => c22.name === "reason")) {
|
|
30968
30986
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -30972,7 +30990,7 @@ function up322(db) {
|
|
|
30972
30990
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
30973
30991
|
}
|
|
30974
30992
|
}
|
|
30975
|
-
function
|
|
30993
|
+
function up342(db) {
|
|
30976
30994
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
30977
30995
|
if (cols.length === 0)
|
|
30978
30996
|
return;
|
|
@@ -30980,14 +30998,14 @@ function up332(db) {
|
|
|
30980
30998
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
30981
30999
|
}
|
|
30982
31000
|
}
|
|
30983
|
-
function
|
|
31001
|
+
function up352(db) {
|
|
30984
31002
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
30985
31003
|
if (!cols.some((c22) => c22.name === "scope")) {
|
|
30986
31004
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
30987
31005
|
}
|
|
30988
31006
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
30989
31007
|
}
|
|
30990
|
-
function
|
|
31008
|
+
function up362(db) {
|
|
30991
31009
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
30992
31010
|
db.exec(`
|
|
30993
31011
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -30995,7 +31013,7 @@ function up352(db) {
|
|
|
30995
31013
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
30996
31014
|
`);
|
|
30997
31015
|
}
|
|
30998
|
-
function
|
|
31016
|
+
function up372(db) {
|
|
30999
31017
|
db.exec(`
|
|
31000
31018
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
31001
31019
|
name, canonical_name,
|
|
@@ -31027,13 +31045,13 @@ function up362(db) {
|
|
|
31027
31045
|
END
|
|
31028
31046
|
`);
|
|
31029
31047
|
}
|
|
31030
|
-
function
|
|
31048
|
+
function up382(db) {
|
|
31031
31049
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
31032
31050
|
if (!cols.some((c22) => c22.name === "confidence")) {
|
|
31033
31051
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
31034
31052
|
}
|
|
31035
31053
|
}
|
|
31036
|
-
function
|
|
31054
|
+
function up392(db) {
|
|
31037
31055
|
db.exec(`
|
|
31038
31056
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
31039
31057
|
id TEXT PRIMARY KEY,
|
|
@@ -31051,7 +31069,7 @@ function up382(db) {
|
|
|
31051
31069
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
31052
31070
|
}
|
|
31053
31071
|
}
|
|
31054
|
-
function
|
|
31072
|
+
function up402(db) {
|
|
31055
31073
|
db.exec(`
|
|
31056
31074
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
31057
31075
|
id TEXT PRIMARY KEY,
|
|
@@ -31091,7 +31109,7 @@ function up392(db) {
|
|
|
31091
31109
|
END
|
|
31092
31110
|
`);
|
|
31093
31111
|
}
|
|
31094
|
-
function
|
|
31112
|
+
function up412(db) {
|
|
31095
31113
|
db.exec(`
|
|
31096
31114
|
DELETE FROM entity_dependencies
|
|
31097
31115
|
WHERE id NOT IN (
|
|
@@ -31109,7 +31127,7 @@ function up402(db) {
|
|
|
31109
31127
|
)
|
|
31110
31128
|
`);
|
|
31111
31129
|
}
|
|
31112
|
-
function
|
|
31130
|
+
function up422(db) {
|
|
31113
31131
|
db.exec(`
|
|
31114
31132
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
31115
31133
|
session_key TEXT PRIMARY KEY,
|
|
@@ -31132,7 +31150,7 @@ function addColumnIfMissing102(db, table, column, definition) {
|
|
|
31132
31150
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31133
31151
|
}
|
|
31134
31152
|
}
|
|
31135
|
-
function
|
|
31153
|
+
function up432(db) {
|
|
31136
31154
|
addColumnIfMissing102(db, "session_memories", "path_json", "TEXT");
|
|
31137
31155
|
db.exec(`
|
|
31138
31156
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -31207,7 +31225,7 @@ function addColumnIfMissing112(db, table, column, definition) {
|
|
|
31207
31225
|
return;
|
|
31208
31226
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31209
31227
|
}
|
|
31210
|
-
function
|
|
31228
|
+
function up442(db) {
|
|
31211
31229
|
addColumnIfMissing112(db, "session_memories", "entity_slot", "INTEGER");
|
|
31212
31230
|
addColumnIfMissing112(db, "session_memories", "aspect_slot", "INTEGER");
|
|
31213
31231
|
addColumnIfMissing112(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -31295,7 +31313,7 @@ function addColumnIfMissing122(db, table, column, definition) {
|
|
|
31295
31313
|
return;
|
|
31296
31314
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31297
31315
|
}
|
|
31298
|
-
function
|
|
31316
|
+
function up452(db) {
|
|
31299
31317
|
db.exec(`
|
|
31300
31318
|
CREATE TABLE IF NOT EXISTS agents (
|
|
31301
31319
|
id TEXT PRIMARY KEY,
|
|
@@ -31324,7 +31342,7 @@ function addColumnIfMissing132(db, table, column, definition) {
|
|
|
31324
31342
|
return;
|
|
31325
31343
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31326
31344
|
}
|
|
31327
|
-
function
|
|
31345
|
+
function up462(db) {
|
|
31328
31346
|
addColumnIfMissing132(db, "session_summaries", "source_type", "TEXT");
|
|
31329
31347
|
addColumnIfMissing132(db, "session_summaries", "source_ref", "TEXT");
|
|
31330
31348
|
addColumnIfMissing132(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -31350,7 +31368,7 @@ function addColumnIfMissing142(db, table, column, definition) {
|
|
|
31350
31368
|
return;
|
|
31351
31369
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31352
31370
|
}
|
|
31353
|
-
function
|
|
31371
|
+
function up472(db) {
|
|
31354
31372
|
addColumnIfMissing142(db, "session_transcripts", "updated_at", "TEXT");
|
|
31355
31373
|
addColumnIfMissing142(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
31356
31374
|
addColumnIfMissing142(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -31421,7 +31439,7 @@ function up462(db) {
|
|
|
31421
31439
|
ON memory_md_heads(lease_expires_at);
|
|
31422
31440
|
`);
|
|
31423
31441
|
}
|
|
31424
|
-
function
|
|
31442
|
+
function up482(db) {
|
|
31425
31443
|
db.exec(`
|
|
31426
31444
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
31427
31445
|
|
|
@@ -31482,7 +31500,7 @@ function up472(db) {
|
|
|
31482
31500
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31483
31501
|
`);
|
|
31484
31502
|
}
|
|
31485
|
-
function
|
|
31503
|
+
function up492(db) {
|
|
31486
31504
|
db.exec(`
|
|
31487
31505
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
31488
31506
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -31580,7 +31598,7 @@ function up482(db) {
|
|
|
31580
31598
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31581
31599
|
`);
|
|
31582
31600
|
}
|
|
31583
|
-
function
|
|
31601
|
+
function up502(db) {
|
|
31584
31602
|
db.exec(`
|
|
31585
31603
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
31586
31604
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -31698,7 +31716,7 @@ function up492(db) {
|
|
|
31698
31716
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
31699
31717
|
`);
|
|
31700
31718
|
}
|
|
31701
|
-
function
|
|
31719
|
+
function up512(db) {
|
|
31702
31720
|
db.exec(`
|
|
31703
31721
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
31704
31722
|
session_key TEXT NOT NULL,
|
|
@@ -31715,7 +31733,7 @@ function hasTable5(db, name) {
|
|
|
31715
31733
|
WHERE type = 'table' AND name = ?
|
|
31716
31734
|
LIMIT 1`).get(name) !== undefined;
|
|
31717
31735
|
}
|
|
31718
|
-
function
|
|
31736
|
+
function up522(db) {
|
|
31719
31737
|
db.exec(`
|
|
31720
31738
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
31721
31739
|
id TEXT PRIMARY KEY,
|
|
@@ -31885,7 +31903,7 @@ function addColumnIfMissing152(db, table, column, definition) {
|
|
|
31885
31903
|
return;
|
|
31886
31904
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31887
31905
|
}
|
|
31888
|
-
function
|
|
31906
|
+
function up532(db) {
|
|
31889
31907
|
addColumnIfMissing152(db, "summary_jobs", "session_id", "TEXT");
|
|
31890
31908
|
addColumnIfMissing152(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
31891
31909
|
addColumnIfMissing152(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -31977,7 +31995,7 @@ function up522(db) {
|
|
|
31977
31995
|
VALUES ('rebuild');
|
|
31978
31996
|
`);
|
|
31979
31997
|
}
|
|
31980
|
-
function
|
|
31998
|
+
function up542(db) {
|
|
31981
31999
|
db.exec(`
|
|
31982
32000
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
31983
32001
|
id TEXT PRIMARY KEY,
|
|
@@ -31994,7 +32012,7 @@ function up532(db) {
|
|
|
31994
32012
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
31995
32013
|
`);
|
|
31996
32014
|
}
|
|
31997
|
-
function
|
|
32015
|
+
function up552(db) {
|
|
31998
32016
|
db.exec(`
|
|
31999
32017
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
32000
32018
|
id TEXT PRIMARY KEY,
|
|
@@ -32010,7 +32028,7 @@ function up542(db) {
|
|
|
32010
32028
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
32011
32029
|
`);
|
|
32012
32030
|
}
|
|
32013
|
-
function
|
|
32031
|
+
function up562(db) {
|
|
32014
32032
|
db.exec(`
|
|
32015
32033
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
32016
32034
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -32041,7 +32059,7 @@ function up552(db) {
|
|
|
32041
32059
|
ON task_scope_hints(agent_id, updated_at);
|
|
32042
32060
|
`);
|
|
32043
32061
|
}
|
|
32044
|
-
function
|
|
32062
|
+
function up572(db) {
|
|
32045
32063
|
db.exec(`
|
|
32046
32064
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
32047
32065
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -32084,7 +32102,7 @@ function ensureMemoriesScopeColumns3(db) {
|
|
|
32084
32102
|
if (!names.has("scope"))
|
|
32085
32103
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
32086
32104
|
}
|
|
32087
|
-
function
|
|
32105
|
+
function up582(db) {
|
|
32088
32106
|
ensureMemoriesScopeColumns3(db);
|
|
32089
32107
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
32090
32108
|
db.exec(`
|
|
@@ -32097,20 +32115,20 @@ function up572(db) {
|
|
|
32097
32115
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
32098
32116
|
`);
|
|
32099
32117
|
}
|
|
32100
|
-
function
|
|
32118
|
+
function up592(db) {
|
|
32101
32119
|
const sql = readMemoriesFtsSql2(db);
|
|
32102
32120
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair2(sql))
|
|
32103
32121
|
return;
|
|
32104
32122
|
recreateMemoriesFts2(db);
|
|
32105
32123
|
}
|
|
32106
|
-
function
|
|
32124
|
+
function up602(db) {
|
|
32107
32125
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
32108
32126
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
32109
32127
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
32110
32128
|
ON entities(entity_type, mentions)
|
|
32111
32129
|
WHERE entity_type = 'extracted'`);
|
|
32112
32130
|
}
|
|
32113
|
-
function
|
|
32131
|
+
function up612(db) {
|
|
32114
32132
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
32115
32133
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
32116
32134
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -32119,7 +32137,7 @@ function up602(db) {
|
|
|
32119
32137
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
32120
32138
|
WHERE claim_key IS NOT NULL`);
|
|
32121
32139
|
}
|
|
32122
|
-
function
|
|
32140
|
+
function up622(db) {
|
|
32123
32141
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
32124
32142
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
32125
32143
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -32131,13 +32149,13 @@ function up612(db) {
|
|
|
32131
32149
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
32132
32150
|
WHERE claim_key IS NOT NULL`);
|
|
32133
32151
|
}
|
|
32134
|
-
function
|
|
32152
|
+
function up632(db) {
|
|
32135
32153
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
32136
32154
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
32137
32155
|
return;
|
|
32138
32156
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
32139
32157
|
}
|
|
32140
|
-
function
|
|
32158
|
+
function up642(db) {
|
|
32141
32159
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
32142
32160
|
const names = new Set(cols.map((col) => col.name));
|
|
32143
32161
|
if (!names.has("is_deleted")) {
|
|
@@ -32151,7 +32169,7 @@ function up632(db) {
|
|
|
32151
32169
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
32152
32170
|
`);
|
|
32153
32171
|
}
|
|
32154
|
-
function
|
|
32172
|
+
function up652(db) {
|
|
32155
32173
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
32156
32174
|
db.exec(`
|
|
32157
32175
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -32169,7 +32187,7 @@ function addColumnIfMissing162(db, table, column, definition) {
|
|
|
32169
32187
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32170
32188
|
}
|
|
32171
32189
|
}
|
|
32172
|
-
function
|
|
32190
|
+
function up662(db) {
|
|
32173
32191
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
32174
32192
|
addColumnIfMissing162(db, table, "source_id", "TEXT");
|
|
32175
32193
|
addColumnIfMissing162(db, table, "source_kind", "TEXT");
|
|
@@ -32189,7 +32207,7 @@ function hasColumn72(db, table, column) {
|
|
|
32189
32207
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32190
32208
|
return rows.some((row) => row.name === column);
|
|
32191
32209
|
}
|
|
32192
|
-
function
|
|
32210
|
+
function up672(db) {
|
|
32193
32211
|
if (!hasTable22(db, "embeddings"))
|
|
32194
32212
|
return;
|
|
32195
32213
|
if (!hasColumn72(db, "embeddings", "agent_id")) {
|
|
@@ -32197,7 +32215,7 @@ function up662(db) {
|
|
|
32197
32215
|
}
|
|
32198
32216
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
32199
32217
|
}
|
|
32200
|
-
function
|
|
32218
|
+
function up682(db) {
|
|
32201
32219
|
db.exec(`
|
|
32202
32220
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
32203
32221
|
id TEXT PRIMARY KEY,
|
|
@@ -32238,7 +32256,7 @@ function addColumnIfMissing172(db, table, column, definition) {
|
|
|
32238
32256
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32239
32257
|
}
|
|
32240
32258
|
}
|
|
32241
|
-
function
|
|
32259
|
+
function up692(db) {
|
|
32242
32260
|
db.exec(`
|
|
32243
32261
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
32244
32262
|
id TEXT PRIMARY KEY,
|
|
@@ -32281,7 +32299,7 @@ function up682(db) {
|
|
|
32281
32299
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
32282
32300
|
}
|
|
32283
32301
|
}
|
|
32284
|
-
function
|
|
32302
|
+
function up702(db) {
|
|
32285
32303
|
db.exec(`
|
|
32286
32304
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
32287
32305
|
id TEXT PRIMARY KEY,
|
|
@@ -32308,7 +32326,7 @@ function up692(db) {
|
|
|
32308
32326
|
WHERE content_key IS NOT NULL;
|
|
32309
32327
|
`);
|
|
32310
32328
|
}
|
|
32311
|
-
function
|
|
32329
|
+
function up712(db) {
|
|
32312
32330
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
32313
32331
|
const colNames = new Set(cols.flatMap((c22) => typeof c22.name === "string" ? [c22.name] : []));
|
|
32314
32332
|
if (!colNames.has("content_key")) {
|
|
@@ -32345,7 +32363,7 @@ function backfillVersionRoots2(db) {
|
|
|
32345
32363
|
WHERE version_root_id IS NULL
|
|
32346
32364
|
`);
|
|
32347
32365
|
}
|
|
32348
|
-
function
|
|
32366
|
+
function up722(db) {
|
|
32349
32367
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
32350
32368
|
addColumnIfMissing182(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
32351
32369
|
addColumnIfMissing182(db, table, "archived_at", "TEXT");
|
|
@@ -32380,7 +32398,7 @@ function up712(db) {
|
|
|
32380
32398
|
ON entity_aspects(agent_id, proposal_id);
|
|
32381
32399
|
`);
|
|
32382
32400
|
}
|
|
32383
|
-
function
|
|
32401
|
+
function up732(db) {
|
|
32384
32402
|
db.exec(`
|
|
32385
32403
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
32386
32404
|
id TEXT PRIMARY KEY,
|
|
@@ -32436,7 +32454,7 @@ function ensureMemoriesScopeColumns22(db) {
|
|
|
32436
32454
|
if (!names.has("runtime_path"))
|
|
32437
32455
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
32438
32456
|
}
|
|
32439
|
-
function
|
|
32457
|
+
function up742(db) {
|
|
32440
32458
|
ensureMemoriesScopeColumns22(db);
|
|
32441
32459
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
32442
32460
|
db.exec(`
|
|
@@ -32450,7 +32468,7 @@ function up732(db) {
|
|
|
32450
32468
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
32451
32469
|
`);
|
|
32452
32470
|
}
|
|
32453
|
-
function
|
|
32471
|
+
function up752(db) {
|
|
32454
32472
|
db.exec(`
|
|
32455
32473
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
32456
32474
|
session_key TEXT NOT NULL,
|
|
@@ -32485,7 +32503,7 @@ function up742(db) {
|
|
|
32485
32503
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
32486
32504
|
`);
|
|
32487
32505
|
}
|
|
32488
|
-
function
|
|
32506
|
+
function up762(db) {
|
|
32489
32507
|
db.exec(`
|
|
32490
32508
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
32491
32509
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32504,7 +32522,7 @@ function addColumnIfMissing192(db, table, column, definition) {
|
|
|
32504
32522
|
return;
|
|
32505
32523
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32506
32524
|
}
|
|
32507
|
-
function
|
|
32525
|
+
function up772(db) {
|
|
32508
32526
|
addColumnIfMissing192(db, "memory_artifacts", "source_id", "TEXT");
|
|
32509
32527
|
addColumnIfMissing192(db, "memory_artifacts", "source_root", "TEXT");
|
|
32510
32528
|
addColumnIfMissing192(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -32517,7 +32535,7 @@ function up762(db) {
|
|
|
32517
32535
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
32518
32536
|
`);
|
|
32519
32537
|
}
|
|
32520
|
-
function
|
|
32538
|
+
function up782(db) {
|
|
32521
32539
|
db.exec(`
|
|
32522
32540
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
32523
32541
|
id TEXT PRIMARY KEY,
|
|
@@ -32540,7 +32558,7 @@ function up772(db) {
|
|
|
32540
32558
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
32541
32559
|
`);
|
|
32542
32560
|
}
|
|
32543
|
-
function
|
|
32561
|
+
function up792(db) {
|
|
32544
32562
|
db.exec(`
|
|
32545
32563
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
32546
32564
|
id TEXT PRIMARY KEY,
|
|
@@ -32564,7 +32582,7 @@ function up782(db) {
|
|
|
32564
32582
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
32565
32583
|
`);
|
|
32566
32584
|
}
|
|
32567
|
-
function
|
|
32585
|
+
function up802(db) {
|
|
32568
32586
|
db.exec(`
|
|
32569
32587
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
32570
32588
|
id TEXT PRIMARY KEY,
|
|
@@ -32592,7 +32610,7 @@ function up792(db) {
|
|
|
32592
32610
|
ON api_keys(connector, harness);
|
|
32593
32611
|
`);
|
|
32594
32612
|
}
|
|
32595
|
-
function
|
|
32613
|
+
function up812(db) {
|
|
32596
32614
|
db.exec(`
|
|
32597
32615
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
32598
32616
|
id TEXT PRIMARY KEY,
|
|
@@ -32627,7 +32645,7 @@ function hasColumn102(db, table, column) {
|
|
|
32627
32645
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32628
32646
|
return rows.some((row) => row.name === column);
|
|
32629
32647
|
}
|
|
32630
|
-
function
|
|
32648
|
+
function up822(db) {
|
|
32631
32649
|
if (!hasColumn102(db, "documents", "agent_id")) {
|
|
32632
32650
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
32633
32651
|
}
|
|
@@ -32713,7 +32731,7 @@ function up812(db) {
|
|
|
32713
32731
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
32714
32732
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
32715
32733
|
}
|
|
32716
|
-
function
|
|
32734
|
+
function up832(db) {
|
|
32717
32735
|
db.exec(`
|
|
32718
32736
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
32719
32737
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32735,7 +32753,7 @@ function hasColumn112(db, table, column) {
|
|
|
32735
32753
|
return rows.some((row) => row.name === column);
|
|
32736
32754
|
}
|
|
32737
32755
|
var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
32738
|
-
function
|
|
32756
|
+
function up842(db) {
|
|
32739
32757
|
for (const column of COLUMNS3) {
|
|
32740
32758
|
if (!hasColumn112(db, "skill_invocations", column)) {
|
|
32741
32759
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -32816,7 +32834,7 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32816
32834
|
`);
|
|
32817
32835
|
}
|
|
32818
32836
|
try {
|
|
32819
|
-
|
|
32837
|
+
up822(db);
|
|
32820
32838
|
if (preserveAgentId) {
|
|
32821
32839
|
db.exec(`
|
|
32822
32840
|
UPDATE documents
|
|
@@ -32836,12 +32854,12 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32836
32854
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
32837
32855
|
}
|
|
32838
32856
|
}
|
|
32839
|
-
function
|
|
32840
|
-
|
|
32857
|
+
function up852(db) {
|
|
32858
|
+
up812(db);
|
|
32841
32859
|
if (hasTable32(db, "documents")) {
|
|
32842
32860
|
documentScopeColumnsPreservingExisting2(db);
|
|
32843
32861
|
}
|
|
32844
|
-
|
|
32862
|
+
up832(db);
|
|
32845
32863
|
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
32846
32864
|
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
32847
32865
|
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -32898,7 +32916,7 @@ function up842(db) {
|
|
|
32898
32916
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
32899
32917
|
`);
|
|
32900
32918
|
}
|
|
32901
|
-
function
|
|
32919
|
+
function up862(db) {
|
|
32902
32920
|
db.exec(`
|
|
32903
32921
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
32904
32922
|
path TEXT PRIMARY KEY,
|
|
@@ -32928,7 +32946,7 @@ function up852(db) {
|
|
|
32928
32946
|
ON legacy_markdown_chunks(memory_id);
|
|
32929
32947
|
`);
|
|
32930
32948
|
}
|
|
32931
|
-
function
|
|
32949
|
+
function up872(db) {
|
|
32932
32950
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
32933
32951
|
const tableNames = new Set(tables.map((r22) => String(r22.name)));
|
|
32934
32952
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -32987,7 +33005,7 @@ function addColumnIfMissing212(db, table, column, definition) {
|
|
|
32987
33005
|
return;
|
|
32988
33006
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32989
33007
|
}
|
|
32990
|
-
function
|
|
33008
|
+
function up882(db) {
|
|
32991
33009
|
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
32992
33010
|
db.exec(`
|
|
32993
33011
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -33000,14 +33018,14 @@ function addColumnIfMissing222(db, table, column, definition) {
|
|
|
33000
33018
|
return;
|
|
33001
33019
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
33002
33020
|
}
|
|
33003
|
-
function
|
|
33021
|
+
function up892(db) {
|
|
33004
33022
|
addColumnIfMissing222(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
33005
33023
|
db.exec(`
|
|
33006
33024
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
33007
33025
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
33008
33026
|
`);
|
|
33009
33027
|
}
|
|
33010
|
-
function
|
|
33028
|
+
function up902(db) {
|
|
33011
33029
|
db.exec(`
|
|
33012
33030
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
33013
33031
|
agent_id TEXT NOT NULL,
|
|
@@ -33025,7 +33043,7 @@ function up892(db) {
|
|
|
33025
33043
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
33026
33044
|
`);
|
|
33027
33045
|
}
|
|
33028
|
-
function
|
|
33046
|
+
function up912(db) {
|
|
33029
33047
|
db.exec(`
|
|
33030
33048
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
33031
33049
|
id TEXT PRIMARY KEY,
|
|
@@ -33053,7 +33071,7 @@ function indexExists3(db, table, indexName) {
|
|
|
33053
33071
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
33054
33072
|
return rows.some((row) => row.name === indexName);
|
|
33055
33073
|
}
|
|
33056
|
-
function
|
|
33074
|
+
function up922(db) {
|
|
33057
33075
|
db.exec(`
|
|
33058
33076
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
33059
33077
|
id TEXT PRIMARY KEY,
|
|
@@ -33080,7 +33098,7 @@ function indexExists22(db, table, indexName) {
|
|
|
33080
33098
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
33081
33099
|
return rows.some((row) => row.name === indexName);
|
|
33082
33100
|
}
|
|
33083
|
-
function
|
|
33101
|
+
function up932(db) {
|
|
33084
33102
|
db.exec(`
|
|
33085
33103
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
33086
33104
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -33093,7 +33111,7 @@ function up922(db) {
|
|
|
33093
33111
|
)
|
|
33094
33112
|
`);
|
|
33095
33113
|
}
|
|
33096
|
-
function
|
|
33114
|
+
function up942(db) {
|
|
33097
33115
|
db.exec(`
|
|
33098
33116
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
33099
33117
|
id TEXT PRIMARY KEY,
|
|
@@ -33112,7 +33130,7 @@ function up932(db) {
|
|
|
33112
33130
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
33113
33131
|
`);
|
|
33114
33132
|
}
|
|
33115
|
-
function
|
|
33133
|
+
function up952(db) {
|
|
33116
33134
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
33117
33135
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
33118
33136
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -33123,7 +33141,7 @@ function hasColumn132(db, table, column) {
|
|
|
33123
33141
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
33124
33142
|
return rows.some((r22) => r22.name === column);
|
|
33125
33143
|
}
|
|
33126
|
-
function
|
|
33144
|
+
function up962(db) {
|
|
33127
33145
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
33128
33146
|
if (tables.length === 0)
|
|
33129
33147
|
return;
|
|
@@ -33148,23 +33166,23 @@ function up952(db) {
|
|
|
33148
33166
|
function hasColumn142(db, table, column) {
|
|
33149
33167
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33150
33168
|
}
|
|
33151
|
-
function
|
|
33169
|
+
function up972(db) {
|
|
33152
33170
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
33153
33171
|
if (!hasMemories || !hasColumn142(db, "memories", "memory_kind") || !hasColumn142(db, "memories", "type"))
|
|
33154
33172
|
return;
|
|
33155
33173
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
33156
33174
|
}
|
|
33157
|
-
function
|
|
33175
|
+
function up982(db) {
|
|
33158
33176
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
33159
33177
|
}
|
|
33160
|
-
function
|
|
33178
|
+
function up992(db) {
|
|
33161
33179
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
33162
33180
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
33163
33181
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
33164
33182
|
}
|
|
33165
33183
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
33166
33184
|
}
|
|
33167
|
-
function
|
|
33185
|
+
function up1002(db) {
|
|
33168
33186
|
db.exec(`
|
|
33169
33187
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
33170
33188
|
agent_id TEXT NOT NULL,
|
|
@@ -33181,7 +33199,7 @@ function up992(db) {
|
|
|
33181
33199
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
33182
33200
|
`);
|
|
33183
33201
|
}
|
|
33184
|
-
function
|
|
33202
|
+
function up1012(db) {
|
|
33185
33203
|
db.exec(`
|
|
33186
33204
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
33187
33205
|
id TEXT PRIMARY KEY,
|
|
@@ -33201,7 +33219,7 @@ function up1002(db) {
|
|
|
33201
33219
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
33202
33220
|
`);
|
|
33203
33221
|
}
|
|
33204
|
-
function
|
|
33222
|
+
function up1022(db) {
|
|
33205
33223
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
33206
33224
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
33207
33225
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -33210,7 +33228,7 @@ function up1012(db) {
|
|
|
33210
33228
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
33211
33229
|
}
|
|
33212
33230
|
}
|
|
33213
|
-
function
|
|
33231
|
+
function up1032(db) {
|
|
33214
33232
|
db.exec(`
|
|
33215
33233
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
33216
33234
|
id TEXT PRIMARY KEY,
|
|
@@ -33232,7 +33250,7 @@ function up1022(db) {
|
|
|
33232
33250
|
function hasColumn152(db, table, column) {
|
|
33233
33251
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33234
33252
|
}
|
|
33235
|
-
function
|
|
33253
|
+
function up1042(db) {
|
|
33236
33254
|
const requiredMemoryColumns = [
|
|
33237
33255
|
"content_hash",
|
|
33238
33256
|
"normalized_content",
|
|
@@ -33283,7 +33301,7 @@ function up1032(db) {
|
|
|
33283
33301
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
33284
33302
|
`);
|
|
33285
33303
|
}
|
|
33286
|
-
function
|
|
33304
|
+
function up1052(db) {
|
|
33287
33305
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
33288
33306
|
if (tables.length !== 2)
|
|
33289
33307
|
return;
|
|
@@ -33306,7 +33324,7 @@ function tableExists4(db, table) {
|
|
|
33306
33324
|
function hasColumn162(db, table, column) {
|
|
33307
33325
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33308
33326
|
}
|
|
33309
|
-
function
|
|
33327
|
+
function up1062(db) {
|
|
33310
33328
|
db.exec(`
|
|
33311
33329
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
33312
33330
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -33349,7 +33367,7 @@ function up1052(db) {
|
|
|
33349
33367
|
`);
|
|
33350
33368
|
}
|
|
33351
33369
|
}
|
|
33352
|
-
function
|
|
33370
|
+
function up1072(db) {
|
|
33353
33371
|
db.exec(`
|
|
33354
33372
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
33355
33373
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -33438,7 +33456,7 @@ function up1062(db) {
|
|
|
33438
33456
|
function hasColumn172(db, table, column) {
|
|
33439
33457
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33440
33458
|
}
|
|
33441
|
-
function
|
|
33459
|
+
function up1082(db) {
|
|
33442
33460
|
if (!hasColumn172(db, "memories", "review_after")) {
|
|
33443
33461
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
33444
33462
|
}
|
|
@@ -33454,14 +33472,14 @@ var TOKEN_COLUMNS2 = [
|
|
|
33454
33472
|
["tokens_cache_write", "INTEGER"],
|
|
33455
33473
|
["tokens_cost", "REAL"]
|
|
33456
33474
|
];
|
|
33457
|
-
function
|
|
33475
|
+
function up1092(db) {
|
|
33458
33476
|
for (const [column, type] of TOKEN_COLUMNS2) {
|
|
33459
33477
|
if (!hasColumn182(db, "dreaming_passes", column)) {
|
|
33460
33478
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
33461
33479
|
}
|
|
33462
33480
|
}
|
|
33463
33481
|
}
|
|
33464
|
-
function
|
|
33482
|
+
function up1102(db) {
|
|
33465
33483
|
db.exec(`
|
|
33466
33484
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
33467
33485
|
day TEXT NOT NULL,
|
|
@@ -33474,7 +33492,7 @@ function up1092(db) {
|
|
|
33474
33492
|
);
|
|
33475
33493
|
`);
|
|
33476
33494
|
}
|
|
33477
|
-
function
|
|
33495
|
+
function up1112(db) {
|
|
33478
33496
|
db.exec(`
|
|
33479
33497
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
33480
33498
|
id TEXT PRIMARY KEY,
|
|
@@ -33482,7 +33500,7 @@ function up1102(db) {
|
|
|
33482
33500
|
);
|
|
33483
33501
|
`);
|
|
33484
33502
|
}
|
|
33485
|
-
function
|
|
33503
|
+
function up1122(db) {
|
|
33486
33504
|
db.exec(`
|
|
33487
33505
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
33488
33506
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -33493,7 +33511,7 @@ function hasColumn192(db, table, column) {
|
|
|
33493
33511
|
return rows.some((row) => row.name === column);
|
|
33494
33512
|
}
|
|
33495
33513
|
var COLUMNS22 = ["first_remember_at", "first_recall_at"];
|
|
33496
|
-
function
|
|
33514
|
+
function up1132(db) {
|
|
33497
33515
|
for (const column of COLUMNS22) {
|
|
33498
33516
|
if (!hasColumn192(db, "telemetry_install", column)) {
|
|
33499
33517
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -33509,7 +33527,7 @@ function addColumnIfMissing232(db, column, definition) {
|
|
|
33509
33527
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33510
33528
|
}
|
|
33511
33529
|
}
|
|
33512
|
-
function
|
|
33530
|
+
function up1142(db) {
|
|
33513
33531
|
addColumnIfMissing232(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
33514
33532
|
addColumnIfMissing232(db, "claim_token", "TEXT");
|
|
33515
33533
|
addColumnIfMissing232(db, "claimed_at", "TEXT");
|
|
@@ -33518,7 +33536,7 @@ function up1132(db) {
|
|
|
33518
33536
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
33519
33537
|
`);
|
|
33520
33538
|
}
|
|
33521
|
-
function
|
|
33539
|
+
function up1152(db) {
|
|
33522
33540
|
db.exec(`
|
|
33523
33541
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
33524
33542
|
session_key TEXT NOT NULL,
|
|
@@ -33539,7 +33557,7 @@ function up1142(db) {
|
|
|
33539
33557
|
ON session_claims(agent_id, state, expires_at);
|
|
33540
33558
|
`);
|
|
33541
33559
|
}
|
|
33542
|
-
function
|
|
33560
|
+
function up1162(db) {
|
|
33543
33561
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
33544
33562
|
if (table == null)
|
|
33545
33563
|
return;
|
|
@@ -33548,7 +33566,7 @@ function up1152(db) {
|
|
|
33548
33566
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
33549
33567
|
`);
|
|
33550
33568
|
}
|
|
33551
|
-
function
|
|
33569
|
+
function up1172(db) {
|
|
33552
33570
|
db.exec(`
|
|
33553
33571
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
33554
33572
|
id TEXT PRIMARY KEY,
|
|
@@ -33605,7 +33623,7 @@ function addColumnIfMissing242(db, column, definition) {
|
|
|
33605
33623
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
33606
33624
|
}
|
|
33607
33625
|
}
|
|
33608
|
-
function
|
|
33626
|
+
function up1182(db) {
|
|
33609
33627
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
33610
33628
|
if (table == null)
|
|
33611
33629
|
return;
|
|
@@ -33806,7 +33824,7 @@ function backfillTranscriptsFromSummaryJobs2(db) {
|
|
|
33806
33824
|
insert.run(...values);
|
|
33807
33825
|
}
|
|
33808
33826
|
}
|
|
33809
|
-
function
|
|
33827
|
+
function up1192(db) {
|
|
33810
33828
|
if (!hasTable42(db, "session_transcripts"))
|
|
33811
33829
|
return;
|
|
33812
33830
|
addColumnIfMissing252(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -33859,7 +33877,7 @@ function up1182(db) {
|
|
|
33859
33877
|
ON session_transcripts(agent_id, content_hash);
|
|
33860
33878
|
`);
|
|
33861
33879
|
}
|
|
33862
|
-
function
|
|
33880
|
+
function up1202(db) {
|
|
33863
33881
|
db.exec(`
|
|
33864
33882
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
33865
33883
|
ON memory_jobs(status)
|
|
@@ -33878,12 +33896,12 @@ function up1192(db) {
|
|
|
33878
33896
|
function hasColumn222(db, table, column) {
|
|
33879
33897
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33880
33898
|
}
|
|
33881
|
-
function
|
|
33899
|
+
function up1212(db) {
|
|
33882
33900
|
if (!hasColumn222(db, "telemetry_install", "last_seen_version")) {
|
|
33883
33901
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
33884
33902
|
}
|
|
33885
33903
|
}
|
|
33886
|
-
function
|
|
33904
|
+
function up1222(db) {
|
|
33887
33905
|
db.exec(`
|
|
33888
33906
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
33889
33907
|
agent_id TEXT NOT NULL,
|
|
@@ -33912,7 +33930,7 @@ function addColumnIfMissing262(db, column, definition) {
|
|
|
33912
33930
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33913
33931
|
}
|
|
33914
33932
|
}
|
|
33915
|
-
function
|
|
33933
|
+
function up1232(db) {
|
|
33916
33934
|
addColumnIfMissing262(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
33917
33935
|
addColumnIfMissing262(db, "last_attempt_at", "TEXT");
|
|
33918
33936
|
addColumnIfMissing262(db, "sent_at", "TEXT");
|
|
@@ -33933,7 +33951,7 @@ function up1222(db) {
|
|
|
33933
33951
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
33934
33952
|
`);
|
|
33935
33953
|
}
|
|
33936
|
-
function
|
|
33954
|
+
function up1242(db) {
|
|
33937
33955
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
33938
33956
|
const names = new Set(columns.map((column) => column.name));
|
|
33939
33957
|
if (!names.has("failure_class")) {
|
|
@@ -33950,7 +33968,7 @@ function up1232(db) {
|
|
|
33950
33968
|
}
|
|
33951
33969
|
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)");
|
|
33952
33970
|
}
|
|
33953
|
-
function
|
|
33971
|
+
function up1252(db) {
|
|
33954
33972
|
db.exec(`
|
|
33955
33973
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
33956
33974
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -33974,7 +33992,7 @@ function up1242(db) {
|
|
|
33974
33992
|
ON embedding_index_failures(source_type, source_id);
|
|
33975
33993
|
`);
|
|
33976
33994
|
}
|
|
33977
|
-
function
|
|
33995
|
+
function up1262(db) {
|
|
33978
33996
|
db.exec(`
|
|
33979
33997
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
33980
33998
|
id TEXT PRIMARY KEY,
|
|
@@ -34024,7 +34042,7 @@ function backfillTable2(db, params) {
|
|
|
34024
34042
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
34025
34043
|
backfill2(db, rows, params.sourceKind, params.scannedAt);
|
|
34026
34044
|
}
|
|
34027
|
-
function
|
|
34045
|
+
function up1272(db) {
|
|
34028
34046
|
db.exec(`
|
|
34029
34047
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
34030
34048
|
agent_id TEXT NOT NULL,
|
|
@@ -34081,7 +34099,7 @@ function up1262(db) {
|
|
|
34081
34099
|
scannedAt
|
|
34082
34100
|
});
|
|
34083
34101
|
}
|
|
34084
|
-
function
|
|
34102
|
+
function up1282(db) {
|
|
34085
34103
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
34086
34104
|
if (!table)
|
|
34087
34105
|
return;
|
|
@@ -34115,7 +34133,7 @@ function up1272(db) {
|
|
|
34115
34133
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
34116
34134
|
`);
|
|
34117
34135
|
}
|
|
34118
|
-
function
|
|
34136
|
+
function up1292(db) {
|
|
34119
34137
|
db.exec(`
|
|
34120
34138
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
34121
34139
|
id TEXT PRIMARY KEY,
|
|
@@ -34171,7 +34189,7 @@ function up1282(db) {
|
|
|
34171
34189
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
34172
34190
|
`);
|
|
34173
34191
|
}
|
|
34174
|
-
function
|
|
34192
|
+
function up1302(db) {
|
|
34175
34193
|
db.exec(`
|
|
34176
34194
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
34177
34195
|
ON memory_jobs(status, created_at)
|
|
@@ -34186,7 +34204,7 @@ function up1292(db) {
|
|
|
34186
34204
|
function tableExists32(db, table) {
|
|
34187
34205
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
34188
34206
|
}
|
|
34189
|
-
function
|
|
34207
|
+
function up1312(db) {
|
|
34190
34208
|
if (!tableExists32(db, "memory_jobs"))
|
|
34191
34209
|
return;
|
|
34192
34210
|
if (!tableExists32(db, "job_cancellations")) {
|
|
@@ -34235,7 +34253,7 @@ function up1302(db) {
|
|
|
34235
34253
|
AND status IN ('pending', 'leased');
|
|
34236
34254
|
`);
|
|
34237
34255
|
}
|
|
34238
|
-
function
|
|
34256
|
+
function up1322(db) {
|
|
34239
34257
|
db.exec(`
|
|
34240
34258
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
34241
34259
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -34275,7 +34293,7 @@ function up1312(db) {
|
|
|
34275
34293
|
END;
|
|
34276
34294
|
`);
|
|
34277
34295
|
}
|
|
34278
|
-
function
|
|
34296
|
+
function up1332(db) {
|
|
34279
34297
|
db.exec(`
|
|
34280
34298
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
34281
34299
|
agent_id TEXT NOT NULL,
|
|
@@ -34298,13 +34316,13 @@ function up1322(db) {
|
|
|
34298
34316
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
34299
34317
|
`);
|
|
34300
34318
|
}
|
|
34301
|
-
function
|
|
34319
|
+
function up1342(db) {
|
|
34302
34320
|
db.exec(`
|
|
34303
34321
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
34304
34322
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
34305
34323
|
`);
|
|
34306
34324
|
}
|
|
34307
|
-
function
|
|
34325
|
+
function up1352(db) {
|
|
34308
34326
|
db.exec(`
|
|
34309
34327
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
34310
34328
|
id TEXT PRIMARY KEY,
|
|
@@ -34356,7 +34374,7 @@ function up1342(db) {
|
|
|
34356
34374
|
if (!names.has("format_version"))
|
|
34357
34375
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
34358
34376
|
}
|
|
34359
|
-
function
|
|
34377
|
+
function up1362(db) {
|
|
34360
34378
|
db.exec(`
|
|
34361
34379
|
CREATE TABLE memory_head_entries_v134 (
|
|
34362
34380
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -34374,7 +34392,7 @@ function up1352(db) {
|
|
|
34374
34392
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
34375
34393
|
`);
|
|
34376
34394
|
}
|
|
34377
|
-
function
|
|
34395
|
+
function up1372(db) {
|
|
34378
34396
|
db.exec(`
|
|
34379
34397
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
34380
34398
|
agent_id TEXT NOT NULL,
|
|
@@ -34390,7 +34408,7 @@ function up1362(db) {
|
|
|
34390
34408
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
34391
34409
|
`);
|
|
34392
34410
|
}
|
|
34393
|
-
function
|
|
34411
|
+
function up1382(db) {
|
|
34394
34412
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r22) => r22.name));
|
|
34395
34413
|
for (const [name, type] of [
|
|
34396
34414
|
["entry_id", "TEXT"],
|
|
@@ -34404,7 +34422,7 @@ function up1372(db) {
|
|
|
34404
34422
|
}
|
|
34405
34423
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
34406
34424
|
}
|
|
34407
|
-
function
|
|
34425
|
+
function up1392(db) {
|
|
34408
34426
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r22) => r22.name));
|
|
34409
34427
|
for (const [name, type] of [
|
|
34410
34428
|
["head_revision", "INTEGER"],
|
|
@@ -34426,7 +34444,7 @@ function addColumnIfMissing272(db, table, column, definition) {
|
|
|
34426
34444
|
if (!hasColumn252(db, table, column))
|
|
34427
34445
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34428
34446
|
}
|
|
34429
|
-
function
|
|
34447
|
+
function up1402(db) {
|
|
34430
34448
|
addColumnIfMissing272(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
34431
34449
|
db.exec(`
|
|
34432
34450
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -34731,7 +34749,7 @@ function up1392(db) {
|
|
|
34731
34749
|
GROUP BY j.agent_id;
|
|
34732
34750
|
`);
|
|
34733
34751
|
}
|
|
34734
|
-
function
|
|
34752
|
+
function up1412(db) {
|
|
34735
34753
|
db.exec(`
|
|
34736
34754
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
34737
34755
|
agent_id TEXT NOT NULL,
|
|
@@ -34747,7 +34765,7 @@ function up1402(db) {
|
|
|
34747
34765
|
ON native_source_sync_state(agent_id, status);
|
|
34748
34766
|
`);
|
|
34749
34767
|
}
|
|
34750
|
-
function
|
|
34768
|
+
function up1422(db) {
|
|
34751
34769
|
db.exec(`
|
|
34752
34770
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
34753
34771
|
agent_id TEXT NOT NULL,
|
|
@@ -34759,7 +34777,7 @@ function up1412(db) {
|
|
|
34759
34777
|
);
|
|
34760
34778
|
`);
|
|
34761
34779
|
}
|
|
34762
|
-
function
|
|
34780
|
+
function up1432(db) {
|
|
34763
34781
|
db.exec(`
|
|
34764
34782
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
34765
34783
|
agent_id TEXT NOT NULL,
|
|
@@ -34773,13 +34791,13 @@ function up1422(db) {
|
|
|
34773
34791
|
);
|
|
34774
34792
|
`);
|
|
34775
34793
|
}
|
|
34776
|
-
function
|
|
34794
|
+
function up1442(db) {
|
|
34777
34795
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
34778
34796
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
34779
34797
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
34780
34798
|
}
|
|
34781
34799
|
}
|
|
34782
|
-
function
|
|
34800
|
+
function up1452(db) {
|
|
34783
34801
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34784
34802
|
const additions = [
|
|
34785
34803
|
["migration_phase", "TEXT"],
|
|
@@ -34814,13 +34832,13 @@ function up1442(db) {
|
|
|
34814
34832
|
`);
|
|
34815
34833
|
}
|
|
34816
34834
|
}
|
|
34817
|
-
function
|
|
34835
|
+
function up1462(db) {
|
|
34818
34836
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34819
34837
|
if (!columns.has("lease_token")) {
|
|
34820
34838
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
34821
34839
|
}
|
|
34822
34840
|
}
|
|
34823
|
-
function
|
|
34841
|
+
function up1472(db) {
|
|
34824
34842
|
db.exec(`
|
|
34825
34843
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
34826
34844
|
agent_id TEXT NOT NULL,
|
|
@@ -34838,7 +34856,7 @@ function up1462(db) {
|
|
|
34838
34856
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
34839
34857
|
`);
|
|
34840
34858
|
}
|
|
34841
|
-
function
|
|
34859
|
+
function up1482(db) {
|
|
34842
34860
|
db.exec(`
|
|
34843
34861
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
34844
34862
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -34905,16 +34923,16 @@ function up1472(db) {
|
|
|
34905
34923
|
}
|
|
34906
34924
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
34907
34925
|
}
|
|
34908
|
-
function
|
|
34926
|
+
function up1492(db) {
|
|
34909
34927
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
34910
34928
|
}
|
|
34911
|
-
function
|
|
34929
|
+
function up1502(db) {
|
|
34912
34930
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
34913
34931
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
34914
34932
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
34915
34933
|
}
|
|
34916
34934
|
}
|
|
34917
|
-
function
|
|
34935
|
+
function up1512(db) {
|
|
34918
34936
|
const addColumn = (table, column, definition) => {
|
|
34919
34937
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
34920
34938
|
let exists;
|
|
@@ -34935,7 +34953,7 @@ function addColumnIfMissing282(db, table, column, definition) {
|
|
|
34935
34953
|
if (!columns.some((row) => row.name === column))
|
|
34936
34954
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34937
34955
|
}
|
|
34938
|
-
function
|
|
34956
|
+
function up1522(db) {
|
|
34939
34957
|
addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
34940
34958
|
addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
34941
34959
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -35089,13 +35107,13 @@ var MIGRATIONS2 = [
|
|
|
35089
35107
|
{
|
|
35090
35108
|
version: 1,
|
|
35091
35109
|
name: "baseline",
|
|
35092
|
-
up:
|
|
35110
|
+
up: up310,
|
|
35093
35111
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
35094
35112
|
},
|
|
35095
35113
|
{
|
|
35096
35114
|
version: 2,
|
|
35097
35115
|
name: "pipeline-v2",
|
|
35098
|
-
up:
|
|
35116
|
+
up: up410,
|
|
35099
35117
|
artifacts: {
|
|
35100
35118
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
35101
35119
|
}
|
|
@@ -35103,12 +35121,12 @@ var MIGRATIONS2 = [
|
|
|
35103
35121
|
{
|
|
35104
35122
|
version: 3,
|
|
35105
35123
|
name: "unique-content-hash",
|
|
35106
|
-
up:
|
|
35124
|
+
up: up510
|
|
35107
35125
|
},
|
|
35108
35126
|
{
|
|
35109
35127
|
version: 4,
|
|
35110
35128
|
name: "history-actor-and-retention",
|
|
35111
|
-
up:
|
|
35129
|
+
up: up610,
|
|
35112
35130
|
artifacts: {
|
|
35113
35131
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
35114
35132
|
}
|
|
@@ -35116,7 +35134,7 @@ var MIGRATIONS2 = [
|
|
|
35116
35134
|
{
|
|
35117
35135
|
version: 5,
|
|
35118
35136
|
name: "graph-extended",
|
|
35119
|
-
up:
|
|
35137
|
+
up: up710,
|
|
35120
35138
|
artifacts: {
|
|
35121
35139
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
35122
35140
|
}
|
|
@@ -35124,7 +35142,7 @@ var MIGRATIONS2 = [
|
|
|
35124
35142
|
{
|
|
35125
35143
|
version: 6,
|
|
35126
35144
|
name: "idempotency-key",
|
|
35127
|
-
up:
|
|
35145
|
+
up: up810,
|
|
35128
35146
|
artifacts: {
|
|
35129
35147
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
35130
35148
|
}
|
|
@@ -35132,42 +35150,42 @@ var MIGRATIONS2 = [
|
|
|
35132
35150
|
{
|
|
35133
35151
|
version: 7,
|
|
35134
35152
|
name: "documents-and-connectors",
|
|
35135
|
-
up:
|
|
35153
|
+
up: up910,
|
|
35136
35154
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
35137
35155
|
},
|
|
35138
35156
|
{
|
|
35139
35157
|
version: 8,
|
|
35140
35158
|
name: "embeddings-unique-hash",
|
|
35141
|
-
up:
|
|
35159
|
+
up: up1010
|
|
35142
35160
|
},
|
|
35143
35161
|
{
|
|
35144
35162
|
version: 9,
|
|
35145
35163
|
name: "summary-jobs",
|
|
35146
|
-
up:
|
|
35164
|
+
up: up1110,
|
|
35147
35165
|
artifacts: { tables: ["summary_jobs"] }
|
|
35148
35166
|
},
|
|
35149
35167
|
{
|
|
35150
35168
|
version: 10,
|
|
35151
35169
|
name: "umap-cache",
|
|
35152
|
-
up:
|
|
35170
|
+
up: up1210,
|
|
35153
35171
|
artifacts: { tables: ["umap_cache"] }
|
|
35154
35172
|
},
|
|
35155
35173
|
{
|
|
35156
35174
|
version: 11,
|
|
35157
35175
|
name: "session-scores",
|
|
35158
|
-
up:
|
|
35176
|
+
up: up1310,
|
|
35159
35177
|
artifacts: { tables: ["session_scores"] }
|
|
35160
35178
|
},
|
|
35161
35179
|
{
|
|
35162
35180
|
version: 12,
|
|
35163
35181
|
name: "scheduled-tasks",
|
|
35164
|
-
up:
|
|
35182
|
+
up: up1410,
|
|
35165
35183
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
35166
35184
|
},
|
|
35167
35185
|
{
|
|
35168
35186
|
version: 13,
|
|
35169
35187
|
name: "ingestion-tracking",
|
|
35170
|
-
up:
|
|
35188
|
+
up: up154,
|
|
35171
35189
|
artifacts: {
|
|
35172
35190
|
columns: [
|
|
35173
35191
|
{ table: "memories", column: "source_path" },
|
|
@@ -35178,13 +35196,13 @@ var MIGRATIONS2 = [
|
|
|
35178
35196
|
{
|
|
35179
35197
|
version: 14,
|
|
35180
35198
|
name: "telemetry",
|
|
35181
|
-
up:
|
|
35199
|
+
up: up162,
|
|
35182
35200
|
artifacts: { tables: ["telemetry_events"] }
|
|
35183
35201
|
},
|
|
35184
35202
|
{
|
|
35185
35203
|
version: 15,
|
|
35186
35204
|
name: "session-memories",
|
|
35187
|
-
up:
|
|
35205
|
+
up: up172,
|
|
35188
35206
|
artifacts: {
|
|
35189
35207
|
tables: ["session_memories"],
|
|
35190
35208
|
columns: [
|
|
@@ -35196,13 +35214,13 @@ var MIGRATIONS2 = [
|
|
|
35196
35214
|
{
|
|
35197
35215
|
version: 16,
|
|
35198
35216
|
name: "session-checkpoints",
|
|
35199
|
-
up:
|
|
35217
|
+
up: up182,
|
|
35200
35218
|
artifacts: { tables: ["session_checkpoints"] }
|
|
35201
35219
|
},
|
|
35202
35220
|
{
|
|
35203
35221
|
version: 17,
|
|
35204
35222
|
name: "task-skills",
|
|
35205
|
-
up:
|
|
35223
|
+
up: up192,
|
|
35206
35224
|
artifacts: {
|
|
35207
35225
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
35208
35226
|
}
|
|
@@ -35210,13 +35228,13 @@ var MIGRATIONS2 = [
|
|
|
35210
35228
|
{
|
|
35211
35229
|
version: 18,
|
|
35212
35230
|
name: "skill-meta",
|
|
35213
|
-
up:
|
|
35231
|
+
up: up202,
|
|
35214
35232
|
artifacts: { tables: ["skill_meta"] }
|
|
35215
35233
|
},
|
|
35216
35234
|
{
|
|
35217
35235
|
version: 19,
|
|
35218
35236
|
name: "knowledge-structure",
|
|
35219
|
-
up:
|
|
35237
|
+
up: up212,
|
|
35220
35238
|
artifacts: {
|
|
35221
35239
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
35222
35240
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -35225,7 +35243,7 @@ var MIGRATIONS2 = [
|
|
|
35225
35243
|
{
|
|
35226
35244
|
version: 20,
|
|
35227
35245
|
name: "session-structural-columns",
|
|
35228
|
-
up:
|
|
35246
|
+
up: up222,
|
|
35229
35247
|
artifacts: {
|
|
35230
35248
|
columns: [
|
|
35231
35249
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -35238,7 +35256,7 @@ var MIGRATIONS2 = [
|
|
|
35238
35256
|
{
|
|
35239
35257
|
version: 21,
|
|
35240
35258
|
name: "checkpoint-structural",
|
|
35241
|
-
up:
|
|
35259
|
+
up: up232,
|
|
35242
35260
|
artifacts: {
|
|
35243
35261
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
35244
35262
|
}
|
|
@@ -35246,7 +35264,7 @@ var MIGRATIONS2 = [
|
|
|
35246
35264
|
{
|
|
35247
35265
|
version: 22,
|
|
35248
35266
|
name: "entity-pinning",
|
|
35249
|
-
up:
|
|
35267
|
+
up: up242,
|
|
35250
35268
|
artifacts: {
|
|
35251
35269
|
columns: [
|
|
35252
35270
|
{ table: "entities", column: "pinned" },
|
|
@@ -35257,17 +35275,17 @@ var MIGRATIONS2 = [
|
|
|
35257
35275
|
{
|
|
35258
35276
|
version: 23,
|
|
35259
35277
|
name: "retired-scorer-gap",
|
|
35260
|
-
up:
|
|
35278
|
+
up: up252
|
|
35261
35279
|
},
|
|
35262
35280
|
{
|
|
35263
35281
|
version: 24,
|
|
35264
35282
|
name: "retired-scorer-gap",
|
|
35265
|
-
up:
|
|
35283
|
+
up: up262
|
|
35266
35284
|
},
|
|
35267
35285
|
{
|
|
35268
35286
|
version: 25,
|
|
35269
35287
|
name: "agent-feedback",
|
|
35270
|
-
up:
|
|
35288
|
+
up: up272,
|
|
35271
35289
|
artifacts: {
|
|
35272
35290
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
35273
35291
|
}
|
|
@@ -35275,32 +35293,32 @@ var MIGRATIONS2 = [
|
|
|
35275
35293
|
{
|
|
35276
35294
|
version: 26,
|
|
35277
35295
|
name: "retired-scorer-gap",
|
|
35278
|
-
up:
|
|
35296
|
+
up: up282
|
|
35279
35297
|
},
|
|
35280
35298
|
{
|
|
35281
35299
|
version: 27,
|
|
35282
35300
|
name: "backfill-canonical-names",
|
|
35283
|
-
up:
|
|
35301
|
+
up: up292
|
|
35284
35302
|
},
|
|
35285
35303
|
{
|
|
35286
35304
|
version: 28,
|
|
35287
35305
|
name: "lossless-retention",
|
|
35288
|
-
up:
|
|
35306
|
+
up: up302
|
|
35289
35307
|
},
|
|
35290
35308
|
{
|
|
35291
35309
|
version: 29,
|
|
35292
35310
|
name: "session-summary-dag",
|
|
35293
|
-
up:
|
|
35311
|
+
up: up312
|
|
35294
35312
|
},
|
|
35295
35313
|
{
|
|
35296
35314
|
version: 30,
|
|
35297
35315
|
name: "nullable-memory-job-memory-id",
|
|
35298
|
-
up:
|
|
35316
|
+
up: up322
|
|
35299
35317
|
},
|
|
35300
35318
|
{
|
|
35301
35319
|
version: 31,
|
|
35302
35320
|
name: "dependency-reason",
|
|
35303
|
-
up:
|
|
35321
|
+
up: up332,
|
|
35304
35322
|
artifacts: {
|
|
35305
35323
|
columns: [
|
|
35306
35324
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -35311,7 +35329,7 @@ var MIGRATIONS2 = [
|
|
|
35311
35329
|
{
|
|
35312
35330
|
version: 32,
|
|
35313
35331
|
name: "embeddings-vector-column",
|
|
35314
|
-
up:
|
|
35332
|
+
up: up342,
|
|
35315
35333
|
artifacts: {
|
|
35316
35334
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
35317
35335
|
}
|
|
@@ -35319,7 +35337,7 @@ var MIGRATIONS2 = [
|
|
|
35319
35337
|
{
|
|
35320
35338
|
version: 33,
|
|
35321
35339
|
name: "scope",
|
|
35322
|
-
up:
|
|
35340
|
+
up: up352,
|
|
35323
35341
|
artifacts: {
|
|
35324
35342
|
columns: [{ table: "memories", column: "scope" }]
|
|
35325
35343
|
}
|
|
@@ -35327,17 +35345,17 @@ var MIGRATIONS2 = [
|
|
|
35327
35345
|
{
|
|
35328
35346
|
version: 34,
|
|
35329
35347
|
name: "scope-aware-dedup",
|
|
35330
|
-
up:
|
|
35348
|
+
up: up362
|
|
35331
35349
|
},
|
|
35332
35350
|
{
|
|
35333
35351
|
version: 35,
|
|
35334
35352
|
name: "entity-fts",
|
|
35335
|
-
up:
|
|
35353
|
+
up: up372
|
|
35336
35354
|
},
|
|
35337
35355
|
{
|
|
35338
35356
|
version: 36,
|
|
35339
35357
|
name: "dependency-confidence",
|
|
35340
|
-
up:
|
|
35358
|
+
up: up382,
|
|
35341
35359
|
artifacts: {
|
|
35342
35360
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
35343
35361
|
}
|
|
@@ -35345,7 +35363,7 @@ var MIGRATIONS2 = [
|
|
|
35345
35363
|
{
|
|
35346
35364
|
version: 37,
|
|
35347
35365
|
name: "entity-communities",
|
|
35348
|
-
up:
|
|
35366
|
+
up: up392,
|
|
35349
35367
|
artifacts: {
|
|
35350
35368
|
tables: ["entity_communities"],
|
|
35351
35369
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -35354,24 +35372,24 @@ var MIGRATIONS2 = [
|
|
|
35354
35372
|
{
|
|
35355
35373
|
version: 38,
|
|
35356
35374
|
name: "memory-hints",
|
|
35357
|
-
up:
|
|
35375
|
+
up: up402,
|
|
35358
35376
|
artifacts: { tables: ["memory_hints"] }
|
|
35359
35377
|
},
|
|
35360
35378
|
{
|
|
35361
35379
|
version: 39,
|
|
35362
35380
|
name: "dedup-entity-dependencies",
|
|
35363
|
-
up:
|
|
35381
|
+
up: up412
|
|
35364
35382
|
},
|
|
35365
35383
|
{
|
|
35366
35384
|
version: 40,
|
|
35367
35385
|
name: "session-transcripts",
|
|
35368
|
-
up:
|
|
35386
|
+
up: up422,
|
|
35369
35387
|
artifacts: { tables: ["session_transcripts"] }
|
|
35370
35388
|
},
|
|
35371
35389
|
{
|
|
35372
35390
|
version: 41,
|
|
35373
35391
|
name: "path-feedback",
|
|
35374
|
-
up:
|
|
35392
|
+
up: up432,
|
|
35375
35393
|
artifacts: {
|
|
35376
35394
|
tables: [
|
|
35377
35395
|
"path_feedback_events",
|
|
@@ -35386,7 +35404,7 @@ var MIGRATIONS2 = [
|
|
|
35386
35404
|
{
|
|
35387
35405
|
version: 42,
|
|
35388
35406
|
name: "session-memories-agent-id",
|
|
35389
|
-
up:
|
|
35407
|
+
up: up442,
|
|
35390
35408
|
artifacts: {
|
|
35391
35409
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
35392
35410
|
}
|
|
@@ -35394,7 +35412,7 @@ var MIGRATIONS2 = [
|
|
|
35394
35412
|
{
|
|
35395
35413
|
version: 43,
|
|
35396
35414
|
name: "agents-table",
|
|
35397
|
-
up:
|
|
35415
|
+
up: up452,
|
|
35398
35416
|
artifacts: {
|
|
35399
35417
|
tables: ["agents"],
|
|
35400
35418
|
columns: [
|
|
@@ -35406,7 +35424,7 @@ var MIGRATIONS2 = [
|
|
|
35406
35424
|
{
|
|
35407
35425
|
version: 44,
|
|
35408
35426
|
name: "memory-md-temporal-head",
|
|
35409
|
-
up:
|
|
35427
|
+
up: up462,
|
|
35410
35428
|
artifacts: {
|
|
35411
35429
|
columns: [
|
|
35412
35430
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -35418,7 +35436,7 @@ var MIGRATIONS2 = [
|
|
|
35418
35436
|
{
|
|
35419
35437
|
version: 45,
|
|
35420
35438
|
name: "lossless-working-memory-hardening",
|
|
35421
|
-
up:
|
|
35439
|
+
up: up472,
|
|
35422
35440
|
artifacts: {
|
|
35423
35441
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
35424
35442
|
columns: [
|
|
@@ -35431,17 +35449,17 @@ var MIGRATIONS2 = [
|
|
|
35431
35449
|
{
|
|
35432
35450
|
version: 46,
|
|
35433
35451
|
name: "session-summary-uniqueness",
|
|
35434
|
-
up:
|
|
35452
|
+
up: up482
|
|
35435
35453
|
},
|
|
35436
35454
|
{
|
|
35437
35455
|
version: 47,
|
|
35438
35456
|
name: "agent-scoped-temporal-uniqueness",
|
|
35439
|
-
up:
|
|
35457
|
+
up: up492
|
|
35440
35458
|
},
|
|
35441
35459
|
{
|
|
35442
35460
|
version: 48,
|
|
35443
35461
|
name: "thread-heads",
|
|
35444
|
-
up:
|
|
35462
|
+
up: up502,
|
|
35445
35463
|
artifacts: {
|
|
35446
35464
|
tables: ["memory_thread_heads"]
|
|
35447
35465
|
}
|
|
@@ -35449,7 +35467,7 @@ var MIGRATIONS2 = [
|
|
|
35449
35467
|
{
|
|
35450
35468
|
version: 49,
|
|
35451
35469
|
name: "session-extract-cursors",
|
|
35452
|
-
up:
|
|
35470
|
+
up: up512,
|
|
35453
35471
|
artifacts: {
|
|
35454
35472
|
tables: ["session_extract_cursors"]
|
|
35455
35473
|
}
|
|
@@ -35457,7 +35475,7 @@ var MIGRATIONS2 = [
|
|
|
35457
35475
|
{
|
|
35458
35476
|
version: 50,
|
|
35459
35477
|
name: "related-to-audit",
|
|
35460
|
-
up:
|
|
35478
|
+
up: up522,
|
|
35461
35479
|
artifacts: {
|
|
35462
35480
|
tables: ["entity_dependency_history"]
|
|
35463
35481
|
}
|
|
@@ -35465,7 +35483,7 @@ var MIGRATIONS2 = [
|
|
|
35465
35483
|
{
|
|
35466
35484
|
version: 51,
|
|
35467
35485
|
name: "memory-md-rolling-window-lineage",
|
|
35468
|
-
up:
|
|
35486
|
+
up: up532,
|
|
35469
35487
|
artifacts: {
|
|
35470
35488
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
35471
35489
|
columns: [
|
|
@@ -35480,7 +35498,7 @@ var MIGRATIONS2 = [
|
|
|
35480
35498
|
{
|
|
35481
35499
|
version: 52,
|
|
35482
35500
|
name: "mcp-invocations",
|
|
35483
|
-
up:
|
|
35501
|
+
up: up542,
|
|
35484
35502
|
artifacts: {
|
|
35485
35503
|
tables: ["mcp_invocations"]
|
|
35486
35504
|
}
|
|
@@ -35488,7 +35506,7 @@ var MIGRATIONS2 = [
|
|
|
35488
35506
|
{
|
|
35489
35507
|
version: 53,
|
|
35490
35508
|
name: "skill-invocations",
|
|
35491
|
-
up:
|
|
35509
|
+
up: up552,
|
|
35492
35510
|
artifacts: {
|
|
35493
35511
|
tables: ["skill_invocations"]
|
|
35494
35512
|
}
|
|
@@ -35496,7 +35514,7 @@ var MIGRATIONS2 = [
|
|
|
35496
35514
|
{
|
|
35497
35515
|
version: 54,
|
|
35498
35516
|
name: "task-agent-scope",
|
|
35499
|
-
up:
|
|
35517
|
+
up: up562,
|
|
35500
35518
|
artifacts: {
|
|
35501
35519
|
tables: ["task_scope_hints"]
|
|
35502
35520
|
}
|
|
@@ -35504,7 +35522,7 @@ var MIGRATIONS2 = [
|
|
|
35504
35522
|
{
|
|
35505
35523
|
version: 55,
|
|
35506
35524
|
name: "dreaming-state",
|
|
35507
|
-
up:
|
|
35525
|
+
up: up572,
|
|
35508
35526
|
artifacts: {
|
|
35509
35527
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
35510
35528
|
}
|
|
@@ -35512,22 +35530,22 @@ var MIGRATIONS2 = [
|
|
|
35512
35530
|
{
|
|
35513
35531
|
version: 56,
|
|
35514
35532
|
name: "agent-scoped-content-hash",
|
|
35515
|
-
up:
|
|
35533
|
+
up: up582
|
|
35516
35534
|
},
|
|
35517
35535
|
{
|
|
35518
35536
|
version: 57,
|
|
35519
35537
|
name: "memories-fts-tokenizer-repair",
|
|
35520
|
-
up:
|
|
35538
|
+
up: up592
|
|
35521
35539
|
},
|
|
35522
35540
|
{
|
|
35523
35541
|
version: 58,
|
|
35524
35542
|
name: "knowledge-graph-indices",
|
|
35525
|
-
up:
|
|
35543
|
+
up: up602
|
|
35526
35544
|
},
|
|
35527
35545
|
{
|
|
35528
35546
|
version: 59,
|
|
35529
35547
|
name: "entity-attribute-claim-key",
|
|
35530
|
-
up:
|
|
35548
|
+
up: up612,
|
|
35531
35549
|
artifacts: {
|
|
35532
35550
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
35533
35551
|
}
|
|
@@ -35535,7 +35553,7 @@ var MIGRATIONS2 = [
|
|
|
35535
35553
|
{
|
|
35536
35554
|
version: 60,
|
|
35537
35555
|
name: "entity-attribute-group-key",
|
|
35538
|
-
up:
|
|
35556
|
+
up: up622,
|
|
35539
35557
|
artifacts: {
|
|
35540
35558
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
35541
35559
|
}
|
|
@@ -35543,7 +35561,7 @@ var MIGRATIONS2 = [
|
|
|
35543
35561
|
{
|
|
35544
35562
|
version: 61,
|
|
35545
35563
|
name: "memory-artifact-source-mtime",
|
|
35546
|
-
up:
|
|
35564
|
+
up: up632,
|
|
35547
35565
|
artifacts: {
|
|
35548
35566
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
35549
35567
|
}
|
|
@@ -35551,7 +35569,7 @@ var MIGRATIONS2 = [
|
|
|
35551
35569
|
{
|
|
35552
35570
|
version: 62,
|
|
35553
35571
|
name: "memory-artifact-soft-delete",
|
|
35554
|
-
up:
|
|
35572
|
+
up: up642,
|
|
35555
35573
|
artifacts: {
|
|
35556
35574
|
columns: [
|
|
35557
35575
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -35562,12 +35580,12 @@ var MIGRATIONS2 = [
|
|
|
35562
35580
|
{
|
|
35563
35581
|
version: 63,
|
|
35564
35582
|
name: "content-only-memories-fts-update",
|
|
35565
|
-
up:
|
|
35583
|
+
up: up652
|
|
35566
35584
|
},
|
|
35567
35585
|
{
|
|
35568
35586
|
version: 64,
|
|
35569
35587
|
name: "source-graph-provenance",
|
|
35570
|
-
up:
|
|
35588
|
+
up: up662,
|
|
35571
35589
|
artifacts: {
|
|
35572
35590
|
columns: [
|
|
35573
35591
|
{ table: "entities", column: "source_path" },
|
|
@@ -35580,7 +35598,7 @@ var MIGRATIONS2 = [
|
|
|
35580
35598
|
{
|
|
35581
35599
|
version: 65,
|
|
35582
35600
|
name: "source-embedding-agent-scope",
|
|
35583
|
-
up:
|
|
35601
|
+
up: up672,
|
|
35584
35602
|
artifacts: {
|
|
35585
35603
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
35586
35604
|
}
|
|
@@ -35588,7 +35606,7 @@ var MIGRATIONS2 = [
|
|
|
35588
35606
|
{
|
|
35589
35607
|
version: 66,
|
|
35590
35608
|
name: "memory-search-telemetry",
|
|
35591
|
-
up:
|
|
35609
|
+
up: up682,
|
|
35592
35610
|
artifacts: {
|
|
35593
35611
|
tables: ["memory_search_telemetry"]
|
|
35594
35612
|
}
|
|
@@ -35596,7 +35614,7 @@ var MIGRATIONS2 = [
|
|
|
35596
35614
|
{
|
|
35597
35615
|
version: 67,
|
|
35598
35616
|
name: "ontology-proposals",
|
|
35599
|
-
up:
|
|
35617
|
+
up: up692,
|
|
35600
35618
|
artifacts: {
|
|
35601
35619
|
tables: ["ontology_proposals"],
|
|
35602
35620
|
columns: [
|
|
@@ -35610,7 +35628,7 @@ var MIGRATIONS2 = [
|
|
|
35610
35628
|
{
|
|
35611
35629
|
version: 68,
|
|
35612
35630
|
name: "daily-reflections",
|
|
35613
|
-
up:
|
|
35631
|
+
up: up702,
|
|
35614
35632
|
artifacts: {
|
|
35615
35633
|
tables: ["daily_reflections"]
|
|
35616
35634
|
}
|
|
@@ -35618,7 +35636,7 @@ var MIGRATIONS2 = [
|
|
|
35618
35636
|
{
|
|
35619
35637
|
version: 69,
|
|
35620
35638
|
name: "daily-reflections-multiple-insights",
|
|
35621
|
-
up:
|
|
35639
|
+
up: up712,
|
|
35622
35640
|
artifacts: {
|
|
35623
35641
|
tables: ["daily_reflections"]
|
|
35624
35642
|
}
|
|
@@ -35626,7 +35644,7 @@ var MIGRATIONS2 = [
|
|
|
35626
35644
|
{
|
|
35627
35645
|
version: 70,
|
|
35628
35646
|
name: "ontology-control-plane-state",
|
|
35629
|
-
up:
|
|
35647
|
+
up: up722,
|
|
35630
35648
|
artifacts: {
|
|
35631
35649
|
columns: [
|
|
35632
35650
|
{ table: "entities", column: "status" },
|
|
@@ -35641,7 +35659,7 @@ var MIGRATIONS2 = [
|
|
|
35641
35659
|
{
|
|
35642
35660
|
version: 71,
|
|
35643
35661
|
name: "epistemic-assertions",
|
|
35644
|
-
up:
|
|
35662
|
+
up: up732,
|
|
35645
35663
|
artifacts: {
|
|
35646
35664
|
tables: ["epistemic_assertions"]
|
|
35647
35665
|
}
|
|
@@ -35649,7 +35667,7 @@ var MIGRATIONS2 = [
|
|
|
35649
35667
|
{
|
|
35650
35668
|
version: 72,
|
|
35651
35669
|
name: "agent-scoped-idempotency-key",
|
|
35652
|
-
up:
|
|
35670
|
+
up: up742,
|
|
35653
35671
|
artifacts: {
|
|
35654
35672
|
columns: [
|
|
35655
35673
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -35660,7 +35678,7 @@ var MIGRATIONS2 = [
|
|
|
35660
35678
|
{
|
|
35661
35679
|
version: 73,
|
|
35662
35680
|
name: "recall-context-dedupe",
|
|
35663
|
-
up:
|
|
35681
|
+
up: up752,
|
|
35664
35682
|
artifacts: {
|
|
35665
35683
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
35666
35684
|
}
|
|
@@ -35668,7 +35686,7 @@ var MIGRATIONS2 = [
|
|
|
35668
35686
|
{
|
|
35669
35687
|
version: 74,
|
|
35670
35688
|
name: "aggregate-memory-links",
|
|
35671
|
-
up:
|
|
35689
|
+
up: up762,
|
|
35672
35690
|
artifacts: {
|
|
35673
35691
|
tables: ["aggregate_memory_sources"]
|
|
35674
35692
|
}
|
|
@@ -35676,7 +35694,7 @@ var MIGRATIONS2 = [
|
|
|
35676
35694
|
{
|
|
35677
35695
|
version: 75,
|
|
35678
35696
|
name: "memory-artifact-source-provenance",
|
|
35679
|
-
up:
|
|
35697
|
+
up: up772,
|
|
35680
35698
|
artifacts: {
|
|
35681
35699
|
columns: [
|
|
35682
35700
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -35690,7 +35708,7 @@ var MIGRATIONS2 = [
|
|
|
35690
35708
|
{
|
|
35691
35709
|
version: 76,
|
|
35692
35710
|
name: "temporal-edges",
|
|
35693
|
-
up:
|
|
35711
|
+
up: up782,
|
|
35694
35712
|
artifacts: {
|
|
35695
35713
|
tables: ["temporal_edges"]
|
|
35696
35714
|
}
|
|
@@ -35698,7 +35716,7 @@ var MIGRATIONS2 = [
|
|
|
35698
35716
|
{
|
|
35699
35717
|
version: 77,
|
|
35700
35718
|
name: "entity-aliases",
|
|
35701
|
-
up:
|
|
35719
|
+
up: up792,
|
|
35702
35720
|
artifacts: {
|
|
35703
35721
|
tables: ["entity_aliases"]
|
|
35704
35722
|
}
|
|
@@ -35706,7 +35724,7 @@ var MIGRATIONS2 = [
|
|
|
35706
35724
|
{
|
|
35707
35725
|
version: 78,
|
|
35708
35726
|
name: "api-keys",
|
|
35709
|
-
up:
|
|
35727
|
+
up: up802,
|
|
35710
35728
|
artifacts: {
|
|
35711
35729
|
tables: ["api_keys"]
|
|
35712
35730
|
}
|
|
@@ -35714,7 +35732,7 @@ var MIGRATIONS2 = [
|
|
|
35714
35732
|
{
|
|
35715
35733
|
version: 79,
|
|
35716
35734
|
name: "transcript-capture-jobs",
|
|
35717
|
-
up:
|
|
35735
|
+
up: up812,
|
|
35718
35736
|
artifacts: {
|
|
35719
35737
|
tables: ["transcript_capture_jobs"]
|
|
35720
35738
|
}
|
|
@@ -35722,7 +35740,7 @@ var MIGRATIONS2 = [
|
|
|
35722
35740
|
{
|
|
35723
35741
|
version: 80,
|
|
35724
35742
|
name: "document-scope-columns",
|
|
35725
|
-
up:
|
|
35743
|
+
up: up822,
|
|
35726
35744
|
artifacts: {
|
|
35727
35745
|
columns: [
|
|
35728
35746
|
{ table: "documents", column: "agent_id" },
|
|
@@ -35733,7 +35751,7 @@ var MIGRATIONS2 = [
|
|
|
35733
35751
|
{
|
|
35734
35752
|
version: 81,
|
|
35735
35753
|
name: "aggregate-evidence-sources",
|
|
35736
|
-
up:
|
|
35754
|
+
up: up832,
|
|
35737
35755
|
artifacts: {
|
|
35738
35756
|
tables: ["aggregate_evidence_sources"]
|
|
35739
35757
|
}
|
|
@@ -35741,7 +35759,7 @@ var MIGRATIONS2 = [
|
|
|
35741
35759
|
{
|
|
35742
35760
|
version: 82,
|
|
35743
35761
|
name: "skill-invocations-harness",
|
|
35744
|
-
up:
|
|
35762
|
+
up: up842,
|
|
35745
35763
|
artifacts: {
|
|
35746
35764
|
columns: [
|
|
35747
35765
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -35752,7 +35770,7 @@ var MIGRATIONS2 = [
|
|
|
35752
35770
|
{
|
|
35753
35771
|
version: 83,
|
|
35754
35772
|
name: "memory-lifecycle-repair",
|
|
35755
|
-
up:
|
|
35773
|
+
up: up852,
|
|
35756
35774
|
artifacts: {
|
|
35757
35775
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
35758
35776
|
columns: [
|
|
@@ -35767,7 +35785,7 @@ var MIGRATIONS2 = [
|
|
|
35767
35785
|
{
|
|
35768
35786
|
version: 84,
|
|
35769
35787
|
name: "legacy-markdown-import-state",
|
|
35770
|
-
up:
|
|
35788
|
+
up: up862,
|
|
35771
35789
|
artifacts: {
|
|
35772
35790
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
35773
35791
|
}
|
|
@@ -35775,7 +35793,7 @@ var MIGRATIONS2 = [
|
|
|
35775
35793
|
{
|
|
35776
35794
|
version: 85,
|
|
35777
35795
|
name: "backfill-relations-to-dependencies",
|
|
35778
|
-
up:
|
|
35796
|
+
up: up872,
|
|
35779
35797
|
artifacts: {
|
|
35780
35798
|
tables: ["entity_dependencies"]
|
|
35781
35799
|
}
|
|
@@ -35783,7 +35801,7 @@ var MIGRATIONS2 = [
|
|
|
35783
35801
|
{
|
|
35784
35802
|
version: 86,
|
|
35785
35803
|
name: "summary-jobs-content-hash",
|
|
35786
|
-
up:
|
|
35804
|
+
up: up882,
|
|
35787
35805
|
artifacts: {
|
|
35788
35806
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
35789
35807
|
}
|
|
@@ -35791,7 +35809,7 @@ var MIGRATIONS2 = [
|
|
|
35791
35809
|
{
|
|
35792
35810
|
version: 87,
|
|
35793
35811
|
name: "summary-jobs-boundary-reason",
|
|
35794
|
-
up:
|
|
35812
|
+
up: up892,
|
|
35795
35813
|
artifacts: {
|
|
35796
35814
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
35797
35815
|
}
|
|
@@ -35799,7 +35817,7 @@ var MIGRATIONS2 = [
|
|
|
35799
35817
|
{
|
|
35800
35818
|
version: 88,
|
|
35801
35819
|
name: "transcript-recovery-files",
|
|
35802
|
-
up:
|
|
35820
|
+
up: up902,
|
|
35803
35821
|
artifacts: {
|
|
35804
35822
|
tables: ["transcript_recovery_files"]
|
|
35805
35823
|
}
|
|
@@ -35807,7 +35825,7 @@ var MIGRATIONS2 = [
|
|
|
35807
35825
|
{
|
|
35808
35826
|
version: 89,
|
|
35809
35827
|
name: "job-cancellations",
|
|
35810
|
-
up:
|
|
35828
|
+
up: up912,
|
|
35811
35829
|
artifacts: {
|
|
35812
35830
|
tables: ["job_cancellations"]
|
|
35813
35831
|
}
|
|
@@ -35815,7 +35833,7 @@ var MIGRATIONS2 = [
|
|
|
35815
35833
|
{
|
|
35816
35834
|
version: 90,
|
|
35817
35835
|
name: "job-archive",
|
|
35818
|
-
up:
|
|
35836
|
+
up: up922,
|
|
35819
35837
|
artifacts: {
|
|
35820
35838
|
tables: ["job_archive"]
|
|
35821
35839
|
}
|
|
@@ -35823,25 +35841,25 @@ var MIGRATIONS2 = [
|
|
|
35823
35841
|
{
|
|
35824
35842
|
version: 91,
|
|
35825
35843
|
name: "embedding-index-generations",
|
|
35826
|
-
up:
|
|
35844
|
+
up: up932,
|
|
35827
35845
|
artifacts: { tables: ["embedding_index_state"] }
|
|
35828
35846
|
},
|
|
35829
35847
|
{
|
|
35830
35848
|
version: 92,
|
|
35831
35849
|
name: "embedding-staging-store",
|
|
35832
|
-
up:
|
|
35850
|
+
up: up942,
|
|
35833
35851
|
artifacts: { tables: ["embeddings_staging"] }
|
|
35834
35852
|
},
|
|
35835
35853
|
{
|
|
35836
35854
|
version: 93,
|
|
35837
35855
|
name: "dreaming-evidence-cursor",
|
|
35838
|
-
up:
|
|
35856
|
+
up: up952,
|
|
35839
35857
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
35840
35858
|
},
|
|
35841
35859
|
{
|
|
35842
35860
|
version: 94,
|
|
35843
35861
|
name: "memory-kind",
|
|
35844
|
-
up:
|
|
35862
|
+
up: up962,
|
|
35845
35863
|
artifacts: {
|
|
35846
35864
|
columns: [
|
|
35847
35865
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -35852,35 +35870,35 @@ var MIGRATIONS2 = [
|
|
|
35852
35870
|
{
|
|
35853
35871
|
version: 95,
|
|
35854
35872
|
name: "compaction-recall-projections",
|
|
35855
|
-
up:
|
|
35873
|
+
up: up972
|
|
35856
35874
|
},
|
|
35857
35875
|
{
|
|
35858
35876
|
version: 96,
|
|
35859
35877
|
name: "retire-legacy-ingestion",
|
|
35860
|
-
up:
|
|
35878
|
+
up: up982
|
|
35861
35879
|
},
|
|
35862
35880
|
{
|
|
35863
35881
|
version: 97,
|
|
35864
35882
|
name: "dreaming-failure-backoff",
|
|
35865
|
-
up:
|
|
35883
|
+
up: up992,
|
|
35866
35884
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
35867
35885
|
},
|
|
35868
35886
|
{
|
|
35869
35887
|
version: 98,
|
|
35870
35888
|
name: "dreaming-evidence-exclusions",
|
|
35871
|
-
up:
|
|
35889
|
+
up: up1002,
|
|
35872
35890
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
35873
35891
|
},
|
|
35874
35892
|
{
|
|
35875
35893
|
version: 99,
|
|
35876
35894
|
name: "dreaming-tool-calls",
|
|
35877
|
-
up:
|
|
35895
|
+
up: up1012,
|
|
35878
35896
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
35879
35897
|
},
|
|
35880
35898
|
{
|
|
35881
35899
|
version: 100,
|
|
35882
35900
|
name: "dreaming-runbook",
|
|
35883
|
-
up:
|
|
35901
|
+
up: up1022,
|
|
35884
35902
|
artifacts: {
|
|
35885
35903
|
columns: [
|
|
35886
35904
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -35891,23 +35909,23 @@ var MIGRATIONS2 = [
|
|
|
35891
35909
|
{
|
|
35892
35910
|
version: 101,
|
|
35893
35911
|
name: "dreaming-attention",
|
|
35894
|
-
up:
|
|
35912
|
+
up: up1032,
|
|
35895
35913
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35896
35914
|
},
|
|
35897
35915
|
{
|
|
35898
35916
|
version: 102,
|
|
35899
35917
|
name: "attribute-semantic-memories",
|
|
35900
|
-
up:
|
|
35918
|
+
up: up1042
|
|
35901
35919
|
},
|
|
35902
35920
|
{
|
|
35903
35921
|
version: 103,
|
|
35904
35922
|
name: "semantic-memory-kind",
|
|
35905
|
-
up:
|
|
35923
|
+
up: up1052
|
|
35906
35924
|
},
|
|
35907
35925
|
{
|
|
35908
35926
|
version: 104,
|
|
35909
35927
|
name: "derived-memory-provenance",
|
|
35910
|
-
up:
|
|
35928
|
+
up: up1062,
|
|
35911
35929
|
artifacts: {
|
|
35912
35930
|
tables: ["derived_memory_sources"],
|
|
35913
35931
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -35916,12 +35934,12 @@ var MIGRATIONS2 = [
|
|
|
35916
35934
|
{
|
|
35917
35935
|
version: 105,
|
|
35918
35936
|
name: "agent-scoped-entity-name",
|
|
35919
|
-
up:
|
|
35937
|
+
up: up1072
|
|
35920
35938
|
},
|
|
35921
35939
|
{
|
|
35922
35940
|
version: 106,
|
|
35923
35941
|
name: "memory-review-after",
|
|
35924
|
-
up:
|
|
35942
|
+
up: up1082,
|
|
35925
35943
|
artifacts: {
|
|
35926
35944
|
columns: [{ table: "memories", column: "review_after" }]
|
|
35927
35945
|
}
|
|
@@ -35929,7 +35947,7 @@ var MIGRATIONS2 = [
|
|
|
35929
35947
|
{
|
|
35930
35948
|
version: 107,
|
|
35931
35949
|
name: "dreaming-pass-usage",
|
|
35932
|
-
up:
|
|
35950
|
+
up: up1092,
|
|
35933
35951
|
artifacts: {
|
|
35934
35952
|
columns: [
|
|
35935
35953
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -35943,7 +35961,7 @@ var MIGRATIONS2 = [
|
|
|
35943
35961
|
{
|
|
35944
35962
|
version: 108,
|
|
35945
35963
|
name: "embedding-usage",
|
|
35946
|
-
up:
|
|
35964
|
+
up: up1102,
|
|
35947
35965
|
artifacts: {
|
|
35948
35966
|
tables: ["embedding_usage"]
|
|
35949
35967
|
}
|
|
@@ -35951,7 +35969,7 @@ var MIGRATIONS2 = [
|
|
|
35951
35969
|
{
|
|
35952
35970
|
version: 109,
|
|
35953
35971
|
name: "telemetry-install",
|
|
35954
|
-
up:
|
|
35972
|
+
up: up1112,
|
|
35955
35973
|
artifacts: {
|
|
35956
35974
|
tables: ["telemetry_install"]
|
|
35957
35975
|
}
|
|
@@ -35959,12 +35977,12 @@ var MIGRATIONS2 = [
|
|
|
35959
35977
|
{
|
|
35960
35978
|
version: 110,
|
|
35961
35979
|
name: "memory-mention-join-index",
|
|
35962
|
-
up:
|
|
35980
|
+
up: up1122
|
|
35963
35981
|
},
|
|
35964
35982
|
{
|
|
35965
35983
|
version: 111,
|
|
35966
35984
|
name: "telemetry-first-use",
|
|
35967
|
-
up:
|
|
35985
|
+
up: up1132,
|
|
35968
35986
|
artifacts: {
|
|
35969
35987
|
columns: [
|
|
35970
35988
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -35975,7 +35993,7 @@ var MIGRATIONS2 = [
|
|
|
35975
35993
|
{
|
|
35976
35994
|
version: 112,
|
|
35977
35995
|
name: "telemetry-queue-ownership",
|
|
35978
|
-
up:
|
|
35996
|
+
up: up1142,
|
|
35979
35997
|
artifacts: {
|
|
35980
35998
|
columns: [
|
|
35981
35999
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -35987,7 +36005,7 @@ var MIGRATIONS2 = [
|
|
|
35987
36005
|
{
|
|
35988
36006
|
version: 113,
|
|
35989
36007
|
name: "session-claims",
|
|
35990
|
-
up:
|
|
36008
|
+
up: up1152,
|
|
35991
36009
|
artifacts: {
|
|
35992
36010
|
tables: ["session_claims"],
|
|
35993
36011
|
columns: [
|
|
@@ -36001,12 +36019,12 @@ var MIGRATIONS2 = [
|
|
|
36001
36019
|
{
|
|
36002
36020
|
version: 114,
|
|
36003
36021
|
name: "memory-traversal-hydration-index",
|
|
36004
|
-
up:
|
|
36022
|
+
up: up1162
|
|
36005
36023
|
},
|
|
36006
36024
|
{
|
|
36007
36025
|
version: 115,
|
|
36008
36026
|
name: "cross-agent-message-notifications",
|
|
36009
|
-
up:
|
|
36027
|
+
up: up1172,
|
|
36010
36028
|
artifacts: {
|
|
36011
36029
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
36012
36030
|
}
|
|
@@ -36014,7 +36032,7 @@ var MIGRATIONS2 = [
|
|
|
36014
36032
|
{
|
|
36015
36033
|
version: 116,
|
|
36016
36034
|
name: "acp-delivery-reconciliation",
|
|
36017
|
-
up:
|
|
36035
|
+
up: up1182,
|
|
36018
36036
|
artifacts: {
|
|
36019
36037
|
columns: [
|
|
36020
36038
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -36028,7 +36046,7 @@ var MIGRATIONS2 = [
|
|
|
36028
36046
|
{
|
|
36029
36047
|
version: 117,
|
|
36030
36048
|
name: "retire-summary-worker",
|
|
36031
|
-
up:
|
|
36049
|
+
up: up1192,
|
|
36032
36050
|
artifacts: {
|
|
36033
36051
|
columns: [
|
|
36034
36052
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -36039,24 +36057,24 @@ var MIGRATIONS2 = [
|
|
|
36039
36057
|
{
|
|
36040
36058
|
version: 118,
|
|
36041
36059
|
name: "queue-pressure-indices",
|
|
36042
|
-
up:
|
|
36060
|
+
up: up1202
|
|
36043
36061
|
},
|
|
36044
36062
|
{
|
|
36045
36063
|
version: 119,
|
|
36046
36064
|
name: "telemetry-version-observation",
|
|
36047
|
-
up:
|
|
36065
|
+
up: up1212,
|
|
36048
36066
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
36049
36067
|
},
|
|
36050
36068
|
{
|
|
36051
36069
|
version: 120,
|
|
36052
36070
|
name: "source-lifecycle-telemetry",
|
|
36053
|
-
up:
|
|
36071
|
+
up: up1222,
|
|
36054
36072
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
36055
36073
|
},
|
|
36056
36074
|
{
|
|
36057
36075
|
version: 121,
|
|
36058
36076
|
name: "telemetry-delivery-health",
|
|
36059
|
-
up:
|
|
36077
|
+
up: up1232,
|
|
36060
36078
|
artifacts: {
|
|
36061
36079
|
tables: ["telemetry_delivery_state"],
|
|
36062
36080
|
columns: [
|
|
@@ -36070,7 +36088,7 @@ var MIGRATIONS2 = [
|
|
|
36070
36088
|
{
|
|
36071
36089
|
version: 122,
|
|
36072
36090
|
name: "dreaming-evidence-retry",
|
|
36073
|
-
up:
|
|
36091
|
+
up: up1242,
|
|
36074
36092
|
artifacts: {
|
|
36075
36093
|
columns: [
|
|
36076
36094
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -36083,13 +36101,13 @@ var MIGRATIONS2 = [
|
|
|
36083
36101
|
{
|
|
36084
36102
|
version: 123,
|
|
36085
36103
|
name: "embedding-index-failures",
|
|
36086
|
-
up:
|
|
36104
|
+
up: up1252,
|
|
36087
36105
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
36088
36106
|
},
|
|
36089
36107
|
{
|
|
36090
36108
|
version: 124,
|
|
36091
36109
|
name: "import-derived-lifecycle",
|
|
36092
|
-
up:
|
|
36110
|
+
up: up1262,
|
|
36093
36111
|
artifacts: {
|
|
36094
36112
|
tables: ["imported_source_lifecycle"]
|
|
36095
36113
|
}
|
|
@@ -36097,77 +36115,77 @@ var MIGRATIONS2 = [
|
|
|
36097
36115
|
{
|
|
36098
36116
|
version: 125,
|
|
36099
36117
|
name: "memory-content-safety",
|
|
36100
|
-
up:
|
|
36118
|
+
up: up1272,
|
|
36101
36119
|
artifacts: { tables: ["memory_content_safety"] }
|
|
36102
36120
|
},
|
|
36103
36121
|
{
|
|
36104
36122
|
version: 126,
|
|
36105
36123
|
name: "dreaming-surprisal-attention",
|
|
36106
|
-
up:
|
|
36124
|
+
up: up1282,
|
|
36107
36125
|
artifacts: { tables: ["dreaming_attention"] }
|
|
36108
36126
|
},
|
|
36109
36127
|
{
|
|
36110
36128
|
version: 127,
|
|
36111
36129
|
name: "ontology-contradictions",
|
|
36112
|
-
up:
|
|
36130
|
+
up: up1292,
|
|
36113
36131
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
36114
36132
|
},
|
|
36115
36133
|
{
|
|
36116
36134
|
version: 128,
|
|
36117
36135
|
name: "bounded-queue-diagnostics",
|
|
36118
|
-
up:
|
|
36136
|
+
up: up1302
|
|
36119
36137
|
},
|
|
36120
36138
|
{
|
|
36121
36139
|
version: 129,
|
|
36122
36140
|
name: "retire-structural-jobs",
|
|
36123
|
-
up:
|
|
36141
|
+
up: up1312
|
|
36124
36142
|
},
|
|
36125
36143
|
{
|
|
36126
36144
|
version: 130,
|
|
36127
36145
|
name: "embedding-repair-state",
|
|
36128
|
-
up:
|
|
36146
|
+
up: up1322,
|
|
36129
36147
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
36130
36148
|
},
|
|
36131
36149
|
{
|
|
36132
36150
|
version: 131,
|
|
36133
36151
|
name: "dreaming-evidence-consumption",
|
|
36134
|
-
up:
|
|
36152
|
+
up: up1332,
|
|
36135
36153
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
36136
36154
|
},
|
|
36137
36155
|
{
|
|
36138
36156
|
version: 132,
|
|
36139
36157
|
name: "observer-scoped-epistemic-assertions",
|
|
36140
|
-
up:
|
|
36158
|
+
up: up1342,
|
|
36141
36159
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
36142
36160
|
},
|
|
36143
36161
|
{
|
|
36144
36162
|
version: 133,
|
|
36145
36163
|
name: "dreaming-memory-head",
|
|
36146
|
-
up:
|
|
36164
|
+
up: up1352,
|
|
36147
36165
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
36148
36166
|
},
|
|
36149
36167
|
{
|
|
36150
36168
|
version: 134,
|
|
36151
36169
|
name: "scope-memory-head-entries",
|
|
36152
|
-
up:
|
|
36170
|
+
up: up1362,
|
|
36153
36171
|
artifacts: { tables: ["memory_head_entries"] }
|
|
36154
36172
|
},
|
|
36155
36173
|
{
|
|
36156
36174
|
version: 135,
|
|
36157
36175
|
name: "memory-head-publication",
|
|
36158
|
-
up:
|
|
36176
|
+
up: up1372,
|
|
36159
36177
|
artifacts: { tables: ["memory_head_publications"] }
|
|
36160
36178
|
},
|
|
36161
36179
|
{
|
|
36162
36180
|
version: 136,
|
|
36163
36181
|
name: "memory-head-revisions",
|
|
36164
|
-
up:
|
|
36182
|
+
up: up1382,
|
|
36165
36183
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
36166
36184
|
},
|
|
36167
36185
|
{
|
|
36168
36186
|
version: 137,
|
|
36169
36187
|
name: "dreaming-head-manifest",
|
|
36170
|
-
up:
|
|
36188
|
+
up: up1392,
|
|
36171
36189
|
artifacts: {
|
|
36172
36190
|
columns: [
|
|
36173
36191
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -36178,7 +36196,7 @@ var MIGRATIONS2 = [
|
|
|
36178
36196
|
{
|
|
36179
36197
|
version: 138,
|
|
36180
36198
|
name: "bounded-status-projections",
|
|
36181
|
-
up:
|
|
36199
|
+
up: up1402,
|
|
36182
36200
|
artifacts: {
|
|
36183
36201
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
36184
36202
|
}
|
|
@@ -36186,31 +36204,31 @@ var MIGRATIONS2 = [
|
|
|
36186
36204
|
{
|
|
36187
36205
|
version: 139,
|
|
36188
36206
|
name: "native-source-sync-state",
|
|
36189
|
-
up:
|
|
36207
|
+
up: up1412,
|
|
36190
36208
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
36191
36209
|
},
|
|
36192
36210
|
{
|
|
36193
36211
|
version: 140,
|
|
36194
36212
|
name: "transcript-recovery-frontier",
|
|
36195
|
-
up:
|
|
36213
|
+
up: up1422,
|
|
36196
36214
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
36197
36215
|
},
|
|
36198
36216
|
{
|
|
36199
36217
|
version: 141,
|
|
36200
36218
|
name: "source-sync-checkpoints",
|
|
36201
|
-
up:
|
|
36219
|
+
up: up1432,
|
|
36202
36220
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
36203
36221
|
},
|
|
36204
36222
|
{
|
|
36205
36223
|
version: 142,
|
|
36206
36224
|
name: "source-sync-frontier",
|
|
36207
|
-
up:
|
|
36225
|
+
up: up1442,
|
|
36208
36226
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
36209
36227
|
},
|
|
36210
36228
|
{
|
|
36211
36229
|
version: 143,
|
|
36212
36230
|
name: "embedding-index-progress",
|
|
36213
|
-
up:
|
|
36231
|
+
up: up1452,
|
|
36214
36232
|
artifacts: {
|
|
36215
36233
|
columns: [
|
|
36216
36234
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -36226,19 +36244,19 @@ var MIGRATIONS2 = [
|
|
|
36226
36244
|
{
|
|
36227
36245
|
version: 144,
|
|
36228
36246
|
name: "memory-job-lease-token",
|
|
36229
|
-
up:
|
|
36247
|
+
up: up1462,
|
|
36230
36248
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
36231
36249
|
},
|
|
36232
36250
|
{
|
|
36233
36251
|
version: 145,
|
|
36234
36252
|
name: "dreaming-evidence-reviews",
|
|
36235
|
-
up:
|
|
36253
|
+
up: up1472,
|
|
36236
36254
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
36237
36255
|
},
|
|
36238
36256
|
{
|
|
36239
36257
|
version: 146,
|
|
36240
36258
|
name: "source-transcript-import",
|
|
36241
|
-
up:
|
|
36259
|
+
up: up1482,
|
|
36242
36260
|
artifacts: {
|
|
36243
36261
|
tables: [
|
|
36244
36262
|
"source_import_jobs",
|
|
@@ -36257,19 +36275,19 @@ var MIGRATIONS2 = [
|
|
|
36257
36275
|
{
|
|
36258
36276
|
version: 147,
|
|
36259
36277
|
name: "source-import-replay-file-slots",
|
|
36260
|
-
up:
|
|
36278
|
+
up: up1492,
|
|
36261
36279
|
artifacts: { tables: ["source_import_files"] }
|
|
36262
36280
|
},
|
|
36263
36281
|
{
|
|
36264
36282
|
version: 148,
|
|
36265
36283
|
name: "source-import-attempt-provenance",
|
|
36266
|
-
up:
|
|
36284
|
+
up: up1502,
|
|
36267
36285
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
36268
36286
|
},
|
|
36269
36287
|
{
|
|
36270
36288
|
version: 149,
|
|
36271
36289
|
name: "transcript-import-state-machine",
|
|
36272
|
-
up:
|
|
36290
|
+
up: up1512,
|
|
36273
36291
|
artifacts: {
|
|
36274
36292
|
columns: [
|
|
36275
36293
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -36281,7 +36299,7 @@ var MIGRATIONS2 = [
|
|
|
36281
36299
|
{
|
|
36282
36300
|
version: 150,
|
|
36283
36301
|
name: "memory-head-freshness",
|
|
36284
|
-
up:
|
|
36302
|
+
up: up1522,
|
|
36285
36303
|
artifacts: {
|
|
36286
36304
|
columns: [
|
|
36287
36305
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -36292,7 +36310,7 @@ var MIGRATIONS2 = [
|
|
|
36292
36310
|
{
|
|
36293
36311
|
version: 151,
|
|
36294
36312
|
name: "transcript-import-bytes",
|
|
36295
|
-
up:
|
|
36313
|
+
up: up153,
|
|
36296
36314
|
artifacts: {
|
|
36297
36315
|
tables: [
|
|
36298
36316
|
"source_import_chunks",
|
|
@@ -36317,6 +36335,12 @@ var MIGRATIONS2 = [
|
|
|
36317
36335
|
}))
|
|
36318
36336
|
]
|
|
36319
36337
|
}
|
|
36338
|
+
},
|
|
36339
|
+
{
|
|
36340
|
+
version: 152,
|
|
36341
|
+
name: "memory-artifact-sha-index",
|
|
36342
|
+
up: up210,
|
|
36343
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
36320
36344
|
}
|
|
36321
36345
|
];
|
|
36322
36346
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|