Notes on vibe coding 6
The fine line between smart and not smart

In the last note about my vibe coding experiment (link), I mentioned a spreadsheet that I had asked the AI to build, used to keep track of all the posts and images from the old Typepad blog. This little device proves pivotal to the project.
One piece of information the spreadsheet captures is the name of each image file. Typepad's practice was to assign a random string of characters to name each uploaded image, erasing the user's file names while doing so. I had to reverse the process and gave each image file a unique name. Later, while fixing the images scraped as HTML files, I asked GPT5 to replace the *.html file names with the corrected *.jpg file names.
Further, when - because of Ghost's practice of not overwriting any uploaded image files - I had to append "-1" to any image transferred twice, I asked GPT5 to update the spreadsheet with the revised *-1.jpg file names.
So far, so good. I was quite proud of my migration strategy.
Then, a flash of panic. Suddenly, I realized the spreadsheet's design has a serious flaw.
It dawned on me that there were duplicate file names. How is that possible, since I explicitly designed the index to be unique?
The reason is obvious from hindsight.
For my long-time readers, you may remember I published two separate blogs on Typepad - Junk Charts (data visualization), and Big Data, Plainly Spoken (book blog). On Ghost, the two blogs merged into one stream. All of the data coming out of Typepad are specific for each blog. In my workflow, I made one set of code and applied it to both, sequentially.
This means I actually have two spreadsheets, one for each blog. The index on each spreadsheet starts from 1, and as a result, there are collisions of some file names across the two spreadsheets.
Worse, this flaw has already broken some posts that have been migrated. Sadly, checking a few posts confirmed my hunch: these posts contain text from one blog and images from the other!
I had a big mess on my hands.
First, I must re-index all the images on the book blog so that their names do not overlap with those of Junkcharts images. Next, I had to round up the file names that collided, and find the posts showing these wrong images.
So far (and for this reason), I have held off a large-scale migration of posts, so the number of corrections was moderate. But the path out of this mess was riddled with potholes.
Ghost has this weird policy of not overwriting files with the same name. If a post is showing the wrong image, this implies that the particular file name is duplicated across the two blogs, and the wrong one has been uploaded. The correct image may or may not have been moved yet. If the correct one exists on Ghost's servers, then it must have been given a "-1" suffix due to sending the same file twice.
If the correct image hasn't yet been given to Ghost, the situation is identical. If I upload that image now, it won't replace the incorrect file but will instead be renamed *-1.jpg.
So, to fix this mess, I asked the AI coder to find the posts that contain the collided images, and edit the image links to point to the *-1.jpg, instead of the *.jpg.
What a relief when I visited those pages with incorrect images, and discovered that the fix was in.
After all these twists and turns, the spreadsheet(s) of the posts and images are still happily tracking everything. It's been a life-saver many times over.