read.markets/app
Giorgio Gilestro 2f223b75a3 strip prompt-echo leakage in indicator summaries
DeepSeek occasionally regurgitates the system prompt verbatim
("Constraints: ≤60 words...", "Example good: ..."). Three-pronged fix:

1. Removed the inline good/bad example blocks from the per-group and
   aggregate system prompts — DeepSeek was treating them as templates
   to copy. The hard constraints alone are clear enough.

2. Expanded the LEAK_PATTERNS list to catch the prompt-label echoes
   that still occasionally slip through ("Key observations:", "The
   indicators are:", "Must cite ...", "Should give ...", bare "Key:").
   Cleanup now runs up to 6 passes for compound leakage.

3. Added looks_like_leakage() — if the cleaned output still contains
   tell-tale phrases ("≤60 words", "instructions:", etc.), the summary
   is skipped rather than persisted. Logs a 'leakage_detected' warning
   and an ai_calls row with status=leaked so we can see the failure
   rate over time. The previous good summary stays visible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 10:10:24 +01:00
..
jobs strip prompt-echo leakage in indicator summaries 2026-05-16 10:10:24 +01:00
routers add ECB Data Portal source; group-aware stale thresholds 2026-05-15 23:13:58 +01:00
services strip prompt-echo leakage in indicator summaries 2026-05-16 10:10:24 +01:00
static add Eurostat + UK ONS sources; valuation/bubble/economy/bonds groups; aggregate read; market-open header 2026-05-15 23:07:42 +01:00
templates add Eurostat + UK ONS sources; valuation/bubble/economy/bonds groups; aggregate read; market-open header 2026-05-15 23:07:42 +01:00
__init__.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
auth.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
config.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
db.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
logging.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
main.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
models.py add Eurostat + UK ONS sources; valuation/bubble/economy/bonds groups; aggregate read; market-open header 2026-05-15 23:07:42 +01:00
scheduler_main.py add Eurostat + UK ONS sources; valuation/bubble/economy/bonds groups; aggregate read; market-open header 2026-05-15 23:07:42 +01:00
schemas.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00
templates_env.py initial commit — cassandra v0.1 2026-05-15 21:56:10 +01:00