feat(build): add content freshness detection warnings#187
Open
s1ddh-rth wants to merge 1 commit intoandrewyng:mainfrom
Open
feat(build): add content freshness detection warnings#187s1ddh-rth wants to merge 1 commit intoandrewyng:mainfrom
s1ddh-rth wants to merge 1 commit intoandrewyng:mainfrom
Conversation
Stop silently defaulting missing updated-on to today's date. Instead, emit an actionable warning and set lastUpdated to null in the registry. Add a staleness summary that counts entries not updated in 180+ days, shown as an info line in human output and a stale field in JSON output. Both validate-only and full build paths report consistently. Closes andrewyng#186 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Stop silently defaulting missing
updated-onto today's date. Instead,emit an actionable warning and set
lastUpdatedtonullin the registry.Add a staleness summary that counts entries not updated in 180+ days,
shown as an info line in human output and a
stalefield in JSON output.Both validate-only and full build paths report consistently.
Closes #186
What
Two non-breaking additions to
chub build:metadata.updated-onnow emits a warning with a suggested fix instead of silently defaulting to today's dateWhy
Context Hub's value depends on content being current. Currently, missing
updated-onis silently backfilled with today's date, masking the problem. There's also no visibility into how many entries in the registry are going stale. This change surfaces both issues as non-blocking warnings so contributors and maintainers can act on them.Related: #106, #107
Testing
npm testpasses (231/231)chub build content/ --validate-onlysucceedsupdated-onemits actionable warning with suggested date--jsonoutput includesstalefieldNotes
cli/src/commands/build.jslastUpdatedis set tonull(not"unknown") when missing — cleaner for JSON consumersSetto deduplicate by doc ID so multi-language/version docs aren't double-counted