fix(blog): re-check lookback window after resolving publish date - #72
Open
mashagua wants to merge 1 commit into
Open
fix(blog): re-check lookback window after resolving publish date#72mashagua wants to merge 1 commit into
mashagua wants to merge 1 commit into
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
feed-blogs.json declares
lookbackHours: 72but 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
parseClaudeBlogIndexhardcodespublishedAt: null, so the Step-2 filterif (article.publishedAt && new Date(article.publishedAt) < cutoff)short-circuits and never rejects anything. The real date is only resolved later, from JSON-LD inextractClaudeBlogArticleContent, and is written straight into the output without being re-validated. The same failure mode affectsparseAnthropicEngineeringIndexwhenever 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