diff --git a/api/sitrep_generator.py b/api/sitrep_generator.py index 844559d..cd8471e 100644 --- a/api/sitrep_generator.py +++ b/api/sitrep_generator.py @@ -199,7 +199,8 @@ def build_ai_prompt(all_stories, crypto): lines.append(f'\n--- {src_name.upper()} ---') for i, s in enumerate(sources[src_name][:25], 1): score_str = f" [score:{s.get('score', '?')}]" if s.get('score') else '' - lines.append(f"{i}. {s['title']}{score_str}") + url_str = f"\n Link: {s['url']}" if s.get('url') else '' + lines.append(f"{i}. {s['title']}{score_str}{url_str}") if s.get('summary'): lines.append(f" Summary: {s['summary'][:150]}") @@ -207,7 +208,8 @@ def build_ai_prompt(all_stories, crypto): if 'r/netsec' in sources: lines.append('--- R/NETSEC ---') for i, s in enumerate(sources['r/netsec'][:15], 1): - lines.append(f"{i}. {s['title']}") + url_str = f"\n Link: {s['url']}" if s.get('url') else '' + lines.append(f"{i}. {s['title']}{url_str}") if s.get('summary'): lines.append(f" Summary: {s['summary'][:150]}") @@ -226,6 +228,8 @@ def build_ai_prompt(all_stories, crypto): lines.append('\n--- SECURITY-RELATED FROM OTHER FEEDS ---') for i, s in enumerate(sec_stories[:10], 1): lines.append(f"{i}. [{s['source']}] {s['title']}") + if s.get('url'): + lines.append(f" Link: {s['url']}") lines.append('\n=== CRYPTO MARKET DATA ===') for ticker, data in crypto.items(): @@ -254,13 +258,13 @@ Format the SITREP in markdown with the following EXACT structure: ## SECTOR ALPHA — TECHNOLOGY -Summarise the top 8-10 most significant technology stories. Group loosely by theme (AI/ML, infrastructure, programming languages, open source, industry moves). Each item should be 1-2 sentences max. Use bullet points. Prioritise stories by significance and novelty. +Summarise the top 8-10 most significant technology stories. Group loosely by theme (AI/ML, infrastructure, programming languages, open source, industry moves). Each item should be 1-2 sentences max. Use bullet points. Prioritise stories by significance and novelty. After each bullet point, on a new line add a small source link in this exact format: ` *[source — read more](URL)*` using the Link URL provided in the raw data. --- ## SECTOR BRAVO — CYBERSECURITY -Summarise any cybersecurity-related stories. Include CVEs, breaches, new tools, threat intel. If few dedicated security stories, note the relatively quiet SIGINT environment. 4-8 items. +Summarise any cybersecurity-related stories. Include CVEs, breaches, new tools, threat intel. If few dedicated security stories, note the relatively quiet SIGINT environment. 4-8 items. After each bullet point, on a new line add a small source link in this exact format: ` *[source — read more](URL)*` using the Link URL provided in the raw data. --- @@ -285,7 +289,9 @@ Rules: - If data is sparse for a sector, acknowledge it briefly - Use markdown formatting (headers, bold, bullets, horizontal rules) - Include the exact crypto prices provided — do not round them differently -- For each tech story, mention the source in brackets like [HN] [Reddit] [Lobsters]""" +- For each tech/security story, mention the source in brackets like [HN] [Reddit] [Lobsters] +- CRITICAL: After EVERY bullet point story in SECTOR ALPHA and SECTOR BRAVO, include the original source link on a NEW indented line formatted exactly as: *[source — read more](URL)* +- Use the Link URLs provided in the raw intelligence data — NEVER invent or guess URLs""" def generate_with_venice(user_prompt):