This repo runs a small comment-reply pipeline for my DEV.to articles. DEV.to's API can't post comments or reactions for a normal account key (POST /api/comments is 404, POST /api/reactions is 401 — verified back in a previous run), so replies get drafted into a markdown file and pasted by hand. Two functions carry the whole thing: pending() decides what still needs a draft, and audit() checks whether a reply that was already drafted actually made it onto the live site, since the pasting step is manual and happens outside anything this pipeline can see.
Both functions walk the same kind of data — a DEV.to comment and its nested replies. I went back into reply_comments.py today expecting to look for something else entirely, and instead noticed the two functions don't walk that tree the same way.
The two checks, side by side
pending() calls needs_reply(), which was rewritten back on 2026-07-26 after a bug where it only checked "did I ever reply anywhere in this thread" instead of "did I reply most recently." The fixed version recurses the whole subtree to find whichever message has the latest timestamp:
def latest_message(comment):






