Capture robots.txt + llms.txt as crawl-time compliance witnesses#10
Open
MirjamOdile wants to merge 1 commit into
Open
Capture robots.txt + llms.txt as crawl-time compliance witnesses#10MirjamOdile wants to merge 1 commit into
MirjamOdile wants to merge 1 commit into
Conversation
New ComplianceFileCapture extension: when a spider opens, it schedules
one request per file through the spider's OWN downloader — so the same
Cloudflare/proxy/TLS handling as the real crawl applies — and writes
the raw body beside the crawl output as crawls/{robots,llms}_DDMMYYYY.txt,
date-synced to the crawl that produced it.
Details that earn their code: redirects are followed manually (capped),
so witnesses are captured even when the spider runs with
REDIRECT_ENABLED=False; HTML soft-404s (sites serving their 200 HTML
page for a missing file) are detected and never stored as .txt; capture
failures only log — they can never break a crawl.
See docs/requests/04-compliance-file-capture.md (ships with the quality
tool PR) for the full write-up.
d9b8b33 to
fa3c1b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
For compliance review you want the robots.txt / llms.txt as the crawl saw
them — fetched through the same Cloudflare/proxy/TLS path as the real crawl,
date-synced to the output they govern. A separate after-the-fact fetch can see
a different file (or be blocked entirely on CF-protected sites the spider
itself gets through).
Change
New
ComplianceFileCaptureextension (enabled viaEXTENSIONSinsettings.py): when a spider opens, it schedules one request per file throughthe spider's OWN downloader and writes the raw body beside the crawl output as
crawls/{robots,llms}_DDMMYYYY.txt.Details that earn their code:
captured even when the spider runs with
REDIRECT_ENABLED=False.a missing file; a real robots/llms is plain text and never starts with
<.DATA_DIR(cwd-independent),same as the crawl JSONL export.
Verification
5 unit tests: plain-text witness saved date-stamped under
crawls/, HTMLsoft-404 rejected, non-200 rejected, redirect re-scheduled with depth
tracking, redirect loop capped. Full unit suite green. Run live across a
15-spider project migration.
Notes
--limittest crawls) — cost is tworequests; a same-day re-run refreshes the dated file.
request" warning for the extension's callback and keeps the request in the
memory queue — captured fine, just not resumable.