Project Information
- Name of tool/project: EditCheck server-side suggestions
- Project home page: https://www.mediawiki.org/wiki/VisualEditor/Suggestion_Mode
- Name of team requesting review: Editing
- Primary contact: Eng: @Esanders, @DLynch (Aug-Sep), Product: @ppelberg
- Target date for deployment: Q1 2026
- Link to code repository / patchset:
- Link to scc output for general sizing of codebases (https://github.com/boyter/scc):
Description of the tool/project:
EditCheck suggestions are generated in the client, using logic that evaluates the VisualEditor data model. We would like to show these suggestions outside of the editor, initially as a counter in read mode. We have considered multiple approaches for doing this:
- Running VE in Node. Cons: while we had some success with core VE, we also have lots of MediaWiki dependencies (VE code in extensions, MW libraries, API calls) and this quickly becomes running all of MW in Node.
- Creating server-side duplicates of all the checks that run directly against Parsoid HTML. Cons: This would requires rewriting and maintaining a duplicate copy of most of the EditCheck system, as well as many parts of VE's converter and some MW dependencies.
- Taking results from the user's client and posting them to the server. Cons: Clients could generate bad data either accidentally (broken browser, or browser with excessive extensions installed) or maliciously.
The approach we have decided on is to run EditCheck headless via a very lightweight entry point (Special:EditCheckHeadless). VE will happily run headless (we already do this for visual diffs in the user's client) as will the edit check logic. The data can then be sent back through an API via Puppeteer.
Description of how the tool will be used at WMF:
Edit suggestions will be counted after a page has been edited (triggered by a JobQueue). The results of the count will be inserted into the Linked Artifact Cache. The API is fully internal, it will never be publicly accessible.
- editcheck-headless-server opens a headless browser at /Special:EditCheckHeadless
- this page can be locked down as much as needed - it only needs to load RL modules, and make action API calls.
- an internal request from the JobQueue comes in, asking for the suggestion count for <Page>
- <Page>'s Parsoid HTML is fetched in the headless browser, loaded into VE and the edit check logic run
- Parsoid HTML could also be fetched in advance and POSTed to the API, if required (still, only internally)
- the result is handed back to Puppeteer
- the browser can be shutdown after each request, or be kept open for performance and restarted every N requests (to avoid memory leaks)
We are open to using headless Chrome, or more lightweight render-free headless browsers like Lightpanda which uses ~10x fewer resources (CPU/memory).
Dependencies
List dependencies, or upstream projects that this project relies on.
- Puppeteer (open to alternatives like WebDriver if required)
- Chromium headless (open to alternatives like Lightpanda)
- gRPC
Has this project been reviewed before?
No
Working test environment
e.g.
node editcheck/build/editcheck-headless/editcheck-headless-server.js --script-path <script-path> --wikis http://localhost
Post-deployment
Editing, contacts as above