feat(HNT-2086): read scheduled live articles from the Corpus API - #23
Draft
mmiermans wants to merge 1 commit into
Draft
feat(HNT-2086): read scheduled live articles from the Corpus API#23mmiermans wants to merge 1 commit into
mmiermans wants to merge 1 commit into
Conversation
mmiermans
force-pushed
the
claude/hnt-2086-common-utils
branch
from
July 6, 2026 17:08
baaa374 to
31dc989
Compare
mmiermans
force-pushed
the
claude/hnt-2086-corpus-section-items
branch
from
July 6, 2026 17:08
2ce2154 to
a212372
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-2086
Let the crawl agent source curated live articles from the Corpus Admin API instead of a hardcoded list.
getScheduledSectionItemsreads a surface's currently scheduled section items and returns them asLiveArticlevalues, mapping the camelCase Corpus shape to the snake_casecorpus_itemthe agent expects.This builds on the domain-types slice by importing its
CorpusItemandLiveArticletypes. See the agent flow in docs/ARCHITECTURE.md under review as #14.Implementation decisions
graphqlRequesthelperupdateApprovedCorpusItemand the newgetScheduledSectionItemscall through one function for JWT auth, retry, transient 5xx and network backoff, and error handlinggetSectionsWithSectionItemsis fetched with the admin JWT, then non-LIVE sections are filtered out before flattening their itemsservers/curated-corpus-api/src/database/queries/Section.tsdocuments this: the public context returns only LIVE sections while the admin context returns all active enabled and disabled ones. The LIVE-only filter therefore has to live in the client. This sections query is chosen over the date-basedgetScheduledCorpusItemsbecause it matches the legacy HydrateSectionItems semantics, returns the full item includinglanguageso non-EN surfaces are not defaulted, and reuses the same curator JWT group the write path already holds so the read needs no new credential.authorsmaps to an empty array rather than throwingvalidateLiveArticlecan drop a malformed item, so an unguarded throw here would crash-loop the agent at startup. The validation layer, not the mapper, is where a bad item is rejected.