From 4f2f113cdaf8bd9db999c3370c718c4c3618aa2b Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Sun, 12 Apr 2026 04:15:00 -0700 Subject: [PATCH] phase 17: fix text[]/varchar[] type mismatch in coverage-gaps SQL --- .kiro/specs/stonks-oracle/tasks.md | 8 ++++---- services/api/app.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.kiro/specs/stonks-oracle/tasks.md b/.kiro/specs/stonks-oracle/tasks.md index 60226d8..f052638 100644 --- a/.kiro/specs/stonks-oracle/tasks.md +++ b/.kiro/specs/stonks-oracle/tasks.md @@ -174,7 +174,7 @@ ## Phase 17 - First Vertical Slice: Live Pipeline End-to-End -- [-] 17. Activate the full data pipeline for a set of tracked symbols +- [x] 17. Activate the full data pipeline for a set of tracked symbols - [x] 17.1 Seed initial symbols and configure sources via the dashboard - Use the dashboard Companies page to add 5-10 symbols (e.g. AAPL, MSFT, GOOGL, AMZN, TSLA, NVDA, META, JPM, V, UNH) - For each company, add sources via the Company Detail → Sources tab: one `market_api` source (Polygon), one `news_api` source, one `filings_api` source @@ -216,7 +216,7 @@ - Check the dashboard Trends page shows trend cards with real data - _Requirements: 7.1, 7.2, 7.3_ -- [-] 17.6 Validate recommendation engine produces paper-trade recommendations +- [x] 17.6 Validate recommendation engine produces paper-trade recommendations - Check recommendation worker logs for recommendation generation - Verify `recommendations` table has entries with action, confidence, thesis - Verify `recommendation_evidence` links recommendations to documents @@ -224,14 +224,14 @@ - Check the dashboard Recommendations page shows real recommendations - _Requirements: 8.1, 8.2, 8.3_ -- [ ] 17.7 Validate lake publisher writes analytical facts to MinIO/Trino +- [x] 17.7 Validate lake publisher writes analytical facts to MinIO/Trino - Check lake-publisher worker logs for Parquet writes - Verify MinIO `stonks-lakehouse` bucket has partitioned Parquet files - Verify Trino can query the lakehouse tables via the SQL Explorer page - Test a sample query: `SELECT * FROM lakehouse.stonks.documents LIMIT 10` - _Requirements: 10.1, 10.2, 10.3_ -- [ ] 17.8 Validate dashboard shows live data across all pages +- [x] 17.8 Validate dashboard shows live data across all pages - Verify Home page shows non-zero metrics (active companies, documents, recommendations) - Verify Companies page lists seeded companies with source counts - Verify Documents page shows ingested documents with parse quality badges diff --git a/services/api/app.py b/services/api/app.py index 888e1d2..4d145d4 100644 --- a/services/api/app.py +++ b/services/api/app.py @@ -1479,8 +1479,8 @@ async def get_source_coverage_gaps(): LEFT JOIN sources s ON s.company_id = c.id AND s.active = TRUE WHERE c.active = TRUE GROUP BY c.id, c.ticker, c.legal_name, c.sector - HAVING NOT ARRAY['market_api', 'news_api', 'filings_api'] <@ ARRAY_AGG(DISTINCT s.source_type) FILTER (WHERE s.active) - OR ARRAY_AGG(DISTINCT s.source_type) FILTER (WHERE s.active) IS NULL + HAVING NOT ARRAY['market_api', 'news_api', 'filings_api']::text[] <@ ARRAY_AGG(DISTINCT s.source_type::text) FILTER (WHERE s.active) + OR ARRAY_AGG(DISTINCT s.source_type::text) FILTER (WHERE s.active) IS NULL ORDER BY c.ticker""", )