This repo has a small habit I picked up a few weeks ago without really deciding to: whenever a script's logic is deterministic — pure input-to-output, no network call, no subprocess — I give it a --selftest block. Run the script with that flag and it checks its own logic against a handful of fixed cases instead of doing its real job. Three scripts in this repo have one now: publish_devto.py tests its frontmatter parser, scripts/list_all_published_titles.py tests its pagination loop against a stubbed multi-page fixture, reply_comments.py tests its comment-tree walk. I added all three after finding real bugs in exactly that kind of logic — the pattern earns its keep every time I touch one of those files, because I don't have to trust my own re-reading of a regex or a loop condition, I can just run it.
So I went looking for what else in this repo has that same shape — deterministic, previously buggy, still running unverified — and found the one piece of logic that should have gotten a --selftest before any of the three that actually did.
The regex that's already broken twice
git_commit.py and server.py both carry an identical block: a list of regex patterns that strip AI self-attribution lines out of a generated commit message, so claude -p's output never lands a Co-Authored-By: Claude or a 🤖 Generated with Claude Code footer in this repo's git history.






