Skip to content

fix(rules): leave noindex pages out of sitemap-coverage and title-pattern-outlier - #551

Merged
nc9 merged 3 commits into
mainfrom
claude/noindex-sitemap-title-outlier
Oct 8, 2026
Merged

nc9 merged 3 commits into
mainfrom
claude/noindex-sitemap-title-outlier

Conversation

@nc9

@nc9 nc9 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes #488

What changed

  • crawl/sitemap-coverage no longer lists a noindex page (meta or X-Robots-Tag) as missing from the sitemap. The filter runs on the precomputed missing list as well as the fallback, and the path is chosen on the unfiltered list so a list emptied by the filter does not trigger a recompute. The engine still builds the unfiltered list, so sitemap-valid is unaffected.
  • content/title-pattern-outlier leaves noindex pages out of the template vote and never judges them, on both the streaming and in-memory paths. They still count toward the site page floor.
  • Both apply only when the site itself is indexable (siteIndexable === true), the same gate as the other index rules. On a noindex-everywhere host, or when unknown, behavior is unchanged, including the fallback's existing meta-noindex filter.
  • Docs: both rule pages and the "pages kept out of search" list in docs/rules/index.mdx (now nine rules) mention the exclusion.
  • integrity/orphan-page is left alone, per the triage note.

Tests

  • sitemap-coverage.test.ts: precomputed meta-noindex page not listed, header-noindex page on the fallback path not listed, indexable missing page still listed, noindex-everywhere site unchanged.
  • title-pattern-outlier.test.ts: 12 product pages plus 2 noindex short-title pages gives no finding; the same pages without noindex still fire brand-missing; header noindex; noindex pages excluded from template learning; noindex-everywhere unchanged.
  • noindex-site-rules-dual-path.test.ts: content/title-pattern-outlier added, streamed equals legacy with and without a known-indexable site.
  • streaming-rules-canonical-golden.test.ts stays green. make validate in docs/ passes; rules and audit-engine typecheck clean.

Agent skill

No change needed. The skill links to the rule pages, which are the reference and are updated here.

Relation to #549

Independent of the crawl/indexability-conflicts PR; no conflicts with it, so no rebase was needed.

…tern-outlier

Both rules still counted pages kept out of search. sitemap-coverage no
longer lists a noindex page (meta or X-Robots-Tag) as missing from the
sitemap, on the precomputed and fallback paths. title-pattern-outlier
leaves noindex pages out of the template vote and never flags them.
Both apply only when the site itself is indexable, the same gate as the
other index rules, so a noindex-everywhere host is unchanged.

Closes #488

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

claude Bot commented Oct 7, 2026

Copy link
Copy Markdown

Review of PR 551 (noindex handling for content/title-pattern-outlier and crawl/sitemap-coverage).

I read the diff and shared/noindex.ts. I didn't run the test suite.

The change is consistent with the #457 gate (skipsNoindexPages, with the site floor still counting every page). The legacy and streaming paths are covered by dual-path tests. I found nothing that should block merging.

  • (low) packages/rules/src/crawl/sitemap-coverage.ts: the precomputed branch builds the noindex URL set by looping over every page, but only when precomputedMissing is non-empty. That is fine for performance. However, a noindex page that appears only in missingPages and has no matching crawled page entry (for example, one that was capped out) is still listed. That is acceptable. It's worth a short comment saying that filtering is limited to crawled pages.
  • (low) packages/rules/src/crawl/sitemap-coverage.ts: the fallback uses skipNoindex ? source !== null : source === "robots meta tag". This keeps the old behaviour when the gate is closed, but the condition is subtle. Consider naming it, e.g. const isSkipped = ..., so the intent reads at a glance.
  • (nit) normalizedOrNull(url) ?? url in the precomputed loop: when normalisation fails, the raw URL is compared against normalised entries. That can never match, but it is harmless.
  • (nit) The test comment in noindex-site-rules-dual-path.test.ts refers to pub#488. Consider linking the issue in the docs or changelog as well.

The docs updates in rules/index.mdx and the two rule pages match the code. The count of nine rules is correct.

@claude

claude Bot commented Oct 7, 2026

Copy link
Copy Markdown

Reviewed the diff for #488. I found no blocking problems, so there are no (high) or (critical) findings.

  • (nit) sitemap-coverage.ts: the precomputed branch builds the noindex set from every page, with no statusCode === 200 check. This is harmless, because it only removes entries from a list that is already filtered. A short comment would make that clear to the next reader.
  • (nit) sitemap-coverage.ts: normalizedOrNull(url) ?? url means a malformed precomputed URL is compared raw against the normalized set. It will never match, so the URL stays listed, which is the safe outcome.
  • (nit) The tests cover the precomputed and fallback paths, the closed gate, trailing-slash matching, and streaming against legacy output. A case where page.finalUrl differs from page.url on a noindex page would exercise the finalUrl matching that the code adds.

What I checked and found sound:

  • Choosing the precomputed or fallback path on the unfiltered list avoids the recompute trap.
  • Keeping the site-floor count unchanged is consistent with the docs.
  • The gate on siteIndexable === true is applied the same way in both rules.

I did not run the tests.

@claude

claude Bot commented Oct 8, 2026

Copy link
Copy Markdown

Review of #551 (noindex pages left out of crawl/sitemap-coverage and content/title-pattern-outlier).

I found no correctness, security or performance problems. I only read the diff and shared/noindex.ts; I did not run the tests.

  • (low) packages/rules/src/crawl/sitemap-coverage.ts: the precomputed path builds noindexUrls by walking all pages and normalizing each URL, and only when precomputedMissing is non-empty. That is linear and fine. Note that noindex matching there is by normalized URL, so a page that is noindex only under a query-string variant could be matched loosely. That is acceptable, but a comment would help.
  • (nit) sitemap-coverage.ts: the behaviour differs by path when the site gate is closed. The fallback still drops meta-noindex pages, while the precomputed path drops nothing. The docs and tests state this, so it is intentional. Consider noting it in the rule's header comment too.
  • (nit) title-pattern-outlier.ts: excluded is optional on TitlePageRecord. Making it required would force future callers to decide.

Positives:

  • The title-outlier change gives the same result on the legacy and streaming paths. That includes the site floor still counting noindex pages, and the dual-path tests check it.
  • The siteIndexable gate is reused rather than reimplemented.
  • The normalizedOrNull refactor is behaviour-preserving.
  • The new tests cover the gate being open, closed and unknown, a trailing slash, and the filtered-empty case that must not trigger the fallback.

nc9 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Re the (low) normalized-URL matching note in sitemap-coverage: skipped deliberately. Matching by normalized URL is the same normalization the coverage list itself uses, so the behaviour is intended; a comment can ride a later change to the file.

@nc9
nc9 merged commit f3c1a71 into main Oct 8, 2026
15 checks passed
@nc9
nc9 deleted the claude/noindex-sitemap-title-outlier branch October 8, 2026 01:10
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.

crawl/sitemap-coverage and content/title-pattern-outlier still count noindex pages (follow-up to #457)

1 participant