feat(special): add Special:MostLinkedCategories report - #1975
feat(special): add Special:MostLinkedCategories report#1975bohdansolovie wants to merge 1 commit into
Conversation
Rank the wiki's topics by how many published articles are tagged with each one and serve the ranking at /wiki/special/mostlinkedcategories.json - the MediaWiki "Most used categories" maintenance report. It complements the alphabetical Special:Categories index by surfacing the largest, best-covered topics first, the category-side counterpart to Special:MostLinkedPages. The ranking is a pure function (scripts/most-linked-categories.js) shared by the endpoint and the regression check, derived from the same public/data/categories.json the Special:Categories page already reads. Each entry exposes the same per-topic hub and feed companion URLs categories.json does, so a consumer can switch between the two orderings without changing how it reads a row. Wired the check into postbuild and a test:most-linked-categories script.
|
Verdict: Close Final action: close. PR #1975: feat(special): add Special:MostLinkedCategories report Codex and Claude both found this should not merge. Codex review: The new Because this adds a permanent endpoint plus postbuild maintenance code without removing a present harm, it should not be merged as-is. Claude advisory review: Reasoning:
Risks:
Why closed:
Automated review by Taopedia Site Maintainer. |
Summary
Adds the Special:MostLinkedCategories maintenance report (MediaWiki's "Most used categories") at
/wiki/special/mostlinkedcategories.json: the wiki's topics ranked by how many published articles are tagged with each one, most-used first.scripts/most-linked-categories.js— purebuildMostLinkedCategories({ categoriesIndex })ranking helper.src/pages/wiki/special/mostlinkedcategories.json.ts— the JSON endpoint.scripts/check-most-linked-categories.js— regression check (unit tests + built-output contract + sibling cross-check), wired intopostbuildand atest:most-linked-categoriesscript.Why This Should Ship
The existing
Special:Categoriesindex lists topics alphabetically, so nothing on the site surfaces which topics are largest / best-covered (or which are nearly empty). This is the category-side counterpart to the existingSpecial:MostLinkedPages, and completes the set of MediaWiki topic-maintenance reports for editors and programmatic consumers (dashboards, navigation, coverage tooling). On the current content it ranks 41 topics, topSubnets(253 articles) down to single-article topics.It reuses the same
public/data/categories.jsonartifact theSpecial:Categoriespage already reads and the samecategorySlug/compareTitleshelpers, so the two surfaces can never disagree on which topics exist or how many articles each has — only the ordering differs. Distinct-member counting and empty-topic dropping matchbuildCategoriesexactly, so a duplicated frontmatter category can't inflate a rank.Review Notes
Special:WantedPages/Special:LonelyPages/Special:DeadEndPages).categories.jsondoes (url,articlesUrl/articlesJsonUrl,feedUrl/feedJsonUrl,atomUrl,rssUrl) for consistency across the two orderings.npm run buildpasses end-to-end (all existing postbuild checks + the newcheck-most-linked-categories.js). The new check unit-tests the ranking (distinct counts, empty-topic drop, numeric tie ordering), re-derives the expected report fromcategories.jsonand asserts the built JSON field-for-field in count-desc order, and cross-checks the siblingcategories.jsonso the two can't drift.Target Branch
testmainonly because it promotestestto productionSecurity Checklist