A site that blocks automated readers usually does it politely. The request succeeds, the status is 200, and the body says "checking your browser". A language model handed that body will extract a brand from it. The gate exists so that the extractor never sees a page that is not the page.
The problem
Two of the ten failures found in the old onboarding flow were about this.
- A subpage returned a 403 or a bot-check body, and that body went into the extractor’s input and into the list of sources.
- A page that needed JavaScript returned an almost empty shell, and the readout reported success with nothing in it.
In both cases the fetch layer had done its job. It returned what the server sent. What was missing was a judgement about whether the text is the site’s content at all, made before anything downstream could treat it as evidence.
Seven outcomes, in order

The whole gate is one function.
def assess(page: FetchedPage, text: str) -> PageOutcome:
if page.error_kind in ("blocked_host", "redirect_blocked"):
return "blocked"
if page.error_kind == "non_text" or is_non_text(page.headers.get("content-type", "")):
return "not_html"
if page.error or page.status_code == 0:
return "fetch_failed"
if page.status_code >= 400:
return "http_error"
head = text[:2000]
if _CHALLENGE.search(head) and len(text) < 2000:
return "challenge"
if len(text) < MIN_PAGE_CHARS or (_JS_SHELL.search(head) and len(text) < 600):
return "thin"
return "ok"
| Outcome | Rule | Why it is separate |
|---|---|---|
blocked | the fetch layer refused the host or a redirect | a safety refusal on our side, not a fact about the site |
not_html | the content type is not text | a PDF or an image is not read by this pipeline |
fetch_failed | any transport error, or no status | the network, not the page |
http_error | status 400 or above | the server said no |
challenge | bot-check phrases in the first 2,000 characters and fewer than 2,000 characters in total | the server said yes and sent something else |
thin | fewer than 120 characters, or a “JavaScript required” phrase with fewer than 600 | a shell with no content |
ok | none of the above | the only outcome that is evidence |
The order matters. A blocked host has no status code worth reading, so it is tested before status. A challenge page can be long if the site wraps it in a normal layout, so the phrase alone is not enough and the length condition keeps a real article that merely mentions “captcha” from being thrown away.
The two patterns are deliberately plain. One looks for the phrases bot-check pages use, such as “verify you are human”, “checking your browser”, “just a moment”, “access denied” and “captcha”, with their Korean equivalents. The other looks for “enable JavaScript” and “JavaScript is required”, also in both languages.
Normalising what passes
The text the gate measures is not the raw HTML. Scripts, styles, navigation, frames, templates and inline graphics are dropped. Headings become lines that start with #, which the chunker later uses as section boundaries. Whitespace is collapsed on each line and consecutive duplicate lines are removed, since menus and footers often repeat.
There is one fallback. If the text built from the document structure is less than half the length of the visible text, the visible text is used instead. Some sites put their content in elements the structural pass skips, and losing half a page silently is worse than keeping some boilerplate.
What happens to the result
A readout reads the home page and up to two more pages of the same owner. The gate’s outcome for each page decides two things: what is stored and how the run ends.
| Situation | Stored | Run ends as |
|---|---|---|
Root page ok, subpages ok | status, text, hash, chunks | done |
Root page ok, a subpage not ok | the subpage’s status and time only | partial |
Root page thin or challenge | status and time only | failed, no_content |
Root page anything else not ok | status and time only | failed, no_site |
A page that was readable last month and is blocked today keeps last month’s text and chunks. The stored status and time change, so the record shows that the latest attempt failed, and the content stays available to generators. A failed fetch is not proof that the content is gone. Pages that were not visited in this run are not touched at all.
When the root page is thin or challenged, the extractor is not called. There is nothing to extract from, and an empty readout reported as “no content” is more useful to the customer than an invented one reported as success.
Failure modes
| What goes wrong | What the gate does | Regression test |
|---|---|---|
| A subpage answers 403 | recorded as http_error, never extracted | test_f7_error_subpage_is_recorded_but_never_extracted |
| A bot check arrives with status 200 | challenge, not evidence | test_challenge_page_with_200_is_not_evidence |
| The page is a JavaScript shell | thin, the run ends no_content, the extractor is skipped | test_f8_js_shell_is_no_content_and_skips_extraction |
| The root page cannot be fetched | the run ends no_site | test_no_site_when_root_fails |
| A page that was readable fails on re-read | the earlier text and chunks are kept | test_failed_reread_keeps_previous_text_and_chunks |
| Extraction returns nothing that survives verification | the run ends no_content | test_extraction_with_nothing_grounded_is_no_content |
Limits I know about
The gate recognises challenges by phrase. A bot check with unfamiliar wording and a long body passes as ok, and its text reaches the extractor. The quote check downstream limits the damage, since a value needs a quote found in a page, but a challenge page is a page. The patterns have to be extended as new wording appears.
The design specifies more than the code does here. It describes a source status of “unknown” for a page that could not be read and a rule that retires a page only after two consecutive “gone” responses. Neither exists. Today a source keeps its last good content indefinitely, which is safe against a temporary block and wrong for a page the brand deleted on purpose.
A superseded run’s pages are stored before its result is refused. That is harmless, since the pages are real observations of the site, but it means the store can hold a reading that no accepted extraction was based on.
