feat: add revalidate logic and the new SEAL_RUN_SUMMARY notification type - #1837
Merged
Merged
Conversation
davidgamez
marked this pull request as ready for review
September 14, 2026 19:43
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:
Closes #1823. The Feed Detail page is cached for 14 days or until something calls
/api/revalidate, and only dataset events did. The seal changes nightly without anydataset moving, so the page could show a stale seal for a fortnight.
The nightly run now compares each feed's rendered seal state —
has_seal, plus eachcriterion's status, grace and probation — against the pre-run
seal_criterionrows, andrevalidates only the feeds that actually moved. Timestamps (
evaluated_at,earned_at,probation_ends_at, ...) are excluded: they move on every feed every night and the pagenever shows them.
Revalidations are now batched (~50 feeds per request, using the endpoint's existing
feedIdsarray) instead of one Cloud Task per feed, so a catalogue-wide night is ~58tasks rather than ~2900 against a 1/sec queue.
Also adds an
admin.event_summary / seal_run_summarynotification reporting each run'schanges to admin subscribers. No schema, API or Terraform changes.
New email notification:

Expected behavior:
A run that only advances timestamps revalidates nothing. A run where a seal or criterion
changes revalidates exactly those feeds. Admin subscribers get a seal summary the same
morning (seal runs 04:00 UTC, dispatcher 08:00 UTC).
Testing tips:
Run
update_seal_of_reliabilitytwice unchanged — the second reportsfeeds_changed: 0even though
evaluated_atmoved. Then flip a criterion and re-run with"revalidate": trueto see the feed inchanged_stable_ids.Note: this is the first caller to send more than one id to
/api/revalidate. Worth asanity check from @Alessandro100 that the endpoint handles a ~50-id list; if not,
WEB_REVALIDATION_CHUNK_SIZE = 1restores per-feed behaviour without dropping anything.Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything