Skip to content

fix(rules): exclude verbatim-repeated card microcopy from keyword-stuffing #2444 - #2449

Queued
longshore-nc9[bot] wants to merge 5 commits into
mainfrom
fix/2444-keyword-stuffing-card-microcopy
Queued

longshore-nc9[bot] wants to merge 5 commits into
mainfrom
fix/2444-keyword-stuffing-card-microcopy

Conversation

@longshore-nc9

@longshore-nc9 longshore-nc9 Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2444. content/keyword-stuffing now leaves text repeated verbatim across items, and navigation and menu link text, out of the density basis.

  • Cards: leaf texts of two or more words (headings included, digit runs masked) repeating at least 5 times are deducted, only when the page has at least 3 such different texts (a card grid's cycle). A single repeated phrase still counts in full. Words at 10% or more of the page are never deducted. The 24-card fixture (flat and wrapped) passes; the 'bademode '.repeat(100) control still warns.
  • Menus (maintainer decision on keyword-stuffing still warns on repeated product-card microcopy and menu link text (v0.0.191) #2444, reverses the content/keyword-stuffing: card microcopy, teaser and menu terms still warn on a real shop (#1315 residual) #1441 trade-off): a block of at least 6 links, at least 4 different labels and at least 85% link text is a link list and leaves the count. The menu-signal and keyword-cloud gates are gone, and the exclusion also applies inside a measured <main> or <article>. <nav>, role=navigation, header and footer chrome were already excluded. The 24-link Bademode Style collection category selection inspiration N menu plus one sentence does not warn. Stuffing in body copy next to a menu still warns, and so does a block repeating one anchor or with fewer than 4 labels. Menu words no longer count toward the 100-word minimum. Accepted cost: a doorway page of over 85% keyword links is not measured by this rule.
  • Tests that pinned the content/keyword-stuffing: card microcopy, teaser and menu terms still warn on a real shop (#1315 residual) #1441 trade-off (keyword-stuffing-pins-1441, keyword-stuffing, keyword-stuffing-regions-3544) were rewritten to the new behaviour. The new menu tests fail without the source change.

Commands: bun test on all keyword-stuffing* tests, item-finding-identity, inconclusive-info-1031, content-no-dom-mutation, page-type-skip-841, reading-level-code-blocks-1639, streaming-rules golden, golden-finding-messages, docs-rule-pages, docs-category-table, verdict-scope and template-verdict tests, bun run docs:check, tsgo typecheck in packages/rules, oxfmt --check and oxlint on the changed files (one existing prefer-dom-node-dataset lint error in keyword-stuffing-regions-3544.test.ts:23 predates this change).

Docs: docs/rules/content/keyword-stuffing.mdx. Skill: none.

@longshore-nc9
longshore-nc9 Bot marked this pull request as ready for review December 1, 2026 09:54
@longshore-nc9

longshore-nc9 Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Automated review

Reviewed at 1ae5f35 against #2444 and the maintainer decision on the menu case (fix it). Ran on Bun 1.4.4: all 8 keyword-stuffing-adjacent test files (158 tests, 0 fail); oxfmt --check clean on the 5 changed files; oxlint on the changed files shows one error, see finding 5. Scratch probes (since removed, nothing left in the tree) compared this head against origin/main.

Findings, ranked

  1. Docs send users to a rule that does not cover the stated gap (verified, blocking). docs/rules/content/keyword-stuffing.mdx says a doorway page built only of keyword links "is not measured here; [integrity/seo-doorway] covers that shape". integrity/seo-doorway only fires on a fixed lexicon (clickfunnels, kajabi, affiliate, make money online, passive income, best funnel, sales funnel) with one of those in the title. A link farm of cheap viagra online pharmacy uk/us/de/... anchors is covered by neither rule. Reword the docs (drop the claim, or say the shape is not covered) and match the code comment, which says only "accepted cost".

  2. The keyword-anchor-spam edges of the new menu heuristic are untested (verified, blocking). The only "still warns" link test is 80 copies of one anchor. Probes on this head against main:

    • 40 anchors cheap viagra online pharmacy <uk|us|de|fr|es> in one div, plus 300 words of copy: main warns, PR passes.
    • 60 keyword anchors in one <p> (4 labels): main warns, PR passes.
    • 40 <li><a> links with 4 labels: PR passes. With 3 labels it warns. The 4-label floor is therefore one extra label away from a bypass.
    • The same anchors separated by plain text ("... and"): still warns, because the 85% share fails.

    The maintainer accepted the loss for doorway-shaped pages, so this is not a request to revert. But no test pins the boundary: fewer than 4 labels warns, fewer than 6 links warns, link text just under 85% warns, and the 4-label case is deliberately excluded. Add those so a later change cannot move the edge unnoticed.

  3. The "verbatim sibling" deduction does not check siblings (verified, medium, non-blocking). repeatedVerbatimText counts any leaf p/span/div/li/dd/dt/small/h1-h6 text that repeats at least 5 times anywhere under the root, with at least 3 such texts. Three phrases, 8 <p> each (cheap shoes online, buy shoes now, best shoes london), plus 250 words of prose: main warns on shoes, PR passes. The words stay under the 10% raw-density guard and are deducted down to the floor. The docs already state the 20% cap and the 1.5% floor, so this is a known, bounded cost, but it is wider than "siblings in a card grid". Consider requiring the repeats to sit under at least N distinct parents. At minimum, add a test that documents this residual, because none exists. Acceptance criterion 3 is met in practice for the card fixtures, flat and wrapped.

  4. Performance stays linear (verified, no action). 2k, 8k and 32k card divs inside <main> ran in 50, 115 and 408 ms. A 3000-anchor nested fixture took 48 ms and a 2000-deep chain took 607 ms, against 791 ms on main. Work is bounded by LINK_LIST_MAX_ANCHORS, LINK_LIST_MAX_DEPTH, CARD_MAX_SCANNED and CARD_MAX_ELEMENTS. Dropping the signal gate means more candidates reach the textContent read, but that is bounded by depth 8.

  5. oxlint error in keyword-stuffing-regions-3544.test.ts:23 is pre-existing (verified, no action). prefer-dom-node-dataset at line 23:25 reproduces on origin/main, and the PR's hunk in that file starts at line 78. The merge-queue lint gate covers only apps/cli, packages/synthetic-site and packages/report, so it is not a gate for this package either.

  6. DCO, changelog, docs (verified). All 4 commits carry Signed-off-by: nc9. changelog.d/2444-keyword-stuffing-card-microcopy.fixed.md is present and ends (#2444). The rule page is updated.

Acceptance criteria (#2444)

All five are met. Criteria 1, 2 and 4 each pass on the head. Criterion 3 is met for card grids. The maintainer decision was recorded (fix it) and the test matches it. Both fixtures have regression tests in keyword-stuffing-verbatim-2444.test.ts.

Post-merge checks

None.

VERDICT: changes-requested

@longshore-nc9

longshore-nc9 Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Automated review

Delta review at 5a95a0f (previous review at 1ae5f35, changes-requested). Bun 1.4.4. Read-only: scratch probes lived in /tmp and the tree is clean.

Ran: bun test on all keyword-stuffing* tests plus item-finding-identity, inconclusive-info-1031, content-no-dom-mutation (6 files, 132 pass, 0 fail). oxfmt --check is clean on the 5 changed .ts files. oxlint -c apps/cli/oxlint.config.mjs reports one error, keyword-stuffing-regions-3544.test.ts:23 prefer-dom-node-dataset. That line is not in the PR's hunk (the hunk starts at line 78) and the error reproduces on origin/main.

Previous findings

  1. Docs claim, resolved (verified). keyword-stuffing.mdx now says no other rule checks this shape and that integrity/seo-doorway fires only on a fixed phrase list in the title.
  2. Keyword-anchor-spam probes, resolved (verified). The 4-label <ul> farm, the 40-anchor 5-label farm, the 60-anchor paragraph and the 24-distinct-label paragraph all warn on this head. They are pinned in keyword-stuffing-verbatim-2444.test.ts, along with the boundaries: fewer than 4 labels, fewer than 6 links, link text under 85%, and 24 distinct labels being navigation.
  3. Verbatim deduction needs sibling structure, resolved (verified). Three phrases repeated 8 times between prose paragraphs now warn on shoes, and a test pins it. The same phrases in a run of siblings are deducted.
  4. keyword-stuffing still warns on repeated product-card microcopy and menu link text (v0.0.191) #2444 menu, resolved (verified). The 24-link Bademode Style collection category selection inspiration N menu plus one sentence does not warn, and it passes inside <nav>, role=navigation, header, footer and a measured <main>. Stuffing in body copy next to the menu still warns.
  5. Older tests changed from repeating to distinct labels. This hides no regression. Reverting to the old repeating shapes on this head: 24 links with 6 repeated labels (emergency plumber <city>) warn on plumber, and 20 links with 5 repeated labels (bademode <word>) warn on bademode. Tests assert the repeating shapes warn (5, 4, 3 and 2 labels over many links). The numbered variants are left out by design.

New findings

  1. The 30-link cap on a one-keyword block is trivially evaded by splitting (verified, medium, non-blocking).

    • On this head, 100 distinct keyword links (cheap viagra online pharmacy gNnM) in five <div> or <ul> groups of 20, plus 200 words of copy, pass. On origin/main they warn.
    • The same 40 links in one block warn, so only the grouping decides.
    • Each 20-link group is judged alone; the ancestor holding all 100 links is not a list, but its children are.
    • This is the accepted doorway cost, so it is not a blocker. The code comment and docs ("a keyword shared by more than 30 links counts as copy") read as a bound on the page, though it is a bound per block. Suggest saying "in one block" in the docs, and ideally also counting the dominant term across sibling list blocks.
  2. Other new evasion probes, all within the accepted cost (verified, informational). These pass:

    • A 25-link menu with 3 stuffed-term labels and 22 distinct other labels, plus 150 words of copy.
    • 25 distinct all-keyword labels.
    • 30 distinct keyword links in a div.
    • 20 links sharing one keyword with otherwise different words.
    • 28 distinct keyword links in <main>.
    • Five 6-link columns of keyword links.

    These warn:

    • 40 numbered <li> links with 2 repeated labels.
    • 24 links where each of 12 labels repeats twice.
    • 25 links where the last 6 repeat one label.
    • A 40-link footer block, through keyword-stuffing-footer (the density check itself passes).
  3. Docs wording imprecise (verified, low). The docs say "at least half of the links carry a label no other link has". The code uses labels.size >= links * 0.5 (distinct label count), a looser condition. It decides only the no-dominant-term case: 24 links as 12 labels each used twice, with varied words, is left out although none of the links has a unique label.

Acceptance criteria (#2444)

All five are met: the card fixture (flat and wrapped) does not warn; the 'bademode '.repeat(100) control warns; verbatim repeated sibling text leaves the density basis; the maintainer decision (fix the menu) is recorded and the menu fixture test matches it; both fixtures have regression tests.

Post-merge checks

None.

VERDICT: approve

@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@nc9
nc9 added this pull request to the merge queue Dec 1, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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.

keyword-stuffing still warns on repeated product-card microcopy and menu link text (v0.0.191)

1 participant