Repository navigation
feat(crawler): let users turn off the pre-crawl discovery probes (#409) - #419
Merged
Merged
Conversation
Before the first page every audit sent ~28 root requests for agent files: llms.txt, markdown negotiation, 20 well-known paths including /swagger.json and /openapi.json, the homepage as GPTBot/Claude-User, and an RSL robots.txt re-read. A common fail2ban "sensitive files" jail bans the auditing IP for /swagger.json, so the audit failed right after it started. - [crawler] discovery_probes = false and squirrel audit --no-discovery-probes send none of them; robots.txt, sitemap discovery and the seed still run. The config field is optional and unset means on, so cloud runs are unchanged. - Rules declare the probes they read (RuleMeta.discoveryProbes) and the CLI sends only the ones an enabled rule reads: --rule-exclude ax sends none, --rule-exclude ax/api-discovery drops only its paths. - A probe that was not sent, turned off, unselected or cut by the preamble budget, reports "not checked" (value not-checked), never a missing file. - Probes queue behind per_host_concurrency and per_host_delay_ms. Queueing never outlasts the preamble budget, and interrupting the crawl aborts the probes still waiting for a slot. - --no-discovery-probes is read from argv (cli/flags.ts, same helper as the --no-publish fix): citty never sets a declared no-* arg. Signed-off-by: Nik Cubrilovic <[email protected]>
…ceptions (#409) Per the decision on the issue ("disable would be preferred"), and nothing has shipped yet, so no alias: - --no-discovery-probes becomes --disable-discovery-probes, a plain boolean citty delivers itself (no rawArgs read). It overrides the config both ways: --disable-discovery-probes=false sends the probes when the config turns them off. A repeated flag arrives as an array; the last one wins. - [crawler] discovery_probes = false becomes disable_discovery_probes = true. Still optional in the shared schema, so absent means probes on. - Docs say how to let the audit through instead of turning the probes off (own IP in fail2ban's ignoreip, or a secret -H header a WAF rule skips on) and link the firewall exceptions page, also from the failed-audits guide. - The CLI wiring test closes the process-wide content store and link cache on entry and exit: a handle left in another file's deleted scratch dir made every later offline audit fail with "No pages were crawled". Signed-off-by: Nik Cubrilovic <[email protected]>
- Probes take slots from their own per-host scheduler, sized by discoveryProbePerHost: a cloud-rendered CLI audit clamps pages to the plan's render concurrency (1 on free, no delay), and the plain-HTTP probes queued behind it ran in series and could lose the budget on a slow host. The CLI passes the unclamped per_host_concurrency and per_host_delay_ms. - agent-access goes out before the 20-path well-known sweep, so the weight-3 ax/agent-blocking is the last reader to lose its budget. - The gate uses acquireUseRelease (acquire kept interruptible), so an interrupt between acquire and use cannot leak a slot. - No answer is not checked: a probe that went out and got none (refused, timed out, cut at the deadline) no longer reads as a missing file. llms, markdown and RSL store no row; the well-known and pay-per-crawl readers treat status 0 as unchecked, and the message says which. - ax/llms-txt reports a real /.well-known/llms.txt or /docs/llms.txt even when the root /llms.txt got no answer. - selectDiscoveryProbes takes plugin namespaces like the runner does. - The --no-publish wiring test closes the process-wide content store and link cache in afterAll; left open in its deleted scratch dir they failed every later file's offline audits. - Docs: "is not scored"; suggest per_host_concurrency = 1 for touchy sites. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/discovery-probes-switch-409
branch
from
September 30, 2026 02:01
839df75 to
4294b2d
Compare
nc9
marked this pull request as ready for review
September 30, 2026 02:17
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.
Closes #409
A common fail2ban "sensitive files" jail bans the auditing IP when an audit asks for
/swagger.jsonor/openapi.json, and every request after that gets connection refused. This adds a switch for the pre-crawl discovery probes, makes them follow the rule selection, reports a probe that was not sent or got no answer as "not checked", and puts the probes behind the per-host throttle.What the switch covers
Every pre-crawl request except robots.txt, sitemap discovery and the seed page, in the order they go out:
llms-txt/llms.txt,/llms-full.txtmarkdown/withAccept: text/markdown,/index.mdagent-access/as browser, GPTBot, Claude-User/.well-known/mcp*,agent-card.json,agent-skills/index.json,api-catalog,/openapi.json,/swagger.json,/api/openapi.json, the two OAuth docs, four AGENTS.md paths, twoai-plugin.json, two altllms.txtrslLicense:plus the documents it namesThe AI-crawler homepage fetches are in: a WAF that blocks GPTBot can ban on them too. They go out before the well-known sweep, so the weight-3 ax/agent-blocking is the last reader to lose the budget on a slow host.
How
[crawler] disable_discovery_probes = trueandsquirrel audit --disable-discovery-probessend none (named per the decision on the issue: "disable would be preferred"; nothing has shipped, so no alias). The zod field is optional and unset means probes on, so a config without it (every cloud run) and code that builds aConfigby hand are unchanged. The flag is a plain boolean citty delivers itself and overrides the config both ways:--disable-discovery-probes=falsesends the probes for one run when the config turns them off; repeated, the last one wins.squirrel crawlhonours the config value; the flag is onauditonly.RuleMeta.discoveryProbes, typed againstWELL_KNOWN_PATHS, now in core-contracts).selectDiscoveryProbestakes the union over the enabled rules (configenable/disable,--rule-include/--rule-exclude, per-ruleenabled = false, theaialias, plugin namespaces when a caller has them), and the CLI passes it asCrawlerConfig.discoveryProbes. Unset sends everything, so the cloud runtime, which builds its own crawler config, sends what it always sent.--rule-exclude ax/api-discoverydrops only the six API/OAuth paths.<thing> not checked: <reason>at info status with valuenot-checked, never as a missing file, and is not scored. llms, markdown and the RSL robots read store no row in those cases (test(cli): request-deadline 'checkReachability ... stalled body' test fails on macOS (127.0.0.2 is not routable) #1733 stored an empty shape there, so the rule said "No /llms.txt found" for a file never answered;preamble-budget.test.tsis updated to match). The well-known and pay-per-crawl readers treatstatus: 0as unchecked. ax/agent-blocking keepsskipped/inconclusive, and ax/rsl-license still calls a named license document it could not fetch a broken reference. ax/llms-txt still reports a real/.well-known/llms.txtor/docs/llms.txtwhen the root got no answer.per_host_concurrencyandper_host_delay_ms. A cloud-rendered CLI audit clamps pages to the plan's render concurrency (1 on free, 0ms), so the CLI passes the unclamped values asdiscoveryProbePerHost: the probes are plain HTTP, and behind the clamp all 28 ran in series. Not a robots.txtCrawl-delay: at the 2s cap, 28 probes would outlast the 45s budget on every respect_robots audit of such a site. Queueing never outlasts the budget (a start slot past the deadline is not reserved), the gate isacquireUseRelease, and interrupting the crawl aborts the probes still waiting for a slot.ignoreip, or a secret header sent with-Hthat a WAF rule skips on (the probes, robots.txt, sitemaps and pages carry it; the checks that resolve the start URL before the crawl do not). They link Firewall and WAF exceptions, and so does the failed-audits guide.--no-publishwiring test from fix(cli): --no-publish stops the auto-publish attempt (#404) #417 left them open inside its deleted scratch dir, and every later file's offline audits then failed with "No pages were crawled". ItsafterAllnow closes both, and the new wiring test closes them on entry and exit, so the pair passes in either order.Request logs
Local server that logs every request,
squirrel audit http://localhost:48409/ -m 2 -C quick --offline, scratch HOME. LeadingGET /lines are the reachability check and seed resolution.default: all 28 probes, including the browser-UA homepage and the second robots.txt (RSL)
--disable-discovery-probes: no probes; robots.txt once, sitemaps, pages
[crawler] disable_discovery_probes = true
disable_discovery_probes = true plus --disable-discovery-probes=false: the flag wins, all probes go out
--rule-exclude ax (no other setting)
--per-host 1 with per_host_delay_ms = 150: one probe at a time, ~150ms apart
Preamble timing (real site, default settings)
squirrelscan.com,
createCrawlerdefaults (per_host_concurrency 5, per_host_delay_ms 50), 5 runs each, window from the end of the first robots.txt read to the start of sitemap discovery:About +0.8s, which is the 50ms stagger over 28 requests. The budget is 45s, so a normal site uses about 3% of it.
Tests
tests/discovery-probes.test.ts(all on / none / a subset; per-host concurrency 1 and 3; delay spacing;discoveryProbePerHostsizing the probe slots apart from a render-clamped page limit; queue bounded by the budget; interruption stops queued probes; no answer keeps no llms/markdown/RSL row),preamble-budget.test.tsupdated.tests/discovery-probes.test.ts(selection, every probe has a reader, plugin namespaces), not-checked cases (not sent, budget-skipped, no answer) in the eight ax rule tests, the llms.txt alt-path hit with no root answer.tests/commands/audit-discovery-probes-wiring.test.tsdrivesrunCommand(audit, { rawArgs })and asserts on requests: default,--disable-discovery-probes, config true, flag over config false,=falseover config true,--rule-exclude ax,--rule-exclude ax/api-discovery; plus citty's own parse of the flag (absent, set,=false,=true, before the URL, repeated).tests/controllers/crawl-concurrency.test.ts: the free-plan render case keeps the probes on the configured per-host limits.tangly check --strictpasses.Not in this PR
--disable-discovery-probesonsquirrel crawl(the config value applies there).restartCrawl(no production caller) keeps the instance'sdiscoveryProbes/discoveryProbePerHostrather than persisting them in the stored crawl config, like the other instance-level options (documentFetcher).