A deep-dive into why AI coding agents produce 'almost right' code, the root causes in model decoding and context handling, and a practical debugging playbook to fix them.