Skip to content

fix(rules): exclude news sitemaps from lastmod churn #115 - #116

Merged
nc9 merged 2 commits into
mainfrom
chore/release-0.0.86-docs
Aug 20, 2026
Merged

nc9 merged 2 commits into
mainfrom
chore/release-0.0.86-docs

Conversation

@nc9

@nc9 nc9 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #115. Pre-release work for v0.0.86 — the first commit is the blocker, the second is drift the release surfaced.

crawl/sitemap-lastmod-churn accused every news publisher

A Google News sitemap carries roughly the last 48 hours of articles by specification, so its lastmod values always collapse onto one or two days. That is exactly the accusation the rule makes, and it pooled lastmod across every discovered sitemap, so a news sitemap alone satisfied it.

Found in pre-dispatch smoke on allrecipes.com:

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

Byte-for-byte the content of its google-news-sitemap.xml. The site's real sitemap contributed nothing — its four children are bot-protected and return an HTML error page — leaving the news sitemap as the entire sample.

Detection is by the xmlns:news namespace, never the filename: google-news-sitemap.xml is a widespread convention, not part of any spec, and a news sitemap can be served from any path. Tested in both directions.

The seam is where the bug actually lived

Parsing the flag correctly changed nothing at first. The live site still warned, with the fix in place, because the audit adapter rebuilds its sitemap list field-by-field from the stored record — in three separate places — and the stored record had no such column. A parse-only test passes green while the feature does nothing.

So it is closed end to end:

parse (xmlns:news) → SitemapData → SitemapRecord → sqlite column
                   → getSitemaps → all 3 adapter reconstructions → rule

I asserted the count when patching the adapter, which is how the third reconstruction site turned up — I had expected two.

Behaviour

  • news-sitemap URLs are excluded from the count entirely, not merely out-voted
  • a sample that is only news URLs reports skipped naming that reason, so "your sitemap is fine" is distinguishable from "your sitemap carries no lastmod"
  • findings name the sitemap the offending values came from, since "which one stamps at build time" is the first question on a site with several

Schema

v21 adds sitemaps.is_news_sitemap. Local sqlite only, NOT a prod migration. Pre-v21 rows read back false, which is the behaviour they were stored under. SCHEMA_VERSION is now exported so the migration tests assert "reached the current version" rather than pinning a literal — that literal was already costing two unrelated failures per schema bump, including in this PR.

Verification

Live, on the site that failed:

before:  warn :: 38 sitemap URL(s) ... collapse onto 2 distinct day(s)
after:   (silent)

sqlite>  select url, is_news_sitemap from sitemaps;
         https://www.allrecipes.com/sitemap.xml|0
         https://www.allrecipes.com/google-news-sitemap.xml|1

Tests: 9 new (3 rule fixtures incl. the exact allrecipes shape, 6 namespace-detection, 3 DB round-trip covering the pre-v21 NULL path). packages/crawler + packages/rules 1563 pass, packages/audit-engine 270 pass — the canonical golden tripwire is unmoved, as expected: no news sitemap in the fixture corpus.

Rule counts had drifted

The catalog is at 275; README and docs claimed 273. The two sitemap-lastmod-* rules added pages and nav entries but never updated the counts, so Crawlability read 18 against an actual 20. Recomputed from loadAllRules(), not edited by hand.

sitemap-lastmod-churn also had a page and a nav entry but no card in the Crawlability index, so it was unreachable by browsing. Two pre-existing gaps of the same kind are fixed alongside it: content/mojibake and content/stale-copyright.

nc9 added 2 commits August 20, 2026 11:15
crawl/sitemap-lastmod-churn warned on any site publishing a Google News
sitemap, which is the correct thing for a publisher to have. A news sitemap
carries roughly the last 48 hours of articles by specification, so its lastmod
values always collapse onto one or two days: exactly the accusation the rule
makes. The rule pooled lastmod across every discovered sitemap, so a news
sitemap alone satisfied it.

Found in pre-release smoke for v0.0.86, on allrecipes.com:

  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 its google-news-sitemap.xml. The site's
real sitemap contributed nothing, because its four children are bot-protected
and return an HTML error page, leaving the news sitemap as the entire sample.

Detection is by the xmlns:news namespace, never the filename:
google-news-sitemap.xml is a widespread convention, not part of any spec, and a
news sitemap can be served from any path.

The flag has to survive the DB round trip, and that is where the bug really
lived. Parsing it correctly changed nothing at first: the audit adapter rebuilds
its sitemap list field-by-field from the STORED record, in three separate
places, and the stored record had no such column. So the seam is closed end to
end here:

  parse (xmlns:news) -> SitemapData -> SitemapRecord -> sqlite column
  -> getSitemaps -> all three adapter reconstructions -> rule

Behaviour:

- news-sitemap URLs are excluded from the count entirely, not merely out-voted
- a sample that is ONLY news URLs reports skipped and says so, so "your sitemap
  is fine" is distinguishable from "your sitemap has no lastmod"
- findings now name the sitemap the offending values came from, since "which one
  stamps at build time" is the first question on a site with several

Schema v21 adds sitemaps.is_news_sitemap. Local sqlite only, NOT a prod
migration; pre-v21 rows read back false, which is the behaviour they were stored
under. SCHEMA_VERSION is exported so the migration tests assert "reached the
current version" instead of pinning a literal that breaks on every bump.

Verified against the live site: the finding is gone, and the DB shows
is_news_sitemap=1 for the news sitemap and 0 for the regular one.

Signed-off-by: Nik Cubrilovic <[email protected]>
The catalog is at 275 rules; README and the docs claimed 273. The two
crawl/sitemap-lastmod-* rules added their pages and nav entries but never
updated the counts, so Crawlability read 18 against an actual 20.

Counts are recomputed from loadAllRules(), not edited by hand:

  README.md            Crawlability 18 -> 20, total 273 -> 275
  docs/index.mdx       hero card, prose, category table, total
  docs/rules/index.mdx frontmatter description and prose

crawl/sitemap-lastmod-churn also had a docs page and a nav entry but no card in
the Crawlability index, so it was unreachable by browsing. Two pre-existing gaps
of the same kind are fixed alongside it: content/mojibake and
content/stale-copyright have had pages and no cards.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 merged commit f03068a into main Aug 20, 2026
14 checks passed
@nc9
nc9 deleted the chore/release-0.0.86-docs branch August 20, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant