feat: add topic dedup check to ingest cron#619
Merged
codercatdev merged 1 commit intodevfrom Mar 5, 2026
Merged
Conversation
- Add isTopicAlreadyCovered() with GROQ title match + topic overlap - Add isSlugTaken() for slug collision detection - Walk ranked trends list, skip already-covered topics - Add dedupWindowDays field to contentConfig (default 90, 0 to disable) - Pass single selectedTrend to buildPrompt and createSanityDocuments - Graceful degradation: dedup failures don't block pipeline
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
codercatdev
added a commit
that referenced
this pull request
Mar 5, 2026
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.
Summary
Before creating a new
contentIdea, the ingest cron now walks the ranked trends list and skips any topic that's already been covered. This prevents duplicate content from being generated day after day for the same hot topic.Spec: Content Idea Dedup (
RD0ib2Hx)Task:
00nBkb6eChanges
app/api/cron/ingest/route.tsextractSearchTerms(title)— Extracts 2-3 meaningful keywords from a topic title, stripping ~100 common stop wordsisTopicAlreadyCovered(topic, topics)— Queries Sanity for existingcontentIdea+automatedVideodocs within the configurable dedup window:matchoperator for title prefix matching with wildcard patternsdedupWindowDaysfrom contentConfig (default 90 days, 0 to disable)isSlugTaken(slug)— Checks for existingautomatedVideowith the same slug to prevent URL collisions{ success: true, skipped: true }if ALL topics are already coveredskippedCountin response JSONbuildPrompt([selectedTrend])— Now passes only the single selected trend (not the full array)createSanityDocuments— Signature changed fromtrends: TrendResult[]toselectedTrend: TrendResultsanity/schemas/singletons/contentConfig.tsdedupWindowDaysfield (number, default 90, validation 0-365)Files changed (2 only)
app/api/cron/ingest/route.tssanity/schemas/singletons/contentConfig.ts