@signetai/connector-kimi 0.221.9 → 0.221.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +630 -606
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -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;
|
|
@@ -29498,7 +29510,7 @@ var DAEMON_DERIVED_MEMORY_SOURCE_TYPES2 = [
|
|
|
29498
29510
|
"checkpoint",
|
|
29499
29511
|
"dreaming"
|
|
29500
29512
|
];
|
|
29501
|
-
function
|
|
29513
|
+
function up153(db) {
|
|
29502
29514
|
const hasColumn26 = (table, column) => {
|
|
29503
29515
|
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
29504
29516
|
try {
|
|
@@ -29558,6 +29570,12 @@ function up152(db) {
|
|
|
29558
29570
|
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
29559
29571
|
`);
|
|
29560
29572
|
}
|
|
29573
|
+
function up210(db) {
|
|
29574
|
+
db.exec(`
|
|
29575
|
+
DROP INDEX IF EXISTS idx_memory_artifacts_agent_sha;
|
|
29576
|
+
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)
|
|
29577
|
+
`);
|
|
29578
|
+
}
|
|
29561
29579
|
var MEMORIES_FTS_TOKENIZER2 = "unicode61";
|
|
29562
29580
|
var FTS_STATE_TABLE2 = "memories_fts_state";
|
|
29563
29581
|
function normalizeSql2(sql) {
|
|
@@ -29673,7 +29691,7 @@ function memoriesFtsNeedsTokenizerRepair2(sql) {
|
|
|
29673
29691
|
return true;
|
|
29674
29692
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER2}'`);
|
|
29675
29693
|
}
|
|
29676
|
-
function
|
|
29694
|
+
function up310(db) {
|
|
29677
29695
|
db.exec(`
|
|
29678
29696
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
29679
29697
|
version INTEGER PRIMARY KEY,
|
|
@@ -29771,7 +29789,7 @@ function addColumnIfMissing29(db, table, column, definition) {
|
|
|
29771
29789
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29772
29790
|
}
|
|
29773
29791
|
}
|
|
29774
|
-
function
|
|
29792
|
+
function up410(db) {
|
|
29775
29793
|
addColumnIfMissing29(db, "memories", "content_hash", "TEXT");
|
|
29776
29794
|
addColumnIfMissing29(db, "memories", "normalized_content", "TEXT");
|
|
29777
29795
|
addColumnIfMissing29(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -29889,7 +29907,7 @@ function addColumnIfMissing210(db, table, column, definition) {
|
|
|
29889
29907
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29890
29908
|
return true;
|
|
29891
29909
|
}
|
|
29892
|
-
function
|
|
29910
|
+
function up510(db) {
|
|
29893
29911
|
addColumnIfMissing210(db, "memories", "why", "TEXT");
|
|
29894
29912
|
addColumnIfMissing210(db, "memories", "project", "TEXT");
|
|
29895
29913
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -29926,7 +29944,7 @@ function addColumnIfMissing32(db, table, column, definition) {
|
|
|
29926
29944
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29927
29945
|
}
|
|
29928
29946
|
}
|
|
29929
|
-
function
|
|
29947
|
+
function up610(db) {
|
|
29930
29948
|
addColumnIfMissing32(db, "memory_history", "actor_type", "TEXT");
|
|
29931
29949
|
addColumnIfMissing32(db, "memory_history", "session_id", "TEXT");
|
|
29932
29950
|
addColumnIfMissing32(db, "memory_history", "request_id", "TEXT");
|
|
@@ -29959,7 +29977,7 @@ function addColumnIfMissing42(db, table, column, definition) {
|
|
|
29959
29977
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29960
29978
|
}
|
|
29961
29979
|
}
|
|
29962
|
-
function
|
|
29980
|
+
function up710(db) {
|
|
29963
29981
|
addColumnIfMissing42(db, "entities", "canonical_name", "TEXT");
|
|
29964
29982
|
addColumnIfMissing42(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
29965
29983
|
addColumnIfMissing42(db, "entities", "embedding", "BLOB");
|
|
@@ -29976,7 +29994,7 @@ function hasColumn42(db, table, column) {
|
|
|
29976
29994
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
29977
29995
|
return rows.some((r3) => r3.name === column);
|
|
29978
29996
|
}
|
|
29979
|
-
function
|
|
29997
|
+
function up810(db) {
|
|
29980
29998
|
if (!hasColumn42(db, "memories", "idempotency_key")) {
|
|
29981
29999
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
29982
30000
|
}
|
|
@@ -29991,7 +30009,7 @@ function hasColumn52(db, table, column) {
|
|
|
29991
30009
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
29992
30010
|
return rows.some((r3) => r3.name === column);
|
|
29993
30011
|
}
|
|
29994
|
-
function
|
|
30012
|
+
function up910(db) {
|
|
29995
30013
|
db.exec(`
|
|
29996
30014
|
CREATE TABLE IF NOT EXISTS documents (
|
|
29997
30015
|
id TEXT PRIMARY KEY,
|
|
@@ -30048,7 +30066,7 @@ function up810(db) {
|
|
|
30048
30066
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
30049
30067
|
}
|
|
30050
30068
|
}
|
|
30051
|
-
function
|
|
30069
|
+
function up1010(db) {
|
|
30052
30070
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
30053
30071
|
if (tables.length === 0)
|
|
30054
30072
|
return;
|
|
@@ -30065,7 +30083,7 @@ function up910(db) {
|
|
|
30065
30083
|
ON embeddings(content_hash)
|
|
30066
30084
|
`);
|
|
30067
30085
|
}
|
|
30068
|
-
function
|
|
30086
|
+
function up1110(db) {
|
|
30069
30087
|
db.exec(`
|
|
30070
30088
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
30071
30089
|
id TEXT PRIMARY KEY,
|
|
@@ -30085,7 +30103,7 @@ function up1010(db) {
|
|
|
30085
30103
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
30086
30104
|
ON summary_jobs(status)`);
|
|
30087
30105
|
}
|
|
30088
|
-
function
|
|
30106
|
+
function up1210(db) {
|
|
30089
30107
|
db.exec(`
|
|
30090
30108
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
30091
30109
|
id INTEGER PRIMARY KEY,
|
|
@@ -30096,7 +30114,7 @@ function up1110(db) {
|
|
|
30096
30114
|
)
|
|
30097
30115
|
`);
|
|
30098
30116
|
}
|
|
30099
|
-
function
|
|
30117
|
+
function up1310(db) {
|
|
30100
30118
|
db.exec(`
|
|
30101
30119
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
30102
30120
|
id TEXT PRIMARY KEY,
|
|
@@ -30116,7 +30134,7 @@ function up1210(db) {
|
|
|
30116
30134
|
ON session_scores(session_key);
|
|
30117
30135
|
`);
|
|
30118
30136
|
}
|
|
30119
|
-
function
|
|
30137
|
+
function up1410(db) {
|
|
30120
30138
|
db.exec(`
|
|
30121
30139
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
30122
30140
|
id TEXT PRIMARY KEY,
|
|
@@ -30157,7 +30175,7 @@ function addColumnIfMissing52(db, table, column, definition) {
|
|
|
30157
30175
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30158
30176
|
}
|
|
30159
30177
|
}
|
|
30160
|
-
function
|
|
30178
|
+
function up154(db) {
|
|
30161
30179
|
db.exec(`
|
|
30162
30180
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
30163
30181
|
id TEXT PRIMARY KEY,
|
|
@@ -30183,7 +30201,7 @@ function up1410(db) {
|
|
|
30183
30201
|
addColumnIfMissing52(db, "memories", "source_path", "TEXT");
|
|
30184
30202
|
addColumnIfMissing52(db, "memories", "source_section", "TEXT");
|
|
30185
30203
|
}
|
|
30186
|
-
function
|
|
30204
|
+
function up162(db) {
|
|
30187
30205
|
db.exec(`
|
|
30188
30206
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
30189
30207
|
id TEXT PRIMARY KEY,
|
|
@@ -30208,7 +30226,7 @@ function addColumnIfMissing62(db, table, column, definition) {
|
|
|
30208
30226
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30209
30227
|
}
|
|
30210
30228
|
}
|
|
30211
|
-
function
|
|
30229
|
+
function up172(db) {
|
|
30212
30230
|
db.exec(`
|
|
30213
30231
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
30214
30232
|
id TEXT PRIMARY KEY,
|
|
@@ -30235,7 +30253,7 @@ function up162(db) {
|
|
|
30235
30253
|
addColumnIfMissing62(db, "session_scores", "confidence", "REAL");
|
|
30236
30254
|
addColumnIfMissing62(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
30237
30255
|
}
|
|
30238
|
-
function
|
|
30256
|
+
function up182(db) {
|
|
30239
30257
|
db.exec(`
|
|
30240
30258
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
30241
30259
|
id TEXT PRIMARY KEY,
|
|
@@ -30257,7 +30275,7 @@ function up172(db) {
|
|
|
30257
30275
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
30258
30276
|
`);
|
|
30259
30277
|
}
|
|
30260
|
-
function
|
|
30278
|
+
function up192(db) {
|
|
30261
30279
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
30262
30280
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
30263
30281
|
if (!colNames.has("skill_name")) {
|
|
@@ -30268,7 +30286,7 @@ function up182(db) {
|
|
|
30268
30286
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
30269
30287
|
}
|
|
30270
30288
|
}
|
|
30271
|
-
function
|
|
30289
|
+
function up202(db) {
|
|
30272
30290
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
30273
30291
|
if (existing)
|
|
30274
30292
|
return;
|
|
@@ -30300,7 +30318,7 @@ function up192(db) {
|
|
|
30300
30318
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
30301
30319
|
`);
|
|
30302
30320
|
}
|
|
30303
|
-
function
|
|
30321
|
+
function up212(db) {
|
|
30304
30322
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
30305
30323
|
const entityColNames = new Set(entityCols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
30306
30324
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -30385,13 +30403,13 @@ function addColumnIfMissing72(db, table, column, definition) {
|
|
|
30385
30403
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30386
30404
|
}
|
|
30387
30405
|
}
|
|
30388
|
-
function
|
|
30406
|
+
function up222(db) {
|
|
30389
30407
|
addColumnIfMissing72(db, "session_memories", "entity_slot", "INTEGER");
|
|
30390
30408
|
addColumnIfMissing72(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30391
30409
|
addColumnIfMissing72(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
30392
30410
|
addColumnIfMissing72(db, "session_memories", "structural_density", "INTEGER");
|
|
30393
30411
|
}
|
|
30394
|
-
function
|
|
30412
|
+
function up232(db) {
|
|
30395
30413
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
30396
30414
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
30397
30415
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -30416,25 +30434,25 @@ function addColumnIfMissing82(db, table, column, definition) {
|
|
|
30416
30434
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30417
30435
|
}
|
|
30418
30436
|
}
|
|
30419
|
-
function
|
|
30437
|
+
function up242(db) {
|
|
30420
30438
|
addColumnIfMissing82(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
30421
30439
|
addColumnIfMissing82(db, "entities", "pinned_at", "TEXT");
|
|
30422
30440
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
30423
30441
|
}
|
|
30424
|
-
function up242(_db) {}
|
|
30425
30442
|
function up252(_db) {}
|
|
30443
|
+
function up262(_db) {}
|
|
30426
30444
|
function addColumnIfMissing92(db, table, column, definition) {
|
|
30427
30445
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
30428
30446
|
if (!cols.some((c3) => c3.name === column)) {
|
|
30429
30447
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30430
30448
|
}
|
|
30431
30449
|
}
|
|
30432
|
-
function
|
|
30450
|
+
function up272(db) {
|
|
30433
30451
|
addColumnIfMissing92(db, "session_memories", "agent_relevance_score", "REAL");
|
|
30434
30452
|
addColumnIfMissing92(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
30435
30453
|
}
|
|
30436
|
-
function
|
|
30437
|
-
function
|
|
30454
|
+
function up282(_db) {}
|
|
30455
|
+
function up292(db) {
|
|
30438
30456
|
db.exec(`
|
|
30439
30457
|
UPDATE entities
|
|
30440
30458
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -30443,7 +30461,7 @@ function up282(db) {
|
|
|
30443
30461
|
WHERE canonical_name IS NULL
|
|
30444
30462
|
`);
|
|
30445
30463
|
}
|
|
30446
|
-
function
|
|
30464
|
+
function up302(db) {
|
|
30447
30465
|
db.exec(`
|
|
30448
30466
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
30449
30467
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -30480,7 +30498,7 @@ function up292(db) {
|
|
|
30480
30498
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
30481
30499
|
`);
|
|
30482
30500
|
}
|
|
30483
|
-
function
|
|
30501
|
+
function up312(db) {
|
|
30484
30502
|
db.exec(`
|
|
30485
30503
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
30486
30504
|
id TEXT PRIMARY KEY,
|
|
@@ -30525,7 +30543,7 @@ function up302(db) {
|
|
|
30525
30543
|
WHERE session_key IS NOT NULL;
|
|
30526
30544
|
`);
|
|
30527
30545
|
}
|
|
30528
|
-
function
|
|
30546
|
+
function up322(db) {
|
|
30529
30547
|
db.exec(`
|
|
30530
30548
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
30531
30549
|
id TEXT PRIMARY KEY,
|
|
@@ -30570,7 +30588,7 @@ function up312(db) {
|
|
|
30570
30588
|
ON memory_jobs(failed_at);
|
|
30571
30589
|
`);
|
|
30572
30590
|
}
|
|
30573
|
-
function
|
|
30591
|
+
function up332(db) {
|
|
30574
30592
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30575
30593
|
if (!depCols.some((c3) => c3.name === "reason")) {
|
|
30576
30594
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -30580,7 +30598,7 @@ function up322(db) {
|
|
|
30580
30598
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
30581
30599
|
}
|
|
30582
30600
|
}
|
|
30583
|
-
function
|
|
30601
|
+
function up342(db) {
|
|
30584
30602
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
30585
30603
|
if (cols.length === 0)
|
|
30586
30604
|
return;
|
|
@@ -30588,14 +30606,14 @@ function up332(db) {
|
|
|
30588
30606
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
30589
30607
|
}
|
|
30590
30608
|
}
|
|
30591
|
-
function
|
|
30609
|
+
function up352(db) {
|
|
30592
30610
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
30593
30611
|
if (!cols.some((c3) => c3.name === "scope")) {
|
|
30594
30612
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
30595
30613
|
}
|
|
30596
30614
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
30597
30615
|
}
|
|
30598
|
-
function
|
|
30616
|
+
function up362(db) {
|
|
30599
30617
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
30600
30618
|
db.exec(`
|
|
30601
30619
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -30603,7 +30621,7 @@ function up352(db) {
|
|
|
30603
30621
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
30604
30622
|
`);
|
|
30605
30623
|
}
|
|
30606
|
-
function
|
|
30624
|
+
function up372(db) {
|
|
30607
30625
|
db.exec(`
|
|
30608
30626
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
30609
30627
|
name, canonical_name,
|
|
@@ -30635,13 +30653,13 @@ function up362(db) {
|
|
|
30635
30653
|
END
|
|
30636
30654
|
`);
|
|
30637
30655
|
}
|
|
30638
|
-
function
|
|
30656
|
+
function up382(db) {
|
|
30639
30657
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
30640
30658
|
if (!cols.some((c3) => c3.name === "confidence")) {
|
|
30641
30659
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
30642
30660
|
}
|
|
30643
30661
|
}
|
|
30644
|
-
function
|
|
30662
|
+
function up392(db) {
|
|
30645
30663
|
db.exec(`
|
|
30646
30664
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
30647
30665
|
id TEXT PRIMARY KEY,
|
|
@@ -30659,7 +30677,7 @@ function up382(db) {
|
|
|
30659
30677
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
30660
30678
|
}
|
|
30661
30679
|
}
|
|
30662
|
-
function
|
|
30680
|
+
function up402(db) {
|
|
30663
30681
|
db.exec(`
|
|
30664
30682
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
30665
30683
|
id TEXT PRIMARY KEY,
|
|
@@ -30699,7 +30717,7 @@ function up392(db) {
|
|
|
30699
30717
|
END
|
|
30700
30718
|
`);
|
|
30701
30719
|
}
|
|
30702
|
-
function
|
|
30720
|
+
function up412(db) {
|
|
30703
30721
|
db.exec(`
|
|
30704
30722
|
DELETE FROM entity_dependencies
|
|
30705
30723
|
WHERE id NOT IN (
|
|
@@ -30717,7 +30735,7 @@ function up402(db) {
|
|
|
30717
30735
|
)
|
|
30718
30736
|
`);
|
|
30719
30737
|
}
|
|
30720
|
-
function
|
|
30738
|
+
function up422(db) {
|
|
30721
30739
|
db.exec(`
|
|
30722
30740
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
30723
30741
|
session_key TEXT PRIMARY KEY,
|
|
@@ -30740,7 +30758,7 @@ function addColumnIfMissing102(db, table, column, definition) {
|
|
|
30740
30758
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30741
30759
|
}
|
|
30742
30760
|
}
|
|
30743
|
-
function
|
|
30761
|
+
function up432(db) {
|
|
30744
30762
|
addColumnIfMissing102(db, "session_memories", "path_json", "TEXT");
|
|
30745
30763
|
db.exec(`
|
|
30746
30764
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -30815,7 +30833,7 @@ function addColumnIfMissing112(db, table, column, definition) {
|
|
|
30815
30833
|
return;
|
|
30816
30834
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30817
30835
|
}
|
|
30818
|
-
function
|
|
30836
|
+
function up442(db) {
|
|
30819
30837
|
addColumnIfMissing112(db, "session_memories", "entity_slot", "INTEGER");
|
|
30820
30838
|
addColumnIfMissing112(db, "session_memories", "aspect_slot", "INTEGER");
|
|
30821
30839
|
addColumnIfMissing112(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -30903,7 +30921,7 @@ function addColumnIfMissing122(db, table, column, definition) {
|
|
|
30903
30921
|
return;
|
|
30904
30922
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30905
30923
|
}
|
|
30906
|
-
function
|
|
30924
|
+
function up452(db) {
|
|
30907
30925
|
db.exec(`
|
|
30908
30926
|
CREATE TABLE IF NOT EXISTS agents (
|
|
30909
30927
|
id TEXT PRIMARY KEY,
|
|
@@ -30932,7 +30950,7 @@ function addColumnIfMissing132(db, table, column, definition) {
|
|
|
30932
30950
|
return;
|
|
30933
30951
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30934
30952
|
}
|
|
30935
|
-
function
|
|
30953
|
+
function up462(db) {
|
|
30936
30954
|
addColumnIfMissing132(db, "session_summaries", "source_type", "TEXT");
|
|
30937
30955
|
addColumnIfMissing132(db, "session_summaries", "source_ref", "TEXT");
|
|
30938
30956
|
addColumnIfMissing132(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -30958,7 +30976,7 @@ function addColumnIfMissing142(db, table, column, definition) {
|
|
|
30958
30976
|
return;
|
|
30959
30977
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30960
30978
|
}
|
|
30961
|
-
function
|
|
30979
|
+
function up472(db) {
|
|
30962
30980
|
addColumnIfMissing142(db, "session_transcripts", "updated_at", "TEXT");
|
|
30963
30981
|
addColumnIfMissing142(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
30964
30982
|
addColumnIfMissing142(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -31029,7 +31047,7 @@ function up462(db) {
|
|
|
31029
31047
|
ON memory_md_heads(lease_expires_at);
|
|
31030
31048
|
`);
|
|
31031
31049
|
}
|
|
31032
|
-
function
|
|
31050
|
+
function up482(db) {
|
|
31033
31051
|
db.exec(`
|
|
31034
31052
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
31035
31053
|
|
|
@@ -31090,7 +31108,7 @@ function up472(db) {
|
|
|
31090
31108
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31091
31109
|
`);
|
|
31092
31110
|
}
|
|
31093
|
-
function
|
|
31111
|
+
function up492(db) {
|
|
31094
31112
|
db.exec(`
|
|
31095
31113
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
31096
31114
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -31188,7 +31206,7 @@ function up482(db) {
|
|
|
31188
31206
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
31189
31207
|
`);
|
|
31190
31208
|
}
|
|
31191
|
-
function
|
|
31209
|
+
function up502(db) {
|
|
31192
31210
|
db.exec(`
|
|
31193
31211
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
31194
31212
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -31306,7 +31324,7 @@ function up492(db) {
|
|
|
31306
31324
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
31307
31325
|
`);
|
|
31308
31326
|
}
|
|
31309
|
-
function
|
|
31327
|
+
function up512(db) {
|
|
31310
31328
|
db.exec(`
|
|
31311
31329
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
31312
31330
|
session_key TEXT NOT NULL,
|
|
@@ -31323,7 +31341,7 @@ function hasTable5(db, name) {
|
|
|
31323
31341
|
WHERE type = 'table' AND name = ?
|
|
31324
31342
|
LIMIT 1`).get(name) !== undefined;
|
|
31325
31343
|
}
|
|
31326
|
-
function
|
|
31344
|
+
function up522(db) {
|
|
31327
31345
|
db.exec(`
|
|
31328
31346
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
31329
31347
|
id TEXT PRIMARY KEY,
|
|
@@ -31493,7 +31511,7 @@ function addColumnIfMissing152(db, table, column, definition) {
|
|
|
31493
31511
|
return;
|
|
31494
31512
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31495
31513
|
}
|
|
31496
|
-
function
|
|
31514
|
+
function up532(db) {
|
|
31497
31515
|
addColumnIfMissing152(db, "summary_jobs", "session_id", "TEXT");
|
|
31498
31516
|
addColumnIfMissing152(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
31499
31517
|
addColumnIfMissing152(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -31585,7 +31603,7 @@ function up522(db) {
|
|
|
31585
31603
|
VALUES ('rebuild');
|
|
31586
31604
|
`);
|
|
31587
31605
|
}
|
|
31588
|
-
function
|
|
31606
|
+
function up542(db) {
|
|
31589
31607
|
db.exec(`
|
|
31590
31608
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
31591
31609
|
id TEXT PRIMARY KEY,
|
|
@@ -31602,7 +31620,7 @@ function up532(db) {
|
|
|
31602
31620
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
31603
31621
|
`);
|
|
31604
31622
|
}
|
|
31605
|
-
function
|
|
31623
|
+
function up552(db) {
|
|
31606
31624
|
db.exec(`
|
|
31607
31625
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
31608
31626
|
id TEXT PRIMARY KEY,
|
|
@@ -31618,7 +31636,7 @@ function up542(db) {
|
|
|
31618
31636
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
31619
31637
|
`);
|
|
31620
31638
|
}
|
|
31621
|
-
function
|
|
31639
|
+
function up562(db) {
|
|
31622
31640
|
db.exec(`
|
|
31623
31641
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
31624
31642
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -31649,7 +31667,7 @@ function up552(db) {
|
|
|
31649
31667
|
ON task_scope_hints(agent_id, updated_at);
|
|
31650
31668
|
`);
|
|
31651
31669
|
}
|
|
31652
|
-
function
|
|
31670
|
+
function up572(db) {
|
|
31653
31671
|
db.exec(`
|
|
31654
31672
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
31655
31673
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -31692,7 +31710,7 @@ function ensureMemoriesScopeColumns3(db) {
|
|
|
31692
31710
|
if (!names.has("scope"))
|
|
31693
31711
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
31694
31712
|
}
|
|
31695
|
-
function
|
|
31713
|
+
function up582(db) {
|
|
31696
31714
|
ensureMemoriesScopeColumns3(db);
|
|
31697
31715
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
31698
31716
|
db.exec(`
|
|
@@ -31705,20 +31723,20 @@ function up572(db) {
|
|
|
31705
31723
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
31706
31724
|
`);
|
|
31707
31725
|
}
|
|
31708
|
-
function
|
|
31726
|
+
function up592(db) {
|
|
31709
31727
|
const sql = readMemoriesFtsSql2(db);
|
|
31710
31728
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair2(sql))
|
|
31711
31729
|
return;
|
|
31712
31730
|
recreateMemoriesFts2(db);
|
|
31713
31731
|
}
|
|
31714
|
-
function
|
|
31732
|
+
function up602(db) {
|
|
31715
31733
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
31716
31734
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
31717
31735
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
31718
31736
|
ON entities(entity_type, mentions)
|
|
31719
31737
|
WHERE entity_type = 'extracted'`);
|
|
31720
31738
|
}
|
|
31721
|
-
function
|
|
31739
|
+
function up612(db) {
|
|
31722
31740
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
31723
31741
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
31724
31742
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -31727,7 +31745,7 @@ function up602(db) {
|
|
|
31727
31745
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
31728
31746
|
WHERE claim_key IS NOT NULL`);
|
|
31729
31747
|
}
|
|
31730
|
-
function
|
|
31748
|
+
function up622(db) {
|
|
31731
31749
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
31732
31750
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
31733
31751
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -31739,13 +31757,13 @@ function up612(db) {
|
|
|
31739
31757
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
31740
31758
|
WHERE claim_key IS NOT NULL`);
|
|
31741
31759
|
}
|
|
31742
|
-
function
|
|
31760
|
+
function up632(db) {
|
|
31743
31761
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
31744
31762
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
31745
31763
|
return;
|
|
31746
31764
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
31747
31765
|
}
|
|
31748
|
-
function
|
|
31766
|
+
function up642(db) {
|
|
31749
31767
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
31750
31768
|
const names = new Set(cols.map((col) => col.name));
|
|
31751
31769
|
if (!names.has("is_deleted")) {
|
|
@@ -31759,7 +31777,7 @@ function up632(db) {
|
|
|
31759
31777
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
31760
31778
|
`);
|
|
31761
31779
|
}
|
|
31762
|
-
function
|
|
31780
|
+
function up652(db) {
|
|
31763
31781
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
31764
31782
|
db.exec(`
|
|
31765
31783
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -31777,7 +31795,7 @@ function addColumnIfMissing162(db, table, column, definition) {
|
|
|
31777
31795
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31778
31796
|
}
|
|
31779
31797
|
}
|
|
31780
|
-
function
|
|
31798
|
+
function up662(db) {
|
|
31781
31799
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
31782
31800
|
addColumnIfMissing162(db, table, "source_id", "TEXT");
|
|
31783
31801
|
addColumnIfMissing162(db, table, "source_kind", "TEXT");
|
|
@@ -31797,7 +31815,7 @@ function hasColumn72(db, table, column) {
|
|
|
31797
31815
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
31798
31816
|
return rows.some((row) => row.name === column);
|
|
31799
31817
|
}
|
|
31800
|
-
function
|
|
31818
|
+
function up672(db) {
|
|
31801
31819
|
if (!hasTable22(db, "embeddings"))
|
|
31802
31820
|
return;
|
|
31803
31821
|
if (!hasColumn72(db, "embeddings", "agent_id")) {
|
|
@@ -31805,7 +31823,7 @@ function up662(db) {
|
|
|
31805
31823
|
}
|
|
31806
31824
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
31807
31825
|
}
|
|
31808
|
-
function
|
|
31826
|
+
function up682(db) {
|
|
31809
31827
|
db.exec(`
|
|
31810
31828
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
31811
31829
|
id TEXT PRIMARY KEY,
|
|
@@ -31846,7 +31864,7 @@ function addColumnIfMissing172(db, table, column, definition) {
|
|
|
31846
31864
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
31847
31865
|
}
|
|
31848
31866
|
}
|
|
31849
|
-
function
|
|
31867
|
+
function up692(db) {
|
|
31850
31868
|
db.exec(`
|
|
31851
31869
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
31852
31870
|
id TEXT PRIMARY KEY,
|
|
@@ -31889,7 +31907,7 @@ function up682(db) {
|
|
|
31889
31907
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
31890
31908
|
}
|
|
31891
31909
|
}
|
|
31892
|
-
function
|
|
31910
|
+
function up702(db) {
|
|
31893
31911
|
db.exec(`
|
|
31894
31912
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
31895
31913
|
id TEXT PRIMARY KEY,
|
|
@@ -31916,7 +31934,7 @@ function up692(db) {
|
|
|
31916
31934
|
WHERE content_key IS NOT NULL;
|
|
31917
31935
|
`);
|
|
31918
31936
|
}
|
|
31919
|
-
function
|
|
31937
|
+
function up712(db) {
|
|
31920
31938
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
31921
31939
|
const colNames = new Set(cols.flatMap((c3) => typeof c3.name === "string" ? [c3.name] : []));
|
|
31922
31940
|
if (!colNames.has("content_key")) {
|
|
@@ -31953,7 +31971,7 @@ function backfillVersionRoots2(db) {
|
|
|
31953
31971
|
WHERE version_root_id IS NULL
|
|
31954
31972
|
`);
|
|
31955
31973
|
}
|
|
31956
|
-
function
|
|
31974
|
+
function up722(db) {
|
|
31957
31975
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
31958
31976
|
addColumnIfMissing182(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
31959
31977
|
addColumnIfMissing182(db, table, "archived_at", "TEXT");
|
|
@@ -31988,7 +32006,7 @@ function up712(db) {
|
|
|
31988
32006
|
ON entity_aspects(agent_id, proposal_id);
|
|
31989
32007
|
`);
|
|
31990
32008
|
}
|
|
31991
|
-
function
|
|
32009
|
+
function up732(db) {
|
|
31992
32010
|
db.exec(`
|
|
31993
32011
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
31994
32012
|
id TEXT PRIMARY KEY,
|
|
@@ -32044,7 +32062,7 @@ function ensureMemoriesScopeColumns22(db) {
|
|
|
32044
32062
|
if (!names.has("runtime_path"))
|
|
32045
32063
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
32046
32064
|
}
|
|
32047
|
-
function
|
|
32065
|
+
function up742(db) {
|
|
32048
32066
|
ensureMemoriesScopeColumns22(db);
|
|
32049
32067
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
32050
32068
|
db.exec(`
|
|
@@ -32058,7 +32076,7 @@ function up732(db) {
|
|
|
32058
32076
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
32059
32077
|
`);
|
|
32060
32078
|
}
|
|
32061
|
-
function
|
|
32079
|
+
function up752(db) {
|
|
32062
32080
|
db.exec(`
|
|
32063
32081
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
32064
32082
|
session_key TEXT NOT NULL,
|
|
@@ -32093,7 +32111,7 @@ function up742(db) {
|
|
|
32093
32111
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
32094
32112
|
`);
|
|
32095
32113
|
}
|
|
32096
|
-
function
|
|
32114
|
+
function up762(db) {
|
|
32097
32115
|
db.exec(`
|
|
32098
32116
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
32099
32117
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32112,7 +32130,7 @@ function addColumnIfMissing192(db, table, column, definition) {
|
|
|
32112
32130
|
return;
|
|
32113
32131
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32114
32132
|
}
|
|
32115
|
-
function
|
|
32133
|
+
function up772(db) {
|
|
32116
32134
|
addColumnIfMissing192(db, "memory_artifacts", "source_id", "TEXT");
|
|
32117
32135
|
addColumnIfMissing192(db, "memory_artifacts", "source_root", "TEXT");
|
|
32118
32136
|
addColumnIfMissing192(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -32125,7 +32143,7 @@ function up762(db) {
|
|
|
32125
32143
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
32126
32144
|
`);
|
|
32127
32145
|
}
|
|
32128
|
-
function
|
|
32146
|
+
function up782(db) {
|
|
32129
32147
|
db.exec(`
|
|
32130
32148
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
32131
32149
|
id TEXT PRIMARY KEY,
|
|
@@ -32148,7 +32166,7 @@ function up772(db) {
|
|
|
32148
32166
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
32149
32167
|
`);
|
|
32150
32168
|
}
|
|
32151
|
-
function
|
|
32169
|
+
function up792(db) {
|
|
32152
32170
|
db.exec(`
|
|
32153
32171
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
32154
32172
|
id TEXT PRIMARY KEY,
|
|
@@ -32172,7 +32190,7 @@ function up782(db) {
|
|
|
32172
32190
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
32173
32191
|
`);
|
|
32174
32192
|
}
|
|
32175
|
-
function
|
|
32193
|
+
function up802(db) {
|
|
32176
32194
|
db.exec(`
|
|
32177
32195
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
32178
32196
|
id TEXT PRIMARY KEY,
|
|
@@ -32200,7 +32218,7 @@ function up792(db) {
|
|
|
32200
32218
|
ON api_keys(connector, harness);
|
|
32201
32219
|
`);
|
|
32202
32220
|
}
|
|
32203
|
-
function
|
|
32221
|
+
function up812(db) {
|
|
32204
32222
|
db.exec(`
|
|
32205
32223
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
32206
32224
|
id TEXT PRIMARY KEY,
|
|
@@ -32235,7 +32253,7 @@ function hasColumn102(db, table, column) {
|
|
|
32235
32253
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32236
32254
|
return rows.some((row) => row.name === column);
|
|
32237
32255
|
}
|
|
32238
|
-
function
|
|
32256
|
+
function up822(db) {
|
|
32239
32257
|
if (!hasColumn102(db, "documents", "agent_id")) {
|
|
32240
32258
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
32241
32259
|
}
|
|
@@ -32321,7 +32339,7 @@ function up812(db) {
|
|
|
32321
32339
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
32322
32340
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
32323
32341
|
}
|
|
32324
|
-
function
|
|
32342
|
+
function up832(db) {
|
|
32325
32343
|
db.exec(`
|
|
32326
32344
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
32327
32345
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -32343,7 +32361,7 @@ function hasColumn112(db, table, column) {
|
|
|
32343
32361
|
return rows.some((row) => row.name === column);
|
|
32344
32362
|
}
|
|
32345
32363
|
var COLUMNS3 = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
|
|
32346
|
-
function
|
|
32364
|
+
function up842(db) {
|
|
32347
32365
|
for (const column of COLUMNS3) {
|
|
32348
32366
|
if (!hasColumn112(db, "skill_invocations", column)) {
|
|
32349
32367
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -32424,7 +32442,7 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32424
32442
|
`);
|
|
32425
32443
|
}
|
|
32426
32444
|
try {
|
|
32427
|
-
|
|
32445
|
+
up822(db);
|
|
32428
32446
|
if (preserveAgentId) {
|
|
32429
32447
|
db.exec(`
|
|
32430
32448
|
UPDATE documents
|
|
@@ -32444,12 +32462,12 @@ function documentScopeColumnsPreservingExisting2(db) {
|
|
|
32444
32462
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
32445
32463
|
}
|
|
32446
32464
|
}
|
|
32447
|
-
function
|
|
32448
|
-
|
|
32465
|
+
function up852(db) {
|
|
32466
|
+
up812(db);
|
|
32449
32467
|
if (hasTable32(db, "documents")) {
|
|
32450
32468
|
documentScopeColumnsPreservingExisting2(db);
|
|
32451
32469
|
}
|
|
32452
|
-
|
|
32470
|
+
up832(db);
|
|
32453
32471
|
addColumnIfMissing202(db, "memories", "superseded_by", "TEXT");
|
|
32454
32472
|
addColumnIfMissing202(db, "memories", "superseded_at", "TEXT");
|
|
32455
32473
|
addColumnIfMissing202(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -32506,7 +32524,7 @@ function up842(db) {
|
|
|
32506
32524
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
32507
32525
|
`);
|
|
32508
32526
|
}
|
|
32509
|
-
function
|
|
32527
|
+
function up862(db) {
|
|
32510
32528
|
db.exec(`
|
|
32511
32529
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
32512
32530
|
path TEXT PRIMARY KEY,
|
|
@@ -32536,7 +32554,7 @@ function up852(db) {
|
|
|
32536
32554
|
ON legacy_markdown_chunks(memory_id);
|
|
32537
32555
|
`);
|
|
32538
32556
|
}
|
|
32539
|
-
function
|
|
32557
|
+
function up872(db) {
|
|
32540
32558
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
32541
32559
|
const tableNames = new Set(tables.map((r3) => String(r3.name)));
|
|
32542
32560
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -32595,7 +32613,7 @@ function addColumnIfMissing212(db, table, column, definition) {
|
|
|
32595
32613
|
return;
|
|
32596
32614
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32597
32615
|
}
|
|
32598
|
-
function
|
|
32616
|
+
function up882(db) {
|
|
32599
32617
|
addColumnIfMissing212(db, "summary_jobs", "content_hash", "TEXT");
|
|
32600
32618
|
db.exec(`
|
|
32601
32619
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -32608,14 +32626,14 @@ function addColumnIfMissing222(db, table, column, definition) {
|
|
|
32608
32626
|
return;
|
|
32609
32627
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
32610
32628
|
}
|
|
32611
|
-
function
|
|
32629
|
+
function up892(db) {
|
|
32612
32630
|
addColumnIfMissing222(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
32613
32631
|
db.exec(`
|
|
32614
32632
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
32615
32633
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
32616
32634
|
`);
|
|
32617
32635
|
}
|
|
32618
|
-
function
|
|
32636
|
+
function up902(db) {
|
|
32619
32637
|
db.exec(`
|
|
32620
32638
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
32621
32639
|
agent_id TEXT NOT NULL,
|
|
@@ -32633,7 +32651,7 @@ function up892(db) {
|
|
|
32633
32651
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
32634
32652
|
`);
|
|
32635
32653
|
}
|
|
32636
|
-
function
|
|
32654
|
+
function up912(db) {
|
|
32637
32655
|
db.exec(`
|
|
32638
32656
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
32639
32657
|
id TEXT PRIMARY KEY,
|
|
@@ -32661,7 +32679,7 @@ function indexExists3(db, table, indexName) {
|
|
|
32661
32679
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32662
32680
|
return rows.some((row) => row.name === indexName);
|
|
32663
32681
|
}
|
|
32664
|
-
function
|
|
32682
|
+
function up922(db) {
|
|
32665
32683
|
db.exec(`
|
|
32666
32684
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
32667
32685
|
id TEXT PRIMARY KEY,
|
|
@@ -32688,7 +32706,7 @@ function indexExists22(db, table, indexName) {
|
|
|
32688
32706
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
32689
32707
|
return rows.some((row) => row.name === indexName);
|
|
32690
32708
|
}
|
|
32691
|
-
function
|
|
32709
|
+
function up932(db) {
|
|
32692
32710
|
db.exec(`
|
|
32693
32711
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
32694
32712
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -32701,7 +32719,7 @@ function up922(db) {
|
|
|
32701
32719
|
)
|
|
32702
32720
|
`);
|
|
32703
32721
|
}
|
|
32704
|
-
function
|
|
32722
|
+
function up942(db) {
|
|
32705
32723
|
db.exec(`
|
|
32706
32724
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
32707
32725
|
id TEXT PRIMARY KEY,
|
|
@@ -32720,7 +32738,7 @@ function up932(db) {
|
|
|
32720
32738
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
32721
32739
|
`);
|
|
32722
32740
|
}
|
|
32723
|
-
function
|
|
32741
|
+
function up952(db) {
|
|
32724
32742
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
32725
32743
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
32726
32744
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -32731,7 +32749,7 @@ function hasColumn132(db, table, column) {
|
|
|
32731
32749
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
32732
32750
|
return rows.some((r3) => r3.name === column);
|
|
32733
32751
|
}
|
|
32734
|
-
function
|
|
32752
|
+
function up962(db) {
|
|
32735
32753
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
32736
32754
|
if (tables.length === 0)
|
|
32737
32755
|
return;
|
|
@@ -32756,23 +32774,23 @@ function up952(db) {
|
|
|
32756
32774
|
function hasColumn142(db, table, column) {
|
|
32757
32775
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32758
32776
|
}
|
|
32759
|
-
function
|
|
32777
|
+
function up972(db) {
|
|
32760
32778
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
32761
32779
|
if (!hasMemories || !hasColumn142(db, "memories", "memory_kind") || !hasColumn142(db, "memories", "type"))
|
|
32762
32780
|
return;
|
|
32763
32781
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
32764
32782
|
}
|
|
32765
|
-
function
|
|
32783
|
+
function up982(db) {
|
|
32766
32784
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
32767
32785
|
}
|
|
32768
|
-
function
|
|
32786
|
+
function up992(db) {
|
|
32769
32787
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
32770
32788
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
32771
32789
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
32772
32790
|
}
|
|
32773
32791
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
32774
32792
|
}
|
|
32775
|
-
function
|
|
32793
|
+
function up1002(db) {
|
|
32776
32794
|
db.exec(`
|
|
32777
32795
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
32778
32796
|
agent_id TEXT NOT NULL,
|
|
@@ -32789,7 +32807,7 @@ function up992(db) {
|
|
|
32789
32807
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
32790
32808
|
`);
|
|
32791
32809
|
}
|
|
32792
|
-
function
|
|
32810
|
+
function up1012(db) {
|
|
32793
32811
|
db.exec(`
|
|
32794
32812
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
32795
32813
|
id TEXT PRIMARY KEY,
|
|
@@ -32809,7 +32827,7 @@ function up1002(db) {
|
|
|
32809
32827
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
32810
32828
|
`);
|
|
32811
32829
|
}
|
|
32812
|
-
function
|
|
32830
|
+
function up1022(db) {
|
|
32813
32831
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
32814
32832
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
32815
32833
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -32818,7 +32836,7 @@ function up1012(db) {
|
|
|
32818
32836
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
32819
32837
|
}
|
|
32820
32838
|
}
|
|
32821
|
-
function
|
|
32839
|
+
function up1032(db) {
|
|
32822
32840
|
db.exec(`
|
|
32823
32841
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
32824
32842
|
id TEXT PRIMARY KEY,
|
|
@@ -32840,7 +32858,7 @@ function up1022(db) {
|
|
|
32840
32858
|
function hasColumn152(db, table, column) {
|
|
32841
32859
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32842
32860
|
}
|
|
32843
|
-
function
|
|
32861
|
+
function up1042(db) {
|
|
32844
32862
|
const requiredMemoryColumns = [
|
|
32845
32863
|
"content_hash",
|
|
32846
32864
|
"normalized_content",
|
|
@@ -32891,7 +32909,7 @@ function up1032(db) {
|
|
|
32891
32909
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
32892
32910
|
`);
|
|
32893
32911
|
}
|
|
32894
|
-
function
|
|
32912
|
+
function up1052(db) {
|
|
32895
32913
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
32896
32914
|
if (tables.length !== 2)
|
|
32897
32915
|
return;
|
|
@@ -32914,7 +32932,7 @@ function tableExists4(db, table) {
|
|
|
32914
32932
|
function hasColumn162(db, table, column) {
|
|
32915
32933
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
32916
32934
|
}
|
|
32917
|
-
function
|
|
32935
|
+
function up1062(db) {
|
|
32918
32936
|
db.exec(`
|
|
32919
32937
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
32920
32938
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -32957,7 +32975,7 @@ function up1052(db) {
|
|
|
32957
32975
|
`);
|
|
32958
32976
|
}
|
|
32959
32977
|
}
|
|
32960
|
-
function
|
|
32978
|
+
function up1072(db) {
|
|
32961
32979
|
db.exec(`
|
|
32962
32980
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
32963
32981
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -33046,7 +33064,7 @@ function up1062(db) {
|
|
|
33046
33064
|
function hasColumn172(db, table, column) {
|
|
33047
33065
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33048
33066
|
}
|
|
33049
|
-
function
|
|
33067
|
+
function up1082(db) {
|
|
33050
33068
|
if (!hasColumn172(db, "memories", "review_after")) {
|
|
33051
33069
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
33052
33070
|
}
|
|
@@ -33062,14 +33080,14 @@ var TOKEN_COLUMNS2 = [
|
|
|
33062
33080
|
["tokens_cache_write", "INTEGER"],
|
|
33063
33081
|
["tokens_cost", "REAL"]
|
|
33064
33082
|
];
|
|
33065
|
-
function
|
|
33083
|
+
function up1092(db) {
|
|
33066
33084
|
for (const [column, type] of TOKEN_COLUMNS2) {
|
|
33067
33085
|
if (!hasColumn182(db, "dreaming_passes", column)) {
|
|
33068
33086
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
33069
33087
|
}
|
|
33070
33088
|
}
|
|
33071
33089
|
}
|
|
33072
|
-
function
|
|
33090
|
+
function up1102(db) {
|
|
33073
33091
|
db.exec(`
|
|
33074
33092
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
33075
33093
|
day TEXT NOT NULL,
|
|
@@ -33082,7 +33100,7 @@ function up1092(db) {
|
|
|
33082
33100
|
);
|
|
33083
33101
|
`);
|
|
33084
33102
|
}
|
|
33085
|
-
function
|
|
33103
|
+
function up1112(db) {
|
|
33086
33104
|
db.exec(`
|
|
33087
33105
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
33088
33106
|
id TEXT PRIMARY KEY,
|
|
@@ -33090,7 +33108,7 @@ function up1102(db) {
|
|
|
33090
33108
|
);
|
|
33091
33109
|
`);
|
|
33092
33110
|
}
|
|
33093
|
-
function
|
|
33111
|
+
function up1122(db) {
|
|
33094
33112
|
db.exec(`
|
|
33095
33113
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
33096
33114
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -33101,7 +33119,7 @@ function hasColumn192(db, table, column) {
|
|
|
33101
33119
|
return rows.some((row) => row.name === column);
|
|
33102
33120
|
}
|
|
33103
33121
|
var COLUMNS22 = ["first_remember_at", "first_recall_at"];
|
|
33104
|
-
function
|
|
33122
|
+
function up1132(db) {
|
|
33105
33123
|
for (const column of COLUMNS22) {
|
|
33106
33124
|
if (!hasColumn192(db, "telemetry_install", column)) {
|
|
33107
33125
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -33117,7 +33135,7 @@ function addColumnIfMissing232(db, column, definition) {
|
|
|
33117
33135
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33118
33136
|
}
|
|
33119
33137
|
}
|
|
33120
|
-
function
|
|
33138
|
+
function up1142(db) {
|
|
33121
33139
|
addColumnIfMissing232(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
33122
33140
|
addColumnIfMissing232(db, "claim_token", "TEXT");
|
|
33123
33141
|
addColumnIfMissing232(db, "claimed_at", "TEXT");
|
|
@@ -33126,7 +33144,7 @@ function up1132(db) {
|
|
|
33126
33144
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
33127
33145
|
`);
|
|
33128
33146
|
}
|
|
33129
|
-
function
|
|
33147
|
+
function up1152(db) {
|
|
33130
33148
|
db.exec(`
|
|
33131
33149
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
33132
33150
|
session_key TEXT NOT NULL,
|
|
@@ -33147,7 +33165,7 @@ function up1142(db) {
|
|
|
33147
33165
|
ON session_claims(agent_id, state, expires_at);
|
|
33148
33166
|
`);
|
|
33149
33167
|
}
|
|
33150
|
-
function
|
|
33168
|
+
function up1162(db) {
|
|
33151
33169
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
33152
33170
|
if (table == null)
|
|
33153
33171
|
return;
|
|
@@ -33156,7 +33174,7 @@ function up1152(db) {
|
|
|
33156
33174
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
33157
33175
|
`);
|
|
33158
33176
|
}
|
|
33159
|
-
function
|
|
33177
|
+
function up1172(db) {
|
|
33160
33178
|
db.exec(`
|
|
33161
33179
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
33162
33180
|
id TEXT PRIMARY KEY,
|
|
@@ -33213,7 +33231,7 @@ function addColumnIfMissing242(db, column, definition) {
|
|
|
33213
33231
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
33214
33232
|
}
|
|
33215
33233
|
}
|
|
33216
|
-
function
|
|
33234
|
+
function up1182(db) {
|
|
33217
33235
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
33218
33236
|
if (table == null)
|
|
33219
33237
|
return;
|
|
@@ -33414,7 +33432,7 @@ function backfillTranscriptsFromSummaryJobs2(db) {
|
|
|
33414
33432
|
insert.run(...values);
|
|
33415
33433
|
}
|
|
33416
33434
|
}
|
|
33417
|
-
function
|
|
33435
|
+
function up1192(db) {
|
|
33418
33436
|
if (!hasTable42(db, "session_transcripts"))
|
|
33419
33437
|
return;
|
|
33420
33438
|
addColumnIfMissing252(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -33467,7 +33485,7 @@ function up1182(db) {
|
|
|
33467
33485
|
ON session_transcripts(agent_id, content_hash);
|
|
33468
33486
|
`);
|
|
33469
33487
|
}
|
|
33470
|
-
function
|
|
33488
|
+
function up1202(db) {
|
|
33471
33489
|
db.exec(`
|
|
33472
33490
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
33473
33491
|
ON memory_jobs(status)
|
|
@@ -33486,12 +33504,12 @@ function up1192(db) {
|
|
|
33486
33504
|
function hasColumn222(db, table, column) {
|
|
33487
33505
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
33488
33506
|
}
|
|
33489
|
-
function
|
|
33507
|
+
function up1212(db) {
|
|
33490
33508
|
if (!hasColumn222(db, "telemetry_install", "last_seen_version")) {
|
|
33491
33509
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
33492
33510
|
}
|
|
33493
33511
|
}
|
|
33494
|
-
function
|
|
33512
|
+
function up1222(db) {
|
|
33495
33513
|
db.exec(`
|
|
33496
33514
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
33497
33515
|
agent_id TEXT NOT NULL,
|
|
@@ -33520,7 +33538,7 @@ function addColumnIfMissing262(db, column, definition) {
|
|
|
33520
33538
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
33521
33539
|
}
|
|
33522
33540
|
}
|
|
33523
|
-
function
|
|
33541
|
+
function up1232(db) {
|
|
33524
33542
|
addColumnIfMissing262(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
33525
33543
|
addColumnIfMissing262(db, "last_attempt_at", "TEXT");
|
|
33526
33544
|
addColumnIfMissing262(db, "sent_at", "TEXT");
|
|
@@ -33541,7 +33559,7 @@ function up1222(db) {
|
|
|
33541
33559
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
33542
33560
|
`);
|
|
33543
33561
|
}
|
|
33544
|
-
function
|
|
33562
|
+
function up1242(db) {
|
|
33545
33563
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
33546
33564
|
const names = new Set(columns.map((column) => column.name));
|
|
33547
33565
|
if (!names.has("failure_class")) {
|
|
@@ -33558,7 +33576,7 @@ function up1232(db) {
|
|
|
33558
33576
|
}
|
|
33559
33577
|
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)");
|
|
33560
33578
|
}
|
|
33561
|
-
function
|
|
33579
|
+
function up1252(db) {
|
|
33562
33580
|
db.exec(`
|
|
33563
33581
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
33564
33582
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -33582,7 +33600,7 @@ function up1242(db) {
|
|
|
33582
33600
|
ON embedding_index_failures(source_type, source_id);
|
|
33583
33601
|
`);
|
|
33584
33602
|
}
|
|
33585
|
-
function
|
|
33603
|
+
function up1262(db) {
|
|
33586
33604
|
db.exec(`
|
|
33587
33605
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
33588
33606
|
id TEXT PRIMARY KEY,
|
|
@@ -33632,7 +33650,7 @@ function backfillTable2(db, params) {
|
|
|
33632
33650
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
33633
33651
|
backfill2(db, rows, params.sourceKind, params.scannedAt);
|
|
33634
33652
|
}
|
|
33635
|
-
function
|
|
33653
|
+
function up1272(db) {
|
|
33636
33654
|
db.exec(`
|
|
33637
33655
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
33638
33656
|
agent_id TEXT NOT NULL,
|
|
@@ -33689,7 +33707,7 @@ function up1262(db) {
|
|
|
33689
33707
|
scannedAt
|
|
33690
33708
|
});
|
|
33691
33709
|
}
|
|
33692
|
-
function
|
|
33710
|
+
function up1282(db) {
|
|
33693
33711
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
33694
33712
|
if (!table)
|
|
33695
33713
|
return;
|
|
@@ -33723,7 +33741,7 @@ function up1272(db) {
|
|
|
33723
33741
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
33724
33742
|
`);
|
|
33725
33743
|
}
|
|
33726
|
-
function
|
|
33744
|
+
function up1292(db) {
|
|
33727
33745
|
db.exec(`
|
|
33728
33746
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
33729
33747
|
id TEXT PRIMARY KEY,
|
|
@@ -33779,7 +33797,7 @@ function up1282(db) {
|
|
|
33779
33797
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
33780
33798
|
`);
|
|
33781
33799
|
}
|
|
33782
|
-
function
|
|
33800
|
+
function up1302(db) {
|
|
33783
33801
|
db.exec(`
|
|
33784
33802
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
33785
33803
|
ON memory_jobs(status, created_at)
|
|
@@ -33794,7 +33812,7 @@ function up1292(db) {
|
|
|
33794
33812
|
function tableExists32(db, table) {
|
|
33795
33813
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
33796
33814
|
}
|
|
33797
|
-
function
|
|
33815
|
+
function up1312(db) {
|
|
33798
33816
|
if (!tableExists32(db, "memory_jobs"))
|
|
33799
33817
|
return;
|
|
33800
33818
|
if (!tableExists32(db, "job_cancellations")) {
|
|
@@ -33843,7 +33861,7 @@ function up1302(db) {
|
|
|
33843
33861
|
AND status IN ('pending', 'leased');
|
|
33844
33862
|
`);
|
|
33845
33863
|
}
|
|
33846
|
-
function
|
|
33864
|
+
function up1322(db) {
|
|
33847
33865
|
db.exec(`
|
|
33848
33866
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
33849
33867
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -33883,7 +33901,7 @@ function up1312(db) {
|
|
|
33883
33901
|
END;
|
|
33884
33902
|
`);
|
|
33885
33903
|
}
|
|
33886
|
-
function
|
|
33904
|
+
function up1332(db) {
|
|
33887
33905
|
db.exec(`
|
|
33888
33906
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
33889
33907
|
agent_id TEXT NOT NULL,
|
|
@@ -33906,13 +33924,13 @@ function up1322(db) {
|
|
|
33906
33924
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
33907
33925
|
`);
|
|
33908
33926
|
}
|
|
33909
|
-
function
|
|
33927
|
+
function up1342(db) {
|
|
33910
33928
|
db.exec(`
|
|
33911
33929
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
33912
33930
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
33913
33931
|
`);
|
|
33914
33932
|
}
|
|
33915
|
-
function
|
|
33933
|
+
function up1352(db) {
|
|
33916
33934
|
db.exec(`
|
|
33917
33935
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
33918
33936
|
id TEXT PRIMARY KEY,
|
|
@@ -33964,7 +33982,7 @@ function up1342(db) {
|
|
|
33964
33982
|
if (!names.has("format_version"))
|
|
33965
33983
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
33966
33984
|
}
|
|
33967
|
-
function
|
|
33985
|
+
function up1362(db) {
|
|
33968
33986
|
db.exec(`
|
|
33969
33987
|
CREATE TABLE memory_head_entries_v134 (
|
|
33970
33988
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -33982,7 +34000,7 @@ function up1352(db) {
|
|
|
33982
34000
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
33983
34001
|
`);
|
|
33984
34002
|
}
|
|
33985
|
-
function
|
|
34003
|
+
function up1372(db) {
|
|
33986
34004
|
db.exec(`
|
|
33987
34005
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
33988
34006
|
agent_id TEXT NOT NULL,
|
|
@@ -33998,7 +34016,7 @@ function up1362(db) {
|
|
|
33998
34016
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
33999
34017
|
`);
|
|
34000
34018
|
}
|
|
34001
|
-
function
|
|
34019
|
+
function up1382(db) {
|
|
34002
34020
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r3) => r3.name));
|
|
34003
34021
|
for (const [name, type] of [
|
|
34004
34022
|
["entry_id", "TEXT"],
|
|
@@ -34012,7 +34030,7 @@ function up1372(db) {
|
|
|
34012
34030
|
}
|
|
34013
34031
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
34014
34032
|
}
|
|
34015
|
-
function
|
|
34033
|
+
function up1392(db) {
|
|
34016
34034
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r3) => r3.name));
|
|
34017
34035
|
for (const [name, type] of [
|
|
34018
34036
|
["head_revision", "INTEGER"],
|
|
@@ -34034,7 +34052,7 @@ function addColumnIfMissing272(db, table, column, definition) {
|
|
|
34034
34052
|
if (!hasColumn252(db, table, column))
|
|
34035
34053
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34036
34054
|
}
|
|
34037
|
-
function
|
|
34055
|
+
function up1402(db) {
|
|
34038
34056
|
addColumnIfMissing272(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
34039
34057
|
db.exec(`
|
|
34040
34058
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -34339,7 +34357,7 @@ function up1392(db) {
|
|
|
34339
34357
|
GROUP BY j.agent_id;
|
|
34340
34358
|
`);
|
|
34341
34359
|
}
|
|
34342
|
-
function
|
|
34360
|
+
function up1412(db) {
|
|
34343
34361
|
db.exec(`
|
|
34344
34362
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
34345
34363
|
agent_id TEXT NOT NULL,
|
|
@@ -34355,7 +34373,7 @@ function up1402(db) {
|
|
|
34355
34373
|
ON native_source_sync_state(agent_id, status);
|
|
34356
34374
|
`);
|
|
34357
34375
|
}
|
|
34358
|
-
function
|
|
34376
|
+
function up1422(db) {
|
|
34359
34377
|
db.exec(`
|
|
34360
34378
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
34361
34379
|
agent_id TEXT NOT NULL,
|
|
@@ -34367,7 +34385,7 @@ function up1412(db) {
|
|
|
34367
34385
|
);
|
|
34368
34386
|
`);
|
|
34369
34387
|
}
|
|
34370
|
-
function
|
|
34388
|
+
function up1432(db) {
|
|
34371
34389
|
db.exec(`
|
|
34372
34390
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
34373
34391
|
agent_id TEXT NOT NULL,
|
|
@@ -34381,13 +34399,13 @@ function up1422(db) {
|
|
|
34381
34399
|
);
|
|
34382
34400
|
`);
|
|
34383
34401
|
}
|
|
34384
|
-
function
|
|
34402
|
+
function up1442(db) {
|
|
34385
34403
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
34386
34404
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
34387
34405
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
34388
34406
|
}
|
|
34389
34407
|
}
|
|
34390
|
-
function
|
|
34408
|
+
function up1452(db) {
|
|
34391
34409
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34392
34410
|
const additions = [
|
|
34393
34411
|
["migration_phase", "TEXT"],
|
|
@@ -34422,13 +34440,13 @@ function up1442(db) {
|
|
|
34422
34440
|
`);
|
|
34423
34441
|
}
|
|
34424
34442
|
}
|
|
34425
|
-
function
|
|
34443
|
+
function up1462(db) {
|
|
34426
34444
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
34427
34445
|
if (!columns.has("lease_token")) {
|
|
34428
34446
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
34429
34447
|
}
|
|
34430
34448
|
}
|
|
34431
|
-
function
|
|
34449
|
+
function up1472(db) {
|
|
34432
34450
|
db.exec(`
|
|
34433
34451
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
34434
34452
|
agent_id TEXT NOT NULL,
|
|
@@ -34446,7 +34464,7 @@ function up1462(db) {
|
|
|
34446
34464
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
34447
34465
|
`);
|
|
34448
34466
|
}
|
|
34449
|
-
function
|
|
34467
|
+
function up1482(db) {
|
|
34450
34468
|
db.exec(`
|
|
34451
34469
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
34452
34470
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -34513,16 +34531,16 @@ function up1472(db) {
|
|
|
34513
34531
|
}
|
|
34514
34532
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
34515
34533
|
}
|
|
34516
|
-
function
|
|
34534
|
+
function up1492(db) {
|
|
34517
34535
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
34518
34536
|
}
|
|
34519
|
-
function
|
|
34537
|
+
function up1502(db) {
|
|
34520
34538
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
34521
34539
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
34522
34540
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
34523
34541
|
}
|
|
34524
34542
|
}
|
|
34525
|
-
function
|
|
34543
|
+
function up1512(db) {
|
|
34526
34544
|
const addColumn = (table, column, definition) => {
|
|
34527
34545
|
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
34528
34546
|
let exists;
|
|
@@ -34543,7 +34561,7 @@ function addColumnIfMissing282(db, table, column, definition) {
|
|
|
34543
34561
|
if (!columns.some((row) => row.name === column))
|
|
34544
34562
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
34545
34563
|
}
|
|
34546
|
-
function
|
|
34564
|
+
function up1522(db) {
|
|
34547
34565
|
addColumnIfMissing282(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
34548
34566
|
addColumnIfMissing282(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
34549
34567
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -34697,13 +34715,13 @@ var MIGRATIONS2 = [
|
|
|
34697
34715
|
{
|
|
34698
34716
|
version: 1,
|
|
34699
34717
|
name: "baseline",
|
|
34700
|
-
up:
|
|
34718
|
+
up: up310,
|
|
34701
34719
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
34702
34720
|
},
|
|
34703
34721
|
{
|
|
34704
34722
|
version: 2,
|
|
34705
34723
|
name: "pipeline-v2",
|
|
34706
|
-
up:
|
|
34724
|
+
up: up410,
|
|
34707
34725
|
artifacts: {
|
|
34708
34726
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
34709
34727
|
}
|
|
@@ -34711,12 +34729,12 @@ var MIGRATIONS2 = [
|
|
|
34711
34729
|
{
|
|
34712
34730
|
version: 3,
|
|
34713
34731
|
name: "unique-content-hash",
|
|
34714
|
-
up:
|
|
34732
|
+
up: up510
|
|
34715
34733
|
},
|
|
34716
34734
|
{
|
|
34717
34735
|
version: 4,
|
|
34718
34736
|
name: "history-actor-and-retention",
|
|
34719
|
-
up:
|
|
34737
|
+
up: up610,
|
|
34720
34738
|
artifacts: {
|
|
34721
34739
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
34722
34740
|
}
|
|
@@ -34724,7 +34742,7 @@ var MIGRATIONS2 = [
|
|
|
34724
34742
|
{
|
|
34725
34743
|
version: 5,
|
|
34726
34744
|
name: "graph-extended",
|
|
34727
|
-
up:
|
|
34745
|
+
up: up710,
|
|
34728
34746
|
artifacts: {
|
|
34729
34747
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
34730
34748
|
}
|
|
@@ -34732,7 +34750,7 @@ var MIGRATIONS2 = [
|
|
|
34732
34750
|
{
|
|
34733
34751
|
version: 6,
|
|
34734
34752
|
name: "idempotency-key",
|
|
34735
|
-
up:
|
|
34753
|
+
up: up810,
|
|
34736
34754
|
artifacts: {
|
|
34737
34755
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
34738
34756
|
}
|
|
@@ -34740,42 +34758,42 @@ var MIGRATIONS2 = [
|
|
|
34740
34758
|
{
|
|
34741
34759
|
version: 7,
|
|
34742
34760
|
name: "documents-and-connectors",
|
|
34743
|
-
up:
|
|
34761
|
+
up: up910,
|
|
34744
34762
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
34745
34763
|
},
|
|
34746
34764
|
{
|
|
34747
34765
|
version: 8,
|
|
34748
34766
|
name: "embeddings-unique-hash",
|
|
34749
|
-
up:
|
|
34767
|
+
up: up1010
|
|
34750
34768
|
},
|
|
34751
34769
|
{
|
|
34752
34770
|
version: 9,
|
|
34753
34771
|
name: "summary-jobs",
|
|
34754
|
-
up:
|
|
34772
|
+
up: up1110,
|
|
34755
34773
|
artifacts: { tables: ["summary_jobs"] }
|
|
34756
34774
|
},
|
|
34757
34775
|
{
|
|
34758
34776
|
version: 10,
|
|
34759
34777
|
name: "umap-cache",
|
|
34760
|
-
up:
|
|
34778
|
+
up: up1210,
|
|
34761
34779
|
artifacts: { tables: ["umap_cache"] }
|
|
34762
34780
|
},
|
|
34763
34781
|
{
|
|
34764
34782
|
version: 11,
|
|
34765
34783
|
name: "session-scores",
|
|
34766
|
-
up:
|
|
34784
|
+
up: up1310,
|
|
34767
34785
|
artifacts: { tables: ["session_scores"] }
|
|
34768
34786
|
},
|
|
34769
34787
|
{
|
|
34770
34788
|
version: 12,
|
|
34771
34789
|
name: "scheduled-tasks",
|
|
34772
|
-
up:
|
|
34790
|
+
up: up1410,
|
|
34773
34791
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
34774
34792
|
},
|
|
34775
34793
|
{
|
|
34776
34794
|
version: 13,
|
|
34777
34795
|
name: "ingestion-tracking",
|
|
34778
|
-
up:
|
|
34796
|
+
up: up154,
|
|
34779
34797
|
artifacts: {
|
|
34780
34798
|
columns: [
|
|
34781
34799
|
{ table: "memories", column: "source_path" },
|
|
@@ -34786,13 +34804,13 @@ var MIGRATIONS2 = [
|
|
|
34786
34804
|
{
|
|
34787
34805
|
version: 14,
|
|
34788
34806
|
name: "telemetry",
|
|
34789
|
-
up:
|
|
34807
|
+
up: up162,
|
|
34790
34808
|
artifacts: { tables: ["telemetry_events"] }
|
|
34791
34809
|
},
|
|
34792
34810
|
{
|
|
34793
34811
|
version: 15,
|
|
34794
34812
|
name: "session-memories",
|
|
34795
|
-
up:
|
|
34813
|
+
up: up172,
|
|
34796
34814
|
artifacts: {
|
|
34797
34815
|
tables: ["session_memories"],
|
|
34798
34816
|
columns: [
|
|
@@ -34804,13 +34822,13 @@ var MIGRATIONS2 = [
|
|
|
34804
34822
|
{
|
|
34805
34823
|
version: 16,
|
|
34806
34824
|
name: "session-checkpoints",
|
|
34807
|
-
up:
|
|
34825
|
+
up: up182,
|
|
34808
34826
|
artifacts: { tables: ["session_checkpoints"] }
|
|
34809
34827
|
},
|
|
34810
34828
|
{
|
|
34811
34829
|
version: 17,
|
|
34812
34830
|
name: "task-skills",
|
|
34813
|
-
up:
|
|
34831
|
+
up: up192,
|
|
34814
34832
|
artifacts: {
|
|
34815
34833
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
34816
34834
|
}
|
|
@@ -34818,13 +34836,13 @@ var MIGRATIONS2 = [
|
|
|
34818
34836
|
{
|
|
34819
34837
|
version: 18,
|
|
34820
34838
|
name: "skill-meta",
|
|
34821
|
-
up:
|
|
34839
|
+
up: up202,
|
|
34822
34840
|
artifacts: { tables: ["skill_meta"] }
|
|
34823
34841
|
},
|
|
34824
34842
|
{
|
|
34825
34843
|
version: 19,
|
|
34826
34844
|
name: "knowledge-structure",
|
|
34827
|
-
up:
|
|
34845
|
+
up: up212,
|
|
34828
34846
|
artifacts: {
|
|
34829
34847
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
34830
34848
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -34833,7 +34851,7 @@ var MIGRATIONS2 = [
|
|
|
34833
34851
|
{
|
|
34834
34852
|
version: 20,
|
|
34835
34853
|
name: "session-structural-columns",
|
|
34836
|
-
up:
|
|
34854
|
+
up: up222,
|
|
34837
34855
|
artifacts: {
|
|
34838
34856
|
columns: [
|
|
34839
34857
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -34846,7 +34864,7 @@ var MIGRATIONS2 = [
|
|
|
34846
34864
|
{
|
|
34847
34865
|
version: 21,
|
|
34848
34866
|
name: "checkpoint-structural",
|
|
34849
|
-
up:
|
|
34867
|
+
up: up232,
|
|
34850
34868
|
artifacts: {
|
|
34851
34869
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
34852
34870
|
}
|
|
@@ -34854,7 +34872,7 @@ var MIGRATIONS2 = [
|
|
|
34854
34872
|
{
|
|
34855
34873
|
version: 22,
|
|
34856
34874
|
name: "entity-pinning",
|
|
34857
|
-
up:
|
|
34875
|
+
up: up242,
|
|
34858
34876
|
artifacts: {
|
|
34859
34877
|
columns: [
|
|
34860
34878
|
{ table: "entities", column: "pinned" },
|
|
@@ -34865,17 +34883,17 @@ var MIGRATIONS2 = [
|
|
|
34865
34883
|
{
|
|
34866
34884
|
version: 23,
|
|
34867
34885
|
name: "retired-scorer-gap",
|
|
34868
|
-
up:
|
|
34886
|
+
up: up252
|
|
34869
34887
|
},
|
|
34870
34888
|
{
|
|
34871
34889
|
version: 24,
|
|
34872
34890
|
name: "retired-scorer-gap",
|
|
34873
|
-
up:
|
|
34891
|
+
up: up262
|
|
34874
34892
|
},
|
|
34875
34893
|
{
|
|
34876
34894
|
version: 25,
|
|
34877
34895
|
name: "agent-feedback",
|
|
34878
|
-
up:
|
|
34896
|
+
up: up272,
|
|
34879
34897
|
artifacts: {
|
|
34880
34898
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
34881
34899
|
}
|
|
@@ -34883,32 +34901,32 @@ var MIGRATIONS2 = [
|
|
|
34883
34901
|
{
|
|
34884
34902
|
version: 26,
|
|
34885
34903
|
name: "retired-scorer-gap",
|
|
34886
|
-
up:
|
|
34904
|
+
up: up282
|
|
34887
34905
|
},
|
|
34888
34906
|
{
|
|
34889
34907
|
version: 27,
|
|
34890
34908
|
name: "backfill-canonical-names",
|
|
34891
|
-
up:
|
|
34909
|
+
up: up292
|
|
34892
34910
|
},
|
|
34893
34911
|
{
|
|
34894
34912
|
version: 28,
|
|
34895
34913
|
name: "lossless-retention",
|
|
34896
|
-
up:
|
|
34914
|
+
up: up302
|
|
34897
34915
|
},
|
|
34898
34916
|
{
|
|
34899
34917
|
version: 29,
|
|
34900
34918
|
name: "session-summary-dag",
|
|
34901
|
-
up:
|
|
34919
|
+
up: up312
|
|
34902
34920
|
},
|
|
34903
34921
|
{
|
|
34904
34922
|
version: 30,
|
|
34905
34923
|
name: "nullable-memory-job-memory-id",
|
|
34906
|
-
up:
|
|
34924
|
+
up: up322
|
|
34907
34925
|
},
|
|
34908
34926
|
{
|
|
34909
34927
|
version: 31,
|
|
34910
34928
|
name: "dependency-reason",
|
|
34911
|
-
up:
|
|
34929
|
+
up: up332,
|
|
34912
34930
|
artifacts: {
|
|
34913
34931
|
columns: [
|
|
34914
34932
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -34919,7 +34937,7 @@ var MIGRATIONS2 = [
|
|
|
34919
34937
|
{
|
|
34920
34938
|
version: 32,
|
|
34921
34939
|
name: "embeddings-vector-column",
|
|
34922
|
-
up:
|
|
34940
|
+
up: up342,
|
|
34923
34941
|
artifacts: {
|
|
34924
34942
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
34925
34943
|
}
|
|
@@ -34927,7 +34945,7 @@ var MIGRATIONS2 = [
|
|
|
34927
34945
|
{
|
|
34928
34946
|
version: 33,
|
|
34929
34947
|
name: "scope",
|
|
34930
|
-
up:
|
|
34948
|
+
up: up352,
|
|
34931
34949
|
artifacts: {
|
|
34932
34950
|
columns: [{ table: "memories", column: "scope" }]
|
|
34933
34951
|
}
|
|
@@ -34935,17 +34953,17 @@ var MIGRATIONS2 = [
|
|
|
34935
34953
|
{
|
|
34936
34954
|
version: 34,
|
|
34937
34955
|
name: "scope-aware-dedup",
|
|
34938
|
-
up:
|
|
34956
|
+
up: up362
|
|
34939
34957
|
},
|
|
34940
34958
|
{
|
|
34941
34959
|
version: 35,
|
|
34942
34960
|
name: "entity-fts",
|
|
34943
|
-
up:
|
|
34961
|
+
up: up372
|
|
34944
34962
|
},
|
|
34945
34963
|
{
|
|
34946
34964
|
version: 36,
|
|
34947
34965
|
name: "dependency-confidence",
|
|
34948
|
-
up:
|
|
34966
|
+
up: up382,
|
|
34949
34967
|
artifacts: {
|
|
34950
34968
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
34951
34969
|
}
|
|
@@ -34953,7 +34971,7 @@ var MIGRATIONS2 = [
|
|
|
34953
34971
|
{
|
|
34954
34972
|
version: 37,
|
|
34955
34973
|
name: "entity-communities",
|
|
34956
|
-
up:
|
|
34974
|
+
up: up392,
|
|
34957
34975
|
artifacts: {
|
|
34958
34976
|
tables: ["entity_communities"],
|
|
34959
34977
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -34962,24 +34980,24 @@ var MIGRATIONS2 = [
|
|
|
34962
34980
|
{
|
|
34963
34981
|
version: 38,
|
|
34964
34982
|
name: "memory-hints",
|
|
34965
|
-
up:
|
|
34983
|
+
up: up402,
|
|
34966
34984
|
artifacts: { tables: ["memory_hints"] }
|
|
34967
34985
|
},
|
|
34968
34986
|
{
|
|
34969
34987
|
version: 39,
|
|
34970
34988
|
name: "dedup-entity-dependencies",
|
|
34971
|
-
up:
|
|
34989
|
+
up: up412
|
|
34972
34990
|
},
|
|
34973
34991
|
{
|
|
34974
34992
|
version: 40,
|
|
34975
34993
|
name: "session-transcripts",
|
|
34976
|
-
up:
|
|
34994
|
+
up: up422,
|
|
34977
34995
|
artifacts: { tables: ["session_transcripts"] }
|
|
34978
34996
|
},
|
|
34979
34997
|
{
|
|
34980
34998
|
version: 41,
|
|
34981
34999
|
name: "path-feedback",
|
|
34982
|
-
up:
|
|
35000
|
+
up: up432,
|
|
34983
35001
|
artifacts: {
|
|
34984
35002
|
tables: [
|
|
34985
35003
|
"path_feedback_events",
|
|
@@ -34994,7 +35012,7 @@ var MIGRATIONS2 = [
|
|
|
34994
35012
|
{
|
|
34995
35013
|
version: 42,
|
|
34996
35014
|
name: "session-memories-agent-id",
|
|
34997
|
-
up:
|
|
35015
|
+
up: up442,
|
|
34998
35016
|
artifacts: {
|
|
34999
35017
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
35000
35018
|
}
|
|
@@ -35002,7 +35020,7 @@ var MIGRATIONS2 = [
|
|
|
35002
35020
|
{
|
|
35003
35021
|
version: 43,
|
|
35004
35022
|
name: "agents-table",
|
|
35005
|
-
up:
|
|
35023
|
+
up: up452,
|
|
35006
35024
|
artifacts: {
|
|
35007
35025
|
tables: ["agents"],
|
|
35008
35026
|
columns: [
|
|
@@ -35014,7 +35032,7 @@ var MIGRATIONS2 = [
|
|
|
35014
35032
|
{
|
|
35015
35033
|
version: 44,
|
|
35016
35034
|
name: "memory-md-temporal-head",
|
|
35017
|
-
up:
|
|
35035
|
+
up: up462,
|
|
35018
35036
|
artifacts: {
|
|
35019
35037
|
columns: [
|
|
35020
35038
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -35026,7 +35044,7 @@ var MIGRATIONS2 = [
|
|
|
35026
35044
|
{
|
|
35027
35045
|
version: 45,
|
|
35028
35046
|
name: "lossless-working-memory-hardening",
|
|
35029
|
-
up:
|
|
35047
|
+
up: up472,
|
|
35030
35048
|
artifacts: {
|
|
35031
35049
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
35032
35050
|
columns: [
|
|
@@ -35039,17 +35057,17 @@ var MIGRATIONS2 = [
|
|
|
35039
35057
|
{
|
|
35040
35058
|
version: 46,
|
|
35041
35059
|
name: "session-summary-uniqueness",
|
|
35042
|
-
up:
|
|
35060
|
+
up: up482
|
|
35043
35061
|
},
|
|
35044
35062
|
{
|
|
35045
35063
|
version: 47,
|
|
35046
35064
|
name: "agent-scoped-temporal-uniqueness",
|
|
35047
|
-
up:
|
|
35065
|
+
up: up492
|
|
35048
35066
|
},
|
|
35049
35067
|
{
|
|
35050
35068
|
version: 48,
|
|
35051
35069
|
name: "thread-heads",
|
|
35052
|
-
up:
|
|
35070
|
+
up: up502,
|
|
35053
35071
|
artifacts: {
|
|
35054
35072
|
tables: ["memory_thread_heads"]
|
|
35055
35073
|
}
|
|
@@ -35057,7 +35075,7 @@ var MIGRATIONS2 = [
|
|
|
35057
35075
|
{
|
|
35058
35076
|
version: 49,
|
|
35059
35077
|
name: "session-extract-cursors",
|
|
35060
|
-
up:
|
|
35078
|
+
up: up512,
|
|
35061
35079
|
artifacts: {
|
|
35062
35080
|
tables: ["session_extract_cursors"]
|
|
35063
35081
|
}
|
|
@@ -35065,7 +35083,7 @@ var MIGRATIONS2 = [
|
|
|
35065
35083
|
{
|
|
35066
35084
|
version: 50,
|
|
35067
35085
|
name: "related-to-audit",
|
|
35068
|
-
up:
|
|
35086
|
+
up: up522,
|
|
35069
35087
|
artifacts: {
|
|
35070
35088
|
tables: ["entity_dependency_history"]
|
|
35071
35089
|
}
|
|
@@ -35073,7 +35091,7 @@ var MIGRATIONS2 = [
|
|
|
35073
35091
|
{
|
|
35074
35092
|
version: 51,
|
|
35075
35093
|
name: "memory-md-rolling-window-lineage",
|
|
35076
|
-
up:
|
|
35094
|
+
up: up532,
|
|
35077
35095
|
artifacts: {
|
|
35078
35096
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
35079
35097
|
columns: [
|
|
@@ -35088,7 +35106,7 @@ var MIGRATIONS2 = [
|
|
|
35088
35106
|
{
|
|
35089
35107
|
version: 52,
|
|
35090
35108
|
name: "mcp-invocations",
|
|
35091
|
-
up:
|
|
35109
|
+
up: up542,
|
|
35092
35110
|
artifacts: {
|
|
35093
35111
|
tables: ["mcp_invocations"]
|
|
35094
35112
|
}
|
|
@@ -35096,7 +35114,7 @@ var MIGRATIONS2 = [
|
|
|
35096
35114
|
{
|
|
35097
35115
|
version: 53,
|
|
35098
35116
|
name: "skill-invocations",
|
|
35099
|
-
up:
|
|
35117
|
+
up: up552,
|
|
35100
35118
|
artifacts: {
|
|
35101
35119
|
tables: ["skill_invocations"]
|
|
35102
35120
|
}
|
|
@@ -35104,7 +35122,7 @@ var MIGRATIONS2 = [
|
|
|
35104
35122
|
{
|
|
35105
35123
|
version: 54,
|
|
35106
35124
|
name: "task-agent-scope",
|
|
35107
|
-
up:
|
|
35125
|
+
up: up562,
|
|
35108
35126
|
artifacts: {
|
|
35109
35127
|
tables: ["task_scope_hints"]
|
|
35110
35128
|
}
|
|
@@ -35112,7 +35130,7 @@ var MIGRATIONS2 = [
|
|
|
35112
35130
|
{
|
|
35113
35131
|
version: 55,
|
|
35114
35132
|
name: "dreaming-state",
|
|
35115
|
-
up:
|
|
35133
|
+
up: up572,
|
|
35116
35134
|
artifacts: {
|
|
35117
35135
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
35118
35136
|
}
|
|
@@ -35120,22 +35138,22 @@ var MIGRATIONS2 = [
|
|
|
35120
35138
|
{
|
|
35121
35139
|
version: 56,
|
|
35122
35140
|
name: "agent-scoped-content-hash",
|
|
35123
|
-
up:
|
|
35141
|
+
up: up582
|
|
35124
35142
|
},
|
|
35125
35143
|
{
|
|
35126
35144
|
version: 57,
|
|
35127
35145
|
name: "memories-fts-tokenizer-repair",
|
|
35128
|
-
up:
|
|
35146
|
+
up: up592
|
|
35129
35147
|
},
|
|
35130
35148
|
{
|
|
35131
35149
|
version: 58,
|
|
35132
35150
|
name: "knowledge-graph-indices",
|
|
35133
|
-
up:
|
|
35151
|
+
up: up602
|
|
35134
35152
|
},
|
|
35135
35153
|
{
|
|
35136
35154
|
version: 59,
|
|
35137
35155
|
name: "entity-attribute-claim-key",
|
|
35138
|
-
up:
|
|
35156
|
+
up: up612,
|
|
35139
35157
|
artifacts: {
|
|
35140
35158
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
35141
35159
|
}
|
|
@@ -35143,7 +35161,7 @@ var MIGRATIONS2 = [
|
|
|
35143
35161
|
{
|
|
35144
35162
|
version: 60,
|
|
35145
35163
|
name: "entity-attribute-group-key",
|
|
35146
|
-
up:
|
|
35164
|
+
up: up622,
|
|
35147
35165
|
artifacts: {
|
|
35148
35166
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
35149
35167
|
}
|
|
@@ -35151,7 +35169,7 @@ var MIGRATIONS2 = [
|
|
|
35151
35169
|
{
|
|
35152
35170
|
version: 61,
|
|
35153
35171
|
name: "memory-artifact-source-mtime",
|
|
35154
|
-
up:
|
|
35172
|
+
up: up632,
|
|
35155
35173
|
artifacts: {
|
|
35156
35174
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
35157
35175
|
}
|
|
@@ -35159,7 +35177,7 @@ var MIGRATIONS2 = [
|
|
|
35159
35177
|
{
|
|
35160
35178
|
version: 62,
|
|
35161
35179
|
name: "memory-artifact-soft-delete",
|
|
35162
|
-
up:
|
|
35180
|
+
up: up642,
|
|
35163
35181
|
artifacts: {
|
|
35164
35182
|
columns: [
|
|
35165
35183
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -35170,12 +35188,12 @@ var MIGRATIONS2 = [
|
|
|
35170
35188
|
{
|
|
35171
35189
|
version: 63,
|
|
35172
35190
|
name: "content-only-memories-fts-update",
|
|
35173
|
-
up:
|
|
35191
|
+
up: up652
|
|
35174
35192
|
},
|
|
35175
35193
|
{
|
|
35176
35194
|
version: 64,
|
|
35177
35195
|
name: "source-graph-provenance",
|
|
35178
|
-
up:
|
|
35196
|
+
up: up662,
|
|
35179
35197
|
artifacts: {
|
|
35180
35198
|
columns: [
|
|
35181
35199
|
{ table: "entities", column: "source_path" },
|
|
@@ -35188,7 +35206,7 @@ var MIGRATIONS2 = [
|
|
|
35188
35206
|
{
|
|
35189
35207
|
version: 65,
|
|
35190
35208
|
name: "source-embedding-agent-scope",
|
|
35191
|
-
up:
|
|
35209
|
+
up: up672,
|
|
35192
35210
|
artifacts: {
|
|
35193
35211
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
35194
35212
|
}
|
|
@@ -35196,7 +35214,7 @@ var MIGRATIONS2 = [
|
|
|
35196
35214
|
{
|
|
35197
35215
|
version: 66,
|
|
35198
35216
|
name: "memory-search-telemetry",
|
|
35199
|
-
up:
|
|
35217
|
+
up: up682,
|
|
35200
35218
|
artifacts: {
|
|
35201
35219
|
tables: ["memory_search_telemetry"]
|
|
35202
35220
|
}
|
|
@@ -35204,7 +35222,7 @@ var MIGRATIONS2 = [
|
|
|
35204
35222
|
{
|
|
35205
35223
|
version: 67,
|
|
35206
35224
|
name: "ontology-proposals",
|
|
35207
|
-
up:
|
|
35225
|
+
up: up692,
|
|
35208
35226
|
artifacts: {
|
|
35209
35227
|
tables: ["ontology_proposals"],
|
|
35210
35228
|
columns: [
|
|
@@ -35218,7 +35236,7 @@ var MIGRATIONS2 = [
|
|
|
35218
35236
|
{
|
|
35219
35237
|
version: 68,
|
|
35220
35238
|
name: "daily-reflections",
|
|
35221
|
-
up:
|
|
35239
|
+
up: up702,
|
|
35222
35240
|
artifacts: {
|
|
35223
35241
|
tables: ["daily_reflections"]
|
|
35224
35242
|
}
|
|
@@ -35226,7 +35244,7 @@ var MIGRATIONS2 = [
|
|
|
35226
35244
|
{
|
|
35227
35245
|
version: 69,
|
|
35228
35246
|
name: "daily-reflections-multiple-insights",
|
|
35229
|
-
up:
|
|
35247
|
+
up: up712,
|
|
35230
35248
|
artifacts: {
|
|
35231
35249
|
tables: ["daily_reflections"]
|
|
35232
35250
|
}
|
|
@@ -35234,7 +35252,7 @@ var MIGRATIONS2 = [
|
|
|
35234
35252
|
{
|
|
35235
35253
|
version: 70,
|
|
35236
35254
|
name: "ontology-control-plane-state",
|
|
35237
|
-
up:
|
|
35255
|
+
up: up722,
|
|
35238
35256
|
artifacts: {
|
|
35239
35257
|
columns: [
|
|
35240
35258
|
{ table: "entities", column: "status" },
|
|
@@ -35249,7 +35267,7 @@ var MIGRATIONS2 = [
|
|
|
35249
35267
|
{
|
|
35250
35268
|
version: 71,
|
|
35251
35269
|
name: "epistemic-assertions",
|
|
35252
|
-
up:
|
|
35270
|
+
up: up732,
|
|
35253
35271
|
artifacts: {
|
|
35254
35272
|
tables: ["epistemic_assertions"]
|
|
35255
35273
|
}
|
|
@@ -35257,7 +35275,7 @@ var MIGRATIONS2 = [
|
|
|
35257
35275
|
{
|
|
35258
35276
|
version: 72,
|
|
35259
35277
|
name: "agent-scoped-idempotency-key",
|
|
35260
|
-
up:
|
|
35278
|
+
up: up742,
|
|
35261
35279
|
artifacts: {
|
|
35262
35280
|
columns: [
|
|
35263
35281
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -35268,7 +35286,7 @@ var MIGRATIONS2 = [
|
|
|
35268
35286
|
{
|
|
35269
35287
|
version: 73,
|
|
35270
35288
|
name: "recall-context-dedupe",
|
|
35271
|
-
up:
|
|
35289
|
+
up: up752,
|
|
35272
35290
|
artifacts: {
|
|
35273
35291
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
35274
35292
|
}
|
|
@@ -35276,7 +35294,7 @@ var MIGRATIONS2 = [
|
|
|
35276
35294
|
{
|
|
35277
35295
|
version: 74,
|
|
35278
35296
|
name: "aggregate-memory-links",
|
|
35279
|
-
up:
|
|
35297
|
+
up: up762,
|
|
35280
35298
|
artifacts: {
|
|
35281
35299
|
tables: ["aggregate_memory_sources"]
|
|
35282
35300
|
}
|
|
@@ -35284,7 +35302,7 @@ var MIGRATIONS2 = [
|
|
|
35284
35302
|
{
|
|
35285
35303
|
version: 75,
|
|
35286
35304
|
name: "memory-artifact-source-provenance",
|
|
35287
|
-
up:
|
|
35305
|
+
up: up772,
|
|
35288
35306
|
artifacts: {
|
|
35289
35307
|
columns: [
|
|
35290
35308
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -35298,7 +35316,7 @@ var MIGRATIONS2 = [
|
|
|
35298
35316
|
{
|
|
35299
35317
|
version: 76,
|
|
35300
35318
|
name: "temporal-edges",
|
|
35301
|
-
up:
|
|
35319
|
+
up: up782,
|
|
35302
35320
|
artifacts: {
|
|
35303
35321
|
tables: ["temporal_edges"]
|
|
35304
35322
|
}
|
|
@@ -35306,7 +35324,7 @@ var MIGRATIONS2 = [
|
|
|
35306
35324
|
{
|
|
35307
35325
|
version: 77,
|
|
35308
35326
|
name: "entity-aliases",
|
|
35309
|
-
up:
|
|
35327
|
+
up: up792,
|
|
35310
35328
|
artifacts: {
|
|
35311
35329
|
tables: ["entity_aliases"]
|
|
35312
35330
|
}
|
|
@@ -35314,7 +35332,7 @@ var MIGRATIONS2 = [
|
|
|
35314
35332
|
{
|
|
35315
35333
|
version: 78,
|
|
35316
35334
|
name: "api-keys",
|
|
35317
|
-
up:
|
|
35335
|
+
up: up802,
|
|
35318
35336
|
artifacts: {
|
|
35319
35337
|
tables: ["api_keys"]
|
|
35320
35338
|
}
|
|
@@ -35322,7 +35340,7 @@ var MIGRATIONS2 = [
|
|
|
35322
35340
|
{
|
|
35323
35341
|
version: 79,
|
|
35324
35342
|
name: "transcript-capture-jobs",
|
|
35325
|
-
up:
|
|
35343
|
+
up: up812,
|
|
35326
35344
|
artifacts: {
|
|
35327
35345
|
tables: ["transcript_capture_jobs"]
|
|
35328
35346
|
}
|
|
@@ -35330,7 +35348,7 @@ var MIGRATIONS2 = [
|
|
|
35330
35348
|
{
|
|
35331
35349
|
version: 80,
|
|
35332
35350
|
name: "document-scope-columns",
|
|
35333
|
-
up:
|
|
35351
|
+
up: up822,
|
|
35334
35352
|
artifacts: {
|
|
35335
35353
|
columns: [
|
|
35336
35354
|
{ table: "documents", column: "agent_id" },
|
|
@@ -35341,7 +35359,7 @@ var MIGRATIONS2 = [
|
|
|
35341
35359
|
{
|
|
35342
35360
|
version: 81,
|
|
35343
35361
|
name: "aggregate-evidence-sources",
|
|
35344
|
-
up:
|
|
35362
|
+
up: up832,
|
|
35345
35363
|
artifacts: {
|
|
35346
35364
|
tables: ["aggregate_evidence_sources"]
|
|
35347
35365
|
}
|
|
@@ -35349,7 +35367,7 @@ var MIGRATIONS2 = [
|
|
|
35349
35367
|
{
|
|
35350
35368
|
version: 82,
|
|
35351
35369
|
name: "skill-invocations-harness",
|
|
35352
|
-
up:
|
|
35370
|
+
up: up842,
|
|
35353
35371
|
artifacts: {
|
|
35354
35372
|
columns: [
|
|
35355
35373
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -35360,7 +35378,7 @@ var MIGRATIONS2 = [
|
|
|
35360
35378
|
{
|
|
35361
35379
|
version: 83,
|
|
35362
35380
|
name: "memory-lifecycle-repair",
|
|
35363
|
-
up:
|
|
35381
|
+
up: up852,
|
|
35364
35382
|
artifacts: {
|
|
35365
35383
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
35366
35384
|
columns: [
|
|
@@ -35375,7 +35393,7 @@ var MIGRATIONS2 = [
|
|
|
35375
35393
|
{
|
|
35376
35394
|
version: 84,
|
|
35377
35395
|
name: "legacy-markdown-import-state",
|
|
35378
|
-
up:
|
|
35396
|
+
up: up862,
|
|
35379
35397
|
artifacts: {
|
|
35380
35398
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
35381
35399
|
}
|
|
@@ -35383,7 +35401,7 @@ var MIGRATIONS2 = [
|
|
|
35383
35401
|
{
|
|
35384
35402
|
version: 85,
|
|
35385
35403
|
name: "backfill-relations-to-dependencies",
|
|
35386
|
-
up:
|
|
35404
|
+
up: up872,
|
|
35387
35405
|
artifacts: {
|
|
35388
35406
|
tables: ["entity_dependencies"]
|
|
35389
35407
|
}
|
|
@@ -35391,7 +35409,7 @@ var MIGRATIONS2 = [
|
|
|
35391
35409
|
{
|
|
35392
35410
|
version: 86,
|
|
35393
35411
|
name: "summary-jobs-content-hash",
|
|
35394
|
-
up:
|
|
35412
|
+
up: up882,
|
|
35395
35413
|
artifacts: {
|
|
35396
35414
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
35397
35415
|
}
|
|
@@ -35399,7 +35417,7 @@ var MIGRATIONS2 = [
|
|
|
35399
35417
|
{
|
|
35400
35418
|
version: 87,
|
|
35401
35419
|
name: "summary-jobs-boundary-reason",
|
|
35402
|
-
up:
|
|
35420
|
+
up: up892,
|
|
35403
35421
|
artifacts: {
|
|
35404
35422
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
35405
35423
|
}
|
|
@@ -35407,7 +35425,7 @@ var MIGRATIONS2 = [
|
|
|
35407
35425
|
{
|
|
35408
35426
|
version: 88,
|
|
35409
35427
|
name: "transcript-recovery-files",
|
|
35410
|
-
up:
|
|
35428
|
+
up: up902,
|
|
35411
35429
|
artifacts: {
|
|
35412
35430
|
tables: ["transcript_recovery_files"]
|
|
35413
35431
|
}
|
|
@@ -35415,7 +35433,7 @@ var MIGRATIONS2 = [
|
|
|
35415
35433
|
{
|
|
35416
35434
|
version: 89,
|
|
35417
35435
|
name: "job-cancellations",
|
|
35418
|
-
up:
|
|
35436
|
+
up: up912,
|
|
35419
35437
|
artifacts: {
|
|
35420
35438
|
tables: ["job_cancellations"]
|
|
35421
35439
|
}
|
|
@@ -35423,7 +35441,7 @@ var MIGRATIONS2 = [
|
|
|
35423
35441
|
{
|
|
35424
35442
|
version: 90,
|
|
35425
35443
|
name: "job-archive",
|
|
35426
|
-
up:
|
|
35444
|
+
up: up922,
|
|
35427
35445
|
artifacts: {
|
|
35428
35446
|
tables: ["job_archive"]
|
|
35429
35447
|
}
|
|
@@ -35431,25 +35449,25 @@ var MIGRATIONS2 = [
|
|
|
35431
35449
|
{
|
|
35432
35450
|
version: 91,
|
|
35433
35451
|
name: "embedding-index-generations",
|
|
35434
|
-
up:
|
|
35452
|
+
up: up932,
|
|
35435
35453
|
artifacts: { tables: ["embedding_index_state"] }
|
|
35436
35454
|
},
|
|
35437
35455
|
{
|
|
35438
35456
|
version: 92,
|
|
35439
35457
|
name: "embedding-staging-store",
|
|
35440
|
-
up:
|
|
35458
|
+
up: up942,
|
|
35441
35459
|
artifacts: { tables: ["embeddings_staging"] }
|
|
35442
35460
|
},
|
|
35443
35461
|
{
|
|
35444
35462
|
version: 93,
|
|
35445
35463
|
name: "dreaming-evidence-cursor",
|
|
35446
|
-
up:
|
|
35464
|
+
up: up952,
|
|
35447
35465
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
35448
35466
|
},
|
|
35449
35467
|
{
|
|
35450
35468
|
version: 94,
|
|
35451
35469
|
name: "memory-kind",
|
|
35452
|
-
up:
|
|
35470
|
+
up: up962,
|
|
35453
35471
|
artifacts: {
|
|
35454
35472
|
columns: [
|
|
35455
35473
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -35460,35 +35478,35 @@ var MIGRATIONS2 = [
|
|
|
35460
35478
|
{
|
|
35461
35479
|
version: 95,
|
|
35462
35480
|
name: "compaction-recall-projections",
|
|
35463
|
-
up:
|
|
35481
|
+
up: up972
|
|
35464
35482
|
},
|
|
35465
35483
|
{
|
|
35466
35484
|
version: 96,
|
|
35467
35485
|
name: "retire-legacy-ingestion",
|
|
35468
|
-
up:
|
|
35486
|
+
up: up982
|
|
35469
35487
|
},
|
|
35470
35488
|
{
|
|
35471
35489
|
version: 97,
|
|
35472
35490
|
name: "dreaming-failure-backoff",
|
|
35473
|
-
up:
|
|
35491
|
+
up: up992,
|
|
35474
35492
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
35475
35493
|
},
|
|
35476
35494
|
{
|
|
35477
35495
|
version: 98,
|
|
35478
35496
|
name: "dreaming-evidence-exclusions",
|
|
35479
|
-
up:
|
|
35497
|
+
up: up1002,
|
|
35480
35498
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
35481
35499
|
},
|
|
35482
35500
|
{
|
|
35483
35501
|
version: 99,
|
|
35484
35502
|
name: "dreaming-tool-calls",
|
|
35485
|
-
up:
|
|
35503
|
+
up: up1012,
|
|
35486
35504
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
35487
35505
|
},
|
|
35488
35506
|
{
|
|
35489
35507
|
version: 100,
|
|
35490
35508
|
name: "dreaming-runbook",
|
|
35491
|
-
up:
|
|
35509
|
+
up: up1022,
|
|
35492
35510
|
artifacts: {
|
|
35493
35511
|
columns: [
|
|
35494
35512
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -35499,23 +35517,23 @@ var MIGRATIONS2 = [
|
|
|
35499
35517
|
{
|
|
35500
35518
|
version: 101,
|
|
35501
35519
|
name: "dreaming-attention",
|
|
35502
|
-
up:
|
|
35520
|
+
up: up1032,
|
|
35503
35521
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35504
35522
|
},
|
|
35505
35523
|
{
|
|
35506
35524
|
version: 102,
|
|
35507
35525
|
name: "attribute-semantic-memories",
|
|
35508
|
-
up:
|
|
35526
|
+
up: up1042
|
|
35509
35527
|
},
|
|
35510
35528
|
{
|
|
35511
35529
|
version: 103,
|
|
35512
35530
|
name: "semantic-memory-kind",
|
|
35513
|
-
up:
|
|
35531
|
+
up: up1052
|
|
35514
35532
|
},
|
|
35515
35533
|
{
|
|
35516
35534
|
version: 104,
|
|
35517
35535
|
name: "derived-memory-provenance",
|
|
35518
|
-
up:
|
|
35536
|
+
up: up1062,
|
|
35519
35537
|
artifacts: {
|
|
35520
35538
|
tables: ["derived_memory_sources"],
|
|
35521
35539
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -35524,12 +35542,12 @@ var MIGRATIONS2 = [
|
|
|
35524
35542
|
{
|
|
35525
35543
|
version: 105,
|
|
35526
35544
|
name: "agent-scoped-entity-name",
|
|
35527
|
-
up:
|
|
35545
|
+
up: up1072
|
|
35528
35546
|
},
|
|
35529
35547
|
{
|
|
35530
35548
|
version: 106,
|
|
35531
35549
|
name: "memory-review-after",
|
|
35532
|
-
up:
|
|
35550
|
+
up: up1082,
|
|
35533
35551
|
artifacts: {
|
|
35534
35552
|
columns: [{ table: "memories", column: "review_after" }]
|
|
35535
35553
|
}
|
|
@@ -35537,7 +35555,7 @@ var MIGRATIONS2 = [
|
|
|
35537
35555
|
{
|
|
35538
35556
|
version: 107,
|
|
35539
35557
|
name: "dreaming-pass-usage",
|
|
35540
|
-
up:
|
|
35558
|
+
up: up1092,
|
|
35541
35559
|
artifacts: {
|
|
35542
35560
|
columns: [
|
|
35543
35561
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -35551,7 +35569,7 @@ var MIGRATIONS2 = [
|
|
|
35551
35569
|
{
|
|
35552
35570
|
version: 108,
|
|
35553
35571
|
name: "embedding-usage",
|
|
35554
|
-
up:
|
|
35572
|
+
up: up1102,
|
|
35555
35573
|
artifacts: {
|
|
35556
35574
|
tables: ["embedding_usage"]
|
|
35557
35575
|
}
|
|
@@ -35559,7 +35577,7 @@ var MIGRATIONS2 = [
|
|
|
35559
35577
|
{
|
|
35560
35578
|
version: 109,
|
|
35561
35579
|
name: "telemetry-install",
|
|
35562
|
-
up:
|
|
35580
|
+
up: up1112,
|
|
35563
35581
|
artifacts: {
|
|
35564
35582
|
tables: ["telemetry_install"]
|
|
35565
35583
|
}
|
|
@@ -35567,12 +35585,12 @@ var MIGRATIONS2 = [
|
|
|
35567
35585
|
{
|
|
35568
35586
|
version: 110,
|
|
35569
35587
|
name: "memory-mention-join-index",
|
|
35570
|
-
up:
|
|
35588
|
+
up: up1122
|
|
35571
35589
|
},
|
|
35572
35590
|
{
|
|
35573
35591
|
version: 111,
|
|
35574
35592
|
name: "telemetry-first-use",
|
|
35575
|
-
up:
|
|
35593
|
+
up: up1132,
|
|
35576
35594
|
artifacts: {
|
|
35577
35595
|
columns: [
|
|
35578
35596
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -35583,7 +35601,7 @@ var MIGRATIONS2 = [
|
|
|
35583
35601
|
{
|
|
35584
35602
|
version: 112,
|
|
35585
35603
|
name: "telemetry-queue-ownership",
|
|
35586
|
-
up:
|
|
35604
|
+
up: up1142,
|
|
35587
35605
|
artifacts: {
|
|
35588
35606
|
columns: [
|
|
35589
35607
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -35595,7 +35613,7 @@ var MIGRATIONS2 = [
|
|
|
35595
35613
|
{
|
|
35596
35614
|
version: 113,
|
|
35597
35615
|
name: "session-claims",
|
|
35598
|
-
up:
|
|
35616
|
+
up: up1152,
|
|
35599
35617
|
artifacts: {
|
|
35600
35618
|
tables: ["session_claims"],
|
|
35601
35619
|
columns: [
|
|
@@ -35609,12 +35627,12 @@ var MIGRATIONS2 = [
|
|
|
35609
35627
|
{
|
|
35610
35628
|
version: 114,
|
|
35611
35629
|
name: "memory-traversal-hydration-index",
|
|
35612
|
-
up:
|
|
35630
|
+
up: up1162
|
|
35613
35631
|
},
|
|
35614
35632
|
{
|
|
35615
35633
|
version: 115,
|
|
35616
35634
|
name: "cross-agent-message-notifications",
|
|
35617
|
-
up:
|
|
35635
|
+
up: up1172,
|
|
35618
35636
|
artifacts: {
|
|
35619
35637
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
35620
35638
|
}
|
|
@@ -35622,7 +35640,7 @@ var MIGRATIONS2 = [
|
|
|
35622
35640
|
{
|
|
35623
35641
|
version: 116,
|
|
35624
35642
|
name: "acp-delivery-reconciliation",
|
|
35625
|
-
up:
|
|
35643
|
+
up: up1182,
|
|
35626
35644
|
artifacts: {
|
|
35627
35645
|
columns: [
|
|
35628
35646
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -35636,7 +35654,7 @@ var MIGRATIONS2 = [
|
|
|
35636
35654
|
{
|
|
35637
35655
|
version: 117,
|
|
35638
35656
|
name: "retire-summary-worker",
|
|
35639
|
-
up:
|
|
35657
|
+
up: up1192,
|
|
35640
35658
|
artifacts: {
|
|
35641
35659
|
columns: [
|
|
35642
35660
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -35647,24 +35665,24 @@ var MIGRATIONS2 = [
|
|
|
35647
35665
|
{
|
|
35648
35666
|
version: 118,
|
|
35649
35667
|
name: "queue-pressure-indices",
|
|
35650
|
-
up:
|
|
35668
|
+
up: up1202
|
|
35651
35669
|
},
|
|
35652
35670
|
{
|
|
35653
35671
|
version: 119,
|
|
35654
35672
|
name: "telemetry-version-observation",
|
|
35655
|
-
up:
|
|
35673
|
+
up: up1212,
|
|
35656
35674
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
35657
35675
|
},
|
|
35658
35676
|
{
|
|
35659
35677
|
version: 120,
|
|
35660
35678
|
name: "source-lifecycle-telemetry",
|
|
35661
|
-
up:
|
|
35679
|
+
up: up1222,
|
|
35662
35680
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
35663
35681
|
},
|
|
35664
35682
|
{
|
|
35665
35683
|
version: 121,
|
|
35666
35684
|
name: "telemetry-delivery-health",
|
|
35667
|
-
up:
|
|
35685
|
+
up: up1232,
|
|
35668
35686
|
artifacts: {
|
|
35669
35687
|
tables: ["telemetry_delivery_state"],
|
|
35670
35688
|
columns: [
|
|
@@ -35678,7 +35696,7 @@ var MIGRATIONS2 = [
|
|
|
35678
35696
|
{
|
|
35679
35697
|
version: 122,
|
|
35680
35698
|
name: "dreaming-evidence-retry",
|
|
35681
|
-
up:
|
|
35699
|
+
up: up1242,
|
|
35682
35700
|
artifacts: {
|
|
35683
35701
|
columns: [
|
|
35684
35702
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -35691,13 +35709,13 @@ var MIGRATIONS2 = [
|
|
|
35691
35709
|
{
|
|
35692
35710
|
version: 123,
|
|
35693
35711
|
name: "embedding-index-failures",
|
|
35694
|
-
up:
|
|
35712
|
+
up: up1252,
|
|
35695
35713
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
35696
35714
|
},
|
|
35697
35715
|
{
|
|
35698
35716
|
version: 124,
|
|
35699
35717
|
name: "import-derived-lifecycle",
|
|
35700
|
-
up:
|
|
35718
|
+
up: up1262,
|
|
35701
35719
|
artifacts: {
|
|
35702
35720
|
tables: ["imported_source_lifecycle"]
|
|
35703
35721
|
}
|
|
@@ -35705,77 +35723,77 @@ var MIGRATIONS2 = [
|
|
|
35705
35723
|
{
|
|
35706
35724
|
version: 125,
|
|
35707
35725
|
name: "memory-content-safety",
|
|
35708
|
-
up:
|
|
35726
|
+
up: up1272,
|
|
35709
35727
|
artifacts: { tables: ["memory_content_safety"] }
|
|
35710
35728
|
},
|
|
35711
35729
|
{
|
|
35712
35730
|
version: 126,
|
|
35713
35731
|
name: "dreaming-surprisal-attention",
|
|
35714
|
-
up:
|
|
35732
|
+
up: up1282,
|
|
35715
35733
|
artifacts: { tables: ["dreaming_attention"] }
|
|
35716
35734
|
},
|
|
35717
35735
|
{
|
|
35718
35736
|
version: 127,
|
|
35719
35737
|
name: "ontology-contradictions",
|
|
35720
|
-
up:
|
|
35738
|
+
up: up1292,
|
|
35721
35739
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
35722
35740
|
},
|
|
35723
35741
|
{
|
|
35724
35742
|
version: 128,
|
|
35725
35743
|
name: "bounded-queue-diagnostics",
|
|
35726
|
-
up:
|
|
35744
|
+
up: up1302
|
|
35727
35745
|
},
|
|
35728
35746
|
{
|
|
35729
35747
|
version: 129,
|
|
35730
35748
|
name: "retire-structural-jobs",
|
|
35731
|
-
up:
|
|
35749
|
+
up: up1312
|
|
35732
35750
|
},
|
|
35733
35751
|
{
|
|
35734
35752
|
version: 130,
|
|
35735
35753
|
name: "embedding-repair-state",
|
|
35736
|
-
up:
|
|
35754
|
+
up: up1322,
|
|
35737
35755
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
35738
35756
|
},
|
|
35739
35757
|
{
|
|
35740
35758
|
version: 131,
|
|
35741
35759
|
name: "dreaming-evidence-consumption",
|
|
35742
|
-
up:
|
|
35760
|
+
up: up1332,
|
|
35743
35761
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
35744
35762
|
},
|
|
35745
35763
|
{
|
|
35746
35764
|
version: 132,
|
|
35747
35765
|
name: "observer-scoped-epistemic-assertions",
|
|
35748
|
-
up:
|
|
35766
|
+
up: up1342,
|
|
35749
35767
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
35750
35768
|
},
|
|
35751
35769
|
{
|
|
35752
35770
|
version: 133,
|
|
35753
35771
|
name: "dreaming-memory-head",
|
|
35754
|
-
up:
|
|
35772
|
+
up: up1352,
|
|
35755
35773
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
35756
35774
|
},
|
|
35757
35775
|
{
|
|
35758
35776
|
version: 134,
|
|
35759
35777
|
name: "scope-memory-head-entries",
|
|
35760
|
-
up:
|
|
35778
|
+
up: up1362,
|
|
35761
35779
|
artifacts: { tables: ["memory_head_entries"] }
|
|
35762
35780
|
},
|
|
35763
35781
|
{
|
|
35764
35782
|
version: 135,
|
|
35765
35783
|
name: "memory-head-publication",
|
|
35766
|
-
up:
|
|
35784
|
+
up: up1372,
|
|
35767
35785
|
artifacts: { tables: ["memory_head_publications"] }
|
|
35768
35786
|
},
|
|
35769
35787
|
{
|
|
35770
35788
|
version: 136,
|
|
35771
35789
|
name: "memory-head-revisions",
|
|
35772
|
-
up:
|
|
35790
|
+
up: up1382,
|
|
35773
35791
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
35774
35792
|
},
|
|
35775
35793
|
{
|
|
35776
35794
|
version: 137,
|
|
35777
35795
|
name: "dreaming-head-manifest",
|
|
35778
|
-
up:
|
|
35796
|
+
up: up1392,
|
|
35779
35797
|
artifacts: {
|
|
35780
35798
|
columns: [
|
|
35781
35799
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -35786,7 +35804,7 @@ var MIGRATIONS2 = [
|
|
|
35786
35804
|
{
|
|
35787
35805
|
version: 138,
|
|
35788
35806
|
name: "bounded-status-projections",
|
|
35789
|
-
up:
|
|
35807
|
+
up: up1402,
|
|
35790
35808
|
artifacts: {
|
|
35791
35809
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
35792
35810
|
}
|
|
@@ -35794,31 +35812,31 @@ var MIGRATIONS2 = [
|
|
|
35794
35812
|
{
|
|
35795
35813
|
version: 139,
|
|
35796
35814
|
name: "native-source-sync-state",
|
|
35797
|
-
up:
|
|
35815
|
+
up: up1412,
|
|
35798
35816
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
35799
35817
|
},
|
|
35800
35818
|
{
|
|
35801
35819
|
version: 140,
|
|
35802
35820
|
name: "transcript-recovery-frontier",
|
|
35803
|
-
up:
|
|
35821
|
+
up: up1422,
|
|
35804
35822
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
35805
35823
|
},
|
|
35806
35824
|
{
|
|
35807
35825
|
version: 141,
|
|
35808
35826
|
name: "source-sync-checkpoints",
|
|
35809
|
-
up:
|
|
35827
|
+
up: up1432,
|
|
35810
35828
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
35811
35829
|
},
|
|
35812
35830
|
{
|
|
35813
35831
|
version: 142,
|
|
35814
35832
|
name: "source-sync-frontier",
|
|
35815
|
-
up:
|
|
35833
|
+
up: up1442,
|
|
35816
35834
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
35817
35835
|
},
|
|
35818
35836
|
{
|
|
35819
35837
|
version: 143,
|
|
35820
35838
|
name: "embedding-index-progress",
|
|
35821
|
-
up:
|
|
35839
|
+
up: up1452,
|
|
35822
35840
|
artifacts: {
|
|
35823
35841
|
columns: [
|
|
35824
35842
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -35834,19 +35852,19 @@ var MIGRATIONS2 = [
|
|
|
35834
35852
|
{
|
|
35835
35853
|
version: 144,
|
|
35836
35854
|
name: "memory-job-lease-token",
|
|
35837
|
-
up:
|
|
35855
|
+
up: up1462,
|
|
35838
35856
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
35839
35857
|
},
|
|
35840
35858
|
{
|
|
35841
35859
|
version: 145,
|
|
35842
35860
|
name: "dreaming-evidence-reviews",
|
|
35843
|
-
up:
|
|
35861
|
+
up: up1472,
|
|
35844
35862
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
35845
35863
|
},
|
|
35846
35864
|
{
|
|
35847
35865
|
version: 146,
|
|
35848
35866
|
name: "source-transcript-import",
|
|
35849
|
-
up:
|
|
35867
|
+
up: up1482,
|
|
35850
35868
|
artifacts: {
|
|
35851
35869
|
tables: [
|
|
35852
35870
|
"source_import_jobs",
|
|
@@ -35865,19 +35883,19 @@ var MIGRATIONS2 = [
|
|
|
35865
35883
|
{
|
|
35866
35884
|
version: 147,
|
|
35867
35885
|
name: "source-import-replay-file-slots",
|
|
35868
|
-
up:
|
|
35886
|
+
up: up1492,
|
|
35869
35887
|
artifacts: { tables: ["source_import_files"] }
|
|
35870
35888
|
},
|
|
35871
35889
|
{
|
|
35872
35890
|
version: 148,
|
|
35873
35891
|
name: "source-import-attempt-provenance",
|
|
35874
|
-
up:
|
|
35892
|
+
up: up1502,
|
|
35875
35893
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
35876
35894
|
},
|
|
35877
35895
|
{
|
|
35878
35896
|
version: 149,
|
|
35879
35897
|
name: "transcript-import-state-machine",
|
|
35880
|
-
up:
|
|
35898
|
+
up: up1512,
|
|
35881
35899
|
artifacts: {
|
|
35882
35900
|
columns: [
|
|
35883
35901
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -35889,7 +35907,7 @@ var MIGRATIONS2 = [
|
|
|
35889
35907
|
{
|
|
35890
35908
|
version: 150,
|
|
35891
35909
|
name: "memory-head-freshness",
|
|
35892
|
-
up:
|
|
35910
|
+
up: up1522,
|
|
35893
35911
|
artifacts: {
|
|
35894
35912
|
columns: [
|
|
35895
35913
|
{ table: "memory_md_heads", column: "is_current" },
|
|
@@ -35900,7 +35918,7 @@ var MIGRATIONS2 = [
|
|
|
35900
35918
|
{
|
|
35901
35919
|
version: 151,
|
|
35902
35920
|
name: "transcript-import-bytes",
|
|
35903
|
-
up:
|
|
35921
|
+
up: up153,
|
|
35904
35922
|
artifacts: {
|
|
35905
35923
|
tables: [
|
|
35906
35924
|
"source_import_chunks",
|
|
@@ -35925,6 +35943,12 @@ var MIGRATIONS2 = [
|
|
|
35925
35943
|
}))
|
|
35926
35944
|
]
|
|
35927
35945
|
}
|
|
35946
|
+
},
|
|
35947
|
+
{
|
|
35948
|
+
version: 152,
|
|
35949
|
+
name: "memory-artifact-sha-index",
|
|
35950
|
+
up: up210,
|
|
35951
|
+
artifacts: { indexes: ["idx_memory_artifacts_agent_sha"] }
|
|
35928
35952
|
}
|
|
35929
35953
|
];
|
|
35930
35954
|
var LATEST_SCHEMA_VERSION2 = MIGRATIONS2[MIGRATIONS2.length - 1]?.version ?? 0;
|