← Blog Home

News & Sentiment

#7 Fixing the News Page When AI Analysis Was Stuck at 0 AI Analyzed

· Build Log

A debugging story of empty analysis states, cache traps, and serve-path sanitation.

0 AI analyzednews cache bugserve-time sanitation

1) TL;DR

2) What I Tried

I expanded ingestion and ranking but relied on brittle parse assumptions.

3) What Broke

Users saw zero analyzed cards or weak card details during active sessions.

4) Root Cause

Cache objects with incomplete normalized fields were treated as final analysis states.

5) Before (Code Path)

news path - cached item could miss summary/reason - renderer classified missing keys as non-analyzed

6) After (Code Path)

news path + sanitize cached summary/reason at read and write + stronger stale detection + fallback score extraction for partial model output

7) Evidence (Git History)

8) What I Learned

Cache validity checks must run at serve-time, not only at write-time.

9) Frequently Asked Questions

Why did this persist across refreshes?

Because invalid cache objects were still considered valid output.

What fixed it permanently?

Schema sanitation plus stale-state detection and fallback parsing.

What user signal improved most?

The analyzed-count and card consistency on reload.