Page MenuHomePhabricator

[SPIKE] Review hCaptcha measurement plan
Closed, ResolvedPublic

Description

The Product Safety and Integrity team is testing a bot detection service (hCaptcha) as a possible replacement for the current CAPTCHA system.

In a deployment planned for Q2 (2025 - 2026), the team will release hCaptcha in 99.9% passive mode on several wikis, and in 100% passive mode [i] on enwiki/frwiki in the source/wikitext editor [ii] and move to a 99.9% passive mode after one week of data collection
This task involves the work of:

  1. Editing + Product Analytics:
    1. Document the metrics we need to be gathered as part of this trial so that we can evaluate its impact on the core editing funnel
    2. Review instrumentation plan (@EMill-WMF to link) being added as part of this trial and ensure it accords with established patterns in EditAttemptStep and VisualEditorFeatureUse. E.g. T409701.
  2. Product Safety and Integrity
    1. Confirm key editing metrics (see below) are implemented in a way that will enable Editing to evaluate

Open questions

  • 1. At what point in the editing funnel will requests be sent off to hCaptcha? Knowing this will enable the Editing Team to determine the point from which to look at the metrics listed below.
    • The hcaptcha.request() method is invoked when the user presses "Publish changes" in the wikitext editor. This introduces a period of latency while hCaptcha responds with a token, or in rare cases (~0.1% of sessions), a challenge. After the challenge is completed, a token is provided and the form submission continues.

Editing key metrics

WARNING: this section will not be considered final and ready for review by Product Safety and Integrity until @MNeisler has singed off on its completeness and accuracy.
Learning objectiveMetric(s)Notes
Edit completion: What proportion of people go on to publish an edit after reaching the point in the editing funnel when a request is sent off to hCaptcha?Use existing EditAttemptStep data. All users without skipcaptcha right will have hcaptcha.execute() evaluated as part of form submission. The VisualEditorFeatureUse event for hcaptcha_execute will make this more explicit in the funnel (T410146).
Time to save: How much time does hCaptcha introduce into the publishing process?We are tracking hcaptcha.execute() p10, p50, p90 in the Grafana dashboard and will have this segmented for edit interactions (T410008)
Edit abandonment: What proportion of people abandon edits after reaching the point in the editing funnel when a request is sent off to hCaptcha?The event generated in T410146: hCaptcha: Generate VisualEditorFeatureUse event when hCaptcha execute is invoked will allow for tracking this alongside existing data in EditAttemptStep
No-JS users: What % of edits are blocked from publishing b/c someone is attempting to edit without JS enabled?The data from rEWED7c1b4b8e13fd: EventLogging: Fix wikitext editor interface detection shows that approximately 0.6% of sessions from users without skipcaptcha are editing without JS
Edit quality: How does the rate at which edits are reverted or cause an AbuseFilter to become activated vary between edits included as part of this trial and those that are not?Measuring AbuseFilter trips is possible with the saveFailure event. We can track whether these drop for wikis with hCaptcha enabled. For revert rate, we can compare how things change between the week of 100% passive data on enwiki and frwiki and the subsequent shift to 99.9% passive
[nice to have] Editor retention: How does editor retention vary among people whose edits are sent off to hCaptcha and those that are not?This involves looking at retention rates for users who don't have skipcaptcha right, which is all new user accounts

i. Where "100% passive mode" means all edit included in the trial:

  • Will be submitted to hCaptcha client for evaluation
  • Will NOT be presented with a puzzle/challenge

ii. A trial of hCaptcha within visualeditor-based editing interfaces will occur at a later time.

Event Timeline

ppelberg renamed this task from [SPIKE] Review hCaptcha to [SPIKE] Review hCaptcha measurement plan.Mon, Nov 10, 8:29 PM

Edit completion: What proportion of people go on to publish an edit after reaching the point in the editing funnel when a request is sent off to hCaptcha?

To clarify, here we want to understand two things:

  • users who press "Submit" but close the tab/window or otherwise abandon the form before hCaptcha responds with a token
  • users who encounter a visual challenge (0.1% of sessions) and don't complete the challenge

For the latter, we can look at events from T409701: hCaptcha: Log challenge event as "saveFailure" in EditAttemptStep. For the former, we might need to add an additional VEFU event for hcaptcha_token_requested or something like that, fired when hcaptcha.execute() is invoked.

Change #1204384 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikiEditor@master] EventLogging: Expand on no-js logging

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

Change #1204384 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] EventLogging: Expand on no-js logging

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

Change #1204662 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.2] EventLogging: Expand on no-js logging

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

Change #1204663 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.1] EventLogging: Expand on no-js logging

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

Change #1204663 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.1] EventLogging: Expand on no-js logging

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

Change #1204662 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.2] EventLogging: Expand on no-js logging

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T20:17:43Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1204663|EventLogging: Expand on no-js logging (T409779 T263505)]], [[gerrit:1204662|EventLogging: Expand on no-js logging (T409779 T263505)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T20:20:22Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1204663|EventLogging: Expand on no-js logging (T409779 T263505)]], [[gerrit:1204662|EventLogging: Expand on no-js logging (T409779 T263505)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-12T20:27:58Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204663|EventLogging: Expand on no-js logging (T409779 T263505)]], [[gerrit:1204662|EventLogging: Expand on no-js logging (T409779 T263505)]] (duration: 10m 15s)

Change #1204669 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikiEditor@master] EventLogging: Fix EditAttemptStep and VEFU logging

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

Change #1204678 had a related patch set uploaded (by DLynch; author: Kosta Harlan):

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.2] EventLogging: Fix wikitext editor interface detection

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

Change #1204679 had a related patch set uploaded (by DLynch; author: Kosta Harlan):

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.1] EventLogging: Fix wikitext editor interface detection

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

Change #1204678 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.2] EventLogging: Fix wikitext editor interface detection

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

Change #1204679 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@wmf/1.46.0-wmf.1] EventLogging: Fix wikitext editor interface detection

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T21:43:26Z] <kemayo@deploy2002> Started scap sync-world: Backport for [[gerrit:1204678|EventLogging: Fix wikitext editor interface detection (T409779)]], [[gerrit:1204679|EventLogging: Fix wikitext editor interface detection (T409779)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T21:46:07Z] <kemayo@deploy2002> kemayo: Backport for [[gerrit:1204678|EventLogging: Fix wikitext editor interface detection (T409779)]], [[gerrit:1204679|EventLogging: Fix wikitext editor interface detection (T409779)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Change #1204669 merged by jenkins-bot:

[mediawiki/extensions/WikiEditor@master] EventLogging: Fix wikitext editor interface detection

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T21:51:14Z] <kemayo@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204678|EventLogging: Fix wikitext editor interface detection (T409779)]], [[gerrit:1204679|EventLogging: Fix wikitext editor interface detection (T409779)]] (duration: 07m 48s)

kostajh updated the task description. (Show Details)
kostajh updated the task description. (Show Details)
kostajh updated the task description. (Show Details)

This involves looking at retention rates for users who don't have skipcaptcha right, which is all new user accounts

Just make sure you're not actually checking whether the user has the right, because they might have picked it up during the retention-period you choose.

Measuring AbuseFilter trips is possible with the saveFailure event.

Specifically, you can check for save_failure_type=extensionAbuseFilter + save_failure_type=responseUnknown AND save_failure_message LIKE abusefilter-%. (We're mostly just passing through what the API gives us for response types and error messages here, unfortunately.)

Confirming that the defined Editing metrics in the task description look good to me.

Edit Completion: What proportion of people go on to publish an edit after reaching the point in the editing funnel when a request is sent off to hCaptcha?
The hcaptcha.request() method is invoked when the user presses "Publish changes" in the wikitext editor

Just a note to clarfiy that there are typically no additional user actions after a user clicks "Publish changes" in wikitext editor. After a user clicks the "Publish changes" button in wikitext editor, the edit will be sent to the server and logged as action = saveSuccess if there were no saveFailures, which marks the end of an editing session. This differs from Visual Editor, where a user is presented a pre-save dialog they can interact with after clicking "Publish Changes".

As a result, the baseline edit completion rate for wikitext editor at this stage is high and it may be difficult to detect changes in overall completion rates between saveIntent and saveSuccess. I agree with the approach mentioned in T409779#11362766 of looking specifically at drop-offs the occur after users press "Submit" or who encounter a visual challenge (0.1% of sessions) and don't complete the challenge as this will allow you to reduce some noise and specifically focus on users that might be affected.

ppelberg claimed this task.

Per what @MNeisler and I discussed offline today, we can consider this task Resolved given the "OK" Megan offered in T409779#11389656 and she being in touch with Morten about the analysis and available to provide reviews if/when needed.