Repository navigation
feat(rules): skip index-presentation rules on noindex pages #457 - #460
Merged
Merged
Conversation
nc9
force-pushed
the
feat/skip-index-rules-noindex-457
branch
from
October 5, 2026 07:56
f751091 to
ee07cd6
Compare
nc9
force-pushed
the
feat/skip-index-rules-noindex-457
branch
from
October 5, 2026 23:06
ee07cd6 to
038ff60
Compare
nc9
marked this pull request as ready for review
October 5, 2026 23:19
A page its owner keeps out of the search index (robots meta or X-Robots-Tag noindex, the isPageIndexable test page_features and crawl/indexability already use) is no longer graded on how it would look in search results: - page rules core/meta-title, core/meta-description and core/h1 declare skipOnNoindex; the runner emits one skipped check (reason "noindex") - site rules content/duplicate-title, content/duplicate-description, core/title-unique and links/orphan-pages leave noindex pages out, on both the legacy site.pages and the streaming siteQuery path Pages are skipped only on a site known to be indexed: its homepage, or the crawl's entry page when the homepage was not fetched, is indexable (SiteData.siteIndexable, hashed into the per-page rule-cache run context). A noindex homepage (a staging host, or a Vercel/Netlify/ Cloudflare Pages preview, which send X-Robots-Tag: noindex on every page) and an unknown one skip nothing. Noindex-gated rules never fan out across a template, and the publish resolution signal treats a noindex skip as evaluated for that page, so a finding from before the page went noindex resolves instead of being carried forever. Closes #457 Signed-off-by: Nik Cubrilovic <[email protected]>
…log entry #457 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/skip-index-rules-noindex-457
branch
from
October 5, 2026 23:19
038ff60 to
f7cb71a
Compare
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 #457 (the "index rules skip noindex pages" half; the
X-Robots-Tagreporting half shipped in v0.0.103 via #459). Rebased onto v0.0.103 (d279852).What changes
A page counts as noindex when its
<meta name="robots">tag or itsX-Robots-Tagheader containsnoindex, including a header scoped to one crawler (googlebot: noindex). This is the existingisPageIndexable(parsed, headers)test thatpage_features.robotsNoindexandcrawl/indexabilityalready use, so every reader agrees on which pages are noindex. robots.txt disallow does not count.Rules that now skip noindex pages, and why
core/meta-titleskippedcheckcore/meta-descriptionskippedcheckcore/h1skippedcheckcore/title-uniquecontent/duplicate-titlecontent/duplicate-descriptionlinks/orphan-pagesThe list is pinned by a test: exactly these three page rules declare
skipOnNoindex, and noa11y,security,perforlinksrule may. Accessibility, security, performance and broken-link rules,core/robots-meta,crawl/indexabilityand the other crawl/noindex rules all still run on noindex pages.The skipped check reads
Skipped: page is set to noindex via robots meta tag(orvia X-Robots-Tag header) withskipReason: "noindex". Skipped checks are already excluded from scoring.Noindex pages are skipped only on a site known to be indexed
Vercel, Netlify and Cloudflare Pages preview deployments send
X-Robots-Tag: noindexon every page, and a staging site usually carries a site-wide noindex. Those are exactly the pre-launch audits where the title, description and H1 checks matter most, so a naive skip would silently empty them. The run therefore skips noindex pages only when it knows the site itself is being indexed, judged from one reference page:/with no query string, that answered below 400. A noindex/?s=termsearch page or another host's root never stands in for it.crawl/all-noindex-pagesis untouched and still lists every noindex page in all three cases (it reports at info status, so likecrawl/indexabilityit is not in the JSON issue list; the visible per-page signal iscore/robots-meta, which since #459 warns on every noindex page, header or meta).The decision is made once per run (
isSiteIndexable) into the tri-stateSiteData.siteIndexablein both SiteData builders (runRulesOnStorageand the streamingbuildStreamingSiteData), so the page pass and the site pass agree. A caller that never sets it skips nothing.Caches and fan-out
siteIndexableis new run-level input, so it is added toPAGE_RULE_SITE_FIELDSand hashed into the run context (all three states distinct); a homepage or entry page that turns noindex re-runs every page instead of replaying their results.page-rule-site-context.test.ts(the read-set falsifier) passes with the field declared.createTemplateFanoutdisqualifiesskipOnNoindexrules exactly as it doesskipOnSoft404, andtemplate-verdict-page-independence.test.tsnow also fails any template-scoped rule that declares it. (The three gated rules areverdictScope: "page"today.)skippedcheck normally lands in the publish resolution signal'snotEvaluated, which makes the server merge carry prior findings forever. A cloud user's existing "No H1" on a page that is now skipped would therefore never resolve.buildResolutionSignalnow treats askipReason: "noindex"skip as evaluated-clean for that rule's keys on that page only, so its priors resolve while every other page's findings for the same rule are untouched. The server merge itself (runCloudSmartAudits/ merge-core, which apps/api imports from audit-engine) needs no change. The skip carriesdetails.foldKey: "noindex"so a fold never mixes it with another gate's skip of the same rule, and a folded aggregate is trusted only with that key. If a rule emits no key at all in a run (every page skipped), priors carry, which is the safe direction.Evidence
CLI from source,
squirrel audit <url> --http --offline --refresh -f json, before (origin/main d279852, v0.0.103) and after (this branch rebased onto it), against fixtures served locally by a small bun server that sets the headers.1. The issue's fixture:
/meta.html(<meta name="robots" content="noindex,nofollow">),/hdr.html(X-Robots-Tag: noindex),/bot.html(X-Robots-Tag: googlebot: noindex),/a.html, and a directory listing at/. No page has an<h1>or a meta description.2. A fixture where the site rules fire: an indexable homepage linking twice each to two articles that share a title, and once each to
/thanks.html(meta noindex) and/thanks-hdr.html(X-Robots-Tag: noindex), which also share a title.3. A preview deployment: fixture 1 served with
X-Robots-Tag: noindexon every response, homepage included. Before and after reports are identical (empty diff): nothing is skipped. The stored rule results showcrawl/all-noindex-pagesstill reporting5 page(s) blocked from indexing, and the report itself showscore/robots-meta [warn] Page is set to noindex via X-Robots-Tag headeron every page, so the host-wide noindex stays visible.4. A deep-seeded audit with a noindex entry page: audit seeded at
/docs/start.html(meta noindex), the homepage answers 500,/docs/b.htmlis also noindex. Before and after reports are identical (empty diff): nothing is skipped, andcrawl/all-noindex-pagesreports2 page(s) blocked from indexing.5. The same deep-seeded audit with an indexable entry page: only
/docs/b.htmlis skipped.The rule cache was also checked on fixture 2 without
--refresh: the second run replayed all 5 pages (pagesReplayed: 5) and its findings match the--refreshrun exactly.Tests
Re-run after the rebase onto v0.0.103: the noindex test files (
noindex-skip,template-verdict-page-independence,resolution,core-robots-meta: 139 pass;noindex-skip-e2e,noindex-site-rules-dual-path,cloud-merge,rule-cache-codec,page-rule-site-context: 60 pass),tsgo --noEmitfor rules, audit-engine and apps/cli,tangly check --strict, and the five CLI fixtures above. All green.packages/audit-engine/tests/noindex-skip-e2e.test.ts(12): the real adapter on BOTH engine paths (runRulesOnStorageandrunStreamingRules): homepage noindex skips nothing, homepage indexable with one noindex page skips that page only, a deep-seeded audit with a noindex entry page skips nothing, a deep-seeded audit with an indexable entry page skips the noindex page, a homepage that answered 500 hands the decision to the entry page, neither fetched skips nothing.crawl/all-noindex-pageskeeps listing the noindex pages.packages/audit-engine/tests/cloud-merge.test.ts(+2): the server merge (runCloudSmartAuditswith a signal frombuildResolutionSignal). A noindex skip resolves that page's prior "No H1" while another page's stays open; a soft-404 skip (the control) carries. The noindex case fails without theresolution.tschange.packages/rules/tests/noindex-skip.test.ts(24): the pinned skip list and category exclusion, the runner gate (meta, header, googlebot-scoped header, indexable page, staging host, unknown site),noindexSource,isSiteIndexable(homepage, query page, other host, www and http, entry page by url and final url, errored homepage, bad base URL, neither fetched), the four site rules on the legacy path in all three states, and the resolution signal (that page only, folded aggregate, a realfoldOverflowChecksover mixed soft-404 and noindex skips, an untyped aggregate not trusted, soft-404 still carries, no cross-rule leakage).packages/audit-engine/tests/noindex-site-rules-dual-path.test.ts(4): each site rule on the legacy and the streamingsiteQuerypath over one seeded store, deep-equal, in all three states.rule-cache-codec.test.ts: the run context moves withsiteIndexable, all three states distinct.template-verdict-page-independence.test.ts: no template-scoped rule declaresskipOnNoindex.streaming-rules-golden(v1/v2 parity),golden-baseline,page-rule-site-context,template-fanout-equivalence-golden,template-fanout-parity-golden,rule-cache-replay-golden,site-query-content-rules-golden,site-query-link-rules-golden,page-features-noindex-golden,rate-limited-pages-e2e,soft404-confirm,soft-404,resolution,rule-verdict-scope,runner-applicability,no-contextual-inbound, synthetic-sitehttp-mode.tsgo --noEmitinpackages/rules,packages/audit-engineandapps/cli: clean. oxlint on the changed files adds no new errors (the remaining ones pre-date this PR). No file that was oxfmt-clean became unclean.tangly check --strictindocs/: all checks passed.Docs
docs/rules/index.mdxgains a Pages kept out of search section, the one place the behavior is explained: the seven rules (linked), what counts as noindex, the homepage/start-page guard for staging and preview deployments (with a table of the three outcomes), how a skipped check shows in reports and scores, and that accessibility, security, performance and the other link rules still run.core/robots-meta,crawl/indexabilityandcrawl/all-noindex-pageseach get a one-line pointer to it in their related rules.CHANGELOG.mdgets an## [Unreleased]entry under### Changedsaying scores can rise for sites with noindex pages, crediting @deniskern (Index rules should skip noindex pages, and core/robots-meta should report X-Robots-Tag: noindex #457).Not covered
<meta name="googlebot" content="noindex">) are not read by the parser, so they do not trigger the skip.none(meaningnoindex, nofollow) is not recognised byisPageIndexable.core/og-tags,core/canonical,content/word-count,schema/*) keep running and can be added later if the noise shows up.