gabriel / musehub public
refactor patch task/orm-repo-card-enrichment #2 / 2
AI Agent gabriel · 26 days ago · May 14, 2026 · Diff

refactor: replace raw SQL in repo_card_enrichment with ORM queries

All five enrichment queries converted from sa.text() to SQLAlchemy ORM: - Pulse (daily commits): join through MusehubCommitRef instead of filtering by musehub_commits.repo_id (which no longer exists) - Autonomy (agent ratio): same ref-table join pattern with case() expression - Hottest symbol: row_number() window function replaces DISTINCT ON - Blast leader: same row_number() approach - Dead count + breakage: select() on MusehubIntelDead / MusehubIntelBreakageMeta

Fixes 500 Internal Server Error on /explore caused by raw SQL still referencing the removed musehub_commits.repo_id column.

sha256:ea0e6297f1c4979b9de1124c62814c163b3f922933f359bdd47def2b37ab1709 sha
sha256:9a07ff5820e5d73bcd330dfda7877bf7cbb64f58aaa2c62d31c8511fdf191e7c snapshot

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:ea0e6297f1c4979b9de1124c62814c163b3f922933f359bdd47def2b37ab1709 --body "your comment"