Skip to content

fix(rules): report a linked but uncrawled privacy policy, not create advice #672 - #743

Merged
nc9 merged 1 commit into
mainfrom
fix/eeat-privacy-linked-uncrawled-672
Oct 13, 2026
Merged

nc9 merged 1 commit into
mainfrom
fix/eeat-privacy-linked-uncrawled-672

Conversation

@nc9

@nc9 nc9 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Closes #672.

What changed

eeat/privacy-policy looked for the policy only among crawled pages. When the crawl excluded the policy's path (/policies/** on a Shopify storefront) or reached its page limit first, the rule warned No Privacy Policy page found and advised creating a page that every footer already links to. legal/privacy-policy already credited the same link, so the two rules disagreed.

When no crawled page is the policy, the rule now looks for a link to one that the crawl did not fetch. It uses the same acceptance as legal/privacy-policy: an href matching a privacy slug anywhere on the site wins, then anchor text.

Case Outcome
A crawled page is the policy pass Privacy Policy page exists (unchanged)
Linked, not crawled info Privacy Policy linked but not crawled, value = link target, details.linkedFrom
Linked, not crawled, and the internal link probe saw a 4xx/5xx warn Privacy Policy link returns N (401, 403 and rate limits stay info, as in links/broken-links)
No policy and no link warn No Privacy Policy page found / Create /privacy-policy page (unchanged)
  • Coverage check: privacy-linked still runs when the link matched a slug. It is skipped for a text-only match, because coverage counts slug links.
  • Crawled targets: a linked page the crawl did fetch is not "uncrawled". It was checked, and it keeps today's verdict.
  • No new requests: the only status the rule reads is one the internal link probe already recorded (SiteData.linkTargetStatuses), and the probe never requests an excluded or robots-disallowed path.

The lookup and the check builder live in packages/rules/src/shared/linked-uncrawled-page.ts, so eeat/about-page and eeat/contact-page (#740) reuse them next. shared/privacy-page.ts now exports isPrivacyLinkText, and privacyLinkHref uses it, with unchanged behaviour.

Acceptance criteria

  • Linked page excluded from the crawl: no No Privacy Policy page found and no Create /privacy-policy page. It gets info Privacy Policy linked but not crawled.
  • No link and no policy (fixture "missing") still warns with the create advice.
  • Linked and crawled with HTTP 200 (fixture "allowed") passes.
  • Fixture "excluded" yields the not-checked outcome.
  • The three-origin fixture is turned into unit tests (packages/rules/tests/eeat-privacy-policy-not-crawled.test.ts). It also covers a probed 404, 410, 200, 403 and 429, a text-only link, slug over text precedence, a crawled target, a redirect target and mailto:/javascript: links.
  • docs/rules/eeat/privacy-policy.mdx quotes the message templates (the coverage messages were filled examples and now read N%) and has a section on excluded and uncrawled policies. make validate passes.

Verification

  • bun test packages/rules/tests/eeat-privacy-policy-not-crawled.test.ts packages/rules/tests/eeat-page-detection.test.ts packages/rules/tests/ws4-rule-batches.test.ts: 66 pass.
  • bun test packages/rules/tests/privacy-page-detection.test.ts: 22 pass.
  • bun test packages/audit-engine/tests/streaming-rules-canonical-golden.test.ts: 1 pass. No re-pin; the rule count is unchanged at 308.
  • tsgo --noEmit in packages/rules: clean. oxfmt and oxlint are clean on the changed files.
  • make validate in docs/: all checks passed.

Score effect

An audit whose policy is linked but excluded or past the page limit goes from warn to info on privacy-policy, and now also gets the privacy-linked coverage check. Nothing that passed before warns.

Agent skill

No change needed. The squirrelscan skill does not describe this rule's messages.

…advice #672

eeat/privacy-policy only looked for the policy among crawled pages, so a
crawl that excluded `/policies/**` (or hit its page limit first) got "No
Privacy Policy page found" and advice to create a page every footer
already links to.

When no crawled page is the policy, look for a link to one the crawl did
not fetch (slug first, then anchor text, as legal/privacy-policy does):
info "Privacy Policy linked but not crawled", or a warning "Privacy Policy
link returns N" when the internal link probe saw a 4xx/5xx. No new
requests. The lookup lives in shared/linked-uncrawled-page.ts so the
about and contact rules (#740) can reuse it.

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 marked this pull request as ready for review October 13, 2026 11:49
@claude

claude Bot commented Oct 13, 2026

Copy link
Copy Markdown

Reviewed the diff. The change is sound: it reuses the existing linkTargetStatuses probe data, makes no new requests, and the tests cover the main paths (missing, crawled, excluded, probed 404/403/429, redirect, mailto/javascript). CI was still pending when I looked, so I haven't seen test, lint or typecheck results.

  • (low) packages/rules/src/shared/linked-uncrawled-page.ts:92 The probe lookup is a linear .find with normalizeUrl on every probe entry. It runs once per rule on a few probes, so it's fine now. Building a Map would be cleaner if about/contact reuse the helper on large link sets.
  • (nit) linked-uncrawled-page.ts:84 Text-only matching is loose ("Manage Privacy Preferences" passes), which the docs acknowledge. Only a first-party text-only link is reported, and it's info, so the risk is low. Consider a test pinning that a cookie-settings-only site yields info rather than the 'create' warn, if that is the intended behaviour.
  • (nit) Consider a test for a probed 5xx (for example 503), since the broken check covers any status of 400 or above except the excluded ones.

No blocking issues.

@nc9

nc9 commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Review triage (no code change, so no new push or CI round):

  • (low) linear .find over linkTargetStatuses: kept as is. The lookup runs once per rule call, after a single target has been chosen, so it is one pass over at most internal_links.max_targets probe rows, not a per-link cost. eeat/about-page, eeat/contact-page: advise creating a page that is linked but excluded from the crawl #740 reuses the helper the same way, one call per rule, so a Map would not change the cost.
  • (nit) text-only matching is loose: this is intended, and it is the acceptance legal/privacy-policy already uses. A cookie-settings-only link to an uncrawled URL gives info Privacy Policy linked but not crawled with that URL as the value, never a pass, and the docs say a text-only match gets no coverage check. One correction to the review: the helper does not restrict to first-party links. An external policy link is also reported as linked but not crawled, which is accurate, since the crawl never fetches other hosts.
  • (nit) probed 5xx test: a plain 503 is broken by the same >= 400 branch the 404 and 410 tests pin. A 503 with Retry-After reaches the helper as rateLimited: true, which the 429 test pins. Both branches are covered, so no extra case was added.

@nc9
nc9 merged commit 7b81795 into main Oct 13, 2026
16 checks passed
@nc9
nc9 deleted the fix/eeat-privacy-linked-uncrawled-672 branch October 13, 2026 12:03
nc9 added a commit that referenced this pull request Oct 13, 2026
…g a linked page that was not crawled; only same-host links count #740 (#745)

Reuses the shared linked-uncrawled-page helper from #743. The helper now counts only links to the linking page's own host, which also closes a gap in eeat/privacy-policy (a third-party privacy link such as reCAPTCHA's hid a real missing-policy warning).

Fixes #740

Signed-off-by: Nik Cubrilovic <[email protected]>
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.

eeat/privacy-policy recommends creating an existing excluded policy

1 participant