Wikipedia talk:AfD stats

Latest comment: 1 day ago by ScrubbedFalcon in topic Relisting comment detected as vote and "support" votes

WSGI rewrite

edit

@Enterprisey, Legoktm, 0xDeadbeef, Σ:

I decided to dive into WSGI programming by rewriting the AfD stats script to be able to use one of the standard toolforge python images via a uWSGI web server instead of the hack we're using which accesses the system python binary from an image intended for php apps. This allows for better stability since it allows us to specify which version of python to use (the shared one is updated from time to time), and I was warned during the k8s migration that our hack is unsupported and might not work after future system updates. WSGI is also more performant, since it doesn't require launching a new process for every request.

The main effort was to make the script return the output as a string, rather than printing it one line at a time, but also involved rewriting it to support multiple workers by getting rid of global variables. While I was in the code, I also made several changes to bring it up to modern Python coding standards (such as using f-strings instead of serial string concatenation and using "with" statements), make it run more efficiently (frequently-used values were made into global constants, it no longer needs a separate SQL query for each AfD, and complex if/or statements were replaced with lookup tables), and in general make the code more readable. I also got rid of the grocer's apostrophes.

I put the new version in the WSGI branch on gitlab (https://gitlab.wikimedia.org/toolforge-repos/afdstats/-/tree/wsgi) and have it running at https://afdstats2.toolforge.org. --Ahecht (TALK
PAGE
)
02:21, 22 January 2025 (UTC)Reply

I did a quick skim and it looks really great. I think you should feel free to deploy it to the main tool whenever you feel comfortable. If you're up for it, I'd also suggest investigating flask and jinja templates to further clean up the presentation/HTML output.
It may also be worth picking some old/archived AfDs and writing tests against them to more easily verify future changes. Legoktm (talk) 06:12, 22 January 2025 (UTC)Reply
@Legoktm I did look at using Django and its template system initially, but ruled it out as overkill when I thought the job was just going to be as simple as changing "print" to "append" and ended up down the rabbit hole of optimizing that code. Flask might be a good idea at some point as it seems to be simpler than Django.
My testing here was as simple as running the old and new versions against a bunch of prolific AfD editors and making sure that the output was the same. A standard test suite would be nice, but ultimately real AfDs are anything but standard. --Ahecht (TALK
PAGE
)
14:54, 22 January 2025 (UTC)Reply
Deploying now... --Ahecht (TALK
PAGE
)
00:18, 7 February 2025 (UTC)Reply
Done! --Ahecht (TALK
PAGE
)
00:19, 7 February 2025 (UTC)Reply

New AfD outcome

edit

A head's up that a new outcome, "navify", is now being used and I anticipate will become pretty widespread in the sportsperson arena. It's functionally the same as a redirect and so could be folded into those results if a new voting matrix is untenable. JoelleJay (talk) 16:36, 19 April 2025 (UTC)Reply

@JoelleJay I added "navif" (which covers "navify", "navified", "navification", etc.) as an alias for "Redirect" to toolforge:afdstats2. Do you have any examples of discussions with navify votes or outcomes that could be used as testcases before rolling it into the main tool? --Ahecht (TALK
PAGE
)
02:42, 20 April 2025 (UTC)Reply
Yes, here's one. JoelleJay (talk) 03:31, 20 April 2025 (UTC)Reply
@Ahecht here's another one where the closer didn't use any shorthand :/ JoelleJay (talk) 17:25, 25 April 2025 (UTC)Reply
@JoelleJay :/ is right, I don't know that we'd want to even try to capture all the longhand ways it could be stated. I can try adding "navigation" to afdstats2 over the weekend. --Ahecht (TALK
PAGE
)
18:34, 25 April 2025 (UTC)Reply
@JoelleJay I've updated afdstats2 to recognize "navif" and "navigation" as aliases for "Redirect". Please test it out and let me know if it's working as expected. --Ahecht (TALK
PAGE
)
15:44, 26 April 2025 (UTC)Reply
@Ahecht is Afdstats2 different from the one linked on this page? I'm still seeing "UNDETERMINED" for the navify results on that one. EDIT: oops, saw you linked above. Looks good there! JoelleJay (talk) 15:54, 26 April 2025 (UTC)Reply
For the record, this was  Done for the main afdstats tool at the same time as the below request. --Ahecht (TALK
PAGE
)
01:41, 24 June 2025 (UTC)Reply
edit

