For T428816: [EPIC] Surface edit suggestion counts to logged-in editors on articles (Phase 1), counts of edit suggestions on a page revision will be stored and served outside of VisualEditor.
The proposed architecture uses Linked Artifacts Cache as the storage for suggestion counts. A 'lambda' behind LAC will compute the edit suggestions for the page.
Since LAC is a cache, and we want edit suggestions computed as soon as possible after a page is edited, we need a mechanism to 'warm' the cache. Something to trigger the compute of edit suggestions for the new revision.
The proposed architecture uses MediaWiki JobQueue to do this. There are several triggers that may cause edit suggestions for a page to be invalid, but for Phase 1 we will focus solely on edits, i.e. when new revisions are created.
Note that not all wikis or pages have edit suggestions. We will only call the LAC endpoint (triggering the computation) for configured wikis and page namespaces.
For T432286: [MILESTONE] Run technical pilot to evaluate Headless VE resource requirements, we may also need the ability to configure some sampling to avoid triggering the computation for all pages while the compute mechanism (Headless VE) is evaluated.
Another identical use case is T403254: Article topic cache backfilling. That task encompasses backfilling, but also ongoing updates for page revision article topics, which are stored in LAC.
Warming LAC after changes in MediaWiki state is likely a common use case; the implementation to do this should probably be generic, and not Edit Suggestion specific.
Additionally: the proposed architecture has edit suggestion change events emitted to Kafka for data reusability. There is currently a mediawiki.page_outlink_topic_prediction_change_v1 stream emitted by LiftWing. This is done via change-prop. If LiftWing usages fit nicely in LAC, it may be possible to decouple LiftWing from change-prop by emitting events from MediaWiki after LAC is warmed. A new MediaWiki DomainEvent that can be subscribed to after an artifact is warmed can be used to translate from LAC response to Event Platform event, while keeping the cache warming mechanism decoupled from the event producing mechanism.
Done is
- Edit Suggestion LAC endpoint is called after new revisions are created.
- Which pages for which new revisions call LAC can be configured, e.g. via sampling.