@signetai/core 0.226.8 → 0.226.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 CHANGED
@@ -11783,6 +11783,31 @@ function up2(db) {
11783
11783
  `);
11784
11784
  }
11785
11785
 
11786
+ // src/migrations/154-transcript-capture-source-identity.ts
11787
+ function addColumnIfMissing(db, column, definition) {
11788
+ const columns = db.prepare("PRAGMA table_info(transcript_capture_jobs)").all();
11789
+ if (columns.some((row) => row.name === column))
11790
+ return;
11791
+ db.exec(`ALTER TABLE transcript_capture_jobs ADD COLUMN ${column} ${definition}`);
11792
+ }
11793
+ function up3(db) {
11794
+ const table = db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'transcript_capture_jobs'").get();
11795
+ if (!table?.present)
11796
+ return;
11797
+ addColumnIfMissing(db, "source_identity", "TEXT");
11798
+ addColumnIfMissing(db, "source_sha256", "TEXT");
11799
+ addColumnIfMissing(db, "source_size_bytes", "INTEGER");
11800
+ addColumnIfMissing(db, "source_mtime_ms", "REAL");
11801
+ addColumnIfMissing(db, "source_format", "TEXT");
11802
+ addColumnIfMissing(db, "audit_path", "TEXT");
11803
+ db.exec(`
11804
+ CREATE INDEX IF NOT EXISTS idx_transcript_capture_jobs_source_identity
11805
+ ON transcript_capture_jobs(agent_id, source_identity, status);
11806
+ CREATE INDEX IF NOT EXISTS idx_transcript_capture_jobs_source_digest
11807
+ ON transcript_capture_jobs(agent_id, source_sha256);
11808
+ `);
11809
+ }
11810
+
11786
11811
  // src/fts-schema.ts
11787
11812
  var MEMORIES_FTS_TOKENIZER = "unicode61";
11788
11813
  var FTS_STATE_TABLE = "memories_fts_state";
@@ -11950,7 +11975,7 @@ function memoriesFtsNeedsTokenizerRepair(sql) {
11950
11975
  }
11951
11976
 
11952
11977
  // src/migrations/001-baseline.ts
11953
- function up3(db) {
11978
+ function up4(db) {
11954
11979
  db.exec(`
11955
11980
  CREATE TABLE IF NOT EXISTS schema_migrations (
11956
11981
  version INTEGER PRIMARY KEY,
@@ -12045,27 +12070,27 @@ function hasColumn(db, table, column) {
12045
12070
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
12046
12071
  return rows.some((r) => r.name === column);
12047
12072
  }
12048
- function addColumnIfMissing(db, table, column, definition) {
12073
+ function addColumnIfMissing2(db, table, column, definition) {
12049
12074
  if (!hasColumn(db, table, column)) {
12050
12075
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12051
12076
  }
12052
12077
  }
12053
- function up4(db) {
12054
- addColumnIfMissing(db, "memories", "content_hash", "TEXT");
12055
- addColumnIfMissing(db, "memories", "normalized_content", "TEXT");
12056
- addColumnIfMissing(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
12057
- addColumnIfMissing(db, "memories", "deleted_at", "TEXT");
12058
- addColumnIfMissing(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
12059
- addColumnIfMissing(db, "memories", "embedding_model", "TEXT");
12060
- addColumnIfMissing(db, "memories", "extraction_model", "TEXT");
12061
- addColumnIfMissing(db, "memories", "update_count", "INTEGER DEFAULT 0");
12062
- addColumnIfMissing(db, "memories", "who", "TEXT");
12063
- addColumnIfMissing(db, "memories", "why", "TEXT");
12064
- addColumnIfMissing(db, "memories", "project", "TEXT");
12065
- addColumnIfMissing(db, "memories", "pinned", "INTEGER DEFAULT 0");
12066
- addColumnIfMissing(db, "memories", "importance", "REAL DEFAULT 0.5");
12067
- addColumnIfMissing(db, "memories", "last_accessed", "TEXT");
12068
- addColumnIfMissing(db, "memories", "access_count", "INTEGER DEFAULT 0");
12078
+ function up5(db) {
12079
+ addColumnIfMissing2(db, "memories", "content_hash", "TEXT");
12080
+ addColumnIfMissing2(db, "memories", "normalized_content", "TEXT");
12081
+ addColumnIfMissing2(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
12082
+ addColumnIfMissing2(db, "memories", "deleted_at", "TEXT");
12083
+ addColumnIfMissing2(db, "memories", "extraction_status", "TEXT DEFAULT 'none'");
12084
+ addColumnIfMissing2(db, "memories", "embedding_model", "TEXT");
12085
+ addColumnIfMissing2(db, "memories", "extraction_model", "TEXT");
12086
+ addColumnIfMissing2(db, "memories", "update_count", "INTEGER DEFAULT 0");
12087
+ addColumnIfMissing2(db, "memories", "who", "TEXT");
12088
+ addColumnIfMissing2(db, "memories", "why", "TEXT");
12089
+ addColumnIfMissing2(db, "memories", "project", "TEXT");
12090
+ addColumnIfMissing2(db, "memories", "pinned", "INTEGER DEFAULT 0");
12091
+ addColumnIfMissing2(db, "memories", "importance", "REAL DEFAULT 0.5");
12092
+ addColumnIfMissing2(db, "memories", "last_accessed", "TEXT");
12093
+ addColumnIfMissing2(db, "memories", "access_count", "INTEGER DEFAULT 0");
12069
12094
  db.exec(`
12070
12095
  CREATE TABLE IF NOT EXISTS memory_history (
12071
12096
  id TEXT PRIMARY KEY,
@@ -12163,16 +12188,16 @@ function up4(db) {
12163
12188
  }
12164
12189
 
12165
12190
  // src/migrations/003-unique-content-hash.ts
12166
- function addColumnIfMissing2(db, table, column, definition) {
12191
+ function addColumnIfMissing3(db, table, column, definition) {
12167
12192
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
12168
12193
  if (rows.some((r) => r.name === column))
12169
12194
  return false;
12170
12195
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12171
12196
  return true;
12172
12197
  }
12173
- function up5(db) {
12174
- addColumnIfMissing2(db, "memories", "why", "TEXT");
12175
- addColumnIfMissing2(db, "memories", "project", "TEXT");
12198
+ function up6(db) {
12199
+ addColumnIfMissing3(db, "memories", "why", "TEXT");
12200
+ addColumnIfMissing3(db, "memories", "project", "TEXT");
12176
12201
  db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
12177
12202
  db.exec(`
12178
12203
  UPDATE memories
@@ -12204,15 +12229,15 @@ function hasColumn2(db, table, column) {
12204
12229
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
12205
12230
  return rows.some((r) => r.name === column);
12206
12231
  }
12207
- function addColumnIfMissing3(db, table, column, definition) {
12232
+ function addColumnIfMissing4(db, table, column, definition) {
12208
12233
  if (!hasColumn2(db, table, column)) {
12209
12234
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12210
12235
  }
12211
12236
  }
12212
- function up6(db) {
12213
- addColumnIfMissing3(db, "memory_history", "actor_type", "TEXT");
12214
- addColumnIfMissing3(db, "memory_history", "session_id", "TEXT");
12215
- addColumnIfMissing3(db, "memory_history", "request_id", "TEXT");
12237
+ function up7(db) {
12238
+ addColumnIfMissing4(db, "memory_history", "actor_type", "TEXT");
12239
+ addColumnIfMissing4(db, "memory_history", "session_id", "TEXT");
12240
+ addColumnIfMissing4(db, "memory_history", "request_id", "TEXT");
12216
12241
  db.exec(`
12217
12242
  CREATE INDEX IF NOT EXISTS idx_memories_deleted_at
12218
12243
  ON memories(deleted_at)
@@ -12239,21 +12264,21 @@ function hasColumn3(db, table, column) {
12239
12264
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
12240
12265
  return rows.some((r) => r.name === column);
12241
12266
  }
12242
- function addColumnIfMissing4(db, table, column, definition) {
12267
+ function addColumnIfMissing5(db, table, column, definition) {
12243
12268
  if (!hasColumn3(db, table, column)) {
12244
12269
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12245
12270
  }
12246
12271
  }
12247
- function up7(db) {
12248
- addColumnIfMissing4(db, "entities", "canonical_name", "TEXT");
12249
- addColumnIfMissing4(db, "entities", "mentions", "INTEGER DEFAULT 0");
12250
- addColumnIfMissing4(db, "entities", "embedding", "BLOB");
12251
- addColumnIfMissing4(db, "relations", "mentions", "INTEGER DEFAULT 1");
12252
- addColumnIfMissing4(db, "relations", "confidence", "REAL DEFAULT 0.5");
12253
- addColumnIfMissing4(db, "relations", "updated_at", "TEXT");
12254
- addColumnIfMissing4(db, "memory_entity_mentions", "mention_text", "TEXT");
12255
- addColumnIfMissing4(db, "memory_entity_mentions", "confidence", "REAL");
12256
- addColumnIfMissing4(db, "memory_entity_mentions", "created_at", "TEXT");
12272
+ function up8(db) {
12273
+ addColumnIfMissing5(db, "entities", "canonical_name", "TEXT");
12274
+ addColumnIfMissing5(db, "entities", "mentions", "INTEGER DEFAULT 0");
12275
+ addColumnIfMissing5(db, "entities", "embedding", "BLOB");
12276
+ addColumnIfMissing5(db, "relations", "mentions", "INTEGER DEFAULT 1");
12277
+ addColumnIfMissing5(db, "relations", "confidence", "REAL DEFAULT 0.5");
12278
+ addColumnIfMissing5(db, "relations", "updated_at", "TEXT");
12279
+ addColumnIfMissing5(db, "memory_entity_mentions", "mention_text", "TEXT");
12280
+ addColumnIfMissing5(db, "memory_entity_mentions", "confidence", "REAL");
12281
+ addColumnIfMissing5(db, "memory_entity_mentions", "created_at", "TEXT");
12257
12282
  db.exec("CREATE INDEX IF NOT EXISTS idx_entities_canonical_name ON entities(canonical_name)");
12258
12283
  db.exec("CREATE INDEX IF NOT EXISTS idx_relations_composite ON relations(source_entity_id, relation_type)");
12259
12284
  }
@@ -12263,7 +12288,7 @@ function hasColumn4(db, table, column) {
12263
12288
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
12264
12289
  return rows.some((r) => r.name === column);
12265
12290
  }
12266
- function up8(db) {
12291
+ function up9(db) {
12267
12292
  if (!hasColumn4(db, "memories", "idempotency_key")) {
12268
12293
  db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
12269
12294
  }
@@ -12280,7 +12305,7 @@ function hasColumn5(db, table, column) {
12280
12305
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
12281
12306
  return rows.some((r) => r.name === column);
12282
12307
  }
12283
- function up9(db) {
12308
+ function up10(db) {
12284
12309
  db.exec(`
12285
12310
  CREATE TABLE IF NOT EXISTS documents (
12286
12311
  id TEXT PRIMARY KEY,
@@ -12339,7 +12364,7 @@ function up9(db) {
12339
12364
  }
12340
12365
 
12341
12366
  // src/migrations/008-embeddings-unique-hash.ts
12342
- function up10(db) {
12367
+ function up11(db) {
12343
12368
  const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
12344
12369
  if (tables.length === 0)
12345
12370
  return;
@@ -12358,7 +12383,7 @@ function up10(db) {
12358
12383
  }
12359
12384
 
12360
12385
  // src/migrations/009-summary-jobs.ts
12361
- function up11(db) {
12386
+ function up12(db) {
12362
12387
  db.exec(`
12363
12388
  CREATE TABLE IF NOT EXISTS summary_jobs (
12364
12389
  id TEXT PRIMARY KEY,
@@ -12380,7 +12405,7 @@ function up11(db) {
12380
12405
  }
12381
12406
 
12382
12407
  // src/migrations/010-umap-cache.ts
12383
- function up12(db) {
12408
+ function up13(db) {
12384
12409
  db.exec(`
12385
12410
  CREATE TABLE IF NOT EXISTS umap_cache (
12386
12411
  id INTEGER PRIMARY KEY,
@@ -12393,7 +12418,7 @@ function up12(db) {
12393
12418
  }
12394
12419
 
12395
12420
  // src/migrations/011-session-scores.ts
12396
- function up13(db) {
12421
+ function up14(db) {
12397
12422
  db.exec(`
12398
12423
  CREATE TABLE IF NOT EXISTS session_scores (
12399
12424
  id TEXT PRIMARY KEY,
@@ -12415,7 +12440,7 @@ function up13(db) {
12415
12440
  }
12416
12441
 
12417
12442
  // src/migrations/012-scheduled-tasks.ts
12418
- function up14(db) {
12443
+ function up15(db) {
12419
12444
  db.exec(`
12420
12445
  CREATE TABLE IF NOT EXISTS scheduled_tasks (
12421
12446
  id TEXT PRIMARY KEY,
@@ -12452,13 +12477,13 @@ function up14(db) {
12452
12477
  }
12453
12478
 
12454
12479
  // src/migrations/013-ingestion-tracking.ts
12455
- function addColumnIfMissing5(db, table, column, definition) {
12480
+ function addColumnIfMissing6(db, table, column, definition) {
12456
12481
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
12457
12482
  if (!cols.some((c) => c.name === column)) {
12458
12483
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12459
12484
  }
12460
12485
  }
12461
- function up15(db) {
12486
+ function up16(db) {
12462
12487
  db.exec(`
12463
12488
  CREATE TABLE IF NOT EXISTS ingestion_jobs (
12464
12489
  id TEXT PRIMARY KEY,
@@ -12481,12 +12506,12 @@ function up15(db) {
12481
12506
  CREATE INDEX IF NOT EXISTS idx_ingestion_jobs_source_path
12482
12507
  ON ingestion_jobs(source_path);
12483
12508
  `);
12484
- addColumnIfMissing5(db, "memories", "source_path", "TEXT");
12485
- addColumnIfMissing5(db, "memories", "source_section", "TEXT");
12509
+ addColumnIfMissing6(db, "memories", "source_path", "TEXT");
12510
+ addColumnIfMissing6(db, "memories", "source_section", "TEXT");
12486
12511
  }
12487
12512
 
12488
12513
  // src/migrations/014-telemetry.ts
12489
- function up16(db) {
12514
+ function up17(db) {
12490
12515
  db.exec(`
12491
12516
  CREATE TABLE IF NOT EXISTS telemetry_events (
12492
12517
  id TEXT PRIMARY KEY,
@@ -12507,13 +12532,13 @@ function up16(db) {
12507
12532
  }
12508
12533
 
12509
12534
  // src/migrations/015-session-memories.ts
12510
- function addColumnIfMissing6(db, table, column, definition) {
12535
+ function addColumnIfMissing7(db, table, column, definition) {
12511
12536
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
12512
12537
  if (!cols.some((c) => c.name === column)) {
12513
12538
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12514
12539
  }
12515
12540
  }
12516
- function up17(db) {
12541
+ function up18(db) {
12517
12542
  db.exec(`
12518
12543
  CREATE TABLE IF NOT EXISTS session_memories (
12519
12544
  id TEXT PRIMARY KEY,
@@ -12537,12 +12562,12 @@ function up17(db) {
12537
12562
  CREATE INDEX IF NOT EXISTS idx_session_memories_memory
12538
12563
  ON session_memories(memory_id);
12539
12564
  `);
12540
- addColumnIfMissing6(db, "session_scores", "confidence", "REAL");
12541
- addColumnIfMissing6(db, "session_scores", "continuity_reasoning", "TEXT");
12565
+ addColumnIfMissing7(db, "session_scores", "confidence", "REAL");
12566
+ addColumnIfMissing7(db, "session_scores", "continuity_reasoning", "TEXT");
12542
12567
  }
12543
12568
 
12544
12569
  // src/migrations/016-session-checkpoints.ts
12545
- function up18(db) {
12570
+ function up19(db) {
12546
12571
  db.exec(`
12547
12572
  CREATE TABLE IF NOT EXISTS session_checkpoints (
12548
12573
  id TEXT PRIMARY KEY,
@@ -12566,7 +12591,7 @@ function up18(db) {
12566
12591
  }
12567
12592
 
12568
12593
  // src/migrations/017-task-skills.ts
12569
- function up19(db) {
12594
+ function up20(db) {
12570
12595
  const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
12571
12596
  const colNames = new Set(cols.flatMap((c) => typeof c.name === "string" ? [c.name] : []));
12572
12597
  if (!colNames.has("skill_name")) {
@@ -12579,7 +12604,7 @@ function up19(db) {
12579
12604
  }
12580
12605
 
12581
12606
  // src/migrations/018-skill-meta.ts
12582
- function up20(db) {
12607
+ function up21(db) {
12583
12608
  const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
12584
12609
  if (existing)
12585
12610
  return;
@@ -12613,7 +12638,7 @@ function up20(db) {
12613
12638
  }
12614
12639
 
12615
12640
  // src/migrations/019-knowledge-structure.ts
12616
- function up21(db) {
12641
+ function up22(db) {
12617
12642
  const entityCols = db.prepare("PRAGMA table_info(entities)").all();
12618
12643
  const entityColNames = new Set(entityCols.flatMap((c) => typeof c.name === "string" ? [c.name] : []));
12619
12644
  if (!entityColNames.has("agent_id")) {
@@ -12694,21 +12719,21 @@ function up21(db) {
12694
12719
  }
12695
12720
 
12696
12721
  // src/migrations/020-predictor-comparisons.ts
12697
- function addColumnIfMissing7(db, table, column, definition) {
12722
+ function addColumnIfMissing8(db, table, column, definition) {
12698
12723
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
12699
12724
  if (!cols.some((c) => c.name === column)) {
12700
12725
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12701
12726
  }
12702
12727
  }
12703
- function up22(db) {
12704
- addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
12705
- addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
12706
- addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
12707
- addColumnIfMissing7(db, "session_memories", "structural_density", "INTEGER");
12728
+ function up23(db) {
12729
+ addColumnIfMissing8(db, "session_memories", "entity_slot", "INTEGER");
12730
+ addColumnIfMissing8(db, "session_memories", "aspect_slot", "INTEGER");
12731
+ addColumnIfMissing8(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
12732
+ addColumnIfMissing8(db, "session_memories", "structural_density", "INTEGER");
12708
12733
  }
12709
12734
 
12710
12735
  // src/migrations/021-checkpoint-structural.ts
12711
- function up23(db) {
12736
+ function up24(db) {
12712
12737
  const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
12713
12738
  const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
12714
12739
  if (!columnNames.has("focal_entity_ids")) {
@@ -12729,41 +12754,41 @@ function up23(db) {
12729
12754
  }
12730
12755
 
12731
12756
  // src/migrations/022-entity-pinning.ts
12732
- function addColumnIfMissing8(db, table, column, definition) {
12757
+ function addColumnIfMissing9(db, table, column, definition) {
12733
12758
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
12734
12759
  if (!cols.some((c) => c.name === column)) {
12735
12760
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12736
12761
  }
12737
12762
  }
12738
- function up24(db) {
12739
- addColumnIfMissing8(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
12740
- addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
12763
+ function up25(db) {
12764
+ addColumnIfMissing9(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
12765
+ addColumnIfMissing9(db, "entities", "pinned_at", "TEXT");
12741
12766
  db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
12742
12767
  }
12743
12768
 
12744
12769
  // src/migrations/023-predictor-columns.ts
12745
- function up25(_db) {}
12770
+ function up26(_db) {}
12746
12771
 
12747
12772
  // src/migrations/024-predictor-comparison-columns.ts
12748
- function up26(_db) {}
12773
+ function up27(_db) {}
12749
12774
 
12750
12775
  // src/migrations/025-agent-feedback.ts
12751
- function addColumnIfMissing9(db, table, column, definition) {
12776
+ function addColumnIfMissing10(db, table, column, definition) {
12752
12777
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
12753
12778
  if (!cols.some((c) => c.name === column)) {
12754
12779
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
12755
12780
  }
12756
12781
  }
12757
- function up27(db) {
12758
- addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
12759
- addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
12782
+ function up28(db) {
12783
+ addColumnIfMissing10(db, "session_memories", "agent_relevance_score", "REAL");
12784
+ addColumnIfMissing10(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
12760
12785
  }
12761
12786
 
12762
12787
  // src/migrations/026-predictor-training-pairs.ts
12763
- function up28(_db) {}
12788
+ function up29(_db) {}
12764
12789
 
12765
12790
  // src/migrations/027-backfill-canonical-names.ts
12766
- function up29(db) {
12791
+ function up30(db) {
12767
12792
  db.exec(`
12768
12793
  UPDATE entities
12769
12794
  SET canonical_name = REPLACE(REPLACE(REPLACE(
@@ -12774,7 +12799,7 @@ function up29(db) {
12774
12799
  }
12775
12800
 
12776
12801
  // src/migrations/028-lossless-retention.ts
12777
- function up30(db) {
12802
+ function up31(db) {
12778
12803
  db.exec(`
12779
12804
  CREATE TABLE IF NOT EXISTS memories_cold (
12780
12805
  archive_id TEXT PRIMARY KEY,
@@ -12813,7 +12838,7 @@ function up30(db) {
12813
12838
  }
12814
12839
 
12815
12840
  // src/migrations/029-session-summary-dag.ts
12816
- function up31(db) {
12841
+ function up32(db) {
12817
12842
  db.exec(`
12818
12843
  CREATE TABLE IF NOT EXISTS session_summaries (
12819
12844
  id TEXT PRIMARY KEY,
@@ -12860,7 +12885,7 @@ function up31(db) {
12860
12885
  }
12861
12886
 
12862
12887
  // src/migrations/030-nullable-memory-job-memory-id.ts
12863
- function up32(db) {
12888
+ function up33(db) {
12864
12889
  db.exec(`
12865
12890
  CREATE TABLE IF NOT EXISTS memory_jobs_new (
12866
12891
  id TEXT PRIMARY KEY,
@@ -12907,7 +12932,7 @@ function up32(db) {
12907
12932
  }
12908
12933
 
12909
12934
  // src/migrations/031-dependency-reason.ts
12910
- function up33(db) {
12935
+ function up34(db) {
12911
12936
  const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
12912
12937
  if (!depCols.some((c) => c.name === "reason")) {
12913
12938
  db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
@@ -12919,7 +12944,7 @@ function up33(db) {
12919
12944
  }
12920
12945
 
12921
12946
  // src/migrations/032-embeddings-vector-column.ts
12922
- function up34(db) {
12947
+ function up35(db) {
12923
12948
  const cols = db.prepare("PRAGMA table_info(embeddings)").all();
12924
12949
  if (cols.length === 0)
12925
12950
  return;
@@ -12929,7 +12954,7 @@ function up34(db) {
12929
12954
  }
12930
12955
 
12931
12956
  // src/migrations/033-scope.ts
12932
- function up35(db) {
12957
+ function up36(db) {
12933
12958
  const cols = db.prepare("PRAGMA table_info(memories)").all();
12934
12959
  if (!cols.some((c) => c.name === "scope")) {
12935
12960
  db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
@@ -12938,7 +12963,7 @@ function up35(db) {
12938
12963
  }
12939
12964
 
12940
12965
  // src/migrations/034-scope-aware-dedup.ts
12941
- function up36(db) {
12966
+ function up37(db) {
12942
12967
  db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
12943
12968
  db.exec(`
12944
12969
  CREATE UNIQUE INDEX idx_memories_content_hash_unique
@@ -12948,7 +12973,7 @@ function up36(db) {
12948
12973
  }
12949
12974
 
12950
12975
  // src/migrations/035-entity-fts.ts
12951
- function up37(db) {
12976
+ function up38(db) {
12952
12977
  db.exec(`
12953
12978
  CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
12954
12979
  name, canonical_name,
@@ -12982,7 +13007,7 @@ function up37(db) {
12982
13007
  }
12983
13008
 
12984
13009
  // src/migrations/036-dependency-confidence.ts
12985
- function up38(db) {
13010
+ function up39(db) {
12986
13011
  const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
12987
13012
  if (!cols.some((c) => c.name === "confidence")) {
12988
13013
  db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
@@ -12990,7 +13015,7 @@ function up38(db) {
12990
13015
  }
12991
13016
 
12992
13017
  // src/migrations/037-entity-communities.ts
12993
- function up39(db) {
13018
+ function up40(db) {
12994
13019
  db.exec(`
12995
13020
  CREATE TABLE IF NOT EXISTS entity_communities (
12996
13021
  id TEXT PRIMARY KEY,
@@ -13010,7 +13035,7 @@ function up39(db) {
13010
13035
  }
13011
13036
 
13012
13037
  // src/migrations/038-memory-hints.ts
13013
- function up40(db) {
13038
+ function up41(db) {
13014
13039
  db.exec(`
13015
13040
  CREATE TABLE IF NOT EXISTS memory_hints (
13016
13041
  id TEXT PRIMARY KEY,
@@ -13052,7 +13077,7 @@ function up40(db) {
13052
13077
  }
13053
13078
 
13054
13079
  // src/migrations/039-dedup-entity-dependencies.ts
13055
- function up41(db) {
13080
+ function up42(db) {
13056
13081
  db.exec(`
13057
13082
  DELETE FROM entity_dependencies
13058
13083
  WHERE id NOT IN (
@@ -13072,7 +13097,7 @@ function up41(db) {
13072
13097
  }
13073
13098
 
13074
13099
  // src/migrations/040-session-transcripts.ts
13075
- function up42(db) {
13100
+ function up43(db) {
13076
13101
  db.exec(`
13077
13102
  CREATE TABLE IF NOT EXISTS session_transcripts (
13078
13103
  session_key TEXT PRIMARY KEY,
@@ -13091,14 +13116,14 @@ function up42(db) {
13091
13116
  }
13092
13117
 
13093
13118
  // src/migrations/041-path-feedback.ts
13094
- function addColumnIfMissing10(db, table, column, definition) {
13119
+ function addColumnIfMissing11(db, table, column, definition) {
13095
13120
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
13096
13121
  if (!cols.some((c) => c.name === column)) {
13097
13122
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
13098
13123
  }
13099
13124
  }
13100
- function up43(db) {
13101
- addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
13125
+ function up44(db) {
13126
+ addColumnIfMissing11(db, "session_memories", "path_json", "TEXT");
13102
13127
  db.exec(`
13103
13128
  CREATE TABLE IF NOT EXISTS path_feedback_events (
13104
13129
  id TEXT PRIMARY KEY,
@@ -13168,21 +13193,21 @@ function up43(db) {
13168
13193
  }
13169
13194
 
13170
13195
  // src/migrations/042-session-memories-agent-id.ts
13171
- function addColumnIfMissing11(db, table, column, definition) {
13196
+ function addColumnIfMissing12(db, table, column, definition) {
13172
13197
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
13173
13198
  if (cols.some((col) => col.name === column))
13174
13199
  return;
13175
13200
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
13176
13201
  }
13177
- function up44(db) {
13178
- addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
13179
- addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
13180
- addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
13181
- addColumnIfMissing11(db, "session_memories", "structural_density", "INTEGER");
13182
- addColumnIfMissing11(db, "session_memories", "predictor_rank", "INTEGER");
13183
- addColumnIfMissing11(db, "session_memories", "agent_relevance_score", "REAL");
13184
- addColumnIfMissing11(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
13185
- addColumnIfMissing11(db, "session_memories", "path_json", "TEXT");
13202
+ function up45(db) {
13203
+ addColumnIfMissing12(db, "session_memories", "entity_slot", "INTEGER");
13204
+ addColumnIfMissing12(db, "session_memories", "aspect_slot", "INTEGER");
13205
+ addColumnIfMissing12(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
13206
+ addColumnIfMissing12(db, "session_memories", "structural_density", "INTEGER");
13207
+ addColumnIfMissing12(db, "session_memories", "predictor_rank", "INTEGER");
13208
+ addColumnIfMissing12(db, "session_memories", "agent_relevance_score", "REAL");
13209
+ addColumnIfMissing12(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
13210
+ addColumnIfMissing12(db, "session_memories", "path_json", "TEXT");
13186
13211
  const cols = db.prepare("PRAGMA table_info(session_memories)").all();
13187
13212
  const hasAgent = cols.some((col) => col.name === "agent_id");
13188
13213
  const agentExpr = hasAgent ? "COALESCE(NULLIF(agent_id, ''), 'default')" : "'default'";
@@ -13258,13 +13283,13 @@ function up44(db) {
13258
13283
  }
13259
13284
 
13260
13285
  // src/migrations/043-agents-table.ts
13261
- function addColumnIfMissing12(db, table, column, definition) {
13286
+ function addColumnIfMissing13(db, table, column, definition) {
13262
13287
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
13263
13288
  if (cols.some((c) => c.name === column))
13264
13289
  return;
13265
13290
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
13266
13291
  }
13267
- function up45(db) {
13292
+ function up46(db) {
13268
13293
  db.exec(`
13269
13294
  CREATE TABLE IF NOT EXISTS agents (
13270
13295
  id TEXT PRIMARY KEY,
@@ -13278,8 +13303,8 @@ function up45(db) {
13278
13303
  const now = new Date().toISOString();
13279
13304
  db.prepare(`INSERT OR IGNORE INTO agents (id, name, read_policy, created_at, updated_at)
13280
13305
  VALUES ('default', 'default', 'shared', ?, ?)`).run(now, now);
13281
- addColumnIfMissing12(db, "memories", "agent_id", "TEXT DEFAULT 'default'");
13282
- addColumnIfMissing12(db, "memories", "visibility", "TEXT DEFAULT 'global'");
13306
+ addColumnIfMissing13(db, "memories", "agent_id", "TEXT DEFAULT 'default'");
13307
+ addColumnIfMissing13(db, "memories", "visibility", "TEXT DEFAULT 'global'");
13283
13308
  db.exec(`
13284
13309
  CREATE INDEX IF NOT EXISTS idx_memories_agent_id
13285
13310
  ON memories(agent_id);
@@ -13289,16 +13314,16 @@ function up45(db) {
13289
13314
  }
13290
13315
 
13291
13316
  // src/migrations/044-memory-md-temporal-head.ts
13292
- function addColumnIfMissing13(db, table, column, definition) {
13317
+ function addColumnIfMissing14(db, table, column, definition) {
13293
13318
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
13294
13319
  if (cols.some((c) => c.name === column))
13295
13320
  return;
13296
13321
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
13297
13322
  }
13298
- function up46(db) {
13299
- addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
13300
- addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
13301
- addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
13323
+ function up47(db) {
13324
+ addColumnIfMissing14(db, "session_summaries", "source_type", "TEXT");
13325
+ addColumnIfMissing14(db, "session_summaries", "source_ref", "TEXT");
13326
+ addColumnIfMissing14(db, "session_summaries", "meta_json", "TEXT");
13302
13327
  db.exec(`
13303
13328
  UPDATE session_summaries
13304
13329
  SET source_type = CASE
@@ -13317,16 +13342,16 @@ function up46(db) {
13317
13342
  }
13318
13343
 
13319
13344
  // src/migrations/045-lossless-working-memory-hardening.ts
13320
- function addColumnIfMissing14(db, table, column, definition) {
13345
+ function addColumnIfMissing15(db, table, column, definition) {
13321
13346
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
13322
13347
  if (cols.some((col) => col.name === column))
13323
13348
  return;
13324
13349
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
13325
13350
  }
13326
- function up47(db) {
13327
- addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
13328
- addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
13329
- addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
13351
+ function up48(db) {
13352
+ addColumnIfMissing15(db, "session_transcripts", "updated_at", "TEXT");
13353
+ addColumnIfMissing15(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
13354
+ addColumnIfMissing15(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
13330
13355
  db.exec(`
13331
13356
  UPDATE session_transcripts
13332
13357
  SET updated_at = COALESCE(updated_at, created_at)
@@ -13396,7 +13421,7 @@ function up47(db) {
13396
13421
  }
13397
13422
 
13398
13423
  // src/migrations/046-session-summary-uniqueness.ts
13399
- function up48(db) {
13424
+ function up49(db) {
13400
13425
  db.exec(`
13401
13426
  DROP INDEX IF EXISTS idx_summaries_session_depth;
13402
13427
 
@@ -13459,7 +13484,7 @@ function up48(db) {
13459
13484
  }
13460
13485
 
13461
13486
  // src/migrations/047-agent-scoped-temporal-uniqueness.ts
13462
- function up49(db) {
13487
+ function up50(db) {
13463
13488
  db.exec(`
13464
13489
  DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
13465
13490
  DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
@@ -13559,7 +13584,7 @@ function up49(db) {
13559
13584
  }
13560
13585
 
13561
13586
  // src/migrations/048-thread-heads.ts
13562
- function up50(db) {
13587
+ function up51(db) {
13563
13588
  db.exec(`
13564
13589
  CREATE TABLE IF NOT EXISTS memory_thread_heads (
13565
13590
  agent_id TEXT NOT NULL DEFAULT 'default',
@@ -13679,7 +13704,7 @@ function up50(db) {
13679
13704
  }
13680
13705
 
13681
13706
  // src/migrations/049-session-extract-cursors.ts
13682
- function up51(db) {
13707
+ function up52(db) {
13683
13708
  db.exec(`
13684
13709
  CREATE TABLE IF NOT EXISTS session_extract_cursors (
13685
13710
  session_key TEXT NOT NULL,
@@ -13698,7 +13723,7 @@ function hasTable(db, name) {
13698
13723
  WHERE type = 'table' AND name = ?
13699
13724
  LIMIT 1`).get(name) !== undefined;
13700
13725
  }
13701
- function up52(db) {
13726
+ function up53(db) {
13702
13727
  db.exec(`
13703
13728
  CREATE TABLE IF NOT EXISTS entity_dependency_history (
13704
13729
  id TEXT PRIMARY KEY,
@@ -13864,18 +13889,18 @@ function up52(db) {
13864
13889
  }
13865
13890
 
13866
13891
  // src/migrations/051-memory-md-rolling-window-lineage.ts
13867
- function addColumnIfMissing15(db, table, column, definition) {
13892
+ function addColumnIfMissing16(db, table, column, definition) {
13868
13893
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
13869
13894
  if (cols.some((col) => col.name === column))
13870
13895
  return;
13871
13896
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
13872
13897
  }
13873
- function up53(db) {
13874
- addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
13875
- addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
13876
- addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
13877
- addColumnIfMissing15(db, "summary_jobs", "started_at", "TEXT");
13878
- addColumnIfMissing15(db, "summary_jobs", "ended_at", "TEXT");
13898
+ function up54(db) {
13899
+ addColumnIfMissing16(db, "summary_jobs", "session_id", "TEXT");
13900
+ addColumnIfMissing16(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
13901
+ addColumnIfMissing16(db, "summary_jobs", "captured_at", "TEXT");
13902
+ addColumnIfMissing16(db, "summary_jobs", "started_at", "TEXT");
13903
+ addColumnIfMissing16(db, "summary_jobs", "ended_at", "TEXT");
13879
13904
  db.exec(`
13880
13905
  UPDATE summary_jobs
13881
13906
  SET
@@ -13964,7 +13989,7 @@ function up53(db) {
13964
13989
  }
13965
13990
 
13966
13991
  // src/migrations/052-mcp-invocations.ts
13967
- function up54(db) {
13992
+ function up55(db) {
13968
13993
  db.exec(`
13969
13994
  CREATE TABLE IF NOT EXISTS mcp_invocations (
13970
13995
  id TEXT PRIMARY KEY,
@@ -13983,7 +14008,7 @@ function up54(db) {
13983
14008
  }
13984
14009
 
13985
14010
  // src/migrations/053-skill-invocations.ts
13986
- function up55(db) {
14011
+ function up56(db) {
13987
14012
  db.exec(`
13988
14013
  CREATE TABLE IF NOT EXISTS skill_invocations (
13989
14014
  id TEXT PRIMARY KEY,
@@ -14001,7 +14026,7 @@ function up55(db) {
14001
14026
  }
14002
14027
 
14003
14028
  // src/migrations/054-task-agent-scope.ts
14004
- function up56(db) {
14029
+ function up57(db) {
14005
14030
  db.exec(`
14006
14031
  CREATE TABLE IF NOT EXISTS task_scope_hints (
14007
14032
  task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
@@ -14034,7 +14059,7 @@ function up56(db) {
14034
14059
  }
14035
14060
 
14036
14061
  // src/migrations/055-dreaming-state.ts
14037
- function up57(db) {
14062
+ function up58(db) {
14038
14063
  db.exec(`
14039
14064
  CREATE TABLE IF NOT EXISTS dreaming_state (
14040
14065
  agent_id TEXT PRIMARY KEY NOT NULL,
@@ -14079,7 +14104,7 @@ function ensureMemoriesScopeColumns(db) {
14079
14104
  if (!names.has("scope"))
14080
14105
  db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
14081
14106
  }
14082
- function up58(db) {
14107
+ function up59(db) {
14083
14108
  ensureMemoriesScopeColumns(db);
14084
14109
  db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
14085
14110
  db.exec(`
@@ -14094,7 +14119,7 @@ function up58(db) {
14094
14119
  }
14095
14120
 
14096
14121
  // src/migrations/057-memories-fts-tokenizer-repair.ts
14097
- function up59(db) {
14122
+ function up60(db) {
14098
14123
  const sql = readMemoriesFtsSql(db);
14099
14124
  if (sql !== null && !memoriesFtsNeedsTokenizerRepair(sql))
14100
14125
  return;
@@ -14102,7 +14127,7 @@ function up59(db) {
14102
14127
  }
14103
14128
 
14104
14129
  // src/migrations/058-knowledge-graph-indices.ts
14105
- function up60(db) {
14130
+ function up61(db) {
14106
14131
  db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
14107
14132
  ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
14108
14133
  db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
@@ -14111,7 +14136,7 @@ function up60(db) {
14111
14136
  }
14112
14137
 
14113
14138
  // src/migrations/059-entity-attribute-claim-key.ts
14114
- function up61(db) {
14139
+ function up62(db) {
14115
14140
  const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
14116
14141
  if (!cols.some((col) => col.name === "claim_key")) {
14117
14142
  db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
@@ -14122,7 +14147,7 @@ function up61(db) {
14122
14147
  }
14123
14148
 
14124
14149
  // src/migrations/060-entity-attribute-group-key.ts
14125
- function up62(db) {
14150
+ function up63(db) {
14126
14151
  const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
14127
14152
  if (!cols.some((col) => col.name === "group_key")) {
14128
14153
  db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
@@ -14136,7 +14161,7 @@ function up62(db) {
14136
14161
  }
14137
14162
 
14138
14163
  // src/migrations/061-memory-artifact-source-mtime.ts
14139
- function up63(db) {
14164
+ function up64(db) {
14140
14165
  const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
14141
14166
  if (cols.some((col) => col.name === "source_mtime_ms"))
14142
14167
  return;
@@ -14144,7 +14169,7 @@ function up63(db) {
14144
14169
  }
14145
14170
 
14146
14171
  // src/migrations/062-memory-artifact-soft-delete.ts
14147
- function up64(db) {
14172
+ function up65(db) {
14148
14173
  const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
14149
14174
  const names = new Set(cols.map((col) => col.name));
14150
14175
  if (!names.has("is_deleted")) {
@@ -14160,7 +14185,7 @@ function up64(db) {
14160
14185
  }
14161
14186
 
14162
14187
  // src/migrations/063-content-only-memories-fts-update.ts
14163
- function up65(db) {
14188
+ function up66(db) {
14164
14189
  db.exec("DROP TRIGGER IF EXISTS memories_au");
14165
14190
  db.exec(`
14166
14191
  CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
@@ -14175,17 +14200,17 @@ function hasColumn6(db, table, column) {
14175
14200
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
14176
14201
  return rows.some((row) => row.name === column);
14177
14202
  }
14178
- function addColumnIfMissing16(db, table, column, definition) {
14203
+ function addColumnIfMissing17(db, table, column, definition) {
14179
14204
  if (!hasColumn6(db, table, column)) {
14180
14205
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
14181
14206
  }
14182
14207
  }
14183
- function up66(db) {
14208
+ function up67(db) {
14184
14209
  for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
14185
- addColumnIfMissing16(db, table, "source_id", "TEXT");
14186
- addColumnIfMissing16(db, table, "source_kind", "TEXT");
14187
- addColumnIfMissing16(db, table, "source_path", "TEXT");
14188
- addColumnIfMissing16(db, table, "source_root", "TEXT");
14210
+ addColumnIfMissing17(db, table, "source_id", "TEXT");
14211
+ addColumnIfMissing17(db, table, "source_kind", "TEXT");
14212
+ addColumnIfMissing17(db, table, "source_path", "TEXT");
14213
+ addColumnIfMissing17(db, table, "source_root", "TEXT");
14189
14214
  }
14190
14215
  db.exec("CREATE INDEX IF NOT EXISTS idx_entities_source ON entities(agent_id, source_id, source_path)");
14191
14216
  db.exec("CREATE INDEX IF NOT EXISTS idx_entity_communities_source ON entity_communities(agent_id, source_id, source_path)");
@@ -14202,7 +14227,7 @@ function hasColumn7(db, table, column) {
14202
14227
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
14203
14228
  return rows.some((row) => row.name === column);
14204
14229
  }
14205
- function up67(db) {
14230
+ function up68(db) {
14206
14231
  if (!hasTable2(db, "embeddings"))
14207
14232
  return;
14208
14233
  if (!hasColumn7(db, "embeddings", "agent_id")) {
@@ -14212,7 +14237,7 @@ function up67(db) {
14212
14237
  }
14213
14238
 
14214
14239
  // src/migrations/066-memory-search-telemetry.ts
14215
- function up68(db) {
14240
+ function up69(db) {
14216
14241
  db.exec(`
14217
14242
  CREATE TABLE IF NOT EXISTS memory_search_telemetry (
14218
14243
  id TEXT PRIMARY KEY,
@@ -14250,12 +14275,12 @@ function hasColumn8(db, table, column) {
14250
14275
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
14251
14276
  return rows.some((row) => row.name === column);
14252
14277
  }
14253
- function addColumnIfMissing17(db, table, column, definition) {
14278
+ function addColumnIfMissing18(db, table, column, definition) {
14254
14279
  if (!hasColumn8(db, table, column)) {
14255
14280
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
14256
14281
  }
14257
14282
  }
14258
- function up69(db) {
14283
+ function up70(db) {
14259
14284
  db.exec(`
14260
14285
  CREATE TABLE IF NOT EXISTS ontology_proposals (
14261
14286
  id TEXT PRIMARY KEY,
@@ -14293,14 +14318,14 @@ function up69(db) {
14293
14318
  ON ontology_proposals(agent_id, source_kind, source_id);
14294
14319
  `);
14295
14320
  for (const table of ["entity_attributes", "entity_dependencies"]) {
14296
- addColumnIfMissing17(db, table, "proposal_id", "TEXT");
14297
- addColumnIfMissing17(db, table, "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
14321
+ addColumnIfMissing18(db, table, "proposal_id", "TEXT");
14322
+ addColumnIfMissing18(db, table, "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
14298
14323
  db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
14299
14324
  }
14300
14325
  }
14301
14326
 
14302
14327
  // src/migrations/068-daily-reflections.ts
14303
- function up70(db) {
14328
+ function up71(db) {
14304
14329
  db.exec(`
14305
14330
  CREATE TABLE IF NOT EXISTS daily_reflections (
14306
14331
  id TEXT PRIMARY KEY,
@@ -14329,7 +14354,7 @@ function up70(db) {
14329
14354
  }
14330
14355
 
14331
14356
  // src/migrations/069-daily-reflections-multiple-insights.ts
14332
- function up71(db) {
14357
+ function up72(db) {
14333
14358
  const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
14334
14359
  const colNames = new Set(cols.flatMap((c) => typeof c.name === "string" ? [c.name] : []));
14335
14360
  if (!colNames.has("content_key")) {
@@ -14356,7 +14381,7 @@ function hasColumn9(db, table, column) {
14356
14381
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
14357
14382
  return rows.some((row) => row.name === column);
14358
14383
  }
14359
- function addColumnIfMissing18(db, table, column, definition) {
14384
+ function addColumnIfMissing19(db, table, column, definition) {
14360
14385
  if (!hasColumn9(db, table, column)) {
14361
14386
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
14362
14387
  }
@@ -14368,23 +14393,23 @@ function backfillVersionRoots(db) {
14368
14393
  WHERE version_root_id IS NULL
14369
14394
  `);
14370
14395
  }
14371
- function up72(db) {
14396
+ function up73(db) {
14372
14397
  for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
14373
- addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
14374
- addColumnIfMissing18(db, table, "archived_at", "TEXT");
14375
- addColumnIfMissing18(db, table, "archived_by", "TEXT");
14376
- addColumnIfMissing18(db, table, "archive_reason", "TEXT");
14398
+ addColumnIfMissing19(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
14399
+ addColumnIfMissing19(db, table, "archived_at", "TEXT");
14400
+ addColumnIfMissing19(db, table, "archived_by", "TEXT");
14401
+ addColumnIfMissing19(db, table, "archive_reason", "TEXT");
14377
14402
  }
14378
14403
  for (const table of ["entities", "entity_aspects"]) {
14379
- addColumnIfMissing18(db, table, "proposal_id", "TEXT");
14380
- addColumnIfMissing18(db, table, "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
14381
- }
14382
- addColumnIfMissing18(db, "entity_attributes", "version", "INTEGER NOT NULL DEFAULT 1");
14383
- addColumnIfMissing18(db, "entity_attributes", "version_root_id", "TEXT");
14384
- addColumnIfMissing18(db, "entity_attributes", "previous_attribute_id", "TEXT");
14385
- addColumnIfMissing18(db, "entity_attributes", "archived_at", "TEXT");
14386
- addColumnIfMissing18(db, "entity_attributes", "archived_by", "TEXT");
14387
- addColumnIfMissing18(db, "entity_attributes", "archive_reason", "TEXT");
14404
+ addColumnIfMissing19(db, table, "proposal_id", "TEXT");
14405
+ addColumnIfMissing19(db, table, "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
14406
+ }
14407
+ addColumnIfMissing19(db, "entity_attributes", "version", "INTEGER NOT NULL DEFAULT 1");
14408
+ addColumnIfMissing19(db, "entity_attributes", "version_root_id", "TEXT");
14409
+ addColumnIfMissing19(db, "entity_attributes", "previous_attribute_id", "TEXT");
14410
+ addColumnIfMissing19(db, "entity_attributes", "archived_at", "TEXT");
14411
+ addColumnIfMissing19(db, "entity_attributes", "archived_by", "TEXT");
14412
+ addColumnIfMissing19(db, "entity_attributes", "archive_reason", "TEXT");
14388
14413
  backfillVersionRoots(db);
14389
14414
  db.exec(`
14390
14415
  CREATE INDEX IF NOT EXISTS idx_entities_status
@@ -14405,7 +14430,7 @@ function up72(db) {
14405
14430
  }
14406
14431
 
14407
14432
  // src/migrations/071-epistemic-assertions.ts
14408
- function up73(db) {
14433
+ function up74(db) {
14409
14434
  db.exec(`
14410
14435
  CREATE TABLE IF NOT EXISTS epistemic_assertions (
14411
14436
  id TEXT PRIMARY KEY,
@@ -14463,7 +14488,7 @@ function ensureMemoriesScopeColumns2(db) {
14463
14488
  if (!names.has("runtime_path"))
14464
14489
  db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
14465
14490
  }
14466
- function up74(db) {
14491
+ function up75(db) {
14467
14492
  ensureMemoriesScopeColumns2(db);
14468
14493
  db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
14469
14494
  db.exec(`
@@ -14479,7 +14504,7 @@ function up74(db) {
14479
14504
  }
14480
14505
 
14481
14506
  // src/migrations/073-recall-context-dedupe.ts
14482
- function up75(db) {
14507
+ function up76(db) {
14483
14508
  db.exec(`
14484
14509
  CREATE TABLE IF NOT EXISTS session_context_epochs (
14485
14510
  session_key TEXT NOT NULL,
@@ -14516,7 +14541,7 @@ function up75(db) {
14516
14541
  }
14517
14542
 
14518
14543
  // src/migrations/074-aggregate-memory-links.ts
14519
- function up76(db) {
14544
+ function up77(db) {
14520
14545
  db.exec(`
14521
14546
  CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
14522
14547
  aggregate_memory_id TEXT NOT NULL,
@@ -14531,18 +14556,18 @@ function up76(db) {
14531
14556
  }
14532
14557
 
14533
14558
  // src/migrations/075-memory-artifact-source-provenance.ts
14534
- function addColumnIfMissing19(db, table, column, definition) {
14559
+ function addColumnIfMissing20(db, table, column, definition) {
14535
14560
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
14536
14561
  if (cols.some((col) => col.name === column))
14537
14562
  return;
14538
14563
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
14539
14564
  }
14540
- function up77(db) {
14541
- addColumnIfMissing19(db, "memory_artifacts", "source_id", "TEXT");
14542
- addColumnIfMissing19(db, "memory_artifacts", "source_root", "TEXT");
14543
- addColumnIfMissing19(db, "memory_artifacts", "source_external_id", "TEXT");
14544
- addColumnIfMissing19(db, "memory_artifacts", "source_parent_path", "TEXT");
14545
- addColumnIfMissing19(db, "memory_artifacts", "source_meta_json", "TEXT");
14565
+ function up78(db) {
14566
+ addColumnIfMissing20(db, "memory_artifacts", "source_id", "TEXT");
14567
+ addColumnIfMissing20(db, "memory_artifacts", "source_root", "TEXT");
14568
+ addColumnIfMissing20(db, "memory_artifacts", "source_external_id", "TEXT");
14569
+ addColumnIfMissing20(db, "memory_artifacts", "source_parent_path", "TEXT");
14570
+ addColumnIfMissing20(db, "memory_artifacts", "source_meta_json", "TEXT");
14546
14571
  db.exec(`
14547
14572
  CREATE INDEX IF NOT EXISTS idx_memory_artifacts_agent_source
14548
14573
  ON memory_artifacts(agent_id, source_id, source_external_id);
@@ -14552,7 +14577,7 @@ function up77(db) {
14552
14577
  }
14553
14578
 
14554
14579
  // src/migrations/076-temporal-edges.ts
14555
- function up78(db) {
14580
+ function up79(db) {
14556
14581
  db.exec(`
14557
14582
  CREATE TABLE IF NOT EXISTS temporal_edges (
14558
14583
  id TEXT PRIMARY KEY,
@@ -14577,7 +14602,7 @@ function up78(db) {
14577
14602
  }
14578
14603
 
14579
14604
  // src/migrations/077-entity-aliases.ts
14580
- function up79(db) {
14605
+ function up80(db) {
14581
14606
  db.exec(`
14582
14607
  CREATE TABLE IF NOT EXISTS entity_aliases (
14583
14608
  id TEXT PRIMARY KEY,
@@ -14603,7 +14628,7 @@ function up79(db) {
14603
14628
  }
14604
14629
 
14605
14630
  // src/migrations/078-api-keys.ts
14606
- function up80(db) {
14631
+ function up81(db) {
14607
14632
  db.exec(`
14608
14633
  CREATE TABLE IF NOT EXISTS api_keys (
14609
14634
  id TEXT PRIMARY KEY,
@@ -14633,7 +14658,7 @@ function up80(db) {
14633
14658
  }
14634
14659
 
14635
14660
  // src/migrations/079-transcript-capture-jobs.ts
14636
- function up81(db) {
14661
+ function up82(db) {
14637
14662
  db.exec(`
14638
14663
  CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
14639
14664
  id TEXT PRIMARY KEY,
@@ -14670,7 +14695,7 @@ function hasColumn10(db, table, column) {
14670
14695
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
14671
14696
  return rows.some((row) => row.name === column);
14672
14697
  }
14673
- function up82(db) {
14698
+ function up83(db) {
14674
14699
  if (!hasColumn10(db, "documents", "agent_id")) {
14675
14700
  db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
14676
14701
  }
@@ -14758,7 +14783,7 @@ function up82(db) {
14758
14783
  }
14759
14784
 
14760
14785
  // src/migrations/081-aggregate-evidence-sources.ts
14761
- function up83(db) {
14786
+ function up84(db) {
14762
14787
  db.exec(`
14763
14788
  CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
14764
14789
  aggregate_memory_id TEXT NOT NULL,
@@ -14782,7 +14807,7 @@ function hasColumn11(db, table, column) {
14782
14807
  return rows.some((row) => row.name === column);
14783
14808
  }
14784
14809
  var COLUMNS = ["harness", "session_id", "tool_use_id", "cwd", "origin", "args"];
14785
- function up84(db) {
14810
+ function up85(db) {
14786
14811
  for (const column of COLUMNS) {
14787
14812
  if (!hasColumn11(db, "skill_invocations", column)) {
14788
14813
  db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
@@ -14842,7 +14867,7 @@ function hasColumn12(db, table, column) {
14842
14867
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
14843
14868
  return rows.some((row) => row.name === column);
14844
14869
  }
14845
- function addColumnIfMissing20(db, table, column, definition) {
14870
+ function addColumnIfMissing21(db, table, column, definition) {
14846
14871
  if (!hasColumn12(db, table, column))
14847
14872
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
14848
14873
  }
@@ -14865,7 +14890,7 @@ function documentScopeColumnsPreservingExisting(db) {
14865
14890
  `);
14866
14891
  }
14867
14892
  try {
14868
- up82(db);
14893
+ up83(db);
14869
14894
  if (preserveAgentId) {
14870
14895
  db.exec(`
14871
14896
  UPDATE documents
@@ -14885,25 +14910,25 @@ function documentScopeColumnsPreservingExisting(db) {
14885
14910
  db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
14886
14911
  }
14887
14912
  }
14888
- function up85(db) {
14889
- up81(db);
14913
+ function up86(db) {
14914
+ up82(db);
14890
14915
  if (hasTable3(db, "documents")) {
14891
14916
  documentScopeColumnsPreservingExisting(db);
14892
14917
  }
14893
- up83(db);
14894
- addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
14895
- addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
14896
- addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
14918
+ up84(db);
14919
+ addColumnIfMissing21(db, "memories", "superseded_by", "TEXT");
14920
+ addColumnIfMissing21(db, "memories", "superseded_at", "TEXT");
14921
+ addColumnIfMissing21(db, "memories", "superseded_reason", "TEXT");
14897
14922
  db.exec("CREATE INDEX IF NOT EXISTS idx_memories_superseded_by ON memories(superseded_by)");
14898
14923
  db.exec("CREATE INDEX IF NOT EXISTS idx_memories_active_supersession ON memories(is_deleted, superseded_by)");
14899
14924
  if (!hasTable3(db, "relations") || !hasTable3(db, "entity_dependencies"))
14900
14925
  return;
14901
- addColumnIfMissing20(db, "entity_dependencies", "confidence", "REAL");
14902
- addColumnIfMissing20(db, "entity_dependencies", "reason", "TEXT");
14903
- addColumnIfMissing20(db, "entity_dependencies", "source_id", "TEXT");
14904
- addColumnIfMissing20(db, "entity_dependencies", "source_kind", "TEXT");
14905
- addColumnIfMissing20(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
14906
- addColumnIfMissing20(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
14926
+ addColumnIfMissing21(db, "entity_dependencies", "confidence", "REAL");
14927
+ addColumnIfMissing21(db, "entity_dependencies", "reason", "TEXT");
14928
+ addColumnIfMissing21(db, "entity_dependencies", "source_id", "TEXT");
14929
+ addColumnIfMissing21(db, "entity_dependencies", "source_kind", "TEXT");
14930
+ addColumnIfMissing21(db, "entity_dependencies", "proposal_evidence", "TEXT NOT NULL DEFAULT '[]'");
14931
+ addColumnIfMissing21(db, "entity_dependencies", "status", "TEXT NOT NULL DEFAULT 'active'");
14907
14932
  const relationConfidence = hasColumn12(db, "relations", "confidence") ? "r.confidence" : "NULL";
14908
14933
  const relationUpdatedAt = hasColumn12(db, "relations", "updated_at") ? "r.updated_at" : "r.created_at";
14909
14934
  const sourceAgentId = hasColumn12(db, "entities", "agent_id") ? "COALESCE(NULLIF(TRIM(src.agent_id), ''), 'default')" : "'default'";
@@ -14949,7 +14974,7 @@ function up85(db) {
14949
14974
  }
14950
14975
 
14951
14976
  // src/migrations/084-legacy-markdown-import-state.ts
14952
- function up86(db) {
14977
+ function up87(db) {
14953
14978
  db.exec(`
14954
14979
  CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
14955
14980
  path TEXT PRIMARY KEY,
@@ -14981,7 +15006,7 @@ function up86(db) {
14981
15006
  }
14982
15007
 
14983
15008
  // src/migrations/085-backfill-relations-to-dependencies.ts
14984
- function up87(db) {
15009
+ function up88(db) {
14985
15010
  const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
14986
15011
  const tableNames = new Set(tables.map((r) => String(r.name)));
14987
15012
  if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
@@ -15036,14 +15061,14 @@ function up87(db) {
15036
15061
  }
15037
15062
 
15038
15063
  // src/migrations/086-summary-jobs-content-hash.ts
15039
- function addColumnIfMissing21(db, table, column, definition) {
15064
+ function addColumnIfMissing22(db, table, column, definition) {
15040
15065
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
15041
15066
  if (cols.some((col) => col.name === column))
15042
15067
  return;
15043
15068
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
15044
15069
  }
15045
- function up88(db) {
15046
- addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
15070
+ function up89(db) {
15071
+ addColumnIfMissing22(db, "summary_jobs", "content_hash", "TEXT");
15047
15072
  db.exec(`
15048
15073
  CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
15049
15074
  ON summary_jobs(agent_id, session_key, content_hash)
@@ -15051,14 +15076,14 @@ function up88(db) {
15051
15076
  }
15052
15077
 
15053
15078
  // src/migrations/087-summary-jobs-boundary-reason.ts
15054
- function addColumnIfMissing22(db, table, column, definition) {
15079
+ function addColumnIfMissing23(db, table, column, definition) {
15055
15080
  const cols = db.prepare(`PRAGMA table_info(${table})`).all();
15056
15081
  if (cols.some((col) => col.name === column))
15057
15082
  return;
15058
15083
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
15059
15084
  }
15060
- function up89(db) {
15061
- addColumnIfMissing22(db, "summary_jobs", "boundary_reason", "TEXT");
15085
+ function up90(db) {
15086
+ addColumnIfMissing23(db, "summary_jobs", "boundary_reason", "TEXT");
15062
15087
  db.exec(`
15063
15088
  CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
15064
15089
  ON summary_jobs(agent_id, session_key, boundary_reason)
@@ -15066,7 +15091,7 @@ function up89(db) {
15066
15091
  }
15067
15092
 
15068
15093
  // src/migrations/088-transcript-recovery-files.ts
15069
- function up90(db) {
15094
+ function up91(db) {
15070
15095
  db.exec(`
15071
15096
  CREATE TABLE IF NOT EXISTS transcript_recovery_files (
15072
15097
  agent_id TEXT NOT NULL,
@@ -15086,7 +15111,7 @@ function up90(db) {
15086
15111
  }
15087
15112
 
15088
15113
  // src/migrations/089-job-cancellations.ts
15089
- function up91(db) {
15114
+ function up92(db) {
15090
15115
  db.exec(`
15091
15116
  CREATE TABLE IF NOT EXISTS job_cancellations (
15092
15117
  id TEXT PRIMARY KEY,
@@ -15116,7 +15141,7 @@ function indexExists(db, table, indexName) {
15116
15141
  }
15117
15142
 
15118
15143
  // src/migrations/090-job-archive.ts
15119
- function up92(db) {
15144
+ function up93(db) {
15120
15145
  db.exec(`
15121
15146
  CREATE TABLE IF NOT EXISTS job_archive (
15122
15147
  id TEXT PRIMARY KEY,
@@ -15145,7 +15170,7 @@ function indexExists2(db, table, indexName) {
15145
15170
  }
15146
15171
 
15147
15172
  // src/migrations/091-embedding-index-generations.ts
15148
- function up93(db) {
15173
+ function up94(db) {
15149
15174
  db.exec(`
15150
15175
  CREATE TABLE IF NOT EXISTS embedding_index_state (
15151
15176
  id INTEGER PRIMARY KEY CHECK (id = 1),
@@ -15160,7 +15185,7 @@ function up93(db) {
15160
15185
  }
15161
15186
 
15162
15187
  // src/migrations/092-embedding-staging-store.ts
15163
- function up94(db) {
15188
+ function up95(db) {
15164
15189
  db.exec(`
15165
15190
  CREATE TABLE IF NOT EXISTS embeddings_staging (
15166
15191
  id TEXT PRIMARY KEY,
@@ -15181,7 +15206,7 @@ function up94(db) {
15181
15206
  }
15182
15207
 
15183
15208
  // src/migrations/093-dreaming-evidence-cursor.ts
15184
- function up95(db) {
15209
+ function up96(db) {
15185
15210
  const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
15186
15211
  if (!columns.some((column) => column.name === "evidence_cursor")) {
15187
15212
  db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
@@ -15194,7 +15219,7 @@ function hasColumn13(db, table, column) {
15194
15219
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
15195
15220
  return rows.some((r) => r.name === column);
15196
15221
  }
15197
- function up96(db) {
15222
+ function up97(db) {
15198
15223
  const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
15199
15224
  if (tables.length === 0)
15200
15225
  return;
@@ -15221,7 +15246,7 @@ function up96(db) {
15221
15246
  function hasColumn14(db, table, column) {
15222
15247
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
15223
15248
  }
15224
- function up97(db) {
15249
+ function up98(db) {
15225
15250
  const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
15226
15251
  if (!hasMemories || !hasColumn14(db, "memories", "memory_kind") || !hasColumn14(db, "memories", "type"))
15227
15252
  return;
@@ -15229,12 +15254,12 @@ function up97(db) {
15229
15254
  }
15230
15255
 
15231
15256
  // src/migrations/096-retire-legacy-ingestion.ts
15232
- function up98(db) {
15257
+ function up99(db) {
15233
15258
  db.exec("DROP TABLE IF EXISTS ingestion_jobs");
15234
15259
  }
15235
15260
 
15236
15261
  // src/migrations/097-dreaming-failure-backoff.ts
15237
- function up99(db) {
15262
+ function up100(db) {
15238
15263
  const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
15239
15264
  if (!columns.some((column) => column.name === "last_failure_at")) {
15240
15265
  db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
@@ -15243,7 +15268,7 @@ function up99(db) {
15243
15268
  }
15244
15269
 
15245
15270
  // src/migrations/098-dreaming-evidence-exclusions.ts
15246
- function up100(db) {
15271
+ function up101(db) {
15247
15272
  db.exec(`
15248
15273
  CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
15249
15274
  agent_id TEXT NOT NULL,
@@ -15262,7 +15287,7 @@ function up100(db) {
15262
15287
  }
15263
15288
 
15264
15289
  // src/migrations/099-dreaming-tool-calls.ts
15265
- function up101(db) {
15290
+ function up102(db) {
15266
15291
  db.exec(`
15267
15292
  CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
15268
15293
  id TEXT PRIMARY KEY,
@@ -15284,7 +15309,7 @@ function up101(db) {
15284
15309
  }
15285
15310
 
15286
15311
  // src/migrations/100-dreaming-runbook.ts
15287
- function up102(db) {
15312
+ function up103(db) {
15288
15313
  const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
15289
15314
  if (!columns.some((column) => column.name === "evidence_window_json")) {
15290
15315
  db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
@@ -15295,7 +15320,7 @@ function up102(db) {
15295
15320
  }
15296
15321
 
15297
15322
  // src/migrations/101-dreaming-attention.ts
15298
- function up103(db) {
15323
+ function up104(db) {
15299
15324
  db.exec(`
15300
15325
  CREATE TABLE IF NOT EXISTS dreaming_attention (
15301
15326
  id TEXT PRIMARY KEY,
@@ -15319,7 +15344,7 @@ function up103(db) {
15319
15344
  function hasColumn15(db, table, column) {
15320
15345
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
15321
15346
  }
15322
- function up104(db) {
15347
+ function up105(db) {
15323
15348
  const requiredMemoryColumns = [
15324
15349
  "content_hash",
15325
15350
  "normalized_content",
@@ -15372,7 +15397,7 @@ function up104(db) {
15372
15397
  }
15373
15398
 
15374
15399
  // src/migrations/103-semantic-memory-kind.ts
15375
- function up105(db) {
15400
+ function up106(db) {
15376
15401
  const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
15377
15402
  if (tables.length !== 2)
15378
15403
  return;
@@ -15397,7 +15422,7 @@ function tableExists(db, table) {
15397
15422
  function hasColumn16(db, table, column) {
15398
15423
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
15399
15424
  }
15400
- function up106(db) {
15425
+ function up107(db) {
15401
15426
  db.exec(`
15402
15427
  CREATE TABLE IF NOT EXISTS derived_memory_sources (
15403
15428
  derived_memory_id TEXT NOT NULL,
@@ -15442,7 +15467,7 @@ function up106(db) {
15442
15467
  }
15443
15468
 
15444
15469
  // src/migrations/105-agent-scoped-entity-name.ts
15445
- function up107(db) {
15470
+ function up108(db) {
15446
15471
  db.exec(`
15447
15472
  DROP TRIGGER IF EXISTS entities_fts_ai;
15448
15473
  DROP TRIGGER IF EXISTS entities_fts_ad;
@@ -15533,7 +15558,7 @@ function up107(db) {
15533
15558
  function hasColumn17(db, table, column) {
15534
15559
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
15535
15560
  }
15536
- function up108(db) {
15561
+ function up109(db) {
15537
15562
  if (!hasColumn17(db, "memories", "review_after")) {
15538
15563
  db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
15539
15564
  }
@@ -15551,7 +15576,7 @@ var TOKEN_COLUMNS = [
15551
15576
  ["tokens_cache_write", "INTEGER"],
15552
15577
  ["tokens_cost", "REAL"]
15553
15578
  ];
15554
- function up109(db) {
15579
+ function up110(db) {
15555
15580
  for (const [column, type] of TOKEN_COLUMNS) {
15556
15581
  if (!hasColumn18(db, "dreaming_passes", column)) {
15557
15582
  db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
@@ -15560,7 +15585,7 @@ function up109(db) {
15560
15585
  }
15561
15586
 
15562
15587
  // src/migrations/108-embedding-usage.ts
15563
- function up110(db) {
15588
+ function up111(db) {
15564
15589
  db.exec(`
15565
15590
  CREATE TABLE IF NOT EXISTS embedding_usage (
15566
15591
  day TEXT NOT NULL,
@@ -15575,7 +15600,7 @@ function up110(db) {
15575
15600
  }
15576
15601
 
15577
15602
  // src/migrations/109-telemetry-install.ts
15578
- function up111(db) {
15603
+ function up112(db) {
15579
15604
  db.exec(`
15580
15605
  CREATE TABLE IF NOT EXISTS telemetry_install (
15581
15606
  id TEXT PRIMARY KEY,
@@ -15585,7 +15610,7 @@ function up111(db) {
15585
15610
  }
15586
15611
 
15587
15612
  // src/migrations/110-memory-mention-join-index.ts
15588
- function up112(db) {
15613
+ function up113(db) {
15589
15614
  db.exec(`
15590
15615
  CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
15591
15616
  ON memory_entity_mentions(entity_id, memory_id);
@@ -15598,7 +15623,7 @@ function hasColumn19(db, table, column) {
15598
15623
  return rows.some((row) => row.name === column);
15599
15624
  }
15600
15625
  var COLUMNS2 = ["first_remember_at", "first_recall_at"];
15601
- function up113(db) {
15626
+ function up114(db) {
15602
15627
  for (const column of COLUMNS2) {
15603
15628
  if (!hasColumn19(db, "telemetry_install", column)) {
15604
15629
  db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
@@ -15611,15 +15636,15 @@ function hasColumn20(db, table, column) {
15611
15636
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
15612
15637
  return rows.some((row) => row.name === column);
15613
15638
  }
15614
- function addColumnIfMissing23(db, column, definition) {
15639
+ function addColumnIfMissing24(db, column, definition) {
15615
15640
  if (!hasColumn20(db, "telemetry_events", column)) {
15616
15641
  db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
15617
15642
  }
15618
15643
  }
15619
- function up114(db) {
15620
- addColumnIfMissing23(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
15621
- addColumnIfMissing23(db, "claim_token", "TEXT");
15622
- addColumnIfMissing23(db, "claimed_at", "TEXT");
15644
+ function up115(db) {
15645
+ addColumnIfMissing24(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
15646
+ addColumnIfMissing24(db, "claim_token", "TEXT");
15647
+ addColumnIfMissing24(db, "claimed_at", "TEXT");
15623
15648
  db.exec(`
15624
15649
  CREATE INDEX IF NOT EXISTS idx_telemetry_events_queue
15625
15650
  ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
@@ -15627,7 +15652,7 @@ function up114(db) {
15627
15652
  }
15628
15653
 
15629
15654
  // src/migrations/113-session-claims.ts
15630
- function up115(db) {
15655
+ function up116(db) {
15631
15656
  db.exec(`
15632
15657
  CREATE TABLE IF NOT EXISTS session_claims (
15633
15658
  session_key TEXT NOT NULL,
@@ -15650,7 +15675,7 @@ function up115(db) {
15650
15675
  }
15651
15676
 
15652
15677
  // src/migrations/114-memory-traversal-hydration-index.ts
15653
- function up116(db) {
15678
+ function up117(db) {
15654
15679
  const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
15655
15680
  if (table == null)
15656
15681
  return;
@@ -15661,7 +15686,7 @@ function up116(db) {
15661
15686
  }
15662
15687
 
15663
15688
  // src/migrations/115-cross-agent-message-notifications.ts
15664
- function up117(db) {
15689
+ function up118(db) {
15665
15690
  db.exec(`
15666
15691
  CREATE TABLE IF NOT EXISTS cross_agent_messages (
15667
15692
  id TEXT PRIMARY KEY,
@@ -15715,26 +15740,26 @@ function up117(db) {
15715
15740
  function hasColumn21(db, table, column) {
15716
15741
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
15717
15742
  }
15718
- function addColumnIfMissing24(db, column, definition) {
15743
+ function addColumnIfMissing25(db, column, definition) {
15719
15744
  if (!hasColumn21(db, "cross_agent_messages", column)) {
15720
15745
  db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
15721
15746
  }
15722
15747
  }
15723
- function up118(db) {
15748
+ function up119(db) {
15724
15749
  const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
15725
15750
  if (table == null)
15726
15751
  return;
15727
- addColumnIfMissing24(db, "delivery_state", "TEXT NOT NULL DEFAULT 'pending'");
15728
- addColumnIfMissing24(db, "delivery_attempt_id", "TEXT");
15729
- addColumnIfMissing24(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
15730
- addColumnIfMissing24(db, "delivery_lease_token", "TEXT");
15731
- addColumnIfMissing24(db, "delivery_lease_expires_at", "TEXT");
15732
- addColumnIfMissing24(db, "delivery_attempt_started_at", "TEXT");
15733
- addColumnIfMissing24(db, "delivery_updated_at", "TEXT");
15734
- addColumnIfMissing24(db, "acp_base_url", "TEXT");
15735
- addColumnIfMissing24(db, "acp_target_agent_name", "TEXT");
15736
- addColumnIfMissing24(db, "acp_timeout_ms", "INTEGER");
15737
- addColumnIfMissing24(db, "acp_metadata_json", "TEXT");
15752
+ addColumnIfMissing25(db, "delivery_state", "TEXT NOT NULL DEFAULT 'pending'");
15753
+ addColumnIfMissing25(db, "delivery_attempt_id", "TEXT");
15754
+ addColumnIfMissing25(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
15755
+ addColumnIfMissing25(db, "delivery_lease_token", "TEXT");
15756
+ addColumnIfMissing25(db, "delivery_lease_expires_at", "TEXT");
15757
+ addColumnIfMissing25(db, "delivery_attempt_started_at", "TEXT");
15758
+ addColumnIfMissing25(db, "delivery_updated_at", "TEXT");
15759
+ addColumnIfMissing25(db, "acp_base_url", "TEXT");
15760
+ addColumnIfMissing25(db, "acp_target_agent_name", "TEXT");
15761
+ addColumnIfMissing25(db, "acp_timeout_ms", "INTEGER");
15762
+ addColumnIfMissing25(db, "acp_metadata_json", "TEXT");
15738
15763
  db.exec(`
15739
15764
  UPDATE cross_agent_messages
15740
15765
  SET delivery_state = CASE delivery_status
@@ -15762,7 +15787,7 @@ import { createHash } from "node:crypto";
15762
15787
  function hasTable4(db, table) {
15763
15788
  return db.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
15764
15789
  }
15765
- function addColumnIfMissing25(db, table, column, definition) {
15790
+ function addColumnIfMissing26(db, table, column, definition) {
15766
15791
  const columns = db.prepare(`PRAGMA table_info(${table})`).all();
15767
15792
  if (columns.some((row) => row.name === column))
15768
15793
  return;
@@ -15924,11 +15949,11 @@ function backfillTranscriptsFromSummaryJobs(db) {
15924
15949
  insert.run(...values);
15925
15950
  }
15926
15951
  }
15927
- function up119(db) {
15952
+ function up120(db) {
15928
15953
  if (!hasTable4(db, "session_transcripts"))
15929
15954
  return;
15930
- addColumnIfMissing25(db, "session_transcripts", "completed_at", "TEXT");
15931
- addColumnIfMissing25(db, "session_transcripts", "content_hash", "TEXT");
15955
+ addColumnIfMissing26(db, "session_transcripts", "completed_at", "TEXT");
15956
+ addColumnIfMissing26(db, "session_transcripts", "content_hash", "TEXT");
15932
15957
  backfillTranscriptHashes(db);
15933
15958
  if (hasTable4(db, "transcript_capture_jobs")) {
15934
15959
  const captureColumns = db.prepare("PRAGMA table_info(transcript_capture_jobs)").all();
@@ -15979,7 +16004,7 @@ function up119(db) {
15979
16004
  }
15980
16005
 
15981
16006
  // src/migrations/118-queue-pressure-indices.ts
15982
- function up120(db) {
16007
+ function up121(db) {
15983
16008
  db.exec(`
15984
16009
  CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
15985
16010
  ON memory_jobs(status)
@@ -16000,14 +16025,14 @@ function up120(db) {
16000
16025
  function hasColumn22(db, table, column) {
16001
16026
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
16002
16027
  }
16003
- function up121(db) {
16028
+ function up122(db) {
16004
16029
  if (!hasColumn22(db, "telemetry_install", "last_seen_version")) {
16005
16030
  db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
16006
16031
  }
16007
16032
  }
16008
16033
 
16009
16034
  // src/migrations/120-source-lifecycle-telemetry.ts
16010
- function up122(db) {
16035
+ function up123(db) {
16011
16036
  db.exec(`
16012
16037
  CREATE TABLE IF NOT EXISTS source_lifecycle_state (
16013
16038
  agent_id TEXT NOT NULL,
@@ -16033,16 +16058,16 @@ function up122(db) {
16033
16058
  function hasColumn23(db, table, column) {
16034
16059
  return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
16035
16060
  }
16036
- function addColumnIfMissing26(db, column, definition) {
16061
+ function addColumnIfMissing27(db, column, definition) {
16037
16062
  if (!hasColumn23(db, "telemetry_events", column)) {
16038
16063
  db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
16039
16064
  }
16040
16065
  }
16041
- function up123(db) {
16042
- addColumnIfMissing26(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
16043
- addColumnIfMissing26(db, "last_attempt_at", "TEXT");
16044
- addColumnIfMissing26(db, "sent_at", "TEXT");
16045
- addColumnIfMissing26(db, "last_failure_code", "TEXT");
16066
+ function up124(db) {
16067
+ addColumnIfMissing27(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
16068
+ addColumnIfMissing27(db, "last_attempt_at", "TEXT");
16069
+ addColumnIfMissing27(db, "sent_at", "TEXT");
16070
+ addColumnIfMissing27(db, "last_failure_code", "TEXT");
16046
16071
  db.exec(`
16047
16072
  CREATE TABLE IF NOT EXISTS telemetry_delivery_state (
16048
16073
  id INTEGER PRIMARY KEY CHECK (id = 1),
@@ -16061,7 +16086,7 @@ function up123(db) {
16061
16086
  }
16062
16087
 
16063
16088
  // src/migrations/122-dreaming-evidence-retry.ts
16064
- function up124(db) {
16089
+ function up125(db) {
16065
16090
  const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
16066
16091
  const names = new Set(columns.map((column) => column.name));
16067
16092
  if (!names.has("failure_class")) {
@@ -16080,7 +16105,7 @@ function up124(db) {
16080
16105
  }
16081
16106
 
16082
16107
  // src/migrations/123-embedding-index-failures.ts
16083
- function up125(db) {
16108
+ function up126(db) {
16084
16109
  db.exec(`
16085
16110
  CREATE TABLE IF NOT EXISTS embedding_index_failures (
16086
16111
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -16106,7 +16131,7 @@ function up125(db) {
16106
16131
  }
16107
16132
 
16108
16133
  // src/migrations/124-import-derived-lifecycle.ts
16109
- function up126(db) {
16134
+ function up127(db) {
16110
16135
  db.exec(`
16111
16136
  CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
16112
16137
  id TEXT PRIMARY KEY,
@@ -16158,7 +16183,7 @@ function backfillTable(db, params) {
16158
16183
  FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
16159
16184
  backfill(db, rows, params.sourceKind, params.scannedAt);
16160
16185
  }
16161
- function up127(db) {
16186
+ function up128(db) {
16162
16187
  db.exec(`
16163
16188
  CREATE TABLE IF NOT EXISTS memory_content_safety (
16164
16189
  agent_id TEXT NOT NULL,
@@ -16217,7 +16242,7 @@ function up127(db) {
16217
16242
  }
16218
16243
 
16219
16244
  // src/migrations/126-dreaming-surprisal-attention.ts
16220
- function up128(db) {
16245
+ function up129(db) {
16221
16246
  const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
16222
16247
  if (!table)
16223
16248
  return;
@@ -16253,7 +16278,7 @@ function up128(db) {
16253
16278
  }
16254
16279
 
16255
16280
  // src/migrations/127-ontology-contradictions.ts
16256
- function up129(db) {
16281
+ function up130(db) {
16257
16282
  db.exec(`
16258
16283
  CREATE TABLE IF NOT EXISTS ontology_contradictions (
16259
16284
  id TEXT PRIMARY KEY,
@@ -16311,7 +16336,7 @@ function up129(db) {
16311
16336
  }
16312
16337
 
16313
16338
  // src/migrations/128-bounded-queue-diagnostics.ts
16314
- function up130(db) {
16339
+ function up131(db) {
16315
16340
  db.exec(`
16316
16341
  CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
16317
16342
  ON memory_jobs(status, created_at)
@@ -16328,7 +16353,7 @@ function up130(db) {
16328
16353
  function tableExists3(db, table) {
16329
16354
  return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
16330
16355
  }
16331
- function up131(db) {
16356
+ function up132(db) {
16332
16357
  if (!tableExists3(db, "memory_jobs"))
16333
16358
  return;
16334
16359
  if (!tableExists3(db, "job_cancellations")) {
@@ -16379,7 +16404,7 @@ function up131(db) {
16379
16404
  }
16380
16405
 
16381
16406
  // src/migrations/130-embedding-repair-state.ts
16382
- function up132(db) {
16407
+ function up133(db) {
16383
16408
  db.exec(`
16384
16409
  CREATE TABLE IF NOT EXISTS embedding_repair_budget (
16385
16410
  id INTEGER PRIMARY KEY CHECK (id = 1),
@@ -16421,7 +16446,7 @@ function up132(db) {
16421
16446
  }
16422
16447
 
16423
16448
  // src/migrations/131-dreaming-evidence-consumption.ts
16424
- function up133(db) {
16449
+ function up134(db) {
16425
16450
  db.exec(`
16426
16451
  CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
16427
16452
  agent_id TEXT NOT NULL,
@@ -16446,7 +16471,7 @@ function up133(db) {
16446
16471
  }
16447
16472
 
16448
16473
  // src/migrations/132-observer-scoped-epistemic-assertions.ts
16449
- function up134(db) {
16474
+ function up135(db) {
16450
16475
  db.exec(`
16451
16476
  CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
16452
16477
  ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
@@ -16454,7 +16479,7 @@ function up134(db) {
16454
16479
  }
16455
16480
 
16456
16481
  // src/migrations/133-dreaming-memory-head.ts
16457
- function up135(db) {
16482
+ function up136(db) {
16458
16483
  db.exec(`
16459
16484
  CREATE TABLE IF NOT EXISTS memory_head_revisions (
16460
16485
  id TEXT PRIMARY KEY,
@@ -16508,7 +16533,7 @@ function up135(db) {
16508
16533
  }
16509
16534
 
16510
16535
  // src/migrations/134-scope-memory-head-entries.ts
16511
- function up136(db) {
16536
+ function up137(db) {
16512
16537
  db.exec(`
16513
16538
  CREATE TABLE memory_head_entries_v134 (
16514
16539
  entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
@@ -16528,7 +16553,7 @@ function up136(db) {
16528
16553
  }
16529
16554
 
16530
16555
  // src/migrations/135-memory-head-publication.ts
16531
- function up137(db) {
16556
+ function up138(db) {
16532
16557
  db.exec(`
16533
16558
  CREATE TABLE IF NOT EXISTS memory_head_publications (
16534
16559
  agent_id TEXT NOT NULL,
@@ -16546,7 +16571,7 @@ function up137(db) {
16546
16571
  }
16547
16572
 
16548
16573
  // src/migrations/136-memory-head-revisions.ts
16549
- function up138(db) {
16574
+ function up139(db) {
16550
16575
  const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r) => r.name));
16551
16576
  for (const [name, type] of [
16552
16577
  ["entry_id", "TEXT"],
@@ -16562,7 +16587,7 @@ function up138(db) {
16562
16587
  }
16563
16588
 
16564
16589
  // src/migrations/137-dreaming-head-manifest.ts
16565
- function up139(db) {
16590
+ function up140(db) {
16566
16591
  const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r) => r.name));
16567
16592
  for (const [name, type] of [
16568
16593
  ["head_revision", "INTEGER"],
@@ -16582,12 +16607,12 @@ function hasColumn25(db, table, column) {
16582
16607
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
16583
16608
  return rows.some((row) => row.name === column);
16584
16609
  }
16585
- function addColumnIfMissing27(db, table, column, definition) {
16610
+ function addColumnIfMissing28(db, table, column, definition) {
16586
16611
  if (!hasColumn25(db, table, column))
16587
16612
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
16588
16613
  }
16589
- function up140(db) {
16590
- addColumnIfMissing27(db, "memories", "manual_override", "INTEGER DEFAULT 0");
16614
+ function up141(db) {
16615
+ addColumnIfMissing28(db, "memories", "manual_override", "INTEGER DEFAULT 0");
16591
16616
  db.exec(`
16592
16617
  CREATE TABLE IF NOT EXISTS transcript_capture_status (
16593
16618
  agent_id TEXT PRIMARY KEY,
@@ -16893,7 +16918,7 @@ function up140(db) {
16893
16918
  }
16894
16919
 
16895
16920
  // src/migrations/139-native-source-sync-state.ts
16896
- function up141(db) {
16921
+ function up142(db) {
16897
16922
  db.exec(`
16898
16923
  CREATE TABLE IF NOT EXISTS native_source_sync_state (
16899
16924
  agent_id TEXT NOT NULL,
@@ -16911,7 +16936,7 @@ function up141(db) {
16911
16936
  }
16912
16937
 
16913
16938
  // src/migrations/140-transcript-recovery-frontier.ts
16914
- function up142(db) {
16939
+ function up143(db) {
16915
16940
  db.exec(`
16916
16941
  CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
16917
16942
  agent_id TEXT NOT NULL,
@@ -16925,7 +16950,7 @@ function up142(db) {
16925
16950
  }
16926
16951
 
16927
16952
  // src/migrations/141-source-sync-checkpoints.ts
16928
- function up143(db) {
16953
+ function up144(db) {
16929
16954
  db.exec(`
16930
16955
  CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
16931
16956
  agent_id TEXT NOT NULL,
@@ -16941,7 +16966,7 @@ function up143(db) {
16941
16966
  }
16942
16967
 
16943
16968
  // src/migrations/142-source-sync-frontier.ts
16944
- function up144(db) {
16969
+ function up145(db) {
16945
16970
  const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
16946
16971
  if (!columns.some((column) => column.name === "frontier")) {
16947
16972
  db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
@@ -16949,7 +16974,7 @@ function up144(db) {
16949
16974
  }
16950
16975
 
16951
16976
  // src/migrations/143-embedding-index-progress.ts
16952
- function up145(db) {
16977
+ function up146(db) {
16953
16978
  const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
16954
16979
  const additions = [
16955
16980
  ["migration_phase", "TEXT"],
@@ -16986,7 +17011,7 @@ function up145(db) {
16986
17011
  }
16987
17012
 
16988
17013
  // src/migrations/144-memory-job-lease-token.ts
16989
- function up146(db) {
17014
+ function up147(db) {
16990
17015
  const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
16991
17016
  if (!columns.has("lease_token")) {
16992
17017
  db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
@@ -16994,7 +17019,7 @@ function up146(db) {
16994
17019
  }
16995
17020
 
16996
17021
  // src/migrations/145-dreaming-evidence-reviews.ts
16997
- function up147(db) {
17022
+ function up148(db) {
16998
17023
  db.exec(`
16999
17024
  CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
17000
17025
  agent_id TEXT NOT NULL,
@@ -17014,7 +17039,7 @@ function up147(db) {
17014
17039
  }
17015
17040
 
17016
17041
  // src/migrations/146-source-transcript-import.ts
17017
- function up148(db) {
17042
+ function up149(db) {
17018
17043
  db.exec(`
17019
17044
  CREATE TABLE IF NOT EXISTS source_import_jobs (
17020
17045
  id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
@@ -17083,12 +17108,12 @@ function up148(db) {
17083
17108
  }
17084
17109
 
17085
17110
  // src/migrations/147-source-import-replay-file-slots.ts
17086
- function up149(db) {
17111
+ function up150(db) {
17087
17112
  db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
17088
17113
  }
17089
17114
 
17090
17115
  // src/migrations/148-source-import-attempt-provenance.ts
17091
- function up150(db) {
17116
+ function up151(db) {
17092
17117
  const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
17093
17118
  if (!columns.some((column) => column.name === "source_id")) {
17094
17119
  db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
@@ -17096,7 +17121,7 @@ function up150(db) {
17096
17121
  }
17097
17122
 
17098
17123
  // src/migrations/149-transcript-import-state-machine.ts
17099
- function up151(db) {
17124
+ function up152(db) {
17100
17125
  const addColumn = (table, column, definition) => {
17101
17126
  const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
17102
17127
  let exists;
@@ -17114,14 +17139,14 @@ function up151(db) {
17114
17139
  }
17115
17140
 
17116
17141
  // src/migrations/150-memory-head-freshness.ts
17117
- function addColumnIfMissing28(db, table, column, definition) {
17142
+ function addColumnIfMissing29(db, table, column, definition) {
17118
17143
  const columns = db.prepare(`PRAGMA table_info(${table})`).all();
17119
17144
  if (!columns.some((row) => row.name === column))
17120
17145
  db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
17121
17146
  }
17122
- function up152(db) {
17123
- addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
17124
- addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
17147
+ function up153(db) {
17148
+ addColumnIfMissing29(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
17149
+ addColumnIfMissing29(db, "dreaming_passes", "head_base_revision", "INTEGER");
17125
17150
  db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
17126
17151
  db.exec("CREATE INDEX IF NOT EXISTS idx_memory_md_heads_content_hash ON memory_md_heads(content_hash)");
17127
17152
  db.exec(`
@@ -17271,7 +17296,7 @@ function up152(db) {
17271
17296
  }
17272
17297
 
17273
17298
  // src/migrations/153-vector-repair-checkpoints.ts
17274
- function up153(db) {
17299
+ function up154(db) {
17275
17300
  db.exec(`
17276
17301
  CREATE TABLE IF NOT EXISTS vector_repair_checkpoints (
17277
17302
  operation TEXT NOT NULL CHECK (operation IN ('resync', 'clean-orphans')),
@@ -17302,13 +17327,13 @@ var MIGRATIONS = [
17302
17327
  {
17303
17328
  version: 1,
17304
17329
  name: "baseline",
17305
- up: up3,
17330
+ up: up4,
17306
17331
  artifacts: { tables: ["memories", "conversations", "embeddings"] }
17307
17332
  },
17308
17333
  {
17309
17334
  version: 2,
17310
17335
  name: "pipeline-v2",
17311
- up: up4,
17336
+ up: up5,
17312
17337
  artifacts: {
17313
17338
  tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
17314
17339
  }
@@ -17316,12 +17341,12 @@ var MIGRATIONS = [
17316
17341
  {
17317
17342
  version: 3,
17318
17343
  name: "unique-content-hash",
17319
- up: up5
17344
+ up: up6
17320
17345
  },
17321
17346
  {
17322
17347
  version: 4,
17323
17348
  name: "history-actor-and-retention",
17324
- up: up6,
17349
+ up: up7,
17325
17350
  artifacts: {
17326
17351
  columns: [{ table: "memory_history", column: "actor_type" }]
17327
17352
  }
@@ -17329,7 +17354,7 @@ var MIGRATIONS = [
17329
17354
  {
17330
17355
  version: 5,
17331
17356
  name: "graph-extended",
17332
- up: up7,
17357
+ up: up8,
17333
17358
  artifacts: {
17334
17359
  columns: [{ table: "entities", column: "canonical_name" }]
17335
17360
  }
@@ -17337,7 +17362,7 @@ var MIGRATIONS = [
17337
17362
  {
17338
17363
  version: 6,
17339
17364
  name: "idempotency-key",
17340
- up: up8,
17365
+ up: up9,
17341
17366
  artifacts: {
17342
17367
  columns: [{ table: "memories", column: "idempotency_key" }]
17343
17368
  }
@@ -17345,42 +17370,42 @@ var MIGRATIONS = [
17345
17370
  {
17346
17371
  version: 7,
17347
17372
  name: "documents-and-connectors",
17348
- up: up9,
17373
+ up: up10,
17349
17374
  artifacts: { tables: ["documents", "document_memories", "connectors"] }
17350
17375
  },
17351
17376
  {
17352
17377
  version: 8,
17353
17378
  name: "embeddings-unique-hash",
17354
- up: up10
17379
+ up: up11
17355
17380
  },
17356
17381
  {
17357
17382
  version: 9,
17358
17383
  name: "summary-jobs",
17359
- up: up11,
17384
+ up: up12,
17360
17385
  artifacts: { tables: ["summary_jobs"] }
17361
17386
  },
17362
17387
  {
17363
17388
  version: 10,
17364
17389
  name: "umap-cache",
17365
- up: up12,
17390
+ up: up13,
17366
17391
  artifacts: { tables: ["umap_cache"] }
17367
17392
  },
17368
17393
  {
17369
17394
  version: 11,
17370
17395
  name: "session-scores",
17371
- up: up13,
17396
+ up: up14,
17372
17397
  artifacts: { tables: ["session_scores"] }
17373
17398
  },
17374
17399
  {
17375
17400
  version: 12,
17376
17401
  name: "scheduled-tasks",
17377
- up: up14,
17402
+ up: up15,
17378
17403
  artifacts: { tables: ["scheduled_tasks", "task_runs"] }
17379
17404
  },
17380
17405
  {
17381
17406
  version: 13,
17382
17407
  name: "ingestion-tracking",
17383
- up: up15,
17408
+ up: up16,
17384
17409
  artifacts: {
17385
17410
  columns: [
17386
17411
  { table: "memories", column: "source_path" },
@@ -17391,13 +17416,13 @@ var MIGRATIONS = [
17391
17416
  {
17392
17417
  version: 14,
17393
17418
  name: "telemetry",
17394
- up: up16,
17419
+ up: up17,
17395
17420
  artifacts: { tables: ["telemetry_events"] }
17396
17421
  },
17397
17422
  {
17398
17423
  version: 15,
17399
17424
  name: "session-memories",
17400
- up: up17,
17425
+ up: up18,
17401
17426
  artifacts: {
17402
17427
  tables: ["session_memories"],
17403
17428
  columns: [
@@ -17409,13 +17434,13 @@ var MIGRATIONS = [
17409
17434
  {
17410
17435
  version: 16,
17411
17436
  name: "session-checkpoints",
17412
- up: up18,
17437
+ up: up19,
17413
17438
  artifacts: { tables: ["session_checkpoints"] }
17414
17439
  },
17415
17440
  {
17416
17441
  version: 17,
17417
17442
  name: "task-skills",
17418
- up: up19,
17443
+ up: up20,
17419
17444
  artifacts: {
17420
17445
  columns: [{ table: "scheduled_tasks", column: "skill_name" }]
17421
17446
  }
@@ -17423,13 +17448,13 @@ var MIGRATIONS = [
17423
17448
  {
17424
17449
  version: 18,
17425
17450
  name: "skill-meta",
17426
- up: up20,
17451
+ up: up21,
17427
17452
  artifacts: { tables: ["skill_meta"] }
17428
17453
  },
17429
17454
  {
17430
17455
  version: 19,
17431
17456
  name: "knowledge-structure",
17432
- up: up21,
17457
+ up: up22,
17433
17458
  artifacts: {
17434
17459
  tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
17435
17460
  columns: [{ table: "entities", column: "agent_id" }]
@@ -17438,7 +17463,7 @@ var MIGRATIONS = [
17438
17463
  {
17439
17464
  version: 20,
17440
17465
  name: "session-structural-columns",
17441
- up: up22,
17466
+ up: up23,
17442
17467
  artifacts: {
17443
17468
  columns: [
17444
17469
  { table: "session_memories", column: "entity_slot" },
@@ -17451,7 +17476,7 @@ var MIGRATIONS = [
17451
17476
  {
17452
17477
  version: 21,
17453
17478
  name: "checkpoint-structural",
17454
- up: up23,
17479
+ up: up24,
17455
17480
  artifacts: {
17456
17481
  columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
17457
17482
  }
@@ -17459,7 +17484,7 @@ var MIGRATIONS = [
17459
17484
  {
17460
17485
  version: 22,
17461
17486
  name: "entity-pinning",
17462
- up: up24,
17487
+ up: up25,
17463
17488
  artifacts: {
17464
17489
  columns: [
17465
17490
  { table: "entities", column: "pinned" },
@@ -17470,17 +17495,17 @@ var MIGRATIONS = [
17470
17495
  {
17471
17496
  version: 23,
17472
17497
  name: "retired-scorer-gap",
17473
- up: up25
17498
+ up: up26
17474
17499
  },
17475
17500
  {
17476
17501
  version: 24,
17477
17502
  name: "retired-scorer-gap",
17478
- up: up26
17503
+ up: up27
17479
17504
  },
17480
17505
  {
17481
17506
  version: 25,
17482
17507
  name: "agent-feedback",
17483
- up: up27,
17508
+ up: up28,
17484
17509
  artifacts: {
17485
17510
  columns: [{ table: "session_memories", column: "agent_relevance_score" }]
17486
17511
  }
@@ -17488,32 +17513,32 @@ var MIGRATIONS = [
17488
17513
  {
17489
17514
  version: 26,
17490
17515
  name: "retired-scorer-gap",
17491
- up: up28
17516
+ up: up29
17492
17517
  },
17493
17518
  {
17494
17519
  version: 27,
17495
17520
  name: "backfill-canonical-names",
17496
- up: up29
17521
+ up: up30
17497
17522
  },
17498
17523
  {
17499
17524
  version: 28,
17500
17525
  name: "lossless-retention",
17501
- up: up30
17526
+ up: up31
17502
17527
  },
17503
17528
  {
17504
17529
  version: 29,
17505
17530
  name: "session-summary-dag",
17506
- up: up31
17531
+ up: up32
17507
17532
  },
17508
17533
  {
17509
17534
  version: 30,
17510
17535
  name: "nullable-memory-job-memory-id",
17511
- up: up32
17536
+ up: up33
17512
17537
  },
17513
17538
  {
17514
17539
  version: 31,
17515
17540
  name: "dependency-reason",
17516
- up: up33,
17541
+ up: up34,
17517
17542
  artifacts: {
17518
17543
  columns: [
17519
17544
  { table: "entity_dependencies", column: "reason" },
@@ -17524,7 +17549,7 @@ var MIGRATIONS = [
17524
17549
  {
17525
17550
  version: 32,
17526
17551
  name: "embeddings-vector-column",
17527
- up: up34,
17552
+ up: up35,
17528
17553
  artifacts: {
17529
17554
  columns: [{ table: "embeddings", column: "vector", optional: true }]
17530
17555
  }
@@ -17532,7 +17557,7 @@ var MIGRATIONS = [
17532
17557
  {
17533
17558
  version: 33,
17534
17559
  name: "scope",
17535
- up: up35,
17560
+ up: up36,
17536
17561
  artifacts: {
17537
17562
  columns: [{ table: "memories", column: "scope" }]
17538
17563
  }
@@ -17540,17 +17565,17 @@ var MIGRATIONS = [
17540
17565
  {
17541
17566
  version: 34,
17542
17567
  name: "scope-aware-dedup",
17543
- up: up36
17568
+ up: up37
17544
17569
  },
17545
17570
  {
17546
17571
  version: 35,
17547
17572
  name: "entity-fts",
17548
- up: up37
17573
+ up: up38
17549
17574
  },
17550
17575
  {
17551
17576
  version: 36,
17552
17577
  name: "dependency-confidence",
17553
- up: up38,
17578
+ up: up39,
17554
17579
  artifacts: {
17555
17580
  columns: [{ table: "entity_dependencies", column: "confidence" }]
17556
17581
  }
@@ -17558,7 +17583,7 @@ var MIGRATIONS = [
17558
17583
  {
17559
17584
  version: 37,
17560
17585
  name: "entity-communities",
17561
- up: up39,
17586
+ up: up40,
17562
17587
  artifacts: {
17563
17588
  tables: ["entity_communities"],
17564
17589
  columns: [{ table: "entities", column: "community_id" }]
@@ -17567,24 +17592,24 @@ var MIGRATIONS = [
17567
17592
  {
17568
17593
  version: 38,
17569
17594
  name: "memory-hints",
17570
- up: up40,
17595
+ up: up41,
17571
17596
  artifacts: { tables: ["memory_hints"] }
17572
17597
  },
17573
17598
  {
17574
17599
  version: 39,
17575
17600
  name: "dedup-entity-dependencies",
17576
- up: up41
17601
+ up: up42
17577
17602
  },
17578
17603
  {
17579
17604
  version: 40,
17580
17605
  name: "session-transcripts",
17581
- up: up42,
17606
+ up: up43,
17582
17607
  artifacts: { tables: ["session_transcripts"] }
17583
17608
  },
17584
17609
  {
17585
17610
  version: 41,
17586
17611
  name: "path-feedback",
17587
- up: up43,
17612
+ up: up44,
17588
17613
  artifacts: {
17589
17614
  tables: [
17590
17615
  "path_feedback_events",
@@ -17599,7 +17624,7 @@ var MIGRATIONS = [
17599
17624
  {
17600
17625
  version: 42,
17601
17626
  name: "session-memories-agent-id",
17602
- up: up44,
17627
+ up: up45,
17603
17628
  artifacts: {
17604
17629
  columns: [{ table: "session_memories", column: "agent_id" }]
17605
17630
  }
@@ -17607,7 +17632,7 @@ var MIGRATIONS = [
17607
17632
  {
17608
17633
  version: 43,
17609
17634
  name: "agents-table",
17610
- up: up45,
17635
+ up: up46,
17611
17636
  artifacts: {
17612
17637
  tables: ["agents"],
17613
17638
  columns: [
@@ -17619,7 +17644,7 @@ var MIGRATIONS = [
17619
17644
  {
17620
17645
  version: 44,
17621
17646
  name: "memory-md-temporal-head",
17622
- up: up46,
17647
+ up: up47,
17623
17648
  artifacts: {
17624
17649
  columns: [
17625
17650
  { table: "session_summaries", column: "source_type" },
@@ -17631,7 +17656,7 @@ var MIGRATIONS = [
17631
17656
  {
17632
17657
  version: 45,
17633
17658
  name: "lossless-working-memory-hardening",
17634
- up: up47,
17659
+ up: up48,
17635
17660
  artifacts: {
17636
17661
  tables: ["session_transcripts_fts", "memory_md_heads"],
17637
17662
  columns: [
@@ -17644,17 +17669,17 @@ var MIGRATIONS = [
17644
17669
  {
17645
17670
  version: 46,
17646
17671
  name: "session-summary-uniqueness",
17647
- up: up48
17672
+ up: up49
17648
17673
  },
17649
17674
  {
17650
17675
  version: 47,
17651
17676
  name: "agent-scoped-temporal-uniqueness",
17652
- up: up49
17677
+ up: up50
17653
17678
  },
17654
17679
  {
17655
17680
  version: 48,
17656
17681
  name: "thread-heads",
17657
- up: up50,
17682
+ up: up51,
17658
17683
  artifacts: {
17659
17684
  tables: ["memory_thread_heads"]
17660
17685
  }
@@ -17662,7 +17687,7 @@ var MIGRATIONS = [
17662
17687
  {
17663
17688
  version: 49,
17664
17689
  name: "session-extract-cursors",
17665
- up: up51,
17690
+ up: up52,
17666
17691
  artifacts: {
17667
17692
  tables: ["session_extract_cursors"]
17668
17693
  }
@@ -17670,7 +17695,7 @@ var MIGRATIONS = [
17670
17695
  {
17671
17696
  version: 50,
17672
17697
  name: "related-to-audit",
17673
- up: up52,
17698
+ up: up53,
17674
17699
  artifacts: {
17675
17700
  tables: ["entity_dependency_history"]
17676
17701
  }
@@ -17678,7 +17703,7 @@ var MIGRATIONS = [
17678
17703
  {
17679
17704
  version: 51,
17680
17705
  name: "memory-md-rolling-window-lineage",
17681
- up: up53,
17706
+ up: up54,
17682
17707
  artifacts: {
17683
17708
  tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
17684
17709
  columns: [
@@ -17693,7 +17718,7 @@ var MIGRATIONS = [
17693
17718
  {
17694
17719
  version: 52,
17695
17720
  name: "mcp-invocations",
17696
- up: up54,
17721
+ up: up55,
17697
17722
  artifacts: {
17698
17723
  tables: ["mcp_invocations"]
17699
17724
  }
@@ -17701,7 +17726,7 @@ var MIGRATIONS = [
17701
17726
  {
17702
17727
  version: 53,
17703
17728
  name: "skill-invocations",
17704
- up: up55,
17729
+ up: up56,
17705
17730
  artifacts: {
17706
17731
  tables: ["skill_invocations"]
17707
17732
  }
@@ -17709,7 +17734,7 @@ var MIGRATIONS = [
17709
17734
  {
17710
17735
  version: 54,
17711
17736
  name: "task-agent-scope",
17712
- up: up56,
17737
+ up: up57,
17713
17738
  artifacts: {
17714
17739
  tables: ["task_scope_hints"]
17715
17740
  }
@@ -17717,7 +17742,7 @@ var MIGRATIONS = [
17717
17742
  {
17718
17743
  version: 55,
17719
17744
  name: "dreaming-state",
17720
- up: up57,
17745
+ up: up58,
17721
17746
  artifacts: {
17722
17747
  tables: ["dreaming_state", "dreaming_passes"]
17723
17748
  }
@@ -17725,22 +17750,22 @@ var MIGRATIONS = [
17725
17750
  {
17726
17751
  version: 56,
17727
17752
  name: "agent-scoped-content-hash",
17728
- up: up58
17753
+ up: up59
17729
17754
  },
17730
17755
  {
17731
17756
  version: 57,
17732
17757
  name: "memories-fts-tokenizer-repair",
17733
- up: up59
17758
+ up: up60
17734
17759
  },
17735
17760
  {
17736
17761
  version: 58,
17737
17762
  name: "knowledge-graph-indices",
17738
- up: up60
17763
+ up: up61
17739
17764
  },
17740
17765
  {
17741
17766
  version: 59,
17742
17767
  name: "entity-attribute-claim-key",
17743
- up: up61,
17768
+ up: up62,
17744
17769
  artifacts: {
17745
17770
  columns: [{ table: "entity_attributes", column: "claim_key" }]
17746
17771
  }
@@ -17748,7 +17773,7 @@ var MIGRATIONS = [
17748
17773
  {
17749
17774
  version: 60,
17750
17775
  name: "entity-attribute-group-key",
17751
- up: up62,
17776
+ up: up63,
17752
17777
  artifacts: {
17753
17778
  columns: [{ table: "entity_attributes", column: "group_key" }]
17754
17779
  }
@@ -17756,7 +17781,7 @@ var MIGRATIONS = [
17756
17781
  {
17757
17782
  version: 61,
17758
17783
  name: "memory-artifact-source-mtime",
17759
- up: up63,
17784
+ up: up64,
17760
17785
  artifacts: {
17761
17786
  columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
17762
17787
  }
@@ -17764,7 +17789,7 @@ var MIGRATIONS = [
17764
17789
  {
17765
17790
  version: 62,
17766
17791
  name: "memory-artifact-soft-delete",
17767
- up: up64,
17792
+ up: up65,
17768
17793
  artifacts: {
17769
17794
  columns: [
17770
17795
  { table: "memory_artifacts", column: "is_deleted" },
@@ -17775,12 +17800,12 @@ var MIGRATIONS = [
17775
17800
  {
17776
17801
  version: 63,
17777
17802
  name: "content-only-memories-fts-update",
17778
- up: up65
17803
+ up: up66
17779
17804
  },
17780
17805
  {
17781
17806
  version: 64,
17782
17807
  name: "source-graph-provenance",
17783
- up: up66,
17808
+ up: up67,
17784
17809
  artifacts: {
17785
17810
  columns: [
17786
17811
  { table: "entities", column: "source_path" },
@@ -17793,7 +17818,7 @@ var MIGRATIONS = [
17793
17818
  {
17794
17819
  version: 65,
17795
17820
  name: "source-embedding-agent-scope",
17796
- up: up67,
17821
+ up: up68,
17797
17822
  artifacts: {
17798
17823
  columns: [{ table: "embeddings", column: "agent_id", optional: true }]
17799
17824
  }
@@ -17801,7 +17826,7 @@ var MIGRATIONS = [
17801
17826
  {
17802
17827
  version: 66,
17803
17828
  name: "memory-search-telemetry",
17804
- up: up68,
17829
+ up: up69,
17805
17830
  artifacts: {
17806
17831
  tables: ["memory_search_telemetry"]
17807
17832
  }
@@ -17809,7 +17834,7 @@ var MIGRATIONS = [
17809
17834
  {
17810
17835
  version: 67,
17811
17836
  name: "ontology-proposals",
17812
- up: up69,
17837
+ up: up70,
17813
17838
  artifacts: {
17814
17839
  tables: ["ontology_proposals"],
17815
17840
  columns: [
@@ -17823,7 +17848,7 @@ var MIGRATIONS = [
17823
17848
  {
17824
17849
  version: 68,
17825
17850
  name: "daily-reflections",
17826
- up: up70,
17851
+ up: up71,
17827
17852
  artifacts: {
17828
17853
  tables: ["daily_reflections"]
17829
17854
  }
@@ -17831,7 +17856,7 @@ var MIGRATIONS = [
17831
17856
  {
17832
17857
  version: 69,
17833
17858
  name: "daily-reflections-multiple-insights",
17834
- up: up71,
17859
+ up: up72,
17835
17860
  artifacts: {
17836
17861
  tables: ["daily_reflections"]
17837
17862
  }
@@ -17839,7 +17864,7 @@ var MIGRATIONS = [
17839
17864
  {
17840
17865
  version: 70,
17841
17866
  name: "ontology-control-plane-state",
17842
- up: up72,
17867
+ up: up73,
17843
17868
  artifacts: {
17844
17869
  columns: [
17845
17870
  { table: "entities", column: "status" },
@@ -17854,7 +17879,7 @@ var MIGRATIONS = [
17854
17879
  {
17855
17880
  version: 71,
17856
17881
  name: "epistemic-assertions",
17857
- up: up73,
17882
+ up: up74,
17858
17883
  artifacts: {
17859
17884
  tables: ["epistemic_assertions"]
17860
17885
  }
@@ -17862,7 +17887,7 @@ var MIGRATIONS = [
17862
17887
  {
17863
17888
  version: 72,
17864
17889
  name: "agent-scoped-idempotency-key",
17865
- up: up74,
17890
+ up: up75,
17866
17891
  artifacts: {
17867
17892
  columns: [
17868
17893
  { table: "memories", column: "idempotency_key" },
@@ -17873,7 +17898,7 @@ var MIGRATIONS = [
17873
17898
  {
17874
17899
  version: 73,
17875
17900
  name: "recall-context-dedupe",
17876
- up: up75,
17901
+ up: up76,
17877
17902
  artifacts: {
17878
17903
  tables: ["session_context_epochs", "session_recall_events"]
17879
17904
  }
@@ -17881,7 +17906,7 @@ var MIGRATIONS = [
17881
17906
  {
17882
17907
  version: 74,
17883
17908
  name: "aggregate-memory-links",
17884
- up: up76,
17909
+ up: up77,
17885
17910
  artifacts: {
17886
17911
  tables: ["aggregate_memory_sources"]
17887
17912
  }
@@ -17889,7 +17914,7 @@ var MIGRATIONS = [
17889
17914
  {
17890
17915
  version: 75,
17891
17916
  name: "memory-artifact-source-provenance",
17892
- up: up77,
17917
+ up: up78,
17893
17918
  artifacts: {
17894
17919
  columns: [
17895
17920
  { table: "memory_artifacts", column: "source_id" },
@@ -17903,7 +17928,7 @@ var MIGRATIONS = [
17903
17928
  {
17904
17929
  version: 76,
17905
17930
  name: "temporal-edges",
17906
- up: up78,
17931
+ up: up79,
17907
17932
  artifacts: {
17908
17933
  tables: ["temporal_edges"]
17909
17934
  }
@@ -17911,7 +17936,7 @@ var MIGRATIONS = [
17911
17936
  {
17912
17937
  version: 77,
17913
17938
  name: "entity-aliases",
17914
- up: up79,
17939
+ up: up80,
17915
17940
  artifacts: {
17916
17941
  tables: ["entity_aliases"]
17917
17942
  }
@@ -17919,7 +17944,7 @@ var MIGRATIONS = [
17919
17944
  {
17920
17945
  version: 78,
17921
17946
  name: "api-keys",
17922
- up: up80,
17947
+ up: up81,
17923
17948
  artifacts: {
17924
17949
  tables: ["api_keys"]
17925
17950
  }
@@ -17927,7 +17952,7 @@ var MIGRATIONS = [
17927
17952
  {
17928
17953
  version: 79,
17929
17954
  name: "transcript-capture-jobs",
17930
- up: up81,
17955
+ up: up82,
17931
17956
  artifacts: {
17932
17957
  tables: ["transcript_capture_jobs"]
17933
17958
  }
@@ -17935,7 +17960,7 @@ var MIGRATIONS = [
17935
17960
  {
17936
17961
  version: 80,
17937
17962
  name: "document-scope-columns",
17938
- up: up82,
17963
+ up: up83,
17939
17964
  artifacts: {
17940
17965
  columns: [
17941
17966
  { table: "documents", column: "agent_id" },
@@ -17946,7 +17971,7 @@ var MIGRATIONS = [
17946
17971
  {
17947
17972
  version: 81,
17948
17973
  name: "aggregate-evidence-sources",
17949
- up: up83,
17974
+ up: up84,
17950
17975
  artifacts: {
17951
17976
  tables: ["aggregate_evidence_sources"]
17952
17977
  }
@@ -17954,7 +17979,7 @@ var MIGRATIONS = [
17954
17979
  {
17955
17980
  version: 82,
17956
17981
  name: "skill-invocations-harness",
17957
- up: up84,
17982
+ up: up85,
17958
17983
  artifacts: {
17959
17984
  columns: [
17960
17985
  { table: "skill_invocations", column: "harness" },
@@ -17965,7 +17990,7 @@ var MIGRATIONS = [
17965
17990
  {
17966
17991
  version: 83,
17967
17992
  name: "memory-lifecycle-repair",
17968
- up: up85,
17993
+ up: up86,
17969
17994
  artifacts: {
17970
17995
  tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
17971
17996
  columns: [
@@ -17980,7 +18005,7 @@ var MIGRATIONS = [
17980
18005
  {
17981
18006
  version: 84,
17982
18007
  name: "legacy-markdown-import-state",
17983
- up: up86,
18008
+ up: up87,
17984
18009
  artifacts: {
17985
18010
  tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
17986
18011
  }
@@ -17988,7 +18013,7 @@ var MIGRATIONS = [
17988
18013
  {
17989
18014
  version: 85,
17990
18015
  name: "backfill-relations-to-dependencies",
17991
- up: up87,
18016
+ up: up88,
17992
18017
  artifacts: {
17993
18018
  tables: ["entity_dependencies"]
17994
18019
  }
@@ -17996,7 +18021,7 @@ var MIGRATIONS = [
17996
18021
  {
17997
18022
  version: 86,
17998
18023
  name: "summary-jobs-content-hash",
17999
- up: up88,
18024
+ up: up89,
18000
18025
  artifacts: {
18001
18026
  columns: [{ table: "summary_jobs", column: "content_hash" }]
18002
18027
  }
@@ -18004,7 +18029,7 @@ var MIGRATIONS = [
18004
18029
  {
18005
18030
  version: 87,
18006
18031
  name: "summary-jobs-boundary-reason",
18007
- up: up89,
18032
+ up: up90,
18008
18033
  artifacts: {
18009
18034
  columns: [{ table: "summary_jobs", column: "boundary_reason" }]
18010
18035
  }
@@ -18012,7 +18037,7 @@ var MIGRATIONS = [
18012
18037
  {
18013
18038
  version: 88,
18014
18039
  name: "transcript-recovery-files",
18015
- up: up90,
18040
+ up: up91,
18016
18041
  artifacts: {
18017
18042
  tables: ["transcript_recovery_files"]
18018
18043
  }
@@ -18020,7 +18045,7 @@ var MIGRATIONS = [
18020
18045
  {
18021
18046
  version: 89,
18022
18047
  name: "job-cancellations",
18023
- up: up91,
18048
+ up: up92,
18024
18049
  artifacts: {
18025
18050
  tables: ["job_cancellations"]
18026
18051
  }
@@ -18028,7 +18053,7 @@ var MIGRATIONS = [
18028
18053
  {
18029
18054
  version: 90,
18030
18055
  name: "job-archive",
18031
- up: up92,
18056
+ up: up93,
18032
18057
  artifacts: {
18033
18058
  tables: ["job_archive"]
18034
18059
  }
@@ -18036,25 +18061,25 @@ var MIGRATIONS = [
18036
18061
  {
18037
18062
  version: 91,
18038
18063
  name: "embedding-index-generations",
18039
- up: up93,
18064
+ up: up94,
18040
18065
  artifacts: { tables: ["embedding_index_state"] }
18041
18066
  },
18042
18067
  {
18043
18068
  version: 92,
18044
18069
  name: "embedding-staging-store",
18045
- up: up94,
18070
+ up: up95,
18046
18071
  artifacts: { tables: ["embeddings_staging"] }
18047
18072
  },
18048
18073
  {
18049
18074
  version: 93,
18050
18075
  name: "dreaming-evidence-cursor",
18051
- up: up95,
18076
+ up: up96,
18052
18077
  artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
18053
18078
  },
18054
18079
  {
18055
18080
  version: 94,
18056
18081
  name: "memory-kind",
18057
- up: up96,
18082
+ up: up97,
18058
18083
  artifacts: {
18059
18084
  columns: [
18060
18085
  { table: "memories", column: "memory_kind" },
@@ -18065,35 +18090,35 @@ var MIGRATIONS = [
18065
18090
  {
18066
18091
  version: 95,
18067
18092
  name: "compaction-recall-projections",
18068
- up: up97
18093
+ up: up98
18069
18094
  },
18070
18095
  {
18071
18096
  version: 96,
18072
18097
  name: "retire-legacy-ingestion",
18073
- up: up98
18098
+ up: up99
18074
18099
  },
18075
18100
  {
18076
18101
  version: 97,
18077
18102
  name: "dreaming-failure-backoff",
18078
- up: up99,
18103
+ up: up100,
18079
18104
  artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
18080
18105
  },
18081
18106
  {
18082
18107
  version: 98,
18083
18108
  name: "dreaming-evidence-exclusions",
18084
- up: up100,
18109
+ up: up101,
18085
18110
  artifacts: { tables: ["dreaming_evidence_exclusions"] }
18086
18111
  },
18087
18112
  {
18088
18113
  version: 99,
18089
18114
  name: "dreaming-tool-calls",
18090
- up: up101,
18115
+ up: up102,
18091
18116
  artifacts: { tables: ["dreaming_tool_calls"] }
18092
18117
  },
18093
18118
  {
18094
18119
  version: 100,
18095
18120
  name: "dreaming-runbook",
18096
- up: up102,
18121
+ up: up103,
18097
18122
  artifacts: {
18098
18123
  columns: [
18099
18124
  { table: "dreaming_passes", column: "evidence_window_json" },
@@ -18104,23 +18129,23 @@ var MIGRATIONS = [
18104
18129
  {
18105
18130
  version: 101,
18106
18131
  name: "dreaming-attention",
18107
- up: up103,
18132
+ up: up104,
18108
18133
  artifacts: { tables: ["dreaming_attention"] }
18109
18134
  },
18110
18135
  {
18111
18136
  version: 102,
18112
18137
  name: "attribute-semantic-memories",
18113
- up: up104
18138
+ up: up105
18114
18139
  },
18115
18140
  {
18116
18141
  version: 103,
18117
18142
  name: "semantic-memory-kind",
18118
- up: up105
18143
+ up: up106
18119
18144
  },
18120
18145
  {
18121
18146
  version: 104,
18122
18147
  name: "derived-memory-provenance",
18123
- up: up106,
18148
+ up: up107,
18124
18149
  artifacts: {
18125
18150
  tables: ["derived_memory_sources"],
18126
18151
  columns: [{ table: "memories", column: "stale_at" }]
@@ -18129,12 +18154,12 @@ var MIGRATIONS = [
18129
18154
  {
18130
18155
  version: 105,
18131
18156
  name: "agent-scoped-entity-name",
18132
- up: up107
18157
+ up: up108
18133
18158
  },
18134
18159
  {
18135
18160
  version: 106,
18136
18161
  name: "memory-review-after",
18137
- up: up108,
18162
+ up: up109,
18138
18163
  artifacts: {
18139
18164
  columns: [{ table: "memories", column: "review_after" }]
18140
18165
  }
@@ -18142,7 +18167,7 @@ var MIGRATIONS = [
18142
18167
  {
18143
18168
  version: 107,
18144
18169
  name: "dreaming-pass-usage",
18145
- up: up109,
18170
+ up: up110,
18146
18171
  artifacts: {
18147
18172
  columns: [
18148
18173
  { table: "dreaming_passes", column: "tokens_input" },
@@ -18156,7 +18181,7 @@ var MIGRATIONS = [
18156
18181
  {
18157
18182
  version: 108,
18158
18183
  name: "embedding-usage",
18159
- up: up110,
18184
+ up: up111,
18160
18185
  artifacts: {
18161
18186
  tables: ["embedding_usage"]
18162
18187
  }
@@ -18164,7 +18189,7 @@ var MIGRATIONS = [
18164
18189
  {
18165
18190
  version: 109,
18166
18191
  name: "telemetry-install",
18167
- up: up111,
18192
+ up: up112,
18168
18193
  artifacts: {
18169
18194
  tables: ["telemetry_install"]
18170
18195
  }
@@ -18172,12 +18197,12 @@ var MIGRATIONS = [
18172
18197
  {
18173
18198
  version: 110,
18174
18199
  name: "memory-mention-join-index",
18175
- up: up112
18200
+ up: up113
18176
18201
  },
18177
18202
  {
18178
18203
  version: 111,
18179
18204
  name: "telemetry-first-use",
18180
- up: up113,
18205
+ up: up114,
18181
18206
  artifacts: {
18182
18207
  columns: [
18183
18208
  { table: "telemetry_install", column: "first_remember_at" },
@@ -18188,7 +18213,7 @@ var MIGRATIONS = [
18188
18213
  {
18189
18214
  version: 112,
18190
18215
  name: "telemetry-queue-ownership",
18191
- up: up114,
18216
+ up: up115,
18192
18217
  artifacts: {
18193
18218
  columns: [
18194
18219
  { table: "telemetry_events", column: "source" },
@@ -18200,7 +18225,7 @@ var MIGRATIONS = [
18200
18225
  {
18201
18226
  version: 113,
18202
18227
  name: "session-claims",
18203
- up: up115,
18228
+ up: up116,
18204
18229
  artifacts: {
18205
18230
  tables: ["session_claims"],
18206
18231
  columns: [
@@ -18214,12 +18239,12 @@ var MIGRATIONS = [
18214
18239
  {
18215
18240
  version: 114,
18216
18241
  name: "memory-traversal-hydration-index",
18217
- up: up116
18242
+ up: up117
18218
18243
  },
18219
18244
  {
18220
18245
  version: 115,
18221
18246
  name: "cross-agent-message-notifications",
18222
- up: up117,
18247
+ up: up118,
18223
18248
  artifacts: {
18224
18249
  tables: ["cross_agent_messages", "cross_agent_message_receipts"]
18225
18250
  }
@@ -18227,7 +18252,7 @@ var MIGRATIONS = [
18227
18252
  {
18228
18253
  version: 116,
18229
18254
  name: "acp-delivery-reconciliation",
18230
- up: up118,
18255
+ up: up119,
18231
18256
  artifacts: {
18232
18257
  columns: [
18233
18258
  { table: "cross_agent_messages", column: "delivery_state" },
@@ -18241,7 +18266,7 @@ var MIGRATIONS = [
18241
18266
  {
18242
18267
  version: 117,
18243
18268
  name: "retire-summary-worker",
18244
- up: up119,
18269
+ up: up120,
18245
18270
  artifacts: {
18246
18271
  columns: [
18247
18272
  { table: "session_transcripts", column: "completed_at" },
@@ -18252,24 +18277,24 @@ var MIGRATIONS = [
18252
18277
  {
18253
18278
  version: 118,
18254
18279
  name: "queue-pressure-indices",
18255
- up: up120
18280
+ up: up121
18256
18281
  },
18257
18282
  {
18258
18283
  version: 119,
18259
18284
  name: "telemetry-version-observation",
18260
- up: up121,
18285
+ up: up122,
18261
18286
  artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
18262
18287
  },
18263
18288
  {
18264
18289
  version: 120,
18265
18290
  name: "source-lifecycle-telemetry",
18266
- up: up122,
18291
+ up: up123,
18267
18292
  artifacts: { tables: ["source_lifecycle_state"] }
18268
18293
  },
18269
18294
  {
18270
18295
  version: 121,
18271
18296
  name: "telemetry-delivery-health",
18272
- up: up123,
18297
+ up: up124,
18273
18298
  artifacts: {
18274
18299
  tables: ["telemetry_delivery_state"],
18275
18300
  columns: [
@@ -18283,7 +18308,7 @@ var MIGRATIONS = [
18283
18308
  {
18284
18309
  version: 122,
18285
18310
  name: "dreaming-evidence-retry",
18286
- up: up124,
18311
+ up: up125,
18287
18312
  artifacts: {
18288
18313
  columns: [
18289
18314
  { table: "dreaming_evidence_exclusions", column: "failure_class" },
@@ -18296,13 +18321,13 @@ var MIGRATIONS = [
18296
18321
  {
18297
18322
  version: 123,
18298
18323
  name: "embedding-index-failures",
18299
- up: up125,
18324
+ up: up126,
18300
18325
  artifacts: { tables: ["embedding_index_failures"] }
18301
18326
  },
18302
18327
  {
18303
18328
  version: 124,
18304
18329
  name: "import-derived-lifecycle",
18305
- up: up126,
18330
+ up: up127,
18306
18331
  artifacts: {
18307
18332
  tables: ["imported_source_lifecycle"]
18308
18333
  }
@@ -18310,77 +18335,77 @@ var MIGRATIONS = [
18310
18335
  {
18311
18336
  version: 125,
18312
18337
  name: "memory-content-safety",
18313
- up: up127,
18338
+ up: up128,
18314
18339
  artifacts: { tables: ["memory_content_safety"] }
18315
18340
  },
18316
18341
  {
18317
18342
  version: 126,
18318
18343
  name: "dreaming-surprisal-attention",
18319
- up: up128,
18344
+ up: up129,
18320
18345
  artifacts: { tables: ["dreaming_attention"] }
18321
18346
  },
18322
18347
  {
18323
18348
  version: 127,
18324
18349
  name: "ontology-contradictions",
18325
- up: up129,
18350
+ up: up130,
18326
18351
  artifacts: { tables: ["ontology_contradictions"] }
18327
18352
  },
18328
18353
  {
18329
18354
  version: 128,
18330
18355
  name: "bounded-queue-diagnostics",
18331
- up: up130
18356
+ up: up131
18332
18357
  },
18333
18358
  {
18334
18359
  version: 129,
18335
18360
  name: "retire-structural-jobs",
18336
- up: up131
18361
+ up: up132
18337
18362
  },
18338
18363
  {
18339
18364
  version: 130,
18340
18365
  name: "embedding-repair-state",
18341
- up: up132,
18366
+ up: up133,
18342
18367
  artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
18343
18368
  },
18344
18369
  {
18345
18370
  version: 131,
18346
18371
  name: "dreaming-evidence-consumption",
18347
- up: up133,
18372
+ up: up134,
18348
18373
  artifacts: { tables: ["dreaming_evidence_consumption"] }
18349
18374
  },
18350
18375
  {
18351
18376
  version: 132,
18352
18377
  name: "observer-scoped-epistemic-assertions",
18353
- up: up134,
18378
+ up: up135,
18354
18379
  artifacts: { tables: ["epistemic_assertions"] }
18355
18380
  },
18356
18381
  {
18357
18382
  version: 133,
18358
18383
  name: "dreaming-memory-head",
18359
- up: up135,
18384
+ up: up136,
18360
18385
  artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
18361
18386
  },
18362
18387
  {
18363
18388
  version: 134,
18364
18389
  name: "scope-memory-head-entries",
18365
- up: up136,
18390
+ up: up137,
18366
18391
  artifacts: { tables: ["memory_head_entries"] }
18367
18392
  },
18368
18393
  {
18369
18394
  version: 135,
18370
18395
  name: "memory-head-publication",
18371
- up: up137,
18396
+ up: up138,
18372
18397
  artifacts: { tables: ["memory_head_publications"] }
18373
18398
  },
18374
18399
  {
18375
18400
  version: 136,
18376
18401
  name: "memory-head-revisions",
18377
- up: up138,
18402
+ up: up139,
18378
18403
  artifacts: { tables: ["memory_head_revisions"] }
18379
18404
  },
18380
18405
  {
18381
18406
  version: 137,
18382
18407
  name: "dreaming-head-manifest",
18383
- up: up139,
18408
+ up: up140,
18384
18409
  artifacts: {
18385
18410
  columns: [
18386
18411
  { table: "dreaming_passes", column: "head_revision" },
@@ -18391,7 +18416,7 @@ var MIGRATIONS = [
18391
18416
  {
18392
18417
  version: 138,
18393
18418
  name: "bounded-status-projections",
18394
- up: up140,
18419
+ up: up141,
18395
18420
  artifacts: {
18396
18421
  tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
18397
18422
  }
@@ -18399,31 +18424,31 @@ var MIGRATIONS = [
18399
18424
  {
18400
18425
  version: 139,
18401
18426
  name: "native-source-sync-state",
18402
- up: up141,
18427
+ up: up142,
18403
18428
  artifacts: { tables: ["native_source_sync_state"] }
18404
18429
  },
18405
18430
  {
18406
18431
  version: 140,
18407
18432
  name: "transcript-recovery-frontier",
18408
- up: up142,
18433
+ up: up143,
18409
18434
  artifacts: { tables: ["transcript_recovery_frontiers"] }
18410
18435
  },
18411
18436
  {
18412
18437
  version: 141,
18413
18438
  name: "source-sync-checkpoints",
18414
- up: up143,
18439
+ up: up144,
18415
18440
  artifacts: { tables: ["source_sync_checkpoints"] }
18416
18441
  },
18417
18442
  {
18418
18443
  version: 142,
18419
18444
  name: "source-sync-frontier",
18420
- up: up144,
18445
+ up: up145,
18421
18446
  artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
18422
18447
  },
18423
18448
  {
18424
18449
  version: 143,
18425
18450
  name: "embedding-index-progress",
18426
- up: up145,
18451
+ up: up146,
18427
18452
  artifacts: {
18428
18453
  columns: [
18429
18454
  { table: "embedding_index_state", column: "migration_phase" },
@@ -18439,19 +18464,19 @@ var MIGRATIONS = [
18439
18464
  {
18440
18465
  version: 144,
18441
18466
  name: "memory-job-lease-token",
18442
- up: up146,
18467
+ up: up147,
18443
18468
  artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
18444
18469
  },
18445
18470
  {
18446
18471
  version: 145,
18447
18472
  name: "dreaming-evidence-reviews",
18448
- up: up147,
18473
+ up: up148,
18449
18474
  artifacts: { tables: ["dreaming_evidence_reviews"] }
18450
18475
  },
18451
18476
  {
18452
18477
  version: 146,
18453
18478
  name: "source-transcript-import",
18454
- up: up148,
18479
+ up: up149,
18455
18480
  artifacts: {
18456
18481
  tables: [
18457
18482
  "source_import_jobs",
@@ -18470,19 +18495,19 @@ var MIGRATIONS = [
18470
18495
  {
18471
18496
  version: 147,
18472
18497
  name: "source-import-replay-file-slots",
18473
- up: up149,
18498
+ up: up150,
18474
18499
  artifacts: { tables: ["source_import_files"] }
18475
18500
  },
18476
18501
  {
18477
18502
  version: 148,
18478
18503
  name: "source-import-attempt-provenance",
18479
- up: up150,
18504
+ up: up151,
18480
18505
  artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
18481
18506
  },
18482
18507
  {
18483
18508
  version: 149,
18484
18509
  name: "transcript-import-state-machine",
18485
- up: up151,
18510
+ up: up152,
18486
18511
  artifacts: {
18487
18512
  columns: [
18488
18513
  { table: "source_import_jobs", column: "duplicate_mode" },
@@ -18494,7 +18519,7 @@ var MIGRATIONS = [
18494
18519
  {
18495
18520
  version: 150,
18496
18521
  name: "memory-head-freshness",
18497
- up: up152,
18522
+ up: up153,
18498
18523
  artifacts: {
18499
18524
  columns: [
18500
18525
  { table: "memory_md_heads", column: "is_current" },
@@ -18540,8 +18565,23 @@ var MIGRATIONS = [
18540
18565
  {
18541
18566
  version: 153,
18542
18567
  name: "vector-repair-checkpoints",
18543
- up: up153,
18568
+ up: up154,
18544
18569
  artifacts: { tables: ["vector_repair_checkpoints"] }
18570
+ },
18571
+ {
18572
+ version: 154,
18573
+ name: "transcript-capture-source-identity",
18574
+ up: up3,
18575
+ artifacts: {
18576
+ columns: [
18577
+ { table: "transcript_capture_jobs", column: "source_identity" },
18578
+ { table: "transcript_capture_jobs", column: "source_sha256" },
18579
+ { table: "transcript_capture_jobs", column: "source_size_bytes" },
18580
+ { table: "transcript_capture_jobs", column: "source_mtime_ms" },
18581
+ { table: "transcript_capture_jobs", column: "source_format" },
18582
+ { table: "transcript_capture_jobs", column: "audit_path" }
18583
+ ]
18584
+ }
18545
18585
  }
18546
18586
  ];
18547
18587
  function checksum(m) {