
    F`i                         d Z dZdedefdZedk(  r]ddlZ ed      5 Z ej                  e      Z
ddd       e
d	   d   Z ee      Z eedd
         ed        ed ee       d       yy# 1 sw Y   @xY w)a  
Prompt B: Curiosity Mining (Clustered Data)

This prompt receives the SAME clustered data as the baseline, but is redesigned to:
1. Mine for specific "wait, what?" moments in the raw posts
2. Look for counterintuitive facts, surprising numbers, unexpected connections
3. Avoid abstracting into generic themes - preserve the specific hooks
4. Evaluate based on "would I click this?" not "is this a valid topic area?"
u  You are a viral content researcher. Your job is to find the ONE specific, surprising detail in this data that would make someone stop scrolling.

I don't want a theme analysis. I don't want "people are confused about X." I want you to identify the SINGLE MOST CLICKABLE HOOK hiding in this cluster of Reddit posts.

## THE DATA

{titles_text}

## RAW REDDIT POSTS (READ THESE CAREFULLY - THE GOLD IS HERE)

{reddit_text}

## WHAT MAKES A GREAT HOOK

The difference between mediocre and viral:

MEDIOCRE: "How to invest your money wisely"
VIRAL: "I put $50k in a 'managed fund' in 2021. It's now $55k. The S&P would have made me $75k."

MEDIOCRE: "The psychology of memory"
VIRAL: "58% of people remember the Monopoly Man having a monocle. He never had one."

MEDIOCRE: "Why people stay in bad relationships"
VIRAL: "Why therapists call it 'the hostage stage' — and why leaving triggers it"

The viral hooks share these traits:
1. SPECIFIC: A number, a name, a concrete detail
2. COUNTERINTUITIVE: Challenges what you thought you knew
3. EMOTIONALLY CHARGED: Makes you feel something (outrage, curiosity, recognition)
4. INCOMPLETE: Creates an open loop that needs closing

## YOUR TASK

Scan EVERY Reddit post in this cluster. Look for:
- Surprising numbers or statistics mentioned
- Counterintuitive outcomes people are sharing
- Specific stories that reveal a larger pattern
- "Wait, that doesn't make sense" moments
- Unexpected confessions or realizations

Then identify the SINGLE BEST HOOK.

## RESPOND IN JSON:

{{
  "hook_discovery": {{
    "source_post": "The Reddit post title that contains the hook",
    "the_raw_detail": "The specific surprising detail from that post (quote if possible)",
    "why_this_hooks": "In 1-2 sentences, why would someone stop scrolling for this?",
    "the_open_loop": "What question does this create that viewers NEED answered?"
  }},

  "video_angle": {{
    "title": "A specific, clickable title (not generic, uses the hook)",
    "first_five_seconds": "The exact words you'd say to open the video",
    "the_revelation": "What surprising truth will viewers learn?",
    "emotional_payoff": "How will viewers FEEL after watching? (must be: validated, empowered, smarter, relieved, or amused)"
  }},

  "hookability_score": {{
    "specificity": "1-5: Does the hook contain a specific detail (number, name, concrete fact)?",
    "counterintuitiveness": "1-5: How much does this challenge common assumptions?",
    "emotional_charge": "1-5: Does this make you feel something?",
    "open_loop_strength": "1-5: How badly do you need this question answered?",
    "overall": "Average of above, 1 decimal place"
  }},

  "verdict": "MAKE_NOW / WORTH_MAKING / NEEDS_RESEARCH / SKIP",
  "verdict_reasoning": "One sentence: why this verdict?"
}}

CRITICAL: If the data is full of generic questions with no specific surprising details, say so. Don't invent hooks that aren't there. Verdict should be SKIP if there's no genuine hook in the data.

Respond in JSON only. No markdown code blocks.cluster_datareturnc           
         | j                  dg       D cg c]$  }|j                  d|j                  dd            & }}dj                  |dd D cg c]  }d| 	 c}      }g }t        | j                  d	g       dd
       D ]  \  }}|j                  dd      }|j                  dd      }|j                  dd      }	|j                  dd      }
|j                  d|dz    d|	 d|
 d       |j                  d|        |r|j                  d|dd         |j                  d        |rdj                  |      nd}t        j                  ||      S c c}w c c}w )z"Format Prompt B with cluster data.topics
topic_nametitle 
N   z- 	raw_posts   selftext	subredditnum_comments    z

### Post    z: r/z (z
 comments)z**Title:** z**Content:** i   z No Reddit posts in this cluster.)titles_textreddit_text)getjoin	enumerateappendPROMPT_Bformat)r   ttitlesr   reddit_linesipostr   r   r   r   r   s               K/home/sietch6/trending-topics-pipeline/sandbox/prompt_b_curiosity_mining.pyformat_prompt_br    W   sy    @L?O?OPXZ\?]^!aeeL!%%"45^F^))vcr{;!r!X;<K L\--k2>sCD  4"%88J+HH["-	xx2k!A#d9+R~ZXYk%12-#/? @AB  .:$))L)?aK??   ) _;s   )EE"__main__r   Nztest_clusters.jsonclustersi  z...z
Total prompt length: z chars)__doc__r   dictstrr    __name__jsonopenfloaddataclusterpromptprintlen     r   <module>r2      s   I2X$ 3 : z	"	# qtyy| :q!GW%F	&$-	%L	#CK=
78  s   A00A9