# VIC Data Infrastructure Consolidation

**Status: COMPLETE** (2026-03-13)

**Goal:** Eliminate VIC-specific data silos by promoting shared infrastructure and removing duplicates.

**Architecture:** Three changes: (1) Move prices/ from VIC-specific to shared finance/lib/prices/, (2) Delete thesis_text.db and point consumers at vic.db, (3) Re-key returns cache from idea_id to (symbol, date, price_type) for cross-strategy reuse.

---

## Task 1: Promote prices/ to finance/lib/prices/ — DONE

Moved `finance/vic_analysis/prices/` to `finance/lib/prices/`, updated all imports (no shims). Data files (crosslist.db, symbol_equiv.db) moved to `finance/lib/prices/data/`. 19 tests pass.

## Task 2: Delete thesis_text.db, point consumers at vic.db — DONE

Updated predict_embeddings.py, predict_combined.py, predict_robust.py to read from vic.db `ideas` table. thesis_text.db trashed.

## Task 3: Re-key returns cache to (symbol, date, price_type) — DONE

Created `finance/lib/returns_cache.py` with `ReturnsCache` class keyed by `(symbol, as_of_date, price_type, benchmark, horizons)`. Migrated 2238 OK entries. Updated all 8 consumers. VIC metadata joined at read time via `load_vic_returns()`.

### Follow-up: PriceStore (2026-03-10)

Built `finance/lib/prices/store.py` — SQLite-backed daily OHLCV store replacing opaque diskcache blobs. Migrated 9.8M rows (4587 symbols). Old diskcache retained as API dedup layer (also used by other projects).

### Follow-up: PriceStore fixes (2026-03-13)

Fixed 6 issues: UTC epoch computation, density-based completeness check, dropped redundant index (~100MB), partial data merge, horizons kwarg in verify, removed dead sync wrapper.
