Skip to content

fix(blog): re-check lookback window after resolving publish date - #72

Open
mashagua wants to merge 1 commit into
zarazhangrui:mainfrom
mashagua:fix/blog-lookback-after-date-resolution
Open

fix(blog): re-check lookback window after resolving publish date#72
mashagua wants to merge 1 commit into
zarazhangrui:mainfrom
mashagua:fix/blog-lookback-after-date-resolution

Conversation

@mashagua

@mashagua mashagua commented Aug 8, 2026

Copy link
Copy Markdown

Problem

feed-blogs.json declares lookbackHours: 72 but shipped an article dated Jun 08, 2026 — roughly 60 days outside the window. Downstream consumers trust that declaration and present the item as current.

Root cause

parseClaudeBlogIndex hardcodes publishedAt: null, so the Step-2 filter if (article.publishedAt && new Date(article.publishedAt) < cutoff) short-circuits and never rejects anything. The real date is only resolved later, from JSON-LD in extractClaudeBlogArticleContent, and is written straight into the output without being re-validated. The same failure mode affects parseAnthropicEngineeringIndex whenever it falls back to regex parsing.

The existing fallback heuristic — "articles without dates are accepted if they appear near the top of the listing" — doesn't hold on claude.com/blog, a Webflow page where the link regex scans raw HTML in DOM order rather than publish order. Combined with MAX_INDEX_SCAN = 3, a pinned older post can also crowd out genuinely new ones.

Fix

Re-apply the same cutoff once the real date is known, just before results.push. Unparseable dates still pass through (fail-open, unchanged behaviour). Skipped articles are marked seen so they aren't refetched every run.


我在 2026-08-08 的 feed 里复现到了这条:https://claude.com/blog/claude-for-foundation-models,它实际上是2026-06-08

Problem: feed-blogs.json declares lookbackHours: 72 but shipped an article dated Jun 08, 2026 - roughly 60 days outside the window. Downstream consumers trust that declaration and present the item as current.

Root cause: parseClaudeBlogIndex hardcodes publishedAt: null, so the Step-2 filter if (article.publishedAt && new Date(article.publishedAt) < cutoff) short-circuits and never rejects anything. The real date is only resolved later, from JSON-LD in extractClaudeBlogArticleContent, and is written straight into the output without being re-validated. The same failure mode affects parseAnthropicEngineeringIndex whenever it falls back to regex parsing.

The existing fallback heuristic - "articles without dates are accepted if they appear near the top of the listing" - doesn't hold on claude.com/blog, a Webflow page where the link regex scans raw HTML in DOM order rather than publish order. Combined with MAX_INDEX_SCAN = 3, a pinned older post can also crowd out genuinely new ones.

Fix: re-apply the same cutoff once the real date is known, just before results.push. Unparseable dates still pass through (fail-open, unchanged behaviour). Skipped articles are marked seen so they aren't refetched every run.

Reproduced on 2026-08-08 feed: https://claude.com/blog/claude-for-foundation-models (actual date 2026-06-08)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant