Page MenuHomePhabricator

Surfacing Structured Tasks: internal Action API endpoint
Closed, ResolvedPublic5 Estimated Story Points

Description

User Story:

As a new, logged-in Wikipedia account holder, I want to receive a link recommendation based on the article I’m viewing, so I can confidently make my first edit with the support I need.


Task scope:

Create an internal Action Api endpoint that allows getting the recommendations for the current page

  • Retrieve link-recommendations from the database.
  • Ensure the user is logged in; if not, return an empty response.
  • The endpoint should only be enabled if the associated feature flag (T376677) is activated.

Evaluation: Evaluate the impact on the homepage and existing functionality of increasing the task pool by an order of magnitude, from 20K to 200K

Potential optimization: If the above new mediawiki/GE API endpoint is hit for an eligible page that does not have a recommendation, make a server API request to the recommendation-endpoint to retrieve new recommendations, storing them in the database and Cirrus search index, and then return those recommendations to the original request


Background

Current full-page editing experiences require too much context, patience, and trial and error for many newcomers to contribute constructively. To support a new generation of volunteers, we will increase the number and availability of smaller, structured, and more task-specific editing workflows (E.g. Edit Check and Structured Tasks). The Growth team will primarily focus on Structured Tasks, while working closely with the Editing team to ensure our work integrates well with Edit Check.

This project aims to address the following user problem: Getting started editing on Wikipedia is difficult and especially frustrating on mobile devices. I want the editing interface to provide the in-the-moment policy and technical guidance I need, so my initial efforts aren't reverted.

This project aims to achieve the following user outcome: As a new Wikipedia volunteer, I feel confident and enthusiastic about contributing to the Wikimedia movement by editing Wikipedia articles. The tools provided guide me step-by-step, limit distractions, and allow me to learn progressively so I can successfully contribute on my mobile device.

As part of the Growth team 2024/2025 Annual Plan, the Growth team will explore various ways to increase constructive activation on mobile. This is part of the Wikimedia Foundation 2024-2025 Annual Plan, specifically the Wiki Experiences 1.2 Key Result

Acceptance Criteria

Given a particular article,
When I query the internal Action API endpoint,
Then I can determine if the article has any associated link-recommendations
AND if yes, I receive data on the recommendation.

Note:

  • This doesn't need to be production ready.
  • This is only about tasks already populated in the links task pool. This is NOT about generating new tasks.

Event Timeline

KStoller-WMF set the point value for this task to 5.

Change #1081362 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/GrowthExperiments@master] [WIP]:Add API module for link recommendations

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

@KStoller-WMF , just a clarification on this AC from the task:

AND if yes, I receive data on the recommendation.

what kind of data would be expected from this endpoint(link recommendation data or task data )? cc: @Urbanecm , @Michael

Sorry, this task had rather vague acceptance criteria. 😬 I think we covered this in our meeting today, but in case it helps:

My understanding is that for the MVP we really just need:

"context_after" 
"context_before" 
"link_text"

from the Link recommendation Link object: https://api.wikimedia.org/wiki/Link_Recommendation_API/Reference/Link_object

However, if it's not much extra work, perhaps we want access to all of the Link object fields, as I can see how we might want to consider using some of the other data in the future to further improve the task.

"link_index" 
"link_target" 
"link_text" 
"match_index" 
"score" 
"wikitext_offset"

My understanding is that currently a Homepage token is necessary to trigger the Structured Task editing workflow. (For tasks initiated from the Homepage, Click ID is used to connect multiple Add Link sessions started from the same Homepage visit). But for this project, that isn't needed, so we can just generate that Click ID randomly.

Does that help? If you still have questions, please reach out to other engineers or me.

Yes, what @KStoller-WMF writes is already a very good start!
From my perspective we want the following:

1: for every-link suggestion that we have for the page (should usually be 2-3) at minimum:

  • "context_after"
  • "context_before"
  • "link_text"
  • "link_target"

In addition to that, whatever else is in that table, such as the things mentioned by Kirsten above, are also fine.

In general, that api is intentionally internal for now, so that we can iterate over it quickly and add the things we discover we still need and drop the things that we learn we don't need.

Change #1081362 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add internal API endpoint for link recommendations

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