Skip to content

crawl/sitemap-lastmod-churn: false-positive on every site with a Google News sitemap #115

Closed

Description

@nc9

crawl/sitemap-lastmod-churn warns on any site that publishes a Google News sitemap, which is the
correct thing for a publisher to have.

A Google News sitemap contains, by specification, only articles from roughly the last 48 hours. Its
lastmod values therefore always collapse onto 1–2 distinct days. The rule pools lastmod values
across every discovered sitemap and warns at <= 2 distinct days over >= 20 URLs, so a news sitemap
alone satisfies the accusation.

Reproduced on allrecipes.com (pre-release smoke for v0.0.86):

warn :: 38 sitemap URL(s) with lastmod collapse onto 2 distinct day(s): 2026-08-18, 2026-08-19

That is byte-for-byte the content of https://www.allrecipes.com/google-news-sitemap.xml: 38 URLs,
38 lastmods, 2 distinct days. The whole finding came from the news sitemap.

The site's real sitemap (/sitemap.xml → 4 children) contributed nothing, because those children
are bot-protected and return an HTML error page. So the pool was 100% news-sitemap URLs.

Two distinct defects, and the second is the one that generalises:

  1. News sitemaps must not count toward lastmod churn at all. They are a rolling 48-hour window by
    design. Any publisher with one gets accused of build-stamping their lastmod, and publishers are
    exactly the audience that cares about this field.
  2. The rule cannot tell a small pool from a representative one. It pools across sitemaps and never
    asks where the URLs came from, so a partial ingest (blocked children, a fetch failure, a cap) is
    indistinguishable from a real site-wide collapse. SitemapData already carries the sitemap's own
    url, so per-sitemap grouping is available today.

The rule's own tests pass, CI was green on the PR, and the golden corpus is byte-identical. Fixtures
encode the cases someone thought of; none of them was a news sitemap.

Acceptance Criteria

  • URLs from a Google News sitemap are excluded from the churn calculation, detected from the
    xmlns:news namespace declaration (not from the filename, which is convention rather than spec)
  • SitemapData carries whether the sitemap declared the news namespace, set during sitemap parsing
    in packages/crawler/src/sitemaps.ts, and the field is threaded through the core-contracts type
  • A site whose ONLY lastmod-carrying sitemap is a news sitemap produces a skipped check naming
    that reason, never a warn
  • The rule reports which sitemap(s) the offending lastmod values came from, so the finding is
    actionable rather than a bare count
  • Fixture: a news sitemap with 38 URLs across 2 days alongside a blocked/empty regular sitemap —
    skipped, not warned (this is the allrecipes.com shape)
  • Fixture: a regular sitemap with 40 URLs all stamped one day — still warns, message unchanged
  • Fixture: a news sitemap PLUS a regular sitemap with well-spread lastmod values — passes, and the
    news URLs are absent from the counted total
  • Existing sitemap-lastmod-churn tests still pass unchanged
  • packages/audit-engine/tests/streaming-rules-canonical-golden.test.ts still passes, or is updated
    with a comment naming this change as the cause if the fixture corpus contains a news sitemap
  • Docs rule page updated to state that news sitemaps are excluded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugrulessize: M

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions