Wikipedia:Bots/Requests for approval/TenshiBot 4
From Wikipedia, the free encyclopedia
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at Wikipedia:Bots/Noticeboard. The result of the discussion was
Approved.
TenshiBot 4
Operator: Tenshi Hinanawi (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 03:31, Friday, September 5, 2025 (UTC)
Automatic, Supervised, or Manual: automatic
Programming language(s): Python
Source code available:
Function overview: Fix misnested tag lints caused by striking multiline text in Wikipedia + Wikipedia talk namespaces.
Links to relevant discussions (where appropriate):
Edit period(s): One time run
Estimated number of pages affected: 11,100~ estimated, likely less due to transclusions and multiple errors on the same page. 4981~
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details:
- Goes through all misnested lint errors in Wikipedia + Wikipedia talk and adds only lint errors caused by <s> tag to a separate list to go through.
- Afterwards, goes through the aforementioned list and uses regex to add new tags to fix the misnested lint errors.
Discussion
- Questions: I support this task, as misnested
<s>...</s>tags are often tedious to replace. There are multiple ways in which s tags can be misnested on discussion pages.- Will this task apply only to multi-line misuse of the inline s tag?
- Can you please provide some sample diffs to show how it would work? If you need to do this with the bot account, test edits might need BAG approval.
- Also, have you considered including obsolete
<strike>...</strike>tags in this work, converting them to s tags? - And one more thing: Why is step 1 needed? How would its output be different from this list? – Jonesey95 (talk) 00:06, 6 September 2025 (UTC)
- Yes, although it will fix stripped/missing end tags if it encounters any, but not any other types of misnests like this. I've put this into function details.
- 1, 2.
- No, I hadn't considered that, though I would be willing to include that in this task.
- By log I mean add the specific lint error to a different listvar, probably could have been better worded in hindsight. Rewritten. Tenshi! (Talk page) 00:35, 6 September 2025 (UTC)
- Thanks. Diff 1 incorrectly added a tag, causing the line "Some of the certification cells are center aligned." to be struck when it was not struck before. That looks like a bug to me. The appearance of the lines following "A pound sign and an abbreviation to go along with the catalog numbers would make them clearer." was also changed due to a missing end tag. That is a bug as well. I think that the code is overambitious and should focus only on misnested tags that it can be sure of, where there is an opening tag followed by a closing tag after multiple line breaks. Example: The line that starts "The "RIAA" column in the singles isn't clear enough" and the line following it. Instances where there are two
<s>tags in a row, or a</s>without an opening tag, should be ignored and left for humans to evaluate. - Diff 2 looks good. As for an article list, I'm seeing 3804 pages, if my query is working properly. I excluded log and archive pages, as I do at User:Jonesey95/Linter tags in AFDs, since those are typically pages containing only transclusions of other pages. – Jonesey95 (talk) 01:08, 6 September 2025 (UTC)
- I disagree on diff 1. In Special:Diff/203776827 there was a multiline strike, later in Special:Diff/204791826 "A pound sign and an abbreviation to go along with the catalog numbers would make them clearer." was moved with an unclosed opening tag. Tenshi! (Talk page) 01:22, 6 September 2025 (UTC)
- How can your script know the page's history? Adding an opening tag where there is only a stripped tag is going to result in inevitable errors. – Jonesey95 (talk) 01:40, 6 September 2025 (UTC)
- Fair, I can't guarantee that is the correct option in terms of WP:CONTEXTBOT. Removed. Tenshi! (Talk page) 01:56, 6 September 2025 (UTC)
- Sounds good. I'd like to see an initial 10 tests, approved by BAG, on a random sample of the 3804 pages linked above, followed by 50 tests if the first 10 go well. If this bot works well, it will fix a lot of tedious-to-fix errors. The Lint-fixing gnomes will appreciate it and may have additional ideas for future tasks or namespaces to work in. – Jonesey95 (talk) 15:01, 6 September 2025 (UTC)
- Fair, I can't guarantee that is the correct option in terms of WP:CONTEXTBOT. Removed. Tenshi! (Talk page) 01:56, 6 September 2025 (UTC)
- How can your script know the page's history? Adding an opening tag where there is only a stripped tag is going to result in inevitable errors. – Jonesey95 (talk) 01:40, 6 September 2025 (UTC)
- I disagree on diff 1. In Special:Diff/203776827 there was a multiline strike, later in Special:Diff/204791826 "A pound sign and an abbreviation to go along with the catalog numbers would make them clearer." was moved with an unclosed opening tag. Tenshi! (Talk page) 01:22, 6 September 2025 (UTC)
- Thanks. Diff 1 incorrectly added a tag, causing the line "Some of the certification cells are center aligned." to be struck when it was not struck before. That looks like a bug to me. The appearance of the lines following "A pound sign and an abbreviation to go along with the catalog numbers would make them clearer." was also changed due to a missing end tag. That is a bug as well. I think that the code is overambitious and should focus only on misnested tags that it can be sure of, where there is an opening tag followed by a closing tag after multiple line breaks. Example: The line that starts "The "RIAA" column in the singles isn't clear enough" and the line following it. Instances where there are two
Approved for trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Primefac (talk) 19:03, 7 September 2025 (UTC)
Trial complete. Contribs. Few issues I've found which I'll list:
- Not respecting nowiki tags: Special:Diff/1310155761
- Adding a missing end tag: Special:Diff/1310155761, Special:Diff/1310169426, Special:Diff/1310169564
- Section heading rendering is broken: Special:Diff/1310161378, Special:Diff/1310171530, Special:Diff/1310171747
- Going to work on these. Tenshi! (Talk page) 02:43, 8 September 2025 (UTC)
- I reviewed all of the diffs. In addition to the above, I found:
- Diff 1310160738 also. I think that a <s> followed by <s> without </s> should probably be ignored as too complex for a bot.
- Diff 1310155761 also missed a line break, leaving a new stripped tag.
- In diff 1310152674, s tags can't be used to wrap the block content of {{User:COIBot/Summary/LinkReports}}. It's an edge case unless there are a bunch of them, and it didn't produce a new error.
- Other than that, nice work. I was wondering how it would deal with multiple levels of indentation with : and *, and it seemed to do quite well. I think another batch of 50 is in order once the code is updated (note: I am not a BAG member). Again, I would probably try to be less ambitious: editing 90% of the batch with no errors is probably better than editing 100% with a 5% error rate. The remaining 10% could be edited by a human with a script to check for validity, or saved for a batch that can be checked easily after a bot run. – Jonesey95 (talk) 04:54, 8 September 2025 (UTC)
- 1310160738 seems correct to me? Tenshi! (Talk page) 12:16, 8 September 2025 (UTC)
- For 1310152674, it appears to be striking out the templated content unless I'm missing something. By "can't be used to wrap the block content", what are you referring to? Tenshi! (Talk page) 00:40, 10 September 2025 (UTC)
- {{User:COIBot/Summary/LinkReports}} creates a table. It is not valid syntax to wrap a table (block content) in inline tags (s tags). Note the Linter misnested tag error at this version of my sandbox. There is a slightly helpful explanation at the MediaWiki help page. I don't mind if the bot leaves a few existing errors of this type behind; someone can just fix them by hand. – Jonesey95 (talk) 01:01, 10 September 2025 (UTC)
- Came across another issue where the bot will likely have to ignore and leave to humans. On , there's a multiline misnest here where the next line is in the middle of a wikilink, which would likely cause another misnest if the bot tried to fix:
- I reviewed all of the diffs. In addition to the above, I found:
| Text |
|---|
| The following discussion has been closed. Please do not modify it. |
|
- Everything seems to be fixed. Should be good for a 2nd trial. Tenshi! (Talk page) 01:37, 10 September 2025 (UTC)
Approved for extended trial (50 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. – DreamRimmer ■ 16:38, 10 September 2025 (UTC)
Trial complete. Contribs. Only issues that I've noticed currently is Special:Diff/1310617599 where the heading was already broken by a preceding <s> tag causing it to not render and Special:Diff/1310616875, which I'm honestly not sure how it did that. Tenshi! (Talk page) 17:30, 10 September 2025 (UTC)
- Good job including strike tags in the edits. An opening s tag was placed in the middle of a URL instead of at the start of the text at Special:Diff/1310617662 (in the "Criticism of Bordeaux" line). Special:Diff/1310616875 seems similar: the opening tag ends up right after an = character. Something in the code. If you can't figure it out, maybe ignore patterns containing an = character and leave them for human editors. The other 48 edits looked perfect.
- As for Special:Diff/1310617599, I wouldn't worry about it. The page looks the same before and after, just as it does when the s tag precedes a : or * character. GIGO is unavoidable in some cases and a pain to work around without breaking other types of valid markup. – Jonesey95 (talk) 19:10, 10 September 2025 (UTC)
- I found one more where the s tag was placed after the = character: Special:Diff/1310617460. So three edits caused by the same bug. – Jonesey95 (talk) 23:17, 10 September 2025 (UTC)
- Fixed, mainly an error in how it handled section headings. Tenshi! (Talk page) 15:48, 11 September 2025 (UTC)
- At the risk of annoying BAG members, I think it's time for another 50 test edits. – Jonesey95 (talk) 16:21, 11 September 2025 (UTC)
Approved for extended trial (100 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. – DreamRimmer ■ 16:42, 12 September 2025 (UTC)
- At the risk of annoying BAG members, I think it's time for another 50 test edits. – Jonesey95 (talk) 16:21, 11 September 2025 (UTC)
- Fixed, mainly an error in how it handled section headings. Tenshi! (Talk page) 15:48, 11 September 2025 (UTC)
- I found one more where the s tag was placed after the = character: Special:Diff/1310617460. So three edits caused by the same bug. – Jonesey95 (talk) 23:17, 10 September 2025 (UTC)
Trial complete. Contribs. Edits seem okay but the bot was refusing to fix certain cases (here and here) because it was misidentifying them as having doubled markup. Tenshi! (Talk page) 17:18, 12 September 2025 (UTC)
- This is fixed once more. Tenshi! (Talk page) 18:13, 12 September 2025 (UTC)
A user has requested the attention of a member of the Bot Approvals Group. Once assistance has been rendered, please deactivate this tag by replacing it with {{t|BAG assistance needed}}. Tenshi! (Talk page) 11:51, 19 September 2025 (UTC)
Approved. Looks good. Please monitor the edits for a while to make sure everything works as intended. – DreamRimmer ■ 06:16, 23 September 2025 (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 Wikipedia:Bots/Noticeboard.