HiddenBag Pipeline Rework Prompt

technical

HiddenBag Pipeline Rework Prompt

Copy this into Claude Code from the hiddenbag-v2 directory:


I need to rework our entire betting picks pipeline. The goal: Discord server (1469086083701542956) becomes the SINGLE SOURCE OF TRUTH for all capper picks flowing into Supabase.

CURRENT STATE (research these files first):

  • Schema: FULL_MIGRATION.sql (hb_cappers, hb_picks, hb_discord_messages, hb_game_odds, hb_consensus_snapshots)
  • Consensus SQL: C:\Users\mpmmo\dailyai-picks-local\sql\supabase-consensus-v2.sql
  • Consensus spec: CONSENSUS-TRACKER-SPEC.md
  • Sheets sync: scripts/sheets-to-supabase.py
  • Routing config: C:\Users\mpmmo\FULL-LOCAL-PRODUCTION\routing_config.json
  • Capper list: cappersnames.txt (79 cappers)

DISCORD SERVER CHANNEL MAP (1469086083701542956 — "THB WORK SPLIT"):

VIP CAPPERS (36 channels):

ChannelChannel IDCapper
king-cap1469086490498961609King Cap
jacav1469086512950804520JaCav
fivestar1469086532114579518FiveStar
razzaq-locks1469086559960830063Razzaq Locks
cesarsportsbets1469086599139557495Cesar Sports Bets
parlaytravy1469086632962429081Parlay Travy
seanperrywins1469086664688271564Sean Perry Wins
yourdailycapper1469086685408137360Your Daily Capper
thecappercollective1469086720900206817The Capper Collective
isellwinners1469086744032055448I Sell Winners
vegasmirabets1469087866310365396Vegas Mira Bets
chamba1469087879031685253Chamba
vinny1469087893338456176Vinny
laformula1469087914502787153La Formula
jaylink1469087930357383412JayLink
vonn1469087943447543939Vonn
anon1469087950271680737Anon
thesportbetking1469087974107910257The Sport Bet King
leeschosenpicks1469088038859702499Lees Chosen Picks
uatb1469088054919696425UATB
monumnetal1469088089812238487Monumental
mrexclusive1469088109718143218Mr Exclusive
ampm1469088123714670654AMPM
afsports1469088149513961617AF Sports
kleos1469088159110529024Kleos
fernpicks1469088174423806135Fern Picks
fredo1469088215657877606Fredo
trustmysystem1469088241515892776Trust My System
cblez1469088260130209989CBLez
beezowins1469088289188479140Beezo Wins
algopicks1469088306317758576Algo Picks
tbsportsbetting1469088333874335941TB Sports Betting
nickycashin1469088346373361823Nicky Cashin
vezinolocks1469088375096086535Vezino Locks
provenwinner1469088388245229661Proven Winner
bonus-vip1469088404104020079BONUS VIP (multi-capper)

free cappers (41 channels):

ChannelChannel IDCapper
a111469426329006116895A11 Bets
anderspicks1469426369409585172Anders Picks
analyticscapper1469426392600023111Analytics Capper
brandontheprofit1469426442734665909Brandon The Profit
betsharper1469426463399739547Bet Sharper
bulliespicks1469426476154622096Bullies Picks
calebpicks1469426490318917828Caleb Picks
cashcing1469426512490004718Cash Cing
cashitbaby1469426532257890496Cash It Baby
duckinvestments1469426564260171887Duck Investments
platinumlocks1469426592437637141Platinum Locks
profiticscports1469426624662343751Profitics Sports
smartmoneysports1469426644577157396Smart Money Sports
sharpinvestments1469426666618097859Sharp Investments
pickprophet1469426697328918784Pick Prophet
hammering-hank1469437872347287722Hammering Hank
pardonmypick1469437894358859979Pardon My Pick
porterpicks1469437922137870367Porter Picks
kimspicks1469437942316535849Kims Picks
seekingreturns1469437955713270103Seeking Returns
thesharpsheets1469437977099895048The Sharp Sheets
ncsharp1469437991318454487NC Sharp
picks4days1469438005839266057Picks 4 Days
mathewp071469438035673481286Mathew P07
mcbets1469438052219748574MC Bets
learlocks1469438071152967782Lear Locks
propjoe1469438090291449907Prop Joe
darthfader1469438110302732471Darth Fader
outoflinebets1469438139641757766Out Of Line Bets
parlaysafari1469438154246197248Parlay Safari
ttw1469438194905907472TTW
a1fantasy1469438231488626698A1 Fantasy
setpointbets1469438251159912479Set Point Bets
newmarktennis1469438354490917127Newmark Tennis
matchpointbets1469438384819933218Match Point Bets
bonusfree1469438421058453659BONUS FREE (multi-capper)
cody-covers-spreads1469721592631267592Cody Covers Spreads
midwest-mike1469721730577596616Midwest Mike
sensisam1469721866443690055Sensei Sam
itstroywest1469722044894675140Its Troy West
qsportsai1469722141766455480Q Sports AI