So, this is my signature: " CX Zoom[he/him] (let's talk • {CX}) " which contains a link to User:CX Zoom/X. When I nominate an article to AfD, it is correctly attributed to myself. However, when I !vote or close an AfD, User:CX Zoom/X is understood to be the closer, and hence the tool fails to attribute those !votes to myself. See AfD Stats - Results, and specifically the "Show pages without detected votes" section, in two of whom the closer is "CX Zoom/X". Thanks! CX Zoom[he/him] (let's talk • {CX}) 12:03, 23 June 2025 (UTC)Reply

@CX Zoom I tweaked the detection code at afdstats2. Does that look closer to what you'd expect? --Ahecht (TALK
PAGE
)
15:32, 23 June 2025 (UTC)Reply
I checked afdstats2 and this now works as expected. Thank you! CX Zoom[he/him] (let's talk • {CX}) 16:16, 23 June 2025 (UTC)Reply
@CX Zoom Ok, I'll roll out that tweak to the main version when I get a chance. --Ahecht (TALK
PAGE
)
17:28, 23 June 2025 (UTC)Reply
@CX Zoom  Done --Ahecht (TALK
PAGE
)
01:38, 24 June 2025 (UTC)Reply
Thank you very much! CX Zoom[he/him] (let's talk • {CX}) 08:45, 24 June 2025 (UTC)Reply

(Nom)

edit

The stats notes when a user nominated/started the afd, and I think that is useful, both for the editor and nosy people looking for background rfa-info etc.

However, if the nom is persuaded by the discussion and makes a keep comment later, they are no longer (Nom) in the stats. This isn't just a theoretical event, it actually happens now and then, and I think it's regrettable that the stats can't handle this. Gråbergs Gråa Sång (talk) 05:28, 28 July 2025 (UTC)Reply

Typo

edit

When you hit "show AfD's without recorded votes" (or whatever the option is called) it becomes "hidew [sic] AfD's without...". JustARandomSquid (talk) 11:29, 29 September 2025 (UTC)Reply

it's "hidew pages without detected votes" JustARandomSquid (talk) 11:30, 29 September 2025 (UTC)Reply
@JustARandomSquid Fixed here. --Ahecht (TALK
PAGE
)
14:19, 29 September 2025 (UTC)Reply

Username changes

edit

Hi there! Just a small one. I had a username change done recently for privacy related reasons. It seems the tool now only tracks AfD nominations, meaning my % is not inclusive of all !votes. I'm sure this is a known issue, not major if it can't be fixed. Thanks! 11WB (talk) 17:03, 28 October 2025 (UTC)Reply

@11WB You can use the "Alternate name:" field (or https://afdstats.toolforge.org/afdstats.py?name=11WB&altname=ALTERNATENAME) to combine results from both usernames. --Ahecht (TALK
PAGE
)
17:44, 28 October 2025 (UTC)Reply
Excellent! I'll remember to do this when linking to it in future. Thanks! 11WB (talk) 17:55, 28 October 2025 (UTC)Reply

AFD Stats down

edit

Last update was Feb 5 — Maile (talk)

@Maile66:, it seems fine to me? Can you provide more details about what error you're seeing or issue you're having? Where are you getting Feb. 5 from? Legoktm (talk) 06:21, 8 February 2026 (UTC)Reply
The latest Vote Date showing on mine is February 5, which is Bradly, Boone County, West Virginia. Should also be Feb 6-8 listings also on there. — Maile (talk) 12:32, 8 February 2026 (UTC)Reply
@Maile66 Again, AfD Stats doesn't do any caching of data, it retrieves it directly from wikimedia's servers every time you load the report. If there is lag in the results, it's not a problem with AfD Stats. It's either a problem with the Wikimedia servers (which you can check at toolforge:replag), or your browser is showing an old version of the page (see WP:Bypass your cache). --Ahecht (TALK
PAGE
)
17:03, 8 February 2026 (UTC)Reply
Looks like the error was on my part, how I was listing the entries. — Maile (talk) 12:58, 8 February 2026 (UTC)Reply

"votes" to be renamed "!votes"

edit

Since we all know that Wikipedia is WP:NOTADEMOCRACY we should have all instances of "votes" for this toolforge tool renamed to "!votes" with the "!" exclamation mark in front of it. Just to make it clear that we acknowledge that these are not majority rule "voting" type logged edits. Iljhgtn (they/them · talk) 04:42, 3 March 2026 (UTC)Reply

I am referring to where it tallies your totals as "Keep votes", "Delete votes", "Speedy Keep votes", "Speedy Delete votes", "Merge votes", "Redirect votes", "Transwiki votes", and "Userfy votes"...
Then, "This table compares the user's votes to the way the AfD eventually closed. The only AfDs included in this matrix are those that have already closed, where both the vote and result could be reliably determined. Results are across the top, and the user's votes down the side. Green cells indicate "matches", meaning that the user's vote matched (or closely resembled) the way the AfD eventually closed, whereas red cells indicate that the vote and the end result did not match.
And some more instances:
"Number of AfDs where vote matched result (green cells):"
"Number of AfDs where vote didn't match result (red cells):"
I think that is all instances of the word "vote" which should be replaced with "!vote". Iljhgtn (they/them · talk) 04:47, 3 March 2026 (UTC)Reply
See User:MZMcBride/Memes#!vote. Legoktm (talk) 05:10, 7 March 2026 (UTC)Reply
This whole computer programmer jargon should be discarded as counterintuitive and confusing. I have always struggled to understand it here, and elsewhere Ive seen !=, which is just as ridiculous. In programming, it makes sense as a shorthand, but here it is rubbish. We have moved far beyond that, if we were ever there in the first place. Whether votes is an appropriate term at all given that discussions are not supposed to be vote is something to consider. I like to call them comments, which fits in with XFD and RFC (literally). ← Metallurgist (talk) 06:18, 26 March 2026 (UTC)Reply

Merge votes

edit

Why does the tool's analysis count a vote or consensus to "merge" as incompatible with deletion? As has been recently discussed at Wikipedia:Requests for comment/Merging merge discussions with AfD, many AfD discussions often start with a suggestion to merge the article (or redirect and merge anything worth keeping from the redirected article) in borderline cases where the topic is considered a WP:NOPAGE situation for notability reasons. Yet the tool regards a vote to merge in a discussion where the consensus was to delete (or vice versa) as not matching the consensus. Given that merging, like redirecting, is often considered a form of deletion as the article is being removed in either case, this seems like an oversight that ought to be corrected. silviaASH (inquire within) 08:03, 24 March 2026 (UTC)Reply

Merge is a form of keep, not deletion. ← Metallurgist (talk) 06:19, 26 March 2026 (UTC)Reply
Incidentally, I had a related thought added below. ← Metallurgist (talk) 06:19, 26 March 2026 (UTC)Reply
Clarification. In my opinion, it is clear that "Keep" means just that. All other ATDs mean the article does not warrant a standalone article. We don't need an AFD to delete or otherwise edit content. For getting rid of the article (title), we use AFD. When a "Merge" has consensus, the old title is redirected, and the content becomes subject to content policies and guidelines under the "new" title. We can call this a keep if it makes some happy, but the title is no longer in mainspace. This generally arises when there is deemed to be insufficient sourcing to advance notability, or when there is "some" notability but sources to verify content. The comment below states that "Redirect IS a form of deletion." Considering the title is redirected, how can it be logically considered a form of keep? -- Otr500 (talk) 05:55, 1 April 2026 (UTC)Reply

Keep and merge should be green

edit

If redirect and delete are treated as green, which makes sense, then keep and merge should as well. I recently commented keep on an AFD and it was merged. No one pinged me about the new proposal to merge after I suggested a similar target might be acceptable for a redirect. I would have likely supported merge. Merging IS a form of keep, just as redirect IS a form of deletion. ← Metallurgist (talk) 06:14, 26 March 2026 (UTC)Reply

This doesn't make any sense to me. Either merging and redirecting are both forms of keeping the article, or they are both forms of deleting it. Given that both outcomes result in the agreement that there should not be a standalone article, I would strongly argue the latter. Many AfDs I have participated in either started with a recommendation from me that the article be merged, or closed in favor of merging on the grounds that the subject didn't warrant an article. Merging is functionally the same as redirecting, with the only difference being some text from the removed article is being pasted into another one, and most editors treat this as the same, with many voting "redirect/merge anything worth keeping".
(Some examples, in no particular order: Off-TV Play, Legs (character), Adobe Premiere Express, Bonfire (Dark Souls), List of Fate/hollow ataraxia characters Bird Game 3, Bird Game 3 2!, The Flames of Disaster, List of Zenless Zone Zero characters, Tomb Raider nude code legend, Bean soup theory. This is just a small sample; I'm sure there's numerous examples of this outside the ones I voted in or nominated.)
This recent RfC, which I linked above, closed in favor of merging the Proposed article mergers process with AfD. Considering this, there will be an increasing number of AfD nominations that start with a nominator's recommendation to merge. (The merge process is being discussed in more detail at Wikipedia talk:Articles for deletion#Follow up from RfC.) The tool needs to be adjusted to account for this. silviaASH (inquire within) 08:01, 26 March 2026 (UTC)Reply
the only difference being some text from the removed article is being pasted into another one
As an editor with experience with PAM, most of the time the majority of the text, or sometimes almost the entire text, is carried over; not just "some text". You may be seeing more selective merges happen at AfD because of the differences in the articles nominated at PAM and AFD until now. I think it should be green FaviFake (talk) 16:40, 27 March 2026 (UTC)Reply
Maybe the real issue here is that the stats tool does not adjust to account for the actual goal(s) of the nominator; it simply assumes the goal of every nomination is to delete the article. This will have to be considered in some fashion as AfD discussions get started with merges as the explicit goal. It also doesn't consider situations in which the nominator changes their mind; as far as I can tell whether or not a nominator withdraws their AfD nomination or is convinced by other participants that an ATD would be preferable doesn't change the statistics. I feel this needs to be addressed as well.
But also in general users just need to stop taking the AfD stats seriously as an indicator of anything at all. silviaASH (inquire within) 17:21, 27 March 2026 (UTC)Reply
Anyway, cases like what you cited are why I'm honestly not the biggest fan of how this tool is used across Wikipedia to evaluate editors. Simple numerical statistics cannot accurately convey the nuances of any given consensus or any particular editor's attitude; you have to actually look at what the discussions say and ask questions about what the editors thought of the situation. Even if redirecting is a form of deletion, there's a big gulf in attitude towards the content between an AfD result that says "redirect this for now" (like Hyperfunk or Cyberpunk 2) and a result that says "redirect this for the foreseeable future because it's unlikely to ever be notable on its own without some big development" (like Sequel of Spore). The AfD stats tool will never be able to parse and render data that considers these kinds of nuances that only a careful human review will uncover.
Nonetheless, this tool is going to continue to be used regardless of my feelings on it, so I think there has to at least be some attempt to recognize the reality of what the particular deletion outcomes are broadly considered to signify, especially when that reality is changing so significantly as the result of something significant like merging PAM and AfD. silviaASH (inquire within) 08:28, 26 March 2026 (UTC)Reply
The considerations for merging overlap with notability but are not equal to it. Sometimes I support merging notable articles, and sometimes I support merging non-notable articles. I don't think a merge vote can be compared to a keep or delete vote specifically because of the conflicting reasons being presented in the discussion here. Thebiguglyalien (talk) 05:17, 3 April 2026 (UTC)Reply
The color coding confuses me. For example:
  • Merge is a "delete" action, even if all the material is merged and therefore "kept".
  • Redirect is a "delete" action, even though all the revisions are publicly available in the page history.
  • Redirect and Merge are the same, but only one is "delete" and neither are "keep".
WhatamIdoing (talk) 23:14, 11 April 2026 (UTC)Reply
Merge should just be considered in agreement with deletion, especially after the PAM-AfD merger. Alternatively, the tool should be updated so that a nominator's vote is specifically counted as the outcome they specify they are seeking- so, if they're seeking a merge, like I am at the recently opened discussion for Machete (character), their vote in the AfD stats tool should be stated as "Merge (nom)", rather than assuming the nomination is to delete.
The tool needs to be updated in some way, sooner rather than later, or else there will be further friction of this nature-- Wikipedia:Articles for deletion/Assyrian continuity is clear evidence of this. There's a lot of other discussion about the merger occurring at Wikipedia talk:Articles for deletion#Implementing the PAM–AfD merge which I'd encourage everyone here to look at and potentially weigh in on if they haven't already. silviaASH (inquire within) 08:38, 27 April 2026 (UTC)Reply
@SilviaASH Even an updated tool wouldn't pick up that that was a merge because there is no bolded action in the nomination statement. --Ahecht (TALK
PAGE
)
13:21, 13 May 2026 (UTC)Reply
Merge is not considered a "delete" action. A vote for "merge" that closes as "redirect" (or vice versa) will be considered in agreement since both result in a redirect being created. A vote for "redirect" with a close of "delete" (or vice versa) will be considered in agreement because the original content was not kept (other than in the edit history), but a vote for "merge" will not be considered in agreement with a close of "delete" (or vice versa) because the content is kept in a live article. --Ahecht (TALK
PAGE
)
14:24, 12 May 2026 (UTC)Reply

