Problem
The vector cache registry has no "edge" entry after Phase 8 migration, causing every switch-back to edge tier to require a full re-embedding even if edge vectors were previously computed.
Root Cause
migrate_legacy_vec_tables() (vector_search.py:895-976) only registers the CURRENT tier group:
group = _active_tier_group() # Returns whatever tier is active NOW
# Only creates a cache entry for THIS one group
conn.execute("INSERT OR REPLACE INTO vector_cache_registry ...", (group, ...))
If the user was on "base" or "pro" when the Phase 8 migration ran (commit ebe36ac), only the "basepro" group gets a cache entry. The "edge" group has NO entry.
Impact
When switching TO edge:
resolve_rebuild_action() calls VectorCacheRegistry.get(conn, "edge")
- Returns
None (no entry exists)
- Returns
"full_rebuild" -- even if edge vectors existed before the upgrade
Combined with Bug #2 (last_embedded_id=0), this means:
- Every tier switch in every direction always requires full rebuild
- The delta-rebuild optimization (only embed new messages since last switch) is dead code
- "Instant switch-back" feature documented in cache.py docstring never works
Expected Behavior
After any tier switch or migration, BOTH tier groups should have registry entries so that:
- Switching Base->Edge uses cached edge vectors + only embeds delta
- Switching Edge->Base uses cached basepro vectors + only embeds delta
Fix Options
- During migration: register both groups (current group with real data, other group with vector_count=0 and last_embedded_id=0)
- During
_finalize_rebuild: ensure the completed group gets properly registered (see related issue about last_embedded_id=0)
- In
resolve_rebuild_action: before returning "full_rebuild", check if the vec table actually exists with data (SELECT COUNT)
Files
truememory/vector_search.py line 913 (migration only registers current group)
truememory/tier_switch/cache.py lines 148-158 (resolve_rebuild_action logic)
- Commit: ebe36ac (Phase 8 migration)
Problem
The vector cache registry has no "edge" entry after Phase 8 migration, causing every switch-back to edge tier to require a full re-embedding even if edge vectors were previously computed.
Root Cause
migrate_legacy_vec_tables()(vector_search.py:895-976) only registers the CURRENT tier group:If the user was on "base" or "pro" when the Phase 8 migration ran (commit ebe36ac), only the "basepro" group gets a cache entry. The "edge" group has NO entry.
Impact
When switching TO edge:
resolve_rebuild_action()callsVectorCacheRegistry.get(conn, "edge")None(no entry exists)"full_rebuild"-- even if edge vectors existed before the upgradeCombined with Bug #2 (
last_embedded_id=0), this means:Expected Behavior
After any tier switch or migration, BOTH tier groups should have registry entries so that:
Fix Options
_finalize_rebuild: ensure the completed group gets properly registered (see related issue about last_embedded_id=0)resolve_rebuild_action: before returning "full_rebuild", check if the vec table actually exists with data (SELECT COUNT)Files
truememory/vector_search.pyline 913 (migration only registers current group)truememory/tier_switch/cache.pylines 148-158 (resolve_rebuild_actionlogic)