Skip to content

feat(page-cluster): merge clusters sharing a rare landmark variant#914

Merged
YusukeHirao merged 2 commits into
devfrom
feat/page-cluster-merge-rare-landmark-clusters
Jul 7, 2026
Merged

feat(page-cluster): merge clusters sharing a rare landmark variant#914
YusukeHirao merged 2 commits into
devfrom
feat/page-cluster-merge-rare-landmark-clusters

Conversation

@YusukeHirao

Copy link
Copy Markdown
Member

Summary

  • Reimplements the previously withdrawn "landmark-gated tertiary cluster" mechanism (mergeRareLandmarkClusters, default false) with the missing safeguard: a header/footer/nav/aside match only counts as merge evidence when that specific variant is rare corpus-wide (landmarkRarityThreshold), not merely identical — the withdrawn prototype merged on identity alone and over-merged on real crawl data since header/footer/nav are present on 99%+ of pages.
  • New merge-landmark-affined-clusters.ts (mergeLandmarkAffinedClusters() / validateMergeLandmarkAffinedClustersOptions()), wired into resolvePageClusterKeys(). Re-keying happens at page granularity, not whole-cluster, so a coincidental match between a couple of outlier pages cannot drag their entire, otherwise-unrelated clusters together.
  • README and package.json exports updated; new subpath @d-zero/page-cluster/merge-landmark-affined-clusters.

Test plan

  • yarn lint — 0 errors
  • yarn build — all 28 packages build
  • yarn test — 1467/1467 pass (monorepo-wide)
  • Went through /code-review xhigh (9 confirmed/plausible findings fixed: missing self-validation, partial-evidence-applied-to-whole-cluster over-merge, landmark-markup leaking into the "independent" content gate, unsafe token-set canonicalization, broken JSDoc cross-references) and /qa-engineer (added a regression test for a previously-untested fuzzy landmark-variant-matching code path)
  • Real-corpus validation (out of scope for this change — the crawl data used for the withdrawn prototype's original validation is not in this repository; ships with synthetic-fixture unit/regression tests only)

🤖 Generated with Claude Code

Reimplements a previously withdrawn "landmark-gated tertiary cluster"
mechanism with the missing safeguard: a header/footer/nav/aside match only
counts as merge evidence when that specific variant is rare corpus-wide
(landmarkRarityThreshold), not merely identical. The withdrawn prototype
merged on identity alone and over-merged on real crawl data, since
header/footer/nav are present on 99%+ of pages.

Adds `mergeRareLandmarkClusters` (default false) to resolvePageClusterKeys,
backed by a new mergeLandmarkAffinedClusters()/validateMergeLandmarkAffinedClustersOptions()
pair in a new file. Re-keying happens at page granularity, not whole-cluster,
so a coincidental match between a couple of outlier pages cannot drag their
entire, otherwise-unrelated clusters together.

Real-corpus validation is out of scope for this change (the crawl data used
previously is not in this repository); this ships with synthetic-fixture
unit and regression tests only.
@YusukeHirao YusukeHirao requested a review from yusasa16 as a code owner July 7, 2026 01:55
@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@YusukeHirao YusukeHirao merged commit 62a512b into dev Jul 7, 2026
6 checks passed
@YusukeHirao YusukeHirao deleted the feat/page-cluster-merge-rare-landmark-clusters branch July 7, 2026 03:03
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.

1 participant