Skip to content

Operations & robustness — robots.txt, crawl-delay, hardening#28

Merged
hendrikebbers merged 3 commits into
mainfrom
feat/014-ops-robustness
Jul 13, 2026
Merged

Operations & robustness — robots.txt, crawl-delay, hardening#28
hendrikebbers merged 3 commits into
mainfrom
feat/014-ops-robustness

Conversation

@herbie-bot

Copy link
Copy Markdown
Collaborator

Summary

Hardens the crawler for production and closes out Phase 1: honor each host's robots.txt, respect Crawl-delay, verify end-to-end fault tolerance, and improve structured logging. Also restricts sitemap-index recursion to the same host (SSRF hardening flagged in earlier specs).

Spec

  • docs/specs/014-ops-robustness/{design,behaviors,steps}.md

Changes

  • RobotsPolicy interface (+ ALLOW_ALL) and HttpRobotsPolicy (per-host fetch+cache, our-UA group with * fallback, longest-prefix matching, missing → allow-all, Crawl-delay)
  • SitemapCrawler filters discovered URLs via robots and only follows same-host child sitemaps; PageFetcher honors Crawl-delay via HostRateLimiter.acquire(host, minInterval)
  • Structured logging (IndexReport, robots-skips, Meilisearch task outcomes)

Deferred (documented)

  • Micrometer metrics — deferred per the design's open question: no metrics backend is wired (only micrometer-observation on the classpath). Structured logging shipped now; add counters/timers when a backend exists.

Test coverage

  • HttpRobotsPolicyTest, HostRateLimiterTest.crawlDelayTightensInterval, SitemapCrawlerTest robots + off-host guard; fault-tolerance covered by existing spec 007/008/009/010 tests. 142 tests total; spec-review and quality-review clean.

Closes #27
🤖 Generated with Claude Code

- RobotsPolicy interface (+ ALLOW_ALL) and HttpRobotsPolicy: per-host
  robots.txt fetch+cache (TTL, injectable clock), our-UA group selection
  (falls back to *), longest-prefix match with Allow winning ties, missing
  robots -> allow-all, Crawl-delay parsing.
- SitemapCrawler filters discovered URLs (sitemap + fallback) via RobotsPolicy
  and only follows same-host child sitemaps (closes the sitemap-index SSRF
  surface). PageFetcher honors Crawl-delay via HostRateLimiter.acquire(host,
  minInterval).
- Fault tolerance verified via existing tests; IndexReport/robots-skip/task
  outcomes logged. Micrometer metrics deferred (no metrics backend wired) per
  the design's open question.
- Tests: HttpRobotsPolicyTest, HostRateLimiter crawl-delay, SitemapCrawler
  robots + off-host guard; existing crawler/fetcher tests use ALLOW_ALL.
  142 tests green. @Autowired on HttpRobotsPolicy's public ctor (two ctors).
- steps.md; refresh CLAUDE.md (Phase 1 complete).

Refs #27
@hendrikebbers hendrikebbers merged commit 738e75b into main Jul 13, 2026
1 check 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.

Operations & robustness — robots.txt, fault tolerance, observability

2 participants