Skip to content

CLI: delete the unreferenced external link checker and sitemap parser copies, and point their tests at the shared packages #756

Closed

Description

@nc9

The CLI keeps its own copy of the external link checker, apps/cli/src/crawler/external-checker.ts, next to the engine's (packages/audit-engine/src/external-checker.ts). Nothing in apps/cli/src calls its checkExternalLinks any more: the audit's external-link phase has run on the engine's checker since #252. Only its ExternalCheckResult type is still imported (apps/cli/src/audit/adapter.ts).

Two CLI tests still exercise the copy instead of the code that runs: apps/cli/tests/crawler/undecoded-fetches.test.ts and apps/cli/tests/crawler/fetch-deadline.test.ts. A fix to the engine's checker (a deadline or body-cap change, or the bulk-pass rule in #753) is not covered by them, and a fix applied only to the copy changes nothing users run.

The sitemap parser has the same shape: apps/cli/src/crawl/sitemaps.ts (with robots.ts and the index.ts that re-exports them) is not imported anywhere in apps/cli/src; the crawl uses packages/crawler/src/sitemaps.ts. apps/cli/tests/graph/processors/discovery/discover-sitemaps.test.ts and apps/cli/tests/crawler/fetch-deadline.test.ts still test the copy, which still has the bare-year <lastmod> crash fixed in the crawler package by #687.

Found while working on #753 (PR #755), which removed the adapter's unreferenced checkExternalLinksOnStorage / runBulkChecker copy, and #687.

Acceptance Criteria

  • apps/cli/src/crawler/external-checker.ts is deleted, and the CLI imports ExternalCheckResult from @squirrelscan/audit-engine.
  • The cases in undecoded-fetches.test.ts and fetch-deadline.test.ts that cover the external link checker run against the engine's checkExternalLinks, or are dropped where an engine test already covers the same case.
  • apps/cli/src/crawl/sitemaps.ts, robots.ts and index.ts are deleted (keeping hybrid-fetcher.ts, which the audit controller imports), and the tests that covered them run against @squirrelscan/crawler's sitemap and robots code or are dropped where a crawler test covers the same case.
  • tsgo --noEmit in apps/cli and packages/audit-engine is clean, and the moved tests pass.

Activity

  1. added
    P3
    size: S
    on Oct 14, 2026
  2. changed the title [-]CLI: delete the unreferenced external link checker copy and point its tests at the engine's[/-] [+]CLI: delete the unreferenced external link checker and sitemap parser copies, and point their tests at the shared packages[/+] on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3choresize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions