signetai 0.221.7 → 0.221.9
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/mcp-stdio.js +483 -454
- package/native-manifest.json +14 -14
- package/package.json +6 -6
package/dist/mcp-stdio.js
CHANGED
|
@@ -25110,6 +25110,66 @@ function scanMemoryContent(content) {
|
|
|
25110
25110
|
policyVersion: MEMORY_CONTENT_SAFETY_POLICY_VERSION
|
|
25111
25111
|
};
|
|
25112
25112
|
}
|
|
25113
|
+
function up(db) {
|
|
25114
|
+
const hasColumn = (table, column) => {
|
|
25115
|
+
const statement = db.prepare(`SELECT 1 FROM pragma_table_info('${table}') WHERE name = ?`);
|
|
25116
|
+
try {
|
|
25117
|
+
return statement.get(column) != null;
|
|
25118
|
+
} finally {
|
|
25119
|
+
statement.finalize?.();
|
|
25120
|
+
}
|
|
25121
|
+
};
|
|
25122
|
+
for (const [column, definition] of [
|
|
25123
|
+
["upload_generation", "INTEGER NOT NULL DEFAULT 0"],
|
|
25124
|
+
["upload_offset", "INTEGER NOT NULL DEFAULT 0"],
|
|
25125
|
+
["upload_size", "INTEGER"],
|
|
25126
|
+
["upload_digest", "TEXT NOT NULL DEFAULT ''"],
|
|
25127
|
+
["checkpoint_line_number", "INTEGER NOT NULL DEFAULT 0"],
|
|
25128
|
+
["reserved_bytes", "INTEGER NOT NULL DEFAULT 0"],
|
|
25129
|
+
["original_path", "TEXT"],
|
|
25130
|
+
[
|
|
25131
|
+
"storage_state",
|
|
25132
|
+
"TEXT NOT NULL DEFAULT 'legacy' CHECK (storage_state IN ('legacy','uploading','sealed','purging','purged'))"
|
|
25133
|
+
]
|
|
25134
|
+
]) {
|
|
25135
|
+
if (!hasColumn("source_import_files", column))
|
|
25136
|
+
db.exec(`ALTER TABLE source_import_files ADD COLUMN ${column} ${definition}`);
|
|
25137
|
+
}
|
|
25138
|
+
if (!hasColumn("source_import_jobs", "retry_count"))
|
|
25139
|
+
db.exec("ALTER TABLE source_import_jobs ADD COLUMN retry_count INTEGER NOT NULL DEFAULT 0");
|
|
25140
|
+
if (!hasColumn("source_import_jobs", "cleanup_state"))
|
|
25141
|
+
db.exec("ALTER TABLE source_import_jobs ADD COLUMN cleanup_state TEXT NOT NULL DEFAULT 'idle'");
|
|
25142
|
+
if (!hasColumn("source_import_jobs", "retry_cursor"))
|
|
25143
|
+
db.exec("ALTER TABLE source_import_jobs ADD COLUMN retry_cursor TEXT NOT NULL DEFAULT ''");
|
|
25144
|
+
if (!hasColumn("source_import_jobs", "retry_requested"))
|
|
25145
|
+
db.exec("ALTER TABLE source_import_jobs ADD COLUMN retry_requested INTEGER NOT NULL DEFAULT 0");
|
|
25146
|
+
db.exec(`
|
|
25147
|
+
CREATE TABLE IF NOT EXISTS source_import_migrations (agent_id TEXT PRIMARY KEY, state TEXT NOT NULL DEFAULT 'pending', cursor TEXT NOT NULL DEFAULT '', error TEXT);
|
|
25148
|
+
CREATE TABLE IF NOT EXISTS source_import_migration_counts (agent_id TEXT NOT NULL, job_id TEXT NOT NULL, total INTEGER NOT NULL DEFAULT 0, imported INTEGER NOT NULL DEFAULT 0, duplicate INTEGER NOT NULL DEFAULT 0, rejected INTEGER NOT NULL DEFAULT 0, pending INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(agent_id,job_id)) WITHOUT ROWID;
|
|
25149
|
+
CREATE TABLE IF NOT EXISTS source_import_migration_streams (agent_id TEXT NOT NULL, stem TEXT NOT NULL, PRIMARY KEY(agent_id,stem)) WITHOUT ROWID;
|
|
25150
|
+
INSERT OR IGNORE INTO source_import_migrations(agent_id) SELECT DISTINCT agent_id FROM source_import_files WHERE storage_state = 'legacy';
|
|
25151
|
+
CREATE TABLE IF NOT EXISTS source_import_capacity (id INTEGER PRIMARY KEY CHECK (id = 1), reserved_bytes INTEGER NOT NULL DEFAULT 0 CHECK (reserved_bytes >= 0));
|
|
25152
|
+
INSERT OR IGNORE INTO source_import_capacity(id) VALUES (1);
|
|
25153
|
+
CREATE TRIGGER IF NOT EXISTS source_import_capacity_update AFTER UPDATE OF reserved_bytes ON source_import_files
|
|
25154
|
+
BEGIN UPDATE source_import_capacity SET reserved_bytes = reserved_bytes - OLD.reserved_bytes + NEW.reserved_bytes WHERE id = 1; END;
|
|
25155
|
+
CREATE TRIGGER IF NOT EXISTS source_import_capacity_delete AFTER DELETE ON source_import_files
|
|
25156
|
+
BEGIN UPDATE source_import_capacity SET reserved_bytes = reserved_bytes - OLD.reserved_bytes WHERE id = 1; END;
|
|
25157
|
+
CREATE TABLE IF NOT EXISTS source_import_chunks (
|
|
25158
|
+
file_id TEXT NOT NULL REFERENCES source_import_files(id),
|
|
25159
|
+
agent_id TEXT NOT NULL, generation INTEGER NOT NULL, byte_offset INTEGER NOT NULL,
|
|
25160
|
+
checksum TEXT NOT NULL, content BLOB NOT NULL CHECK (length(content) BETWEEN 1 AND 65536),
|
|
25161
|
+
PRIMARY KEY (agent_id, file_id, generation, byte_offset)
|
|
25162
|
+
) WITHOUT ROWID;
|
|
25163
|
+
CREATE INDEX IF NOT EXISTS idx_source_import_files_storage ON source_import_files(agent_id, storage_state, id);
|
|
25164
|
+
CREATE INDEX IF NOT EXISTS idx_source_import_cleanup ON source_import_jobs(agent_id,id) WHERE cleanup_state = 'pending';
|
|
25165
|
+
CREATE INDEX IF NOT EXISTS idx_source_import_records_file_pending ON source_import_records(agent_id, file_id, status, ordinal);
|
|
25166
|
+
CREATE INDEX IF NOT EXISTS idx_source_import_records_agent_cursor ON source_import_records(agent_id,id);
|
|
25167
|
+
CREATE INDEX IF NOT EXISTS idx_source_import_records_job_cursor ON source_import_records(job_id,agent_id,status,id);
|
|
25168
|
+
CREATE INDEX IF NOT EXISTS idx_source_import_files_agent_cursor ON source_import_files(agent_id,id);
|
|
25169
|
+
CREATE INDEX IF NOT EXISTS idx_session_transcripts_export ON session_transcripts(agent_id,created_at,session_key);
|
|
25170
|
+
CREATE INDEX IF NOT EXISTS idx_transcript_import_harness ON transcript_import_conversations(agent_id,harness);
|
|
25171
|
+
`);
|
|
25172
|
+
}
|
|
25113
25173
|
function normalizeSql(sql) {
|
|
25114
25174
|
return sql.replace(/\s+/g, " ").trim().toLowerCase();
|
|
25115
25175
|
}
|
|
@@ -25262,7 +25322,7 @@ function memoriesFtsNeedsTokenizerRepair(sql) {
|
|
|
25262
25322
|
return true;
|
|
25263
25323
|
return !normalized.includes(`tokenize='${MEMORIES_FTS_TOKENIZER}'`);
|
|
25264
25324
|
}
|
|
25265
|
-
function
|
|
25325
|
+
function up2(db) {
|
|
25266
25326
|
db.exec(`
|
|
25267
25327
|
CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
25268
25328
|
version INTEGER PRIMARY KEY,
|
|
@@ -25360,7 +25420,7 @@ function addColumnIfMissing(db, table, column, definition) {
|
|
|
25360
25420
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25361
25421
|
}
|
|
25362
25422
|
}
|
|
25363
|
-
function
|
|
25423
|
+
function up3(db) {
|
|
25364
25424
|
addColumnIfMissing(db, "memories", "content_hash", "TEXT");
|
|
25365
25425
|
addColumnIfMissing(db, "memories", "normalized_content", "TEXT");
|
|
25366
25426
|
addColumnIfMissing(db, "memories", "is_deleted", "INTEGER DEFAULT 0");
|
|
@@ -25478,7 +25538,7 @@ function addColumnIfMissing2(db, table, column, definition) {
|
|
|
25478
25538
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25479
25539
|
return true;
|
|
25480
25540
|
}
|
|
25481
|
-
function
|
|
25541
|
+
function up4(db) {
|
|
25482
25542
|
addColumnIfMissing2(db, "memories", "why", "TEXT");
|
|
25483
25543
|
addColumnIfMissing2(db, "memories", "project", "TEXT");
|
|
25484
25544
|
db.exec(`DROP INDEX IF EXISTS idx_memories_content_hash`);
|
|
@@ -25515,7 +25575,7 @@ function addColumnIfMissing3(db, table, column, definition) {
|
|
|
25515
25575
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25516
25576
|
}
|
|
25517
25577
|
}
|
|
25518
|
-
function
|
|
25578
|
+
function up5(db) {
|
|
25519
25579
|
addColumnIfMissing3(db, "memory_history", "actor_type", "TEXT");
|
|
25520
25580
|
addColumnIfMissing3(db, "memory_history", "session_id", "TEXT");
|
|
25521
25581
|
addColumnIfMissing3(db, "memory_history", "request_id", "TEXT");
|
|
@@ -25548,7 +25608,7 @@ function addColumnIfMissing4(db, table, column, definition) {
|
|
|
25548
25608
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25549
25609
|
}
|
|
25550
25610
|
}
|
|
25551
|
-
function
|
|
25611
|
+
function up6(db) {
|
|
25552
25612
|
addColumnIfMissing4(db, "entities", "canonical_name", "TEXT");
|
|
25553
25613
|
addColumnIfMissing4(db, "entities", "mentions", "INTEGER DEFAULT 0");
|
|
25554
25614
|
addColumnIfMissing4(db, "entities", "embedding", "BLOB");
|
|
@@ -25565,7 +25625,7 @@ function hasColumn4(db, table, column) {
|
|
|
25565
25625
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
25566
25626
|
return rows.some((r2) => r2.name === column);
|
|
25567
25627
|
}
|
|
25568
|
-
function
|
|
25628
|
+
function up7(db) {
|
|
25569
25629
|
if (!hasColumn4(db, "memories", "idempotency_key")) {
|
|
25570
25630
|
db.exec("ALTER TABLE memories ADD COLUMN idempotency_key TEXT");
|
|
25571
25631
|
}
|
|
@@ -25580,7 +25640,7 @@ function hasColumn5(db, table, column) {
|
|
|
25580
25640
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
25581
25641
|
return rows.some((r2) => r2.name === column);
|
|
25582
25642
|
}
|
|
25583
|
-
function
|
|
25643
|
+
function up8(db) {
|
|
25584
25644
|
db.exec(`
|
|
25585
25645
|
CREATE TABLE IF NOT EXISTS documents (
|
|
25586
25646
|
id TEXT PRIMARY KEY,
|
|
@@ -25637,7 +25697,7 @@ function up7(db) {
|
|
|
25637
25697
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN document_id TEXT");
|
|
25638
25698
|
}
|
|
25639
25699
|
}
|
|
25640
|
-
function
|
|
25700
|
+
function up9(db) {
|
|
25641
25701
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='embeddings'").all();
|
|
25642
25702
|
if (tables.length === 0)
|
|
25643
25703
|
return;
|
|
@@ -25654,7 +25714,7 @@ function up8(db) {
|
|
|
25654
25714
|
ON embeddings(content_hash)
|
|
25655
25715
|
`);
|
|
25656
25716
|
}
|
|
25657
|
-
function
|
|
25717
|
+
function up10(db) {
|
|
25658
25718
|
db.exec(`
|
|
25659
25719
|
CREATE TABLE IF NOT EXISTS summary_jobs (
|
|
25660
25720
|
id TEXT PRIMARY KEY,
|
|
@@ -25674,7 +25734,7 @@ function up9(db) {
|
|
|
25674
25734
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_summary_jobs_status
|
|
25675
25735
|
ON summary_jobs(status)`);
|
|
25676
25736
|
}
|
|
25677
|
-
function
|
|
25737
|
+
function up11(db) {
|
|
25678
25738
|
db.exec(`
|
|
25679
25739
|
CREATE TABLE IF NOT EXISTS umap_cache (
|
|
25680
25740
|
id INTEGER PRIMARY KEY,
|
|
@@ -25685,7 +25745,7 @@ function up10(db) {
|
|
|
25685
25745
|
)
|
|
25686
25746
|
`);
|
|
25687
25747
|
}
|
|
25688
|
-
function
|
|
25748
|
+
function up12(db) {
|
|
25689
25749
|
db.exec(`
|
|
25690
25750
|
CREATE TABLE IF NOT EXISTS session_scores (
|
|
25691
25751
|
id TEXT PRIMARY KEY,
|
|
@@ -25705,7 +25765,7 @@ function up11(db) {
|
|
|
25705
25765
|
ON session_scores(session_key);
|
|
25706
25766
|
`);
|
|
25707
25767
|
}
|
|
25708
|
-
function
|
|
25768
|
+
function up13(db) {
|
|
25709
25769
|
db.exec(`
|
|
25710
25770
|
CREATE TABLE IF NOT EXISTS scheduled_tasks (
|
|
25711
25771
|
id TEXT PRIMARY KEY,
|
|
@@ -25746,7 +25806,7 @@ function addColumnIfMissing5(db, table, column, definition) {
|
|
|
25746
25806
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25747
25807
|
}
|
|
25748
25808
|
}
|
|
25749
|
-
function
|
|
25809
|
+
function up14(db) {
|
|
25750
25810
|
db.exec(`
|
|
25751
25811
|
CREATE TABLE IF NOT EXISTS ingestion_jobs (
|
|
25752
25812
|
id TEXT PRIMARY KEY,
|
|
@@ -25772,7 +25832,7 @@ function up13(db) {
|
|
|
25772
25832
|
addColumnIfMissing5(db, "memories", "source_path", "TEXT");
|
|
25773
25833
|
addColumnIfMissing5(db, "memories", "source_section", "TEXT");
|
|
25774
25834
|
}
|
|
25775
|
-
function
|
|
25835
|
+
function up15(db) {
|
|
25776
25836
|
db.exec(`
|
|
25777
25837
|
CREATE TABLE IF NOT EXISTS telemetry_events (
|
|
25778
25838
|
id TEXT PRIMARY KEY,
|
|
@@ -25797,7 +25857,7 @@ function addColumnIfMissing6(db, table, column, definition) {
|
|
|
25797
25857
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25798
25858
|
}
|
|
25799
25859
|
}
|
|
25800
|
-
function
|
|
25860
|
+
function up16(db) {
|
|
25801
25861
|
db.exec(`
|
|
25802
25862
|
CREATE TABLE IF NOT EXISTS session_memories (
|
|
25803
25863
|
id TEXT PRIMARY KEY,
|
|
@@ -25824,7 +25884,7 @@ function up15(db) {
|
|
|
25824
25884
|
addColumnIfMissing6(db, "session_scores", "confidence", "REAL");
|
|
25825
25885
|
addColumnIfMissing6(db, "session_scores", "continuity_reasoning", "TEXT");
|
|
25826
25886
|
}
|
|
25827
|
-
function
|
|
25887
|
+
function up17(db) {
|
|
25828
25888
|
db.exec(`
|
|
25829
25889
|
CREATE TABLE IF NOT EXISTS session_checkpoints (
|
|
25830
25890
|
id TEXT PRIMARY KEY,
|
|
@@ -25846,7 +25906,7 @@ function up16(db) {
|
|
|
25846
25906
|
ON session_checkpoints(project_normalized, created_at DESC);
|
|
25847
25907
|
`);
|
|
25848
25908
|
}
|
|
25849
|
-
function
|
|
25909
|
+
function up18(db) {
|
|
25850
25910
|
const cols = db.prepare("PRAGMA table_info(scheduled_tasks)").all();
|
|
25851
25911
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
25852
25912
|
if (!colNames.has("skill_name")) {
|
|
@@ -25857,7 +25917,7 @@ function up17(db) {
|
|
|
25857
25917
|
CHECK (skill_mode IN ('inject', 'slash') OR skill_mode IS NULL)`);
|
|
25858
25918
|
}
|
|
25859
25919
|
}
|
|
25860
|
-
function
|
|
25920
|
+
function up19(db) {
|
|
25861
25921
|
const existing = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='skill_meta'").get();
|
|
25862
25922
|
if (existing)
|
|
25863
25923
|
return;
|
|
@@ -25889,7 +25949,7 @@ function up18(db) {
|
|
|
25889
25949
|
CREATE INDEX idx_skill_meta_source ON skill_meta(source);
|
|
25890
25950
|
`);
|
|
25891
25951
|
}
|
|
25892
|
-
function
|
|
25952
|
+
function up20(db) {
|
|
25893
25953
|
const entityCols = db.prepare("PRAGMA table_info(entities)").all();
|
|
25894
25954
|
const entityColNames = new Set(entityCols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
25895
25955
|
if (!entityColNames.has("agent_id")) {
|
|
@@ -25974,13 +26034,13 @@ function addColumnIfMissing7(db, table, column, definition) {
|
|
|
25974
26034
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
25975
26035
|
}
|
|
25976
26036
|
}
|
|
25977
|
-
function
|
|
26037
|
+
function up21(db) {
|
|
25978
26038
|
addColumnIfMissing7(db, "session_memories", "entity_slot", "INTEGER");
|
|
25979
26039
|
addColumnIfMissing7(db, "session_memories", "aspect_slot", "INTEGER");
|
|
25980
26040
|
addColumnIfMissing7(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
25981
26041
|
addColumnIfMissing7(db, "session_memories", "structural_density", "INTEGER");
|
|
25982
26042
|
}
|
|
25983
|
-
function
|
|
26043
|
+
function up22(db) {
|
|
25984
26044
|
const columns = db.prepare("PRAGMA table_info(session_checkpoints)").all();
|
|
25985
26045
|
const columnNames = new Set(columns.flatMap((column) => typeof column.name === "string" ? [column.name] : []));
|
|
25986
26046
|
if (!columnNames.has("focal_entity_ids")) {
|
|
@@ -26005,25 +26065,25 @@ function addColumnIfMissing8(db, table, column, definition) {
|
|
|
26005
26065
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26006
26066
|
}
|
|
26007
26067
|
}
|
|
26008
|
-
function
|
|
26068
|
+
function up23(db) {
|
|
26009
26069
|
addColumnIfMissing8(db, "entities", "pinned", "INTEGER NOT NULL DEFAULT 0");
|
|
26010
26070
|
addColumnIfMissing8(db, "entities", "pinned_at", "TEXT");
|
|
26011
26071
|
db.exec("CREATE INDEX IF NOT EXISTS idx_entities_pinned ON entities(agent_id, pinned, pinned_at DESC)");
|
|
26012
26072
|
}
|
|
26013
|
-
function up23(_db) {}
|
|
26014
26073
|
function up24(_db) {}
|
|
26074
|
+
function up25(_db) {}
|
|
26015
26075
|
function addColumnIfMissing9(db, table, column, definition) {
|
|
26016
26076
|
const cols = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
26017
26077
|
if (!cols.some((c2) => c2.name === column)) {
|
|
26018
26078
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26019
26079
|
}
|
|
26020
26080
|
}
|
|
26021
|
-
function
|
|
26081
|
+
function up26(db) {
|
|
26022
26082
|
addColumnIfMissing9(db, "session_memories", "agent_relevance_score", "REAL");
|
|
26023
26083
|
addColumnIfMissing9(db, "session_memories", "agent_feedback_count", "INTEGER DEFAULT 0");
|
|
26024
26084
|
}
|
|
26025
|
-
function
|
|
26026
|
-
function
|
|
26085
|
+
function up27(_db) {}
|
|
26086
|
+
function up28(db) {
|
|
26027
26087
|
db.exec(`
|
|
26028
26088
|
UPDATE entities
|
|
26029
26089
|
SET canonical_name = REPLACE(REPLACE(REPLACE(
|
|
@@ -26032,7 +26092,7 @@ function up27(db) {
|
|
|
26032
26092
|
WHERE canonical_name IS NULL
|
|
26033
26093
|
`);
|
|
26034
26094
|
}
|
|
26035
|
-
function
|
|
26095
|
+
function up29(db) {
|
|
26036
26096
|
db.exec(`
|
|
26037
26097
|
CREATE TABLE IF NOT EXISTS memories_cold (
|
|
26038
26098
|
archive_id TEXT PRIMARY KEY,
|
|
@@ -26069,7 +26129,7 @@ function up28(db) {
|
|
|
26069
26129
|
CREATE INDEX IF NOT EXISTS idx_cold_source ON memories_cold(cold_source_id);
|
|
26070
26130
|
`);
|
|
26071
26131
|
}
|
|
26072
|
-
function
|
|
26132
|
+
function up30(db) {
|
|
26073
26133
|
db.exec(`
|
|
26074
26134
|
CREATE TABLE IF NOT EXISTS session_summaries (
|
|
26075
26135
|
id TEXT PRIMARY KEY,
|
|
@@ -26114,7 +26174,7 @@ function up29(db) {
|
|
|
26114
26174
|
WHERE session_key IS NOT NULL;
|
|
26115
26175
|
`);
|
|
26116
26176
|
}
|
|
26117
|
-
function
|
|
26177
|
+
function up31(db) {
|
|
26118
26178
|
db.exec(`
|
|
26119
26179
|
CREATE TABLE IF NOT EXISTS memory_jobs_new (
|
|
26120
26180
|
id TEXT PRIMARY KEY,
|
|
@@ -26159,7 +26219,7 @@ function up30(db) {
|
|
|
26159
26219
|
ON memory_jobs(failed_at);
|
|
26160
26220
|
`);
|
|
26161
26221
|
}
|
|
26162
|
-
function
|
|
26222
|
+
function up32(db) {
|
|
26163
26223
|
const depCols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
26164
26224
|
if (!depCols.some((c2) => c2.name === "reason")) {
|
|
26165
26225
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN reason TEXT");
|
|
@@ -26169,7 +26229,7 @@ function up31(db) {
|
|
|
26169
26229
|
db.exec("ALTER TABLE entities ADD COLUMN last_synthesized_at TEXT");
|
|
26170
26230
|
}
|
|
26171
26231
|
}
|
|
26172
|
-
function
|
|
26232
|
+
function up33(db) {
|
|
26173
26233
|
const cols = db.prepare("PRAGMA table_info(embeddings)").all();
|
|
26174
26234
|
if (cols.length === 0)
|
|
26175
26235
|
return;
|
|
@@ -26177,14 +26237,14 @@ function up32(db) {
|
|
|
26177
26237
|
db.exec("ALTER TABLE embeddings ADD COLUMN vector BLOB");
|
|
26178
26238
|
}
|
|
26179
26239
|
}
|
|
26180
|
-
function
|
|
26240
|
+
function up34(db) {
|
|
26181
26241
|
const cols = db.prepare("PRAGMA table_info(memories)").all();
|
|
26182
26242
|
if (!cols.some((c2) => c2.name === "scope")) {
|
|
26183
26243
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT DEFAULT NULL");
|
|
26184
26244
|
}
|
|
26185
26245
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memories_scope ON memories(scope) WHERE scope IS NOT NULL");
|
|
26186
26246
|
}
|
|
26187
|
-
function
|
|
26247
|
+
function up35(db) {
|
|
26188
26248
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
26189
26249
|
db.exec(`
|
|
26190
26250
|
CREATE UNIQUE INDEX idx_memories_content_hash_unique
|
|
@@ -26192,7 +26252,7 @@ function up34(db) {
|
|
|
26192
26252
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
26193
26253
|
`);
|
|
26194
26254
|
}
|
|
26195
|
-
function
|
|
26255
|
+
function up36(db) {
|
|
26196
26256
|
db.exec(`
|
|
26197
26257
|
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
26198
26258
|
name, canonical_name,
|
|
@@ -26224,13 +26284,13 @@ function up35(db) {
|
|
|
26224
26284
|
END
|
|
26225
26285
|
`);
|
|
26226
26286
|
}
|
|
26227
|
-
function
|
|
26287
|
+
function up37(db) {
|
|
26228
26288
|
const cols = db.prepare("PRAGMA table_info(entity_dependencies)").all();
|
|
26229
26289
|
if (!cols.some((c2) => c2.name === "confidence")) {
|
|
26230
26290
|
db.exec("ALTER TABLE entity_dependencies ADD COLUMN confidence REAL DEFAULT 0.7");
|
|
26231
26291
|
}
|
|
26232
26292
|
}
|
|
26233
|
-
function
|
|
26293
|
+
function up38(db) {
|
|
26234
26294
|
db.exec(`
|
|
26235
26295
|
CREATE TABLE IF NOT EXISTS entity_communities (
|
|
26236
26296
|
id TEXT PRIMARY KEY,
|
|
@@ -26248,7 +26308,7 @@ function up37(db) {
|
|
|
26248
26308
|
db.exec("ALTER TABLE entities ADD COLUMN community_id TEXT REFERENCES entity_communities(id)");
|
|
26249
26309
|
}
|
|
26250
26310
|
}
|
|
26251
|
-
function
|
|
26311
|
+
function up39(db) {
|
|
26252
26312
|
db.exec(`
|
|
26253
26313
|
CREATE TABLE IF NOT EXISTS memory_hints (
|
|
26254
26314
|
id TEXT PRIMARY KEY,
|
|
@@ -26288,7 +26348,7 @@ function up38(db) {
|
|
|
26288
26348
|
END
|
|
26289
26349
|
`);
|
|
26290
26350
|
}
|
|
26291
|
-
function
|
|
26351
|
+
function up40(db) {
|
|
26292
26352
|
db.exec(`
|
|
26293
26353
|
DELETE FROM entity_dependencies
|
|
26294
26354
|
WHERE id NOT IN (
|
|
@@ -26306,7 +26366,7 @@ function up39(db) {
|
|
|
26306
26366
|
)
|
|
26307
26367
|
`);
|
|
26308
26368
|
}
|
|
26309
|
-
function
|
|
26369
|
+
function up41(db) {
|
|
26310
26370
|
db.exec(`
|
|
26311
26371
|
CREATE TABLE IF NOT EXISTS session_transcripts (
|
|
26312
26372
|
session_key TEXT PRIMARY KEY,
|
|
@@ -26329,7 +26389,7 @@ function addColumnIfMissing10(db, table, column, definition) {
|
|
|
26329
26389
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26330
26390
|
}
|
|
26331
26391
|
}
|
|
26332
|
-
function
|
|
26392
|
+
function up42(db) {
|
|
26333
26393
|
addColumnIfMissing10(db, "session_memories", "path_json", "TEXT");
|
|
26334
26394
|
db.exec(`
|
|
26335
26395
|
CREATE TABLE IF NOT EXISTS path_feedback_events (
|
|
@@ -26404,7 +26464,7 @@ function addColumnIfMissing11(db, table, column, definition) {
|
|
|
26404
26464
|
return;
|
|
26405
26465
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26406
26466
|
}
|
|
26407
|
-
function
|
|
26467
|
+
function up43(db) {
|
|
26408
26468
|
addColumnIfMissing11(db, "session_memories", "entity_slot", "INTEGER");
|
|
26409
26469
|
addColumnIfMissing11(db, "session_memories", "aspect_slot", "INTEGER");
|
|
26410
26470
|
addColumnIfMissing11(db, "session_memories", "is_constraint", "INTEGER NOT NULL DEFAULT 0");
|
|
@@ -26492,7 +26552,7 @@ function addColumnIfMissing12(db, table, column, definition) {
|
|
|
26492
26552
|
return;
|
|
26493
26553
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26494
26554
|
}
|
|
26495
|
-
function
|
|
26555
|
+
function up44(db) {
|
|
26496
26556
|
db.exec(`
|
|
26497
26557
|
CREATE TABLE IF NOT EXISTS agents (
|
|
26498
26558
|
id TEXT PRIMARY KEY,
|
|
@@ -26521,7 +26581,7 @@ function addColumnIfMissing13(db, table, column, definition) {
|
|
|
26521
26581
|
return;
|
|
26522
26582
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26523
26583
|
}
|
|
26524
|
-
function
|
|
26584
|
+
function up45(db) {
|
|
26525
26585
|
addColumnIfMissing13(db, "session_summaries", "source_type", "TEXT");
|
|
26526
26586
|
addColumnIfMissing13(db, "session_summaries", "source_ref", "TEXT");
|
|
26527
26587
|
addColumnIfMissing13(db, "session_summaries", "meta_json", "TEXT");
|
|
@@ -26547,7 +26607,7 @@ function addColumnIfMissing14(db, table, column, definition) {
|
|
|
26547
26607
|
return;
|
|
26548
26608
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
26549
26609
|
}
|
|
26550
|
-
function
|
|
26610
|
+
function up46(db) {
|
|
26551
26611
|
addColumnIfMissing14(db, "session_transcripts", "updated_at", "TEXT");
|
|
26552
26612
|
addColumnIfMissing14(db, "summary_jobs", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
26553
26613
|
addColumnIfMissing14(db, "session_scores", "agent_id", "TEXT NOT NULL DEFAULT 'default'");
|
|
@@ -26618,7 +26678,7 @@ function up45(db) {
|
|
|
26618
26678
|
ON memory_md_heads(lease_expires_at);
|
|
26619
26679
|
`);
|
|
26620
26680
|
}
|
|
26621
|
-
function
|
|
26681
|
+
function up47(db) {
|
|
26622
26682
|
db.exec(`
|
|
26623
26683
|
DROP INDEX IF EXISTS idx_summaries_session_depth;
|
|
26624
26684
|
|
|
@@ -26679,7 +26739,7 @@ function up46(db) {
|
|
|
26679
26739
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
26680
26740
|
`);
|
|
26681
26741
|
}
|
|
26682
|
-
function
|
|
26742
|
+
function up48(db) {
|
|
26683
26743
|
db.exec(`
|
|
26684
26744
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ai;
|
|
26685
26745
|
DROP TRIGGER IF EXISTS session_transcripts_fts_ad;
|
|
@@ -26777,7 +26837,7 @@ function up47(db) {
|
|
|
26777
26837
|
AND COALESCE(source_type, 'summary') = 'summary';
|
|
26778
26838
|
`);
|
|
26779
26839
|
}
|
|
26780
|
-
function
|
|
26840
|
+
function up49(db) {
|
|
26781
26841
|
db.exec(`
|
|
26782
26842
|
CREATE TABLE IF NOT EXISTS memory_thread_heads (
|
|
26783
26843
|
agent_id TEXT NOT NULL DEFAULT 'default',
|
|
@@ -26895,7 +26955,7 @@ function up48(db) {
|
|
|
26895
26955
|
WHERE excluded.latest_at >= memory_thread_heads.latest_at;
|
|
26896
26956
|
`);
|
|
26897
26957
|
}
|
|
26898
|
-
function
|
|
26958
|
+
function up50(db) {
|
|
26899
26959
|
db.exec(`
|
|
26900
26960
|
CREATE TABLE IF NOT EXISTS session_extract_cursors (
|
|
26901
26961
|
session_key TEXT NOT NULL,
|
|
@@ -26912,7 +26972,7 @@ function hasTable(db, name) {
|
|
|
26912
26972
|
WHERE type = 'table' AND name = ?
|
|
26913
26973
|
LIMIT 1`).get(name) !== undefined;
|
|
26914
26974
|
}
|
|
26915
|
-
function
|
|
26975
|
+
function up51(db) {
|
|
26916
26976
|
db.exec(`
|
|
26917
26977
|
CREATE TABLE IF NOT EXISTS entity_dependency_history (
|
|
26918
26978
|
id TEXT PRIMARY KEY,
|
|
@@ -27082,7 +27142,7 @@ function addColumnIfMissing15(db, table, column, definition) {
|
|
|
27082
27142
|
return;
|
|
27083
27143
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
27084
27144
|
}
|
|
27085
|
-
function
|
|
27145
|
+
function up52(db) {
|
|
27086
27146
|
addColumnIfMissing15(db, "summary_jobs", "session_id", "TEXT");
|
|
27087
27147
|
addColumnIfMissing15(db, "summary_jobs", "trigger", "TEXT NOT NULL DEFAULT 'session_end'");
|
|
27088
27148
|
addColumnIfMissing15(db, "summary_jobs", "captured_at", "TEXT");
|
|
@@ -27174,7 +27234,7 @@ function up51(db) {
|
|
|
27174
27234
|
VALUES ('rebuild');
|
|
27175
27235
|
`);
|
|
27176
27236
|
}
|
|
27177
|
-
function
|
|
27237
|
+
function up53(db) {
|
|
27178
27238
|
db.exec(`
|
|
27179
27239
|
CREATE TABLE IF NOT EXISTS mcp_invocations (
|
|
27180
27240
|
id TEXT PRIMARY KEY,
|
|
@@ -27191,7 +27251,7 @@ function up52(db) {
|
|
|
27191
27251
|
CREATE INDEX IF NOT EXISTS idx_mcp_inv_agent ON mcp_invocations(agent_id, created_at);
|
|
27192
27252
|
`);
|
|
27193
27253
|
}
|
|
27194
|
-
function
|
|
27254
|
+
function up54(db) {
|
|
27195
27255
|
db.exec(`
|
|
27196
27256
|
CREATE TABLE IF NOT EXISTS skill_invocations (
|
|
27197
27257
|
id TEXT PRIMARY KEY,
|
|
@@ -27207,7 +27267,7 @@ function up53(db) {
|
|
|
27207
27267
|
CREATE INDEX IF NOT EXISTS idx_skill_inv_agent ON skill_invocations(agent_id, created_at);
|
|
27208
27268
|
`);
|
|
27209
27269
|
}
|
|
27210
|
-
function
|
|
27270
|
+
function up55(db) {
|
|
27211
27271
|
db.exec(`
|
|
27212
27272
|
CREATE TABLE IF NOT EXISTS task_scope_hints (
|
|
27213
27273
|
task_id TEXT PRIMARY KEY REFERENCES scheduled_tasks(id) ON DELETE CASCADE,
|
|
@@ -27238,7 +27298,7 @@ function up54(db) {
|
|
|
27238
27298
|
ON task_scope_hints(agent_id, updated_at);
|
|
27239
27299
|
`);
|
|
27240
27300
|
}
|
|
27241
|
-
function
|
|
27301
|
+
function up56(db) {
|
|
27242
27302
|
db.exec(`
|
|
27243
27303
|
CREATE TABLE IF NOT EXISTS dreaming_state (
|
|
27244
27304
|
agent_id TEXT PRIMARY KEY NOT NULL,
|
|
@@ -27281,7 +27341,7 @@ function ensureMemoriesScopeColumns(db) {
|
|
|
27281
27341
|
if (!names.has("scope"))
|
|
27282
27342
|
db.exec("ALTER TABLE memories ADD COLUMN scope TEXT");
|
|
27283
27343
|
}
|
|
27284
|
-
function
|
|
27344
|
+
function up57(db) {
|
|
27285
27345
|
ensureMemoriesScopeColumns(db);
|
|
27286
27346
|
db.exec("DROP INDEX IF EXISTS idx_memories_content_hash_unique");
|
|
27287
27347
|
db.exec(`
|
|
@@ -27294,20 +27354,20 @@ function up56(db) {
|
|
|
27294
27354
|
WHERE content_hash IS NOT NULL AND is_deleted = 0
|
|
27295
27355
|
`);
|
|
27296
27356
|
}
|
|
27297
|
-
function
|
|
27357
|
+
function up58(db) {
|
|
27298
27358
|
const sql = readMemoriesFtsSql(db);
|
|
27299
27359
|
if (sql !== null && !memoriesFtsNeedsTokenizerRepair(sql))
|
|
27300
27360
|
return;
|
|
27301
27361
|
recreateMemoriesFts(db);
|
|
27302
27362
|
}
|
|
27303
|
-
function
|
|
27363
|
+
function up59(db) {
|
|
27304
27364
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_order
|
|
27305
27365
|
ON entities(agent_id, pinned DESC, pinned_at DESC, mentions DESC, updated_at DESC, name)`);
|
|
27306
27366
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_entities_extracted_mentions
|
|
27307
27367
|
ON entities(entity_type, mentions)
|
|
27308
27368
|
WHERE entity_type = 'extracted'`);
|
|
27309
27369
|
}
|
|
27310
|
-
function
|
|
27370
|
+
function up60(db) {
|
|
27311
27371
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
27312
27372
|
if (!cols.some((col) => col.name === "claim_key")) {
|
|
27313
27373
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN claim_key TEXT");
|
|
@@ -27316,7 +27376,7 @@ function up59(db) {
|
|
|
27316
27376
|
ON entity_attributes(agent_id, aspect_id, claim_key, status)
|
|
27317
27377
|
WHERE claim_key IS NOT NULL`);
|
|
27318
27378
|
}
|
|
27319
|
-
function
|
|
27379
|
+
function up61(db) {
|
|
27320
27380
|
const cols = db.prepare("PRAGMA table_info(entity_attributes)").all();
|
|
27321
27381
|
if (!cols.some((col) => col.name === "group_key")) {
|
|
27322
27382
|
db.exec("ALTER TABLE entity_attributes ADD COLUMN group_key TEXT");
|
|
@@ -27328,13 +27388,13 @@ function up60(db) {
|
|
|
27328
27388
|
ON entity_attributes(agent_id, aspect_id, group_key, claim_key, status)
|
|
27329
27389
|
WHERE claim_key IS NOT NULL`);
|
|
27330
27390
|
}
|
|
27331
|
-
function
|
|
27391
|
+
function up62(db) {
|
|
27332
27392
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
27333
27393
|
if (cols.some((col) => col.name === "source_mtime_ms"))
|
|
27334
27394
|
return;
|
|
27335
27395
|
db.exec("ALTER TABLE memory_artifacts ADD COLUMN source_mtime_ms REAL");
|
|
27336
27396
|
}
|
|
27337
|
-
function
|
|
27397
|
+
function up63(db) {
|
|
27338
27398
|
const cols = db.prepare("PRAGMA table_info(memory_artifacts)").all();
|
|
27339
27399
|
const names = new Set(cols.map((col) => col.name));
|
|
27340
27400
|
if (!names.has("is_deleted")) {
|
|
@@ -27348,7 +27408,7 @@ function up62(db) {
|
|
|
27348
27408
|
ON memory_artifacts(agent_id, is_deleted, deleted_at)
|
|
27349
27409
|
`);
|
|
27350
27410
|
}
|
|
27351
|
-
function
|
|
27411
|
+
function up64(db) {
|
|
27352
27412
|
db.exec("DROP TRIGGER IF EXISTS memories_au");
|
|
27353
27413
|
db.exec(`
|
|
27354
27414
|
CREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE OF content ON memories BEGIN
|
|
@@ -27366,7 +27426,7 @@ function addColumnIfMissing16(db, table, column, definition) {
|
|
|
27366
27426
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
27367
27427
|
}
|
|
27368
27428
|
}
|
|
27369
|
-
function
|
|
27429
|
+
function up65(db) {
|
|
27370
27430
|
for (const table of ["entities", "entity_communities", "entity_attributes", "entity_dependencies"]) {
|
|
27371
27431
|
addColumnIfMissing16(db, table, "source_id", "TEXT");
|
|
27372
27432
|
addColumnIfMissing16(db, table, "source_kind", "TEXT");
|
|
@@ -27386,7 +27446,7 @@ function hasColumn7(db, table, column) {
|
|
|
27386
27446
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
27387
27447
|
return rows.some((row) => row.name === column);
|
|
27388
27448
|
}
|
|
27389
|
-
function
|
|
27449
|
+
function up66(db) {
|
|
27390
27450
|
if (!hasTable2(db, "embeddings"))
|
|
27391
27451
|
return;
|
|
27392
27452
|
if (!hasColumn7(db, "embeddings", "agent_id")) {
|
|
@@ -27394,7 +27454,7 @@ function up65(db) {
|
|
|
27394
27454
|
}
|
|
27395
27455
|
db.exec("CREATE INDEX IF NOT EXISTS idx_embeddings_agent_source ON embeddings(agent_id, source_type, source_id)");
|
|
27396
27456
|
}
|
|
27397
|
-
function
|
|
27457
|
+
function up67(db) {
|
|
27398
27458
|
db.exec(`
|
|
27399
27459
|
CREATE TABLE IF NOT EXISTS memory_search_telemetry (
|
|
27400
27460
|
id TEXT PRIMARY KEY,
|
|
@@ -27435,7 +27495,7 @@ function addColumnIfMissing17(db, table, column, definition) {
|
|
|
27435
27495
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
27436
27496
|
}
|
|
27437
27497
|
}
|
|
27438
|
-
function
|
|
27498
|
+
function up68(db) {
|
|
27439
27499
|
db.exec(`
|
|
27440
27500
|
CREATE TABLE IF NOT EXISTS ontology_proposals (
|
|
27441
27501
|
id TEXT PRIMARY KEY,
|
|
@@ -27478,7 +27538,7 @@ function up67(db) {
|
|
|
27478
27538
|
db.exec(`CREATE INDEX IF NOT EXISTS idx_${table}_proposal ON ${table}(agent_id, proposal_id)`);
|
|
27479
27539
|
}
|
|
27480
27540
|
}
|
|
27481
|
-
function
|
|
27541
|
+
function up69(db) {
|
|
27482
27542
|
db.exec(`
|
|
27483
27543
|
CREATE TABLE IF NOT EXISTS daily_reflections (
|
|
27484
27544
|
id TEXT PRIMARY KEY,
|
|
@@ -27505,7 +27565,7 @@ function up68(db) {
|
|
|
27505
27565
|
WHERE content_key IS NOT NULL;
|
|
27506
27566
|
`);
|
|
27507
27567
|
}
|
|
27508
|
-
function
|
|
27568
|
+
function up70(db) {
|
|
27509
27569
|
const cols = db.prepare("PRAGMA table_info(daily_reflections)").all();
|
|
27510
27570
|
const colNames = new Set(cols.flatMap((c2) => typeof c2.name === "string" ? [c2.name] : []));
|
|
27511
27571
|
if (!colNames.has("content_key")) {
|
|
@@ -27542,7 +27602,7 @@ function backfillVersionRoots(db) {
|
|
|
27542
27602
|
WHERE version_root_id IS NULL
|
|
27543
27603
|
`);
|
|
27544
27604
|
}
|
|
27545
|
-
function
|
|
27605
|
+
function up71(db) {
|
|
27546
27606
|
for (const table of ["entities", "entity_aspects", "entity_dependencies"]) {
|
|
27547
27607
|
addColumnIfMissing18(db, table, "status", "TEXT NOT NULL DEFAULT 'active'");
|
|
27548
27608
|
addColumnIfMissing18(db, table, "archived_at", "TEXT");
|
|
@@ -27577,7 +27637,7 @@ function up70(db) {
|
|
|
27577
27637
|
ON entity_aspects(agent_id, proposal_id);
|
|
27578
27638
|
`);
|
|
27579
27639
|
}
|
|
27580
|
-
function
|
|
27640
|
+
function up72(db) {
|
|
27581
27641
|
db.exec(`
|
|
27582
27642
|
CREATE TABLE IF NOT EXISTS epistemic_assertions (
|
|
27583
27643
|
id TEXT PRIMARY KEY,
|
|
@@ -27633,7 +27693,7 @@ function ensureMemoriesScopeColumns2(db) {
|
|
|
27633
27693
|
if (!names.has("runtime_path"))
|
|
27634
27694
|
db.exec("ALTER TABLE memories ADD COLUMN runtime_path TEXT");
|
|
27635
27695
|
}
|
|
27636
|
-
function
|
|
27696
|
+
function up73(db) {
|
|
27637
27697
|
ensureMemoriesScopeColumns2(db);
|
|
27638
27698
|
db.exec("DROP INDEX IF EXISTS idx_memories_idempotency_key");
|
|
27639
27699
|
db.exec(`
|
|
@@ -27647,7 +27707,7 @@ function up72(db) {
|
|
|
27647
27707
|
WHERE idempotency_key IS NOT NULL AND is_deleted = 0
|
|
27648
27708
|
`);
|
|
27649
27709
|
}
|
|
27650
|
-
function
|
|
27710
|
+
function up74(db) {
|
|
27651
27711
|
db.exec(`
|
|
27652
27712
|
CREATE TABLE IF NOT EXISTS session_context_epochs (
|
|
27653
27713
|
session_key TEXT NOT NULL,
|
|
@@ -27682,7 +27742,7 @@ function up73(db) {
|
|
|
27682
27742
|
ON session_recall_events(item_kind, item_id, created_at DESC);
|
|
27683
27743
|
`);
|
|
27684
27744
|
}
|
|
27685
|
-
function
|
|
27745
|
+
function up75(db) {
|
|
27686
27746
|
db.exec(`
|
|
27687
27747
|
CREATE TABLE IF NOT EXISTS aggregate_memory_sources (
|
|
27688
27748
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -27701,7 +27761,7 @@ function addColumnIfMissing19(db, table, column, definition) {
|
|
|
27701
27761
|
return;
|
|
27702
27762
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
27703
27763
|
}
|
|
27704
|
-
function
|
|
27764
|
+
function up76(db) {
|
|
27705
27765
|
addColumnIfMissing19(db, "memory_artifacts", "source_id", "TEXT");
|
|
27706
27766
|
addColumnIfMissing19(db, "memory_artifacts", "source_root", "TEXT");
|
|
27707
27767
|
addColumnIfMissing19(db, "memory_artifacts", "source_external_id", "TEXT");
|
|
@@ -27714,7 +27774,7 @@ function up75(db) {
|
|
|
27714
27774
|
ON memory_artifacts(agent_id, source_id, source_root);
|
|
27715
27775
|
`);
|
|
27716
27776
|
}
|
|
27717
|
-
function
|
|
27777
|
+
function up77(db) {
|
|
27718
27778
|
db.exec(`
|
|
27719
27779
|
CREATE TABLE IF NOT EXISTS temporal_edges (
|
|
27720
27780
|
id TEXT PRIMARY KEY,
|
|
@@ -27737,7 +27797,7 @@ function up76(db) {
|
|
|
27737
27797
|
ON temporal_edges(agent_id, subject_type, subject_id);
|
|
27738
27798
|
`);
|
|
27739
27799
|
}
|
|
27740
|
-
function
|
|
27800
|
+
function up78(db) {
|
|
27741
27801
|
db.exec(`
|
|
27742
27802
|
CREATE TABLE IF NOT EXISTS entity_aliases (
|
|
27743
27803
|
id TEXT PRIMARY KEY,
|
|
@@ -27761,7 +27821,7 @@ function up77(db) {
|
|
|
27761
27821
|
ON entity_aliases(agent_id, canonical_alias, status);
|
|
27762
27822
|
`);
|
|
27763
27823
|
}
|
|
27764
|
-
function
|
|
27824
|
+
function up79(db) {
|
|
27765
27825
|
db.exec(`
|
|
27766
27826
|
CREATE TABLE IF NOT EXISTS api_keys (
|
|
27767
27827
|
id TEXT PRIMARY KEY,
|
|
@@ -27789,7 +27849,7 @@ function up78(db) {
|
|
|
27789
27849
|
ON api_keys(connector, harness);
|
|
27790
27850
|
`);
|
|
27791
27851
|
}
|
|
27792
|
-
function
|
|
27852
|
+
function up80(db) {
|
|
27793
27853
|
db.exec(`
|
|
27794
27854
|
CREATE TABLE IF NOT EXISTS transcript_capture_jobs (
|
|
27795
27855
|
id TEXT PRIMARY KEY,
|
|
@@ -27824,7 +27884,7 @@ function hasColumn10(db, table, column) {
|
|
|
27824
27884
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
27825
27885
|
return rows.some((row) => row.name === column);
|
|
27826
27886
|
}
|
|
27827
|
-
function
|
|
27887
|
+
function up81(db) {
|
|
27828
27888
|
if (!hasColumn10(db, "documents", "agent_id")) {
|
|
27829
27889
|
db.exec("ALTER TABLE documents ADD COLUMN agent_id TEXT NOT NULL DEFAULT 'default'");
|
|
27830
27890
|
}
|
|
@@ -27910,7 +27970,7 @@ function up80(db) {
|
|
|
27910
27970
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_agent_project ON documents(agent_id, project)");
|
|
27911
27971
|
db.exec("CREATE INDEX IF NOT EXISTS idx_documents_source_scope ON documents(source_url, agent_id, project)");
|
|
27912
27972
|
}
|
|
27913
|
-
function
|
|
27973
|
+
function up82(db) {
|
|
27914
27974
|
db.exec(`
|
|
27915
27975
|
CREATE TABLE IF NOT EXISTS aggregate_evidence_sources (
|
|
27916
27976
|
aggregate_memory_id TEXT NOT NULL,
|
|
@@ -27931,7 +27991,7 @@ function hasColumn11(db, table, column) {
|
|
|
27931
27991
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
27932
27992
|
return rows.some((row) => row.name === column);
|
|
27933
27993
|
}
|
|
27934
|
-
function
|
|
27994
|
+
function up83(db) {
|
|
27935
27995
|
for (const column of COLUMNS) {
|
|
27936
27996
|
if (!hasColumn11(db, "skill_invocations", column)) {
|
|
27937
27997
|
db.exec(`ALTER TABLE skill_invocations ADD COLUMN ${column} TEXT`);
|
|
@@ -27978,7 +28038,7 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
27978
28038
|
`);
|
|
27979
28039
|
}
|
|
27980
28040
|
try {
|
|
27981
|
-
|
|
28041
|
+
up81(db);
|
|
27982
28042
|
if (preserveAgentId) {
|
|
27983
28043
|
db.exec(`
|
|
27984
28044
|
UPDATE documents
|
|
@@ -27998,12 +28058,12 @@ function documentScopeColumnsPreservingExisting(db) {
|
|
|
27998
28058
|
db.exec("DROP TABLE IF EXISTS temp.__signet_doc_project_guard");
|
|
27999
28059
|
}
|
|
28000
28060
|
}
|
|
28001
|
-
function
|
|
28002
|
-
|
|
28061
|
+
function up84(db) {
|
|
28062
|
+
up80(db);
|
|
28003
28063
|
if (hasTable3(db, "documents")) {
|
|
28004
28064
|
documentScopeColumnsPreservingExisting(db);
|
|
28005
28065
|
}
|
|
28006
|
-
|
|
28066
|
+
up82(db);
|
|
28007
28067
|
addColumnIfMissing20(db, "memories", "superseded_by", "TEXT");
|
|
28008
28068
|
addColumnIfMissing20(db, "memories", "superseded_at", "TEXT");
|
|
28009
28069
|
addColumnIfMissing20(db, "memories", "superseded_reason", "TEXT");
|
|
@@ -28060,7 +28120,7 @@ function up83(db) {
|
|
|
28060
28120
|
AND ${sourceAgentId} = ${targetAgentId}
|
|
28061
28121
|
`);
|
|
28062
28122
|
}
|
|
28063
|
-
function
|
|
28123
|
+
function up85(db) {
|
|
28064
28124
|
db.exec(`
|
|
28065
28125
|
CREATE TABLE IF NOT EXISTS legacy_markdown_imports (
|
|
28066
28126
|
path TEXT PRIMARY KEY,
|
|
@@ -28090,7 +28150,7 @@ function up84(db) {
|
|
|
28090
28150
|
ON legacy_markdown_chunks(memory_id);
|
|
28091
28151
|
`);
|
|
28092
28152
|
}
|
|
28093
|
-
function
|
|
28153
|
+
function up86(db) {
|
|
28094
28154
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name IN ('relations', 'entity_dependencies')").all();
|
|
28095
28155
|
const tableNames = new Set(tables.map((r2) => String(r2.name)));
|
|
28096
28156
|
if (!tableNames.has("relations") || !tableNames.has("entity_dependencies"))
|
|
@@ -28149,7 +28209,7 @@ function addColumnIfMissing21(db, table, column, definition) {
|
|
|
28149
28209
|
return;
|
|
28150
28210
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
28151
28211
|
}
|
|
28152
|
-
function
|
|
28212
|
+
function up87(db) {
|
|
28153
28213
|
addColumnIfMissing21(db, "summary_jobs", "content_hash", "TEXT");
|
|
28154
28214
|
db.exec(`
|
|
28155
28215
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_agent_session_content_hash
|
|
@@ -28162,14 +28222,14 @@ function addColumnIfMissing22(db, table, column, definition) {
|
|
|
28162
28222
|
return;
|
|
28163
28223
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
28164
28224
|
}
|
|
28165
|
-
function
|
|
28225
|
+
function up88(db) {
|
|
28166
28226
|
addColumnIfMissing22(db, "summary_jobs", "boundary_reason", "TEXT");
|
|
28167
28227
|
db.exec(`
|
|
28168
28228
|
CREATE INDEX IF NOT EXISTS idx_summary_jobs_boundary_reason
|
|
28169
28229
|
ON summary_jobs(agent_id, session_key, boundary_reason)
|
|
28170
28230
|
`);
|
|
28171
28231
|
}
|
|
28172
|
-
function
|
|
28232
|
+
function up89(db) {
|
|
28173
28233
|
db.exec(`
|
|
28174
28234
|
CREATE TABLE IF NOT EXISTS transcript_recovery_files (
|
|
28175
28235
|
agent_id TEXT NOT NULL,
|
|
@@ -28187,7 +28247,7 @@ function up88(db) {
|
|
|
28187
28247
|
ON transcript_capture_jobs(agent_id, session_id, status);
|
|
28188
28248
|
`);
|
|
28189
28249
|
}
|
|
28190
|
-
function
|
|
28250
|
+
function up90(db) {
|
|
28191
28251
|
db.exec(`
|
|
28192
28252
|
CREATE TABLE IF NOT EXISTS job_cancellations (
|
|
28193
28253
|
id TEXT PRIMARY KEY,
|
|
@@ -28215,7 +28275,7 @@ function indexExists(db, table, indexName) {
|
|
|
28215
28275
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
28216
28276
|
return rows.some((row) => row.name === indexName);
|
|
28217
28277
|
}
|
|
28218
|
-
function
|
|
28278
|
+
function up91(db) {
|
|
28219
28279
|
db.exec(`
|
|
28220
28280
|
CREATE TABLE IF NOT EXISTS job_archive (
|
|
28221
28281
|
id TEXT PRIMARY KEY,
|
|
@@ -28242,7 +28302,7 @@ function indexExists2(db, table, indexName) {
|
|
|
28242
28302
|
const rows = db.prepare(`PRAGMA index_list(${table})`).all();
|
|
28243
28303
|
return rows.some((row) => row.name === indexName);
|
|
28244
28304
|
}
|
|
28245
|
-
function
|
|
28305
|
+
function up92(db) {
|
|
28246
28306
|
db.exec(`
|
|
28247
28307
|
CREATE TABLE IF NOT EXISTS embedding_index_state (
|
|
28248
28308
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -28255,7 +28315,7 @@ function up91(db) {
|
|
|
28255
28315
|
)
|
|
28256
28316
|
`);
|
|
28257
28317
|
}
|
|
28258
|
-
function
|
|
28318
|
+
function up93(db) {
|
|
28259
28319
|
db.exec(`
|
|
28260
28320
|
CREATE TABLE IF NOT EXISTS embeddings_staging (
|
|
28261
28321
|
id TEXT PRIMARY KEY,
|
|
@@ -28274,7 +28334,7 @@ function up92(db) {
|
|
|
28274
28334
|
ON embeddings_staging(agent_id, source_type, source_id);
|
|
28275
28335
|
`);
|
|
28276
28336
|
}
|
|
28277
|
-
function
|
|
28337
|
+
function up94(db) {
|
|
28278
28338
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
28279
28339
|
if (!columns.some((column) => column.name === "evidence_cursor")) {
|
|
28280
28340
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN evidence_cursor TEXT");
|
|
@@ -28284,7 +28344,7 @@ function hasColumn13(db, table, column) {
|
|
|
28284
28344
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
28285
28345
|
return rows.some((r2) => r2.name === column);
|
|
28286
28346
|
}
|
|
28287
|
-
function
|
|
28347
|
+
function up95(db) {
|
|
28288
28348
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name = 'memories'").all();
|
|
28289
28349
|
if (tables.length === 0)
|
|
28290
28350
|
return;
|
|
@@ -28309,23 +28369,23 @@ function up94(db) {
|
|
|
28309
28369
|
function hasColumn14(db, table, column) {
|
|
28310
28370
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
28311
28371
|
}
|
|
28312
|
-
function
|
|
28372
|
+
function up96(db) {
|
|
28313
28373
|
const hasMemories = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memories'").get();
|
|
28314
28374
|
if (!hasMemories || !hasColumn14(db, "memories", "memory_kind") || !hasColumn14(db, "memories", "type"))
|
|
28315
28375
|
return;
|
|
28316
28376
|
db.exec("UPDATE memories SET memory_kind = NULL WHERE type = 'session_summary'");
|
|
28317
28377
|
}
|
|
28318
|
-
function
|
|
28378
|
+
function up97(db) {
|
|
28319
28379
|
db.exec("DROP TABLE IF EXISTS ingestion_jobs");
|
|
28320
28380
|
}
|
|
28321
|
-
function
|
|
28381
|
+
function up98(db) {
|
|
28322
28382
|
const columns = db.prepare("PRAGMA table_info(dreaming_state)").all();
|
|
28323
28383
|
if (!columns.some((column) => column.name === "last_failure_at")) {
|
|
28324
28384
|
db.exec("ALTER TABLE dreaming_state ADD COLUMN last_failure_at TEXT");
|
|
28325
28385
|
}
|
|
28326
28386
|
db.exec("UPDATE dreaming_state SET last_failure_at = updated_at WHERE consecutive_failures > 0 AND last_failure_at IS NULL");
|
|
28327
28387
|
}
|
|
28328
|
-
function
|
|
28388
|
+
function up99(db) {
|
|
28329
28389
|
db.exec(`
|
|
28330
28390
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_exclusions (
|
|
28331
28391
|
agent_id TEXT NOT NULL,
|
|
@@ -28342,7 +28402,7 @@ function up98(db) {
|
|
|
28342
28402
|
ON dreaming_evidence_exclusions (agent_id, resolved_at, requeue_requested_at, excluded_at DESC);
|
|
28343
28403
|
`);
|
|
28344
28404
|
}
|
|
28345
|
-
function
|
|
28405
|
+
function up100(db) {
|
|
28346
28406
|
db.exec(`
|
|
28347
28407
|
CREATE TABLE IF NOT EXISTS dreaming_tool_calls (
|
|
28348
28408
|
id TEXT PRIMARY KEY,
|
|
@@ -28362,7 +28422,7 @@ function up99(db) {
|
|
|
28362
28422
|
ON dreaming_tool_calls (agent_id, pass_id, sequence ASC);
|
|
28363
28423
|
`);
|
|
28364
28424
|
}
|
|
28365
|
-
function
|
|
28425
|
+
function up101(db) {
|
|
28366
28426
|
const columns = db.prepare("PRAGMA table_info(dreaming_passes)").all();
|
|
28367
28427
|
if (!columns.some((column) => column.name === "evidence_window_json")) {
|
|
28368
28428
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN evidence_window_json TEXT");
|
|
@@ -28371,7 +28431,7 @@ function up100(db) {
|
|
|
28371
28431
|
db.exec("ALTER TABLE dreaming_passes ADD COLUMN runbook_json TEXT");
|
|
28372
28432
|
}
|
|
28373
28433
|
}
|
|
28374
|
-
function
|
|
28434
|
+
function up102(db) {
|
|
28375
28435
|
db.exec(`
|
|
28376
28436
|
CREATE TABLE IF NOT EXISTS dreaming_attention (
|
|
28377
28437
|
id TEXT PRIMARY KEY,
|
|
@@ -28393,7 +28453,7 @@ function up101(db) {
|
|
|
28393
28453
|
function hasColumn15(db, table, column) {
|
|
28394
28454
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
28395
28455
|
}
|
|
28396
|
-
function
|
|
28456
|
+
function up103(db) {
|
|
28397
28457
|
const requiredMemoryColumns = [
|
|
28398
28458
|
"content_hash",
|
|
28399
28459
|
"normalized_content",
|
|
@@ -28444,7 +28504,7 @@ function up102(db) {
|
|
|
28444
28504
|
WHERE EXISTS (SELECT 1 FROM memory_entity_mentions WHERE entity_id = entities.id)
|
|
28445
28505
|
`);
|
|
28446
28506
|
}
|
|
28447
|
-
function
|
|
28507
|
+
function up104(db) {
|
|
28448
28508
|
const tables = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name IN ('memories', 'entity_attributes')").all();
|
|
28449
28509
|
if (tables.length !== 2)
|
|
28450
28510
|
return;
|
|
@@ -28467,7 +28527,7 @@ function tableExists(db, table) {
|
|
|
28467
28527
|
function hasColumn16(db, table, column) {
|
|
28468
28528
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
28469
28529
|
}
|
|
28470
|
-
function
|
|
28530
|
+
function up105(db) {
|
|
28471
28531
|
db.exec(`
|
|
28472
28532
|
CREATE TABLE IF NOT EXISTS derived_memory_sources (
|
|
28473
28533
|
derived_memory_id TEXT NOT NULL,
|
|
@@ -28510,7 +28570,7 @@ function up104(db) {
|
|
|
28510
28570
|
`);
|
|
28511
28571
|
}
|
|
28512
28572
|
}
|
|
28513
|
-
function
|
|
28573
|
+
function up106(db) {
|
|
28514
28574
|
db.exec(`
|
|
28515
28575
|
DROP TRIGGER IF EXISTS entities_fts_ai;
|
|
28516
28576
|
DROP TRIGGER IF EXISTS entities_fts_ad;
|
|
@@ -28599,7 +28659,7 @@ function up105(db) {
|
|
|
28599
28659
|
function hasColumn17(db, table, column) {
|
|
28600
28660
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
28601
28661
|
}
|
|
28602
|
-
function
|
|
28662
|
+
function up107(db) {
|
|
28603
28663
|
if (!hasColumn17(db, "memories", "review_after")) {
|
|
28604
28664
|
db.exec("ALTER TABLE memories ADD COLUMN review_after TEXT;");
|
|
28605
28665
|
}
|
|
@@ -28608,14 +28668,14 @@ function up106(db) {
|
|
|
28608
28668
|
function hasColumn18(db, table, column) {
|
|
28609
28669
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
28610
28670
|
}
|
|
28611
|
-
function
|
|
28671
|
+
function up108(db) {
|
|
28612
28672
|
for (const [column, type] of TOKEN_COLUMNS) {
|
|
28613
28673
|
if (!hasColumn18(db, "dreaming_passes", column)) {
|
|
28614
28674
|
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${column} ${type};`);
|
|
28615
28675
|
}
|
|
28616
28676
|
}
|
|
28617
28677
|
}
|
|
28618
|
-
function
|
|
28678
|
+
function up109(db) {
|
|
28619
28679
|
db.exec(`
|
|
28620
28680
|
CREATE TABLE IF NOT EXISTS embedding_usage (
|
|
28621
28681
|
day TEXT NOT NULL,
|
|
@@ -28628,7 +28688,7 @@ function up108(db) {
|
|
|
28628
28688
|
);
|
|
28629
28689
|
`);
|
|
28630
28690
|
}
|
|
28631
|
-
function
|
|
28691
|
+
function up110(db) {
|
|
28632
28692
|
db.exec(`
|
|
28633
28693
|
CREATE TABLE IF NOT EXISTS telemetry_install (
|
|
28634
28694
|
id TEXT PRIMARY KEY,
|
|
@@ -28636,7 +28696,7 @@ function up109(db) {
|
|
|
28636
28696
|
);
|
|
28637
28697
|
`);
|
|
28638
28698
|
}
|
|
28639
|
-
function
|
|
28699
|
+
function up111(db) {
|
|
28640
28700
|
db.exec(`
|
|
28641
28701
|
CREATE INDEX IF NOT EXISTS idx_memory_entity_mentions_entity_memory
|
|
28642
28702
|
ON memory_entity_mentions(entity_id, memory_id);
|
|
@@ -28646,7 +28706,7 @@ function hasColumn19(db, table, column) {
|
|
|
28646
28706
|
const rows = db.prepare(`PRAGMA table_info(${table})`).all();
|
|
28647
28707
|
return rows.some((row) => row.name === column);
|
|
28648
28708
|
}
|
|
28649
|
-
function
|
|
28709
|
+
function up112(db) {
|
|
28650
28710
|
for (const column of COLUMNS2) {
|
|
28651
28711
|
if (!hasColumn19(db, "telemetry_install", column)) {
|
|
28652
28712
|
db.exec(`ALTER TABLE telemetry_install ADD COLUMN ${column} TEXT`);
|
|
@@ -28662,7 +28722,7 @@ function addColumnIfMissing23(db, column, definition) {
|
|
|
28662
28722
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
28663
28723
|
}
|
|
28664
28724
|
}
|
|
28665
|
-
function
|
|
28725
|
+
function up113(db) {
|
|
28666
28726
|
addColumnIfMissing23(db, "source", "TEXT NOT NULL DEFAULT 'daemon'");
|
|
28667
28727
|
addColumnIfMissing23(db, "claim_token", "TEXT");
|
|
28668
28728
|
addColumnIfMissing23(db, "claimed_at", "TEXT");
|
|
@@ -28671,7 +28731,7 @@ function up112(db) {
|
|
|
28671
28731
|
ON telemetry_events(source, sent_to_posthog, claimed_at, timestamp);
|
|
28672
28732
|
`);
|
|
28673
28733
|
}
|
|
28674
|
-
function
|
|
28734
|
+
function up114(db) {
|
|
28675
28735
|
db.exec(`
|
|
28676
28736
|
CREATE TABLE IF NOT EXISTS session_claims (
|
|
28677
28737
|
session_key TEXT NOT NULL,
|
|
@@ -28692,7 +28752,7 @@ function up113(db) {
|
|
|
28692
28752
|
ON session_claims(agent_id, state, expires_at);
|
|
28693
28753
|
`);
|
|
28694
28754
|
}
|
|
28695
|
-
function
|
|
28755
|
+
function up115(db) {
|
|
28696
28756
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'entity_attributes'").get();
|
|
28697
28757
|
if (table == null)
|
|
28698
28758
|
return;
|
|
@@ -28701,7 +28761,7 @@ function up114(db) {
|
|
|
28701
28761
|
ON entity_attributes(memory_id, agent_id, status, importance);
|
|
28702
28762
|
`);
|
|
28703
28763
|
}
|
|
28704
|
-
function
|
|
28764
|
+
function up116(db) {
|
|
28705
28765
|
db.exec(`
|
|
28706
28766
|
CREATE TABLE IF NOT EXISTS cross_agent_messages (
|
|
28707
28767
|
id TEXT PRIMARY KEY,
|
|
@@ -28758,7 +28818,7 @@ function addColumnIfMissing24(db, column, definition) {
|
|
|
28758
28818
|
db.exec(`ALTER TABLE cross_agent_messages ADD COLUMN ${column} ${definition}`);
|
|
28759
28819
|
}
|
|
28760
28820
|
}
|
|
28761
|
-
function
|
|
28821
|
+
function up117(db) {
|
|
28762
28822
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'cross_agent_messages'").get();
|
|
28763
28823
|
if (table == null)
|
|
28764
28824
|
return;
|
|
@@ -28958,7 +29018,7 @@ function backfillTranscriptsFromSummaryJobs(db) {
|
|
|
28958
29018
|
insert.run(...values);
|
|
28959
29019
|
}
|
|
28960
29020
|
}
|
|
28961
|
-
function
|
|
29021
|
+
function up118(db) {
|
|
28962
29022
|
if (!hasTable4(db, "session_transcripts"))
|
|
28963
29023
|
return;
|
|
28964
29024
|
addColumnIfMissing25(db, "session_transcripts", "completed_at", "TEXT");
|
|
@@ -29011,7 +29071,7 @@ function up117(db) {
|
|
|
29011
29071
|
ON session_transcripts(agent_id, content_hash);
|
|
29012
29072
|
`);
|
|
29013
29073
|
}
|
|
29014
|
-
function
|
|
29074
|
+
function up119(db) {
|
|
29015
29075
|
db.exec(`
|
|
29016
29076
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_pressure_status
|
|
29017
29077
|
ON memory_jobs(status)
|
|
@@ -29030,12 +29090,12 @@ function up118(db) {
|
|
|
29030
29090
|
function hasColumn22(db, table, column) {
|
|
29031
29091
|
return db.prepare(`PRAGMA table_info(${table})`).all().some((row) => row.name === column);
|
|
29032
29092
|
}
|
|
29033
|
-
function
|
|
29093
|
+
function up120(db) {
|
|
29034
29094
|
if (!hasColumn22(db, "telemetry_install", "last_seen_version")) {
|
|
29035
29095
|
db.exec("ALTER TABLE telemetry_install ADD COLUMN last_seen_version TEXT");
|
|
29036
29096
|
}
|
|
29037
29097
|
}
|
|
29038
|
-
function
|
|
29098
|
+
function up121(db) {
|
|
29039
29099
|
db.exec(`
|
|
29040
29100
|
CREATE TABLE IF NOT EXISTS source_lifecycle_state (
|
|
29041
29101
|
agent_id TEXT NOT NULL,
|
|
@@ -29064,7 +29124,7 @@ function addColumnIfMissing26(db, column, definition) {
|
|
|
29064
29124
|
db.exec(`ALTER TABLE telemetry_events ADD COLUMN ${column} ${definition}`);
|
|
29065
29125
|
}
|
|
29066
29126
|
}
|
|
29067
|
-
function
|
|
29127
|
+
function up122(db) {
|
|
29068
29128
|
addColumnIfMissing26(db, "delivery_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
29069
29129
|
addColumnIfMissing26(db, "last_attempt_at", "TEXT");
|
|
29070
29130
|
addColumnIfMissing26(db, "sent_at", "TEXT");
|
|
@@ -29085,7 +29145,7 @@ function up121(db) {
|
|
|
29085
29145
|
VALUES (1, CURRENT_TIMESTAMP);
|
|
29086
29146
|
`);
|
|
29087
29147
|
}
|
|
29088
|
-
function
|
|
29148
|
+
function up123(db) {
|
|
29089
29149
|
const columns = db.prepare("PRAGMA table_info(dreaming_evidence_exclusions)").all();
|
|
29090
29150
|
const names = new Set(columns.map((column) => column.name));
|
|
29091
29151
|
if (!names.has("failure_class")) {
|
|
@@ -29102,7 +29162,7 @@ function up122(db) {
|
|
|
29102
29162
|
}
|
|
29103
29163
|
db.exec("CREATE INDEX IF NOT EXISTS idx_dreaming_evidence_exclusions_retry ON dreaming_evidence_exclusions (resolved_at, requeue_requested_at, failure_class, retry_count, last_requeued_at)");
|
|
29104
29164
|
}
|
|
29105
|
-
function
|
|
29165
|
+
function up124(db) {
|
|
29106
29166
|
db.exec(`
|
|
29107
29167
|
CREATE TABLE IF NOT EXISTS embedding_index_failures (
|
|
29108
29168
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -29126,7 +29186,7 @@ function up123(db) {
|
|
|
29126
29186
|
ON embedding_index_failures(source_type, source_id);
|
|
29127
29187
|
`);
|
|
29128
29188
|
}
|
|
29129
|
-
function
|
|
29189
|
+
function up125(db) {
|
|
29130
29190
|
db.exec(`
|
|
29131
29191
|
CREATE TABLE IF NOT EXISTS imported_source_lifecycle (
|
|
29132
29192
|
id TEXT PRIMARY KEY,
|
|
@@ -29176,7 +29236,7 @@ function backfillTable(db, params) {
|
|
|
29176
29236
|
FROM ${params.table}${params.where ? ` WHERE ${params.where}` : ""}`).all();
|
|
29177
29237
|
backfill(db, rows, params.sourceKind, params.scannedAt);
|
|
29178
29238
|
}
|
|
29179
|
-
function
|
|
29239
|
+
function up126(db) {
|
|
29180
29240
|
db.exec(`
|
|
29181
29241
|
CREATE TABLE IF NOT EXISTS memory_content_safety (
|
|
29182
29242
|
agent_id TEXT NOT NULL,
|
|
@@ -29233,7 +29293,7 @@ function up125(db) {
|
|
|
29233
29293
|
scannedAt
|
|
29234
29294
|
});
|
|
29235
29295
|
}
|
|
29236
|
-
function
|
|
29296
|
+
function up127(db) {
|
|
29237
29297
|
const table = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'dreaming_attention'").get();
|
|
29238
29298
|
if (!table)
|
|
29239
29299
|
return;
|
|
@@ -29267,7 +29327,7 @@ function up126(db) {
|
|
|
29267
29327
|
ON dreaming_attention (agent_id, resolved_at, priority DESC, created_at ASC);
|
|
29268
29328
|
`);
|
|
29269
29329
|
}
|
|
29270
|
-
function
|
|
29330
|
+
function up128(db) {
|
|
29271
29331
|
db.exec(`
|
|
29272
29332
|
CREATE TABLE IF NOT EXISTS ontology_contradictions (
|
|
29273
29333
|
id TEXT PRIMARY KEY,
|
|
@@ -29323,7 +29383,7 @@ function up127(db) {
|
|
|
29323
29383
|
ON ontology_contradictions(agent_id, left_source_id, right_source_id);
|
|
29324
29384
|
`);
|
|
29325
29385
|
}
|
|
29326
|
-
function
|
|
29386
|
+
function up129(db) {
|
|
29327
29387
|
db.exec(`
|
|
29328
29388
|
CREATE INDEX IF NOT EXISTS idx_memory_jobs_diagnostics_status_created_at
|
|
29329
29389
|
ON memory_jobs(status, created_at)
|
|
@@ -29338,7 +29398,7 @@ function up128(db) {
|
|
|
29338
29398
|
function tableExists3(db, table) {
|
|
29339
29399
|
return db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(table) != null;
|
|
29340
29400
|
}
|
|
29341
|
-
function
|
|
29401
|
+
function up130(db) {
|
|
29342
29402
|
if (!tableExists3(db, "memory_jobs"))
|
|
29343
29403
|
return;
|
|
29344
29404
|
if (!tableExists3(db, "job_cancellations")) {
|
|
@@ -29387,7 +29447,7 @@ function up129(db) {
|
|
|
29387
29447
|
AND status IN ('pending', 'leased');
|
|
29388
29448
|
`);
|
|
29389
29449
|
}
|
|
29390
|
-
function
|
|
29450
|
+
function up131(db) {
|
|
29391
29451
|
db.exec(`
|
|
29392
29452
|
CREATE TABLE IF NOT EXISTS embedding_repair_budget (
|
|
29393
29453
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -29427,7 +29487,7 @@ function up130(db) {
|
|
|
29427
29487
|
END;
|
|
29428
29488
|
`);
|
|
29429
29489
|
}
|
|
29430
|
-
function
|
|
29490
|
+
function up132(db) {
|
|
29431
29491
|
db.exec(`
|
|
29432
29492
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_consumption (
|
|
29433
29493
|
agent_id TEXT NOT NULL,
|
|
@@ -29450,13 +29510,13 @@ function up131(db) {
|
|
|
29450
29510
|
ON dreaming_evidence_consumption(agent_id, pass_id, delivered_offset, source_length);
|
|
29451
29511
|
`);
|
|
29452
29512
|
}
|
|
29453
|
-
function
|
|
29513
|
+
function up133(db) {
|
|
29454
29514
|
db.exec(`
|
|
29455
29515
|
CREATE INDEX IF NOT EXISTS idx_epistemic_assertions_observer_entity
|
|
29456
29516
|
ON epistemic_assertions(agent_id, subject_entity_id, status, asserted_at DESC, created_at DESC);
|
|
29457
29517
|
`);
|
|
29458
29518
|
}
|
|
29459
|
-
function
|
|
29519
|
+
function up134(db) {
|
|
29460
29520
|
db.exec(`
|
|
29461
29521
|
CREATE TABLE IF NOT EXISTS memory_head_revisions (
|
|
29462
29522
|
id TEXT PRIMARY KEY,
|
|
@@ -29508,7 +29568,7 @@ function up133(db) {
|
|
|
29508
29568
|
if (!names.has("format_version"))
|
|
29509
29569
|
db.exec("ALTER TABLE memory_md_heads ADD COLUMN format_version INTEGER NOT NULL DEFAULT 1");
|
|
29510
29570
|
}
|
|
29511
|
-
function
|
|
29571
|
+
function up135(db) {
|
|
29512
29572
|
db.exec(`
|
|
29513
29573
|
CREATE TABLE memory_head_entries_v134 (
|
|
29514
29574
|
entry_id TEXT NOT NULL, agent_id TEXT NOT NULL, canonical_text TEXT NOT NULL,
|
|
@@ -29526,7 +29586,7 @@ function up134(db) {
|
|
|
29526
29586
|
ON memory_head_entries(agent_id, entry_id, last_revision DESC);
|
|
29527
29587
|
`);
|
|
29528
29588
|
}
|
|
29529
|
-
function
|
|
29589
|
+
function up136(db) {
|
|
29530
29590
|
db.exec(`
|
|
29531
29591
|
CREATE TABLE IF NOT EXISTS memory_head_publications (
|
|
29532
29592
|
agent_id TEXT NOT NULL,
|
|
@@ -29542,7 +29602,7 @@ function up135(db) {
|
|
|
29542
29602
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
29543
29603
|
`);
|
|
29544
29604
|
}
|
|
29545
|
-
function
|
|
29605
|
+
function up137(db) {
|
|
29546
29606
|
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
|
|
29547
29607
|
for (const [name, type] of [
|
|
29548
29608
|
["entry_id", "TEXT"],
|
|
@@ -29556,7 +29616,7 @@ function up136(db) {
|
|
|
29556
29616
|
}
|
|
29557
29617
|
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
29558
29618
|
}
|
|
29559
|
-
function
|
|
29619
|
+
function up138(db) {
|
|
29560
29620
|
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
|
|
29561
29621
|
for (const [name, type] of [
|
|
29562
29622
|
["head_revision", "INTEGER"],
|
|
@@ -29578,7 +29638,7 @@ function addColumnIfMissing27(db, table, column, definition) {
|
|
|
29578
29638
|
if (!hasColumn25(db, table, column))
|
|
29579
29639
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
29580
29640
|
}
|
|
29581
|
-
function
|
|
29641
|
+
function up139(db) {
|
|
29582
29642
|
addColumnIfMissing27(db, "memories", "manual_override", "INTEGER DEFAULT 0");
|
|
29583
29643
|
db.exec(`
|
|
29584
29644
|
CREATE TABLE IF NOT EXISTS transcript_capture_status (
|
|
@@ -29883,7 +29943,7 @@ function up138(db) {
|
|
|
29883
29943
|
GROUP BY j.agent_id;
|
|
29884
29944
|
`);
|
|
29885
29945
|
}
|
|
29886
|
-
function
|
|
29946
|
+
function up140(db) {
|
|
29887
29947
|
db.exec(`
|
|
29888
29948
|
CREATE TABLE IF NOT EXISTS native_source_sync_state (
|
|
29889
29949
|
agent_id TEXT NOT NULL,
|
|
@@ -29899,7 +29959,7 @@ function up139(db) {
|
|
|
29899
29959
|
ON native_source_sync_state(agent_id, status);
|
|
29900
29960
|
`);
|
|
29901
29961
|
}
|
|
29902
|
-
function
|
|
29962
|
+
function up141(db) {
|
|
29903
29963
|
db.exec(`
|
|
29904
29964
|
CREATE TABLE IF NOT EXISTS transcript_recovery_frontiers (
|
|
29905
29965
|
agent_id TEXT NOT NULL,
|
|
@@ -29911,7 +29971,7 @@ function up140(db) {
|
|
|
29911
29971
|
);
|
|
29912
29972
|
`);
|
|
29913
29973
|
}
|
|
29914
|
-
function
|
|
29974
|
+
function up142(db) {
|
|
29915
29975
|
db.exec(`
|
|
29916
29976
|
CREATE TABLE IF NOT EXISTS source_sync_checkpoints (
|
|
29917
29977
|
agent_id TEXT NOT NULL,
|
|
@@ -29925,13 +29985,13 @@ function up141(db) {
|
|
|
29925
29985
|
);
|
|
29926
29986
|
`);
|
|
29927
29987
|
}
|
|
29928
|
-
function
|
|
29988
|
+
function up143(db) {
|
|
29929
29989
|
const columns = db.prepare("PRAGMA table_info(source_sync_checkpoints)").all();
|
|
29930
29990
|
if (!columns.some((column) => column.name === "frontier")) {
|
|
29931
29991
|
db.exec("ALTER TABLE source_sync_checkpoints ADD COLUMN frontier TEXT");
|
|
29932
29992
|
}
|
|
29933
29993
|
}
|
|
29934
|
-
function
|
|
29994
|
+
function up144(db) {
|
|
29935
29995
|
const columns = new Set(db.prepare("PRAGMA table_info(embedding_index_state)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
29936
29996
|
const additions = [
|
|
29937
29997
|
["migration_phase", "TEXT"],
|
|
@@ -29966,13 +30026,13 @@ function up143(db) {
|
|
|
29966
30026
|
`);
|
|
29967
30027
|
}
|
|
29968
30028
|
}
|
|
29969
|
-
function
|
|
30029
|
+
function up145(db) {
|
|
29970
30030
|
const columns = new Set(db.prepare("PRAGMA table_info(memory_jobs)").all().map((row) => row.name).filter((name) => typeof name === "string"));
|
|
29971
30031
|
if (!columns.has("lease_token")) {
|
|
29972
30032
|
db.exec("ALTER TABLE memory_jobs ADD COLUMN lease_token TEXT");
|
|
29973
30033
|
}
|
|
29974
30034
|
}
|
|
29975
|
-
function
|
|
30035
|
+
function up146(db) {
|
|
29976
30036
|
db.exec(`
|
|
29977
30037
|
CREATE TABLE IF NOT EXISTS dreaming_evidence_reviews (
|
|
29978
30038
|
agent_id TEXT NOT NULL,
|
|
@@ -29990,7 +30050,7 @@ function up145(db) {
|
|
|
29990
30050
|
ON dreaming_evidence_reviews (agent_id, reviewed_at DESC);
|
|
29991
30051
|
`);
|
|
29992
30052
|
}
|
|
29993
|
-
function
|
|
30053
|
+
function up147(db) {
|
|
29994
30054
|
db.exec(`
|
|
29995
30055
|
CREATE TABLE IF NOT EXISTS source_import_jobs (
|
|
29996
30056
|
id TEXT PRIMARY KEY, kind TEXT NOT NULL CHECK (kind = 'import'), agent_id TEXT NOT NULL,
|
|
@@ -30045,24 +30105,36 @@ function up146(db) {
|
|
|
30045
30105
|
CREATE INDEX IF NOT EXISTS idx_source_import_attempts_record ON source_import_record_attempts(agent_id, record_id, created_at);
|
|
30046
30106
|
`);
|
|
30047
30107
|
for (const column of ["source_id", "source_record_id", "source_meta_json"]) {
|
|
30048
|
-
const
|
|
30108
|
+
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info('session_transcripts') WHERE name = ?");
|
|
30109
|
+
let exists;
|
|
30110
|
+
try {
|
|
30111
|
+
exists = statement.get(column);
|
|
30112
|
+
} finally {
|
|
30113
|
+
statement.finalize?.();
|
|
30114
|
+
}
|
|
30049
30115
|
if (exists == null)
|
|
30050
30116
|
db.exec(`ALTER TABLE session_transcripts ADD COLUMN ${column} TEXT`);
|
|
30051
30117
|
}
|
|
30052
30118
|
db.exec("CREATE INDEX IF NOT EXISTS idx_session_transcripts_agent_source ON session_transcripts(agent_id, source_id)");
|
|
30053
30119
|
}
|
|
30054
|
-
function
|
|
30120
|
+
function up148(db) {
|
|
30055
30121
|
db.exec("CREATE INDEX IF NOT EXISTS idx_source_import_files_job_state ON source_import_files(job_id, state)");
|
|
30056
30122
|
}
|
|
30057
|
-
function
|
|
30123
|
+
function up149(db) {
|
|
30058
30124
|
const columns = db.prepare("PRAGMA table_info(source_import_record_attempts)").all();
|
|
30059
30125
|
if (!columns.some((column) => column.name === "source_id")) {
|
|
30060
30126
|
db.exec("ALTER TABLE source_import_record_attempts ADD COLUMN source_id TEXT");
|
|
30061
30127
|
}
|
|
30062
30128
|
}
|
|
30063
|
-
function
|
|
30129
|
+
function up150(db) {
|
|
30064
30130
|
const addColumn = (table, column, definition) => {
|
|
30065
|
-
const
|
|
30131
|
+
const statement = db.prepare("SELECT 1 AS found FROM pragma_table_info(?) WHERE name = ?");
|
|
30132
|
+
let exists;
|
|
30133
|
+
try {
|
|
30134
|
+
exists = statement.get(table, column);
|
|
30135
|
+
} finally {
|
|
30136
|
+
statement.finalize?.();
|
|
30137
|
+
}
|
|
30066
30138
|
if (exists == null)
|
|
30067
30139
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30068
30140
|
};
|
|
@@ -30075,7 +30147,7 @@ function addColumnIfMissing28(db, table, column, definition) {
|
|
|
30075
30147
|
if (!columns.some((row) => row.name === column))
|
|
30076
30148
|
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
30077
30149
|
}
|
|
30078
|
-
function
|
|
30150
|
+
function up151(db) {
|
|
30079
30151
|
addColumnIfMissing28(db, "memory_md_heads", "is_current", "INTEGER NOT NULL DEFAULT 0");
|
|
30080
30152
|
addColumnIfMissing28(db, "dreaming_passes", "head_base_revision", "INTEGER");
|
|
30081
30153
|
db.exec("CREATE INDEX IF NOT EXISTS idx_memory_head_revisions_content_hash ON memory_head_revisions(content_hash)");
|
|
@@ -39097,13 +39169,13 @@ ${end.comment}` : end.comment;
|
|
|
39097
39169
|
{
|
|
39098
39170
|
version: 1,
|
|
39099
39171
|
name: "baseline",
|
|
39100
|
-
up,
|
|
39172
|
+
up: up2,
|
|
39101
39173
|
artifacts: { tables: ["memories", "conversations", "embeddings"] }
|
|
39102
39174
|
},
|
|
39103
39175
|
{
|
|
39104
39176
|
version: 2,
|
|
39105
39177
|
name: "pipeline-v2",
|
|
39106
|
-
up:
|
|
39178
|
+
up: up3,
|
|
39107
39179
|
artifacts: {
|
|
39108
39180
|
tables: ["memory_history", "memory_jobs", "entities", "relations", "memory_entity_mentions"]
|
|
39109
39181
|
}
|
|
@@ -39111,12 +39183,12 @@ ${end.comment}` : end.comment;
|
|
|
39111
39183
|
{
|
|
39112
39184
|
version: 3,
|
|
39113
39185
|
name: "unique-content-hash",
|
|
39114
|
-
up:
|
|
39186
|
+
up: up4
|
|
39115
39187
|
},
|
|
39116
39188
|
{
|
|
39117
39189
|
version: 4,
|
|
39118
39190
|
name: "history-actor-and-retention",
|
|
39119
|
-
up:
|
|
39191
|
+
up: up5,
|
|
39120
39192
|
artifacts: {
|
|
39121
39193
|
columns: [{ table: "memory_history", column: "actor_type" }]
|
|
39122
39194
|
}
|
|
@@ -39124,7 +39196,7 @@ ${end.comment}` : end.comment;
|
|
|
39124
39196
|
{
|
|
39125
39197
|
version: 5,
|
|
39126
39198
|
name: "graph-extended",
|
|
39127
|
-
up:
|
|
39199
|
+
up: up6,
|
|
39128
39200
|
artifacts: {
|
|
39129
39201
|
columns: [{ table: "entities", column: "canonical_name" }]
|
|
39130
39202
|
}
|
|
@@ -39132,7 +39204,7 @@ ${end.comment}` : end.comment;
|
|
|
39132
39204
|
{
|
|
39133
39205
|
version: 6,
|
|
39134
39206
|
name: "idempotency-key",
|
|
39135
|
-
up:
|
|
39207
|
+
up: up7,
|
|
39136
39208
|
artifacts: {
|
|
39137
39209
|
columns: [{ table: "memories", column: "idempotency_key" }]
|
|
39138
39210
|
}
|
|
@@ -39140,42 +39212,42 @@ ${end.comment}` : end.comment;
|
|
|
39140
39212
|
{
|
|
39141
39213
|
version: 7,
|
|
39142
39214
|
name: "documents-and-connectors",
|
|
39143
|
-
up:
|
|
39215
|
+
up: up8,
|
|
39144
39216
|
artifacts: { tables: ["documents", "document_memories", "connectors"] }
|
|
39145
39217
|
},
|
|
39146
39218
|
{
|
|
39147
39219
|
version: 8,
|
|
39148
39220
|
name: "embeddings-unique-hash",
|
|
39149
|
-
up:
|
|
39221
|
+
up: up9
|
|
39150
39222
|
},
|
|
39151
39223
|
{
|
|
39152
39224
|
version: 9,
|
|
39153
39225
|
name: "summary-jobs",
|
|
39154
|
-
up:
|
|
39226
|
+
up: up10,
|
|
39155
39227
|
artifacts: { tables: ["summary_jobs"] }
|
|
39156
39228
|
},
|
|
39157
39229
|
{
|
|
39158
39230
|
version: 10,
|
|
39159
39231
|
name: "umap-cache",
|
|
39160
|
-
up:
|
|
39232
|
+
up: up11,
|
|
39161
39233
|
artifacts: { tables: ["umap_cache"] }
|
|
39162
39234
|
},
|
|
39163
39235
|
{
|
|
39164
39236
|
version: 11,
|
|
39165
39237
|
name: "session-scores",
|
|
39166
|
-
up:
|
|
39238
|
+
up: up12,
|
|
39167
39239
|
artifacts: { tables: ["session_scores"] }
|
|
39168
39240
|
},
|
|
39169
39241
|
{
|
|
39170
39242
|
version: 12,
|
|
39171
39243
|
name: "scheduled-tasks",
|
|
39172
|
-
up:
|
|
39244
|
+
up: up13,
|
|
39173
39245
|
artifacts: { tables: ["scheduled_tasks", "task_runs"] }
|
|
39174
39246
|
},
|
|
39175
39247
|
{
|
|
39176
39248
|
version: 13,
|
|
39177
39249
|
name: "ingestion-tracking",
|
|
39178
|
-
up:
|
|
39250
|
+
up: up14,
|
|
39179
39251
|
artifacts: {
|
|
39180
39252
|
columns: [
|
|
39181
39253
|
{ table: "memories", column: "source_path" },
|
|
@@ -39186,13 +39258,13 @@ ${end.comment}` : end.comment;
|
|
|
39186
39258
|
{
|
|
39187
39259
|
version: 14,
|
|
39188
39260
|
name: "telemetry",
|
|
39189
|
-
up:
|
|
39261
|
+
up: up15,
|
|
39190
39262
|
artifacts: { tables: ["telemetry_events"] }
|
|
39191
39263
|
},
|
|
39192
39264
|
{
|
|
39193
39265
|
version: 15,
|
|
39194
39266
|
name: "session-memories",
|
|
39195
|
-
up:
|
|
39267
|
+
up: up16,
|
|
39196
39268
|
artifacts: {
|
|
39197
39269
|
tables: ["session_memories"],
|
|
39198
39270
|
columns: [
|
|
@@ -39204,13 +39276,13 @@ ${end.comment}` : end.comment;
|
|
|
39204
39276
|
{
|
|
39205
39277
|
version: 16,
|
|
39206
39278
|
name: "session-checkpoints",
|
|
39207
|
-
up:
|
|
39279
|
+
up: up17,
|
|
39208
39280
|
artifacts: { tables: ["session_checkpoints"] }
|
|
39209
39281
|
},
|
|
39210
39282
|
{
|
|
39211
39283
|
version: 17,
|
|
39212
39284
|
name: "task-skills",
|
|
39213
|
-
up:
|
|
39285
|
+
up: up18,
|
|
39214
39286
|
artifacts: {
|
|
39215
39287
|
columns: [{ table: "scheduled_tasks", column: "skill_name" }]
|
|
39216
39288
|
}
|
|
@@ -39218,13 +39290,13 @@ ${end.comment}` : end.comment;
|
|
|
39218
39290
|
{
|
|
39219
39291
|
version: 18,
|
|
39220
39292
|
name: "skill-meta",
|
|
39221
|
-
up:
|
|
39293
|
+
up: up19,
|
|
39222
39294
|
artifacts: { tables: ["skill_meta"] }
|
|
39223
39295
|
},
|
|
39224
39296
|
{
|
|
39225
39297
|
version: 19,
|
|
39226
39298
|
name: "knowledge-structure",
|
|
39227
|
-
up:
|
|
39299
|
+
up: up20,
|
|
39228
39300
|
artifacts: {
|
|
39229
39301
|
tables: ["entity_aspects", "entity_attributes", "entity_dependencies", "task_meta"],
|
|
39230
39302
|
columns: [{ table: "entities", column: "agent_id" }]
|
|
@@ -39233,7 +39305,7 @@ ${end.comment}` : end.comment;
|
|
|
39233
39305
|
{
|
|
39234
39306
|
version: 20,
|
|
39235
39307
|
name: "session-structural-columns",
|
|
39236
|
-
up:
|
|
39308
|
+
up: up21,
|
|
39237
39309
|
artifacts: {
|
|
39238
39310
|
columns: [
|
|
39239
39311
|
{ table: "session_memories", column: "entity_slot" },
|
|
@@ -39246,7 +39318,7 @@ ${end.comment}` : end.comment;
|
|
|
39246
39318
|
{
|
|
39247
39319
|
version: 21,
|
|
39248
39320
|
name: "checkpoint-structural",
|
|
39249
|
-
up:
|
|
39321
|
+
up: up22,
|
|
39250
39322
|
artifacts: {
|
|
39251
39323
|
columns: [{ table: "session_checkpoints", column: "focal_entity_ids" }]
|
|
39252
39324
|
}
|
|
@@ -39254,7 +39326,7 @@ ${end.comment}` : end.comment;
|
|
|
39254
39326
|
{
|
|
39255
39327
|
version: 22,
|
|
39256
39328
|
name: "entity-pinning",
|
|
39257
|
-
up:
|
|
39329
|
+
up: up23,
|
|
39258
39330
|
artifacts: {
|
|
39259
39331
|
columns: [
|
|
39260
39332
|
{ table: "entities", column: "pinned" },
|
|
@@ -39265,17 +39337,17 @@ ${end.comment}` : end.comment;
|
|
|
39265
39337
|
{
|
|
39266
39338
|
version: 23,
|
|
39267
39339
|
name: "retired-scorer-gap",
|
|
39268
|
-
up:
|
|
39340
|
+
up: up24
|
|
39269
39341
|
},
|
|
39270
39342
|
{
|
|
39271
39343
|
version: 24,
|
|
39272
39344
|
name: "retired-scorer-gap",
|
|
39273
|
-
up:
|
|
39345
|
+
up: up25
|
|
39274
39346
|
},
|
|
39275
39347
|
{
|
|
39276
39348
|
version: 25,
|
|
39277
39349
|
name: "agent-feedback",
|
|
39278
|
-
up:
|
|
39350
|
+
up: up26,
|
|
39279
39351
|
artifacts: {
|
|
39280
39352
|
columns: [{ table: "session_memories", column: "agent_relevance_score" }]
|
|
39281
39353
|
}
|
|
@@ -39283,32 +39355,32 @@ ${end.comment}` : end.comment;
|
|
|
39283
39355
|
{
|
|
39284
39356
|
version: 26,
|
|
39285
39357
|
name: "retired-scorer-gap",
|
|
39286
|
-
up:
|
|
39358
|
+
up: up27
|
|
39287
39359
|
},
|
|
39288
39360
|
{
|
|
39289
39361
|
version: 27,
|
|
39290
39362
|
name: "backfill-canonical-names",
|
|
39291
|
-
up:
|
|
39363
|
+
up: up28
|
|
39292
39364
|
},
|
|
39293
39365
|
{
|
|
39294
39366
|
version: 28,
|
|
39295
39367
|
name: "lossless-retention",
|
|
39296
|
-
up:
|
|
39368
|
+
up: up29
|
|
39297
39369
|
},
|
|
39298
39370
|
{
|
|
39299
39371
|
version: 29,
|
|
39300
39372
|
name: "session-summary-dag",
|
|
39301
|
-
up:
|
|
39373
|
+
up: up30
|
|
39302
39374
|
},
|
|
39303
39375
|
{
|
|
39304
39376
|
version: 30,
|
|
39305
39377
|
name: "nullable-memory-job-memory-id",
|
|
39306
|
-
up:
|
|
39378
|
+
up: up31
|
|
39307
39379
|
},
|
|
39308
39380
|
{
|
|
39309
39381
|
version: 31,
|
|
39310
39382
|
name: "dependency-reason",
|
|
39311
|
-
up:
|
|
39383
|
+
up: up32,
|
|
39312
39384
|
artifacts: {
|
|
39313
39385
|
columns: [
|
|
39314
39386
|
{ table: "entity_dependencies", column: "reason" },
|
|
@@ -39319,7 +39391,7 @@ ${end.comment}` : end.comment;
|
|
|
39319
39391
|
{
|
|
39320
39392
|
version: 32,
|
|
39321
39393
|
name: "embeddings-vector-column",
|
|
39322
|
-
up:
|
|
39394
|
+
up: up33,
|
|
39323
39395
|
artifacts: {
|
|
39324
39396
|
columns: [{ table: "embeddings", column: "vector", optional: true }]
|
|
39325
39397
|
}
|
|
@@ -39327,7 +39399,7 @@ ${end.comment}` : end.comment;
|
|
|
39327
39399
|
{
|
|
39328
39400
|
version: 33,
|
|
39329
39401
|
name: "scope",
|
|
39330
|
-
up:
|
|
39402
|
+
up: up34,
|
|
39331
39403
|
artifacts: {
|
|
39332
39404
|
columns: [{ table: "memories", column: "scope" }]
|
|
39333
39405
|
}
|
|
@@ -39335,17 +39407,17 @@ ${end.comment}` : end.comment;
|
|
|
39335
39407
|
{
|
|
39336
39408
|
version: 34,
|
|
39337
39409
|
name: "scope-aware-dedup",
|
|
39338
|
-
up:
|
|
39410
|
+
up: up35
|
|
39339
39411
|
},
|
|
39340
39412
|
{
|
|
39341
39413
|
version: 35,
|
|
39342
39414
|
name: "entity-fts",
|
|
39343
|
-
up:
|
|
39415
|
+
up: up36
|
|
39344
39416
|
},
|
|
39345
39417
|
{
|
|
39346
39418
|
version: 36,
|
|
39347
39419
|
name: "dependency-confidence",
|
|
39348
|
-
up:
|
|
39420
|
+
up: up37,
|
|
39349
39421
|
artifacts: {
|
|
39350
39422
|
columns: [{ table: "entity_dependencies", column: "confidence" }]
|
|
39351
39423
|
}
|
|
@@ -39353,7 +39425,7 @@ ${end.comment}` : end.comment;
|
|
|
39353
39425
|
{
|
|
39354
39426
|
version: 37,
|
|
39355
39427
|
name: "entity-communities",
|
|
39356
|
-
up:
|
|
39428
|
+
up: up38,
|
|
39357
39429
|
artifacts: {
|
|
39358
39430
|
tables: ["entity_communities"],
|
|
39359
39431
|
columns: [{ table: "entities", column: "community_id" }]
|
|
@@ -39362,24 +39434,24 @@ ${end.comment}` : end.comment;
|
|
|
39362
39434
|
{
|
|
39363
39435
|
version: 38,
|
|
39364
39436
|
name: "memory-hints",
|
|
39365
|
-
up:
|
|
39437
|
+
up: up39,
|
|
39366
39438
|
artifacts: { tables: ["memory_hints"] }
|
|
39367
39439
|
},
|
|
39368
39440
|
{
|
|
39369
39441
|
version: 39,
|
|
39370
39442
|
name: "dedup-entity-dependencies",
|
|
39371
|
-
up:
|
|
39443
|
+
up: up40
|
|
39372
39444
|
},
|
|
39373
39445
|
{
|
|
39374
39446
|
version: 40,
|
|
39375
39447
|
name: "session-transcripts",
|
|
39376
|
-
up:
|
|
39448
|
+
up: up41,
|
|
39377
39449
|
artifacts: { tables: ["session_transcripts"] }
|
|
39378
39450
|
},
|
|
39379
39451
|
{
|
|
39380
39452
|
version: 41,
|
|
39381
39453
|
name: "path-feedback",
|
|
39382
|
-
up:
|
|
39454
|
+
up: up42,
|
|
39383
39455
|
artifacts: {
|
|
39384
39456
|
tables: [
|
|
39385
39457
|
"path_feedback_events",
|
|
@@ -39394,7 +39466,7 @@ ${end.comment}` : end.comment;
|
|
|
39394
39466
|
{
|
|
39395
39467
|
version: 42,
|
|
39396
39468
|
name: "session-memories-agent-id",
|
|
39397
|
-
up:
|
|
39469
|
+
up: up43,
|
|
39398
39470
|
artifacts: {
|
|
39399
39471
|
columns: [{ table: "session_memories", column: "agent_id" }]
|
|
39400
39472
|
}
|
|
@@ -39402,7 +39474,7 @@ ${end.comment}` : end.comment;
|
|
|
39402
39474
|
{
|
|
39403
39475
|
version: 43,
|
|
39404
39476
|
name: "agents-table",
|
|
39405
|
-
up:
|
|
39477
|
+
up: up44,
|
|
39406
39478
|
artifacts: {
|
|
39407
39479
|
tables: ["agents"],
|
|
39408
39480
|
columns: [
|
|
@@ -39414,7 +39486,7 @@ ${end.comment}` : end.comment;
|
|
|
39414
39486
|
{
|
|
39415
39487
|
version: 44,
|
|
39416
39488
|
name: "memory-md-temporal-head",
|
|
39417
|
-
up:
|
|
39489
|
+
up: up45,
|
|
39418
39490
|
artifacts: {
|
|
39419
39491
|
columns: [
|
|
39420
39492
|
{ table: "session_summaries", column: "source_type" },
|
|
@@ -39426,7 +39498,7 @@ ${end.comment}` : end.comment;
|
|
|
39426
39498
|
{
|
|
39427
39499
|
version: 45,
|
|
39428
39500
|
name: "lossless-working-memory-hardening",
|
|
39429
|
-
up:
|
|
39501
|
+
up: up46,
|
|
39430
39502
|
artifacts: {
|
|
39431
39503
|
tables: ["session_transcripts_fts", "memory_md_heads"],
|
|
39432
39504
|
columns: [
|
|
@@ -39439,17 +39511,17 @@ ${end.comment}` : end.comment;
|
|
|
39439
39511
|
{
|
|
39440
39512
|
version: 46,
|
|
39441
39513
|
name: "session-summary-uniqueness",
|
|
39442
|
-
up:
|
|
39514
|
+
up: up47
|
|
39443
39515
|
},
|
|
39444
39516
|
{
|
|
39445
39517
|
version: 47,
|
|
39446
39518
|
name: "agent-scoped-temporal-uniqueness",
|
|
39447
|
-
up:
|
|
39519
|
+
up: up48
|
|
39448
39520
|
},
|
|
39449
39521
|
{
|
|
39450
39522
|
version: 48,
|
|
39451
39523
|
name: "thread-heads",
|
|
39452
|
-
up:
|
|
39524
|
+
up: up49,
|
|
39453
39525
|
artifacts: {
|
|
39454
39526
|
tables: ["memory_thread_heads"]
|
|
39455
39527
|
}
|
|
@@ -39457,7 +39529,7 @@ ${end.comment}` : end.comment;
|
|
|
39457
39529
|
{
|
|
39458
39530
|
version: 49,
|
|
39459
39531
|
name: "session-extract-cursors",
|
|
39460
|
-
up:
|
|
39532
|
+
up: up50,
|
|
39461
39533
|
artifacts: {
|
|
39462
39534
|
tables: ["session_extract_cursors"]
|
|
39463
39535
|
}
|
|
@@ -39465,7 +39537,7 @@ ${end.comment}` : end.comment;
|
|
|
39465
39537
|
{
|
|
39466
39538
|
version: 50,
|
|
39467
39539
|
name: "related-to-audit",
|
|
39468
|
-
up:
|
|
39540
|
+
up: up51,
|
|
39469
39541
|
artifacts: {
|
|
39470
39542
|
tables: ["entity_dependency_history"]
|
|
39471
39543
|
}
|
|
@@ -39473,7 +39545,7 @@ ${end.comment}` : end.comment;
|
|
|
39473
39545
|
{
|
|
39474
39546
|
version: 51,
|
|
39475
39547
|
name: "memory-md-rolling-window-lineage",
|
|
39476
|
-
up:
|
|
39548
|
+
up: up52,
|
|
39477
39549
|
artifacts: {
|
|
39478
39550
|
tables: ["memory_artifacts", "memory_artifact_tombstones", "memory_artifacts_fts"],
|
|
39479
39551
|
columns: [
|
|
@@ -39488,7 +39560,7 @@ ${end.comment}` : end.comment;
|
|
|
39488
39560
|
{
|
|
39489
39561
|
version: 52,
|
|
39490
39562
|
name: "mcp-invocations",
|
|
39491
|
-
up:
|
|
39563
|
+
up: up53,
|
|
39492
39564
|
artifacts: {
|
|
39493
39565
|
tables: ["mcp_invocations"]
|
|
39494
39566
|
}
|
|
@@ -39496,7 +39568,7 @@ ${end.comment}` : end.comment;
|
|
|
39496
39568
|
{
|
|
39497
39569
|
version: 53,
|
|
39498
39570
|
name: "skill-invocations",
|
|
39499
|
-
up:
|
|
39571
|
+
up: up54,
|
|
39500
39572
|
artifacts: {
|
|
39501
39573
|
tables: ["skill_invocations"]
|
|
39502
39574
|
}
|
|
@@ -39504,7 +39576,7 @@ ${end.comment}` : end.comment;
|
|
|
39504
39576
|
{
|
|
39505
39577
|
version: 54,
|
|
39506
39578
|
name: "task-agent-scope",
|
|
39507
|
-
up:
|
|
39579
|
+
up: up55,
|
|
39508
39580
|
artifacts: {
|
|
39509
39581
|
tables: ["task_scope_hints"]
|
|
39510
39582
|
}
|
|
@@ -39512,7 +39584,7 @@ ${end.comment}` : end.comment;
|
|
|
39512
39584
|
{
|
|
39513
39585
|
version: 55,
|
|
39514
39586
|
name: "dreaming-state",
|
|
39515
|
-
up:
|
|
39587
|
+
up: up56,
|
|
39516
39588
|
artifacts: {
|
|
39517
39589
|
tables: ["dreaming_state", "dreaming_passes"]
|
|
39518
39590
|
}
|
|
@@ -39520,22 +39592,22 @@ ${end.comment}` : end.comment;
|
|
|
39520
39592
|
{
|
|
39521
39593
|
version: 56,
|
|
39522
39594
|
name: "agent-scoped-content-hash",
|
|
39523
|
-
up:
|
|
39595
|
+
up: up57
|
|
39524
39596
|
},
|
|
39525
39597
|
{
|
|
39526
39598
|
version: 57,
|
|
39527
39599
|
name: "memories-fts-tokenizer-repair",
|
|
39528
|
-
up:
|
|
39600
|
+
up: up58
|
|
39529
39601
|
},
|
|
39530
39602
|
{
|
|
39531
39603
|
version: 58,
|
|
39532
39604
|
name: "knowledge-graph-indices",
|
|
39533
|
-
up:
|
|
39605
|
+
up: up59
|
|
39534
39606
|
},
|
|
39535
39607
|
{
|
|
39536
39608
|
version: 59,
|
|
39537
39609
|
name: "entity-attribute-claim-key",
|
|
39538
|
-
up:
|
|
39610
|
+
up: up60,
|
|
39539
39611
|
artifacts: {
|
|
39540
39612
|
columns: [{ table: "entity_attributes", column: "claim_key" }]
|
|
39541
39613
|
}
|
|
@@ -39543,7 +39615,7 @@ ${end.comment}` : end.comment;
|
|
|
39543
39615
|
{
|
|
39544
39616
|
version: 60,
|
|
39545
39617
|
name: "entity-attribute-group-key",
|
|
39546
|
-
up:
|
|
39618
|
+
up: up61,
|
|
39547
39619
|
artifacts: {
|
|
39548
39620
|
columns: [{ table: "entity_attributes", column: "group_key" }]
|
|
39549
39621
|
}
|
|
@@ -39551,7 +39623,7 @@ ${end.comment}` : end.comment;
|
|
|
39551
39623
|
{
|
|
39552
39624
|
version: 61,
|
|
39553
39625
|
name: "memory-artifact-source-mtime",
|
|
39554
|
-
up:
|
|
39626
|
+
up: up62,
|
|
39555
39627
|
artifacts: {
|
|
39556
39628
|
columns: [{ table: "memory_artifacts", column: "source_mtime_ms" }]
|
|
39557
39629
|
}
|
|
@@ -39559,7 +39631,7 @@ ${end.comment}` : end.comment;
|
|
|
39559
39631
|
{
|
|
39560
39632
|
version: 62,
|
|
39561
39633
|
name: "memory-artifact-soft-delete",
|
|
39562
|
-
up:
|
|
39634
|
+
up: up63,
|
|
39563
39635
|
artifacts: {
|
|
39564
39636
|
columns: [
|
|
39565
39637
|
{ table: "memory_artifacts", column: "is_deleted" },
|
|
@@ -39570,12 +39642,12 @@ ${end.comment}` : end.comment;
|
|
|
39570
39642
|
{
|
|
39571
39643
|
version: 63,
|
|
39572
39644
|
name: "content-only-memories-fts-update",
|
|
39573
|
-
up:
|
|
39645
|
+
up: up64
|
|
39574
39646
|
},
|
|
39575
39647
|
{
|
|
39576
39648
|
version: 64,
|
|
39577
39649
|
name: "source-graph-provenance",
|
|
39578
|
-
up:
|
|
39650
|
+
up: up65,
|
|
39579
39651
|
artifacts: {
|
|
39580
39652
|
columns: [
|
|
39581
39653
|
{ table: "entities", column: "source_path" },
|
|
@@ -39588,7 +39660,7 @@ ${end.comment}` : end.comment;
|
|
|
39588
39660
|
{
|
|
39589
39661
|
version: 65,
|
|
39590
39662
|
name: "source-embedding-agent-scope",
|
|
39591
|
-
up:
|
|
39663
|
+
up: up66,
|
|
39592
39664
|
artifacts: {
|
|
39593
39665
|
columns: [{ table: "embeddings", column: "agent_id", optional: true }]
|
|
39594
39666
|
}
|
|
@@ -39596,7 +39668,7 @@ ${end.comment}` : end.comment;
|
|
|
39596
39668
|
{
|
|
39597
39669
|
version: 66,
|
|
39598
39670
|
name: "memory-search-telemetry",
|
|
39599
|
-
up:
|
|
39671
|
+
up: up67,
|
|
39600
39672
|
artifacts: {
|
|
39601
39673
|
tables: ["memory_search_telemetry"]
|
|
39602
39674
|
}
|
|
@@ -39604,7 +39676,7 @@ ${end.comment}` : end.comment;
|
|
|
39604
39676
|
{
|
|
39605
39677
|
version: 67,
|
|
39606
39678
|
name: "ontology-proposals",
|
|
39607
|
-
up:
|
|
39679
|
+
up: up68,
|
|
39608
39680
|
artifacts: {
|
|
39609
39681
|
tables: ["ontology_proposals"],
|
|
39610
39682
|
columns: [
|
|
@@ -39618,7 +39690,7 @@ ${end.comment}` : end.comment;
|
|
|
39618
39690
|
{
|
|
39619
39691
|
version: 68,
|
|
39620
39692
|
name: "daily-reflections",
|
|
39621
|
-
up:
|
|
39693
|
+
up: up69,
|
|
39622
39694
|
artifacts: {
|
|
39623
39695
|
tables: ["daily_reflections"]
|
|
39624
39696
|
}
|
|
@@ -39626,7 +39698,7 @@ ${end.comment}` : end.comment;
|
|
|
39626
39698
|
{
|
|
39627
39699
|
version: 69,
|
|
39628
39700
|
name: "daily-reflections-multiple-insights",
|
|
39629
|
-
up:
|
|
39701
|
+
up: up70,
|
|
39630
39702
|
artifacts: {
|
|
39631
39703
|
tables: ["daily_reflections"]
|
|
39632
39704
|
}
|
|
@@ -39634,7 +39706,7 @@ ${end.comment}` : end.comment;
|
|
|
39634
39706
|
{
|
|
39635
39707
|
version: 70,
|
|
39636
39708
|
name: "ontology-control-plane-state",
|
|
39637
|
-
up:
|
|
39709
|
+
up: up71,
|
|
39638
39710
|
artifacts: {
|
|
39639
39711
|
columns: [
|
|
39640
39712
|
{ table: "entities", column: "status" },
|
|
@@ -39649,7 +39721,7 @@ ${end.comment}` : end.comment;
|
|
|
39649
39721
|
{
|
|
39650
39722
|
version: 71,
|
|
39651
39723
|
name: "epistemic-assertions",
|
|
39652
|
-
up:
|
|
39724
|
+
up: up72,
|
|
39653
39725
|
artifacts: {
|
|
39654
39726
|
tables: ["epistemic_assertions"]
|
|
39655
39727
|
}
|
|
@@ -39657,7 +39729,7 @@ ${end.comment}` : end.comment;
|
|
|
39657
39729
|
{
|
|
39658
39730
|
version: 72,
|
|
39659
39731
|
name: "agent-scoped-idempotency-key",
|
|
39660
|
-
up:
|
|
39732
|
+
up: up73,
|
|
39661
39733
|
artifacts: {
|
|
39662
39734
|
columns: [
|
|
39663
39735
|
{ table: "memories", column: "idempotency_key" },
|
|
@@ -39668,7 +39740,7 @@ ${end.comment}` : end.comment;
|
|
|
39668
39740
|
{
|
|
39669
39741
|
version: 73,
|
|
39670
39742
|
name: "recall-context-dedupe",
|
|
39671
|
-
up:
|
|
39743
|
+
up: up74,
|
|
39672
39744
|
artifacts: {
|
|
39673
39745
|
tables: ["session_context_epochs", "session_recall_events"]
|
|
39674
39746
|
}
|
|
@@ -39676,7 +39748,7 @@ ${end.comment}` : end.comment;
|
|
|
39676
39748
|
{
|
|
39677
39749
|
version: 74,
|
|
39678
39750
|
name: "aggregate-memory-links",
|
|
39679
|
-
up:
|
|
39751
|
+
up: up75,
|
|
39680
39752
|
artifacts: {
|
|
39681
39753
|
tables: ["aggregate_memory_sources"]
|
|
39682
39754
|
}
|
|
@@ -39684,7 +39756,7 @@ ${end.comment}` : end.comment;
|
|
|
39684
39756
|
{
|
|
39685
39757
|
version: 75,
|
|
39686
39758
|
name: "memory-artifact-source-provenance",
|
|
39687
|
-
up:
|
|
39759
|
+
up: up76,
|
|
39688
39760
|
artifacts: {
|
|
39689
39761
|
columns: [
|
|
39690
39762
|
{ table: "memory_artifacts", column: "source_id" },
|
|
@@ -39698,7 +39770,7 @@ ${end.comment}` : end.comment;
|
|
|
39698
39770
|
{
|
|
39699
39771
|
version: 76,
|
|
39700
39772
|
name: "temporal-edges",
|
|
39701
|
-
up:
|
|
39773
|
+
up: up77,
|
|
39702
39774
|
artifacts: {
|
|
39703
39775
|
tables: ["temporal_edges"]
|
|
39704
39776
|
}
|
|
@@ -39706,7 +39778,7 @@ ${end.comment}` : end.comment;
|
|
|
39706
39778
|
{
|
|
39707
39779
|
version: 77,
|
|
39708
39780
|
name: "entity-aliases",
|
|
39709
|
-
up:
|
|
39781
|
+
up: up78,
|
|
39710
39782
|
artifacts: {
|
|
39711
39783
|
tables: ["entity_aliases"]
|
|
39712
39784
|
}
|
|
@@ -39714,7 +39786,7 @@ ${end.comment}` : end.comment;
|
|
|
39714
39786
|
{
|
|
39715
39787
|
version: 78,
|
|
39716
39788
|
name: "api-keys",
|
|
39717
|
-
up:
|
|
39789
|
+
up: up79,
|
|
39718
39790
|
artifacts: {
|
|
39719
39791
|
tables: ["api_keys"]
|
|
39720
39792
|
}
|
|
@@ -39722,7 +39794,7 @@ ${end.comment}` : end.comment;
|
|
|
39722
39794
|
{
|
|
39723
39795
|
version: 79,
|
|
39724
39796
|
name: "transcript-capture-jobs",
|
|
39725
|
-
up:
|
|
39797
|
+
up: up80,
|
|
39726
39798
|
artifacts: {
|
|
39727
39799
|
tables: ["transcript_capture_jobs"]
|
|
39728
39800
|
}
|
|
@@ -39730,7 +39802,7 @@ ${end.comment}` : end.comment;
|
|
|
39730
39802
|
{
|
|
39731
39803
|
version: 80,
|
|
39732
39804
|
name: "document-scope-columns",
|
|
39733
|
-
up:
|
|
39805
|
+
up: up81,
|
|
39734
39806
|
artifacts: {
|
|
39735
39807
|
columns: [
|
|
39736
39808
|
{ table: "documents", column: "agent_id" },
|
|
@@ -39741,7 +39813,7 @@ ${end.comment}` : end.comment;
|
|
|
39741
39813
|
{
|
|
39742
39814
|
version: 81,
|
|
39743
39815
|
name: "aggregate-evidence-sources",
|
|
39744
|
-
up:
|
|
39816
|
+
up: up82,
|
|
39745
39817
|
artifacts: {
|
|
39746
39818
|
tables: ["aggregate_evidence_sources"]
|
|
39747
39819
|
}
|
|
@@ -39749,7 +39821,7 @@ ${end.comment}` : end.comment;
|
|
|
39749
39821
|
{
|
|
39750
39822
|
version: 82,
|
|
39751
39823
|
name: "skill-invocations-harness",
|
|
39752
|
-
up:
|
|
39824
|
+
up: up83,
|
|
39753
39825
|
artifacts: {
|
|
39754
39826
|
columns: [
|
|
39755
39827
|
{ table: "skill_invocations", column: "harness" },
|
|
@@ -39760,7 +39832,7 @@ ${end.comment}` : end.comment;
|
|
|
39760
39832
|
{
|
|
39761
39833
|
version: 83,
|
|
39762
39834
|
name: "memory-lifecycle-repair",
|
|
39763
|
-
up:
|
|
39835
|
+
up: up84,
|
|
39764
39836
|
artifacts: {
|
|
39765
39837
|
tables: ["transcript_capture_jobs", "aggregate_evidence_sources", "entity_dependencies"],
|
|
39766
39838
|
columns: [
|
|
@@ -39775,7 +39847,7 @@ ${end.comment}` : end.comment;
|
|
|
39775
39847
|
{
|
|
39776
39848
|
version: 84,
|
|
39777
39849
|
name: "legacy-markdown-import-state",
|
|
39778
|
-
up:
|
|
39850
|
+
up: up85,
|
|
39779
39851
|
artifacts: {
|
|
39780
39852
|
tables: ["legacy_markdown_imports", "legacy_markdown_chunks"]
|
|
39781
39853
|
}
|
|
@@ -39783,7 +39855,7 @@ ${end.comment}` : end.comment;
|
|
|
39783
39855
|
{
|
|
39784
39856
|
version: 85,
|
|
39785
39857
|
name: "backfill-relations-to-dependencies",
|
|
39786
|
-
up:
|
|
39858
|
+
up: up86,
|
|
39787
39859
|
artifacts: {
|
|
39788
39860
|
tables: ["entity_dependencies"]
|
|
39789
39861
|
}
|
|
@@ -39791,7 +39863,7 @@ ${end.comment}` : end.comment;
|
|
|
39791
39863
|
{
|
|
39792
39864
|
version: 86,
|
|
39793
39865
|
name: "summary-jobs-content-hash",
|
|
39794
|
-
up:
|
|
39866
|
+
up: up87,
|
|
39795
39867
|
artifacts: {
|
|
39796
39868
|
columns: [{ table: "summary_jobs", column: "content_hash" }]
|
|
39797
39869
|
}
|
|
@@ -39799,7 +39871,7 @@ ${end.comment}` : end.comment;
|
|
|
39799
39871
|
{
|
|
39800
39872
|
version: 87,
|
|
39801
39873
|
name: "summary-jobs-boundary-reason",
|
|
39802
|
-
up:
|
|
39874
|
+
up: up88,
|
|
39803
39875
|
artifacts: {
|
|
39804
39876
|
columns: [{ table: "summary_jobs", column: "boundary_reason" }]
|
|
39805
39877
|
}
|
|
@@ -39807,7 +39879,7 @@ ${end.comment}` : end.comment;
|
|
|
39807
39879
|
{
|
|
39808
39880
|
version: 88,
|
|
39809
39881
|
name: "transcript-recovery-files",
|
|
39810
|
-
up:
|
|
39882
|
+
up: up89,
|
|
39811
39883
|
artifacts: {
|
|
39812
39884
|
tables: ["transcript_recovery_files"]
|
|
39813
39885
|
}
|
|
@@ -39815,7 +39887,7 @@ ${end.comment}` : end.comment;
|
|
|
39815
39887
|
{
|
|
39816
39888
|
version: 89,
|
|
39817
39889
|
name: "job-cancellations",
|
|
39818
|
-
up:
|
|
39890
|
+
up: up90,
|
|
39819
39891
|
artifacts: {
|
|
39820
39892
|
tables: ["job_cancellations"]
|
|
39821
39893
|
}
|
|
@@ -39823,7 +39895,7 @@ ${end.comment}` : end.comment;
|
|
|
39823
39895
|
{
|
|
39824
39896
|
version: 90,
|
|
39825
39897
|
name: "job-archive",
|
|
39826
|
-
up:
|
|
39898
|
+
up: up91,
|
|
39827
39899
|
artifacts: {
|
|
39828
39900
|
tables: ["job_archive"]
|
|
39829
39901
|
}
|
|
@@ -39831,25 +39903,25 @@ ${end.comment}` : end.comment;
|
|
|
39831
39903
|
{
|
|
39832
39904
|
version: 91,
|
|
39833
39905
|
name: "embedding-index-generations",
|
|
39834
|
-
up:
|
|
39906
|
+
up: up92,
|
|
39835
39907
|
artifacts: { tables: ["embedding_index_state"] }
|
|
39836
39908
|
},
|
|
39837
39909
|
{
|
|
39838
39910
|
version: 92,
|
|
39839
39911
|
name: "embedding-staging-store",
|
|
39840
|
-
up:
|
|
39912
|
+
up: up93,
|
|
39841
39913
|
artifacts: { tables: ["embeddings_staging"] }
|
|
39842
39914
|
},
|
|
39843
39915
|
{
|
|
39844
39916
|
version: 93,
|
|
39845
39917
|
name: "dreaming-evidence-cursor",
|
|
39846
|
-
up:
|
|
39918
|
+
up: up94,
|
|
39847
39919
|
artifacts: { columns: [{ table: "dreaming_state", column: "evidence_cursor" }] }
|
|
39848
39920
|
},
|
|
39849
39921
|
{
|
|
39850
39922
|
version: 94,
|
|
39851
39923
|
name: "memory-kind",
|
|
39852
|
-
up:
|
|
39924
|
+
up: up95,
|
|
39853
39925
|
artifacts: {
|
|
39854
39926
|
columns: [
|
|
39855
39927
|
{ table: "memories", column: "memory_kind" },
|
|
@@ -39860,35 +39932,35 @@ ${end.comment}` : end.comment;
|
|
|
39860
39932
|
{
|
|
39861
39933
|
version: 95,
|
|
39862
39934
|
name: "compaction-recall-projections",
|
|
39863
|
-
up:
|
|
39935
|
+
up: up96
|
|
39864
39936
|
},
|
|
39865
39937
|
{
|
|
39866
39938
|
version: 96,
|
|
39867
39939
|
name: "retire-legacy-ingestion",
|
|
39868
|
-
up:
|
|
39940
|
+
up: up97
|
|
39869
39941
|
},
|
|
39870
39942
|
{
|
|
39871
39943
|
version: 97,
|
|
39872
39944
|
name: "dreaming-failure-backoff",
|
|
39873
|
-
up:
|
|
39945
|
+
up: up98,
|
|
39874
39946
|
artifacts: { columns: [{ table: "dreaming_state", column: "last_failure_at" }] }
|
|
39875
39947
|
},
|
|
39876
39948
|
{
|
|
39877
39949
|
version: 98,
|
|
39878
39950
|
name: "dreaming-evidence-exclusions",
|
|
39879
|
-
up:
|
|
39951
|
+
up: up99,
|
|
39880
39952
|
artifacts: { tables: ["dreaming_evidence_exclusions"] }
|
|
39881
39953
|
},
|
|
39882
39954
|
{
|
|
39883
39955
|
version: 99,
|
|
39884
39956
|
name: "dreaming-tool-calls",
|
|
39885
|
-
up:
|
|
39957
|
+
up: up100,
|
|
39886
39958
|
artifacts: { tables: ["dreaming_tool_calls"] }
|
|
39887
39959
|
},
|
|
39888
39960
|
{
|
|
39889
39961
|
version: 100,
|
|
39890
39962
|
name: "dreaming-runbook",
|
|
39891
|
-
up:
|
|
39963
|
+
up: up101,
|
|
39892
39964
|
artifacts: {
|
|
39893
39965
|
columns: [
|
|
39894
39966
|
{ table: "dreaming_passes", column: "evidence_window_json" },
|
|
@@ -39899,23 +39971,23 @@ ${end.comment}` : end.comment;
|
|
|
39899
39971
|
{
|
|
39900
39972
|
version: 101,
|
|
39901
39973
|
name: "dreaming-attention",
|
|
39902
|
-
up:
|
|
39974
|
+
up: up102,
|
|
39903
39975
|
artifacts: { tables: ["dreaming_attention"] }
|
|
39904
39976
|
},
|
|
39905
39977
|
{
|
|
39906
39978
|
version: 102,
|
|
39907
39979
|
name: "attribute-semantic-memories",
|
|
39908
|
-
up:
|
|
39980
|
+
up: up103
|
|
39909
39981
|
},
|
|
39910
39982
|
{
|
|
39911
39983
|
version: 103,
|
|
39912
39984
|
name: "semantic-memory-kind",
|
|
39913
|
-
up:
|
|
39985
|
+
up: up104
|
|
39914
39986
|
},
|
|
39915
39987
|
{
|
|
39916
39988
|
version: 104,
|
|
39917
39989
|
name: "derived-memory-provenance",
|
|
39918
|
-
up:
|
|
39990
|
+
up: up105,
|
|
39919
39991
|
artifacts: {
|
|
39920
39992
|
tables: ["derived_memory_sources"],
|
|
39921
39993
|
columns: [{ table: "memories", column: "stale_at" }]
|
|
@@ -39924,12 +39996,12 @@ ${end.comment}` : end.comment;
|
|
|
39924
39996
|
{
|
|
39925
39997
|
version: 105,
|
|
39926
39998
|
name: "agent-scoped-entity-name",
|
|
39927
|
-
up:
|
|
39999
|
+
up: up106
|
|
39928
40000
|
},
|
|
39929
40001
|
{
|
|
39930
40002
|
version: 106,
|
|
39931
40003
|
name: "memory-review-after",
|
|
39932
|
-
up:
|
|
40004
|
+
up: up107,
|
|
39933
40005
|
artifacts: {
|
|
39934
40006
|
columns: [{ table: "memories", column: "review_after" }]
|
|
39935
40007
|
}
|
|
@@ -39937,7 +40009,7 @@ ${end.comment}` : end.comment;
|
|
|
39937
40009
|
{
|
|
39938
40010
|
version: 107,
|
|
39939
40011
|
name: "dreaming-pass-usage",
|
|
39940
|
-
up:
|
|
40012
|
+
up: up108,
|
|
39941
40013
|
artifacts: {
|
|
39942
40014
|
columns: [
|
|
39943
40015
|
{ table: "dreaming_passes", column: "tokens_input" },
|
|
@@ -39951,7 +40023,7 @@ ${end.comment}` : end.comment;
|
|
|
39951
40023
|
{
|
|
39952
40024
|
version: 108,
|
|
39953
40025
|
name: "embedding-usage",
|
|
39954
|
-
up:
|
|
40026
|
+
up: up109,
|
|
39955
40027
|
artifacts: {
|
|
39956
40028
|
tables: ["embedding_usage"]
|
|
39957
40029
|
}
|
|
@@ -39959,7 +40031,7 @@ ${end.comment}` : end.comment;
|
|
|
39959
40031
|
{
|
|
39960
40032
|
version: 109,
|
|
39961
40033
|
name: "telemetry-install",
|
|
39962
|
-
up:
|
|
40034
|
+
up: up110,
|
|
39963
40035
|
artifacts: {
|
|
39964
40036
|
tables: ["telemetry_install"]
|
|
39965
40037
|
}
|
|
@@ -39967,12 +40039,12 @@ ${end.comment}` : end.comment;
|
|
|
39967
40039
|
{
|
|
39968
40040
|
version: 110,
|
|
39969
40041
|
name: "memory-mention-join-index",
|
|
39970
|
-
up:
|
|
40042
|
+
up: up111
|
|
39971
40043
|
},
|
|
39972
40044
|
{
|
|
39973
40045
|
version: 111,
|
|
39974
40046
|
name: "telemetry-first-use",
|
|
39975
|
-
up:
|
|
40047
|
+
up: up112,
|
|
39976
40048
|
artifacts: {
|
|
39977
40049
|
columns: [
|
|
39978
40050
|
{ table: "telemetry_install", column: "first_remember_at" },
|
|
@@ -39983,7 +40055,7 @@ ${end.comment}` : end.comment;
|
|
|
39983
40055
|
{
|
|
39984
40056
|
version: 112,
|
|
39985
40057
|
name: "telemetry-queue-ownership",
|
|
39986
|
-
up:
|
|
40058
|
+
up: up113,
|
|
39987
40059
|
artifacts: {
|
|
39988
40060
|
columns: [
|
|
39989
40061
|
{ table: "telemetry_events", column: "source" },
|
|
@@ -39995,7 +40067,7 @@ ${end.comment}` : end.comment;
|
|
|
39995
40067
|
{
|
|
39996
40068
|
version: 113,
|
|
39997
40069
|
name: "session-claims",
|
|
39998
|
-
up:
|
|
40070
|
+
up: up114,
|
|
39999
40071
|
artifacts: {
|
|
40000
40072
|
tables: ["session_claims"],
|
|
40001
40073
|
columns: [
|
|
@@ -40009,12 +40081,12 @@ ${end.comment}` : end.comment;
|
|
|
40009
40081
|
{
|
|
40010
40082
|
version: 114,
|
|
40011
40083
|
name: "memory-traversal-hydration-index",
|
|
40012
|
-
up:
|
|
40084
|
+
up: up115
|
|
40013
40085
|
},
|
|
40014
40086
|
{
|
|
40015
40087
|
version: 115,
|
|
40016
40088
|
name: "cross-agent-message-notifications",
|
|
40017
|
-
up:
|
|
40089
|
+
up: up116,
|
|
40018
40090
|
artifacts: {
|
|
40019
40091
|
tables: ["cross_agent_messages", "cross_agent_message_receipts"]
|
|
40020
40092
|
}
|
|
@@ -40022,7 +40094,7 @@ ${end.comment}` : end.comment;
|
|
|
40022
40094
|
{
|
|
40023
40095
|
version: 116,
|
|
40024
40096
|
name: "acp-delivery-reconciliation",
|
|
40025
|
-
up:
|
|
40097
|
+
up: up117,
|
|
40026
40098
|
artifacts: {
|
|
40027
40099
|
columns: [
|
|
40028
40100
|
{ table: "cross_agent_messages", column: "delivery_state" },
|
|
@@ -40036,7 +40108,7 @@ ${end.comment}` : end.comment;
|
|
|
40036
40108
|
{
|
|
40037
40109
|
version: 117,
|
|
40038
40110
|
name: "retire-summary-worker",
|
|
40039
|
-
up:
|
|
40111
|
+
up: up118,
|
|
40040
40112
|
artifacts: {
|
|
40041
40113
|
columns: [
|
|
40042
40114
|
{ table: "session_transcripts", column: "completed_at" },
|
|
@@ -40047,24 +40119,24 @@ ${end.comment}` : end.comment;
|
|
|
40047
40119
|
{
|
|
40048
40120
|
version: 118,
|
|
40049
40121
|
name: "queue-pressure-indices",
|
|
40050
|
-
up:
|
|
40122
|
+
up: up119
|
|
40051
40123
|
},
|
|
40052
40124
|
{
|
|
40053
40125
|
version: 119,
|
|
40054
40126
|
name: "telemetry-version-observation",
|
|
40055
|
-
up:
|
|
40127
|
+
up: up120,
|
|
40056
40128
|
artifacts: { columns: [{ table: "telemetry_install", column: "last_seen_version" }] }
|
|
40057
40129
|
},
|
|
40058
40130
|
{
|
|
40059
40131
|
version: 120,
|
|
40060
40132
|
name: "source-lifecycle-telemetry",
|
|
40061
|
-
up:
|
|
40133
|
+
up: up121,
|
|
40062
40134
|
artifacts: { tables: ["source_lifecycle_state"] }
|
|
40063
40135
|
},
|
|
40064
40136
|
{
|
|
40065
40137
|
version: 121,
|
|
40066
40138
|
name: "telemetry-delivery-health",
|
|
40067
|
-
up:
|
|
40139
|
+
up: up122,
|
|
40068
40140
|
artifacts: {
|
|
40069
40141
|
tables: ["telemetry_delivery_state"],
|
|
40070
40142
|
columns: [
|
|
@@ -40078,7 +40150,7 @@ ${end.comment}` : end.comment;
|
|
|
40078
40150
|
{
|
|
40079
40151
|
version: 122,
|
|
40080
40152
|
name: "dreaming-evidence-retry",
|
|
40081
|
-
up:
|
|
40153
|
+
up: up123,
|
|
40082
40154
|
artifacts: {
|
|
40083
40155
|
columns: [
|
|
40084
40156
|
{ table: "dreaming_evidence_exclusions", column: "failure_class" },
|
|
@@ -40091,13 +40163,13 @@ ${end.comment}` : end.comment;
|
|
|
40091
40163
|
{
|
|
40092
40164
|
version: 123,
|
|
40093
40165
|
name: "embedding-index-failures",
|
|
40094
|
-
up:
|
|
40166
|
+
up: up124,
|
|
40095
40167
|
artifacts: { tables: ["embedding_index_failures"] }
|
|
40096
40168
|
},
|
|
40097
40169
|
{
|
|
40098
40170
|
version: 124,
|
|
40099
40171
|
name: "import-derived-lifecycle",
|
|
40100
|
-
up:
|
|
40172
|
+
up: up125,
|
|
40101
40173
|
artifacts: {
|
|
40102
40174
|
tables: ["imported_source_lifecycle"]
|
|
40103
40175
|
}
|
|
@@ -40105,77 +40177,77 @@ ${end.comment}` : end.comment;
|
|
|
40105
40177
|
{
|
|
40106
40178
|
version: 125,
|
|
40107
40179
|
name: "memory-content-safety",
|
|
40108
|
-
up:
|
|
40180
|
+
up: up126,
|
|
40109
40181
|
artifacts: { tables: ["memory_content_safety"] }
|
|
40110
40182
|
},
|
|
40111
40183
|
{
|
|
40112
40184
|
version: 126,
|
|
40113
40185
|
name: "dreaming-surprisal-attention",
|
|
40114
|
-
up:
|
|
40186
|
+
up: up127,
|
|
40115
40187
|
artifacts: { tables: ["dreaming_attention"] }
|
|
40116
40188
|
},
|
|
40117
40189
|
{
|
|
40118
40190
|
version: 127,
|
|
40119
40191
|
name: "ontology-contradictions",
|
|
40120
|
-
up:
|
|
40192
|
+
up: up128,
|
|
40121
40193
|
artifacts: { tables: ["ontology_contradictions"] }
|
|
40122
40194
|
},
|
|
40123
40195
|
{
|
|
40124
40196
|
version: 128,
|
|
40125
40197
|
name: "bounded-queue-diagnostics",
|
|
40126
|
-
up:
|
|
40198
|
+
up: up129
|
|
40127
40199
|
},
|
|
40128
40200
|
{
|
|
40129
40201
|
version: 129,
|
|
40130
40202
|
name: "retire-structural-jobs",
|
|
40131
|
-
up:
|
|
40203
|
+
up: up130
|
|
40132
40204
|
},
|
|
40133
40205
|
{
|
|
40134
40206
|
version: 130,
|
|
40135
40207
|
name: "embedding-repair-state",
|
|
40136
|
-
up:
|
|
40208
|
+
up: up131,
|
|
40137
40209
|
artifacts: { tables: ["embedding_repair_budget", "embedding_repair_backoff"] }
|
|
40138
40210
|
},
|
|
40139
40211
|
{
|
|
40140
40212
|
version: 131,
|
|
40141
40213
|
name: "dreaming-evidence-consumption",
|
|
40142
|
-
up:
|
|
40214
|
+
up: up132,
|
|
40143
40215
|
artifacts: { tables: ["dreaming_evidence_consumption"] }
|
|
40144
40216
|
},
|
|
40145
40217
|
{
|
|
40146
40218
|
version: 132,
|
|
40147
40219
|
name: "observer-scoped-epistemic-assertions",
|
|
40148
|
-
up:
|
|
40220
|
+
up: up133,
|
|
40149
40221
|
artifacts: { tables: ["epistemic_assertions"] }
|
|
40150
40222
|
},
|
|
40151
40223
|
{
|
|
40152
40224
|
version: 133,
|
|
40153
40225
|
name: "dreaming-memory-head",
|
|
40154
|
-
up:
|
|
40226
|
+
up: up134,
|
|
40155
40227
|
artifacts: { tables: ["memory_head_revisions", "memory_head_entries", "memory_head_revision_entries"] }
|
|
40156
40228
|
},
|
|
40157
40229
|
{
|
|
40158
40230
|
version: 134,
|
|
40159
40231
|
name: "scope-memory-head-entries",
|
|
40160
|
-
up:
|
|
40232
|
+
up: up135,
|
|
40161
40233
|
artifacts: { tables: ["memory_head_entries"] }
|
|
40162
40234
|
},
|
|
40163
40235
|
{
|
|
40164
40236
|
version: 135,
|
|
40165
40237
|
name: "memory-head-publication",
|
|
40166
|
-
up:
|
|
40238
|
+
up: up136,
|
|
40167
40239
|
artifacts: { tables: ["memory_head_publications"] }
|
|
40168
40240
|
},
|
|
40169
40241
|
{
|
|
40170
40242
|
version: 136,
|
|
40171
40243
|
name: "memory-head-revisions",
|
|
40172
|
-
up:
|
|
40244
|
+
up: up137,
|
|
40173
40245
|
artifacts: { tables: ["memory_head_revisions"] }
|
|
40174
40246
|
},
|
|
40175
40247
|
{
|
|
40176
40248
|
version: 137,
|
|
40177
40249
|
name: "dreaming-head-manifest",
|
|
40178
|
-
up:
|
|
40250
|
+
up: up138,
|
|
40179
40251
|
artifacts: {
|
|
40180
40252
|
columns: [
|
|
40181
40253
|
{ table: "dreaming_passes", column: "head_revision" },
|
|
@@ -40186,7 +40258,7 @@ ${end.comment}` : end.comment;
|
|
|
40186
40258
|
{
|
|
40187
40259
|
version: 138,
|
|
40188
40260
|
name: "bounded-status-projections",
|
|
40189
|
-
up:
|
|
40261
|
+
up: up139,
|
|
40190
40262
|
artifacts: {
|
|
40191
40263
|
tables: ["transcript_capture_status", "memories_duplicate_hash_counts", "memories_diagnostics_state"]
|
|
40192
40264
|
}
|
|
@@ -40194,31 +40266,31 @@ ${end.comment}` : end.comment;
|
|
|
40194
40266
|
{
|
|
40195
40267
|
version: 139,
|
|
40196
40268
|
name: "native-source-sync-state",
|
|
40197
|
-
up:
|
|
40269
|
+
up: up140,
|
|
40198
40270
|
artifacts: { tables: ["native_source_sync_state"] }
|
|
40199
40271
|
},
|
|
40200
40272
|
{
|
|
40201
40273
|
version: 140,
|
|
40202
40274
|
name: "transcript-recovery-frontier",
|
|
40203
|
-
up:
|
|
40275
|
+
up: up141,
|
|
40204
40276
|
artifacts: { tables: ["transcript_recovery_frontiers"] }
|
|
40205
40277
|
},
|
|
40206
40278
|
{
|
|
40207
40279
|
version: 141,
|
|
40208
40280
|
name: "source-sync-checkpoints",
|
|
40209
|
-
up:
|
|
40281
|
+
up: up142,
|
|
40210
40282
|
artifacts: { tables: ["source_sync_checkpoints"] }
|
|
40211
40283
|
},
|
|
40212
40284
|
{
|
|
40213
40285
|
version: 142,
|
|
40214
40286
|
name: "source-sync-frontier",
|
|
40215
|
-
up:
|
|
40287
|
+
up: up143,
|
|
40216
40288
|
artifacts: { columns: [{ table: "source_sync_checkpoints", column: "frontier" }] }
|
|
40217
40289
|
},
|
|
40218
40290
|
{
|
|
40219
40291
|
version: 143,
|
|
40220
40292
|
name: "embedding-index-progress",
|
|
40221
|
-
up:
|
|
40293
|
+
up: up144,
|
|
40222
40294
|
artifacts: {
|
|
40223
40295
|
columns: [
|
|
40224
40296
|
{ table: "embedding_index_state", column: "migration_phase" },
|
|
@@ -40234,19 +40306,19 @@ ${end.comment}` : end.comment;
|
|
|
40234
40306
|
{
|
|
40235
40307
|
version: 144,
|
|
40236
40308
|
name: "memory-job-lease-token",
|
|
40237
|
-
up:
|
|
40309
|
+
up: up145,
|
|
40238
40310
|
artifacts: { columns: [{ table: "memory_jobs", column: "lease_token" }] }
|
|
40239
40311
|
},
|
|
40240
40312
|
{
|
|
40241
40313
|
version: 145,
|
|
40242
40314
|
name: "dreaming-evidence-reviews",
|
|
40243
|
-
up:
|
|
40315
|
+
up: up146,
|
|
40244
40316
|
artifacts: { tables: ["dreaming_evidence_reviews"] }
|
|
40245
40317
|
},
|
|
40246
40318
|
{
|
|
40247
40319
|
version: 146,
|
|
40248
40320
|
name: "source-transcript-import",
|
|
40249
|
-
up:
|
|
40321
|
+
up: up147,
|
|
40250
40322
|
artifacts: {
|
|
40251
40323
|
tables: [
|
|
40252
40324
|
"source_import_jobs",
|
|
@@ -40265,19 +40337,19 @@ ${end.comment}` : end.comment;
|
|
|
40265
40337
|
{
|
|
40266
40338
|
version: 147,
|
|
40267
40339
|
name: "source-import-replay-file-slots",
|
|
40268
|
-
up:
|
|
40340
|
+
up: up148,
|
|
40269
40341
|
artifacts: { tables: ["source_import_files"] }
|
|
40270
40342
|
},
|
|
40271
40343
|
{
|
|
40272
40344
|
version: 148,
|
|
40273
40345
|
name: "source-import-attempt-provenance",
|
|
40274
|
-
up:
|
|
40346
|
+
up: up149,
|
|
40275
40347
|
artifacts: { columns: [{ table: "source_import_record_attempts", column: "source_id" }] }
|
|
40276
40348
|
},
|
|
40277
40349
|
{
|
|
40278
40350
|
version: 149,
|
|
40279
40351
|
name: "transcript-import-state-machine",
|
|
40280
|
-
up:
|
|
40352
|
+
up: up150,
|
|
40281
40353
|
artifacts: {
|
|
40282
40354
|
columns: [
|
|
40283
40355
|
{ table: "source_import_jobs", column: "duplicate_mode" },
|
|
@@ -40289,13 +40361,42 @@ ${end.comment}` : end.comment;
|
|
|
40289
40361
|
{
|
|
40290
40362
|
version: 150,
|
|
40291
40363
|
name: "memory-head-freshness",
|
|
40292
|
-
up:
|
|
40364
|
+
up: up151,
|
|
40293
40365
|
artifacts: {
|
|
40294
40366
|
columns: [
|
|
40295
40367
|
{ table: "memory_md_heads", column: "is_current" },
|
|
40296
40368
|
{ table: "dreaming_passes", column: "head_base_revision" }
|
|
40297
40369
|
]
|
|
40298
40370
|
}
|
|
40371
|
+
},
|
|
40372
|
+
{
|
|
40373
|
+
version: 151,
|
|
40374
|
+
name: "transcript-import-bytes",
|
|
40375
|
+
up,
|
|
40376
|
+
artifacts: {
|
|
40377
|
+
tables: [
|
|
40378
|
+
"source_import_chunks",
|
|
40379
|
+
"source_import_capacity",
|
|
40380
|
+
"source_import_migrations",
|
|
40381
|
+
"source_import_migration_streams",
|
|
40382
|
+
"source_import_migration_counts"
|
|
40383
|
+
],
|
|
40384
|
+
columns: [
|
|
40385
|
+
{ table: "source_import_files", column: "storage_state" },
|
|
40386
|
+
{ table: "source_import_files", column: "upload_generation" },
|
|
40387
|
+
{ table: "source_import_files", column: "upload_offset" },
|
|
40388
|
+
{ table: "source_import_files", column: "upload_size" },
|
|
40389
|
+
{ table: "source_import_files", column: "upload_digest" },
|
|
40390
|
+
...["checkpoint_line_number", "reserved_bytes", "original_path"].map((column) => ({
|
|
40391
|
+
table: "source_import_files",
|
|
40392
|
+
column
|
|
40393
|
+
})),
|
|
40394
|
+
...["retry_count", "cleanup_state", "retry_cursor", "retry_requested"].map((column) => ({
|
|
40395
|
+
table: "source_import_jobs",
|
|
40396
|
+
column
|
|
40397
|
+
}))
|
|
40398
|
+
]
|
|
40399
|
+
}
|
|
40299
40400
|
}
|
|
40300
40401
|
];
|
|
40301
40402
|
LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -53641,14 +53742,7 @@ function ownerIsDead(owner) {
|
|
|
53641
53742
|
function messageFromError(error51) {
|
|
53642
53743
|
return new DbOwnerError(error51.code ?? error51.name, error51.message, error51.causeFamily, error51.sqliteCode);
|
|
53643
53744
|
}
|
|
53644
|
-
function
|
|
53645
|
-
if (first === null)
|
|
53646
|
-
return second;
|
|
53647
|
-
if (second === null)
|
|
53648
|
-
return first;
|
|
53649
|
-
return Math.max(first, second);
|
|
53650
|
-
}
|
|
53651
|
-
function createSingleDbOwnerClient(options) {
|
|
53745
|
+
function createDbOwnerClient(options) {
|
|
53652
53746
|
let child = null;
|
|
53653
53747
|
let activeChildClose = null;
|
|
53654
53748
|
let retiredChildClose = null;
|
|
@@ -53688,7 +53782,7 @@ function createSingleDbOwnerClient(options) {
|
|
|
53688
53782
|
const now2 = dbOwnerWallClockNow();
|
|
53689
53783
|
const jobs = [...pending.values()].filter((entry) => entry.job.id !== activeJobId);
|
|
53690
53784
|
const count = (workloadClass) => jobs.filter((entry) => entry.job.workloadClass === workloadClass).length;
|
|
53691
|
-
const
|
|
53785
|
+
const oldestAge = (workloadClass) => {
|
|
53692
53786
|
const oldest = jobs.filter((entry) => entry.job.workloadClass === workloadClass).reduce((value, entry) => value === null ? entry.job.enqueuedAt : Math.min(value, entry.job.enqueuedAt), null);
|
|
53693
53787
|
return oldest === null ? null : Math.max(0, now2 - oldest);
|
|
53694
53788
|
};
|
|
@@ -53703,8 +53797,8 @@ function createSingleDbOwnerClient(options) {
|
|
|
53703
53797
|
maintenanceQueuedJobs: count("maintenance"),
|
|
53704
53798
|
activeJobId,
|
|
53705
53799
|
activeWorkloadClass: activeJobId === null ? null : pending.get(activeJobId)?.job.workloadClass ?? null,
|
|
53706
|
-
foregroundOldestAgeMs:
|
|
53707
|
-
maintenanceOldestAgeMs:
|
|
53800
|
+
foregroundOldestAgeMs: oldestAge("foreground"),
|
|
53801
|
+
maintenanceOldestAgeMs: oldestAge("maintenance"),
|
|
53708
53802
|
lastError
|
|
53709
53803
|
};
|
|
53710
53804
|
}
|
|
@@ -53913,7 +54007,6 @@ function createSingleDbOwnerClient(options) {
|
|
|
53913
54007
|
SIGNET_DB_OWNER_DB_PATH: options.dbPath,
|
|
53914
54008
|
SIGNET_DB_OWNER_WORKER: "1",
|
|
53915
54009
|
...options.sqlitePath === undefined ? {} : { SIGNET_DB_OWNER_SQLITE_PATH: options.sqlitePath },
|
|
53916
|
-
...options.workerRole === "recall" ? { SIGNET_DB_OWNER_RECALL_WORKER: "1" } : {},
|
|
53917
54010
|
SIGNET_DB_OWNER_CANCEL_REGISTRY: cancellationRegistryPath
|
|
53918
54011
|
};
|
|
53919
54012
|
delete workerEnv.SIGNET_DAEMON_ENTRYPOINT;
|
|
@@ -54158,98 +54251,6 @@ function createSingleDbOwnerClient(options) {
|
|
|
54158
54251
|
}
|
|
54159
54252
|
return { start, initialize, submit, setWriteBlocked, awaitResult, cancel, health: currentHealth, close };
|
|
54160
54253
|
}
|
|
54161
|
-
function createDbOwnerClient(options) {
|
|
54162
|
-
const readLane = createSingleDbOwnerClient(options);
|
|
54163
|
-
const writeLane = options.workerRole === "recall" ? readLane : createSingleDbOwnerClient(options);
|
|
54164
|
-
const maintenanceLane = options.workerRole === "recall" ? readLane : createSingleDbOwnerClient(options);
|
|
54165
|
-
let closed = false;
|
|
54166
|
-
function laneFor(requestLane, workloadClass) {
|
|
54167
|
-
if (workloadClass === "maintenance" || requestLane === "maintenance" || requestLane === "verify")
|
|
54168
|
-
return maintenanceLane;
|
|
54169
|
-
return requestLane === "read" ? readLane : writeLane;
|
|
54170
|
-
}
|
|
54171
|
-
function toLaneHealth(lane) {
|
|
54172
|
-
return {
|
|
54173
|
-
state: lane.state,
|
|
54174
|
-
pid: lane.pid,
|
|
54175
|
-
generation: lane.generation,
|
|
54176
|
-
queuedJobs: lane.queuedJobs,
|
|
54177
|
-
activeJobId: lane.activeJobId,
|
|
54178
|
-
activeWorkloadClass: lane.activeWorkloadClass,
|
|
54179
|
-
foregroundQueuedJobs: lane.foregroundQueuedJobs,
|
|
54180
|
-
maintenanceQueuedJobs: lane.maintenanceQueuedJobs,
|
|
54181
|
-
foregroundOldestAgeMs: lane.foregroundOldestAgeMs,
|
|
54182
|
-
maintenanceOldestAgeMs: lane.maintenanceOldestAgeMs,
|
|
54183
|
-
lastError: lane.lastError
|
|
54184
|
-
};
|
|
54185
|
-
}
|
|
54186
|
-
function health() {
|
|
54187
|
-
const read = readLane.health();
|
|
54188
|
-
const write = writeLane.health();
|
|
54189
|
-
const maintenance = maintenanceLane.health();
|
|
54190
|
-
const state = read.state === "closed" && write.state === "closed" && maintenance.state === "closed" ? "closed" : read.state === "failed" || write.state === "failed" || maintenance.state === "failed" ? "failed" : read.state === "dead" && read.generation > 0 || write.state === "dead" && write.generation > 0 || maintenance.state === "dead" && maintenance.generation > 0 ? "dead" : read.state === "starting" || write.state === "starting" || maintenance.state === "starting" ? "starting" : read.state === "ready" || write.state === "ready" || maintenance.state === "ready" ? "ready" : "dead";
|
|
54191
|
-
return {
|
|
54192
|
-
state,
|
|
54193
|
-
initialization: maintenance.initialization,
|
|
54194
|
-
databaseReady: maintenance.databaseReady,
|
|
54195
|
-
pid: read.pid ?? write.pid ?? maintenance.pid,
|
|
54196
|
-
generation: Math.max(read.generation, write.generation, maintenance.generation),
|
|
54197
|
-
queuedJobs: read.queuedJobs + write.queuedJobs + maintenance.queuedJobs,
|
|
54198
|
-
foregroundQueuedJobs: read.foregroundQueuedJobs + write.foregroundQueuedJobs + maintenance.foregroundQueuedJobs,
|
|
54199
|
-
maintenanceQueuedJobs: read.maintenanceQueuedJobs + write.maintenanceQueuedJobs + maintenance.maintenanceQueuedJobs,
|
|
54200
|
-
activeJobId: read.activeJobId ?? write.activeJobId ?? maintenance.activeJobId,
|
|
54201
|
-
activeWorkloadClass: read.activeWorkloadClass ?? write.activeWorkloadClass ?? maintenance.activeWorkloadClass,
|
|
54202
|
-
foregroundOldestAgeMs: oldestAge(oldestAge(read.foregroundOldestAgeMs, write.foregroundOldestAgeMs), maintenance.foregroundOldestAgeMs),
|
|
54203
|
-
maintenanceOldestAgeMs: oldestAge(read.maintenanceOldestAgeMs, maintenance.maintenanceOldestAgeMs),
|
|
54204
|
-
lanes: {
|
|
54205
|
-
read: toLaneHealth(read),
|
|
54206
|
-
write: toLaneHealth(write),
|
|
54207
|
-
maintenance: toLaneHealth(maintenance)
|
|
54208
|
-
},
|
|
54209
|
-
lastError: read.lastError ?? write.lastError ?? maintenance.lastError
|
|
54210
|
-
};
|
|
54211
|
-
}
|
|
54212
|
-
return {
|
|
54213
|
-
async start() {
|
|
54214
|
-
if (closed)
|
|
54215
|
-
throw new DbOwnerError("DB_OWNER_CLOSED", "DB owner client is closed");
|
|
54216
|
-
await Promise.all([readLane.start(), writeLane.start(), maintenanceLane.start()]);
|
|
54217
|
-
},
|
|
54218
|
-
async initialize(agentsDir) {
|
|
54219
|
-
return await maintenanceLane.initialize(agentsDir);
|
|
54220
|
-
},
|
|
54221
|
-
submit(request, submitOptions) {
|
|
54222
|
-
return laneFor(submitOptions.lane, submitOptions.workloadClass).submit(request, submitOptions);
|
|
54223
|
-
},
|
|
54224
|
-
setWriteBlocked(blocked) {
|
|
54225
|
-
readLane.setWriteBlocked(blocked);
|
|
54226
|
-
if (writeLane !== readLane)
|
|
54227
|
-
writeLane.setWriteBlocked(blocked);
|
|
54228
|
-
if (maintenanceLane !== readLane && maintenanceLane !== writeLane)
|
|
54229
|
-
maintenanceLane.setWriteBlocked(blocked);
|
|
54230
|
-
},
|
|
54231
|
-
awaitResult(handle, timeoutMs) {
|
|
54232
|
-
return laneFor(handle.job.lane, handle.job.workloadClass).awaitResult(handle, timeoutMs);
|
|
54233
|
-
},
|
|
54234
|
-
cancel(jobId) {
|
|
54235
|
-
readLane.cancel(jobId);
|
|
54236
|
-
writeLane.cancel(jobId);
|
|
54237
|
-
maintenanceLane.cancel(jobId);
|
|
54238
|
-
},
|
|
54239
|
-
health,
|
|
54240
|
-
async close() {
|
|
54241
|
-
if (closed)
|
|
54242
|
-
return;
|
|
54243
|
-
closed = true;
|
|
54244
|
-
const lanes = [readLane];
|
|
54245
|
-
if (writeLane !== readLane)
|
|
54246
|
-
lanes.push(writeLane);
|
|
54247
|
-
if (maintenanceLane !== readLane && maintenanceLane !== writeLane)
|
|
54248
|
-
lanes.push(maintenanceLane);
|
|
54249
|
-
await Promise.all(lanes.map((lane) => lane.close()));
|
|
54250
|
-
}
|
|
54251
|
-
};
|
|
54252
|
-
}
|
|
54253
54254
|
// ../../platform/daemon/src/db-owner-maintenance.ts
|
|
54254
54255
|
var MAX_FTS_RUN_BUDGET_MS = 10 * 60000;
|
|
54255
54256
|
var registeredMaintenance = null;
|
|
@@ -54267,31 +54268,61 @@ var TRANSCRIPT_IMPORT_LIMITS = {
|
|
|
54267
54268
|
};
|
|
54268
54269
|
|
|
54269
54270
|
// ../../platform/daemon/src/transcript-import-commit.ts
|
|
54271
|
+
function commitTranscriptImportBatchInTx(db, input) {
|
|
54272
|
+
if (input.commits.length > TRANSCRIPT_IMPORT_LIMITS.maxRecordsPerBatch || input.commits.length === 0 && !input.inventory || (input.inventory?.records.length ?? 0) > TRANSCRIPT_IMPORT_LIMITS.maxRecordsPerBatch)
|
|
54273
|
+
throw new RangeError("invalid transcript commit batch");
|
|
54274
|
+
if (transcriptCommitBatchBytes(input.commits) > TRANSCRIPT_IMPORT_LIMITS.maxCanonicalBatchBytes)
|
|
54275
|
+
throw new RangeError("canonical_batch_too_large");
|
|
54276
|
+
if (!input.agentId || !input.sourceId || input.commits.some((item) => item.agentId !== input.agentId || item.sourceId !== input.sourceId))
|
|
54277
|
+
throw new Error("transcript commit provenance does not match owner request");
|
|
54278
|
+
const lease = db.prepare("SELECT 1 FROM source_import_jobs WHERE id = ? AND agent_id = ? AND generation = ? AND lease_token = ? AND state IN ('running','inventorying') AND control_request IS NULL").get(input.jobId, input.agentId, input.generation, input.leaseToken);
|
|
54279
|
+
if (lease == null)
|
|
54280
|
+
throw new Error("stale import lease");
|
|
54281
|
+
const inventory = input.inventory;
|
|
54282
|
+
if (inventory) {
|
|
54283
|
+
const file2 = db.prepare("SELECT 1 FROM source_import_files WHERE id = ? AND job_id = ? AND agent_id = ? AND source_id = ? AND storage_state = 'sealed' AND checkpoint_byte_offset = ?").get(inventory.fileId, input.jobId, input.agentId, input.sourceId, inventory.previousByteOffset);
|
|
54284
|
+
if (!file2 || inventory.checkpoint.byteOffset < inventory.previousByteOffset)
|
|
54285
|
+
throw new Error("stale inventory checkpoint");
|
|
54286
|
+
for (const row of inventory.records) {
|
|
54287
|
+
if (row.byteOffset < inventory.previousByteOffset || row.byteOffset + row.byteLength > inventory.checkpoint.byteOffset)
|
|
54288
|
+
throw new Error("invalid inventory record range");
|
|
54289
|
+
db.prepare("INSERT INTO source_import_records (id,job_id,file_id,source_id,agent_id,ordinal,line_number,byte_offset,byte_length,raw_hash,status,rejection_code) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)").run(`${input.jobId}:${inventory.fileId}:${row.ordinal}`, input.jobId, inventory.fileId, input.sourceId, input.agentId, row.ordinal, row.lineNumber, row.byteOffset, row.byteLength, row.rawHash, row.status, row.rejectionCode ?? null);
|
|
54290
|
+
if (row.status === "rejected")
|
|
54291
|
+
db.prepare("INSERT INTO source_import_record_attempts (agent_id,job_id,file_id,record_id,generation,outcome,error_code,source_id) VALUES (?,?,?,?,?,'rejected',?,?)").run(input.agentId, input.jobId, inventory.fileId, `${input.jobId}:${inventory.fileId}:${row.ordinal}`, input.generation, row.rejectionCode ?? null, input.sourceId);
|
|
54292
|
+
}
|
|
54293
|
+
const pending = inventory.records.filter((row) => row.status === "pending").length;
|
|
54294
|
+
db.prepare("UPDATE source_import_jobs SET total = total + ?, pending = pending + ?, rejected = rejected + ? WHERE id = ? AND agent_id = ?").run(inventory.records.length, pending, inventory.records.length - pending, input.jobId, input.agentId);
|
|
54295
|
+
}
|
|
54296
|
+
const results = [];
|
|
54297
|
+
for (const item of input.commits) {
|
|
54298
|
+
const row = db.prepare("SELECT status, canonical_id, canonical_key FROM source_import_records WHERE id = ? AND job_id = ? AND agent_id = ? AND source_id = ?").get(item.sourceRecordId, input.jobId, input.agentId, input.sourceId);
|
|
54299
|
+
if (!row)
|
|
54300
|
+
throw new Error("import record scope denied");
|
|
54301
|
+
if (row.status === "imported" || row.status === "duplicate") {
|
|
54302
|
+
results.push({ outcome: row.status, canonicalId: row.canonical_id, sessionKey: row.canonical_key });
|
|
54303
|
+
continue;
|
|
54304
|
+
}
|
|
54305
|
+
if (row.status !== "pending")
|
|
54306
|
+
throw new Error("import record is not pending");
|
|
54307
|
+
const result = commitCompletedTranscriptBatchInTx(db, [item])[0];
|
|
54308
|
+
if (!result)
|
|
54309
|
+
throw new Error("missing transcript commit outcome");
|
|
54310
|
+
const rejected2 = result.outcome === "conversation_identity_conflict";
|
|
54311
|
+
db.prepare("UPDATE source_import_records SET status = ?, canonical_id = ?, canonical_key = ?, external_identity = ?, conversation_fingerprint = ?, rejection_code = ?, attempt_count = attempt_count + 1, updated_at = datetime('now') WHERE id = ? AND job_id = ? AND agent_id = ?").run(rejected2 ? "rejected" : result.outcome, result.canonicalId, result.sessionKey, item.externalIdentity, item.contentHash, rejected2 ? result.outcome : null, item.sourceRecordId, input.jobId, input.agentId);
|
|
54312
|
+
db.prepare("INSERT INTO source_import_record_attempts (agent_id,job_id,file_id,record_id,generation,outcome,error_code,source_id) SELECT agent_id,job_id,file_id,id,?,?,?,source_id FROM source_import_records WHERE id = ? AND job_id = ? AND agent_id = ?").run(input.generation, result.outcome, rejected2 ? result.outcome : null, item.sourceRecordId, input.jobId, input.agentId);
|
|
54313
|
+
db.prepare("UPDATE source_import_jobs SET pending = MAX(0,pending - 1), imported = imported + ?, duplicate = duplicate + ?, rejected = rejected + ? WHERE id = ? AND agent_id = ?").run(result.outcome === "imported" ? 1 : 0, result.outcome === "duplicate" ? 1 : 0, rejected2 ? 1 : 0, input.jobId, input.agentId);
|
|
54314
|
+
results.push(result);
|
|
54315
|
+
}
|
|
54316
|
+
if (inventory) {
|
|
54317
|
+
db.prepare("UPDATE source_import_files SET checkpoint_byte_offset = ?, checkpoint_ordinal = ?, checkpoint_line_number = ?, record_count = record_count + ?, malformed_count = malformed_count + ?, state = ?, reserved_bytes = CASE WHEN ? THEN 0 ELSE reserved_bytes END, updated_at = datetime('now') WHERE id = ? AND job_id = ? AND agent_id = ?").run(inventory.checkpoint.byteOffset, inventory.checkpoint.ordinal, inventory.checkpoint.lineNumber, inventory.records.length, inventory.records.filter((row) => row.status === "rejected").length, inventory.complete ? "completed" : "inventorying", inventory.complete ? 1 : 0, inventory.fileId, input.jobId, input.agentId);
|
|
54318
|
+
}
|
|
54319
|
+
return results;
|
|
54320
|
+
}
|
|
54270
54321
|
function serializeCompletedTranscriptMessages(messages) {
|
|
54271
54322
|
return JSON.stringify(messages);
|
|
54272
54323
|
}
|
|
54273
|
-
function canonicalTranscriptLine(commit) {
|
|
54274
|
-
return `${JSON.stringify({
|
|
54275
|
-
id: commit.recordId,
|
|
54276
|
-
session_id: commit.canonicalId,
|
|
54277
|
-
session_key: commit.canonicalKey,
|
|
54278
|
-
agent_id: commit.agentId,
|
|
54279
|
-
harness: commit.harness,
|
|
54280
|
-
project: commit.project,
|
|
54281
|
-
captured_at: commit.capturedAt,
|
|
54282
|
-
source_id: commit.sourceId,
|
|
54283
|
-
source_record_id: commit.sourceRecordId,
|
|
54284
|
-
content_hash: commit.contentHash,
|
|
54285
|
-
source_path: commit.sourcePath,
|
|
54286
|
-
source_meta_json: commit.sourceMetaJson ?? (commit.sourcePath === null ? null : JSON.stringify({ managedPath: commit.sourcePath })),
|
|
54287
|
-
messages: commit.messages
|
|
54288
|
-
})}
|
|
54289
|
-
`;
|
|
54290
|
-
}
|
|
54291
54324
|
function transcriptCommitBatchBytes(commits) {
|
|
54292
|
-
|
|
54293
|
-
const ownerPayloadBytes = Buffer.byteLength(JSON.stringify(commits), "utf8");
|
|
54294
|
-
return canonicalBytes + ownerPayloadBytes;
|
|
54325
|
+
return Buffer.byteLength(JSON.stringify(commits), "utf8");
|
|
54295
54326
|
}
|
|
54296
54327
|
function insertSessionTranscriptIfMissing(db, commit) {
|
|
54297
54328
|
const existing = db.prepare("SELECT 1 FROM session_transcripts WHERE session_key = ? AND agent_id = ? LIMIT 1").get(commit.canonicalKey, commit.agentId);
|
|
@@ -54401,9 +54432,14 @@ function commitCompletedTranscriptBatchInTx(db, commits) {
|
|
|
54401
54432
|
return results;
|
|
54402
54433
|
}
|
|
54403
54434
|
function purgeTranscriptImportSourceInTx(db, agentId, sourceId) {
|
|
54404
|
-
const
|
|
54405
|
-
|
|
54406
|
-
|
|
54435
|
+
const active = db.prepare(`SELECT 1 FROM source_import_jobs j WHERE state NOT IN ('completed','completed_with_rejections','cancelled') ${agentId === undefined ? "" : "AND agent_id = ?"} AND EXISTS (SELECT 1 FROM source_import_files f WHERE f.job_id = j.id AND f.agent_id = j.agent_id AND f.source_id = ?) LIMIT 1`).get(...agentId === undefined ? [] : [agentId], sourceId);
|
|
54436
|
+
if (active)
|
|
54437
|
+
throw new Error("source purge requires cancelled import leases");
|
|
54438
|
+
const raw = db.prepare(`SELECT 1 FROM source_import_chunks c JOIN source_import_files f ON f.id = c.file_id AND f.agent_id = c.agent_id WHERE f.source_id = ? ${agentId === undefined ? "" : "AND f.agent_id = ?"} LIMIT 1`).get(sourceId, ...agentId === undefined ? [] : [agentId]);
|
|
54439
|
+
if (raw)
|
|
54440
|
+
throw new Error("source purge requires completed raw-byte cleanup");
|
|
54441
|
+
let changed = 0;
|
|
54442
|
+
const conversations = agentId !== undefined ? db.prepare("SELECT agent_id, external_identity, canonical_key FROM transcript_import_conversations WHERE agent_id = ? AND owner_source_id = ? AND state != 'removed' LIMIT 25").all(agentId, sourceId) : db.prepare("SELECT agent_id, external_identity, canonical_key FROM transcript_import_conversations WHERE owner_source_id = ? AND state != 'removed' LIMIT 25").all(sourceId);
|
|
54407
54443
|
for (const conversation of conversations) {
|
|
54408
54444
|
const replacement = db.prepare("SELECT id, source_id FROM source_import_records WHERE agent_id = ? AND external_identity = ? AND source_id != ? AND status IN ('imported','duplicate') ORDER BY CASE status WHEN 'imported' THEN 0 ELSE 1 END, updated_at DESC LIMIT 1").get(conversation.agent_id, conversation.external_identity, sourceId);
|
|
54409
54445
|
if (replacement) {
|
|
@@ -54414,8 +54450,15 @@ function purgeTranscriptImportSourceInTx(db, agentId, sourceId) {
|
|
|
54414
54450
|
changed += Number(db.prepare("UPDATE transcript_import_conversations SET state = 'removed', updated_at = datetime('now') WHERE agent_id = ? AND external_identity = ?").run(conversation.agent_id, conversation.external_identity).changes > 0);
|
|
54415
54451
|
}
|
|
54416
54452
|
}
|
|
54417
|
-
|
|
54418
|
-
|
|
54453
|
+
const scoped = agentId === undefined ? [sourceId] : [agentId, sourceId];
|
|
54454
|
+
const predicate = agentId === undefined ? "source_id = ?" : "agent_id = ? AND source_id = ?";
|
|
54455
|
+
const remaining = db.prepare(`SELECT 1 FROM transcript_import_conversations WHERE ${agentId === undefined ? "" : "agent_id = ? AND "}owner_source_id = ? AND state != 'removed' LIMIT 1`).get(...scoped);
|
|
54456
|
+
if (remaining)
|
|
54457
|
+
return changed;
|
|
54458
|
+
changed += db.prepare(`DELETE FROM source_import_records WHERE id IN (SELECT id FROM source_import_records WHERE ${predicate} LIMIT 25)`).run(...scoped).changes;
|
|
54459
|
+
const records = db.prepare(`SELECT 1 FROM source_import_records WHERE ${predicate} LIMIT 1`).get(...scoped);
|
|
54460
|
+
if (!records)
|
|
54461
|
+
changed += db.prepare(`DELETE FROM source_import_files WHERE id IN (SELECT id FROM source_import_files WHERE ${predicate} LIMIT 25)`).run(...scoped).changes;
|
|
54419
54462
|
return changed;
|
|
54420
54463
|
}
|
|
54421
54464
|
function updateSessionTranscriptSource(db, sessionKey, agentId, sourceId, sourceRecordId) {
|
|
@@ -55468,17 +55511,8 @@ async function executeInlineOwnerRequest(accessor2, request) {
|
|
|
55468
55511
|
});
|
|
55469
55512
|
}
|
|
55470
55513
|
if (request.kind === "transcript_bulk_commit") {
|
|
55471
|
-
if (request.input.commits.length === 0 || request.input.commits.length > TRANSCRIPT_IMPORT_LIMITS.maxRecordsPerBatch)
|
|
55472
|
-
throw new RangeError("invalid transcript commit batch");
|
|
55473
|
-
if (transcriptCommitBatchBytes(request.input.commits) > TRANSCRIPT_IMPORT_LIMITS.maxCanonicalBatchBytes)
|
|
55474
|
-
throw new RangeError("canonical_batch_too_large");
|
|
55475
|
-
if (request.input.commits.some((commit) => commit.agentId !== request.input.agentId || commit.sourceId !== request.input.sourceId || commit.harness !== request.input.harness))
|
|
55476
|
-
throw new Error("transcript commit provenance does not match owner request");
|
|
55477
55514
|
return await invokeAccessorAsync(accessor2, "withWriteTxAsync", (db) => {
|
|
55478
|
-
|
|
55479
|
-
if (lease == null)
|
|
55480
|
-
throw new Error("stale import lease");
|
|
55481
|
-
return commitCompletedTranscriptBatchInTx(db, request.input.commits);
|
|
55515
|
+
return commitTranscriptImportBatchInTx(db, request.input);
|
|
55482
55516
|
});
|
|
55483
55517
|
}
|
|
55484
55518
|
if (request.kind === "source_purge")
|
|
@@ -55593,7 +55627,7 @@ async function dbIdentity(dbPath2) {
|
|
|
55593
55627
|
}
|
|
55594
55628
|
async function startDbOwnerWithRole(dbPath2, workerRole, options = {}) {
|
|
55595
55629
|
const identity = await dbIdentity(dbPath2);
|
|
55596
|
-
const key =
|
|
55630
|
+
const key = dbPath2;
|
|
55597
55631
|
const retiredClosure = retiredClientClosures.get(key);
|
|
55598
55632
|
if (retiredClosure !== undefined)
|
|
55599
55633
|
await retiredClosure;
|
|
@@ -55705,15 +55739,10 @@ async function dbOwnerQuery(statement, options) {
|
|
|
55705
55739
|
}
|
|
55706
55740
|
async function closeDbOwner(dbPath2) {
|
|
55707
55741
|
if (dbPath2 !== undefined) {
|
|
55708
|
-
const
|
|
55709
|
-
|
|
55710
|
-
|
|
55711
|
-
|
|
55712
|
-
return [];
|
|
55713
|
-
clients.delete(key);
|
|
55714
|
-
return [entry];
|
|
55715
|
-
});
|
|
55716
|
-
await Promise.all(entries2.map((entry) => entry.owner.close()));
|
|
55742
|
+
const entry = clients.get(dbPath2);
|
|
55743
|
+
clients.delete(dbPath2);
|
|
55744
|
+
if (entry)
|
|
55745
|
+
await entry.owner.close();
|
|
55717
55746
|
return;
|
|
55718
55747
|
}
|
|
55719
55748
|
const entries = [...clients.values()];
|