@signetai/connector-openclaw 0.221.10 → 0.221.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +630 -606
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -11362,6 +11362,12 @@ function up(db) {
|
|
|
11362
11362
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
11363
11363
|
`);
|
|
11364
11364
|
}
|
|
11365
|
+
function up2(db) {
|
|
11366
|
+
db.exec(`
|
|
11367
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
11368
|
+
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)
|
|
11369
|
+
`);
|
|
11370
|
+
}
|
|
11365
11371
|
var MEMORIES_FTS_TOKENIZER = "unicode61";
|
|
11366
11372
|
var FTS_STATE_TABLE = "memories_fts_state";
|
|
11367
11373
|
function normalizeSql(sql) {
|
|
@@ -11477,7 +11483,7 @@ function memoriesFtsNeedsTokenizerRepair(sql) {
|
|
|
11477
11483
|
return true;
|
|
11478
11484
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER}'`);
|
|
11479
11485
|
}
|
|
11480
|
-
function
|
|
11486
|
+
function up3(db) {
|
|
11481
11487
|
db.exec(`
|
|
11482
11488
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
11483
11489
|
version INTEGER PRIMARY KEY,
|
|
@@ -11575,7 +11581,7 @@ function addColumnIfMissing(db, table, column, definition) {
|
|
|
11575
11581
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11576
11582
|
}
|
|
11577
11583
|
}
|
|
11578
|
-
function
|
|
11584
|
+
function up4(db) {
|
|
11579
11585
|
addColumnIfMissing(db, "memories", "content_hash", "TEXT");
|
|
11580
11586
|
addColumnIfMissing(db, "memories", "normalized_content", "TEXT");
|
|
11581
11587
|
addColumnIfMissing(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -11693,7 +11699,7 @@ function addColumnIfMissing2(db, table, column, definition) {
|
|
|
11693
11699
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11694
11700
|
return true;
|
|
11695
11701
|
}
|
|
11696
|
-
function
|
|
11702
|
+
function up5(db) {
|
|
11697
11703
|
addColumnIfMissing2(db, "memories", "why", "TEXT");
|
|
11698
11704
|
addColumnIfMissing2(db, "memories", "project", "TEXT");
|
|
11699
11705
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -11730,7 +11736,7 @@ function addColumnIfMissing3(db, table, column, definition) {
|
|
|
11730
11736
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11731
11737
|
}
|
|
11732
11738
|
}
|
|
11733
|
-
function
|
|
11739
|
+
function up6(db) {
|
|
11734
11740
|
addColumnIfMissing3(db, "memory_history", "actor_type", "TEXT");
|
|
11735
11741
|
addColumnIfMissing3(db, "memory_history", "session_id", "TEXT");
|
|
11736
11742
|
addColumnIfMissing3(db, "memory_history", "request_id", "TEXT");
|
|
@@ -11763,7 +11769,7 @@ function addColumnIfMissing4(db, table, column, definition) {
|
|
|
11763
11769
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11764
11770
|
}
|
|
11765
11771
|
}
|
|
11766
|
-
function
|
|
11772
|
+
function up7(db) {
|
|
11767
11773
|
addColumnIfMissing4(db, "entities", "canonical_name", "TEXT");
|
|
11768
11774
|
addColumnIfMissing4(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
11769
11775
|
addColumnIfMissing4(db, "entities", "embedding", "BLOB");
|
|
@@ -11780,7 +11786,7 @@ function hasColumn4(db, table, column) {
|
|
|
11780
11786
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11781
11787
|
return rows.some((r2) => r2.name === column);
|
|
11782
11788
|
}
|
|
11783
|
-
function
|
|
11789
|
+
function up8(db) {
|
|
11784
11790
|
if (!hasColumn4(db, "memories", "idempotency_key")) {
|
|
11785
11791
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
11786
11792
|
}
|
|
@@ -11795,7 +11801,7 @@ function hasColumn5(db, table, column) {
|
|
|
11795
11801
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
11796
11802
|
return rows.some((r2) => r2.name === column);
|
|
11797
11803
|
}
|
|
11798
|
-
function
|
|
11804
|
+
function up9(db) {
|
|
11799
11805
|
db.exec(`
|
|
11800
11806
|
CREATE TABLE IF NOT EXISTS documents (
|
|
11801
11807
|
id TEXT PRIMARY KEY,
|
|
@@ -11852,7 +11858,7 @@ function up8(db) {
|
|
|
11852
11858
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
11853
11859
|
}
|
|
11854
11860
|
}
|
|
11855
|
-
function
|
|
11861
|
+
function up10(db) {
|
|
11856
11862
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
11857
11863
|
if (tables.length === 0)
|
|
11858
11864
|
return;
|
|
@@ -11869,7 +11875,7 @@ function up9(db) {
|
|
|
11869
11875
|
ON embeddings(content_hash)
|
|
11870
11876
|
`);
|
|
11871
11877
|
}
|
|
11872
|
-
function
|
|
11878
|
+
function up11(db) {
|
|
11873
11879
|
db.exec(`
|
|
11874
11880
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
11875
11881
|
id TEXT PRIMARY KEY,
|
|
@@ -11889,7 +11895,7 @@ function up10(db) {
|
|
|
11889
11895
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
11890
11896
|
ON summary_jobs(status)`);
|
|
11891
11897
|
}
|
|
11892
|
-
function
|
|
11898
|
+
function up12(db) {
|
|
11893
11899
|
db.exec(`
|
|
11894
11900
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
11895
11901
|
id INTEGER PRIMARY KEY,
|
|
@@ -11900,7 +11906,7 @@ function up11(db) {
|
|
|
11900
11906
|
)
|
|
11901
11907
|
`);
|
|
11902
11908
|
}
|
|
11903
|
-
function
|
|
11909
|
+
function up13(db) {
|
|
11904
11910
|
db.exec(`
|
|
11905
11911
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
11906
11912
|
id TEXT PRIMARY KEY,
|
|
@@ -11920,7 +11926,7 @@ function up12(db) {
|
|
|
11920
11926
|
ON session_scores(session_key);
|
|
11921
11927
|
`);
|
|
11922
11928
|
}
|
|
11923
|
-
function
|
|
11929
|
+
function up14(db) {
|
|
11924
11930
|
db.exec(`
|
|
11925
11931
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
11926
11932
|
id TEXT PRIMARY KEY,
|
|
@@ -11961,7 +11967,7 @@ function addColumnIfMissing5(db, table, column, definition) {
|
|
|
11961
11967
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
11962
11968
|
}
|
|
11963
11969
|
}
|
|
11964
|
-
function
|
|
11970
|
+
function up15(db) {
|
|
11965
11971
|
db.exec(`
|
|
11966
11972
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
11967
11973
|
id TEXT PRIMARY KEY,
|
|
@@ -11987,7 +11993,7 @@ function up14(db) {
|
|
|
11987
11993
|
addColumnIfMissing5(db, "memories", "source_path", "TEXT");
|
|
11988
11994
|
addColumnIfMissing5(db, "memories", "source_section", "TEXT");
|
|
11989
11995
|
}
|
|
11990
|
-
function
|
|
11996
|
+
function up16(db) {
|
|
11991
11997
|
db.exec(`
|
|
11992
11998
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
11993
11999
|
id TEXT PRIMARY KEY,
|
|
@@ -12012,7 +12018,7 @@ function addColumnIfMissing6(db, table, column, definition) {
|
|
|
12012
12018
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12013
12019
|
}
|
|
12014
12020
|
}
|
|
12015
|
-
function
|
|
12021
|
+
function up17(db) {
|
|
12016
12022
|
db.exec(`
|
|
12017
12023
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
12018
12024
|
id TEXT PRIMARY KEY,
|
|
@@ -12039,7 +12045,7 @@ function up16(db) {
|
|
|
12039
12045
|
addColumnIfMissing6(db, "session_scores", "confidence", "REAL");
|
|
12040
12046
|
addColumnIfMissing6(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
12041
12047
|
}
|
|
12042
|
-
function
|
|
12048
|
+
function up18(db) {
|
|
12043
12049
|
db.exec(`
|
|
12044
12050
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
12045
12051
|
id TEXT PRIMARY KEY,
|
|
@@ -12061,7 +12067,7 @@ function up17(db) {
|
|
|
12061
12067
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
12062
12068
|
`);
|
|
12063
12069
|
}
|
|
12064
|
-
function
|
|
12070
|
+
function up19(db) {
|
|
12065
12071
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
12066
12072
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12067
12073
|
if (!colNames.has("skill_name")) {
|
|
@@ -12072,7 +12078,7 @@ function up18(db) {
|
|
|
12072
12078
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
12073
12079
|
}
|
|
12074
12080
|
}
|
|
12075
|
-
function
|
|
12081
|
+
function up20(db) {
|
|
12076
12082
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
12077
12083
|
if (existing)
|
|
12078
12084
|
return;
|
|
@@ -12104,7 +12110,7 @@ function up19(db) {
|
|
|
12104
12110
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
12105
12111
|
`);
|
|
12106
12112
|
}
|
|
12107
|
-
function
|
|
12113
|
+
function up21(db) {
|
|
12108
12114
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
12109
12115
|
const entityColNames = new Set(entityCols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
12110
12116
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -12189,13 +12195,13 @@ function addColumnIfMissing7(db, table, column, definition) {
|
|
|
12189
12195
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12190
12196
|
}
|
|
12191
12197
|
}
|
|
12192
|
-
function
|
|
12198
|
+
function up22(db) {
|
|
12193
12199
|
addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
|
|
12194
12200
|
addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12195
12201
|
addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
12196
12202
|
addColumnIfMissing7(db, "session_memories", "structural_density", "INTEGER");
|
|
12197
12203
|
}
|
|
12198
|
-
function
|
|
12204
|
+
function up23(db) {
|
|
12199
12205
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
12200
12206
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
12201
12207
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -12220,25 +12226,25 @@ function addColumnIfMissing8(db, table, column, definition) {
|
|
|
12220
12226
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12221
12227
|
}
|
|
12222
12228
|
}
|
|
12223
|
-
function
|
|
12229
|
+
function up24(db) {
|
|
12224
12230
|
addColumnIfMissing8(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
12225
12231
|
addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
|
|
12226
12232
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
12227
12233
|
}
|
|
12228
|
-
function up24(_db) {}
|
|
12229
12234
|
function up25(_db) {}
|
|
12235
|
+
function up26(_db) {}
|
|
12230
12236
|
function addColumnIfMissing9(db, table, column, definition) {
|
|
12231
12237
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
12232
12238
|
if (!cols.some((c2) => c2.name === column)) {
|
|
12233
12239
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12234
12240
|
}
|
|
12235
12241
|
}
|
|
12236
|
-
function
|
|
12242
|
+
function up27(db) {
|
|
12237
12243
|
addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
|
|
12238
12244
|
addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
12239
12245
|
}
|
|
12240
|
-
function
|
|
12241
|
-
function
|
|
12246
|
+
function up28(_db) {}
|
|
12247
|
+
function up29(db) {
|
|
12242
12248
|
db.exec(`
|
|
12243
12249
|
UPDATE entities
|
|
12244
12250
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -12247,7 +12253,7 @@ function up28(db) {
|
|
|
12247
12253
|
WHERE canonical_name IS NULL
|
|
12248
12254
|
`);
|
|
12249
12255
|
}
|
|
12250
|
-
function
|
|
12256
|
+
function up30(db) {
|
|
12251
12257
|
db.exec(`
|
|
12252
12258
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
12253
12259
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -12284,7 +12290,7 @@ function up29(db) {
|
|
|
12284
12290
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
12285
12291
|
`);
|
|
12286
12292
|
}
|
|
12287
|
-
function
|
|
12293
|
+
function up31(db) {
|
|
12288
12294
|
db.exec(`
|
|
12289
12295
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
12290
12296
|
id TEXT PRIMARY KEY,
|
|
@@ -12329,7 +12335,7 @@ function up30(db) {
|
|
|
12329
12335
|
WHERE session_key IS NOT NULL;
|
|
12330
12336
|
`);
|
|
12331
12337
|
}
|
|
12332
|
-
function
|
|
12338
|
+
function up32(db) {
|
|
12333
12339
|
db.exec(`
|
|
12334
12340
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
12335
12341
|
id TEXT PRIMARY KEY,
|
|
@@ -12374,7 +12380,7 @@ function up31(db) {
|
|
|
12374
12380
|
ON memory_jobs(failed_at);
|
|
12375
12381
|
`);
|
|
12376
12382
|
}
|
|
12377
|
-
function
|
|
12383
|
+
function up33(db) {
|
|
12378
12384
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12379
12385
|
if (!depCols.some((c2) => c2.name === "reason")) {
|
|
12380
12386
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -12384,7 +12390,7 @@ function up32(db) {
|
|
|
12384
12390
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
12385
12391
|
}
|
|
12386
12392
|
}
|
|
12387
|
-
function
|
|
12393
|
+
function up34(db) {
|
|
12388
12394
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
12389
12395
|
if (cols.length === 0)
|
|
12390
12396
|
return;
|
|
@@ -12392,14 +12398,14 @@ function up33(db) {
|
|
|
12392
12398
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
12393
12399
|
}
|
|
12394
12400
|
}
|
|
12395
|
-
function
|
|
12401
|
+
function up35(db) {
|
|
12396
12402
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
12397
12403
|
if (!cols.some((c2) => c2.name === "scope")) {
|
|
12398
12404
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
12399
12405
|
}
|
|
12400
12406
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
12401
12407
|
}
|
|
12402
|
-
function
|
|
12408
|
+
function up36(db) {
|
|
12403
12409
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
12404
12410
|
db.exec(`
|
|
12405
12411
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -12407,7 +12413,7 @@ function up35(db) {
|
|
|
12407
12413
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
12408
12414
|
`);
|
|
12409
12415
|
}
|
|
12410
|
-
function
|
|
12416
|
+
function up37(db) {
|
|
12411
12417
|
db.exec(`
|
|
12412
12418
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
12413
12419
|
name, canonical_name,
|
|
@@ -12439,13 +12445,13 @@ function up36(db) {
|
|
|
12439
12445
|
END
|
|
12440
12446
|
`);
|
|
12441
12447
|
}
|
|
12442
|
-
function
|
|
12448
|
+
function up38(db) {
|
|
12443
12449
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
12444
12450
|
if (!cols.some((c2) => c2.name === "confidence")) {
|
|
12445
12451
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
12446
12452
|
}
|
|
12447
12453
|
}
|
|
12448
|
-
function
|
|
12454
|
+
function up39(db) {
|
|
12449
12455
|
db.exec(`
|
|
12450
12456
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
12451
12457
|
id TEXT PRIMARY KEY,
|
|
@@ -12463,7 +12469,7 @@ function up38(db) {
|
|
|
12463
12469
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
12464
12470
|
}
|
|
12465
12471
|
}
|
|
12466
|
-
function
|
|
12472
|
+
function up40(db) {
|
|
12467
12473
|
db.exec(`
|
|
12468
12474
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
12469
12475
|
id TEXT PRIMARY KEY,
|
|
@@ -12503,7 +12509,7 @@ function up39(db) {
|
|
|
12503
12509
|
END
|
|
12504
12510
|
`);
|
|
12505
12511
|
}
|
|
12506
|
-
function
|
|
12512
|
+
function up41(db) {
|
|
12507
12513
|
db.exec(`
|
|
12508
12514
|
DELETE FROM entity_dependencies
|
|
12509
12515
|
WHERE id NOT IN (
|
|
@@ -12521,7 +12527,7 @@ function up40(db) {
|
|
|
12521
12527
|
)
|
|
12522
12528
|
`);
|
|
12523
12529
|
}
|
|
12524
|
-
function
|
|
12530
|
+
function up42(db) {
|
|
12525
12531
|
db.exec(`
|
|
12526
12532
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
12527
12533
|
session_key TEXT PRIMARY KEY,
|
|
@@ -12544,7 +12550,7 @@ function addColumnIfMissing10(db, table, column, definition) {
|
|
|
12544
12550
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12545
12551
|
}
|
|
12546
12552
|
}
|
|
12547
|
-
function
|
|
12553
|
+
function up43(db) {
|
|
12548
12554
|
addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
|
|
12549
12555
|
db.exec(`
|
|
12550
12556
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -12619,7 +12625,7 @@ function addColumnIfMissing11(db, table, column, definition) {
|
|
|
12619
12625
|
return;
|
|
12620
12626
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12621
12627
|
}
|
|
12622
|
-
function
|
|
12628
|
+
function up44(db) {
|
|
12623
12629
|
addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
|
|
12624
12630
|
addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
|
|
12625
12631
|
addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -12707,7 +12713,7 @@ function addColumnIfMissing12(db, table, column, definition) {
|
|
|
12707
12713
|
return;
|
|
12708
12714
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12709
12715
|
}
|
|
12710
|
-
function
|
|
12716
|
+
function up45(db) {
|
|
12711
12717
|
db.exec(`
|
|
12712
12718
|
CREATE TABLE IF NOT EXISTS agents (
|
|
12713
12719
|
id TEXT PRIMARY KEY,
|
|
@@ -12736,7 +12742,7 @@ function addColumnIfMissing13(db, table, column, definition) {
|
|
|
12736
12742
|
return;
|
|
12737
12743
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12738
12744
|
}
|
|
12739
|
-
function
|
|
12745
|
+
function up46(db) {
|
|
12740
12746
|
addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
|
|
12741
12747
|
addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
|
|
12742
12748
|
addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -12762,7 +12768,7 @@ function addColumnIfMissing14(db, table, column, definition) {
|
|
|
12762
12768
|
return;
|
|
12763
12769
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
12764
12770
|
}
|
|
12765
|
-
function
|
|
12771
|
+
function up47(db) {
|
|
12766
12772
|
addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
|
|
12767
12773
|
addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
12768
12774
|
addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -12833,7 +12839,7 @@ function up46(db) {
|
|
|
12833
12839
|
ON memory_md_heads(lease_expires_at);
|
|
12834
12840
|
`);
|
|
12835
12841
|
}
|
|
12836
|
-
function
|
|
12842
|
+
function up48(db) {
|
|
12837
12843
|
db.exec(`
|
|
12838
12844
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
12839
12845
|
|
|
@@ -12894,7 +12900,7 @@ function up47(db) {
|
|
|
12894
12900
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
12895
12901
|
`);
|
|
12896
12902
|
}
|
|
12897
|
-
function
|
|
12903
|
+
function up49(db) {
|
|
12898
12904
|
db.exec(`
|
|
12899
12905
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
12900
12906
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -12992,7 +12998,7 @@ function up48(db) {
|
|
|
12992
12998
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
12993
12999
|
`);
|
|
12994
13000
|
}
|
|
12995
|
-
function
|
|
13001
|
+
function up50(db) {
|
|
12996
13002
|
db.exec(`
|
|
12997
13003
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
12998
13004
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -13110,7 +13116,7 @@ function up49(db) {
|
|
|
13110
13116
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
13111
13117
|
`);
|
|
13112
13118
|
}
|
|
13113
|
-
function
|
|
13119
|
+
function up51(db) {
|
|
13114
13120
|
db.exec(`
|
|
13115
13121
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
13116
13122
|
session_key TEXT NOT NULL,
|
|
@@ -13127,7 +13133,7 @@ function hasTable(db, name) {
|
|
|
13127
13133
|
WHERE type = 'table' AND name = ?
|
|
13128
13134
|
LIMIT 1`).get(name) !== undefined;
|
|
13129
13135
|
}
|
|
13130
|
-
function
|
|
13136
|
+
function up52(db) {
|
|
13131
13137
|
db.exec(`
|
|
13132
13138
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
13133
13139
|
id TEXT PRIMARY KEY,
|
|
@@ -13297,7 +13303,7 @@ function addColumnIfMissing15(db, table, column, definition) {
|
|
|
13297
13303
|
return;
|
|
13298
13304
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13299
13305
|
}
|
|
13300
|
-
function
|
|
13306
|
+
function up53(db) {
|
|
13301
13307
|
addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
|
|
13302
13308
|
addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
13303
13309
|
addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -13389,7 +13395,7 @@ function up52(db) {
|
|
|
13389
13395
|
VALUES ('rebuild');
|
|
13390
13396
|
`);
|
|
13391
13397
|
}
|
|
13392
|
-
function
|
|
13398
|
+
function up54(db) {
|
|
13393
13399
|
db.exec(`
|
|
13394
13400
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
13395
13401
|
id TEXT PRIMARY KEY,
|
|
@@ -13406,7 +13412,7 @@ function up53(db) {
|
|
|
13406
13412
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
13407
13413
|
`);
|
|
13408
13414
|
}
|
|
13409
|
-
function
|
|
13415
|
+
function up55(db) {
|
|
13410
13416
|
db.exec(`
|
|
13411
13417
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
13412
13418
|
id TEXT PRIMARY KEY,
|
|
@@ -13422,7 +13428,7 @@ function up54(db) {
|
|
|
13422
13428
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
13423
13429
|
`);
|
|
13424
13430
|
}
|
|
13425
|
-
function
|
|
13431
|
+
function up56(db) {
|
|
13426
13432
|
db.exec(`
|
|
13427
13433
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
13428
13434
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -13453,7 +13459,7 @@ function up55(db) {
|
|
|
13453
13459
|
ON task_scope_hints(agent_id, updated_at);
|
|
13454
13460
|
`);
|
|
13455
13461
|
}
|
|
13456
|
-
function
|
|
13462
|
+
function up57(db) {
|
|
13457
13463
|
db.exec(`
|
|
13458
13464
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
13459
13465
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -13496,7 +13502,7 @@ function ensureMemoriesScopeColumns(db) {
|
|
|
13496
13502
|
if (!names.has("scope"))
|
|
13497
13503
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
13498
13504
|
}
|
|
13499
|
-
function
|
|
13505
|
+
function up58(db) {
|
|
13500
13506
|
ensureMemoriesScopeColumns(db);
|
|
13501
13507
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
13502
13508
|
db.exec(`
|
|
@@ -13509,20 +13515,20 @@ function up57(db) {
|
|
|
13509
13515
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
13510
13516
|
`);
|
|
13511
13517
|
}
|
|
13512
|
-
function
|
|
13518
|
+
function up59(db) {
|
|
13513
13519
|
const sql = readMemoriesFtsSql(db);
|
|
13514
13520
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair(sql))
|
|
13515
13521
|
return;
|
|
13516
13522
|
recreateMemoriesFts(db);
|
|
13517
13523
|
}
|
|
13518
|
-
function
|
|
13524
|
+
function up60(db) {
|
|
13519
13525
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
13520
13526
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
13521
13527
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
13522
13528
|
ON entities(entity_type, mentions)
|
|
13523
13529
|
WHERE entity_type = 'extracted'`);
|
|
13524
13530
|
}
|
|
13525
|
-
function
|
|
13531
|
+
function up61(db) {
|
|
13526
13532
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13527
13533
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
13528
13534
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -13531,7 +13537,7 @@ function up60(db) {
|
|
|
13531
13537
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
13532
13538
|
WHERE claim_key IS NOT NULL`);
|
|
13533
13539
|
}
|
|
13534
|
-
function
|
|
13540
|
+
function up62(db) {
|
|
13535
13541
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
13536
13542
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
13537
13543
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -13543,13 +13549,13 @@ function up61(db) {
|
|
|
13543
13549
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
13544
13550
|
WHERE claim_key IS NOT NULL`);
|
|
13545
13551
|
}
|
|
13546
|
-
function
|
|
13552
|
+
function up63(db) {
|
|
13547
13553
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13548
13554
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
13549
13555
|
return;
|
|
13550
13556
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
13551
13557
|
}
|
|
13552
|
-
function
|
|
13558
|
+
function up64(db) {
|
|
13553
13559
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
13554
13560
|
const names = new Set(cols.map((col) => col.name));
|
|
13555
13561
|
if (!names.has("is_deleted")) {
|
|
@@ -13563,7 +13569,7 @@ function up63(db) {
|
|
|
13563
13569
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
13564
13570
|
`);
|
|
13565
13571
|
}
|
|
13566
|
-
function
|
|
13572
|
+
function up65(db) {
|
|
13567
13573
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
13568
13574
|
db.exec(`
|
|
13569
13575
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -13581,7 +13587,7 @@ function addColumnIfMissing16(db, table, column, definition) {
|
|
|
13581
13587
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13582
13588
|
}
|
|
13583
13589
|
}
|
|
13584
|
-
function
|
|
13590
|
+
function up66(db) {
|
|
13585
13591
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
13586
13592
|
addColumnIfMissing16(db, table, "source_id", "TEXT");
|
|
13587
13593
|
addColumnIfMissing16(db, table, "source_kind", "TEXT");
|
|
@@ -13601,7 +13607,7 @@ function hasColumn7(db, table, column) {
|
|
|
13601
13607
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
13602
13608
|
return rows.some((row) => row.name === column);
|
|
13603
13609
|
}
|
|
13604
|
-
function
|
|
13610
|
+
function up67(db) {
|
|
13605
13611
|
if (!hasTable2(db, "embeddings"))
|
|
13606
13612
|
return;
|
|
13607
13613
|
if (!hasColumn7(db, "embeddings", "agent_id")) {
|
|
@@ -13609,7 +13615,7 @@ function up66(db) {
|
|
|
13609
13615
|
}
|
|
13610
13616
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
13611
13617
|
}
|
|
13612
|
-
function
|
|
13618
|
+
function up68(db) {
|
|
13613
13619
|
db.exec(`
|
|
13614
13620
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
13615
13621
|
id TEXT PRIMARY KEY,
|
|
@@ -13650,7 +13656,7 @@ function addColumnIfMissing17(db, table, column, definition) {
|
|
|
13650
13656
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13651
13657
|
}
|
|
13652
13658
|
}
|
|
13653
|
-
function
|
|
13659
|
+
function up69(db) {
|
|
13654
13660
|
db.exec(`
|
|
13655
13661
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
13656
13662
|
id TEXT PRIMARY KEY,
|
|
@@ -13693,7 +13699,7 @@ function up68(db) {
|
|
|
13693
13699
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
13694
13700
|
}
|
|
13695
13701
|
}
|
|
13696
|
-
function
|
|
13702
|
+
function up70(db) {
|
|
13697
13703
|
db.exec(`
|
|
13698
13704
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
13699
13705
|
id TEXT PRIMARY KEY,
|
|
@@ -13720,7 +13726,7 @@ function up69(db) {
|
|
|
13720
13726
|
WHERE content_key IS NOT NULL;
|
|
13721
13727
|
`);
|
|
13722
13728
|
}
|
|
13723
|
-
function
|
|
13729
|
+
function up71(db) {
|
|
13724
13730
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
13725
13731
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
13726
13732
|
if (!colNames.has("content_key")) {
|
|
@@ -13757,7 +13763,7 @@ function backfillVersionRoots(db) {
|
|
|
13757
13763
|
WHERE version_root_id IS NULL
|
|
13758
13764
|
`);
|
|
13759
13765
|
}
|
|
13760
|
-
function
|
|
13766
|
+
function up72(db) {
|
|
13761
13767
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
13762
13768
|
addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
13763
13769
|
addColumnIfMissing18(db, table, "archived_at", "TEXT");
|
|
@@ -13792,7 +13798,7 @@ function up71(db) {
|
|
|
13792
13798
|
ON entity_aspects(agent_id, proposal_id);
|
|
13793
13799
|
`);
|
|
13794
13800
|
}
|
|
13795
|
-
function
|
|
13801
|
+
function up73(db) {
|
|
13796
13802
|
db.exec(`
|
|
13797
13803
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
13798
13804
|
id TEXT PRIMARY KEY,
|
|
@@ -13848,7 +13854,7 @@ function ensureMemoriesScopeColumns2(db) {
|
|
|
13848
13854
|
if (!names.has("runtime_path"))
|
|
13849
13855
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
13850
13856
|
}
|
|
13851
|
-
function
|
|
13857
|
+
function up74(db) {
|
|
13852
13858
|
ensureMemoriesScopeColumns2(db);
|
|
13853
13859
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
13854
13860
|
db.exec(`
|
|
@@ -13862,7 +13868,7 @@ function up73(db) {
|
|
|
13862
13868
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
13863
13869
|
`);
|
|
13864
13870
|
}
|
|
13865
|
-
function
|
|
13871
|
+
function up75(db) {
|
|
13866
13872
|
db.exec(`
|
|
13867
13873
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
13868
13874
|
session_key TEXT NOT NULL,
|
|
@@ -13897,7 +13903,7 @@ function up74(db) {
|
|
|
13897
13903
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
13898
13904
|
`);
|
|
13899
13905
|
}
|
|
13900
|
-
function
|
|
13906
|
+
function up76(db) {
|
|
13901
13907
|
db.exec(`
|
|
13902
13908
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
13903
13909
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -13916,7 +13922,7 @@ function addColumnIfMissing19(db, table, column, definition) {
|
|
|
13916
13922
|
return;
|
|
13917
13923
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
13918
13924
|
}
|
|
13919
|
-
function
|
|
13925
|
+
function up77(db) {
|
|
13920
13926
|
addColumnIfMissing19(db, "memory_artifacts", "source_id", "TEXT");
|
|
13921
13927
|
addColumnIfMissing19(db, "memory_artifacts", "source_root", "TEXT");
|
|
13922
13928
|
addColumnIfMissing19(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -13929,7 +13935,7 @@ function up76(db) {
|
|
|
13929
13935
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
13930
13936
|
`);
|
|
13931
13937
|
}
|
|
13932
|
-
function
|
|
13938
|
+
function up78(db) {
|
|
13933
13939
|
db.exec(`
|
|
13934
13940
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
13935
13941
|
id TEXT PRIMARY KEY,
|
|
@@ -13952,7 +13958,7 @@ function up77(db) {
|
|
|
13952
13958
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
13953
13959
|
`);
|
|
13954
13960
|
}
|
|
13955
|
-
function
|
|
13961
|
+
function up79(db) {
|
|
13956
13962
|
db.exec(`
|
|
13957
13963
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
13958
13964
|
id TEXT PRIMARY KEY,
|
|
@@ -13976,7 +13982,7 @@ function up78(db) {
|
|
|
13976
13982
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
13977
13983
|
`);
|
|
13978
13984
|
}
|
|
13979
|
-
function
|
|
13985
|
+
function up80(db) {
|
|
13980
13986
|
db.exec(`
|
|
13981
13987
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
13982
13988
|
id TEXT PRIMARY KEY,
|
|
@@ -14004,7 +14010,7 @@ function up79(db) {
|
|
|
14004
14010
|
ON api_keys(connector, harness);
|
|
14005
14011
|
`);
|
|
14006
14012
|
}
|
|
14007
|
-
function
|
|
14013
|
+
function up81(db) {
|
|
14008
14014
|
db.exec(`
|
|
14009
14015
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
14010
14016
|
id TEXT PRIMARY KEY,
|
|
@@ -14039,7 +14045,7 @@ function hasColumn10(db, table, column) {
|
|
|
14039
14045
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14040
14046
|
return rows.some((row) => row.name === column);
|
|
14041
14047
|
}
|
|
14042
|
-
function
|
|
14048
|
+
function up82(db) {
|
|
14043
14049
|
if (!hasColumn10(db, "documents", "agent_id")) {
|
|
14044
14050
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
14045
14051
|
}
|
|
@@ -14125,7 +14131,7 @@ function up81(db) {
|
|
|
14125
14131
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
14126
14132
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
14127
14133
|
}
|
|
14128
|
-
function
|
|
14134
|
+
function up83(db) {
|
|
14129
14135
|
db.exec(`
|
|
14130
14136
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
14131
14137
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -14147,7 +14153,7 @@ function hasColumn11(db, table, column) {
|
|
|
14147
14153
|
return rows.some((row) => row.name === column);
|
|
14148
14154
|
}
|
|
14149
14155
|
var COLUMNS = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
14150
|
-
function
|
|
14156
|
+
function up84(db) {
|
|
14151
14157
|
for (const column of COLUMNS) {
|
|
14152
14158
|
if (!hasColumn11(db, "skill_invocations", column)) {
|
|
14153
14159
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -14228,7 +14234,7 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14228
14234
|
`);
|
|
14229
14235
|
}
|
|
14230
14236
|
try {
|
|
14231
|
-
|
|
14237
|
+
up82(db);
|
|
14232
14238
|
if (preserveAgentId) {
|
|
14233
14239
|
db.exec(`
|
|
14234
14240
|
UPDATE documents
|
|
@@ -14248,12 +14254,12 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
14248
14254
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
14249
14255
|
}
|
|
14250
14256
|
}
|
|
14251
|
-
function
|
|
14252
|
-
|
|
14257
|
+
function up85(db) {
|
|
14258
|
+
up81(db);
|
|
14253
14259
|
if (hasTable3(db, "documents")) {
|
|
14254
14260
|
documentScopeColumnsPreservingExisting(db);
|
|
14255
14261
|
}
|
|
14256
|
-
|
|
14262
|
+
up83(db);
|
|
14257
14263
|
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
14258
14264
|
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
14259
14265
|
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -14310,7 +14316,7 @@ function up84(db) {
|
|
|
14310
14316
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
14311
14317
|
`);
|
|
14312
14318
|
}
|
|
14313
|
-
function
|
|
14319
|
+
function up86(db) {
|
|
14314
14320
|
db.exec(`
|
|
14315
14321
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
14316
14322
|
path TEXT PRIMARY KEY,
|
|
@@ -14340,7 +14346,7 @@ function up85(db) {
|
|
|
14340
14346
|
ON legacy_markdown_chunks(memory_id);
|
|
14341
14347
|
`);
|
|
14342
14348
|
}
|
|
14343
|
-
function
|
|
14349
|
+
function up87(db) {
|
|
14344
14350
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
14345
14351
|
const tableNames = new Set(tables.map((r2) => String(r2.name)));
|
|
14346
14352
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -14399,7 +14405,7 @@ function addColumnIfMissing21(db, table, column, definition) {
|
|
|
14399
14405
|
return;
|
|
14400
14406
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14401
14407
|
}
|
|
14402
|
-
function
|
|
14408
|
+
function up88(db) {
|
|
14403
14409
|
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
14404
14410
|
db.exec(`
|
|
14405
14411
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -14412,14 +14418,14 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
14412
14418
|
return;
|
|
14413
14419
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
14414
14420
|
}
|
|
14415
|
-
function
|
|
14421
|
+
function up89(db) {
|
|
14416
14422
|
addColumnIfMissing22(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
14417
14423
|
db.exec(`
|
|
14418
14424
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
14419
14425
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
14420
14426
|
`);
|
|
14421
14427
|
}
|
|
14422
|
-
function
|
|
14428
|
+
function up90(db) {
|
|
14423
14429
|
db.exec(`
|
|
14424
14430
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
14425
14431
|
agent_id TEXT NOT NULL,
|
|
@@ -14437,7 +14443,7 @@ function up89(db) {
|
|
|
14437
14443
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
14438
14444
|
`);
|
|
14439
14445
|
}
|
|
14440
|
-
function
|
|
14446
|
+
function up91(db) {
|
|
14441
14447
|
db.exec(`
|
|
14442
14448
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
14443
14449
|
id TEXT PRIMARY KEY,
|
|
@@ -14465,7 +14471,7 @@ function indexExists(db, table, indexName) {
|
|
|
14465
14471
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14466
14472
|
return rows.some((row) => row.name === indexName);
|
|
14467
14473
|
}
|
|
14468
|
-
function
|
|
14474
|
+
function up92(db) {
|
|
14469
14475
|
db.exec(`
|
|
14470
14476
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
14471
14477
|
id TEXT PRIMARY KEY,
|
|
@@ -14492,7 +14498,7 @@ function indexExists2(db, table, indexName) {
|
|
|
14492
14498
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
14493
14499
|
return rows.some((row) => row.name === indexName);
|
|
14494
14500
|
}
|
|
14495
|
-
function
|
|
14501
|
+
function up93(db) {
|
|
14496
14502
|
db.exec(`
|
|
14497
14503
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
14498
14504
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -14505,7 +14511,7 @@ function up92(db) {
|
|
|
14505
14511
|
)
|
|
14506
14512
|
`);
|
|
14507
14513
|
}
|
|
14508
|
-
function
|
|
14514
|
+
function up94(db) {
|
|
14509
14515
|
db.exec(`
|
|
14510
14516
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
14511
14517
|
id TEXT PRIMARY KEY,
|
|
@@ -14524,7 +14530,7 @@ function up93(db) {
|
|
|
14524
14530
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
14525
14531
|
`);
|
|
14526
14532
|
}
|
|
14527
|
-
function
|
|
14533
|
+
function up95(db) {
|
|
14528
14534
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14529
14535
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
14530
14536
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -14535,7 +14541,7 @@ function hasColumn13(db, table, column) {
|
|
|
14535
14541
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
14536
14542
|
return rows.some((r2) => r2.name === column);
|
|
14537
14543
|
}
|
|
14538
|
-
function
|
|
14544
|
+
function up96(db) {
|
|
14539
14545
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
14540
14546
|
if (tables.length === 0)
|
|
14541
14547
|
return;
|
|
@@ -14560,23 +14566,23 @@ function up95(db) {
|
|
|
14560
14566
|
function hasColumn14(db, table, column) {
|
|
14561
14567
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14562
14568
|
}
|
|
14563
|
-
function
|
|
14569
|
+
function up97(db) {
|
|
14564
14570
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
14565
14571
|
if (!hasMemories || !hasColumn14(db, "memories", "memory_kind") || !hasColumn14(db, "memories", "type"))
|
|
14566
14572
|
return;
|
|
14567
14573
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
14568
14574
|
}
|
|
14569
|
-
function
|
|
14575
|
+
function up98(db) {
|
|
14570
14576
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
14571
14577
|
}
|
|
14572
|
-
function
|
|
14578
|
+
function up99(db) {
|
|
14573
14579
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
14574
14580
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
14575
14581
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
14576
14582
|
}
|
|
14577
14583
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
14578
14584
|
}
|
|
14579
|
-
function
|
|
14585
|
+
function up100(db) {
|
|
14580
14586
|
db.exec(`
|
|
14581
14587
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
14582
14588
|
agent_id TEXT NOT NULL,
|
|
@@ -14593,7 +14599,7 @@ function up99(db) {
|
|
|
14593
14599
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
14594
14600
|
`);
|
|
14595
14601
|
}
|
|
14596
|
-
function
|
|
14602
|
+
function up101(db) {
|
|
14597
14603
|
db.exec(`
|
|
14598
14604
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
14599
14605
|
id TEXT PRIMARY KEY,
|
|
@@ -14613,7 +14619,7 @@ function up100(db) {
|
|
|
14613
14619
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
14614
14620
|
`);
|
|
14615
14621
|
}
|
|
14616
|
-
function
|
|
14622
|
+
function up102(db) {
|
|
14617
14623
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
14618
14624
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
14619
14625
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -14622,7 +14628,7 @@ function up101(db) {
|
|
|
14622
14628
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
14623
14629
|
}
|
|
14624
14630
|
}
|
|
14625
|
-
function
|
|
14631
|
+
function up103(db) {
|
|
14626
14632
|
db.exec(`
|
|
14627
14633
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
14628
14634
|
id TEXT PRIMARY KEY,
|
|
@@ -14644,7 +14650,7 @@ function up102(db) {
|
|
|
14644
14650
|
function hasColumn15(db, table, column) {
|
|
14645
14651
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14646
14652
|
}
|
|
14647
|
-
function
|
|
14653
|
+
function up104(db) {
|
|
14648
14654
|
const requiredMemoryColumns = [
|
|
14649
14655
|
"content_hash",
|
|
14650
14656
|
"normalized_content",
|
|
@@ -14695,7 +14701,7 @@ function up103(db) {
|
|
|
14695
14701
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
14696
14702
|
`);
|
|
14697
14703
|
}
|
|
14698
|
-
function
|
|
14704
|
+
function up105(db) {
|
|
14699
14705
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
14700
14706
|
if (tables.length !== 2)
|
|
14701
14707
|
return;
|
|
@@ -14718,7 +14724,7 @@ function tableExists(db, table) {
|
|
|
14718
14724
|
function hasColumn16(db, table, column) {
|
|
14719
14725
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14720
14726
|
}
|
|
14721
|
-
function
|
|
14727
|
+
function up106(db) {
|
|
14722
14728
|
db.exec(`
|
|
14723
14729
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
14724
14730
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -14761,7 +14767,7 @@ function up105(db) {
|
|
|
14761
14767
|
`);
|
|
14762
14768
|
}
|
|
14763
14769
|
}
|
|
14764
|
-
function
|
|
14770
|
+
function up107(db) {
|
|
14765
14771
|
db.exec(`
|
|
14766
14772
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
14767
14773
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -14850,7 +14856,7 @@ function up106(db) {
|
|
|
14850
14856
|
function hasColumn17(db, table, column) {
|
|
14851
14857
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
14852
14858
|
}
|
|
14853
|
-
function
|
|
14859
|
+
function up108(db) {
|
|
14854
14860
|
if (!hasColumn17(db, "memories", "review_after")) {
|
|
14855
14861
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
14856
14862
|
}
|
|
@@ -14866,14 +14872,14 @@ var TOKEN_COLUMNS = [
|
|
|
14866
14872
|
["tokens_cache_write", "INTEGER"],
|
|
14867
14873
|
["tokens_cost", "REAL"]
|
|
14868
14874
|
];
|
|
14869
|
-
function
|
|
14875
|
+
function up109(db) {
|
|
14870
14876
|
for (const [column, type] of TOKEN_COLUMNS) {
|
|
14871
14877
|
if (!hasColumn18(db, "dreaming_passes", column)) {
|
|
14872
14878
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
14873
14879
|
}
|
|
14874
14880
|
}
|
|
14875
14881
|
}
|
|
14876
|
-
function
|
|
14882
|
+
function up110(db) {
|
|
14877
14883
|
db.exec(`
|
|
14878
14884
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
14879
14885
|
day TEXT NOT NULL,
|
|
@@ -14886,7 +14892,7 @@ function up109(db) {
|
|
|
14886
14892
|
);
|
|
14887
14893
|
`);
|
|
14888
14894
|
}
|
|
14889
|
-
function
|
|
14895
|
+
function up111(db) {
|
|
14890
14896
|
db.exec(`
|
|
14891
14897
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
14892
14898
|
id TEXT PRIMARY KEY,
|
|
@@ -14894,7 +14900,7 @@ function up110(db) {
|
|
|
14894
14900
|
);
|
|
14895
14901
|
`);
|
|
14896
14902
|
}
|
|
14897
|
-
function
|
|
14903
|
+
function up112(db) {
|
|
14898
14904
|
db.exec(`
|
|
14899
14905
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
14900
14906
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -14905,7 +14911,7 @@ function hasColumn19(db, table, column) {
|
|
|
14905
14911
|
return rows.some((row) => row.name === column);
|
|
14906
14912
|
}
|
|
14907
14913
|
var COLUMNS2 = ["first_remember_at", "first_recall_at"];
|
|
14908
|
-
function
|
|
14914
|
+
function up113(db) {
|
|
14909
14915
|
for (const column of COLUMNS2) {
|
|
14910
14916
|
if (!hasColumn19(db, "telemetry_install", column)) {
|
|
14911
14917
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -14921,7 +14927,7 @@ function addColumnIfMissing23(db, column, definition) {
|
|
|
14921
14927
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
14922
14928
|
}
|
|
14923
14929
|
}
|
|
14924
|
-
function
|
|
14930
|
+
function up114(db) {
|
|
14925
14931
|
addColumnIfMissing23(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
14926
14932
|
addColumnIfMissing23(db, "claim_token", "TEXT");
|
|
14927
14933
|
addColumnIfMissing23(db, "claimed_at", "TEXT");
|
|
@@ -14930,7 +14936,7 @@ function up113(db) {
|
|
|
14930
14936
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
14931
14937
|
`);
|
|
14932
14938
|
}
|
|
14933
|
-
function
|
|
14939
|
+
function up115(db) {
|
|
14934
14940
|
db.exec(`
|
|
14935
14941
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
14936
14942
|
session_key TEXT NOT NULL,
|
|
@@ -14951,7 +14957,7 @@ function up114(db) {
|
|
|
14951
14957
|
ON session_claims(agent_id, state, expires_at);
|
|
14952
14958
|
`);
|
|
14953
14959
|
}
|
|
14954
|
-
function
|
|
14960
|
+
function up116(db) {
|
|
14955
14961
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
14956
14962
|
if (table == null)
|
|
14957
14963
|
return;
|
|
@@ -14960,7 +14966,7 @@ function up115(db) {
|
|
|
14960
14966
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
14961
14967
|
`);
|
|
14962
14968
|
}
|
|
14963
|
-
function
|
|
14969
|
+
function up117(db) {
|
|
14964
14970
|
db.exec(`
|
|
14965
14971
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
14966
14972
|
id TEXT PRIMARY KEY,
|
|
@@ -15017,7 +15023,7 @@ function addColumnIfMissing24(db, column, definition) {
|
|
|
15017
15023
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
15018
15024
|
}
|
|
15019
15025
|
}
|
|
15020
|
-
function
|
|
15026
|
+
function up118(db) {
|
|
15021
15027
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
15022
15028
|
if (table == null)
|
|
15023
15029
|
return;
|
|
@@ -15218,7 +15224,7 @@ function backfillTranscriptsFromSummaryJobs(db) {
|
|
|
15218
15224
|
insert.run(...values);
|
|
15219
15225
|
}
|
|
15220
15226
|
}
|
|
15221
|
-
function
|
|
15227
|
+
function up119(db) {
|
|
15222
15228
|
if (!hasTable4(db, "session_transcripts"))
|
|
15223
15229
|
return;
|
|
15224
15230
|
addColumnIfMissing25(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -15271,7 +15277,7 @@ function up118(db) {
|
|
|
15271
15277
|
ON session_transcripts(agent_id, content_hash);
|
|
15272
15278
|
`);
|
|
15273
15279
|
}
|
|
15274
|
-
function
|
|
15280
|
+
function up120(db) {
|
|
15275
15281
|
db.exec(`
|
|
15276
15282
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
15277
15283
|
ON memory_jobs(status)
|
|
@@ -15290,12 +15296,12 @@ function up119(db) {
|
|
|
15290
15296
|
function hasColumn22(db, table, column) {
|
|
15291
15297
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
15292
15298
|
}
|
|
15293
|
-
function
|
|
15299
|
+
function up121(db) {
|
|
15294
15300
|
if (!hasColumn22(db, "telemetry_install", "last_seen_version")) {
|
|
15295
15301
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
15296
15302
|
}
|
|
15297
15303
|
}
|
|
15298
|
-
function
|
|
15304
|
+
function up122(db) {
|
|
15299
15305
|
db.exec(`
|
|
15300
15306
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
15301
15307
|
agent_id TEXT NOT NULL,
|
|
@@ -15324,7 +15330,7 @@ function addColumnIfMissing26(db, column, definition) {
|
|
|
15324
15330
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
15325
15331
|
}
|
|
15326
15332
|
}
|
|
15327
|
-
function
|
|
15333
|
+
function up123(db) {
|
|
15328
15334
|
addColumnIfMissing26(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
15329
15335
|
addColumnIfMissing26(db, "last_attempt_at", "TEXT");
|
|
15330
15336
|
addColumnIfMissing26(db, "sent_at", "TEXT");
|
|
@@ -15345,7 +15351,7 @@ function up122(db) {
|
|
|
15345
15351
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
15346
15352
|
`);
|
|
15347
15353
|
}
|
|
15348
|
-
function
|
|
15354
|
+
function up124(db) {
|
|
15349
15355
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
15350
15356
|
const names = new Set(columns.map((column) => column.name));
|
|
15351
15357
|
if (!names.has("failure_class")) {
|
|
@@ -15362,7 +15368,7 @@ function up123(db) {
|
|
|
15362
15368
|
}
|
|
15363
15369
|
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)");
|
|
15364
15370
|
}
|
|
15365
|
-
function
|
|
15371
|
+
function up125(db) {
|
|
15366
15372
|
db.exec(`
|
|
15367
15373
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
15368
15374
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -15386,7 +15392,7 @@ function up124(db) {
|
|
|
15386
15392
|
ON embedding_index_failures(source_type, source_id);
|
|
15387
15393
|
`);
|
|
15388
15394
|
}
|
|
15389
|
-
function
|
|
15395
|
+
function up126(db) {
|
|
15390
15396
|
db.exec(`
|
|
15391
15397
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
15392
15398
|
id TEXT PRIMARY KEY,
|
|
@@ -15436,7 +15442,7 @@ function backfillTable(db, params) {
|
|
|
15436
15442
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
15437
15443
|
backfill(db, rows, params.sourceKind, params.scannedAt);
|
|
15438
15444
|
}
|
|
15439
|
-
function
|
|
15445
|
+
function up127(db) {
|
|
15440
15446
|
db.exec(`
|
|
15441
15447
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
15442
15448
|
agent_id TEXT NOT NULL,
|
|
@@ -15493,7 +15499,7 @@ function up126(db) {
|
|
|
15493
15499
|
scannedAt
|
|
15494
15500
|
});
|
|
15495
15501
|
}
|
|
15496
|
-
function
|
|
15502
|
+
function up128(db) {
|
|
15497
15503
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
15498
15504
|
if (!table)
|
|
15499
15505
|
return;
|
|
@@ -15527,7 +15533,7 @@ function up127(db) {
|
|
|
15527
15533
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
15528
15534
|
`);
|
|
15529
15535
|
}
|
|
15530
|
-
function
|
|
15536
|
+
function up129(db) {
|
|
15531
15537
|
db.exec(`
|
|
15532
15538
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
15533
15539
|
id TEXT PRIMARY KEY,
|
|
@@ -15583,7 +15589,7 @@ function up128(db) {
|
|
|
15583
15589
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
15584
15590
|
`);
|
|
15585
15591
|
}
|
|
15586
|
-
function
|
|
15592
|
+
function up130(db) {
|
|
15587
15593
|
db.exec(`
|
|
15588
15594
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
15589
15595
|
ON memory_jobs(status, created_at)
|
|
@@ -15598,7 +15604,7 @@ function up129(db) {
|
|
|
15598
15604
|
function tableExists3(db, table) {
|
|
15599
15605
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
15600
15606
|
}
|
|
15601
|
-
function
|
|
15607
|
+
function up131(db) {
|
|
15602
15608
|
if (!tableExists3(db, "memory_jobs"))
|
|
15603
15609
|
return;
|
|
15604
15610
|
if (!tableExists3(db, "job_cancellations")) {
|
|
@@ -15647,7 +15653,7 @@ function up130(db) {
|
|
|
15647
15653
|
AND status IN ('pending', 'leased');
|
|
15648
15654
|
`);
|
|
15649
15655
|
}
|
|
15650
|
-
function
|
|
15656
|
+
function up132(db) {
|
|
15651
15657
|
db.exec(`
|
|
15652
15658
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
15653
15659
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -15687,7 +15693,7 @@ function up131(db) {
|
|
|
15687
15693
|
END;
|
|
15688
15694
|
`);
|
|
15689
15695
|
}
|
|
15690
|
-
function
|
|
15696
|
+
function up133(db) {
|
|
15691
15697
|
db.exec(`
|
|
15692
15698
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
15693
15699
|
agent_id TEXT NOT NULL,
|
|
@@ -15710,13 +15716,13 @@ function up132(db) {
|
|
|
15710
15716
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
15711
15717
|
`);
|
|
15712
15718
|
}
|
|
15713
|
-
function
|
|
15719
|
+
function up134(db) {
|
|
15714
15720
|
db.exec(`
|
|
15715
15721
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
15716
15722
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
15717
15723
|
`);
|
|
15718
15724
|
}
|
|
15719
|
-
function
|
|
15725
|
+
function up135(db) {
|
|
15720
15726
|
db.exec(`
|
|
15721
15727
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
15722
15728
|
id TEXT PRIMARY KEY,
|
|
@@ -15768,7 +15774,7 @@ function up134(db) {
|
|
|
15768
15774
|
if (!names.has("format_version"))
|
|
15769
15775
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
15770
15776
|
}
|
|
15771
|
-
function
|
|
15777
|
+
function up136(db) {
|
|
15772
15778
|
db.exec(`
|
|
15773
15779
|
CREATE TABLE memory_head_entries_v134 (
|
|
15774
15780
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -15786,7 +15792,7 @@ function up135(db) {
|
|
|
15786
15792
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
15787
15793
|
`);
|
|
15788
15794
|
}
|
|
15789
|
-
function
|
|
15795
|
+
function up137(db) {
|
|
15790
15796
|
db.exec(`
|
|
15791
15797
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
15792
15798
|
agent_id TEXT NOT NULL,
|
|
@@ -15802,7 +15808,7 @@ function up136(db) {
|
|
|
15802
15808
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
15803
15809
|
`);
|
|
15804
15810
|
}
|
|
15805
|
-
function
|
|
15811
|
+
function up138(db) {
|
|
15806
15812
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
|
|
15807
15813
|
for (const [name, type] of [
|
|
15808
15814
|
["entry_id", "TEXT"],
|
|
@@ -15816,7 +15822,7 @@ function up137(db) {
|
|
|
15816
15822
|
}
|
|
15817
15823
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
15818
15824
|
}
|
|
15819
|
-
function
|
|
15825
|
+
function up139(db) {
|
|
15820
15826
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
|
|
15821
15827
|
for (const [name, type] of [
|
|
15822
15828
|
["head_revision", "INTEGER"],
|
|
@@ -15838,7 +15844,7 @@ function addColumnIfMissing27(db, table, column, definition) {
|
|
|
15838
15844
|
if (!hasColumn25(db, table, column))
|
|
15839
15845
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
15840
15846
|
}
|
|
15841
|
-
function
|
|
15847
|
+
function up140(db) {
|
|
15842
15848
|
addColumnIfMissing27(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
15843
15849
|
db.exec(`
|
|
15844
15850
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -16143,7 +16149,7 @@ function up139(db) {
|
|
|
16143
16149
|
GROUP BY j.agent_id;
|
|
16144
16150
|
`);
|
|
16145
16151
|
}
|
|
16146
|
-
function
|
|
16152
|
+
function up141(db) {
|
|
16147
16153
|
db.exec(`
|
|
16148
16154
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
16149
16155
|
agent_id TEXT NOT NULL,
|
|
@@ -16159,7 +16165,7 @@ function up140(db) {
|
|
|
16159
16165
|
ON native_source_sync_state(agent_id, status);
|
|
16160
16166
|
`);
|
|
16161
16167
|
}
|
|
16162
|
-
function
|
|
16168
|
+
function up142(db) {
|
|
16163
16169
|
db.exec(`
|
|
16164
16170
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
16165
16171
|
agent_id TEXT NOT NULL,
|
|
@@ -16171,7 +16177,7 @@ function up141(db) {
|
|
|
16171
16177
|
);
|
|
16172
16178
|
`);
|
|
16173
16179
|
}
|
|
16174
|
-
function
|
|
16180
|
+
function up143(db) {
|
|
16175
16181
|
db.exec(`
|
|
16176
16182
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
16177
16183
|
agent_id TEXT NOT NULL,
|
|
@@ -16185,13 +16191,13 @@ function up142(db) {
|
|
|
16185
16191
|
);
|
|
16186
16192
|
`);
|
|
16187
16193
|
}
|
|
16188
|
-
function
|
|
16194
|
+
function up144(db) {
|
|
16189
16195
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
16190
16196
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
16191
16197
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
16192
16198
|
}
|
|
16193
16199
|
}
|
|
16194
|
-
function
|
|
16200
|
+
function up145(db) {
|
|
16195
16201
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16196
16202
|
const additions = [
|
|
16197
16203
|
["migration_phase", "TEXT"],
|
|
@@ -16226,13 +16232,13 @@ function up144(db) {
|
|
|
16226
16232
|
`);
|
|
16227
16233
|
}
|
|
16228
16234
|
}
|
|
16229
|
-
function
|
|
16235
|
+
function up146(db) {
|
|
16230
16236
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
16231
16237
|
if (!columns.has("lease_token")) {
|
|
16232
16238
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
16233
16239
|
}
|
|
16234
16240
|
}
|
|
16235
|
-
function
|
|
16241
|
+
function up147(db) {
|
|
16236
16242
|
db.exec(`
|
|
16237
16243
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
16238
16244
|
agent_id TEXT NOT NULL,
|
|
@@ -16250,7 +16256,7 @@ function up146(db) {
|
|
|
16250
16256
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
16251
16257
|
`);
|
|
16252
16258
|
}
|
|
16253
|
-
function
|
|
16259
|
+
function up148(db) {
|
|
16254
16260
|
db.exec(`
|
|
16255
16261
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
16256
16262
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -16317,16 +16323,16 @@ function up147(db) {
|
|
|
16317
16323
|
}
|
|
16318
16324
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
16319
16325
|
}
|
|
16320
|
-
function
|
|
16326
|
+
function up149(db) {
|
|
16321
16327
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
16322
16328
|
}
|
|
16323
|
-
function
|
|
16329
|
+
function up150(db) {
|
|
16324
16330
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
16325
16331
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
16326
16332
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
16327
16333
|
}
|
|
16328
16334
|
}
|
|
16329
|
-
function
|
|
16335
|
+
function up151(db) {
|
|
16330
16336
|
const addColumn = (table, column, definition) => {
|
|
16331
16337
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
16332
16338
|
let exists;
|
|
@@ -16347,7 +16353,7 @@ function addColumnIfMissing28(db, table, column, definition) {
|
|
|
16347
16353
|
if (!columns.some((row) => row.name === column))
|
|
16348
16354
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
16349
16355
|
}
|
|
16350
|
-
function
|
|
16356
|
+
function up152(db) {
|
|
16351
16357
|
addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
16352
16358
|
addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
16353
16359
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -16501,13 +16507,13 @@ var MIGRATIONS = [
|
|
|
16501
16507
|
{
|
|
16502
16508
|
version: 1,
|
|
16503
16509
|
name: "baseline",
|
|
16504
|
-
up:
|
|
16510
|
+
up: up3,
|
|
16505
16511
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
16506
16512
|
},
|
|
16507
16513
|
{
|
|
16508
16514
|
version: 2,
|
|
16509
16515
|
name: "pipeline-v2",
|
|
16510
|
-
up:
|
|
16516
|
+
up: up4,
|
|
16511
16517
|
artifacts: {
|
|
16512
16518
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
16513
16519
|
}
|
|
@@ -16515,12 +16521,12 @@ var MIGRATIONS = [
|
|
|
16515
16521
|
{
|
|
16516
16522
|
version: 3,
|
|
16517
16523
|
name: "unique-content-hash",
|
|
16518
|
-
up:
|
|
16524
|
+
up: up5
|
|
16519
16525
|
},
|
|
16520
16526
|
{
|
|
16521
16527
|
version: 4,
|
|
16522
16528
|
name: "history-actor-and-retention",
|
|
16523
|
-
up:
|
|
16529
|
+
up: up6,
|
|
16524
16530
|
artifacts: {
|
|
16525
16531
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
16526
16532
|
}
|
|
@@ -16528,7 +16534,7 @@ var MIGRATIONS = [
|
|
|
16528
16534
|
{
|
|
16529
16535
|
version: 5,
|
|
16530
16536
|
name: "graph-extended",
|
|
16531
|
-
up:
|
|
16537
|
+
up: up7,
|
|
16532
16538
|
artifacts: {
|
|
16533
16539
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
16534
16540
|
}
|
|
@@ -16536,7 +16542,7 @@ var MIGRATIONS = [
|
|
|
16536
16542
|
{
|
|
16537
16543
|
version: 6,
|
|
16538
16544
|
name: "idempotency-key",
|
|
16539
|
-
up:
|
|
16545
|
+
up: up8,
|
|
16540
16546
|
artifacts: {
|
|
16541
16547
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
16542
16548
|
}
|
|
@@ -16544,42 +16550,42 @@ var MIGRATIONS = [
|
|
|
16544
16550
|
{
|
|
16545
16551
|
version: 7,
|
|
16546
16552
|
name: "documents-and-connectors",
|
|
16547
|
-
up:
|
|
16553
|
+
up: up9,
|
|
16548
16554
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
16549
16555
|
},
|
|
16550
16556
|
{
|
|
16551
16557
|
version: 8,
|
|
16552
16558
|
name: "embeddings-unique-hash",
|
|
16553
|
-
up:
|
|
16559
|
+
up: up10
|
|
16554
16560
|
},
|
|
16555
16561
|
{
|
|
16556
16562
|
version: 9,
|
|
16557
16563
|
name: "summary-jobs",
|
|
16558
|
-
up:
|
|
16564
|
+
up: up11,
|
|
16559
16565
|
artifacts: { tables: ["summary_jobs"] }
|
|
16560
16566
|
},
|
|
16561
16567
|
{
|
|
16562
16568
|
version: 10,
|
|
16563
16569
|
name: "umap-cache",
|
|
16564
|
-
up:
|
|
16570
|
+
up: up12,
|
|
16565
16571
|
artifacts: { tables: ["umap_cache"] }
|
|
16566
16572
|
},
|
|
16567
16573
|
{
|
|
16568
16574
|
version: 11,
|
|
16569
16575
|
name: "session-scores",
|
|
16570
|
-
up:
|
|
16576
|
+
up: up13,
|
|
16571
16577
|
artifacts: { tables: ["session_scores"] }
|
|
16572
16578
|
},
|
|
16573
16579
|
{
|
|
16574
16580
|
version: 12,
|
|
16575
16581
|
name: "scheduled-tasks",
|
|
16576
|
-
up:
|
|
16582
|
+
up: up14,
|
|
16577
16583
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
16578
16584
|
},
|
|
16579
16585
|
{
|
|
16580
16586
|
version: 13,
|
|
16581
16587
|
name: "ingestion-tracking",
|
|
16582
|
-
up:
|
|
16588
|
+
up: up15,
|
|
16583
16589
|
artifacts: {
|
|
16584
16590
|
columns: [
|
|
16585
16591
|
{ table: "memories", column: "source_path" },
|
|
@@ -16590,13 +16596,13 @@ var MIGRATIONS = [
|
|
|
16590
16596
|
{
|
|
16591
16597
|
version: 14,
|
|
16592
16598
|
name: "telemetry",
|
|
16593
|
-
up:
|
|
16599
|
+
up: up16,
|
|
16594
16600
|
artifacts: { tables: ["telemetry_events"] }
|
|
16595
16601
|
},
|
|
16596
16602
|
{
|
|
16597
16603
|
version: 15,
|
|
16598
16604
|
name: "session-memories",
|
|
16599
|
-
up:
|
|
16605
|
+
up: up17,
|
|
16600
16606
|
artifacts: {
|
|
16601
16607
|
tables: ["session_memories"],
|
|
16602
16608
|
columns: [
|
|
@@ -16608,13 +16614,13 @@ var MIGRATIONS = [
|
|
|
16608
16614
|
{
|
|
16609
16615
|
version: 16,
|
|
16610
16616
|
name: "session-checkpoints",
|
|
16611
|
-
up:
|
|
16617
|
+
up: up18,
|
|
16612
16618
|
artifacts: { tables: ["session_checkpoints"] }
|
|
16613
16619
|
},
|
|
16614
16620
|
{
|
|
16615
16621
|
version: 17,
|
|
16616
16622
|
name: "task-skills",
|
|
16617
|
-
up:
|
|
16623
|
+
up: up19,
|
|
16618
16624
|
artifacts: {
|
|
16619
16625
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
16620
16626
|
}
|
|
@@ -16622,13 +16628,13 @@ var MIGRATIONS = [
|
|
|
16622
16628
|
{
|
|
16623
16629
|
version: 18,
|
|
16624
16630
|
name: "skill-meta",
|
|
16625
|
-
up:
|
|
16631
|
+
up: up20,
|
|
16626
16632
|
artifacts: { tables: ["skill_meta"] }
|
|
16627
16633
|
},
|
|
16628
16634
|
{
|
|
16629
16635
|
version: 19,
|
|
16630
16636
|
name: "knowledge-structure",
|
|
16631
|
-
up:
|
|
16637
|
+
up: up21,
|
|
16632
16638
|
artifacts: {
|
|
16633
16639
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
16634
16640
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -16637,7 +16643,7 @@ var MIGRATIONS = [
|
|
|
16637
16643
|
{
|
|
16638
16644
|
version: 20,
|
|
16639
16645
|
name: "session-structural-columns",
|
|
16640
|
-
up:
|
|
16646
|
+
up: up22,
|
|
16641
16647
|
artifacts: {
|
|
16642
16648
|
columns: [
|
|
16643
16649
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -16650,7 +16656,7 @@ var MIGRATIONS = [
|
|
|
16650
16656
|
{
|
|
16651
16657
|
version: 21,
|
|
16652
16658
|
name: "checkpoint-structural",
|
|
16653
|
-
up:
|
|
16659
|
+
up: up23,
|
|
16654
16660
|
artifacts: {
|
|
16655
16661
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
16656
16662
|
}
|
|
@@ -16658,7 +16664,7 @@ var MIGRATIONS = [
|
|
|
16658
16664
|
{
|
|
16659
16665
|
version: 22,
|
|
16660
16666
|
name: "entity-pinning",
|
|
16661
|
-
up:
|
|
16667
|
+
up: up24,
|
|
16662
16668
|
artifacts: {
|
|
16663
16669
|
columns: [
|
|
16664
16670
|
{ table: "entities", column: "pinned" },
|
|
@@ -16669,17 +16675,17 @@ var MIGRATIONS = [
|
|
|
16669
16675
|
{
|
|
16670
16676
|
version: 23,
|
|
16671
16677
|
name: "retired-scorer-gap",
|
|
16672
|
-
up:
|
|
16678
|
+
up: up25
|
|
16673
16679
|
},
|
|
16674
16680
|
{
|
|
16675
16681
|
version: 24,
|
|
16676
16682
|
name: "retired-scorer-gap",
|
|
16677
|
-
up:
|
|
16683
|
+
up: up26
|
|
16678
16684
|
},
|
|
16679
16685
|
{
|
|
16680
16686
|
version: 25,
|
|
16681
16687
|
name: "agent-feedback",
|
|
16682
|
-
up:
|
|
16688
|
+
up: up27,
|
|
16683
16689
|
artifacts: {
|
|
16684
16690
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
16685
16691
|
}
|
|
@@ -16687,32 +16693,32 @@ var MIGRATIONS = [
|
|
|
16687
16693
|
{
|
|
16688
16694
|
version: 26,
|
|
16689
16695
|
name: "retired-scorer-gap",
|
|
16690
|
-
up:
|
|
16696
|
+
up: up28
|
|
16691
16697
|
},
|
|
16692
16698
|
{
|
|
16693
16699
|
version: 27,
|
|
16694
16700
|
name: "backfill-canonical-names",
|
|
16695
|
-
up:
|
|
16701
|
+
up: up29
|
|
16696
16702
|
},
|
|
16697
16703
|
{
|
|
16698
16704
|
version: 28,
|
|
16699
16705
|
name: "lossless-retention",
|
|
16700
|
-
up:
|
|
16706
|
+
up: up30
|
|
16701
16707
|
},
|
|
16702
16708
|
{
|
|
16703
16709
|
version: 29,
|
|
16704
16710
|
name: "session-summary-dag",
|
|
16705
|
-
up:
|
|
16711
|
+
up: up31
|
|
16706
16712
|
},
|
|
16707
16713
|
{
|
|
16708
16714
|
version: 30,
|
|
16709
16715
|
name: "nullable-memory-job-memory-id",
|
|
16710
|
-
up:
|
|
16716
|
+
up: up32
|
|
16711
16717
|
},
|
|
16712
16718
|
{
|
|
16713
16719
|
version: 31,
|
|
16714
16720
|
name: "dependency-reason",
|
|
16715
|
-
up:
|
|
16721
|
+
up: up33,
|
|
16716
16722
|
artifacts: {
|
|
16717
16723
|
columns: [
|
|
16718
16724
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -16723,7 +16729,7 @@ var MIGRATIONS = [
|
|
|
16723
16729
|
{
|
|
16724
16730
|
version: 32,
|
|
16725
16731
|
name: "embeddings-vector-column",
|
|
16726
|
-
up:
|
|
16732
|
+
up: up34,
|
|
16727
16733
|
artifacts: {
|
|
16728
16734
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
16729
16735
|
}
|
|
@@ -16731,7 +16737,7 @@ var MIGRATIONS = [
|
|
|
16731
16737
|
{
|
|
16732
16738
|
version: 33,
|
|
16733
16739
|
name: "scope",
|
|
16734
|
-
up:
|
|
16740
|
+
up: up35,
|
|
16735
16741
|
artifacts: {
|
|
16736
16742
|
columns: [{ table: "memories", column: "scope" }]
|
|
16737
16743
|
}
|
|
@@ -16739,17 +16745,17 @@ var MIGRATIONS = [
|
|
|
16739
16745
|
{
|
|
16740
16746
|
version: 34,
|
|
16741
16747
|
name: "scope-aware-dedup",
|
|
16742
|
-
up:
|
|
16748
|
+
up: up36
|
|
16743
16749
|
},
|
|
16744
16750
|
{
|
|
16745
16751
|
version: 35,
|
|
16746
16752
|
name: "entity-fts",
|
|
16747
|
-
up:
|
|
16753
|
+
up: up37
|
|
16748
16754
|
},
|
|
16749
16755
|
{
|
|
16750
16756
|
version: 36,
|
|
16751
16757
|
name: "dependency-confidence",
|
|
16752
|
-
up:
|
|
16758
|
+
up: up38,
|
|
16753
16759
|
artifacts: {
|
|
16754
16760
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
16755
16761
|
}
|
|
@@ -16757,7 +16763,7 @@ var MIGRATIONS = [
|
|
|
16757
16763
|
{
|
|
16758
16764
|
version: 37,
|
|
16759
16765
|
name: "entity-communities",
|
|
16760
|
-
up:
|
|
16766
|
+
up: up39,
|
|
16761
16767
|
artifacts: {
|
|
16762
16768
|
tables: ["entity_communities"],
|
|
16763
16769
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -16766,24 +16772,24 @@ var MIGRATIONS = [
|
|
|
16766
16772
|
{
|
|
16767
16773
|
version: 38,
|
|
16768
16774
|
name: "memory-hints",
|
|
16769
|
-
up:
|
|
16775
|
+
up: up40,
|
|
16770
16776
|
artifacts: { tables: ["memory_hints"] }
|
|
16771
16777
|
},
|
|
16772
16778
|
{
|
|
16773
16779
|
version: 39,
|
|
16774
16780
|
name: "dedup-entity-dependencies",
|
|
16775
|
-
up:
|
|
16781
|
+
up: up41
|
|
16776
16782
|
},
|
|
16777
16783
|
{
|
|
16778
16784
|
version: 40,
|
|
16779
16785
|
name: "session-transcripts",
|
|
16780
|
-
up:
|
|
16786
|
+
up: up42,
|
|
16781
16787
|
artifacts: { tables: ["session_transcripts"] }
|
|
16782
16788
|
},
|
|
16783
16789
|
{
|
|
16784
16790
|
version: 41,
|
|
16785
16791
|
name: "path-feedback",
|
|
16786
|
-
up:
|
|
16792
|
+
up: up43,
|
|
16787
16793
|
artifacts: {
|
|
16788
16794
|
tables: [
|
|
16789
16795
|
"path_feedback_events",
|
|
@@ -16798,7 +16804,7 @@ var MIGRATIONS = [
|
|
|
16798
16804
|
{
|
|
16799
16805
|
version: 42,
|
|
16800
16806
|
name: "session-memories-agent-id",
|
|
16801
|
-
up:
|
|
16807
|
+
up: up44,
|
|
16802
16808
|
artifacts: {
|
|
16803
16809
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
16804
16810
|
}
|
|
@@ -16806,7 +16812,7 @@ var MIGRATIONS = [
|
|
|
16806
16812
|
{
|
|
16807
16813
|
version: 43,
|
|
16808
16814
|
name: "agents-table",
|
|
16809
|
-
up:
|
|
16815
|
+
up: up45,
|
|
16810
16816
|
artifacts: {
|
|
16811
16817
|
tables: ["agents"],
|
|
16812
16818
|
columns: [
|
|
@@ -16818,7 +16824,7 @@ var MIGRATIONS = [
|
|
|
16818
16824
|
{
|
|
16819
16825
|
version: 44,
|
|
16820
16826
|
name: "memory-md-temporal-head",
|
|
16821
|
-
up:
|
|
16827
|
+
up: up46,
|
|
16822
16828
|
artifacts: {
|
|
16823
16829
|
columns: [
|
|
16824
16830
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -16830,7 +16836,7 @@ var MIGRATIONS = [
|
|
|
16830
16836
|
{
|
|
16831
16837
|
version: 45,
|
|
16832
16838
|
name: "lossless-working-memory-hardening",
|
|
16833
|
-
up:
|
|
16839
|
+
up: up47,
|
|
16834
16840
|
artifacts: {
|
|
16835
16841
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
16836
16842
|
columns: [
|
|
@@ -16843,17 +16849,17 @@ var MIGRATIONS = [
|
|
|
16843
16849
|
{
|
|
16844
16850
|
version: 46,
|
|
16845
16851
|
name: "session-summary-uniqueness",
|
|
16846
|
-
up:
|
|
16852
|
+
up: up48
|
|
16847
16853
|
},
|
|
16848
16854
|
{
|
|
16849
16855
|
version: 47,
|
|
16850
16856
|
name: "agent-scoped-temporal-uniqueness",
|
|
16851
|
-
up:
|
|
16857
|
+
up: up49
|
|
16852
16858
|
},
|
|
16853
16859
|
{
|
|
16854
16860
|
version: 48,
|
|
16855
16861
|
name: "thread-heads",
|
|
16856
|
-
up:
|
|
16862
|
+
up: up50,
|
|
16857
16863
|
artifacts: {
|
|
16858
16864
|
tables: ["memory_thread_heads"]
|
|
16859
16865
|
}
|
|
@@ -16861,7 +16867,7 @@ var MIGRATIONS = [
|
|
|
16861
16867
|
{
|
|
16862
16868
|
version: 49,
|
|
16863
16869
|
name: "session-extract-cursors",
|
|
16864
|
-
up:
|
|
16870
|
+
up: up51,
|
|
16865
16871
|
artifacts: {
|
|
16866
16872
|
tables: ["session_extract_cursors"]
|
|
16867
16873
|
}
|
|
@@ -16869,7 +16875,7 @@ var MIGRATIONS = [
|
|
|
16869
16875
|
{
|
|
16870
16876
|
version: 50,
|
|
16871
16877
|
name: "related-to-audit",
|
|
16872
|
-
up:
|
|
16878
|
+
up: up52,
|
|
16873
16879
|
artifacts: {
|
|
16874
16880
|
tables: ["entity_dependency_history"]
|
|
16875
16881
|
}
|
|
@@ -16877,7 +16883,7 @@ var MIGRATIONS = [
|
|
|
16877
16883
|
{
|
|
16878
16884
|
version: 51,
|
|
16879
16885
|
name: "memory-md-rolling-window-lineage",
|
|
16880
|
-
up:
|
|
16886
|
+
up: up53,
|
|
16881
16887
|
artifacts: {
|
|
16882
16888
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
16883
16889
|
columns: [
|
|
@@ -16892,7 +16898,7 @@ var MIGRATIONS = [
|
|
|
16892
16898
|
{
|
|
16893
16899
|
version: 52,
|
|
16894
16900
|
name: "mcp-invocations",
|
|
16895
|
-
up:
|
|
16901
|
+
up: up54,
|
|
16896
16902
|
artifacts: {
|
|
16897
16903
|
tables: ["mcp_invocations"]
|
|
16898
16904
|
}
|
|
@@ -16900,7 +16906,7 @@ var MIGRATIONS = [
|
|
|
16900
16906
|
{
|
|
16901
16907
|
version: 53,
|
|
16902
16908
|
name: "skill-invocations",
|
|
16903
|
-
up:
|
|
16909
|
+
up: up55,
|
|
16904
16910
|
artifacts: {
|
|
16905
16911
|
tables: ["skill_invocations"]
|
|
16906
16912
|
}
|
|
@@ -16908,7 +16914,7 @@ var MIGRATIONS = [
|
|
|
16908
16914
|
{
|
|
16909
16915
|
version: 54,
|
|
16910
16916
|
name: "task-agent-scope",
|
|
16911
|
-
up:
|
|
16917
|
+
up: up56,
|
|
16912
16918
|
artifacts: {
|
|
16913
16919
|
tables: ["task_scope_hints"]
|
|
16914
16920
|
}
|
|
@@ -16916,7 +16922,7 @@ var MIGRATIONS = [
|
|
|
16916
16922
|
{
|
|
16917
16923
|
version: 55,
|
|
16918
16924
|
name: "dreaming-state",
|
|
16919
|
-
up:
|
|
16925
|
+
up: up57,
|
|
16920
16926
|
artifacts: {
|
|
16921
16927
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
16922
16928
|
}
|
|
@@ -16924,22 +16930,22 @@ var MIGRATIONS = [
|
|
|
16924
16930
|
{
|
|
16925
16931
|
version: 56,
|
|
16926
16932
|
name: "agent-scoped-content-hash",
|
|
16927
|
-
up:
|
|
16933
|
+
up: up58
|
|
16928
16934
|
},
|
|
16929
16935
|
{
|
|
16930
16936
|
version: 57,
|
|
16931
16937
|
name: "memories-fts-tokenizer-repair",
|
|
16932
|
-
up:
|
|
16938
|
+
up: up59
|
|
16933
16939
|
},
|
|
16934
16940
|
{
|
|
16935
16941
|
version: 58,
|
|
16936
16942
|
name: "knowledge-graph-indices",
|
|
16937
|
-
up:
|
|
16943
|
+
up: up60
|
|
16938
16944
|
},
|
|
16939
16945
|
{
|
|
16940
16946
|
version: 59,
|
|
16941
16947
|
name: "entity-attribute-claim-key",
|
|
16942
|
-
up:
|
|
16948
|
+
up: up61,
|
|
16943
16949
|
artifacts: {
|
|
16944
16950
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
16945
16951
|
}
|
|
@@ -16947,7 +16953,7 @@ var MIGRATIONS = [
|
|
|
16947
16953
|
{
|
|
16948
16954
|
version: 60,
|
|
16949
16955
|
name: "entity-attribute-group-key",
|
|
16950
|
-
up:
|
|
16956
|
+
up: up62,
|
|
16951
16957
|
artifacts: {
|
|
16952
16958
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
16953
16959
|
}
|
|
@@ -16955,7 +16961,7 @@ var MIGRATIONS = [
|
|
|
16955
16961
|
{
|
|
16956
16962
|
version: 61,
|
|
16957
16963
|
name: "memory-artifact-source-mtime",
|
|
16958
|
-
up:
|
|
16964
|
+
up: up63,
|
|
16959
16965
|
artifacts: {
|
|
16960
16966
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
16961
16967
|
}
|
|
@@ -16963,7 +16969,7 @@ var MIGRATIONS = [
|
|
|
16963
16969
|
{
|
|
16964
16970
|
version: 62,
|
|
16965
16971
|
name: "memory-artifact-soft-delete",
|
|
16966
|
-
up:
|
|
16972
|
+
up: up64,
|
|
16967
16973
|
artifacts: {
|
|
16968
16974
|
columns: [
|
|
16969
16975
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -16974,12 +16980,12 @@ var MIGRATIONS = [
|
|
|
16974
16980
|
{
|
|
16975
16981
|
version: 63,
|
|
16976
16982
|
name: "content-only-memories-fts-update",
|
|
16977
|
-
up:
|
|
16983
|
+
up: up65
|
|
16978
16984
|
},
|
|
16979
16985
|
{
|
|
16980
16986
|
version: 64,
|
|
16981
16987
|
name: "source-graph-provenance",
|
|
16982
|
-
up:
|
|
16988
|
+
up: up66,
|
|
16983
16989
|
artifacts: {
|
|
16984
16990
|
columns: [
|
|
16985
16991
|
{ table: "entities", column: "source_path" },
|
|
@@ -16992,7 +16998,7 @@ var MIGRATIONS = [
|
|
|
16992
16998
|
{
|
|
16993
16999
|
version: 65,
|
|
16994
17000
|
name: "source-embedding-agent-scope",
|
|
16995
|
-
up:
|
|
17001
|
+
up: up67,
|
|
16996
17002
|
artifacts: {
|
|
16997
17003
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
16998
17004
|
}
|
|
@@ -17000,7 +17006,7 @@ var MIGRATIONS = [
|
|
|
17000
17006
|
{
|
|
17001
17007
|
version: 66,
|
|
17002
17008
|
name: "memory-search-telemetry",
|
|
17003
|
-
up:
|
|
17009
|
+
up: up68,
|
|
17004
17010
|
artifacts: {
|
|
17005
17011
|
tables: ["memory_search_telemetry"]
|
|
17006
17012
|
}
|
|
@@ -17008,7 +17014,7 @@ var MIGRATIONS = [
|
|
|
17008
17014
|
{
|
|
17009
17015
|
version: 67,
|
|
17010
17016
|
name: "ontology-proposals",
|
|
17011
|
-
up:
|
|
17017
|
+
up: up69,
|
|
17012
17018
|
artifacts: {
|
|
17013
17019
|
tables: ["ontology_proposals"],
|
|
17014
17020
|
columns: [
|
|
@@ -17022,7 +17028,7 @@ var MIGRATIONS = [
|
|
|
17022
17028
|
{
|
|
17023
17029
|
version: 68,
|
|
17024
17030
|
name: "daily-reflections",
|
|
17025
|
-
up:
|
|
17031
|
+
up: up70,
|
|
17026
17032
|
artifacts: {
|
|
17027
17033
|
tables: ["daily_reflections"]
|
|
17028
17034
|
}
|
|
@@ -17030,7 +17036,7 @@ var MIGRATIONS = [
|
|
|
17030
17036
|
{
|
|
17031
17037
|
version: 69,
|
|
17032
17038
|
name: "daily-reflections-multiple-insights",
|
|
17033
|
-
up:
|
|
17039
|
+
up: up71,
|
|
17034
17040
|
artifacts: {
|
|
17035
17041
|
tables: ["daily_reflections"]
|
|
17036
17042
|
}
|
|
@@ -17038,7 +17044,7 @@ var MIGRATIONS = [
|
|
|
17038
17044
|
{
|
|
17039
17045
|
version: 70,
|
|
17040
17046
|
name: "ontology-control-plane-state",
|
|
17041
|
-
up:
|
|
17047
|
+
up: up72,
|
|
17042
17048
|
artifacts: {
|
|
17043
17049
|
columns: [
|
|
17044
17050
|
{ table: "entities", column: "status" },
|
|
@@ -17053,7 +17059,7 @@ var MIGRATIONS = [
|
|
|
17053
17059
|
{
|
|
17054
17060
|
version: 71,
|
|
17055
17061
|
name: "epistemic-assertions",
|
|
17056
|
-
up:
|
|
17062
|
+
up: up73,
|
|
17057
17063
|
artifacts: {
|
|
17058
17064
|
tables: ["epistemic_assertions"]
|
|
17059
17065
|
}
|
|
@@ -17061,7 +17067,7 @@ var MIGRATIONS = [
|
|
|
17061
17067
|
{
|
|
17062
17068
|
version: 72,
|
|
17063
17069
|
name: "agent-scoped-idempotency-key",
|
|
17064
|
-
up:
|
|
17070
|
+
up: up74,
|
|
17065
17071
|
artifacts: {
|
|
17066
17072
|
columns: [
|
|
17067
17073
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -17072,7 +17078,7 @@ var MIGRATIONS = [
|
|
|
17072
17078
|
{
|
|
17073
17079
|
version: 73,
|
|
17074
17080
|
name: "recall-context-dedupe",
|
|
17075
|
-
up:
|
|
17081
|
+
up: up75,
|
|
17076
17082
|
artifacts: {
|
|
17077
17083
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
17078
17084
|
}
|
|
@@ -17080,7 +17086,7 @@ var MIGRATIONS = [
|
|
|
17080
17086
|
{
|
|
17081
17087
|
version: 74,
|
|
17082
17088
|
name: "aggregate-memory-links",
|
|
17083
|
-
up:
|
|
17089
|
+
up: up76,
|
|
17084
17090
|
artifacts: {
|
|
17085
17091
|
tables: ["aggregate_memory_sources"]
|
|
17086
17092
|
}
|
|
@@ -17088,7 +17094,7 @@ var MIGRATIONS = [
|
|
|
17088
17094
|
{
|
|
17089
17095
|
version: 75,
|
|
17090
17096
|
name: "memory-artifact-source-provenance",
|
|
17091
|
-
up:
|
|
17097
|
+
up: up77,
|
|
17092
17098
|
artifacts: {
|
|
17093
17099
|
columns: [
|
|
17094
17100
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -17102,7 +17108,7 @@ var MIGRATIONS = [
|
|
|
17102
17108
|
{
|
|
17103
17109
|
version: 76,
|
|
17104
17110
|
name: "temporal-edges",
|
|
17105
|
-
up:
|
|
17111
|
+
up: up78,
|
|
17106
17112
|
artifacts: {
|
|
17107
17113
|
tables: ["temporal_edges"]
|
|
17108
17114
|
}
|
|
@@ -17110,7 +17116,7 @@ var MIGRATIONS = [
|
|
|
17110
17116
|
{
|
|
17111
17117
|
version: 77,
|
|
17112
17118
|
name: "entity-aliases",
|
|
17113
|
-
up:
|
|
17119
|
+
up: up79,
|
|
17114
17120
|
artifacts: {
|
|
17115
17121
|
tables: ["entity_aliases"]
|
|
17116
17122
|
}
|
|
@@ -17118,7 +17124,7 @@ var MIGRATIONS = [
|
|
|
17118
17124
|
{
|
|
17119
17125
|
version: 78,
|
|
17120
17126
|
name: "api-keys",
|
|
17121
|
-
up:
|
|
17127
|
+
up: up80,
|
|
17122
17128
|
artifacts: {
|
|
17123
17129
|
tables: ["api_keys"]
|
|
17124
17130
|
}
|
|
@@ -17126,7 +17132,7 @@ var MIGRATIONS = [
|
|
|
17126
17132
|
{
|
|
17127
17133
|
version: 79,
|
|
17128
17134
|
name: "transcript-capture-jobs",
|
|
17129
|
-
up:
|
|
17135
|
+
up: up81,
|
|
17130
17136
|
artifacts: {
|
|
17131
17137
|
tables: ["transcript_capture_jobs"]
|
|
17132
17138
|
}
|
|
@@ -17134,7 +17140,7 @@ var MIGRATIONS = [
|
|
|
17134
17140
|
{
|
|
17135
17141
|
version: 80,
|
|
17136
17142
|
name: "document-scope-columns",
|
|
17137
|
-
up:
|
|
17143
|
+
up: up82,
|
|
17138
17144
|
artifacts: {
|
|
17139
17145
|
columns: [
|
|
17140
17146
|
{ table: "documents", column: "agent_id" },
|
|
@@ -17145,7 +17151,7 @@ var MIGRATIONS = [
|
|
|
17145
17151
|
{
|
|
17146
17152
|
version: 81,
|
|
17147
17153
|
name: "aggregate-evidence-sources",
|
|
17148
|
-
up:
|
|
17154
|
+
up: up83,
|
|
17149
17155
|
artifacts: {
|
|
17150
17156
|
tables: ["aggregate_evidence_sources"]
|
|
17151
17157
|
}
|
|
@@ -17153,7 +17159,7 @@ var MIGRATIONS = [
|
|
|
17153
17159
|
{
|
|
17154
17160
|
version: 82,
|
|
17155
17161
|
name: "skill-invocations-harness",
|
|
17156
|
-
up:
|
|
17162
|
+
up: up84,
|
|
17157
17163
|
artifacts: {
|
|
17158
17164
|
columns: [
|
|
17159
17165
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -17164,7 +17170,7 @@ var MIGRATIONS = [
|
|
|
17164
17170
|
{
|
|
17165
17171
|
version: 83,
|
|
17166
17172
|
name: "memory-lifecycle-repair",
|
|
17167
|
-
up:
|
|
17173
|
+
up: up85,
|
|
17168
17174
|
artifacts: {
|
|
17169
17175
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
17170
17176
|
columns: [
|
|
@@ -17179,7 +17185,7 @@ var MIGRATIONS = [
|
|
|
17179
17185
|
{
|
|
17180
17186
|
version: 84,
|
|
17181
17187
|
name: "legacy-markdown-import-state",
|
|
17182
|
-
up:
|
|
17188
|
+
up: up86,
|
|
17183
17189
|
artifacts: {
|
|
17184
17190
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
17185
17191
|
}
|
|
@@ -17187,7 +17193,7 @@ var MIGRATIONS = [
|
|
|
17187
17193
|
{
|
|
17188
17194
|
version: 85,
|
|
17189
17195
|
name: "backfill-relations-to-dependencies",
|
|
17190
|
-
up:
|
|
17196
|
+
up: up87,
|
|
17191
17197
|
artifacts: {
|
|
17192
17198
|
tables: ["entity_dependencies"]
|
|
17193
17199
|
}
|
|
@@ -17195,7 +17201,7 @@ var MIGRATIONS = [
|
|
|
17195
17201
|
{
|
|
17196
17202
|
version: 86,
|
|
17197
17203
|
name: "summary-jobs-content-hash",
|
|
17198
|
-
up:
|
|
17204
|
+
up: up88,
|
|
17199
17205
|
artifacts: {
|
|
17200
17206
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
17201
17207
|
}
|
|
@@ -17203,7 +17209,7 @@ var MIGRATIONS = [
|
|
|
17203
17209
|
{
|
|
17204
17210
|
version: 87,
|
|
17205
17211
|
name: "summary-jobs-boundary-reason",
|
|
17206
|
-
up:
|
|
17212
|
+
up: up89,
|
|
17207
17213
|
artifacts: {
|
|
17208
17214
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
17209
17215
|
}
|
|
@@ -17211,7 +17217,7 @@ var MIGRATIONS = [
|
|
|
17211
17217
|
{
|
|
17212
17218
|
version: 88,
|
|
17213
17219
|
name: "transcript-recovery-files",
|
|
17214
|
-
up:
|
|
17220
|
+
up: up90,
|
|
17215
17221
|
artifacts: {
|
|
17216
17222
|
tables: ["transcript_recovery_files"]
|
|
17217
17223
|
}
|
|
@@ -17219,7 +17225,7 @@ var MIGRATIONS = [
|
|
|
17219
17225
|
{
|
|
17220
17226
|
version: 89,
|
|
17221
17227
|
name: "job-cancellations",
|
|
17222
|
-
up:
|
|
17228
|
+
up: up91,
|
|
17223
17229
|
artifacts: {
|
|
17224
17230
|
tables: ["job_cancellations"]
|
|
17225
17231
|
}
|
|
@@ -17227,7 +17233,7 @@ var MIGRATIONS = [
|
|
|
17227
17233
|
{
|
|
17228
17234
|
version: 90,
|
|
17229
17235
|
name: "job-archive",
|
|
17230
|
-
up:
|
|
17236
|
+
up: up92,
|
|
17231
17237
|
artifacts: {
|
|
17232
17238
|
tables: ["job_archive"]
|
|
17233
17239
|
}
|
|
@@ -17235,25 +17241,25 @@ var MIGRATIONS = [
|
|
|
17235
17241
|
{
|
|
17236
17242
|
version: 91,
|
|
17237
17243
|
name: "embedding-index-generations",
|
|
17238
|
-
up:
|
|
17244
|
+
up: up93,
|
|
17239
17245
|
artifacts: { tables: ["embedding_index_state"] }
|
|
17240
17246
|
},
|
|
17241
17247
|
{
|
|
17242
17248
|
version: 92,
|
|
17243
17249
|
name: "embedding-staging-store",
|
|
17244
|
-
up:
|
|
17250
|
+
up: up94,
|
|
17245
17251
|
artifacts: { tables: ["embeddings_staging"] }
|
|
17246
17252
|
},
|
|
17247
17253
|
{
|
|
17248
17254
|
version: 93,
|
|
17249
17255
|
name: "dreaming-evidence-cursor",
|
|
17250
|
-
up:
|
|
17256
|
+
up: up95,
|
|
17251
17257
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
17252
17258
|
},
|
|
17253
17259
|
{
|
|
17254
17260
|
version: 94,
|
|
17255
17261
|
name: "memory-kind",
|
|
17256
|
-
up:
|
|
17262
|
+
up: up96,
|
|
17257
17263
|
artifacts: {
|
|
17258
17264
|
columns: [
|
|
17259
17265
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -17264,35 +17270,35 @@ var MIGRATIONS = [
|
|
|
17264
17270
|
{
|
|
17265
17271
|
version: 95,
|
|
17266
17272
|
name: "compaction-recall-projections",
|
|
17267
|
-
up:
|
|
17273
|
+
up: up97
|
|
17268
17274
|
},
|
|
17269
17275
|
{
|
|
17270
17276
|
version: 96,
|
|
17271
17277
|
name: "retire-legacy-ingestion",
|
|
17272
|
-
up:
|
|
17278
|
+
up: up98
|
|
17273
17279
|
},
|
|
17274
17280
|
{
|
|
17275
17281
|
version: 97,
|
|
17276
17282
|
name: "dreaming-failure-backoff",
|
|
17277
|
-
up:
|
|
17283
|
+
up: up99,
|
|
17278
17284
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
17279
17285
|
},
|
|
17280
17286
|
{
|
|
17281
17287
|
version: 98,
|
|
17282
17288
|
name: "dreaming-evidence-exclusions",
|
|
17283
|
-
up:
|
|
17289
|
+
up: up100,
|
|
17284
17290
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
17285
17291
|
},
|
|
17286
17292
|
{
|
|
17287
17293
|
version: 99,
|
|
17288
17294
|
name: "dreaming-tool-calls",
|
|
17289
|
-
up:
|
|
17295
|
+
up: up101,
|
|
17290
17296
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
17291
17297
|
},
|
|
17292
17298
|
{
|
|
17293
17299
|
version: 100,
|
|
17294
17300
|
name: "dreaming-runbook",
|
|
17295
|
-
up:
|
|
17301
|
+
up: up102,
|
|
17296
17302
|
artifacts: {
|
|
17297
17303
|
columns: [
|
|
17298
17304
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -17303,23 +17309,23 @@ var MIGRATIONS = [
|
|
|
17303
17309
|
{
|
|
17304
17310
|
version: 101,
|
|
17305
17311
|
name: "dreaming-attention",
|
|
17306
|
-
up:
|
|
17312
|
+
up: up103,
|
|
17307
17313
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17308
17314
|
},
|
|
17309
17315
|
{
|
|
17310
17316
|
version: 102,
|
|
17311
17317
|
name: "attribute-semantic-memories",
|
|
17312
|
-
up:
|
|
17318
|
+
up: up104
|
|
17313
17319
|
},
|
|
17314
17320
|
{
|
|
17315
17321
|
version: 103,
|
|
17316
17322
|
name: "semantic-memory-kind",
|
|
17317
|
-
up:
|
|
17323
|
+
up: up105
|
|
17318
17324
|
},
|
|
17319
17325
|
{
|
|
17320
17326
|
version: 104,
|
|
17321
17327
|
name: "derived-memory-provenance",
|
|
17322
|
-
up:
|
|
17328
|
+
up: up106,
|
|
17323
17329
|
artifacts: {
|
|
17324
17330
|
tables: ["derived_memory_sources"],
|
|
17325
17331
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -17328,12 +17334,12 @@ var MIGRATIONS = [
|
|
|
17328
17334
|
{
|
|
17329
17335
|
version: 105,
|
|
17330
17336
|
name: "agent-scoped-entity-name",
|
|
17331
|
-
up:
|
|
17337
|
+
up: up107
|
|
17332
17338
|
},
|
|
17333
17339
|
{
|
|
17334
17340
|
version: 106,
|
|
17335
17341
|
name: "memory-review-after",
|
|
17336
|
-
up:
|
|
17342
|
+
up: up108,
|
|
17337
17343
|
artifacts: {
|
|
17338
17344
|
columns: [{ table: "memories", column: "review_after" }]
|
|
17339
17345
|
}
|
|
@@ -17341,7 +17347,7 @@ var MIGRATIONS = [
|
|
|
17341
17347
|
{
|
|
17342
17348
|
version: 107,
|
|
17343
17349
|
name: "dreaming-pass-usage",
|
|
17344
|
-
up:
|
|
17350
|
+
up: up109,
|
|
17345
17351
|
artifacts: {
|
|
17346
17352
|
columns: [
|
|
17347
17353
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -17355,7 +17361,7 @@ var MIGRATIONS = [
|
|
|
17355
17361
|
{
|
|
17356
17362
|
version: 108,
|
|
17357
17363
|
name: "embedding-usage",
|
|
17358
|
-
up:
|
|
17364
|
+
up: up110,
|
|
17359
17365
|
artifacts: {
|
|
17360
17366
|
tables: ["embedding_usage"]
|
|
17361
17367
|
}
|
|
@@ -17363,7 +17369,7 @@ var MIGRATIONS = [
|
|
|
17363
17369
|
{
|
|
17364
17370
|
version: 109,
|
|
17365
17371
|
name: "telemetry-install",
|
|
17366
|
-
up:
|
|
17372
|
+
up: up111,
|
|
17367
17373
|
artifacts: {
|
|
17368
17374
|
tables: ["telemetry_install"]
|
|
17369
17375
|
}
|
|
@@ -17371,12 +17377,12 @@ var MIGRATIONS = [
|
|
|
17371
17377
|
{
|
|
17372
17378
|
version: 110,
|
|
17373
17379
|
name: "memory-mention-join-index",
|
|
17374
|
-
up:
|
|
17380
|
+
up: up112
|
|
17375
17381
|
},
|
|
17376
17382
|
{
|
|
17377
17383
|
version: 111,
|
|
17378
17384
|
name: "telemetry-first-use",
|
|
17379
|
-
up:
|
|
17385
|
+
up: up113,
|
|
17380
17386
|
artifacts: {
|
|
17381
17387
|
columns: [
|
|
17382
17388
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -17387,7 +17393,7 @@ var MIGRATIONS = [
|
|
|
17387
17393
|
{
|
|
17388
17394
|
version: 112,
|
|
17389
17395
|
name: "telemetry-queue-ownership",
|
|
17390
|
-
up:
|
|
17396
|
+
up: up114,
|
|
17391
17397
|
artifacts: {
|
|
17392
17398
|
columns: [
|
|
17393
17399
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -17399,7 +17405,7 @@ var MIGRATIONS = [
|
|
|
17399
17405
|
{
|
|
17400
17406
|
version: 113,
|
|
17401
17407
|
name: "session-claims",
|
|
17402
|
-
up:
|
|
17408
|
+
up: up115,
|
|
17403
17409
|
artifacts: {
|
|
17404
17410
|
tables: ["session_claims"],
|
|
17405
17411
|
columns: [
|
|
@@ -17413,12 +17419,12 @@ var MIGRATIONS = [
|
|
|
17413
17419
|
{
|
|
17414
17420
|
version: 114,
|
|
17415
17421
|
name: "memory-traversal-hydration-index",
|
|
17416
|
-
up:
|
|
17422
|
+
up: up116
|
|
17417
17423
|
},
|
|
17418
17424
|
{
|
|
17419
17425
|
version: 115,
|
|
17420
17426
|
name: "cross-agent-message-notifications",
|
|
17421
|
-
up:
|
|
17427
|
+
up: up117,
|
|
17422
17428
|
artifacts: {
|
|
17423
17429
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
17424
17430
|
}
|
|
@@ -17426,7 +17432,7 @@ var MIGRATIONS = [
|
|
|
17426
17432
|
{
|
|
17427
17433
|
version: 116,
|
|
17428
17434
|
name: "acp-delivery-reconciliation",
|
|
17429
|
-
up:
|
|
17435
|
+
up: up118,
|
|
17430
17436
|
artifacts: {
|
|
17431
17437
|
columns: [
|
|
17432
17438
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -17440,7 +17446,7 @@ var MIGRATIONS = [
|
|
|
17440
17446
|
{
|
|
17441
17447
|
version: 117,
|
|
17442
17448
|
name: "retire-summary-worker",
|
|
17443
|
-
up:
|
|
17449
|
+
up: up119,
|
|
17444
17450
|
artifacts: {
|
|
17445
17451
|
columns: [
|
|
17446
17452
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -17451,24 +17457,24 @@ var MIGRATIONS = [
|
|
|
17451
17457
|
{
|
|
17452
17458
|
version: 118,
|
|
17453
17459
|
name: "queue-pressure-indices",
|
|
17454
|
-
up:
|
|
17460
|
+
up: up120
|
|
17455
17461
|
},
|
|
17456
17462
|
{
|
|
17457
17463
|
version: 119,
|
|
17458
17464
|
name: "telemetry-version-observation",
|
|
17459
|
-
up:
|
|
17465
|
+
up: up121,
|
|
17460
17466
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
17461
17467
|
},
|
|
17462
17468
|
{
|
|
17463
17469
|
version: 120,
|
|
17464
17470
|
name: "source-lifecycle-telemetry",
|
|
17465
|
-
up:
|
|
17471
|
+
up: up122,
|
|
17466
17472
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
17467
17473
|
},
|
|
17468
17474
|
{
|
|
17469
17475
|
version: 121,
|
|
17470
17476
|
name: "telemetry-delivery-health",
|
|
17471
|
-
up:
|
|
17477
|
+
up: up123,
|
|
17472
17478
|
artifacts: {
|
|
17473
17479
|
tables: ["telemetry_delivery_state"],
|
|
17474
17480
|
columns: [
|
|
@@ -17482,7 +17488,7 @@ var MIGRATIONS = [
|
|
|
17482
17488
|
{
|
|
17483
17489
|
version: 122,
|
|
17484
17490
|
name: "dreaming-evidence-retry",
|
|
17485
|
-
up:
|
|
17491
|
+
up: up124,
|
|
17486
17492
|
artifacts: {
|
|
17487
17493
|
columns: [
|
|
17488
17494
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -17495,13 +17501,13 @@ var MIGRATIONS = [
|
|
|
17495
17501
|
{
|
|
17496
17502
|
version: 123,
|
|
17497
17503
|
name: "embedding-index-failures",
|
|
17498
|
-
up:
|
|
17504
|
+
up: up125,
|
|
17499
17505
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
17500
17506
|
},
|
|
17501
17507
|
{
|
|
17502
17508
|
version: 124,
|
|
17503
17509
|
name: "import-derived-lifecycle",
|
|
17504
|
-
up:
|
|
17510
|
+
up: up126,
|
|
17505
17511
|
artifacts: {
|
|
17506
17512
|
tables: ["imported_source_lifecycle"]
|
|
17507
17513
|
}
|
|
@@ -17509,77 +17515,77 @@ var MIGRATIONS = [
|
|
|
17509
17515
|
{
|
|
17510
17516
|
version: 125,
|
|
17511
17517
|
name: "memory-content-safety",
|
|
17512
|
-
up:
|
|
17518
|
+
up: up127,
|
|
17513
17519
|
artifacts: { tables: ["memory_content_safety"] }
|
|
17514
17520
|
},
|
|
17515
17521
|
{
|
|
17516
17522
|
version: 126,
|
|
17517
17523
|
name: "dreaming-surprisal-attention",
|
|
17518
|
-
up:
|
|
17524
|
+
up: up128,
|
|
17519
17525
|
artifacts: { tables: ["dreaming_attention"] }
|
|
17520
17526
|
},
|
|
17521
17527
|
{
|
|
17522
17528
|
version: 127,
|
|
17523
17529
|
name: "ontology-contradictions",
|
|
17524
|
-
up:
|
|
17530
|
+
up: up129,
|
|
17525
17531
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
17526
17532
|
},
|
|
17527
17533
|
{
|
|
17528
17534
|
version: 128,
|
|
17529
17535
|
name: "bounded-queue-diagnostics",
|
|
17530
|
-
up:
|
|
17536
|
+
up: up130
|
|
17531
17537
|
},
|
|
17532
17538
|
{
|
|
17533
17539
|
version: 129,
|
|
17534
17540
|
name: "retire-structural-jobs",
|
|
17535
|
-
up:
|
|
17541
|
+
up: up131
|
|
17536
17542
|
},
|
|
17537
17543
|
{
|
|
17538
17544
|
version: 130,
|
|
17539
17545
|
name: "embedding-repair-state",
|
|
17540
|
-
up:
|
|
17546
|
+
up: up132,
|
|
17541
17547
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
17542
17548
|
},
|
|
17543
17549
|
{
|
|
17544
17550
|
version: 131,
|
|
17545
17551
|
name: "dreaming-evidence-consumption",
|
|
17546
|
-
up:
|
|
17552
|
+
up: up133,
|
|
17547
17553
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
17548
17554
|
},
|
|
17549
17555
|
{
|
|
17550
17556
|
version: 132,
|
|
17551
17557
|
name: "observer-scoped-epistemic-assertions",
|
|
17552
|
-
up:
|
|
17558
|
+
up: up134,
|
|
17553
17559
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
17554
17560
|
},
|
|
17555
17561
|
{
|
|
17556
17562
|
version: 133,
|
|
17557
17563
|
name: "dreaming-memory-head",
|
|
17558
|
-
up:
|
|
17564
|
+
up: up135,
|
|
17559
17565
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
17560
17566
|
},
|
|
17561
17567
|
{
|
|
17562
17568
|
version: 134,
|
|
17563
17569
|
name: "scope-memory-head-entries",
|
|
17564
|
-
up:
|
|
17570
|
+
up: up136,
|
|
17565
17571
|
artifacts: { tables: ["memory_head_entries"] }
|
|
17566
17572
|
},
|
|
17567
17573
|
{
|
|
17568
17574
|
version: 135,
|
|
17569
17575
|
name: "memory-head-publication",
|
|
17570
|
-
up:
|
|
17576
|
+
up: up137,
|
|
17571
17577
|
artifacts: { tables: ["memory_head_publications"] }
|
|
17572
17578
|
},
|
|
17573
17579
|
{
|
|
17574
17580
|
version: 136,
|
|
17575
17581
|
name: "memory-head-revisions",
|
|
17576
|
-
up:
|
|
17582
|
+
up: up138,
|
|
17577
17583
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
17578
17584
|
},
|
|
17579
17585
|
{
|
|
17580
17586
|
version: 137,
|
|
17581
17587
|
name: "dreaming-head-manifest",
|
|
17582
|
-
up:
|
|
17588
|
+
up: up139,
|
|
17583
17589
|
artifacts: {
|
|
17584
17590
|
columns: [
|
|
17585
17591
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -17590,7 +17596,7 @@ var MIGRATIONS = [
|
|
|
17590
17596
|
{
|
|
17591
17597
|
version: 138,
|
|
17592
17598
|
name: "bounded-status-projections",
|
|
17593
|
-
up:
|
|
17599
|
+
up: up140,
|
|
17594
17600
|
artifacts: {
|
|
17595
17601
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
17596
17602
|
}
|
|
@@ -17598,31 +17604,31 @@ var MIGRATIONS = [
|
|
|
17598
17604
|
{
|
|
17599
17605
|
version: 139,
|
|
17600
17606
|
name: "native-source-sync-state",
|
|
17601
|
-
up:
|
|
17607
|
+
up: up141,
|
|
17602
17608
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
17603
17609
|
},
|
|
17604
17610
|
{
|
|
17605
17611
|
version: 140,
|
|
17606
17612
|
name: "transcript-recovery-frontier",
|
|
17607
|
-
up:
|
|
17613
|
+
up: up142,
|
|
17608
17614
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
17609
17615
|
},
|
|
17610
17616
|
{
|
|
17611
17617
|
version: 141,
|
|
17612
17618
|
name: "source-sync-checkpoints",
|
|
17613
|
-
up:
|
|
17619
|
+
up: up143,
|
|
17614
17620
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
17615
17621
|
},
|
|
17616
17622
|
{
|
|
17617
17623
|
version: 142,
|
|
17618
17624
|
name: "source-sync-frontier",
|
|
17619
|
-
up:
|
|
17625
|
+
up: up144,
|
|
17620
17626
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
17621
17627
|
},
|
|
17622
17628
|
{
|
|
17623
17629
|
version: 143,
|
|
17624
17630
|
name: "embedding-index-progress",
|
|
17625
|
-
up:
|
|
17631
|
+
up: up145,
|
|
17626
17632
|
artifacts: {
|
|
17627
17633
|
columns: [
|
|
17628
17634
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -17638,19 +17644,19 @@ var MIGRATIONS = [
|
|
|
17638
17644
|
{
|
|
17639
17645
|
version: 144,
|
|
17640
17646
|
name: "memory-job-lease-token",
|
|
17641
|
-
up:
|
|
17647
|
+
up: up146,
|
|
17642
17648
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
17643
17649
|
},
|
|
17644
17650
|
{
|
|
17645
17651
|
version: 145,
|
|
17646
17652
|
name: "dreaming-evidence-reviews",
|
|
17647
|
-
up:
|
|
17653
|
+
up: up147,
|
|
17648
17654
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
17649
17655
|
},
|
|
17650
17656
|
{
|
|
17651
17657
|
version: 146,
|
|
17652
17658
|
name: "source-transcript-import",
|
|
17653
|
-
up:
|
|
17659
|
+
up: up148,
|
|
17654
17660
|
artifacts: {
|
|
17655
17661
|
tables: [
|
|
17656
17662
|
"source_import_jobs",
|
|
@@ -17669,19 +17675,19 @@ var MIGRATIONS = [
|
|
|
17669
17675
|
{
|
|
17670
17676
|
version: 147,
|
|
17671
17677
|
name: "source-import-replay-file-slots",
|
|
17672
|
-
up:
|
|
17678
|
+
up: up149,
|
|
17673
17679
|
artifacts: { tables: ["source_import_files"] }
|
|
17674
17680
|
},
|
|
17675
17681
|
{
|
|
17676
17682
|
version: 148,
|
|
17677
17683
|
name: "source-import-attempt-provenance",
|
|
17678
|
-
up:
|
|
17684
|
+
up: up150,
|
|
17679
17685
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
17680
17686
|
},
|
|
17681
17687
|
{
|
|
17682
17688
|
version: 149,
|
|
17683
17689
|
name: "transcript-import-state-machine",
|
|
17684
|
-
up:
|
|
17690
|
+
up: up151,
|
|
17685
17691
|
artifacts: {
|
|
17686
17692
|
columns: [
|
|
17687
17693
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -17693,7 +17699,7 @@ var MIGRATIONS = [
|
|
|
17693
17699
|
{
|
|
17694
17700
|
version: 150,
|
|
17695
17701
|
name: "memory-head-freshness",
|
|
17696
|
-
up:
|
|
17702
|
+
up: up152,
|
|
17697
17703
|
artifacts: {
|
|
17698
17704
|
columns: [
|
|
17699
17705
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -17729,6 +17735,12 @@ var MIGRATIONS = [
|
|
|
17729
17735
|
}))
|
|
17730
17736
|
]
|
|
17731
17737
|
}
|
|
17738
|
+
},
|
|
17739
|
+
{
|
|
17740
|
+
version: 152,
|
|
17741
|
+
name: "memory-artifact-sha-index",
|
|
17742
|
+
up: up2,
|
|
17743
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
17732
17744
|
}
|
|
17733
17745
|
];
|
|
17734
17746
|
var LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -31494,7 +31506,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
|
|
|
31494
31506
|
"checkpoint",
|
|
31495
31507
|
"dreaming"
|
|
31496
31508
|
];
|
|
31497
|
-
function
|
|
31509
|
+
function up153(db) {
|
|
31498
31510
|
const hasColumn26 = (table, column) => {
|
|
31499
31511
|
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
31500
31512
|
try {
|
|
@@ -31554,6 +31566,12 @@ function up152(db) {
|
|
|
31554
31566
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
31555
31567
|
`);
|
|
31556
31568
|
}
|
|
31569
|
+
function up210(db) {
|
|
31570
|
+
db.exec(`
|
|
31571
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
31572
|
+
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)
|
|
31573
|
+
`);
|
|
31574
|
+
}
|
|
31557
31575
|
var MEMORIES_FTS_TOKENIZER2 = "unicode61";
|
|
31558
31576
|
var FTS_STATE_TABLE2 = "memories_fts_state";
|
|
31559
31577
|
function normalizeSql2(sql) {
|
|
@@ -31669,7 +31687,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
31669
31687
|
return true;
|
|
31670
31688
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
31671
31689
|
}
|
|
31672
|
-
function
|
|
31690
|
+
function up310(db) {
|
|
31673
31691
|
db.exec(`
|
|
31674
31692
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
31675
31693
|
version INTEGER PRIMARY KEY,
|
|
@@ -31767,7 +31785,7 @@ function addColumnIfMissing29(db, table, column, definition) {
|
|
|
31767
31785
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31768
31786
|
}
|
|
31769
31787
|
}
|
|
31770
|
-
function
|
|
31788
|
+
function up410(db) {
|
|
31771
31789
|
addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
|
|
31772
31790
|
addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
|
|
31773
31791
|
addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -31885,7 +31903,7 @@ function addColumnIfMissing210(db, table, column, definition) {
|
|
|
31885
31903
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31886
31904
|
return true;
|
|
31887
31905
|
}
|
|
31888
|
-
function
|
|
31906
|
+
function up510(db) {
|
|
31889
31907
|
addColumnIfMissing210(db, "memories", "why", "TEXT");
|
|
31890
31908
|
addColumnIfMissing210(db, "memories", "project", "TEXT");
|
|
31891
31909
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -31922,7 +31940,7 @@ function addColumnIfMissing32(db, table, column, definition) {
|
|
|
31922
31940
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31923
31941
|
}
|
|
31924
31942
|
}
|
|
31925
|
-
function
|
|
31943
|
+
function up610(db) {
|
|
31926
31944
|
addColumnIfMissing32(db, "memory_history", "actor_type", "TEXT");
|
|
31927
31945
|
addColumnIfMissing32(db, "memory_history", "session_id", "TEXT");
|
|
31928
31946
|
addColumnIfMissing32(db, "memory_history", "request_id", "TEXT");
|
|
@@ -31955,7 +31973,7 @@ function addColumnIfMissing42(db, table, column, definition) {
|
|
|
31955
31973
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31956
31974
|
}
|
|
31957
31975
|
}
|
|
31958
|
-
function
|
|
31976
|
+
function up710(db) {
|
|
31959
31977
|
addColumnIfMissing42(db, "entities", "canonical_name", "TEXT");
|
|
31960
31978
|
addColumnIfMissing42(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
31961
31979
|
addColumnIfMissing42(db, "entities", "embedding", "BLOB");
|
|
@@ -31972,7 +31990,7 @@ function hasColumn42(db, table, column) {
|
|
|
31972
31990
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
31973
31991
|
return rows.some((r3) => r3.name === column);
|
|
31974
31992
|
}
|
|
31975
|
-
function
|
|
31993
|
+
function up810(db) {
|
|
31976
31994
|
if (!hasColumn42(db, "memories", "idempotency_key")) {
|
|
31977
31995
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
31978
31996
|
}
|
|
@@ -31987,7 +32005,7 @@ function hasColumn52(db, table, column) {
|
|
|
31987
32005
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
31988
32006
|
return rows.some((r3) => r3.name === column);
|
|
31989
32007
|
}
|
|
31990
|
-
function
|
|
32008
|
+
function up910(db) {
|
|
31991
32009
|
db.exec(`
|
|
31992
32010
|
CREATE TABLE IF NOT EXISTS documents (
|
|
31993
32011
|
id TEXT PRIMARY KEY,
|
|
@@ -32044,7 +32062,7 @@ function up810(db) {
|
|
|
32044
32062
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
32045
32063
|
}
|
|
32046
32064
|
}
|
|
32047
|
-
function
|
|
32065
|
+
function up1010(db) {
|
|
32048
32066
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
32049
32067
|
if (tables.length === 0)
|
|
32050
32068
|
return;
|
|
@@ -32061,7 +32079,7 @@ function up910(db) {
|
|
|
32061
32079
|
ON embeddings(content_hash)
|
|
32062
32080
|
`);
|
|
32063
32081
|
}
|
|
32064
|
-
function
|
|
32082
|
+
function up1110(db) {
|
|
32065
32083
|
db.exec(`
|
|
32066
32084
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
32067
32085
|
id TEXT PRIMARY KEY,
|
|
@@ -32081,7 +32099,7 @@ function up1010(db) {
|
|
|
32081
32099
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
32082
32100
|
ON summary_jobs(status)`);
|
|
32083
32101
|
}
|
|
32084
|
-
function
|
|
32102
|
+
function up1210(db) {
|
|
32085
32103
|
db.exec(`
|
|
32086
32104
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
32087
32105
|
id INTEGER PRIMARY KEY,
|
|
@@ -32092,7 +32110,7 @@ function up1110(db) {
|
|
|
32092
32110
|
)
|
|
32093
32111
|
`);
|
|
32094
32112
|
}
|
|
32095
|
-
function
|
|
32113
|
+
function up1310(db) {
|
|
32096
32114
|
db.exec(`
|
|
32097
32115
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
32098
32116
|
id TEXT PRIMARY KEY,
|
|
@@ -32112,7 +32130,7 @@ function up1210(db) {
|
|
|
32112
32130
|
ON session_scores(session_key);
|
|
32113
32131
|
`);
|
|
32114
32132
|
}
|
|
32115
|
-
function
|
|
32133
|
+
function up1410(db) {
|
|
32116
32134
|
db.exec(`
|
|
32117
32135
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
32118
32136
|
id TEXT PRIMARY KEY,
|
|
@@ -32153,7 +32171,7 @@ function addColumnIfMissing52(db, table, column, definition) {
|
|
|
32153
32171
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32154
32172
|
}
|
|
32155
32173
|
}
|
|
32156
|
-
function
|
|
32174
|
+
function up154(db) {
|
|
32157
32175
|
db.exec(`
|
|
32158
32176
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
32159
32177
|
id TEXT PRIMARY KEY,
|
|
@@ -32179,7 +32197,7 @@ function up1410(db) {
|
|
|
32179
32197
|
addColumnIfMissing52(db, "memories", "source_path", "TEXT");
|
|
32180
32198
|
addColumnIfMissing52(db, "memories", "source_section", "TEXT");
|
|
32181
32199
|
}
|
|
32182
|
-
function
|
|
32200
|
+
function up162(db) {
|
|
32183
32201
|
db.exec(`
|
|
32184
32202
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
32185
32203
|
id TEXT PRIMARY KEY,
|
|
@@ -32204,7 +32222,7 @@ function addColumnIfMissing62(db, table, column, definition) {
|
|
|
32204
32222
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32205
32223
|
}
|
|
32206
32224
|
}
|
|
32207
|
-
function
|
|
32225
|
+
function up172(db) {
|
|
32208
32226
|
db.exec(`
|
|
32209
32227
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
32210
32228
|
id TEXT PRIMARY KEY,
|
|
@@ -32231,7 +32249,7 @@ function up162(db) {
|
|
|
32231
32249
|
addColumnIfMissing62(db, "session_scores", "confidence", "REAL");
|
|
32232
32250
|
addColumnIfMissing62(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
32233
32251
|
}
|
|
32234
|
-
function
|
|
32252
|
+
function up182(db) {
|
|
32235
32253
|
db.exec(`
|
|
32236
32254
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
32237
32255
|
id TEXT PRIMARY KEY,
|
|
@@ -32253,7 +32271,7 @@ function up172(db) {
|
|
|
32253
32271
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
32254
32272
|
`);
|
|
32255
32273
|
}
|
|
32256
|
-
function
|
|
32274
|
+
function up192(db) {
|
|
32257
32275
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
32258
32276
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
32259
32277
|
if (!colNames.has("skill_name")) {
|
|
@@ -32264,7 +32282,7 @@ function up182(db) {
|
|
|
32264
32282
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
32265
32283
|
}
|
|
32266
32284
|
}
|
|
32267
|
-
function
|
|
32285
|
+
function up202(db) {
|
|
32268
32286
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
32269
32287
|
if (existing)
|
|
32270
32288
|
return;
|
|
@@ -32296,7 +32314,7 @@ function up192(db) {
|
|
|
32296
32314
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
32297
32315
|
`);
|
|
32298
32316
|
}
|
|
32299
|
-
function
|
|
32317
|
+
function up212(db) {
|
|
32300
32318
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
32301
32319
|
const entityColNames = new Set(entityCols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
32302
32320
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -32381,13 +32399,13 @@ function addColumnIfMissing72(db, table, column, definition) {
|
|
|
32381
32399
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32382
32400
|
}
|
|
32383
32401
|
}
|
|
32384
|
-
function
|
|
32402
|
+
function up222(db) {
|
|
32385
32403
|
addColumnIfMissing72(db, "session_memories", "entity_slot", "INTEGER");
|
|
32386
32404
|
addColumnIfMissing72(db, "session_memories", "aspect_slot", "INTEGER");
|
|
32387
32405
|
addColumnIfMissing72(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
32388
32406
|
addColumnIfMissing72(db, "session_memories", "structural_density", "INTEGER");
|
|
32389
32407
|
}
|
|
32390
|
-
function
|
|
32408
|
+
function up232(db) {
|
|
32391
32409
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
32392
32410
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
32393
32411
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -32412,25 +32430,25 @@ function addColumnIfMissing82(db, table, column, definition) {
|
|
|
32412
32430
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32413
32431
|
}
|
|
32414
32432
|
}
|
|
32415
|
-
function
|
|
32433
|
+
function up242(db) {
|
|
32416
32434
|
addColumnIfMissing82(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
32417
32435
|
addColumnIfMissing82(db, "entities", "pinned_at", "TEXT");
|
|
32418
32436
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
32419
32437
|
}
|
|
32420
|
-
function up242(_db) {}
|
|
32421
32438
|
function up252(_db) {}
|
|
32439
|
+
function up262(_db) {}
|
|
32422
32440
|
function addColumnIfMissing92(db, table, column, definition) {
|
|
32423
32441
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32424
32442
|
if (!cols.some((c3) => c3.name === column)) {
|
|
32425
32443
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32426
32444
|
}
|
|
32427
32445
|
}
|
|
32428
|
-
function
|
|
32446
|
+
function up272(db) {
|
|
32429
32447
|
addColumnIfMissing92(db, "session_memories", "agent_relevance_score", "REAL");
|
|
32430
32448
|
addColumnIfMissing92(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
32431
32449
|
}
|
|
32432
|
-
function
|
|
32433
|
-
function
|
|
32450
|
+
function up282(_db) {}
|
|
32451
|
+
function up292(db) {
|
|
32434
32452
|
db.exec(`
|
|
32435
32453
|
UPDATE entities
|
|
32436
32454
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -32439,7 +32457,7 @@ function up282(db) {
|
|
|
32439
32457
|
WHERE canonical_name IS NULL
|
|
32440
32458
|
`);
|
|
32441
32459
|
}
|
|
32442
|
-
function
|
|
32460
|
+
function up302(db) {
|
|
32443
32461
|
db.exec(`
|
|
32444
32462
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
32445
32463
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -32476,7 +32494,7 @@ function up292(db) {
|
|
|
32476
32494
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
32477
32495
|
`);
|
|
32478
32496
|
}
|
|
32479
|
-
function
|
|
32497
|
+
function up312(db) {
|
|
32480
32498
|
db.exec(`
|
|
32481
32499
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
32482
32500
|
id TEXT PRIMARY KEY,
|
|
@@ -32521,7 +32539,7 @@ function up302(db) {
|
|
|
32521
32539
|
WHERE session_key IS NOT NULL;
|
|
32522
32540
|
`);
|
|
32523
32541
|
}
|
|
32524
|
-
function
|
|
32542
|
+
function up322(db) {
|
|
32525
32543
|
db.exec(`
|
|
32526
32544
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
32527
32545
|
id TEXT PRIMARY KEY,
|
|
@@ -32566,7 +32584,7 @@ function up312(db) {
|
|
|
32566
32584
|
ON memory_jobs(failed_at);
|
|
32567
32585
|
`);
|
|
32568
32586
|
}
|
|
32569
|
-
function
|
|
32587
|
+
function up332(db) {
|
|
32570
32588
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
32571
32589
|
if (!depCols.some((c3) => c3.name === "reason")) {
|
|
32572
32590
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -32576,7 +32594,7 @@ function up322(db) {
|
|
|
32576
32594
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
32577
32595
|
}
|
|
32578
32596
|
}
|
|
32579
|
-
function
|
|
32597
|
+
function up342(db) {
|
|
32580
32598
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
32581
32599
|
if (cols.length === 0)
|
|
32582
32600
|
return;
|
|
@@ -32584,14 +32602,14 @@ function up332(db) {
|
|
|
32584
32602
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
32585
32603
|
}
|
|
32586
32604
|
}
|
|
32587
|
-
function
|
|
32605
|
+
function up352(db) {
|
|
32588
32606
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
32589
32607
|
if (!cols.some((c3) => c3.name === "scope")) {
|
|
32590
32608
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
32591
32609
|
}
|
|
32592
32610
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
32593
32611
|
}
|
|
32594
|
-
function
|
|
32612
|
+
function up362(db) {
|
|
32595
32613
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
32596
32614
|
db.exec(`
|
|
32597
32615
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -32599,7 +32617,7 @@ function up352(db) {
|
|
|
32599
32617
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
32600
32618
|
`);
|
|
32601
32619
|
}
|
|
32602
|
-
function
|
|
32620
|
+
function up372(db) {
|
|
32603
32621
|
db.exec(`
|
|
32604
32622
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
32605
32623
|
name, canonical_name,
|
|
@@ -32631,13 +32649,13 @@ function up362(db) {
|
|
|
32631
32649
|
END
|
|
32632
32650
|
`);
|
|
32633
32651
|
}
|
|
32634
|
-
function
|
|
32652
|
+
function up382(db) {
|
|
32635
32653
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
32636
32654
|
if (!cols.some((c3) => c3.name === "confidence")) {
|
|
32637
32655
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
32638
32656
|
}
|
|
32639
32657
|
}
|
|
32640
|
-
function
|
|
32658
|
+
function up392(db) {
|
|
32641
32659
|
db.exec(`
|
|
32642
32660
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
32643
32661
|
id TEXT PRIMARY KEY,
|
|
@@ -32655,7 +32673,7 @@ function up382(db) {
|
|
|
32655
32673
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
32656
32674
|
}
|
|
32657
32675
|
}
|
|
32658
|
-
function
|
|
32676
|
+
function up402(db) {
|
|
32659
32677
|
db.exec(`
|
|
32660
32678
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
32661
32679
|
id TEXT PRIMARY KEY,
|
|
@@ -32695,7 +32713,7 @@ function up392(db) {
|
|
|
32695
32713
|
END
|
|
32696
32714
|
`);
|
|
32697
32715
|
}
|
|
32698
|
-
function
|
|
32716
|
+
function up412(db) {
|
|
32699
32717
|
db.exec(`
|
|
32700
32718
|
DELETE FROM entity_dependencies
|
|
32701
32719
|
WHERE id NOT IN (
|
|
@@ -32713,7 +32731,7 @@ function up402(db) {
|
|
|
32713
32731
|
)
|
|
32714
32732
|
`);
|
|
32715
32733
|
}
|
|
32716
|
-
function
|
|
32734
|
+
function up422(db) {
|
|
32717
32735
|
db.exec(`
|
|
32718
32736
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
32719
32737
|
session_key TEXT PRIMARY KEY,
|
|
@@ -32736,7 +32754,7 @@ function addColumnIfMissing102(db, table, column, definition) {
|
|
|
32736
32754
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32737
32755
|
}
|
|
32738
32756
|
}
|
|
32739
|
-
function
|
|
32757
|
+
function up432(db) {
|
|
32740
32758
|
addColumnIfMissing102(db, "session_memories", "path_json", "TEXT");
|
|
32741
32759
|
db.exec(`
|
|
32742
32760
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -32811,7 +32829,7 @@ function addColumnIfMissing112(db, table, column, definition) {
|
|
|
32811
32829
|
return;
|
|
32812
32830
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32813
32831
|
}
|
|
32814
|
-
function
|
|
32832
|
+
function up442(db) {
|
|
32815
32833
|
addColumnIfMissing112(db, "session_memories", "entity_slot", "INTEGER");
|
|
32816
32834
|
addColumnIfMissing112(db, "session_memories", "aspect_slot", "INTEGER");
|
|
32817
32835
|
addColumnIfMissing112(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -32899,7 +32917,7 @@ function addColumnIfMissing122(db, table, column, definition) {
|
|
|
32899
32917
|
return;
|
|
32900
32918
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32901
32919
|
}
|
|
32902
|
-
function
|
|
32920
|
+
function up452(db) {
|
|
32903
32921
|
db.exec(`
|
|
32904
32922
|
CREATE TABLE IF NOT EXISTS agents (
|
|
32905
32923
|
id TEXT PRIMARY KEY,
|
|
@@ -32928,7 +32946,7 @@ function addColumnIfMissing132(db, table, column, definition) {
|
|
|
32928
32946
|
return;
|
|
32929
32947
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32930
32948
|
}
|
|
32931
|
-
function
|
|
32949
|
+
function up462(db) {
|
|
32932
32950
|
addColumnIfMissing132(db, "session_summaries", "source_type", "TEXT");
|
|
32933
32951
|
addColumnIfMissing132(db, "session_summaries", "source_ref", "TEXT");
|
|
32934
32952
|
addColumnIfMissing132(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -32954,7 +32972,7 @@ function addColumnIfMissing142(db, table, column, definition) {
|
|
|
32954
32972
|
return;
|
|
32955
32973
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32956
32974
|
}
|
|
32957
|
-
function
|
|
32975
|
+
function up472(db) {
|
|
32958
32976
|
addColumnIfMissing142(db, "session_transcripts", "updated_at", "TEXT");
|
|
32959
32977
|
addColumnIfMissing142(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
32960
32978
|
addColumnIfMissing142(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -33025,7 +33043,7 @@ function up462(db) {
|
|
|
33025
33043
|
ON memory_md_heads(lease_expires_at);
|
|
33026
33044
|
`);
|
|
33027
33045
|
}
|
|
33028
|
-
function
|
|
33046
|
+
function up482(db) {
|
|
33029
33047
|
db.exec(`
|
|
33030
33048
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
33031
33049
|
|
|
@@ -33086,7 +33104,7 @@ function up472(db) {
|
|
|
33086
33104
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
33087
33105
|
`);
|
|
33088
33106
|
}
|
|
33089
|
-
function
|
|
33107
|
+
function up492(db) {
|
|
33090
33108
|
db.exec(`
|
|
33091
33109
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
33092
33110
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -33184,7 +33202,7 @@ function up482(db) {
|
|
|
33184
33202
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
33185
33203
|
`);
|
|
33186
33204
|
}
|
|
33187
|
-
function
|
|
33205
|
+
function up502(db) {
|
|
33188
33206
|
db.exec(`
|
|
33189
33207
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
33190
33208
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -33302,7 +33320,7 @@ function up492(db) {
|
|
|
33302
33320
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
33303
33321
|
`);
|
|
33304
33322
|
}
|
|
33305
|
-
function
|
|
33323
|
+
function up512(db) {
|
|
33306
33324
|
db.exec(`
|
|
33307
33325
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
33308
33326
|
session_key TEXT NOT NULL,
|
|
@@ -33319,7 +33337,7 @@ function hasTable5(db, name) {
|
|
|
33319
33337
|
WHERE type = 'table' AND name = ?
|
|
33320
33338
|
LIMIT 1`).get(name) !== undefined;
|
|
33321
33339
|
}
|
|
33322
|
-
function
|
|
33340
|
+
function up522(db) {
|
|
33323
33341
|
db.exec(`
|
|
33324
33342
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
33325
33343
|
id TEXT PRIMARY KEY,
|
|
@@ -33489,7 +33507,7 @@ function addColumnIfMissing152(db, table, column, definition) {
|
|
|
33489
33507
|
return;
|
|
33490
33508
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
33491
33509
|
}
|
|
33492
|
-
function
|
|
33510
|
+
function up532(db) {
|
|
33493
33511
|
addColumnIfMissing152(db, "summary_jobs", "session_id", "TEXT");
|
|
33494
33512
|
addColumnIfMissing152(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
33495
33513
|
addColumnIfMissing152(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -33581,7 +33599,7 @@ function up522(db) {
|
|
|
33581
33599
|
VALUES ('rebuild');
|
|
33582
33600
|
`);
|
|
33583
33601
|
}
|
|
33584
|
-
function
|
|
33602
|
+
function up542(db) {
|
|
33585
33603
|
db.exec(`
|
|
33586
33604
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
33587
33605
|
id TEXT PRIMARY KEY,
|
|
@@ -33598,7 +33616,7 @@ function up532(db) {
|
|
|
33598
33616
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
33599
33617
|
`);
|
|
33600
33618
|
}
|
|
33601
|
-
function
|
|
33619
|
+
function up552(db) {
|
|
33602
33620
|
db.exec(`
|
|
33603
33621
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
33604
33622
|
id TEXT PRIMARY KEY,
|
|
@@ -33614,7 +33632,7 @@ function up542(db) {
|
|
|
33614
33632
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
33615
33633
|
`);
|
|
33616
33634
|
}
|
|
33617
|
-
function
|
|
33635
|
+
function up562(db) {
|
|
33618
33636
|
db.exec(`
|
|
33619
33637
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
33620
33638
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -33645,7 +33663,7 @@ function up552(db) {
|
|
|
33645
33663
|
ON task_scope_hints(agent_id, updated_at);
|
|
33646
33664
|
`);
|
|
33647
33665
|
}
|
|
33648
|
-
function
|
|
33666
|
+
function up572(db) {
|
|
33649
33667
|
db.exec(`
|
|
33650
33668
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
33651
33669
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -33688,7 +33706,7 @@ function ensureMemoriesScopeColumns3(db) {
|
|
|
33688
33706
|
if (!names.has("scope"))
|
|
33689
33707
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
33690
33708
|
}
|
|
33691
|
-
function
|
|
33709
|
+
function up582(db) {
|
|
33692
33710
|
ensureMemoriesScopeColumns3(db);
|
|
33693
33711
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
33694
33712
|
db.exec(`
|
|
@@ -33701,20 +33719,20 @@ function up572(db) {
|
|
|
33701
33719
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
33702
33720
|
`);
|
|
33703
33721
|
}
|
|
33704
|
-
function
|
|
33722
|
+
function up592(db) {
|
|
33705
33723
|
const sql = readMemoriesFtsSql2(db);
|
|
33706
33724
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair2(sql))
|
|
33707
33725
|
return;
|
|
33708
33726
|
recreateMemoriesFts2(db);
|
|
33709
33727
|
}
|
|
33710
|
-
function
|
|
33728
|
+
function up602(db) {
|
|
33711
33729
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
33712
33730
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
33713
33731
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
33714
33732
|
ON entities(entity_type, mentions)
|
|
33715
33733
|
WHERE entity_type = 'extracted'`);
|
|
33716
33734
|
}
|
|
33717
|
-
function
|
|
33735
|
+
function up612(db) {
|
|
33718
33736
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
33719
33737
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
33720
33738
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -33723,7 +33741,7 @@ function up602(db) {
|
|
|
33723
33741
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
33724
33742
|
WHERE claim_key IS NOT NULL`);
|
|
33725
33743
|
}
|
|
33726
|
-
function
|
|
33744
|
+
function up622(db) {
|
|
33727
33745
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
33728
33746
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
33729
33747
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -33735,13 +33753,13 @@ function up612(db) {
|
|
|
33735
33753
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
33736
33754
|
WHERE claim_key IS NOT NULL`);
|
|
33737
33755
|
}
|
|
33738
|
-
function
|
|
33756
|
+
function up632(db) {
|
|
33739
33757
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
33740
33758
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
33741
33759
|
return;
|
|
33742
33760
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
33743
33761
|
}
|
|
33744
|
-
function
|
|
33762
|
+
function up642(db) {
|
|
33745
33763
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
33746
33764
|
const names = new Set(cols.map((col) => col.name));
|
|
33747
33765
|
if (!names.has("is_deleted")) {
|
|
@@ -33755,7 +33773,7 @@ function up632(db) {
|
|
|
33755
33773
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
33756
33774
|
`);
|
|
33757
33775
|
}
|
|
33758
|
-
function
|
|
33776
|
+
function up652(db) {
|
|
33759
33777
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
33760
33778
|
db.exec(`
|
|
33761
33779
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -33773,7 +33791,7 @@ function addColumnIfMissing162(db, table, column, definition) {
|
|
|
33773
33791
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
33774
33792
|
}
|
|
33775
33793
|
}
|
|
33776
|
-
function
|
|
33794
|
+
function up662(db) {
|
|
33777
33795
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
33778
33796
|
addColumnIfMissing162(db, table, "source_id", "TEXT");
|
|
33779
33797
|
addColumnIfMissing162(db, table, "source_kind", "TEXT");
|
|
@@ -33793,7 +33811,7 @@ function hasColumn72(db, table, column) {
|
|
|
33793
33811
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
33794
33812
|
return rows.some((row) => row.name === column);
|
|
33795
33813
|
}
|
|
33796
|
-
function
|
|
33814
|
+
function up672(db) {
|
|
33797
33815
|
if (!hasTable22(db, "embeddings"))
|
|
33798
33816
|
return;
|
|
33799
33817
|
if (!hasColumn72(db, "embeddings", "agent_id")) {
|
|
@@ -33801,7 +33819,7 @@ function up662(db) {
|
|
|
33801
33819
|
}
|
|
33802
33820
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
33803
33821
|
}
|
|
33804
|
-
function
|
|
33822
|
+
function up682(db) {
|
|
33805
33823
|
db.exec(`
|
|
33806
33824
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
33807
33825
|
id TEXT PRIMARY KEY,
|
|
@@ -33842,7 +33860,7 @@ function addColumnIfMissing172(db, table, column, definition) {
|
|
|
33842
33860
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
33843
33861
|
}
|
|
33844
33862
|
}
|
|
33845
|
-
function
|
|
33863
|
+
function up692(db) {
|
|
33846
33864
|
db.exec(`
|
|
33847
33865
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
33848
33866
|
id TEXT PRIMARY KEY,
|
|
@@ -33885,7 +33903,7 @@ function up682(db) {
|
|
|
33885
33903
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
33886
33904
|
}
|
|
33887
33905
|
}
|
|
33888
|
-
function
|
|
33906
|
+
function up702(db) {
|
|
33889
33907
|
db.exec(`
|
|
33890
33908
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
33891
33909
|
id TEXT PRIMARY KEY,
|
|
@@ -33912,7 +33930,7 @@ function up692(db) {
|
|
|
33912
33930
|
WHERE content_key IS NOT NULL;
|
|
33913
33931
|
`);
|
|
33914
33932
|
}
|
|
33915
|
-
function
|
|
33933
|
+
function up712(db) {
|
|
33916
33934
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
33917
33935
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
33918
33936
|
if (!colNames.has("content_key")) {
|
|
@@ -33949,7 +33967,7 @@ function backfillVersionRoots2(db) {
|
|
|
33949
33967
|
WHERE version_root_id IS NULL
|
|
33950
33968
|
`);
|
|
33951
33969
|
}
|
|
33952
|
-
function
|
|
33970
|
+
function up722(db) {
|
|
33953
33971
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
33954
33972
|
addColumnIfMissing182(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
33955
33973
|
addColumnIfMissing182(db, table, "archived_at", "TEXT");
|
|
@@ -33984,7 +34002,7 @@ function up712(db) {
|
|
|
33984
34002
|
ON entity_aspects(agent_id, proposal_id);
|
|
33985
34003
|
`);
|
|
33986
34004
|
}
|
|
33987
|
-
function
|
|
34005
|
+
function up732(db) {
|
|
33988
34006
|
db.exec(`
|
|
33989
34007
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
33990
34008
|
id TEXT PRIMARY KEY,
|
|
@@ -34040,7 +34058,7 @@ function ensureMemoriesScopeColumns22(db) {
|
|
|
34040
34058
|
if (!names.has("runtime_path"))
|
|
34041
34059
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
34042
34060
|
}
|
|
34043
|
-
function
|
|
34061
|
+
function up742(db) {
|
|
34044
34062
|
ensureMemoriesScopeColumns22(db);
|
|
34045
34063
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
34046
34064
|
db.exec(`
|
|
@@ -34054,7 +34072,7 @@ function up732(db) {
|
|
|
34054
34072
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
34055
34073
|
`);
|
|
34056
34074
|
}
|
|
34057
|
-
function
|
|
34075
|
+
function up752(db) {
|
|
34058
34076
|
db.exec(`
|
|
34059
34077
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
34060
34078
|
session_key TEXT NOT NULL,
|
|
@@ -34089,7 +34107,7 @@ function up742(db) {
|
|
|
34089
34107
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
34090
34108
|
`);
|
|
34091
34109
|
}
|
|
34092
|
-
function
|
|
34110
|
+
function up762(db) {
|
|
34093
34111
|
db.exec(`
|
|
34094
34112
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
34095
34113
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -34108,7 +34126,7 @@ function addColumnIfMissing192(db, table, column, definition) {
|
|
|
34108
34126
|
return;
|
|
34109
34127
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34110
34128
|
}
|
|
34111
|
-
function
|
|
34129
|
+
function up772(db) {
|
|
34112
34130
|
addColumnIfMissing192(db, "memory_artifacts", "source_id", "TEXT");
|
|
34113
34131
|
addColumnIfMissing192(db, "memory_artifacts", "source_root", "TEXT");
|
|
34114
34132
|
addColumnIfMissing192(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -34121,7 +34139,7 @@ function up762(db) {
|
|
|
34121
34139
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
34122
34140
|
`);
|
|
34123
34141
|
}
|
|
34124
|
-
function
|
|
34142
|
+
function up782(db) {
|
|
34125
34143
|
db.exec(`
|
|
34126
34144
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
34127
34145
|
id TEXT PRIMARY KEY,
|
|
@@ -34144,7 +34162,7 @@ function up772(db) {
|
|
|
34144
34162
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
34145
34163
|
`);
|
|
34146
34164
|
}
|
|
34147
|
-
function
|
|
34165
|
+
function up792(db) {
|
|
34148
34166
|
db.exec(`
|
|
34149
34167
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
34150
34168
|
id TEXT PRIMARY KEY,
|
|
@@ -34168,7 +34186,7 @@ function up782(db) {
|
|
|
34168
34186
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
34169
34187
|
`);
|
|
34170
34188
|
}
|
|
34171
|
-
function
|
|
34189
|
+
function up802(db) {
|
|
34172
34190
|
db.exec(`
|
|
34173
34191
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
34174
34192
|
id TEXT PRIMARY KEY,
|
|
@@ -34196,7 +34214,7 @@ function up792(db) {
|
|
|
34196
34214
|
ON api_keys(connector, harness);
|
|
34197
34215
|
`);
|
|
34198
34216
|
}
|
|
34199
|
-
function
|
|
34217
|
+
function up812(db) {
|
|
34200
34218
|
db.exec(`
|
|
34201
34219
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
34202
34220
|
id TEXT PRIMARY KEY,
|
|
@@ -34231,7 +34249,7 @@ function hasColumn102(db, table, column) {
|
|
|
34231
34249
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
34232
34250
|
return rows.some((row) => row.name === column);
|
|
34233
34251
|
}
|
|
34234
|
-
function
|
|
34252
|
+
function up822(db) {
|
|
34235
34253
|
if (!hasColumn102(db, "documents", "agent_id")) {
|
|
34236
34254
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
34237
34255
|
}
|
|
@@ -34317,7 +34335,7 @@ function up812(db) {
|
|
|
34317
34335
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
34318
34336
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
34319
34337
|
}
|
|
34320
|
-
function
|
|
34338
|
+
function up832(db) {
|
|
34321
34339
|
db.exec(`
|
|
34322
34340
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
34323
34341
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -34339,7 +34357,7 @@ function hasColumn112(db, table, column) {
|
|
|
34339
34357
|
return rows.some((row) => row.name === column);
|
|
34340
34358
|
}
|
|
34341
34359
|
var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
34342
|
-
function
|
|
34360
|
+
function up842(db) {
|
|
34343
34361
|
for (const column of COLUMNS3) {
|
|
34344
34362
|
if (!hasColumn112(db, "skill_invocations", column)) {
|
|
34345
34363
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -34420,7 +34438,7 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
34420
34438
|
`);
|
|
34421
34439
|
}
|
|
34422
34440
|
try {
|
|
34423
|
-
|
|
34441
|
+
up822(db);
|
|
34424
34442
|
if (preserveAgentId) {
|
|
34425
34443
|
db.exec(`
|
|
34426
34444
|
UPDATE documents
|
|
@@ -34440,12 +34458,12 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
34440
34458
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
34441
34459
|
}
|
|
34442
34460
|
}
|
|
34443
|
-
function
|
|
34444
|
-
|
|
34461
|
+
function up852(db) {
|
|
34462
|
+
up812(db);
|
|
34445
34463
|
if (hasTable32(db, "documents")) {
|
|
34446
34464
|
documentScopeColumnsPreservingExisting2(db);
|
|
34447
34465
|
}
|
|
34448
|
-
|
|
34466
|
+
up832(db);
|
|
34449
34467
|
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
34450
34468
|
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
34451
34469
|
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -34502,7 +34520,7 @@ function up842(db) {
|
|
|
34502
34520
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
34503
34521
|
`);
|
|
34504
34522
|
}
|
|
34505
|
-
function
|
|
34523
|
+
function up862(db) {
|
|
34506
34524
|
db.exec(`
|
|
34507
34525
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
34508
34526
|
path TEXT PRIMARY KEY,
|
|
@@ -34532,7 +34550,7 @@ function up852(db) {
|
|
|
34532
34550
|
ON legacy_markdown_chunks(memory_id);
|
|
34533
34551
|
`);
|
|
34534
34552
|
}
|
|
34535
|
-
function
|
|
34553
|
+
function up872(db) {
|
|
34536
34554
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
34537
34555
|
const tableNames = new Set(tables.map((r3) => String(r3.name)));
|
|
34538
34556
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -34591,7 +34609,7 @@ function addColumnIfMissing212(db, table, column, definition) {
|
|
|
34591
34609
|
return;
|
|
34592
34610
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34593
34611
|
}
|
|
34594
|
-
function
|
|
34612
|
+
function up882(db) {
|
|
34595
34613
|
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
34596
34614
|
db.exec(`
|
|
34597
34615
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -34604,14 +34622,14 @@ function addColumnIfMissing222(db, table, column, definition) {
|
|
|
34604
34622
|
return;
|
|
34605
34623
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34606
34624
|
}
|
|
34607
|
-
function
|
|
34625
|
+
function up892(db) {
|
|
34608
34626
|
addColumnIfMissing222(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
34609
34627
|
db.exec(`
|
|
34610
34628
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
34611
34629
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
34612
34630
|
`);
|
|
34613
34631
|
}
|
|
34614
|
-
function
|
|
34632
|
+
function up902(db) {
|
|
34615
34633
|
db.exec(`
|
|
34616
34634
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
34617
34635
|
agent_id TEXT NOT NULL,
|
|
@@ -34629,7 +34647,7 @@ function up892(db) {
|
|
|
34629
34647
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
34630
34648
|
`);
|
|
34631
34649
|
}
|
|
34632
|
-
function
|
|
34650
|
+
function up912(db) {
|
|
34633
34651
|
db.exec(`
|
|
34634
34652
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
34635
34653
|
id TEXT PRIMARY KEY,
|
|
@@ -34657,7 +34675,7 @@ function indexExists3(db, table, indexName) {
|
|
|
34657
34675
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
34658
34676
|
return rows.some((row) => row.name === indexName);
|
|
34659
34677
|
}
|
|
34660
|
-
function
|
|
34678
|
+
function up922(db) {
|
|
34661
34679
|
db.exec(`
|
|
34662
34680
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
34663
34681
|
id TEXT PRIMARY KEY,
|
|
@@ -34684,7 +34702,7 @@ function indexExists22(db, table, indexName) {
|
|
|
34684
34702
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
34685
34703
|
return rows.some((row) => row.name === indexName);
|
|
34686
34704
|
}
|
|
34687
|
-
function
|
|
34705
|
+
function up932(db) {
|
|
34688
34706
|
db.exec(`
|
|
34689
34707
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
34690
34708
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -34697,7 +34715,7 @@ function up922(db) {
|
|
|
34697
34715
|
)
|
|
34698
34716
|
`);
|
|
34699
34717
|
}
|
|
34700
|
-
function
|
|
34718
|
+
function up942(db) {
|
|
34701
34719
|
db.exec(`
|
|
34702
34720
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
34703
34721
|
id TEXT PRIMARY KEY,
|
|
@@ -34716,7 +34734,7 @@ function up932(db) {
|
|
|
34716
34734
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
34717
34735
|
`);
|
|
34718
34736
|
}
|
|
34719
|
-
function
|
|
34737
|
+
function up952(db) {
|
|
34720
34738
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
34721
34739
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
34722
34740
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -34727,7 +34745,7 @@ function hasColumn132(db, table, column) {
|
|
|
34727
34745
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
34728
34746
|
return rows.some((r3) => r3.name === column);
|
|
34729
34747
|
}
|
|
34730
|
-
function
|
|
34748
|
+
function up962(db) {
|
|
34731
34749
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
34732
34750
|
if (tables.length === 0)
|
|
34733
34751
|
return;
|
|
@@ -34752,23 +34770,23 @@ function up952(db) {
|
|
|
34752
34770
|
function hasColumn142(db, table, column) {
|
|
34753
34771
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
34754
34772
|
}
|
|
34755
|
-
function
|
|
34773
|
+
function up972(db) {
|
|
34756
34774
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
34757
34775
|
if (!hasMemories || !hasColumn142(db, "memories", "memory_kind") || !hasColumn142(db, "memories", "type"))
|
|
34758
34776
|
return;
|
|
34759
34777
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
34760
34778
|
}
|
|
34761
|
-
function
|
|
34779
|
+
function up982(db) {
|
|
34762
34780
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
34763
34781
|
}
|
|
34764
|
-
function
|
|
34782
|
+
function up992(db) {
|
|
34765
34783
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
34766
34784
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
34767
34785
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
34768
34786
|
}
|
|
34769
34787
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
34770
34788
|
}
|
|
34771
|
-
function
|
|
34789
|
+
function up1002(db) {
|
|
34772
34790
|
db.exec(`
|
|
34773
34791
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
34774
34792
|
agent_id TEXT NOT NULL,
|
|
@@ -34785,7 +34803,7 @@ function up992(db) {
|
|
|
34785
34803
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
34786
34804
|
`);
|
|
34787
34805
|
}
|
|
34788
|
-
function
|
|
34806
|
+
function up1012(db) {
|
|
34789
34807
|
db.exec(`
|
|
34790
34808
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
34791
34809
|
id TEXT PRIMARY KEY,
|
|
@@ -34805,7 +34823,7 @@ function up1002(db) {
|
|
|
34805
34823
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
34806
34824
|
`);
|
|
34807
34825
|
}
|
|
34808
|
-
function
|
|
34826
|
+
function up1022(db) {
|
|
34809
34827
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
34810
34828
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
34811
34829
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -34814,7 +34832,7 @@ function up1012(db) {
|
|
|
34814
34832
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
34815
34833
|
}
|
|
34816
34834
|
}
|
|
34817
|
-
function
|
|
34835
|
+
function up1032(db) {
|
|
34818
34836
|
db.exec(`
|
|
34819
34837
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
34820
34838
|
id TEXT PRIMARY KEY,
|
|
@@ -34836,7 +34854,7 @@ function up1022(db) {
|
|
|
34836
34854
|
function hasColumn152(db, table, column) {
|
|
34837
34855
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
34838
34856
|
}
|
|
34839
|
-
function
|
|
34857
|
+
function up1042(db) {
|
|
34840
34858
|
const requiredMemoryColumns = [
|
|
34841
34859
|
"content_hash",
|
|
34842
34860
|
"normalized_content",
|
|
@@ -34887,7 +34905,7 @@ function up1032(db) {
|
|
|
34887
34905
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
34888
34906
|
`);
|
|
34889
34907
|
}
|
|
34890
|
-
function
|
|
34908
|
+
function up1052(db) {
|
|
34891
34909
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
34892
34910
|
if (tables.length !== 2)
|
|
34893
34911
|
return;
|
|
@@ -34910,7 +34928,7 @@ function tableExists4(db, table) {
|
|
|
34910
34928
|
function hasColumn162(db, table, column) {
|
|
34911
34929
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
34912
34930
|
}
|
|
34913
|
-
function
|
|
34931
|
+
function up1062(db) {
|
|
34914
34932
|
db.exec(`
|
|
34915
34933
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
34916
34934
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -34953,7 +34971,7 @@ function up1052(db) {
|
|
|
34953
34971
|
`);
|
|
34954
34972
|
}
|
|
34955
34973
|
}
|
|
34956
|
-
function
|
|
34974
|
+
function up1072(db) {
|
|
34957
34975
|
db.exec(`
|
|
34958
34976
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
34959
34977
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -35042,7 +35060,7 @@ function up1062(db) {
|
|
|
35042
35060
|
function hasColumn172(db, table, column) {
|
|
35043
35061
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
35044
35062
|
}
|
|
35045
|
-
function
|
|
35063
|
+
function up1082(db) {
|
|
35046
35064
|
if (!hasColumn172(db, "memories", "review_after")) {
|
|
35047
35065
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
35048
35066
|
}
|
|
@@ -35058,14 +35076,14 @@ var TOKEN_COLUMNS2 = [
|
|
|
35058
35076
|
["tokens_cache_write", "INTEGER"],
|
|
35059
35077
|
["tokens_cost", "REAL"]
|
|
35060
35078
|
];
|
|
35061
|
-
function
|
|
35079
|
+
function up1092(db) {
|
|
35062
35080
|
for (const [column, type] of TOKEN_COLUMNS2) {
|
|
35063
35081
|
if (!hasColumn182(db, "dreaming_passes", column)) {
|
|
35064
35082
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
35065
35083
|
}
|
|
35066
35084
|
}
|
|
35067
35085
|
}
|
|
35068
|
-
function
|
|
35086
|
+
function up1102(db) {
|
|
35069
35087
|
db.exec(`
|
|
35070
35088
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
35071
35089
|
day TEXT NOT NULL,
|
|
@@ -35078,7 +35096,7 @@ function up1092(db) {
|
|
|
35078
35096
|
);
|
|
35079
35097
|
`);
|
|
35080
35098
|
}
|
|
35081
|
-
function
|
|
35099
|
+
function up1112(db) {
|
|
35082
35100
|
db.exec(`
|
|
35083
35101
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
35084
35102
|
id TEXT PRIMARY KEY,
|
|
@@ -35086,7 +35104,7 @@ function up1102(db) {
|
|
|
35086
35104
|
);
|
|
35087
35105
|
`);
|
|
35088
35106
|
}
|
|
35089
|
-
function
|
|
35107
|
+
function up1122(db) {
|
|
35090
35108
|
db.exec(`
|
|
35091
35109
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
35092
35110
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -35097,7 +35115,7 @@ function hasColumn192(db, table, column) {
|
|
|
35097
35115
|
return rows.some((row) => row.name === column);
|
|
35098
35116
|
}
|
|
35099
35117
|
var COLUMNS22 = ["first_remember_at", "first_recall_at"];
|
|
35100
|
-
function
|
|
35118
|
+
function up1132(db) {
|
|
35101
35119
|
for (const column of COLUMNS22) {
|
|
35102
35120
|
if (!hasColumn192(db, "telemetry_install", column)) {
|
|
35103
35121
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -35113,7 +35131,7 @@ function addColumnIfMissing232(db, column, definition) {
|
|
|
35113
35131
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
35114
35132
|
}
|
|
35115
35133
|
}
|
|
35116
|
-
function
|
|
35134
|
+
function up1142(db) {
|
|
35117
35135
|
addColumnIfMissing232(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
35118
35136
|
addColumnIfMissing232(db, "claim_token", "TEXT");
|
|
35119
35137
|
addColumnIfMissing232(db, "claimed_at", "TEXT");
|
|
@@ -35122,7 +35140,7 @@ function up1132(db) {
|
|
|
35122
35140
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
35123
35141
|
`);
|
|
35124
35142
|
}
|
|
35125
|
-
function
|
|
35143
|
+
function up1152(db) {
|
|
35126
35144
|
db.exec(`
|
|
35127
35145
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
35128
35146
|
session_key TEXT NOT NULL,
|
|
@@ -35143,7 +35161,7 @@ function up1142(db) {
|
|
|
35143
35161
|
ON session_claims(agent_id, state, expires_at);
|
|
35144
35162
|
`);
|
|
35145
35163
|
}
|
|
35146
|
-
function
|
|
35164
|
+
function up1162(db) {
|
|
35147
35165
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
35148
35166
|
if (table == null)
|
|
35149
35167
|
return;
|
|
@@ -35152,7 +35170,7 @@ function up1152(db) {
|
|
|
35152
35170
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
35153
35171
|
`);
|
|
35154
35172
|
}
|
|
35155
|
-
function
|
|
35173
|
+
function up1172(db) {
|
|
35156
35174
|
db.exec(`
|
|
35157
35175
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
35158
35176
|
id TEXT PRIMARY KEY,
|
|
@@ -35209,7 +35227,7 @@ function addColumnIfMissing242(db, column, definition) {
|
|
|
35209
35227
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
35210
35228
|
}
|
|
35211
35229
|
}
|
|
35212
|
-
function
|
|
35230
|
+
function up1182(db) {
|
|
35213
35231
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
35214
35232
|
if (table == null)
|
|
35215
35233
|
return;
|
|
@@ -35410,7 +35428,7 @@ function backfillTranscriptsFromSummaryJobs2(db) {
|
|
|
35410
35428
|
insert.run(...values);
|
|
35411
35429
|
}
|
|
35412
35430
|
}
|
|
35413
|
-
function
|
|
35431
|
+
function up1192(db) {
|
|
35414
35432
|
if (!hasTable42(db, "session_transcripts"))
|
|
35415
35433
|
return;
|
|
35416
35434
|
addColumnIfMissing252(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -35463,7 +35481,7 @@ function up1182(db) {
|
|
|
35463
35481
|
ON session_transcripts(agent_id, content_hash);
|
|
35464
35482
|
`);
|
|
35465
35483
|
}
|
|
35466
|
-
function
|
|
35484
|
+
function up1202(db) {
|
|
35467
35485
|
db.exec(`
|
|
35468
35486
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
35469
35487
|
ON memory_jobs(status)
|
|
@@ -35482,12 +35500,12 @@ function up1192(db) {
|
|
|
35482
35500
|
function hasColumn222(db, table, column) {
|
|
35483
35501
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
35484
35502
|
}
|
|
35485
|
-
function
|
|
35503
|
+
function up1212(db) {
|
|
35486
35504
|
if (!hasColumn222(db, "telemetry_install", "last_seen_version")) {
|
|
35487
35505
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
35488
35506
|
}
|
|
35489
35507
|
}
|
|
35490
|
-
function
|
|
35508
|
+
function up1222(db) {
|
|
35491
35509
|
db.exec(`
|
|
35492
35510
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
35493
35511
|
agent_id TEXT NOT NULL,
|
|
@@ -35516,7 +35534,7 @@ function addColumnIfMissing262(db, column, definition) {
|
|
|
35516
35534
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
35517
35535
|
}
|
|
35518
35536
|
}
|
|
35519
|
-
function
|
|
35537
|
+
function up1232(db) {
|
|
35520
35538
|
addColumnIfMissing262(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
35521
35539
|
addColumnIfMissing262(db, "last_attempt_at", "TEXT");
|
|
35522
35540
|
addColumnIfMissing262(db, "sent_at", "TEXT");
|
|
@@ -35537,7 +35555,7 @@ function up1222(db) {
|
|
|
35537
35555
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
35538
35556
|
`);
|
|
35539
35557
|
}
|
|
35540
|
-
function
|
|
35558
|
+
function up1242(db) {
|
|
35541
35559
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
35542
35560
|
const names = new Set(columns.map((column) => column.name));
|
|
35543
35561
|
if (!names.has("failure_class")) {
|
|
@@ -35554,7 +35572,7 @@ function up1232(db) {
|
|
|
35554
35572
|
}
|
|
35555
35573
|
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)");
|
|
35556
35574
|
}
|
|
35557
|
-
function
|
|
35575
|
+
function up1252(db) {
|
|
35558
35576
|
db.exec(`
|
|
35559
35577
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
35560
35578
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -35578,7 +35596,7 @@ function up1242(db) {
|
|
|
35578
35596
|
ON embedding_index_failures(source_type, source_id);
|
|
35579
35597
|
`);
|
|
35580
35598
|
}
|
|
35581
|
-
function
|
|
35599
|
+
function up1262(db) {
|
|
35582
35600
|
db.exec(`
|
|
35583
35601
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
35584
35602
|
id TEXT PRIMARY KEY,
|
|
@@ -35628,7 +35646,7 @@ function backfillTable2(db, params) {
|
|
|
35628
35646
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
35629
35647
|
backfill2(db, rows, params.sourceKind, params.scannedAt);
|
|
35630
35648
|
}
|
|
35631
|
-
function
|
|
35649
|
+
function up1272(db) {
|
|
35632
35650
|
db.exec(`
|
|
35633
35651
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
35634
35652
|
agent_id TEXT NOT NULL,
|
|
@@ -35685,7 +35703,7 @@ function up1262(db) {
|
|
|
35685
35703
|
scannedAt
|
|
35686
35704
|
});
|
|
35687
35705
|
}
|
|
35688
|
-
function
|
|
35706
|
+
function up1282(db) {
|
|
35689
35707
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
35690
35708
|
if (!table)
|
|
35691
35709
|
return;
|
|
@@ -35719,7 +35737,7 @@ function up1272(db) {
|
|
|
35719
35737
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
35720
35738
|
`);
|
|
35721
35739
|
}
|
|
35722
|
-
function
|
|
35740
|
+
function up1292(db) {
|
|
35723
35741
|
db.exec(`
|
|
35724
35742
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
35725
35743
|
id TEXT PRIMARY KEY,
|
|
@@ -35775,7 +35793,7 @@ function up1282(db) {
|
|
|
35775
35793
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
35776
35794
|
`);
|
|
35777
35795
|
}
|
|
35778
|
-
function
|
|
35796
|
+
function up1302(db) {
|
|
35779
35797
|
db.exec(`
|
|
35780
35798
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
35781
35799
|
ON memory_jobs(status, created_at)
|
|
@@ -35790,7 +35808,7 @@ function up1292(db) {
|
|
|
35790
35808
|
function tableExists32(db, table) {
|
|
35791
35809
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
35792
35810
|
}
|
|
35793
|
-
function
|
|
35811
|
+
function up1312(db) {
|
|
35794
35812
|
if (!tableExists32(db, "memory_jobs"))
|
|
35795
35813
|
return;
|
|
35796
35814
|
if (!tableExists32(db, "job_cancellations")) {
|
|
@@ -35839,7 +35857,7 @@ function up1302(db) {
|
|
|
35839
35857
|
AND status IN ('pending', 'leased');
|
|
35840
35858
|
`);
|
|
35841
35859
|
}
|
|
35842
|
-
function
|
|
35860
|
+
function up1322(db) {
|
|
35843
35861
|
db.exec(`
|
|
35844
35862
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
35845
35863
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -35879,7 +35897,7 @@ function up1312(db) {
|
|
|
35879
35897
|
END;
|
|
35880
35898
|
`);
|
|
35881
35899
|
}
|
|
35882
|
-
function
|
|
35900
|
+
function up1332(db) {
|
|
35883
35901
|
db.exec(`
|
|
35884
35902
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
35885
35903
|
agent_id TEXT NOT NULL,
|
|
@@ -35902,13 +35920,13 @@ function up1322(db) {
|
|
|
35902
35920
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
35903
35921
|
`);
|
|
35904
35922
|
}
|
|
35905
|
-
function
|
|
35923
|
+
function up1342(db) {
|
|
35906
35924
|
db.exec(`
|
|
35907
35925
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
35908
35926
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
35909
35927
|
`);
|
|
35910
35928
|
}
|
|
35911
|
-
function
|
|
35929
|
+
function up1352(db) {
|
|
35912
35930
|
db.exec(`
|
|
35913
35931
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
35914
35932
|
id TEXT PRIMARY KEY,
|
|
@@ -35960,7 +35978,7 @@ function up1342(db) {
|
|
|
35960
35978
|
if (!names.has("format_version"))
|
|
35961
35979
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
35962
35980
|
}
|
|
35963
|
-
function
|
|
35981
|
+
function up1362(db) {
|
|
35964
35982
|
db.exec(`
|
|
35965
35983
|
CREATE TABLE memory_head_entries_v134 (
|
|
35966
35984
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -35978,7 +35996,7 @@ function up1352(db) {
|
|
|
35978
35996
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
35979
35997
|
`);
|
|
35980
35998
|
}
|
|
35981
|
-
function
|
|
35999
|
+
function up1372(db) {
|
|
35982
36000
|
db.exec(`
|
|
35983
36001
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
35984
36002
|
agent_id TEXT NOT NULL,
|
|
@@ -35994,7 +36012,7 @@ function up1362(db) {
|
|
|
35994
36012
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
35995
36013
|
`);
|
|
35996
36014
|
}
|
|
35997
|
-
function
|
|
36015
|
+
function up1382(db) {
|
|
35998
36016
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r3) => r3.name));
|
|
35999
36017
|
for (const [name, type] of [
|
|
36000
36018
|
["entry_id", "TEXT"],
|
|
@@ -36008,7 +36026,7 @@ function up1372(db) {
|
|
|
36008
36026
|
}
|
|
36009
36027
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
36010
36028
|
}
|
|
36011
|
-
function
|
|
36029
|
+
function up1392(db) {
|
|
36012
36030
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r3) => r3.name));
|
|
36013
36031
|
for (const [name, type] of [
|
|
36014
36032
|
["head_revision", "INTEGER"],
|
|
@@ -36030,7 +36048,7 @@ function addColumnIfMissing272(db, table, column, definition) {
|
|
|
36030
36048
|
if (!hasColumn252(db, table, column))
|
|
36031
36049
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
36032
36050
|
}
|
|
36033
|
-
function
|
|
36051
|
+
function up1402(db) {
|
|
36034
36052
|
addColumnIfMissing272(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
36035
36053
|
db.exec(`
|
|
36036
36054
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -36335,7 +36353,7 @@ function up1392(db) {
|
|
|
36335
36353
|
GROUP BY j.agent_id;
|
|
36336
36354
|
`);
|
|
36337
36355
|
}
|
|
36338
|
-
function
|
|
36356
|
+
function up1412(db) {
|
|
36339
36357
|
db.exec(`
|
|
36340
36358
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
36341
36359
|
agent_id TEXT NOT NULL,
|
|
@@ -36351,7 +36369,7 @@ function up1402(db) {
|
|
|
36351
36369
|
ON native_source_sync_state(agent_id, status);
|
|
36352
36370
|
`);
|
|
36353
36371
|
}
|
|
36354
|
-
function
|
|
36372
|
+
function up1422(db) {
|
|
36355
36373
|
db.exec(`
|
|
36356
36374
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
36357
36375
|
agent_id TEXT NOT NULL,
|
|
@@ -36363,7 +36381,7 @@ function up1412(db) {
|
|
|
36363
36381
|
);
|
|
36364
36382
|
`);
|
|
36365
36383
|
}
|
|
36366
|
-
function
|
|
36384
|
+
function up1432(db) {
|
|
36367
36385
|
db.exec(`
|
|
36368
36386
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
36369
36387
|
agent_id TEXT NOT NULL,
|
|
@@ -36377,13 +36395,13 @@ function up1422(db) {
|
|
|
36377
36395
|
);
|
|
36378
36396
|
`);
|
|
36379
36397
|
}
|
|
36380
|
-
function
|
|
36398
|
+
function up1442(db) {
|
|
36381
36399
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
36382
36400
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
36383
36401
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
36384
36402
|
}
|
|
36385
36403
|
}
|
|
36386
|
-
function
|
|
36404
|
+
function up1452(db) {
|
|
36387
36405
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
36388
36406
|
const additions = [
|
|
36389
36407
|
["migration_phase", "TEXT"],
|
|
@@ -36418,13 +36436,13 @@ function up1442(db) {
|
|
|
36418
36436
|
`);
|
|
36419
36437
|
}
|
|
36420
36438
|
}
|
|
36421
|
-
function
|
|
36439
|
+
function up1462(db) {
|
|
36422
36440
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
36423
36441
|
if (!columns.has("lease_token")) {
|
|
36424
36442
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
36425
36443
|
}
|
|
36426
36444
|
}
|
|
36427
|
-
function
|
|
36445
|
+
function up1472(db) {
|
|
36428
36446
|
db.exec(`
|
|
36429
36447
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
36430
36448
|
agent_id TEXT NOT NULL,
|
|
@@ -36442,7 +36460,7 @@ function up1462(db) {
|
|
|
36442
36460
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
36443
36461
|
`);
|
|
36444
36462
|
}
|
|
36445
|
-
function
|
|
36463
|
+
function up1482(db) {
|
|
36446
36464
|
db.exec(`
|
|
36447
36465
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
36448
36466
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -36509,16 +36527,16 @@ function up1472(db) {
|
|
|
36509
36527
|
}
|
|
36510
36528
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
36511
36529
|
}
|
|
36512
|
-
function
|
|
36530
|
+
function up1492(db) {
|
|
36513
36531
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
36514
36532
|
}
|
|
36515
|
-
function
|
|
36533
|
+
function up1502(db) {
|
|
36516
36534
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
36517
36535
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
36518
36536
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
36519
36537
|
}
|
|
36520
36538
|
}
|
|
36521
|
-
function
|
|
36539
|
+
function up1512(db) {
|
|
36522
36540
|
const addColumn = (table, column, definition) => {
|
|
36523
36541
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
36524
36542
|
let exists;
|
|
@@ -36539,7 +36557,7 @@ function addColumnIfMissing282(db, table, column, definition) {
|
|
|
36539
36557
|
if (!columns.some((row) => row.name === column))
|
|
36540
36558
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
36541
36559
|
}
|
|
36542
|
-
function
|
|
36560
|
+
function up1522(db) {
|
|
36543
36561
|
addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
36544
36562
|
addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
36545
36563
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -36693,13 +36711,13 @@ var MIGRATIONS2 = [
|
|
|
36693
36711
|
{
|
|
36694
36712
|
version: 1,
|
|
36695
36713
|
name: "baseline",
|
|
36696
|
-
up:
|
|
36714
|
+
up: up310,
|
|
36697
36715
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
36698
36716
|
},
|
|
36699
36717
|
{
|
|
36700
36718
|
version: 2,
|
|
36701
36719
|
name: "pipeline-v2",
|
|
36702
|
-
up:
|
|
36720
|
+
up: up410,
|
|
36703
36721
|
artifacts: {
|
|
36704
36722
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
36705
36723
|
}
|
|
@@ -36707,12 +36725,12 @@ var MIGRATIONS2 = [
|
|
|
36707
36725
|
{
|
|
36708
36726
|
version: 3,
|
|
36709
36727
|
name: "unique-content-hash",
|
|
36710
|
-
up:
|
|
36728
|
+
up: up510
|
|
36711
36729
|
},
|
|
36712
36730
|
{
|
|
36713
36731
|
version: 4,
|
|
36714
36732
|
name: "history-actor-and-retention",
|
|
36715
|
-
up:
|
|
36733
|
+
up: up610,
|
|
36716
36734
|
artifacts: {
|
|
36717
36735
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
36718
36736
|
}
|
|
@@ -36720,7 +36738,7 @@ var MIGRATIONS2 = [
|
|
|
36720
36738
|
{
|
|
36721
36739
|
version: 5,
|
|
36722
36740
|
name: "graph-extended",
|
|
36723
|
-
up:
|
|
36741
|
+
up: up710,
|
|
36724
36742
|
artifacts: {
|
|
36725
36743
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
36726
36744
|
}
|
|
@@ -36728,7 +36746,7 @@ var MIGRATIONS2 = [
|
|
|
36728
36746
|
{
|
|
36729
36747
|
version: 6,
|
|
36730
36748
|
name: "idempotency-key",
|
|
36731
|
-
up:
|
|
36749
|
+
up: up810,
|
|
36732
36750
|
artifacts: {
|
|
36733
36751
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
36734
36752
|
}
|
|
@@ -36736,42 +36754,42 @@ var MIGRATIONS2 = [
|
|
|
36736
36754
|
{
|
|
36737
36755
|
version: 7,
|
|
36738
36756
|
name: "documents-and-connectors",
|
|
36739
|
-
up:
|
|
36757
|
+
up: up910,
|
|
36740
36758
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
36741
36759
|
},
|
|
36742
36760
|
{
|
|
36743
36761
|
version: 8,
|
|
36744
36762
|
name: "embeddings-unique-hash",
|
|
36745
|
-
up:
|
|
36763
|
+
up: up1010
|
|
36746
36764
|
},
|
|
36747
36765
|
{
|
|
36748
36766
|
version: 9,
|
|
36749
36767
|
name: "summary-jobs",
|
|
36750
|
-
up:
|
|
36768
|
+
up: up1110,
|
|
36751
36769
|
artifacts: { tables: ["summary_jobs"] }
|
|
36752
36770
|
},
|
|
36753
36771
|
{
|
|
36754
36772
|
version: 10,
|
|
36755
36773
|
name: "umap-cache",
|
|
36756
|
-
up:
|
|
36774
|
+
up: up1210,
|
|
36757
36775
|
artifacts: { tables: ["umap_cache"] }
|
|
36758
36776
|
},
|
|
36759
36777
|
{
|
|
36760
36778
|
version: 11,
|
|
36761
36779
|
name: "session-scores",
|
|
36762
|
-
up:
|
|
36780
|
+
up: up1310,
|
|
36763
36781
|
artifacts: { tables: ["session_scores"] }
|
|
36764
36782
|
},
|
|
36765
36783
|
{
|
|
36766
36784
|
version: 12,
|
|
36767
36785
|
name: "scheduled-tasks",
|
|
36768
|
-
up:
|
|
36786
|
+
up: up1410,
|
|
36769
36787
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
36770
36788
|
},
|
|
36771
36789
|
{
|
|
36772
36790
|
version: 13,
|
|
36773
36791
|
name: "ingestion-tracking",
|
|
36774
|
-
up:
|
|
36792
|
+
up: up154,
|
|
36775
36793
|
artifacts: {
|
|
36776
36794
|
columns: [
|
|
36777
36795
|
{ table: "memories", column: "source_path" },
|
|
@@ -36782,13 +36800,13 @@ var MIGRATIONS2 = [
|
|
|
36782
36800
|
{
|
|
36783
36801
|
version: 14,
|
|
36784
36802
|
name: "telemetry",
|
|
36785
|
-
up:
|
|
36803
|
+
up: up162,
|
|
36786
36804
|
artifacts: { tables: ["telemetry_events"] }
|
|
36787
36805
|
},
|
|
36788
36806
|
{
|
|
36789
36807
|
version: 15,
|
|
36790
36808
|
name: "session-memories",
|
|
36791
|
-
up:
|
|
36809
|
+
up: up172,
|
|
36792
36810
|
artifacts: {
|
|
36793
36811
|
tables: ["session_memories"],
|
|
36794
36812
|
columns: [
|
|
@@ -36800,13 +36818,13 @@ var MIGRATIONS2 = [
|
|
|
36800
36818
|
{
|
|
36801
36819
|
version: 16,
|
|
36802
36820
|
name: "session-checkpoints",
|
|
36803
|
-
up:
|
|
36821
|
+
up: up182,
|
|
36804
36822
|
artifacts: { tables: ["session_checkpoints"] }
|
|
36805
36823
|
},
|
|
36806
36824
|
{
|
|
36807
36825
|
version: 17,
|
|
36808
36826
|
name: "task-skills",
|
|
36809
|
-
up:
|
|
36827
|
+
up: up192,
|
|
36810
36828
|
artifacts: {
|
|
36811
36829
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
36812
36830
|
}
|
|
@@ -36814,13 +36832,13 @@ var MIGRATIONS2 = [
|
|
|
36814
36832
|
{
|
|
36815
36833
|
version: 18,
|
|
36816
36834
|
name: "skill-meta",
|
|
36817
|
-
up:
|
|
36835
|
+
up: up202,
|
|
36818
36836
|
artifacts: { tables: ["skill_meta"] }
|
|
36819
36837
|
},
|
|
36820
36838
|
{
|
|
36821
36839
|
version: 19,
|
|
36822
36840
|
name: "knowledge-structure",
|
|
36823
|
-
up:
|
|
36841
|
+
up: up212,
|
|
36824
36842
|
artifacts: {
|
|
36825
36843
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
36826
36844
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -36829,7 +36847,7 @@ var MIGRATIONS2 = [
|
|
|
36829
36847
|
{
|
|
36830
36848
|
version: 20,
|
|
36831
36849
|
name: "session-structural-columns",
|
|
36832
|
-
up:
|
|
36850
|
+
up: up222,
|
|
36833
36851
|
artifacts: {
|
|
36834
36852
|
columns: [
|
|
36835
36853
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -36842,7 +36860,7 @@ var MIGRATIONS2 = [
|
|
|
36842
36860
|
{
|
|
36843
36861
|
version: 21,
|
|
36844
36862
|
name: "checkpoint-structural",
|
|
36845
|
-
up:
|
|
36863
|
+
up: up232,
|
|
36846
36864
|
artifacts: {
|
|
36847
36865
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
36848
36866
|
}
|
|
@@ -36850,7 +36868,7 @@ var MIGRATIONS2 = [
|
|
|
36850
36868
|
{
|
|
36851
36869
|
version: 22,
|
|
36852
36870
|
name: "entity-pinning",
|
|
36853
|
-
up:
|
|
36871
|
+
up: up242,
|
|
36854
36872
|
artifacts: {
|
|
36855
36873
|
columns: [
|
|
36856
36874
|
{ table: "entities", column: "pinned" },
|
|
@@ -36861,17 +36879,17 @@ var MIGRATIONS2 = [
|
|
|
36861
36879
|
{
|
|
36862
36880
|
version: 23,
|
|
36863
36881
|
name: "retired-scorer-gap",
|
|
36864
|
-
up:
|
|
36882
|
+
up: up252
|
|
36865
36883
|
},
|
|
36866
36884
|
{
|
|
36867
36885
|
version: 24,
|
|
36868
36886
|
name: "retired-scorer-gap",
|
|
36869
|
-
up:
|
|
36887
|
+
up: up262
|
|
36870
36888
|
},
|
|
36871
36889
|
{
|
|
36872
36890
|
version: 25,
|
|
36873
36891
|
name: "agent-feedback",
|
|
36874
|
-
up:
|
|
36892
|
+
up: up272,
|
|
36875
36893
|
artifacts: {
|
|
36876
36894
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
36877
36895
|
}
|
|
@@ -36879,32 +36897,32 @@ var MIGRATIONS2 = [
|
|
|
36879
36897
|
{
|
|
36880
36898
|
version: 26,
|
|
36881
36899
|
name: "retired-scorer-gap",
|
|
36882
|
-
up:
|
|
36900
|
+
up: up282
|
|
36883
36901
|
},
|
|
36884
36902
|
{
|
|
36885
36903
|
version: 27,
|
|
36886
36904
|
name: "backfill-canonical-names",
|
|
36887
|
-
up:
|
|
36905
|
+
up: up292
|
|
36888
36906
|
},
|
|
36889
36907
|
{
|
|
36890
36908
|
version: 28,
|
|
36891
36909
|
name: "lossless-retention",
|
|
36892
|
-
up:
|
|
36910
|
+
up: up302
|
|
36893
36911
|
},
|
|
36894
36912
|
{
|
|
36895
36913
|
version: 29,
|
|
36896
36914
|
name: "session-summary-dag",
|
|
36897
|
-
up:
|
|
36915
|
+
up: up312
|
|
36898
36916
|
},
|
|
36899
36917
|
{
|
|
36900
36918
|
version: 30,
|
|
36901
36919
|
name: "nullable-memory-job-memory-id",
|
|
36902
|
-
up:
|
|
36920
|
+
up: up322
|
|
36903
36921
|
},
|
|
36904
36922
|
{
|
|
36905
36923
|
version: 31,
|
|
36906
36924
|
name: "dependency-reason",
|
|
36907
|
-
up:
|
|
36925
|
+
up: up332,
|
|
36908
36926
|
artifacts: {
|
|
36909
36927
|
columns: [
|
|
36910
36928
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -36915,7 +36933,7 @@ var MIGRATIONS2 = [
|
|
|
36915
36933
|
{
|
|
36916
36934
|
version: 32,
|
|
36917
36935
|
name: "embeddings-vector-column",
|
|
36918
|
-
up:
|
|
36936
|
+
up: up342,
|
|
36919
36937
|
artifacts: {
|
|
36920
36938
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
36921
36939
|
}
|
|
@@ -36923,7 +36941,7 @@ var MIGRATIONS2 = [
|
|
|
36923
36941
|
{
|
|
36924
36942
|
version: 33,
|
|
36925
36943
|
name: "scope",
|
|
36926
|
-
up:
|
|
36944
|
+
up: up352,
|
|
36927
36945
|
artifacts: {
|
|
36928
36946
|
columns: [{ table: "memories", column: "scope" }]
|
|
36929
36947
|
}
|
|
@@ -36931,17 +36949,17 @@ var MIGRATIONS2 = [
|
|
|
36931
36949
|
{
|
|
36932
36950
|
version: 34,
|
|
36933
36951
|
name: "scope-aware-dedup",
|
|
36934
|
-
up:
|
|
36952
|
+
up: up362
|
|
36935
36953
|
},
|
|
36936
36954
|
{
|
|
36937
36955
|
version: 35,
|
|
36938
36956
|
name: "entity-fts",
|
|
36939
|
-
up:
|
|
36957
|
+
up: up372
|
|
36940
36958
|
},
|
|
36941
36959
|
{
|
|
36942
36960
|
version: 36,
|
|
36943
36961
|
name: "dependency-confidence",
|
|
36944
|
-
up:
|
|
36962
|
+
up: up382,
|
|
36945
36963
|
artifacts: {
|
|
36946
36964
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
36947
36965
|
}
|
|
@@ -36949,7 +36967,7 @@ var MIGRATIONS2 = [
|
|
|
36949
36967
|
{
|
|
36950
36968
|
version: 37,
|
|
36951
36969
|
name: "entity-communities",
|
|
36952
|
-
up:
|
|
36970
|
+
up: up392,
|
|
36953
36971
|
artifacts: {
|
|
36954
36972
|
tables: ["entity_communities"],
|
|
36955
36973
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -36958,24 +36976,24 @@ var MIGRATIONS2 = [
|
|
|
36958
36976
|
{
|
|
36959
36977
|
version: 38,
|
|
36960
36978
|
name: "memory-hints",
|
|
36961
|
-
up:
|
|
36979
|
+
up: up402,
|
|
36962
36980
|
artifacts: { tables: ["memory_hints"] }
|
|
36963
36981
|
},
|
|
36964
36982
|
{
|
|
36965
36983
|
version: 39,
|
|
36966
36984
|
name: "dedup-entity-dependencies",
|
|
36967
|
-
up:
|
|
36985
|
+
up: up412
|
|
36968
36986
|
},
|
|
36969
36987
|
{
|
|
36970
36988
|
version: 40,
|
|
36971
36989
|
name: "session-transcripts",
|
|
36972
|
-
up:
|
|
36990
|
+
up: up422,
|
|
36973
36991
|
artifacts: { tables: ["session_transcripts"] }
|
|
36974
36992
|
},
|
|
36975
36993
|
{
|
|
36976
36994
|
version: 41,
|
|
36977
36995
|
name: "path-feedback",
|
|
36978
|
-
up:
|
|
36996
|
+
up: up432,
|
|
36979
36997
|
artifacts: {
|
|
36980
36998
|
tables: [
|
|
36981
36999
|
"path_feedback_events",
|
|
@@ -36990,7 +37008,7 @@ var MIGRATIONS2 = [
|
|
|
36990
37008
|
{
|
|
36991
37009
|
version: 42,
|
|
36992
37010
|
name: "session-memories-agent-id",
|
|
36993
|
-
up:
|
|
37011
|
+
up: up442,
|
|
36994
37012
|
artifacts: {
|
|
36995
37013
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
36996
37014
|
}
|
|
@@ -36998,7 +37016,7 @@ var MIGRATIONS2 = [
|
|
|
36998
37016
|
{
|
|
36999
37017
|
version: 43,
|
|
37000
37018
|
name: "agents-table",
|
|
37001
|
-
up:
|
|
37019
|
+
up: up452,
|
|
37002
37020
|
artifacts: {
|
|
37003
37021
|
tables: ["agents"],
|
|
37004
37022
|
columns: [
|
|
@@ -37010,7 +37028,7 @@ var MIGRATIONS2 = [
|
|
|
37010
37028
|
{
|
|
37011
37029
|
version: 44,
|
|
37012
37030
|
name: "memory-md-temporal-head",
|
|
37013
|
-
up:
|
|
37031
|
+
up: up462,
|
|
37014
37032
|
artifacts: {
|
|
37015
37033
|
columns: [
|
|
37016
37034
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -37022,7 +37040,7 @@ var MIGRATIONS2 = [
|
|
|
37022
37040
|
{
|
|
37023
37041
|
version: 45,
|
|
37024
37042
|
name: "lossless-working-memory-hardening",
|
|
37025
|
-
up:
|
|
37043
|
+
up: up472,
|
|
37026
37044
|
artifacts: {
|
|
37027
37045
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
37028
37046
|
columns: [
|
|
@@ -37035,17 +37053,17 @@ var MIGRATIONS2 = [
|
|
|
37035
37053
|
{
|
|
37036
37054
|
version: 46,
|
|
37037
37055
|
name: "session-summary-uniqueness",
|
|
37038
|
-
up:
|
|
37056
|
+
up: up482
|
|
37039
37057
|
},
|
|
37040
37058
|
{
|
|
37041
37059
|
version: 47,
|
|
37042
37060
|
name: "agent-scoped-temporal-uniqueness",
|
|
37043
|
-
up:
|
|
37061
|
+
up: up492
|
|
37044
37062
|
},
|
|
37045
37063
|
{
|
|
37046
37064
|
version: 48,
|
|
37047
37065
|
name: "thread-heads",
|
|
37048
|
-
up:
|
|
37066
|
+
up: up502,
|
|
37049
37067
|
artifacts: {
|
|
37050
37068
|
tables: ["memory_thread_heads"]
|
|
37051
37069
|
}
|
|
@@ -37053,7 +37071,7 @@ var MIGRATIONS2 = [
|
|
|
37053
37071
|
{
|
|
37054
37072
|
version: 49,
|
|
37055
37073
|
name: "session-extract-cursors",
|
|
37056
|
-
up:
|
|
37074
|
+
up: up512,
|
|
37057
37075
|
artifacts: {
|
|
37058
37076
|
tables: ["session_extract_cursors"]
|
|
37059
37077
|
}
|
|
@@ -37061,7 +37079,7 @@ var MIGRATIONS2 = [
|
|
|
37061
37079
|
{
|
|
37062
37080
|
version: 50,
|
|
37063
37081
|
name: "related-to-audit",
|
|
37064
|
-
up:
|
|
37082
|
+
up: up522,
|
|
37065
37083
|
artifacts: {
|
|
37066
37084
|
tables: ["entity_dependency_history"]
|
|
37067
37085
|
}
|
|
@@ -37069,7 +37087,7 @@ var MIGRATIONS2 = [
|
|
|
37069
37087
|
{
|
|
37070
37088
|
version: 51,
|
|
37071
37089
|
name: "memory-md-rolling-window-lineage",
|
|
37072
|
-
up:
|
|
37090
|
+
up: up532,
|
|
37073
37091
|
artifacts: {
|
|
37074
37092
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
37075
37093
|
columns: [
|
|
@@ -37084,7 +37102,7 @@ var MIGRATIONS2 = [
|
|
|
37084
37102
|
{
|
|
37085
37103
|
version: 52,
|
|
37086
37104
|
name: "mcp-invocations",
|
|
37087
|
-
up:
|
|
37105
|
+
up: up542,
|
|
37088
37106
|
artifacts: {
|
|
37089
37107
|
tables: ["mcp_invocations"]
|
|
37090
37108
|
}
|
|
@@ -37092,7 +37110,7 @@ var MIGRATIONS2 = [
|
|
|
37092
37110
|
{
|
|
37093
37111
|
version: 53,
|
|
37094
37112
|
name: "skill-invocations",
|
|
37095
|
-
up:
|
|
37113
|
+
up: up552,
|
|
37096
37114
|
artifacts: {
|
|
37097
37115
|
tables: ["skill_invocations"]
|
|
37098
37116
|
}
|
|
@@ -37100,7 +37118,7 @@ var MIGRATIONS2 = [
|
|
|
37100
37118
|
{
|
|
37101
37119
|
version: 54,
|
|
37102
37120
|
name: "task-agent-scope",
|
|
37103
|
-
up:
|
|
37121
|
+
up: up562,
|
|
37104
37122
|
artifacts: {
|
|
37105
37123
|
tables: ["task_scope_hints"]
|
|
37106
37124
|
}
|
|
@@ -37108,7 +37126,7 @@ var MIGRATIONS2 = [
|
|
|
37108
37126
|
{
|
|
37109
37127
|
version: 55,
|
|
37110
37128
|
name: "dreaming-state",
|
|
37111
|
-
up:
|
|
37129
|
+
up: up572,
|
|
37112
37130
|
artifacts: {
|
|
37113
37131
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
37114
37132
|
}
|
|
@@ -37116,22 +37134,22 @@ var MIGRATIONS2 = [
|
|
|
37116
37134
|
{
|
|
37117
37135
|
version: 56,
|
|
37118
37136
|
name: "agent-scoped-content-hash",
|
|
37119
|
-
up:
|
|
37137
|
+
up: up582
|
|
37120
37138
|
},
|
|
37121
37139
|
{
|
|
37122
37140
|
version: 57,
|
|
37123
37141
|
name: "memories-fts-tokenizer-repair",
|
|
37124
|
-
up:
|
|
37142
|
+
up: up592
|
|
37125
37143
|
},
|
|
37126
37144
|
{
|
|
37127
37145
|
version: 58,
|
|
37128
37146
|
name: "knowledge-graph-indices",
|
|
37129
|
-
up:
|
|
37147
|
+
up: up602
|
|
37130
37148
|
},
|
|
37131
37149
|
{
|
|
37132
37150
|
version: 59,
|
|
37133
37151
|
name: "entity-attribute-claim-key",
|
|
37134
|
-
up:
|
|
37152
|
+
up: up612,
|
|
37135
37153
|
artifacts: {
|
|
37136
37154
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
37137
37155
|
}
|
|
@@ -37139,7 +37157,7 @@ var MIGRATIONS2 = [
|
|
|
37139
37157
|
{
|
|
37140
37158
|
version: 60,
|
|
37141
37159
|
name: "entity-attribute-group-key",
|
|
37142
|
-
up:
|
|
37160
|
+
up: up622,
|
|
37143
37161
|
artifacts: {
|
|
37144
37162
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
37145
37163
|
}
|
|
@@ -37147,7 +37165,7 @@ var MIGRATIONS2 = [
|
|
|
37147
37165
|
{
|
|
37148
37166
|
version: 61,
|
|
37149
37167
|
name: "memory-artifact-source-mtime",
|
|
37150
|
-
up:
|
|
37168
|
+
up: up632,
|
|
37151
37169
|
artifacts: {
|
|
37152
37170
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
37153
37171
|
}
|
|
@@ -37155,7 +37173,7 @@ var MIGRATIONS2 = [
|
|
|
37155
37173
|
{
|
|
37156
37174
|
version: 62,
|
|
37157
37175
|
name: "memory-artifact-soft-delete",
|
|
37158
|
-
up:
|
|
37176
|
+
up: up642,
|
|
37159
37177
|
artifacts: {
|
|
37160
37178
|
columns: [
|
|
37161
37179
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -37166,12 +37184,12 @@ var MIGRATIONS2 = [
|
|
|
37166
37184
|
{
|
|
37167
37185
|
version: 63,
|
|
37168
37186
|
name: "content-only-memories-fts-update",
|
|
37169
|
-
up:
|
|
37187
|
+
up: up652
|
|
37170
37188
|
},
|
|
37171
37189
|
{
|
|
37172
37190
|
version: 64,
|
|
37173
37191
|
name: "source-graph-provenance",
|
|
37174
|
-
up:
|
|
37192
|
+
up: up662,
|
|
37175
37193
|
artifacts: {
|
|
37176
37194
|
columns: [
|
|
37177
37195
|
{ table: "entities", column: "source_path" },
|
|
@@ -37184,7 +37202,7 @@ var MIGRATIONS2 = [
|
|
|
37184
37202
|
{
|
|
37185
37203
|
version: 65,
|
|
37186
37204
|
name: "source-embedding-agent-scope",
|
|
37187
|
-
up:
|
|
37205
|
+
up: up672,
|
|
37188
37206
|
artifacts: {
|
|
37189
37207
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
37190
37208
|
}
|
|
@@ -37192,7 +37210,7 @@ var MIGRATIONS2 = [
|
|
|
37192
37210
|
{
|
|
37193
37211
|
version: 66,
|
|
37194
37212
|
name: "memory-search-telemetry",
|
|
37195
|
-
up:
|
|
37213
|
+
up: up682,
|
|
37196
37214
|
artifacts: {
|
|
37197
37215
|
tables: ["memory_search_telemetry"]
|
|
37198
37216
|
}
|
|
@@ -37200,7 +37218,7 @@ var MIGRATIONS2 = [
|
|
|
37200
37218
|
{
|
|
37201
37219
|
version: 67,
|
|
37202
37220
|
name: "ontology-proposals",
|
|
37203
|
-
up:
|
|
37221
|
+
up: up692,
|
|
37204
37222
|
artifacts: {
|
|
37205
37223
|
tables: ["ontology_proposals"],
|
|
37206
37224
|
columns: [
|
|
@@ -37214,7 +37232,7 @@ var MIGRATIONS2 = [
|
|
|
37214
37232
|
{
|
|
37215
37233
|
version: 68,
|
|
37216
37234
|
name: "daily-reflections",
|
|
37217
|
-
up:
|
|
37235
|
+
up: up702,
|
|
37218
37236
|
artifacts: {
|
|
37219
37237
|
tables: ["daily_reflections"]
|
|
37220
37238
|
}
|
|
@@ -37222,7 +37240,7 @@ var MIGRATIONS2 = [
|
|
|
37222
37240
|
{
|
|
37223
37241
|
version: 69,
|
|
37224
37242
|
name: "daily-reflections-multiple-insights",
|
|
37225
|
-
up:
|
|
37243
|
+
up: up712,
|
|
37226
37244
|
artifacts: {
|
|
37227
37245
|
tables: ["daily_reflections"]
|
|
37228
37246
|
}
|
|
@@ -37230,7 +37248,7 @@ var MIGRATIONS2 = [
|
|
|
37230
37248
|
{
|
|
37231
37249
|
version: 70,
|
|
37232
37250
|
name: "ontology-control-plane-state",
|
|
37233
|
-
up:
|
|
37251
|
+
up: up722,
|
|
37234
37252
|
artifacts: {
|
|
37235
37253
|
columns: [
|
|
37236
37254
|
{ table: "entities", column: "status" },
|
|
@@ -37245,7 +37263,7 @@ var MIGRATIONS2 = [
|
|
|
37245
37263
|
{
|
|
37246
37264
|
version: 71,
|
|
37247
37265
|
name: "epistemic-assertions",
|
|
37248
|
-
up:
|
|
37266
|
+
up: up732,
|
|
37249
37267
|
artifacts: {
|
|
37250
37268
|
tables: ["epistemic_assertions"]
|
|
37251
37269
|
}
|
|
@@ -37253,7 +37271,7 @@ var MIGRATIONS2 = [
|
|
|
37253
37271
|
{
|
|
37254
37272
|
version: 72,
|
|
37255
37273
|
name: "agent-scoped-idempotency-key",
|
|
37256
|
-
up:
|
|
37274
|
+
up: up742,
|
|
37257
37275
|
artifacts: {
|
|
37258
37276
|
columns: [
|
|
37259
37277
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -37264,7 +37282,7 @@ var MIGRATIONS2 = [
|
|
|
37264
37282
|
{
|
|
37265
37283
|
version: 73,
|
|
37266
37284
|
name: "recall-context-dedupe",
|
|
37267
|
-
up:
|
|
37285
|
+
up: up752,
|
|
37268
37286
|
artifacts: {
|
|
37269
37287
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
37270
37288
|
}
|
|
@@ -37272,7 +37290,7 @@ var MIGRATIONS2 = [
|
|
|
37272
37290
|
{
|
|
37273
37291
|
version: 74,
|
|
37274
37292
|
name: "aggregate-memory-links",
|
|
37275
|
-
up:
|
|
37293
|
+
up: up762,
|
|
37276
37294
|
artifacts: {
|
|
37277
37295
|
tables: ["aggregate_memory_sources"]
|
|
37278
37296
|
}
|
|
@@ -37280,7 +37298,7 @@ var MIGRATIONS2 = [
|
|
|
37280
37298
|
{
|
|
37281
37299
|
version: 75,
|
|
37282
37300
|
name: "memory-artifact-source-provenance",
|
|
37283
|
-
up:
|
|
37301
|
+
up: up772,
|
|
37284
37302
|
artifacts: {
|
|
37285
37303
|
columns: [
|
|
37286
37304
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -37294,7 +37312,7 @@ var MIGRATIONS2 = [
|
|
|
37294
37312
|
{
|
|
37295
37313
|
version: 76,
|
|
37296
37314
|
name: "temporal-edges",
|
|
37297
|
-
up:
|
|
37315
|
+
up: up782,
|
|
37298
37316
|
artifacts: {
|
|
37299
37317
|
tables: ["temporal_edges"]
|
|
37300
37318
|
}
|
|
@@ -37302,7 +37320,7 @@ var MIGRATIONS2 = [
|
|
|
37302
37320
|
{
|
|
37303
37321
|
version: 77,
|
|
37304
37322
|
name: "entity-aliases",
|
|
37305
|
-
up:
|
|
37323
|
+
up: up792,
|
|
37306
37324
|
artifacts: {
|
|
37307
37325
|
tables: ["entity_aliases"]
|
|
37308
37326
|
}
|
|
@@ -37310,7 +37328,7 @@ var MIGRATIONS2 = [
|
|
|
37310
37328
|
{
|
|
37311
37329
|
version: 78,
|
|
37312
37330
|
name: "api-keys",
|
|
37313
|
-
up:
|
|
37331
|
+
up: up802,
|
|
37314
37332
|
artifacts: {
|
|
37315
37333
|
tables: ["api_keys"]
|
|
37316
37334
|
}
|
|
@@ -37318,7 +37336,7 @@ var MIGRATIONS2 = [
|
|
|
37318
37336
|
{
|
|
37319
37337
|
version: 79,
|
|
37320
37338
|
name: "transcript-capture-jobs",
|
|
37321
|
-
up:
|
|
37339
|
+
up: up812,
|
|
37322
37340
|
artifacts: {
|
|
37323
37341
|
tables: ["transcript_capture_jobs"]
|
|
37324
37342
|
}
|
|
@@ -37326,7 +37344,7 @@ var MIGRATIONS2 = [
|
|
|
37326
37344
|
{
|
|
37327
37345
|
version: 80,
|
|
37328
37346
|
name: "document-scope-columns",
|
|
37329
|
-
up:
|
|
37347
|
+
up: up822,
|
|
37330
37348
|
artifacts: {
|
|
37331
37349
|
columns: [
|
|
37332
37350
|
{ table: "documents", column: "agent_id" },
|
|
@@ -37337,7 +37355,7 @@ var MIGRATIONS2 = [
|
|
|
37337
37355
|
{
|
|
37338
37356
|
version: 81,
|
|
37339
37357
|
name: "aggregate-evidence-sources",
|
|
37340
|
-
up:
|
|
37358
|
+
up: up832,
|
|
37341
37359
|
artifacts: {
|
|
37342
37360
|
tables: ["aggregate_evidence_sources"]
|
|
37343
37361
|
}
|
|
@@ -37345,7 +37363,7 @@ var MIGRATIONS2 = [
|
|
|
37345
37363
|
{
|
|
37346
37364
|
version: 82,
|
|
37347
37365
|
name: "skill-invocations-harness",
|
|
37348
|
-
up:
|
|
37366
|
+
up: up842,
|
|
37349
37367
|
artifacts: {
|
|
37350
37368
|
columns: [
|
|
37351
37369
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -37356,7 +37374,7 @@ var MIGRATIONS2 = [
|
|
|
37356
37374
|
{
|
|
37357
37375
|
version: 83,
|
|
37358
37376
|
name: "memory-lifecycle-repair",
|
|
37359
|
-
up:
|
|
37377
|
+
up: up852,
|
|
37360
37378
|
artifacts: {
|
|
37361
37379
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
37362
37380
|
columns: [
|
|
@@ -37371,7 +37389,7 @@ var MIGRATIONS2 = [
|
|
|
37371
37389
|
{
|
|
37372
37390
|
version: 84,
|
|
37373
37391
|
name: "legacy-markdown-import-state",
|
|
37374
|
-
up:
|
|
37392
|
+
up: up862,
|
|
37375
37393
|
artifacts: {
|
|
37376
37394
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
37377
37395
|
}
|
|
@@ -37379,7 +37397,7 @@ var MIGRATIONS2 = [
|
|
|
37379
37397
|
{
|
|
37380
37398
|
version: 85,
|
|
37381
37399
|
name: "backfill-relations-to-dependencies",
|
|
37382
|
-
up:
|
|
37400
|
+
up: up872,
|
|
37383
37401
|
artifacts: {
|
|
37384
37402
|
tables: ["entity_dependencies"]
|
|
37385
37403
|
}
|
|
@@ -37387,7 +37405,7 @@ var MIGRATIONS2 = [
|
|
|
37387
37405
|
{
|
|
37388
37406
|
version: 86,
|
|
37389
37407
|
name: "summary-jobs-content-hash",
|
|
37390
|
-
up:
|
|
37408
|
+
up: up882,
|
|
37391
37409
|
artifacts: {
|
|
37392
37410
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
37393
37411
|
}
|
|
@@ -37395,7 +37413,7 @@ var MIGRATIONS2 = [
|
|
|
37395
37413
|
{
|
|
37396
37414
|
version: 87,
|
|
37397
37415
|
name: "summary-jobs-boundary-reason",
|
|
37398
|
-
up:
|
|
37416
|
+
up: up892,
|
|
37399
37417
|
artifacts: {
|
|
37400
37418
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
37401
37419
|
}
|
|
@@ -37403,7 +37421,7 @@ var MIGRATIONS2 = [
|
|
|
37403
37421
|
{
|
|
37404
37422
|
version: 88,
|
|
37405
37423
|
name: "transcript-recovery-files",
|
|
37406
|
-
up:
|
|
37424
|
+
up: up902,
|
|
37407
37425
|
artifacts: {
|
|
37408
37426
|
tables: ["transcript_recovery_files"]
|
|
37409
37427
|
}
|
|
@@ -37411,7 +37429,7 @@ var MIGRATIONS2 = [
|
|
|
37411
37429
|
{
|
|
37412
37430
|
version: 89,
|
|
37413
37431
|
name: "job-cancellations",
|
|
37414
|
-
up:
|
|
37432
|
+
up: up912,
|
|
37415
37433
|
artifacts: {
|
|
37416
37434
|
tables: ["job_cancellations"]
|
|
37417
37435
|
}
|
|
@@ -37419,7 +37437,7 @@ var MIGRATIONS2 = [
|
|
|
37419
37437
|
{
|
|
37420
37438
|
version: 90,
|
|
37421
37439
|
name: "job-archive",
|
|
37422
|
-
up:
|
|
37440
|
+
up: up922,
|
|
37423
37441
|
artifacts: {
|
|
37424
37442
|
tables: ["job_archive"]
|
|
37425
37443
|
}
|
|
@@ -37427,25 +37445,25 @@ var MIGRATIONS2 = [
|
|
|
37427
37445
|
{
|
|
37428
37446
|
version: 91,
|
|
37429
37447
|
name: "embedding-index-generations",
|
|
37430
|
-
up:
|
|
37448
|
+
up: up932,
|
|
37431
37449
|
artifacts: { tables: ["embedding_index_state"] }
|
|
37432
37450
|
},
|
|
37433
37451
|
{
|
|
37434
37452
|
version: 92,
|
|
37435
37453
|
name: "embedding-staging-store",
|
|
37436
|
-
up:
|
|
37454
|
+
up: up942,
|
|
37437
37455
|
artifacts: { tables: ["embeddings_staging"] }
|
|
37438
37456
|
},
|
|
37439
37457
|
{
|
|
37440
37458
|
version: 93,
|
|
37441
37459
|
name: "dreaming-evidence-cursor",
|
|
37442
|
-
up:
|
|
37460
|
+
up: up952,
|
|
37443
37461
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
37444
37462
|
},
|
|
37445
37463
|
{
|
|
37446
37464
|
version: 94,
|
|
37447
37465
|
name: "memory-kind",
|
|
37448
|
-
up:
|
|
37466
|
+
up: up962,
|
|
37449
37467
|
artifacts: {
|
|
37450
37468
|
columns: [
|
|
37451
37469
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -37456,35 +37474,35 @@ var MIGRATIONS2 = [
|
|
|
37456
37474
|
{
|
|
37457
37475
|
version: 95,
|
|
37458
37476
|
name: "compaction-recall-projections",
|
|
37459
|
-
up:
|
|
37477
|
+
up: up972
|
|
37460
37478
|
},
|
|
37461
37479
|
{
|
|
37462
37480
|
version: 96,
|
|
37463
37481
|
name: "retire-legacy-ingestion",
|
|
37464
|
-
up:
|
|
37482
|
+
up: up982
|
|
37465
37483
|
},
|
|
37466
37484
|
{
|
|
37467
37485
|
version: 97,
|
|
37468
37486
|
name: "dreaming-failure-backoff",
|
|
37469
|
-
up:
|
|
37487
|
+
up: up992,
|
|
37470
37488
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
37471
37489
|
},
|
|
37472
37490
|
{
|
|
37473
37491
|
version: 98,
|
|
37474
37492
|
name: "dreaming-evidence-exclusions",
|
|
37475
|
-
up:
|
|
37493
|
+
up: up1002,
|
|
37476
37494
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
37477
37495
|
},
|
|
37478
37496
|
{
|
|
37479
37497
|
version: 99,
|
|
37480
37498
|
name: "dreaming-tool-calls",
|
|
37481
|
-
up:
|
|
37499
|
+
up: up1012,
|
|
37482
37500
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
37483
37501
|
},
|
|
37484
37502
|
{
|
|
37485
37503
|
version: 100,
|
|
37486
37504
|
name: "dreaming-runbook",
|
|
37487
|
-
up:
|
|
37505
|
+
up: up1022,
|
|
37488
37506
|
artifacts: {
|
|
37489
37507
|
columns: [
|
|
37490
37508
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -37495,23 +37513,23 @@ var MIGRATIONS2 = [
|
|
|
37495
37513
|
{
|
|
37496
37514
|
version: 101,
|
|
37497
37515
|
name: "dreaming-attention",
|
|
37498
|
-
up:
|
|
37516
|
+
up: up1032,
|
|
37499
37517
|
artifacts: { tables: ["dreaming_attention"] }
|
|
37500
37518
|
},
|
|
37501
37519
|
{
|
|
37502
37520
|
version: 102,
|
|
37503
37521
|
name: "attribute-semantic-memories",
|
|
37504
|
-
up:
|
|
37522
|
+
up: up1042
|
|
37505
37523
|
},
|
|
37506
37524
|
{
|
|
37507
37525
|
version: 103,
|
|
37508
37526
|
name: "semantic-memory-kind",
|
|
37509
|
-
up:
|
|
37527
|
+
up: up1052
|
|
37510
37528
|
},
|
|
37511
37529
|
{
|
|
37512
37530
|
version: 104,
|
|
37513
37531
|
name: "derived-memory-provenance",
|
|
37514
|
-
up:
|
|
37532
|
+
up: up1062,
|
|
37515
37533
|
artifacts: {
|
|
37516
37534
|
tables: ["derived_memory_sources"],
|
|
37517
37535
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -37520,12 +37538,12 @@ var MIGRATIONS2 = [
|
|
|
37520
37538
|
{
|
|
37521
37539
|
version: 105,
|
|
37522
37540
|
name: "agent-scoped-entity-name",
|
|
37523
|
-
up:
|
|
37541
|
+
up: up1072
|
|
37524
37542
|
},
|
|
37525
37543
|
{
|
|
37526
37544
|
version: 106,
|
|
37527
37545
|
name: "memory-review-after",
|
|
37528
|
-
up:
|
|
37546
|
+
up: up1082,
|
|
37529
37547
|
artifacts: {
|
|
37530
37548
|
columns: [{ table: "memories", column: "review_after" }]
|
|
37531
37549
|
}
|
|
@@ -37533,7 +37551,7 @@ var MIGRATIONS2 = [
|
|
|
37533
37551
|
{
|
|
37534
37552
|
version: 107,
|
|
37535
37553
|
name: "dreaming-pass-usage",
|
|
37536
|
-
up:
|
|
37554
|
+
up: up1092,
|
|
37537
37555
|
artifacts: {
|
|
37538
37556
|
columns: [
|
|
37539
37557
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -37547,7 +37565,7 @@ var MIGRATIONS2 = [
|
|
|
37547
37565
|
{
|
|
37548
37566
|
version: 108,
|
|
37549
37567
|
name: "embedding-usage",
|
|
37550
|
-
up:
|
|
37568
|
+
up: up1102,
|
|
37551
37569
|
artifacts: {
|
|
37552
37570
|
tables: ["embedding_usage"]
|
|
37553
37571
|
}
|
|
@@ -37555,7 +37573,7 @@ var MIGRATIONS2 = [
|
|
|
37555
37573
|
{
|
|
37556
37574
|
version: 109,
|
|
37557
37575
|
name: "telemetry-install",
|
|
37558
|
-
up:
|
|
37576
|
+
up: up1112,
|
|
37559
37577
|
artifacts: {
|
|
37560
37578
|
tables: ["telemetry_install"]
|
|
37561
37579
|
}
|
|
@@ -37563,12 +37581,12 @@ var MIGRATIONS2 = [
|
|
|
37563
37581
|
{
|
|
37564
37582
|
version: 110,
|
|
37565
37583
|
name: "memory-mention-join-index",
|
|
37566
|
-
up:
|
|
37584
|
+
up: up1122
|
|
37567
37585
|
},
|
|
37568
37586
|
{
|
|
37569
37587
|
version: 111,
|
|
37570
37588
|
name: "telemetry-first-use",
|
|
37571
|
-
up:
|
|
37589
|
+
up: up1132,
|
|
37572
37590
|
artifacts: {
|
|
37573
37591
|
columns: [
|
|
37574
37592
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -37579,7 +37597,7 @@ var MIGRATIONS2 = [
|
|
|
37579
37597
|
{
|
|
37580
37598
|
version: 112,
|
|
37581
37599
|
name: "telemetry-queue-ownership",
|
|
37582
|
-
up:
|
|
37600
|
+
up: up1142,
|
|
37583
37601
|
artifacts: {
|
|
37584
37602
|
columns: [
|
|
37585
37603
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -37591,7 +37609,7 @@ var MIGRATIONS2 = [
|
|
|
37591
37609
|
{
|
|
37592
37610
|
version: 113,
|
|
37593
37611
|
name: "session-claims",
|
|
37594
|
-
up:
|
|
37612
|
+
up: up1152,
|
|
37595
37613
|
artifacts: {
|
|
37596
37614
|
tables: ["session_claims"],
|
|
37597
37615
|
columns: [
|
|
@@ -37605,12 +37623,12 @@ var MIGRATIONS2 = [
|
|
|
37605
37623
|
{
|
|
37606
37624
|
version: 114,
|
|
37607
37625
|
name: "memory-traversal-hydration-index",
|
|
37608
|
-
up:
|
|
37626
|
+
up: up1162
|
|
37609
37627
|
},
|
|
37610
37628
|
{
|
|
37611
37629
|
version: 115,
|
|
37612
37630
|
name: "cross-agent-message-notifications",
|
|
37613
|
-
up:
|
|
37631
|
+
up: up1172,
|
|
37614
37632
|
artifacts: {
|
|
37615
37633
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
37616
37634
|
}
|
|
@@ -37618,7 +37636,7 @@ var MIGRATIONS2 = [
|
|
|
37618
37636
|
{
|
|
37619
37637
|
version: 116,
|
|
37620
37638
|
name: "acp-delivery-reconciliation",
|
|
37621
|
-
up:
|
|
37639
|
+
up: up1182,
|
|
37622
37640
|
artifacts: {
|
|
37623
37641
|
columns: [
|
|
37624
37642
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -37632,7 +37650,7 @@ var MIGRATIONS2 = [
|
|
|
37632
37650
|
{
|
|
37633
37651
|
version: 117,
|
|
37634
37652
|
name: "retire-summary-worker",
|
|
37635
|
-
up:
|
|
37653
|
+
up: up1192,
|
|
37636
37654
|
artifacts: {
|
|
37637
37655
|
columns: [
|
|
37638
37656
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -37643,24 +37661,24 @@ var MIGRATIONS2 = [
|
|
|
37643
37661
|
{
|
|
37644
37662
|
version: 118,
|
|
37645
37663
|
name: "queue-pressure-indices",
|
|
37646
|
-
up:
|
|
37664
|
+
up: up1202
|
|
37647
37665
|
},
|
|
37648
37666
|
{
|
|
37649
37667
|
version: 119,
|
|
37650
37668
|
name: "telemetry-version-observation",
|
|
37651
|
-
up:
|
|
37669
|
+
up: up1212,
|
|
37652
37670
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
37653
37671
|
},
|
|
37654
37672
|
{
|
|
37655
37673
|
version: 120,
|
|
37656
37674
|
name: "source-lifecycle-telemetry",
|
|
37657
|
-
up:
|
|
37675
|
+
up: up1222,
|
|
37658
37676
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
37659
37677
|
},
|
|
37660
37678
|
{
|
|
37661
37679
|
version: 121,
|
|
37662
37680
|
name: "telemetry-delivery-health",
|
|
37663
|
-
up:
|
|
37681
|
+
up: up1232,
|
|
37664
37682
|
artifacts: {
|
|
37665
37683
|
tables: ["telemetry_delivery_state"],
|
|
37666
37684
|
columns: [
|
|
@@ -37674,7 +37692,7 @@ var MIGRATIONS2 = [
|
|
|
37674
37692
|
{
|
|
37675
37693
|
version: 122,
|
|
37676
37694
|
name: "dreaming-evidence-retry",
|
|
37677
|
-
up:
|
|
37695
|
+
up: up1242,
|
|
37678
37696
|
artifacts: {
|
|
37679
37697
|
columns: [
|
|
37680
37698
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -37687,13 +37705,13 @@ var MIGRATIONS2 = [
|
|
|
37687
37705
|
{
|
|
37688
37706
|
version: 123,
|
|
37689
37707
|
name: "embedding-index-failures",
|
|
37690
|
-
up:
|
|
37708
|
+
up: up1252,
|
|
37691
37709
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
37692
37710
|
},
|
|
37693
37711
|
{
|
|
37694
37712
|
version: 124,
|
|
37695
37713
|
name: "import-derived-lifecycle",
|
|
37696
|
-
up:
|
|
37714
|
+
up: up1262,
|
|
37697
37715
|
artifacts: {
|
|
37698
37716
|
tables: ["imported_source_lifecycle"]
|
|
37699
37717
|
}
|
|
@@ -37701,77 +37719,77 @@ var MIGRATIONS2 = [
|
|
|
37701
37719
|
{
|
|
37702
37720
|
version: 125,
|
|
37703
37721
|
name: "memory-content-safety",
|
|
37704
|
-
up:
|
|
37722
|
+
up: up1272,
|
|
37705
37723
|
artifacts: { tables: ["memory_content_safety"] }
|
|
37706
37724
|
},
|
|
37707
37725
|
{
|
|
37708
37726
|
version: 126,
|
|
37709
37727
|
name: "dreaming-surprisal-attention",
|
|
37710
|
-
up:
|
|
37728
|
+
up: up1282,
|
|
37711
37729
|
artifacts: { tables: ["dreaming_attention"] }
|
|
37712
37730
|
},
|
|
37713
37731
|
{
|
|
37714
37732
|
version: 127,
|
|
37715
37733
|
name: "ontology-contradictions",
|
|
37716
|
-
up:
|
|
37734
|
+
up: up1292,
|
|
37717
37735
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
37718
37736
|
},
|
|
37719
37737
|
{
|
|
37720
37738
|
version: 128,
|
|
37721
37739
|
name: "bounded-queue-diagnostics",
|
|
37722
|
-
up:
|
|
37740
|
+
up: up1302
|
|
37723
37741
|
},
|
|
37724
37742
|
{
|
|
37725
37743
|
version: 129,
|
|
37726
37744
|
name: "retire-structural-jobs",
|
|
37727
|
-
up:
|
|
37745
|
+
up: up1312
|
|
37728
37746
|
},
|
|
37729
37747
|
{
|
|
37730
37748
|
version: 130,
|
|
37731
37749
|
name: "embedding-repair-state",
|
|
37732
|
-
up:
|
|
37750
|
+
up: up1322,
|
|
37733
37751
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
37734
37752
|
},
|
|
37735
37753
|
{
|
|
37736
37754
|
version: 131,
|
|
37737
37755
|
name: "dreaming-evidence-consumption",
|
|
37738
|
-
up:
|
|
37756
|
+
up: up1332,
|
|
37739
37757
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
37740
37758
|
},
|
|
37741
37759
|
{
|
|
37742
37760
|
version: 132,
|
|
37743
37761
|
name: "observer-scoped-epistemic-assertions",
|
|
37744
|
-
up:
|
|
37762
|
+
up: up1342,
|
|
37745
37763
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
37746
37764
|
},
|
|
37747
37765
|
{
|
|
37748
37766
|
version: 133,
|
|
37749
37767
|
name: "dreaming-memory-head",
|
|
37750
|
-
up:
|
|
37768
|
+
up: up1352,
|
|
37751
37769
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
37752
37770
|
},
|
|
37753
37771
|
{
|
|
37754
37772
|
version: 134,
|
|
37755
37773
|
name: "scope-memory-head-entries",
|
|
37756
|
-
up:
|
|
37774
|
+
up: up1362,
|
|
37757
37775
|
artifacts: { tables: ["memory_head_entries"] }
|
|
37758
37776
|
},
|
|
37759
37777
|
{
|
|
37760
37778
|
version: 135,
|
|
37761
37779
|
name: "memory-head-publication",
|
|
37762
|
-
up:
|
|
37780
|
+
up: up1372,
|
|
37763
37781
|
artifacts: { tables: ["memory_head_publications"] }
|
|
37764
37782
|
},
|
|
37765
37783
|
{
|
|
37766
37784
|
version: 136,
|
|
37767
37785
|
name: "memory-head-revisions",
|
|
37768
|
-
up:
|
|
37786
|
+
up: up1382,
|
|
37769
37787
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
37770
37788
|
},
|
|
37771
37789
|
{
|
|
37772
37790
|
version: 137,
|
|
37773
37791
|
name: "dreaming-head-manifest",
|
|
37774
|
-
up:
|
|
37792
|
+
up: up1392,
|
|
37775
37793
|
artifacts: {
|
|
37776
37794
|
columns: [
|
|
37777
37795
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -37782,7 +37800,7 @@ var MIGRATIONS2 = [
|
|
|
37782
37800
|
{
|
|
37783
37801
|
version: 138,
|
|
37784
37802
|
name: "bounded-status-projections",
|
|
37785
|
-
up:
|
|
37803
|
+
up: up1402,
|
|
37786
37804
|
artifacts: {
|
|
37787
37805
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
37788
37806
|
}
|
|
@@ -37790,31 +37808,31 @@ var MIGRATIONS2 = [
|
|
|
37790
37808
|
{
|
|
37791
37809
|
version: 139,
|
|
37792
37810
|
name: "native-source-sync-state",
|
|
37793
|
-
up:
|
|
37811
|
+
up: up1412,
|
|
37794
37812
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
37795
37813
|
},
|
|
37796
37814
|
{
|
|
37797
37815
|
version: 140,
|
|
37798
37816
|
name: "transcript-recovery-frontier",
|
|
37799
|
-
up:
|
|
37817
|
+
up: up1422,
|
|
37800
37818
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
37801
37819
|
},
|
|
37802
37820
|
{
|
|
37803
37821
|
version: 141,
|
|
37804
37822
|
name: "source-sync-checkpoints",
|
|
37805
|
-
up:
|
|
37823
|
+
up: up1432,
|
|
37806
37824
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
37807
37825
|
},
|
|
37808
37826
|
{
|
|
37809
37827
|
version: 142,
|
|
37810
37828
|
name: "source-sync-frontier",
|
|
37811
|
-
up:
|
|
37829
|
+
up: up1442,
|
|
37812
37830
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
37813
37831
|
},
|
|
37814
37832
|
{
|
|
37815
37833
|
version: 143,
|
|
37816
37834
|
name: "embedding-index-progress",
|
|
37817
|
-
up:
|
|
37835
|
+
up: up1452,
|
|
37818
37836
|
artifacts: {
|
|
37819
37837
|
columns: [
|
|
37820
37838
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -37830,19 +37848,19 @@ var MIGRATIONS2 = [
|
|
|
37830
37848
|
{
|
|
37831
37849
|
version: 144,
|
|
37832
37850
|
name: "memory-job-lease-token",
|
|
37833
|
-
up:
|
|
37851
|
+
up: up1462,
|
|
37834
37852
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
37835
37853
|
},
|
|
37836
37854
|
{
|
|
37837
37855
|
version: 145,
|
|
37838
37856
|
name: "dreaming-evidence-reviews",
|
|
37839
|
-
up:
|
|
37857
|
+
up: up1472,
|
|
37840
37858
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
37841
37859
|
},
|
|
37842
37860
|
{
|
|
37843
37861
|
version: 146,
|
|
37844
37862
|
name: "source-transcript-import",
|
|
37845
|
-
up:
|
|
37863
|
+
up: up1482,
|
|
37846
37864
|
artifacts: {
|
|
37847
37865
|
tables: [
|
|
37848
37866
|
"source_import_jobs",
|
|
@@ -37861,19 +37879,19 @@ var MIGRATIONS2 = [
|
|
|
37861
37879
|
{
|
|
37862
37880
|
version: 147,
|
|
37863
37881
|
name: "source-import-replay-file-slots",
|
|
37864
|
-
up:
|
|
37882
|
+
up: up1492,
|
|
37865
37883
|
artifacts: { tables: ["source_import_files"] }
|
|
37866
37884
|
},
|
|
37867
37885
|
{
|
|
37868
37886
|
version: 148,
|
|
37869
37887
|
name: "source-import-attempt-provenance",
|
|
37870
|
-
up:
|
|
37888
|
+
up: up1502,
|
|
37871
37889
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
37872
37890
|
},
|
|
37873
37891
|
{
|
|
37874
37892
|
version: 149,
|
|
37875
37893
|
name: "transcript-import-state-machine",
|
|
37876
|
-
up:
|
|
37894
|
+
up: up1512,
|
|
37877
37895
|
artifacts: {
|
|
37878
37896
|
columns: [
|
|
37879
37897
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -37885,7 +37903,7 @@ var MIGRATIONS2 = [
|
|
|
37885
37903
|
{
|
|
37886
37904
|
version: 150,
|
|
37887
37905
|
name: "memory-head-freshness",
|
|
37888
|
-
up:
|
|
37906
|
+
up: up1522,
|
|
37889
37907
|
artifacts: {
|
|
37890
37908
|
columns: [
|
|
37891
37909
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -37896,7 +37914,7 @@ var MIGRATIONS2 = [
|
|
|
37896
37914
|
{
|
|
37897
37915
|
version: 151,
|
|
37898
37916
|
name: "transcript-import-bytes",
|
|
37899
|
-
up:
|
|
37917
|
+
up: up153,
|
|
37900
37918
|
artifacts: {
|
|
37901
37919
|
tables: [
|
|
37902
37920
|
"source_import_chunks",
|
|
@@ -37921,6 +37939,12 @@ var MIGRATIONS2 = [
|
|
|
37921
37939
|
}))
|
|
37922
37940
|
]
|
|
37923
37941
|
}
|
|
37942
|
+
},
|
|
37943
|
+
{
|
|
37944
|
+
version: 152,
|
|
37945
|
+
name: "memory-artifact-sha-index",
|
|
37946
|
+
up: up210,
|
|
37947
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
37924
37948
|
}
|
|
37925
37949
|
];
|
|
37926
37950
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|