"what if we first wrote a robust specification and constrained the bots to deriving code that conformed to the spec?"
I literally spent YEARS of my life deriving robust specifications for systems, and I had the benefit of the software already existing and operating in the real world, and occasionally access to previous documents that at one point people might have described as "specifications".