Last time it was about updating code. Now it’s about altering project internals.
Mid-Project Legacy
A long time ago, I decided that the old style include(‘foo_class.inc’) was annoying, and the new style autoloader classes with use \Foo; were nicer.
So I did a simple thing: copy them all into a namespace, and then convert them to PSR-4 compatible classes (aka, autoloading classes).
I left the old files around, just in case they were still being used. The project never completed, and maybe around 10 classes were converted, and many were not.
I told the LLM to fix this, and make everything into a PSR-4 compatible class. It decided which version was good, and which was not and possible merges.
This is mind-blowing to me, that the program can do this.
The process took a day, due to pauses and usage limits, and I’m still not sure it’s OK.
The goal here was to allow static code checking tools like Psalm to do better code analysis.
So far, no real new code
I’m just writing this to make a weird point: I haven’t asked the LLM to write new code. It’s refactoring.
It’s making old code conform to newer programming standards.
It’s removing code, too.
Some Removals
Reporting bad posts – a system similar to Digg, where the community can moderate. It stopped being useful when people gamed it or it didn’t instantly mod someone down.
Spam trapping – I had a bunch of filters, some quite nice, but it was out of date.
IP logging and redirecting – this is still important, but the site’s implementation was pretty annoying, so it goes.
DIY captcha – I wrote it because there weren’t many options I liked. Now, it’s not that relevant because there are packages for captchas.
Themes – again, not super popular, and it was done in a annoying way, with GET parameters.
These removals aren’t all because the feature was bad, but it was just out of date, or should be replaced. Removing them helped reduce the code size.
Improving Debugging
After telling Thaura to do something a certain way, over and over, it starts to do it, automatically, and even expand on it.
I told it to use the static analysis and dependency databases a couple times, and it figured out how to use them.
I told it to always do static analysis and check dependencies, and it would do both, with the tools, and on its own.
So every change is checked with these tools, and also with the Playwright integration tests against some URLs. These can trigger warnings in the logs, so I have it read the logs and debug error and warning messages.