KNOWN MULTI-CAPPER CHANNELS (require author parsing):

  • bonus-vip (1469088404104020079) — VIP bundle, multiple cappers post here
  • bonusfree (1469438421058453659) — Free bundle, multiple cappers post here
  • thecappercollective (1469086720900206817) — Collective channel

KNOWN CAPPER ALIASES (same person, different names):

Canonical NameKnown Aliases
Monumentalmonumnetal, monumental
JayLinkjaylink, jaylan1k
Vegas Mira Betsvegasmirabets, vegasmirabet
A11 Betsa11, a11bets
Sensei Samsensisam, senseisam
Picks 4 Dayspicks4days, picks4dayzzz
Mathew P07mathewp07, matthewp07
Profitics Sportsprofiticscports, profiticsports
Midwest Mikemidwest-mike, midwestmike
Cody Covers Spreadscody-covers-spreads, codycoverspreads
Hammering Hankhammering-hank, hammeringhank
Bonus Freebonusfree, bonus-free

NEW ARCHITECTURE:

Data Sources (Priority Order):

  1. Discord Bot listening to server 1469086083701542956 — every channel, every message
  2. Google Sheets (existing AllPicks/Picks tabs) for sources not in Discord
  3. Both feed into the SAME Supabase tables

New/Modified Tables Needed:

hb_discord_channels (NEW — track every channel):

  • channel_id, channel_name, server_id
  • source_type: 'single_capper' | 'multi_capper' | 'algo' | 'aggregate'
  • default_capper_id (for single-capper channels)
  • is_active, created_at

hb_raw_messages (NEW — store EVERYTHING before parsing):

  • message_id, channel_id, author_name, content, attachments_json
  • source: 'discord' | 'sheets' | 'telegram'
  • parsed_status: 'pending' | 'parsed' | 'failed' | 'skipped'
  • parsed_at, error_message
  • This is our audit trail — never delete raw data

hb_cappers (MODIFY):

  • Add: discord_channel_id, aliases TEXT[] (array of known name variations)
  • Add: source_priority ('discord' | 'sheets' | 'telegram')
  • Add: auto_detected BOOLEAN (for new cappers found by parser)

hb_picks (MODIFY):

  • Add: source_message_id (FK to hb_raw_messages)
  • Add: source_type ('discord' | 'sheets' | 'telegram')
  • Add: confidence_score (0-100, how sure parser is about the parse)
  • Add: parse_method ('regex' | 'vision' | 'manual' | 'sheets_import')

hb_capper_aliases (NEW — solve the fragmentation problem):

  • alias_text, canonical_capper_id
  • This replaces the current broken duplicate-name system

Multi-Capper Channel Splitting:

Some Discord channels contain picks from MULTIPLE cappers. The bot needs to:

  1. Check if channel is 'multi_capper' type
  2. Parse author name / embedded capper name from message content
  3. Match to hb_capper_aliases → resolve to canonical capper
  4. If no match, flag as 'new_capper_detected' for review

Pipeline Flow:

Discord Message → hb_raw_messages (store raw) → Parser (regex + vision for images) → hb_picks (normalized, linked to capper) → Consensus SQL (find 2+ cappers on same side) → hb_consensus_snapshots → Auto-grading (scores from hb_game_odds)

CSV Export for Validation:

  • Script to dump hb_picks to CSV with: date, capper, sport, team, line, odds, units, result, source, confidence
  • Script to dump consensus plays to CSV
  • Use these to verify data quality before trusting the pipeline

What I need you to build:

  1. SQL migration for all new/modified tables above
  2. Discord bot listener (Node.js, discord.js) that captures every message from the server
  3. Parser module that extracts picks from messages (handle text + image attachments)
  4. Alias resolution system for capper name matching
  5. CSV export scripts for validation
  6. Migration script to backfill existing hb_picks with source info
  7. Dashboard page or API endpoint showing: messages collected, parse rate, unmatched cappers, confidence distribution

SEED DATA — Pre-populate hb_discord_channels with the channel map above on first run.

SEED DATA — Pre-populate hb_capper_aliases with the known aliases table above.