Introducing the mend
command as a way to drive reproducable code refactoring. It takes a Menderfile
,
inspired by Makefile and Dockerfile but also having a lot in common with DataBase migrations in tools like
ActiveRecord and Liquibase.
The files in this gist are an example run - mend
takes Menderfile
to turn main.c
into main-after.c
leaving the trail of commits in mend.log
.
This is useful both for human operators as as a safe abstraction for an LLM to drive changes in accordance with the principles of the Mechanized Mending Manifesto.
Untangler is a tool I'm writing to provide a unified CLI to refactoring steps for a variety of languages.
Kind of like a more strict TDD designed to force small steps. If you run the tests and they fail, you blow away your changes. For docs and formatting, I'm also adding a stricter variant, BICR = BinaryIdentical && Commit || Revert.
IOCCC = International Obfuscated C Code Contest. Here I'm using an entry from 2020 that prints a starwars intro style scroll in ascii art
Arlo's Commit Notation gives a rationale for having a tracable set tiny commits of known risk on a legacy codebase. Mend would be set up to make it very easy to follow this convention for commit prefixes.
See also Naming as a Process, showing the flexibility of refactoring steps targeting capturing insight incrementally in names.