Skip to content

fix(rules): skip incomplete inbound counts - #1128

Merged
nc9 merged 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/capped-inbound-link-rules-1044
Oct 26, 2026
Merged

nc9 merged 1 commit into
squirrelscan:mainfrom
WilliamK112:codex/capped-inbound-link-rules-1044

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

  • skip links/orphan-pages and links/weak-internal-links when the crawl reaches its page cap
  • apply the skip before both legacy and streaming inbound-count paths, with the same explicit reason used by links/no-contextual-inbound
  • preserve uncapped behavior and document why a capped crawl cannot prove these findings

Closes #1044

Verification

  • npx -y [email protected] test packages/rules/tests/no-contextual-inbound.test.ts packages/audit-engine/tests/site-query-link-rules-golden.test.ts — 43 passed
  • npx -y [email protected] test packages/rules/tests — 7,559 passed, 25 todo
  • typechecks passed for packages/rules and packages/audit-engine
  • repository format check and lint passed
  • docs check passed: 61 tests plus Tangly, link, anchor, glossary, and generated-content checks
  • git diff --check

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

Docs: Updated both link-rule pages. Skill: gh-cli.

@nc9

nc9 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Thanks @WilliamK112, this is a clean fix. The gate uses the same pagesCrawled >= maxPages check as links/no-contextual-inbound, runs before both the legacy and streaming paths, and an uncapped crawl takes exactly the old path. At this head the two touched test files, the 518-page canonical gate, the entry-page e2e and the noindex dual-path tests all pass locally.

Two small things before merge:

  1. Glossary. docs/glossary/internal-linking.mdx still says only links/no-contextual-inbound skips at the page cap, and docs/glossary/orphan-page.mdx says a crawl that stops early "produces orphans that only exist in the crawl". Please say all three inbound-link rules skip when the crawl stopped at its page cap, and keep the caution for crawls that stop early for another reason (a time limit, an interruption) or start from a sitemap they cannot reach.
  2. Under-cap test. Only no-contextual-inbound has a "finished under its cap still warns" case. Please add one for orphan-pages and weak-internal-links (for example capped(n, n + 1) on a fixture where each one warns), so "with -m 10 the result is unchanged" is pinned for them too.

Optional: the check, the message and the "Crawl capped before the frontier was exhausted" string now appear in three rules. A small helper in packages/rules/src/shared/ with an exported skip-reason constant would keep them in sync; fine as a follow-up. Also, the 518-page canonical gate runs at the default max_pages of 100, so these rules now skip there; setting max_pages to at least the fixture size in getGoldenBaselineConfig keeps that gate comparing them.

@WilliamK112
WilliamK112 force-pushed the codex/capped-inbound-link-rules-1044 branch from acb475d to 6cf56f0 Compare October 25, 2026 22:25
@WilliamK112

WilliamK112 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed at current head 0435c71: updated both glossary pages, added the under-cap warning regression for both inbound-count rules, and raised the canonical fixture’s configured page limit so the parity gate continues to exercise findings. The branch is rebased onto current main. The focused 44-test set, audit-engine typecheck, and repository-wide format check pass; the earlier canonical golden and docs validations also passed.

@WilliamK112
WilliamK112 force-pushed the codex/capped-inbound-link-rules-1044 branch 2 times, most recently from 575b305 to 0435c71 Compare October 25, 2026 23:27
@nc9
nc9 force-pushed the codex/capped-inbound-link-rules-1044 branch from 0435c71 to 19aca55 Compare October 26, 2026 02:42
@nc9
nc9 merged commit 23c94e9 into squirrelscan:main Oct 26, 2026
15 checks passed
@nc9

nc9 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Merged. Thank you @WilliamK112, reusing the exact cap predicate of links/no-contextual-inbound on both the legacy and streaming paths, then fixing the glossary and the canonical fixture when asked, kept this consistent. (Nik)

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.

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

2 participants