Repository navigation
chore(cli): delete the unreferenced external checker and sitemap/robots copies #756 - #782
Merged
Merged
Conversation
nc9
force-pushed
the
chore/cli-drop-dead-forks-756
branch
from
October 15, 2026 01:26
22bc5c8 to
5378202
Compare
nc9
marked this pull request as ready for review
October 15, 2026 01:42
|
Review of #782 (dead-code removal in the CLI) I found no problems. I couldn't run the test suite or typecheck here, and CI was still pending when I checked.
Merge once the pending |
…ts copies #756 Nothing in the CLI ran apps/cli/src/crawler/external-checker.ts or apps/cli/src/crawl/{sitemaps,robots,index}.ts: audits use the engine's checker and the crawler's sitemap and robots code. Import ExternalCheckResult from @squirrelscan/audit-engine. Tests that covered the copies now run against the shared code (sitemap parsing and the fetch deadline in the crawler, robots parsing in utils, allow rules on the crawler's evaluator) or are dropped where an engine or crawler test covers the same case. Signed-off-by: Nik Cubrilovic <[email protected]>
Drop the robots.txt fixture branch nothing requests now, say the external link deadline cases were dropped (the engine covers them) rather than moved, and word the CHANGELOG entry as fetchers, not parsers. Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
chore/cli-drop-dead-forks-756
branch
from
October 15, 2026 04:15
55aa874 to
c06254f
Compare
|
Review of #782 (removes the dead CLI copies of the external link checker, sitemap fetcher and robots.txt fetcher). No findings.
The changelog entry reads well. |
This was referenced Oct 15, 2026
Closed
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 #756.
What changed
The CLI kept its own copies of three shared modules that nothing in it runs any more:
apps/cli/src/crawler/external-checker.ts: the audit's external link phase runs on the engine's checker. Only theExternalCheckResulttype was imported, and it now comes from@squirrelscan/audit-engine.apps/cli/src/crawl/sitemaps.ts,robots.tsand theindex.tsthat re-exported them: the crawl uses@squirrelscan/crawler's sitemap code and robots evaluator, and@squirrelscan/utils' robots.txt parser.hybrid-fetcher.ts(imported by the audit controller) andcsr-detect.ts(a re-export of@squirrelscan/fetchers) stay.Their tests exercised the copies, not the code users run. Each case now runs against the shared code, or is dropped where a shared-package test already covers it:
discover-sitemaps.test.ts(parse, URL list, recursive fetch dedupe, discovery)packages/crawler/tests/sitemap-parse-756.test.ts, against the crawler'sparseSitemap,getUrlsFromSitemaps,fetchSitemapsRecursiveanddiscoverSitemaps. One expectation changes: the crawler decodes&in a<loc>(the copy's regex kept it), which is correct and already pinned bysitemap-xml-escapes.fetch-robots.test.ts,parseRobotsTxtcasespackages/utils/tests/robots-txt-756.test.ts, against@squirrelscan/utils/robots-txt, which had no direct parse tests.fetch-robots.test.ts,isUrlAllowedcasespackages/crawler/tests/robots-evaluator-756.test.ts, againstcreateRobotsEvaluator().isAllowed, the check the crawl makes.fetch-deadline.test.ts, sitemap deadline casespackages/crawler/tests/sitemap-fetch-deadline.test.ts, against the crawler'sfetchSitemap. Its reasons are the crawler's: a stalled body isEmpty response(not settled), as persisted failure records have always read.fetch-deadline.test.ts, external checker deadline casesfetch-deadline.test.tshas the same two cases.undecoded-fetches.test.ts, external link caseundecoded-probe-fetches.test.tscovers it.capped-read-closes-connection-766.test.ts, external checker caserequest-deadline.test.ts, the copy'sfetchRobotsTxtstallpreamble-budget.test.tscovers a stalled robots.txt.The CLI script fetcher (a live fork used by the analyze pass) keeps its tests in the CLI.
Checks
tsgo --noEmitpasses in apps/cli and packages/audit-engine.format:checkandlintpass.checkReachability returns instead of hanging on a stalled bodyin request-deadline fails locally on macOS, which does not route 127.0.0.2. It fails the same way on main and passes on Linux CI.Docs and skill
No user-facing change, so no docs change. CHANGELOG entry under Changed, marked internal.
The squirrelscan agent skill needs no change.