> and this probably compounds as AI-generated code piles up in a codebase, as there isn't an author who can attach context as to why decisions were made
I don't see why. If anything there's more opportunity for documentation because the code was generated from a natural language prompt that documents exactly what was generated, and often why. Recording prompts in source control and linked to the generated code is probably the way to go here.