Repository navigation
Conversation
nc9
force-pushed
the
boat/near-duplicate-1369
branch
from
November 16, 2026 04:58
8b166bc to
6510f1a
Compare
…early identical (repo#1369) Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
boat/near-duplicate-1369
branch
from
November 17, 2026 01:49
6510f1a to
e3bde54
Compare
Contributor
Author
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.
Adds
content/near-duplicate, a site rule that groups indexable pages whose main text is nearly identical, beyond the exact matchescontent/duplicate-contentfinds (squirrelscan/repo#1369).How it works
main/[role=main], else body, with nav, header, footer, aside, form, menu, landmark roles and aria-hidden subtrees dropped) over word 3-shingles. Each distinct shingle votes once, so a repeated sentence template cannot out-vote a page's own text. Pages under 100 main-text words, redirects and bodyless pages get no hash. Token count is capped at 20,000 per page.PageFeatureRow.contentSimhash(16 hex chars): SQLite schema 41 -> 42 (additiveALTER TABLE page_features ADD COLUMN content_simhash TEXT), filled byextractPageFeatureson the streaming path. The legacy path calls the samepageContentSimhash. Rule cache prc-7 -> prc-8.content/duplicate-content's fingerprint, and a cluster needs at least two distinct texts, so exact copies are not double-reported. Canonicalised clusters, hreflang alternates, noindex, non-2xx and paginated URLs are excluded, the same as in duplicate-content.Design notes for review
integrity/seo-doorway: that is a page rule for injected off-topic affiliate posts. A test runs it over a 12-page location-doorway cluster: it reports nothing, and near-duplicate reports one cluster. There is one finding per cluster.healthScore.overallis unmoved at 56.Acceptance criteria
packages/rules/tests/near-duplicate.test.ts, the exact-duplicate tests also runduplicateContentRule.contentSimhashcolumn added and populated in both paths:page-features-content-simhash.test.tsand thepage-features-store.test.tsround-trip. Timer tests confirm a 1 ms interval ticks during the streaming rule run (4,000 hashes) and the legacy run (300 parsed pages). The 500-page canonical golden passes in 32 s.docs/rules/content/near-duplicate.mdxis added. Content counts 28 -> 29 in the README, docs index, rules index and seo index. The constants comment reads 333 enabled rules.Gates
make validatein docs: exit 0prefer-math-truncon>>> 0, the same as existing files.Agent skill
No change needed: the skill does not list rules by name or count.
Not done
The real-site smoke test (AGENTS.md step 9) needs network access, which this environment does not have. It is filed as a follow-up.