Jump to content

User:MusikBot/PermClerk

From Wikipedia, the free encyclopedia

PermClerk

Bot clerking at requests for permissions.

checkY Enabled

To disable, set /Run to anything other than true (link)

Errors are logged at /Error log

Human-readable report

No errors! Report generated at 09:40, 21 November 2024 (UTC)

Tasks

Archiving

All requests are archived at Wikipedia:Requests for permissions/Archive as approved or denied. This is done as a historical reference, namely so that admins can review previously declined requests.

N hours after the last comment was made on a request (as specified in the config), the discussion is removed from that page and an entry containing a PermaLink to the discussion is added to the archives, noting the user and the permission.

{{User:MusikBot/override}} can be used to override any other {{done}} or {{not done}} templates, and make the bot ignore the user's rights. For example, you may use {{done}}{{User:MusikBot/override|d}} when a user has requested revocation of a user right (marking as done and forcing to archive as done).

You can also force immediate archiving of a request with {{User:MusikBot/archivenow}} ~~~~

Autoformat

Removes extraneous headers and repairs malformed requests. This functionality is not configurable, but it can be turned off entirely.

Admin backlog

Updates {{WP:PERM/Backlog}} based on configurable conditions. At the time of writing, this is set to 3+ requests or any request over 7 days old.

Autorespond

Marks requests as {{already done}} if the user already has the permission they are requesting. Only runs on WP:PERM/C and WP:PERM/AWB. For other PERM pages, the bot will wait N hours after the request (see config) has been made before concluding the admin forgot to mark the request as {{done}}.

Fetch declined

Searches the declined archives and comments if the user has had any relevant requests recently declined, with permalinks to the relevant page. Does not run on WP:PERM/C. The number of days back the bot should search is configurable.

Prerequisites

Comments if the user does not meet the configurable qualifications for that permission. The data is kept up-to-date until the request is responded to.

If the user does not meet one of the prerequisites, the bot will comment with the relevant data. For instance, if 200 mainspace edits are required, the bot will comment "this user has made X edits to the mainspace". If multiple requirements are not met, a single humanized sentence is constructed, as opposed to making multiple comments.

These prerequisites do not necessarily represent a hard requirement, and the comments made by the bot are purely for convenience.

Check revoked

Comments if the user has had the requested permission revoked in the past N days, as specified in the config.

Configuration

Functionality can be tweaked at /config. Configuration data is in the form of JSON.

IMPORTANT:

  • Do not modify the config files unless you have a basic understanding of JSON
  • Read the documentation first.
  • Do not change the key values.
  • Keys should always be strings, e.g. use "option": true instead of option: true.
  • Strings should be wrapped in double-quotes, e.g. "option" instead of 'option'.
  • Boolean values must be either true or false with no quotations around it.
  • Numerical values must be integers with no quotations around it.
  • The last key/value pair within a hash or the value value in an array must not have a comma at the end of it
  • Essentially if the JSON editor interface says there are any syntax errors or warnings, you have done something wrong

Adding a new permission

  1. Create a subpage for the permission at WP:PERM
  2. In the pages hash add a new key/value pair for the new permission. The key is the subpage at WP:PERM and the value is the name of the user group as specified in the Wikipedia config.
  3. Configure prerequisites for the permission in the prerequisites_config hash (see below).

The bot should now process the new page as configured. For reference, see this example of adding the New page reviewer permission.

Options

The documentation for each configuration hash is as follows:

run

Specifies which PermClerk tasks the bot should run

Name Description
admin_backlog Updates {{WP:PERM/Backlog}} based on configurable conditions (3+ requests or any request over 7 days old)
archive Archives requests that have been responded to and where the discussion is over N hours old, as specified by the offset parameter in archive_config
autoformat Removes extraneous headers and repairs malformed requests.
autorespond Marks requests as {{already done}} if the user already has the permission they are requesting. Only runs on WP:PERM/C and WP:PERM/AWB
fetch_declined Searches the declined archives and comments if the user has had any relevant requests recently declined, with permalinks to the relevant page. Does not run on WP:PERM/C
prerequisites Comments if the user does not meet the configurable qualifications for that permission. The data is kept up-to-date until the request is responded to.
checkrevoked Comments if the user has had the requested permission revoked in the past N days, as specified in the config

pages

Specifies which pages the bot should process, and the regular expression the bot should use in detecting if a user has that right.

The keys should be the name of the subpage of Wikipedia:Requests for permissions. The values are the name of the user group as specified by the wiki configuration (e.g. rollbacker, not rollback). A full list of the user groups can be found here, where the value for name is what should be used. The value for "confirmed" is actually a regular expression, since both confirmed and autoconfirmed are considered to be the same permission at WP:PERM.

adminbacklog_config

Define what the bot should consider a backlog.

  • requests is the number of open requests
  • offset is the number of days a request has been open

archive_config

  • offset is the number of hours to leave a request open before archiving
  • done is the regular expression used to identify that a request has been marked as "done"
  • notdone is the regular expression used to identify that a request has been marked as "not done"

autorespond

  • offset represents a number of hours the bot will wait before assuming the admin who granted the right forgot to mark it as "done"

fetchdeclined_config

  • offset specifies the number of days back the bot should search the declined archives

checkrevoked_config

  • offset specifies the number of days back the bot should check the user's user rights log.

prerequisites_config

These prerequisites do not necessarily represent consensus. Any changes should first be discussed at WT:PERM or another appropriate venue.

All values are integers, representing a minimum threshold the user should meet.

If a new permission has been created, it will need to be specified here. If there are no requirements for a particular permission, simply leave an empty object as with {}

Available parameters
Parameter Description
accountAge Number of days since account registration
articleCount Number of articles created by the user
editCount Number of edits
mainSpaceCount Number of edits to the mainspace
manualMainSpaceCount Number of edits to the mainspace without the assistance of automated tools. This count is retrieved via the API provided by non-automated edit tool
moduleSpaceCount Number of edits to the module namespace
templateSpaceCount Number of edits to the template namespace
templateAndModuleSpaceCount Just as it sounds; combined edits to template and module namespaces