feat(HNT-2116): add the Redis-guarded article process step - #29
Draft
mmiermans wants to merge 1 commit into
Draft
Conversation
mmiermans
force-pushed
the
claude/hnt-2086-discovery-handler
branch
from
July 6, 2026 17:08
4b7a119 to
21f1545
Compare
mmiermans
force-pushed
the
claude/hnt-2086-process-article
branch
from
July 6, 2026 17:08
fca1ad9 to
90aca3b
Compare
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.
Goal
HNT-2116
Add
processArticle, the Redis-guarded step that turns a validatedcrawl-articlejob into at most one Zyte fetch and one publish to thearticlestopic. It skips a URL fetched within its refresh window, takes a per-article lock, re-checks freshness under the lock, and publishes only when the extracted content changed since the last fetch.This builds on the article extraction handler and worker helper layer, composing them with the crawl Redis keys, the
redis-stateandpubsubclients, worker config, and the domain types, and it adds thepubsubworkspace dependency to the worker. docs/ARCHITECTURE.md in #14 draws this flow.Implementation decisions
setTimestamp(fetchKey)runs inside the lock but ahead of extraction and publishing, where the tech spec writes it lastarticle:fetchafter acquiring the lockurlandextracted_atfrom the content hashcontentHashhashes only the meaningful content fields, noturlorextracted_aturlis constant per key andextracted_atchanges on every fetch, so including either would make the hash never match and republish the article every time.publishIfChangedpublishes when the hash differs, then always rewrites the hashfinallyfinallyand its rejection is caught and logged, not rethrownmessage.refresh_interval_minutes ?? config.articleFetchTtlMinutes