fix: backfill recommendation evidence for existing recommendations

Migration 028: For each recommendation with no evidence rows, finds
the closest matching trend_window (by ticker + time_horizon + timestamp)
and re-inserts evidence from top_supporting/opposing_evidence arrays.
Filters out non-UUID pattern IDs and verifies documents exist.

This fixes 'No evidence linked' on recommendations created before the
UUID filtering fix in persist_recommendation.
This commit is contained in:
Celes Renata
2026-04-17 07:37:14 +00:00
parent 5efccb1e03
commit c5b7bddadb
2 changed files with 74 additions and 1 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ When a full reset is needed:
## Database Migrations
- Located in `infra/migrations/001_*.sql` through `027_*.sql`
- Applied automatically by `runmefirst.sh` in sorted order
- Next migration number: **028**
- Next migration number: **029**
- Key migrations:
- 016: Global news interpolation (global_events, macro_impact_records, exposure_profiles, trend_projections)
- 017: Competitive intelligence (competitor_relationships, competitive_signal_records)