Skip to content

fix(cli,crawler): crawl --disable-discovery-probes; one robots.txt read; sitemaps throttled per host #422 - #1365

Closed
nc9 wants to merge 2 commits into
mainfrom
fix/422-discovery-probe-followups
Closed

nc9 wants to merge 2 commits into
mainfrom
fix/422-discovery-probe-followups

Conversation

@nc9

@nc9 nc9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #422 (its fifth criterion, plugin rules and --rule-exclude ax, is split into #1375: the CLI loads no plugins yet, so there is nothing to pass)

  • squirrel crawl --disable-discovery-probes: new flag on crawl (bash, zsh, fish completions, docs/cli/crawl.mdx); it overrides [crawler] disable_discovery_probes in both directions, as on audit.
  • robots.txt once: the crawler's robots read now keeps the response's Link header, and fetchRslLicensing takes that read (RobotsRead) instead of requesting robots.txt again; License: directives and Link: rel=license are still found (test with both). The docs' discovery-probe table and "28 requests" (now 27) are updated.
  • Sitemaps and per_host_*: fetchSitemapsRecursive takes a ProbeGate; the crawler passes the same per-host gate the discovery probes use, so the guessed sitemap locations wait for per_host_concurrency and per_host_delay_ms (the walk's own 60 s total deadline still applies).
  • --disable-discovery-probes false: refused on audit and crawl with a message naming the =false form, before anything is requested (spacedBooleanValueError).
  • Plugin rules under --rule-exclude ax: not changed, and the criterion is not met end to end. selectDiscoveryProbes already accepts plugin namespaces and an existing test (rules/tests/discovery-probes.test.ts) pins that a plugin rule's probe is kept; the audit controller passes none because the CLI does not load plugins at all today (nothing in apps/cli builds additionalNamespaces). Wiring it needs a plugin loader, so I left that bullet for the issue, to be closed or split when plugins load.

Tests (failing first)

apps/cli/tests/cli/discovery-probes-flag-422-e2e.test.ts (real CLI; 5 of 6 fail on main): crawl flag sends none and overrides the config both ways, a spaced false exits 1 for crawl and audit with no request, an audit requests robots.txt once. packages/crawler/tests/robots-read-once-422.test.ts (1 request, RSL still reads License and Link) and sitemap-per-host-422.test.ts (per_host_concurrency = 1 gives max one in flight, 5 overlaps, the delay spaces them). discovery-probes.test.ts now expects 1 robots hit. Gates: tsgo in crawler and apps/cli, apps/cli format and lint, tests/self (completions), crawler probe/sitemap/robots tests, make validate.

Note: this branch is off main and does not include the Accept-Language change (#1357), which also touches sitemaps.ts and robots.ts (adjacent lines; trivial conflict). Skill: no change needed. CHANGELOG under Unreleased (Added and Fixed).

Review follow-ups

  • spacedBooleanValueError defaults rawArgs to none (the 16 wiring tests that call audit.run({args}) pass) and checks every occurrence of the flag.
  • The sitemap gate shares one deadline per chunk: a request that waits behind the per-host gate gets what is left of the chunk's timeout, so a stalled origin costs one timeout however narrow the gate is. preamble-budget.test.ts passes unchanged (it failed 4/4 before this).
  • The gate's AbortController is aborted when the crawl is interrupted, so requests queued behind the gate drain at once. Not covered by a dedicated test.
  • CHANGELOG says robots.txt 403/5xx now reads "not checked" for ax/rsl-license. Rebased on main.

nc9 added 2 commits October 31, 2026 06:29
…ad; sitemap requests throttled per host; spaced boolean value refused #422

Signed-off-by: Nik Cubrilovic <[email protected]>
…n stop; rawArgs default; every spaced flag occurrence #422

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.145 as fc55d0a3 5da5b3d0 via #1377. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.145. Closing this original.

nik

@nc9 nc9 closed this Oct 30, 2026
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.

crawler: discovery-probe follow-ups from #409

1 participant