**Problem**
#abusefilter allows privileged users to create filters that execute on each edit. AbuseFilter duplicates a lot of the functionality of wiki pages:
* History
* Revisions
* Recent Changes
* Diffs (for saved revisions)
* Change Logs
* Discussions (Notes)
but is also missing some of the functionality that wiki pages have that filters could benefit from:
* Discussions (pages) T95737
* Watchlist T62588
* Rollbacks
* Diff'ing the current content before saving a new revision
* Partial Blocks
**Proposed Solution**
Since [[ https://www.mediawiki.org/wiki/Everything_is_a_wiki_page | everything is a wiki page ]], filters should also be a wiki page. This would remove a significant amount of code from AbuseFilter, and give filters additional functionality.
The filters should be stored with custom extension (`.filter` ?) and [[ https://www.mediawiki.org/wiki/Manual:Page_content_models | content model ]].
AbuseFilter should use #multi-content-revisions to store the filter code in the main slot, and in metadata (serialized as JSON) in another slot.
Lastly, AbuseFilter should implement the [[ https://www.mediawiki.org/wiki/Manual:Hooks/userCan | userCan ]] hook to control access to the filters (i.e. if a filter is marked as Private, it should prevent `read` for all unprivileged users of both the content and the discussion page). The private filters will also need to be filtered out of the database replicas (that are available on Toolforge and as dumps).