Merge nominations should be reflected

edit

Currently it seems that if you nominate an article for merging (and bold that desired outcome) at AfD (per the recent PAM-AfD merge), the nomination is still counted as a delete vote by this tool. Beyond the debate above on how merge votes are evaluated, this is simply not a correct reflection of what editors are actually nominating pages for. I imagine that there is a similar issue with redirect and draftify nominations which are also now options offered by Twinkle. ScrubbedFalcon (talk) 14:32, 6 May 2026 (UTC)Reply

Taking myself as an example, I made this merge nomination which also closed as merge, but if you look at the tool for my AfD stats (see May 2nd) it has it as a deletion nom that closed as merge. @Ahecht you see to be involved in maintaining the tool at the moment, I can't quite figure out how the code is organized, any idea on how to address this? I'd be happy to do some work in updating the module, but I can't pinpoint where the error is being made in the code. ScrubbedFalcon (talk) 10:14, 11 May 2026 (UTC)Reply
@ScrubbedFalcon The script doesn't recognize "merging" as a synonym for "merge". It only recognizes the dictionary/simple present form of the verb ("merge") and in some limited cases the gerund (e.g. "speedy deletion"), not the present participle ("merging"). The past tense ("merged") would also work since it contains the string "merge". If we decided to change that, the change would be in the VOTE_MAP on line 69 of https://gitlab.wikimedia.org/toolforge-repos/afdstats/-/blob/main/www/python/src/app.py --Ahecht (TALK
PAGE
)
14:10, 12 May 2026 (UTC)Reply
I think it should be updated because the default texts that twinkle provides when an option other than delete is chosen are:
I propose merging because
I propose redirecting because
I propose draftifying because
I would suggest just cutting the "e" off of "merge" in line 72. The other two cases should be covered by "redirect" in line 75 and "draftif" in line 83 respectively. ScrubbedFalcon (talk) 14:31, 12 May 2026 (UTC)Reply
@ScrubbedFalcon I pushed an edit to https://gitlab.wikimedia.org/toolforge-repos/afdstats/-/blob/Merging/www/python/src/app.py that just searches for "merg" instead of "merge" (and fixes some logic about appending "(Nom)"), but I don't have access to SSH right now to test it on the server. One of the other maintainers can feel free to move forward with this if they get to it before I do. --Ahecht (TALK
PAGE
)
14:50, 12 May 2026 (UTC)Reply
@ScrubbedFalcon  Done --Ahecht (TALK
PAGE
)
13:29, 13 May 2026 (UTC)Reply

