Page MenuHomePhabricator

Section suggestions: Appendix sections should not be considered as valid suggestions for sections
Closed, ResolvedPublic2 Estimated Story Points

Description

Currently, the Recommendation API considers a section suggestion valid and returns is as a recommendation, only it if has at least one missing section.

Similarly, if the size filter is present, a section suggestion is required to have at least one missing section that falls within the requested size range, in order to be considered valid.

This task proposes to only consider non-appendix missing sections when validating the section suggestions in Recommendation API, so that we do not suggest to the user section suggestions that only have appendix sections missing, or suggest section suggestions with only appendix easy sections when easy section suggestions are requested.


Derived Requirement

Update the Recommendation API to exclude appendix sections when validating section suggestions. The API should only consider non-appendix missing sections as valid suggestions.
If all missing sections are appendix sections, they should not be returned as valid recommendations, regardless of size filter or difficulty level (e.g., “easy” sections).

Test Steps

Test Case 1: Ensure appendix-only section suggestions are not returned

  1. Access the Recommendation API endpoint on beta wiki.
  2. Request section suggestions for an article that only has missing appendix sections (e.g., “References”, “Bibliography”, “External links”).
  3. ✅❓❌⬜ AC1: Confirm that the API does not return any section suggestions for appendix-only sections.

Test Case 2: Ensure non-appendix section suggestions are still returned

  1. Access the Recommendation API endpoint.
  2. Request section suggestions for an article that has missing non-appendix sections (e.g., “History”, “Geography”).
  3. ✅❓❌⬜ AC2: Confirm that valid section suggestions are returned for non-appendix sections.

Test Case 3: Ensure appendix sections are excluded when size filter is applied

  1. Access the Recommendation API endpoint with a size filter applied (e.g., medium).
  2. Request section suggestions for an article with both appendix and non-appendix missing sections.
  3. ✅❓❌⬜ AC3: Confirm that only non-appendix missing sections within the requested size range are included in the results.

Test Case 4: Ensure appendix sections are excluded for “easy” section suggestions

  1. Access the Recommendation API endpoint with the difficulty filter set to “easy”.
  2. Request section suggestions for an article with only appendix sections labeled as “easy”.
  3. ✅❓❌⬜ AC4: Confirm that no “easy” appendix sections are returned as valid suggestions.

QA Results - TestWiki

Event Timeline

ngkountas renamed this task from Section suggestion: Appendix sections should not be considered as valid suggestions for sections to Section suggestions: Appendix sections should not be considered as valid suggestions for sections.Sep 8 2025, 3:22 PM
ngkountas triaged this task as High priority.
ngkountas set the point value for this task to 2.
ngkountas moved this task from Prioritized to Needs Code Review on the LPL Hypothesis board.

Change #1185968 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[research/recommendation-api@master] section recommendations: filter out appendix sections from missing

https://gerrit.wikimedia.org/r/1185968

Change #1185968 merged by jenkins-bot:

[research/recommendation-api@master] section recommendations: filter out appendix sections from missing

https://gerrit.wikimedia.org/r/1185968

Change #1186961 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update Recommendation API to 2025-09-10-080042-production

https://gerrit.wikimedia.org/r/1186961

Change #1186961 merged by jenkins-bot:

[operations/deployment-charts@master] Update Recommendation API to 2025-09-10-080042-production

https://gerrit.wikimedia.org/r/1186961

Mentioned in SAL (#wikimedia-operations) [2025-09-10T13:05:10Z] <kart_> Updated Recommendation API to 2025-09-10-080042-production (T403730, T403976, T400562)

@ngkountas, Basically, it's ok for these sections to appear in the missing, but the missing should not contain only such sections; we need at least one non-appendix to be valid. I just conducted some spot checks, and we'll revisit this if needed, as it would be challenging to test all recommendations to identify any issues. Upon reviewing the API requests, I did not find any. I will move this to Sign-off. Thanks for all your work!

"Works",
"Publications",
"Bibliography",
"Discography",
"Filmography",
"See also",
"Notes",
"Citations",
"References",
"Further reading",
"External links"

Test Result - Test Wiki

Status: ✅ PASS
Environment: Test Wiki
OS: macOS Tahoe 26.0.1
Browser: Chrome 140
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://api.wikimedia.org/service/lw/recommendation/api/v1/translation/sections?source=en&target=es

Test Steps

Test Case 1: Ensure appendix-only section suggestions are not returned

  1. Access the Recommendation API endpoint on Test Wiki.
  2. Request section suggestions for an article that only has missing appendix sections (e.g., “References”, “Bibliography”, “External links”).
  3. AC1: Confirm that the API does not return any section suggestions for appendix-only sections.

2025-10-07_10-18-48.png (1,901×926 px, 300 KB)

Test Case 2: Ensure non-appendix section suggestions are still returned

  1. Access the Recommendation API endpoint.
  2. Request section suggestions for an article that has missing non-appendix sections (e.g., “History”, “Geography”).
  3. AC2: Confirm that valid section suggestions are returned for non-appendix sections.

2025-10-07_10-16-49.png (1,545×824 px, 236 KB)

Test Case 3: Ensure appendix sections are excluded when size filter is applied

  1. Access the Recommendation API endpoint with a size filter applied (e.g., medium).
  2. Request section suggestions for an article with both appendix and non-appendix missing sections.
  3. AC3: Confirm that only non-appendix missing sections within the requested size range are included in the results.

2025-10-07_11-57-01.png (1,564×1,298 px, 381 KB)

Test Case 4: Ensure appendix sections are excluded for “easy” section suggestions

  1. Access the Recommendation API endpoint with the difficulty filter set to “easy”.
  2. Request section suggestions for an article with only appendix sections labeled as “easy”.
  3. AC4: Confirm that no “easy” appendix sections are returned as valid suggestions.

2025-10-07_12-00-14.png (1,473×1,235 px, 373 KB)

GMikesell-WMF changed the task status from Open to In Progress.Oct 7 2025, 7:48 PM
GMikesell-WMF moved this task from Needs QA to In-progress on the LPL Hypothesis board.