Speaking of commit history, bad merges can leave comments and code together that shouldn’t be. And it will pass tests.
Which makes me to think that the AI models should be trained on the code evolution of commit chains and not just on isolated snippets of code. That way, the AI could analyze your own commits to detect when a comment becomes outdated.