Relisting comment detected as vote and "support" votes

edit

I found another issue, it seems like the tool is interpreting relisting comments as "delete" votes. See for example my re-listings here and here which are shown as delete votes here. Or see the same issue here where BhikhariInformer relisted this discussion which is shown as a delete vote in their stats (looking at the stats closer it seems to be a problem also in all of the discussions that are currently open for them that they relisted).

Second, I wonder if it would be possible for the tool to store the intention of the nominator as a variable so that votes of "support" or "oppose" could be assigned. For example all of the votes in this merge discussion were "support" or "oppose" and if you look at Traumnovelle's stats, who voted "support in the discussion, the discussion is covered as a page without a detected vote. ScrubbedFalcon (talk) 13:53, 13 May 2026 (UTC)Reply

@ScrubbedFalcon I Fixed the relist comment issue here , the "support"/"oppose" recognition is Not done for now as it would require a larger rewrite. Recognizing "Oppose" as "keep" would be pretty straightforward, but I wouldn't want to implement it without "Support" support. Feel free to submit a pull request if you want to take a crack at implementing it yourself. --Ahecht (TALK
PAGE
)
14:52, 13 May 2026 (UTC)Reply
@ScrubbedFalcon Please test out toolforge:afdstats2, which has some preliminary support/oppose support. It doesn't quite work on pages like Wikipedia:Articles for deletion/No. 230 Squadron RNZAF or Wikipedia:Articles for deletion/Woolworths New Zealand because the script detects FaviFake as the nominator, not Mariamnei or Icaldonta, since FaviFake created the nomination pages. --Ahecht (TALK
PAGE
)
16:12, 15 May 2026 (UTC)Reply
It seems to work for cases (other than Favi's nominations as you point out) based on what I found in this search. I should have some time this week to see if I can get it to work for other cases like those mentioned above and when people vote support in sub threads for an ATD for example. ScrubbedFalcon (talk) 07:43, 18 May 2026 (UTC)Reply