Wikipedia:Bots/Requests for approval/'zinbot


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at Bots/Noticeboard. The result of the discussion was

'zinbot
Operator:

Time filed: 02:43, Thursday, September 2, 2021 (UTC)

Function overview: Mark RfD'd redirects as reviewed patrolled, as long as the correct syntax has been used and the RfD has actually been filed.

Automatic, Supervised, or Manual: Automatic

Programming language(s): Python, using PWB as a library

Source code available: https://github.com/TamzinHadasa/zinbot

Links to relevant discussions (where appropriate):

Edit period(s): Probably every 30 minutes

Estimated number of pages affected: ~5-20 per day

Namespace(s): Mainspace (with logging in userspace)

Exclusion compliant (Yes/No): No

Function details:

Iterates through the "marked for deletion" section of Special:NewPagesFeed.

If a page is marked with the exact syntax of {{subst:rfd}}, checks the linked RfD log page for whether an RfD has been filed.
 * Skips and logs the event on-wiki at User:'zinbot/logs/skippedRfDs.json a subpage of User:'zinbot/Unfiled RfDs if any of the following occur:
 * The page was erroneously directly tagged with Rfd-NPF/core.
 * There is no RfD page for that date (distant past, more than a few days in the future, or invalid date).
 * The page was tagged more than 30 minutes ago but no RfD has been filed.
 * The RfD was filed, but on a page that is not currently transcluded to the main page (e.g. tomorrow's page).
 * Otherwise, marks the page as reviewed patrolled (with notification disabled since usually people aren't even aware they've done something reviewable  patrollable ).
 * ( Other than, which is a special case using a separate regex, d D oes not log pages that are tagged with incorrect syntax since there's no easy way to automatically distinguish a malformed  from any other content.)
 * I may add more logging scenarios in the future depending on what kinds of things are showing up at skippedRfDs.json.

Updated 03:53, 16 September 2021 (UTC)

Discussion

 * This resolves an issue where RfDs are flagged for NPR review even though there's essentially nothing for NPRs to review. As you can see at the WT:NPR thread, there is no opposition to this. If approved, I have a few more ideas in the future to cut back on little things that clutter Special:NewPagesFeed, but I thought I'd start small.I've tested this on testwiki on my account (wanted to give 'zinbot NPR, but apparently that's not a thing there). See testwiki:Special:Contribs/Tamzin and testwiki:Special:Log/Tamzin. -- Tamzin  [cetacean needed] (she/they) 02:43, 2 September 2021 (UTC)
 * I'm sure this is already obvious, but for the avoidance of any doubt and as a reminder should this be approved for trial - this task will require the bot being given the  permission.  firefly  ( t · c ) 10:13, 2 September 2021 (UTC)
 * Just a note, I've realized that in production it makes more sense to do logging through a .json file, and am working on the commit for that now. No changes to the core functionality though. -- Tamzin  [cetacean needed] (she/they) 19:02, 2 September 2021 (UTC)
 * Logging overhauled here. See testwiki:User:Tamzin/logs/skippedRfDs.json for demo. Think I'm now pretty happy with where things stand, code-wise. -- Tamzin  [cetacean needed] (she/they) 06:27, 6 September 2021 (UTC)
 * What happens if an RfD is filed (thus the redirect is turned into a 'page'), then it's expanded into an article? I assume if the RfD is closed and it's expanded later, it'll appear in NPP as normal. But if it's expanded while an RfD is open, then it would escape new page patrol? If this is possible then I assume it's quite rare and difficult to abuse (since it would still get attention from the closing admin of the RfD), but felt worth raising. ProcrastinatingReader (talk) 15:54, 7 September 2021 (UTC)
 * Hmm. I'm not sure if it gets re-flagged for review when it's moved out of the deletion queue. Let me check. -- Tamzin  [cetacean needed] (she/they) 17:23, 7 September 2021 (UTC)
 * So, there's two ways that that can happen. One is someone overwriting the page, including the RfD template. This is allowed, and usually leads to a speedy procedural close. The other is someone drafting something (usually a DAB or SIA) beneath the RfD template, for RfD to consider as an outcome. In the latter case, I'd say that any resulting page has a level of review that meets or exceeds what NPP does. In the former, well, I don't think most people are going to close an RfD if the replaced page would obivously meet a CSD, but they're not necessarily going to be tagging issues or anything either. I think you're right to see that as an issue, although it's not unique to reviews done by 'zinbot; it's an eventuality that can arise anytime someone reviews an RfD'd redirect, or for that matter anytime an autopatroller or sysop files an RfD. I could write a something to check back in on pages that 'zinbot reviews and unreview them if necessary, but perhaps it would be better as a separate task encompassing all cases where an already-reviewed RfD'd redirect gets turned into a content page? -- Tamzin  [cetacean needed] (she/they) 19:58, 7 September 2021 (UTC)
 * Yeah, I think the unreviewing is different enough that it's worth discussing separately. Keep this task simple and focused on the reviewing. Thryduulf (talk) 00:24, 8 September 2021 (UTC)
 * This seems like a good idea. The bot should also work identically for instances of  (an alias) and should be case insensitive in all cases. Thryduulf (talk) 16:40, 7 September 2021 (UTC)
 * The matching is with the subst'ed output of {{subst:rfd}}, so aliases and alternate capitalizations in the templates's name shouldn't make a difference. This does mean that if someone, for whatever reason, adds the  stuff manually, it may not match if they use different whitespace or such. But I see that as a feature, not a bug, since if someone's doing that their edit is more likely to need review for formatting issues. See https://github.com/TamzinHadasa/zinbot/blob/trunk/pagetriage/rfd.py#L29 for the regex I'm using. The one case where variation in syntax does need to be accounted for is the redirect itself, since we want to make sure someone hasn't done something like stick some vandalism right after  . The relevant part of the regex there is  . (Translation: pound sign, case-insensitive "redirect", 0 or more spaces, 2 opening brackets, 1 or more characters, and 2 closing brackets. It intentionally does not check for wikilink validity, since it's plausible that someone might RfD a page with an invalid link.)  If anyone sees anything I could be missing in that regex, please let me know.  -- Tamzin  [cetacean needed] (she/they) 17:39, 7 September 2021 (UTC)
 * 10 day trial. For the first 3 days, can you log to your userspace (or the bot's userspace) a list of pages the bot would've marked as patrolled (not actually doing the patrols on live pages at this stage) with timestamps/link/etc. If the data looks good, feel free to move to the 7 day trial on live pages (you don't need to ping me to confirm, but you can if you want me to look over them). When the full trial is complete, provide links to patrols and any userspace logs generated. Don't worry about the unpatrolling for this task. Please do all actions on the bot account. For the second stage, obviously I can't grant your bot reviewer, but you can ask any admin (or at WP:PERM) and link to this BRFA and that will likely not be a problem. ProcrastinatingReader (talk) 01:41, 8 September 2021 (UTC)
 * Exciting! Thanks! Just to note, I did do a single test run just now (User:'zinbot/trial/1/mockReviews.json), but I won't be really starting the timer on the trial till tomorrow, when I've had the chance to properly set it to run once every 30 minutes. -- Tamzin  [cetacean needed] (she/they) 04:47, 8 September 2021 (UTC)
 * Took a few more rounds of bugfixes to get it fully ready, more due to coding perfectionism on my part than to any real issues. There haven't been any false positives, just a few false negatives. Sound good for me to run it in log-only for another 24 hours, and then flip over to live mode if there's no further issues? Perms have been taken care of. -- Tamzin  [cetacean needed] (she/they) 22:40, 10 September 2021 (UTC)
 * Just for the record, I said this was okay to Tamzin at the time, off-wiki (I wasn't able to edit onwiki at the time). ProcrastinatingReader (talk) 15:04, 28 September 2021 (UTC)
 * Post-trial report: Over the course of seven days, 'zinbot reviewed 90 pages and flagged 7 pages as incorrectly tagged or filed.
 * All 90 reviews were true positives. (On five occasions I reverted it to allow for testing of a bugfix of improvement, but none was because it had been wrong to review the page.) To verify that these are true positives, click on any still-tagged page in the review log and check that, when you click the "this redirect's entry" link you are taken to a valid anchor.
 * Of the seven pages that were flagged, six were true negatives (i.e. incorrect usage of RfD templates), and one was an edge-case false negative, fixed in v1.4.1.
 * The only serious technical issue encountered was a glitch in the cleanup function for User:'zinbot/logs/skippedRfDs.json (see: the self-edit-war in that page's history), which was fixed in v1.3.1.
 * I added one minor feature during the run, in v1.4.0, to catch situations where someone directly uses Rfd-NPF/core. This is now logged as error code.
 * -- Tamzin [cetacean needed] (she/they) 02:04, 18 September 2021 (UTC)


 * I don't see any issues in the trial data and the task has consensus support. For the record, I did confer with editors experienced in RfD & NPP (on and off wiki) to see if folks could see any edge cases with abuse potential from a functional standpoint; no such issues were apparent, and Tamzin's attention to detail in this BRFA suggests they will be on top of things should any issues occur. ProcrastinatingReader (talk) 15:04, 28 September 2021 (UTC)
 * The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at Bots/Noticeboard.