Skip to content

19 — Warn loudly that USE_SITEMAP replaces link-following - #17

Open
MirjamOdile wants to merge 2 commits into
mainfrom
pr/19-use-sitemap-warning
Open

19 — Warn loudly that USE_SITEMAP replaces link-following#17
MirjamOdile wants to merge 2 commits into
mainfrom
pr/19-use-sitemap-warning

Conversation

@MirjamOdile

Copy link
Copy Markdown
Contributor

What was broken: the USE_SITEMAP setting sounds additive ("also read the site's page list") but actually swaps the spider for a sitemap-only crawler with no link-following at all. Real sitemaps are routinely incomplete, so any spider built with this setting silently never crawls the sections the sitemap doesn't list — no error, a healthy-looking crawl, missing content. The manual actively claimed the two compose. (Near-miss in the wild: a sitemap listing 1,410 article URLs but none of the site's 647 research/project pages, reachable only by links.)

What it does now: the crawl prints an unmissable warning at launch — "USE_SITEMAP replaces link-following: ONLY sitemap-listed URLs will be crawled; this spider's follow rules are ignored" — and the manual now states the trade-off plainly in all three places it discusses sitemaps. The footgun still exists, but it can no longer fire silently.

Details

  • cli/crawl.py: warning printed when USE_SITEMAP routes to the sitemap spider and the spider also has follow rules.
  • CLAUDE.md: §7.1 + two §5 mentions corrected (they previously read as "sitemap + link-following compose").
  • The real fix — a hybrid crawl where the sitemap seeds the frontier AND link-following stays active — is documented as a follow-up: it's a structural spider change needing a supervised live crawl to verify.
  • Request doc: docs/requests/19-use-sitemap-replaces-link-following.md.

Behavior changes

  • Three new warning lines at crawl launch for USE_SITEMAP spiders that have follow rules. Nothing about the crawl itself changes — this PR only makes an existing trade-off visible.

Verified

Docs + a launch-time message only; no crawl logic touched. Lint/import checked. The underlying behavior it warns about (SitemapSpider has no LinkExtractor) is verified by reading the spider classes and by the near-miss described in the request doc.

Merge note: touches cli/crawl.py, as do PRs 17/18/21 — merging in numeric order minimizes conflicts.

USE_SITEMAP swaps the spider class for a SitemapSpider with no LinkExtractor,
so any spider configured with it against an incomplete sitemap silently loses
every content section the sitemap doesn't list — no error, healthy-looking
crawl, missing sections — and real sitemaps are routinely incomplete. Until a
hybrid crawl exists (documented follow-up), the crawl now warns at start when
the spider has follow rules, and CLAUDE.md states the two are mutually
exclusive instead of implying they compose.

docs/requests/19-use-sitemap-replaces-link-following.md
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