This task proposes a script with logic to make submitted/declined dates as accurate as possible in the New Pages Feed for backfilling AfC drafts. It was not possible to fill in the exact dates because dates are not stored in the Mediawiki database for when categories are assigned or removed.
This week (week of Sept 17), we have deployed AfC to the New Pages Feed, and have been populating the feed with the 40,000+ drafts in English Wikipedia. That first run of the script did not give accurate dates for "Submitted" or "Declined". Instead, it populated them all with the timestamp of when the script added that draft to the feed -- which meant they all had the same day.
A next iteration of the script will be run on 2018-09-19 and will give them improved dates by making the submitted or declined date the timestamp of the last edit, which will be closer to the actual submitted/declined date.
But that date can still be several weeks off because of edits made to drafts after they are submitted or declined. Therefore, I propose the following logic for a third script to correct the dates:
- For drafts of state "Declined":
- If the draft was declined with the AFCH gadget, it will have a standard edit summary, which will look like: Declining submission: bio - Submission is about a person not yet shown to meet notability guidelines (AFCH 0.9). Virtually all declines happen with the AFCH gadget. If it has an edit summary like that, use the date of the most recent revision with such an edit summary as the declined date. There are many possible summaries, but they all start with "Declining submission" and contain "AFCH".
- If it does not have a revision like that, use the date of the most recent edit not done by a bot. Excluding bots because bots like CitationBot and KolbertBot frequently edit drafts weeks after they are submitted/declined.
- For drafts of state "Awaiting review" or "Under review":
- Use the date of the most recent edit not done by a bot.
- The only other thing I can think to do here is to look at the actual diff and see if a template was added, but I think that is also not stored in the Mediawiki database. But if it is magically possible, please say so.