Skip to content

links/orphan-pages reports linked pages as orphans when the crawl stops at its page cap #1044

Closed

Description

@deniskern

Summary

links/orphan-pages reports a page as orphaned (<2 incoming links) when the pages that link to it were not crawled because the crawl stopped at its page cap. links/no-contextual-inbound already skips in that case (v0.0.106: "skips when the crawl stopped at its page limit, because a page it never reached could hold the link"); orphan-pages does not. On a Shopify shop with a 60-page cap it reports 20 collections; we keep the rule disabled for shops.

Repro

Five pages plus a sitemap:

  • / links to /a/, /b/, /c/, /d/
  • /a/, /b/, /c/, /d/ each link to / and /deep/
  • /deep/ links to /
  • sitemap.xml lists / and /deep/
squirrel audit http://127.0.0.1:8766/ --http --level surface -m 3 -f json
squirrel audit http://127.0.0.1:8766/ --http --level surface -m 10 -f json

with [rules] enable = ["*"].

Actual

  • -m 3 (crawled /, /a/, /deep/): "2 orphan page(s) with <2 incoming links" → /a/, /deep/. /deep/ has four incoming links, from /a/–/d/, of which only /a/ was crawled.
  • -m 10 (all six pages): /deep/ is correctly not reported.

Expected

When the crawl stopped at its page cap, links/orphan-pages treats a page's inbound count as unknown, as links/no-contextual-inbound does: skip with a reason, or report only pages that are provably under-linked (e.g. zero inbound links from a crawl that covered every page). Same question for links/weak-internal-links.

Version

squirrel v0.0.129

Acceptance Criteria

  • With -m 3 the repro does not report /deep/ as orphaned
  • With -m 10 the result is unchanged
  • A capped crawl records a skip reason for links/orphan-pages (and links/weak-internal-links) like links/no-contextual-inbound
  • A test covers the capped-crawl case

Activity

  1. WilliamK112 commented on Oct 25, 2026

    @WilliamK112
    Contributor

    I would like to take this. I will make both links/orphan-pages and links/weak-internal-links emit the same capped-crawl skip used by links/no-contextual-inbound, cover the legacy and streaming paths with focused regressions, and update both rule docs plus the changelog.

  2. added a commit that references this issue on Oct 26, 2026
    23c94e9
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions