File tree Expand file tree Collapse file tree
src/memory/retrieval/store/migrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,6 +292,12 @@ const V2_TABLES: TableSpec[] = [
292292 primaryKey : [ 'brain_id' , 'trace_id' ] ,
293293 // Migration: copy existing agent_id column into brain_id (legacy archive
294294 // already discriminated by agent_id, which is semantically the same).
295+ //
296+ // CAVEAT: if the caller passes an explicit brainId override that differs
297+ // from the original agent_id, archived_traces row brain_ids stay at the
298+ // original agent_id values (not the override). Live tables receive the
299+ // override; only archived_traces inherits agent_id. To rebrand archives,
300+ // run a separate UPDATE statement after migration.
295301 brainIdSourceColumn : 'agent_id' ,
296302 indexes : [
297303 `CREATE INDEX IF NOT EXISTS idx_archived_traces_brain_time
You can’t perform that action at this time.
0 commit comments