Skip to content

feat: a website's posts are read from the sitemap it names (ADR 0068) - #60

Merged
jagdish-kumawat merged 1 commit into
mainfrom
feat/2026-11-06-sitemap-posts
Nov 7, 2026
Merged

jagdish-kumawat merged 1 commit into
mainfrom
feat/2026-11-06-sitemap-posts

Conversation

@jagdish-kumawat

Copy link
Copy Markdown
Contributor

Summary

Phase 4 of the Insights plan: a website's settings name its sitemap, and the engine reads it, and each page it lists once, for title and publish date. Settings says how reading went. Recorded in ADR 0068.

  • Reaching only what it should. Every address, file, page and redirect is held to the website's own hosts and the sitemaps.org location rule. Connections are checked as they open: IANA special-purpose blocks and 168.63.129.16 are refused. HTTP/1.1 only, no proxy, no cookies, no certificate downloads.
  • Polite. One request a second per website across engines, robots.txt (RFC 9309) obeyed for every address and redirect, Retry-After heard, and a User-Agent that names the reader (DewirideAnalytics/{version} (sitemap fetcher; +…)).
  • Hostile content. Pages are read by AngleSharp's tokenizer, with no document built. Sitemaps are read through a guard ahead of the XML reader. Bodies are capped compressed and uncompressed, under one deadline.
  • Concurrency. A lease claim is taken on clock_timestamp(), writes are fenced with FOR KEY SHARE, and attempts are written before they are made. New sitemaps queue as of now, a website being read is skipped at both of its names, and a stopping engine releases the website as due.
  • Bounds. A website holds at most three times its listing limit, in pages and in bytes. A closing reading forgets unvouched pages down to twice that limit, so a corrected sitemap always has room.
  • Accounts. A website whose account is not being measured (IMeasurementAllowance) is not read.
  • Status. GET /api/sites/{id}/sitemap reports the state, the problem word, the counts and turnedAway. Partly-read problems are told as being about the files the sitemap lists.
  • Migration. AddSitemapReading adds sites.sitemap_address, sitemap_reads, sitemap_parts and site_posts (with landed_path). The release must back up first.

Tests

  • Free edition: Testing 11, Domain 256, Application 525, Classification 530, Architecture 32, Api 66, Sql 304, Mail 30 and Integration 2,498, all green. The one test-order fix was re-run as the full reader class, 200 of 200.
  • Cloud edition: Ee.Integration 206 (22 skipped, unchanged) and Ee 198.
  • pnpm verify: web 2,092, tracker 84, edition 124 and site 78.
  • Negative controls broke each of the last round's safety fixes, and all 10 were caught.

🤖 Generated with Claude Code

A website's settings take the address of its sitemap. A background reader reads it, and each page it
lists once for its title and publish date, and Settings says how reading went.

- Only the website's own hosts, held to the sitemaps.org location rule, and only the public internet:
  every IANA special-purpose block and Azure's 168.63.129.16 are refused as each connection opens,
  and no certificate is downloaded to complete a chain.
- One request a second per website, robots.txt (RFC 9309) obeyed for every address and redirect,
  and a User-Agent saying what the reader is and where to read about it.
- Pages are read by AngleSharp's tokenizer and no document is ever built.
- A claim is a lease on the website's row, every write is fenced on it, and an attempt is written
  before it is made.
- A new sitemap queues as of the moment it is named, a website being read is skipped at both of its
  names, a website whose account is not being measured is not read, and an engine stopping lets go
  of the website as due at once.
- What a website may hold is bounded in pages and in bytes, and a reading that closes forgets the
  pages no file vouches for down to twice what a website may list.
- landed_path keeps the path a redirected page answered at, for matching visits to posts.
- PostgreSQL migration AddSitemapReading: sites.sitemap_address and the tables sitemap_reads,
  sitemap_parts and site_posts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jagdish-kumawat
jagdish-kumawat merged commit 9e7eb81 into main Nov 7, 2026
6 checks passed
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.

1 participant