As any organically evolved imperfect software, my app grew its own home-brewed unplanned core data structure that almost every system depends on. Uprooting, or even slightly shaking it, might cause seams in unforeseen reaches of the codebase.
Mine is an internal intermediate representation of songs and the choreography around them. The core app is written in TypeScript while many services for generating and analyzing the music are written in Python.
Songs have to be represented and handled in both ecosystems. Sometimes we also have to convert them to or from MusicXML.
But the details don’t really matter — not for you to read about, and not even for me to think about. This is a classic black box for an agent to build.
We just need it to work. Not a single soul will care if it’s a heaping steaming pile of garbage code so long as the right input maps to the right output.
The internals are decoupled from the outside world — no one nowhere should give a thought to what’s inside the belly of the beast.
And yet, I care. I looked. I got curious during a code review.
Among the highlights:
750 lines of joy in validation.py, including life-saving helpers such as _validate_optional_bool and _expect_string.
An attempt at a half-baked re-invention of JSON serialization, featuring beautiful gems as if value is True: return "true".
A roundtrip.py for space-ship-worthy end-to-end verification: careful handling of the nuances of omitted vs. undefined fields and a delicate dance around the possible random order of object keys.
This is horrible. And stupid. And not important in the slightest.
So I was sitting in the garden, smoking a cigarette, thinking: When will I ever get to fix this? And the answer is: Never.
I will never have a day where this will be my top priority. I will never care enough to put it on the roadmap, will never sneak an hour at night to get it polished.
The most I can do is fire away one of the myriad template deslop prompts I routinely have at the ready and pray it smooths things over rather than slap another over-engineered patch on top.
This is the right call, but it does not make me happy.
I could only find one future scenario that will force me to wade into a refactor of this mess: if it prevents the agent from swiftly creating other messes.
Can God create a stone so heavy that even He could not lift it? I don’t really care. But I do know that AI can write code that is too complex for an AI to understand.
If and when this module will grow enough tentacles to make further changes a cumbersome, hairy, token-heavy, and error-prone effort, then I’ll have no other option than to roll up my sleeves and yell at my robot to mow down the lawn.
Until then we just live the with bloat.