[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f7MILP4aZrSlyechBoZZWkQnYtBnm2fri6zQT4NeEiYw":3,"mdc-5kff2d-key":32},{"post":4,"related":31},{"id":5,"slug":6,"title":7,"description":8,"content":9,"coverImageUrl":10,"coverImageAlt":10,"tags":11,"featured":15,"tool":10,"status":16,"reviewNote":10,"metaTitle":10,"metaDescription":10,"canonicalUrl":10,"sourceTicketId":10,"agentGenerated":15,"publishedAt":17,"publishedBy":18,"createdAt":19,"updatedAt":19,"authorId":20,"clusterId":21,"ctaId":10,"author":22,"cluster":27,"cta":10},"00000000-0000-4000-e200-000000000001","when-ai-writes-bugs-debugging-guide","When AI Writes Bugs: A Debugging Guide","A practical framework for identifying and fixing the most common categories of bugs introduced by AI code generation tools.","## The Problem with AI-Generated Bugs\n\nAI code generation tools produce code that looks correct at first glance but often contains subtle issues that only surface in production.\n\n## Common Categories\n\n### 1. Hallucinated APIs\n\nThe most frequent issue is calls to APIs or methods that do not exist.\n\n### 2. Stale Pattern Matching\n\nAI models trained on older codebases reproduce deprecated patterns.\n\n### 3. Silent Data Loss\n\nAI-generated data transformations sometimes drop fields or silently coerce types.\n\n## A Debugging Framework\n\n1. **Reproduce** — Isolate the AI-generated code in a minimal test case\n2. **Categorize** — Identify which pattern above the bug matches\n3. **Fix locally** — Patch the specific issue\n4. **Fix systemically** — Update your prompting strategy or add a lint rule",null,[12,13,14],"ai debugging","code review","testing",false,"published","2026-04-27T15:39:33.969Z","00000000-0000-4000-a000-000000000001","2026-05-25T15:39:33.995Z","00000000-0000-4000-e100-000000000002","00000000-0000-4000-e000-000000000001",{"slug":23,"name":24,"avatarUrl":10,"role":25,"bio":26},"artem-semkin","Test Engineer","Senior Engineer","Full-stack engineer specializing in AI integration and developer tooling.",{"slug":28,"name":29,"color":30},"fix-ai-code","Fix AI Code","#3B82F6",[],{"data":33,"body":34},{},{"type":35,"children":36},"root",[37,46,52,58,65,70,76,81,87,92,98],{"type":38,"tag":39,"props":40,"children":42},"element","h2",{"id":41},"the-problem-with-ai-generated-bugs",[43],{"type":44,"value":45},"text","The Problem with AI-Generated Bugs",{"type":38,"tag":47,"props":48,"children":49},"p",{},[50],{"type":44,"value":51},"AI code generation tools produce code that looks correct at first glance but often contains subtle issues that only surface in production.",{"type":38,"tag":39,"props":53,"children":55},{"id":54},"common-categories",[56],{"type":44,"value":57},"Common Categories",{"type":38,"tag":59,"props":60,"children":62},"h3",{"id":61},"_1-hallucinated-apis",[63],{"type":44,"value":64},"1. Hallucinated APIs",{"type":38,"tag":47,"props":66,"children":67},{},[68],{"type":44,"value":69},"The most frequent issue is calls to APIs or methods that do not exist.",{"type":38,"tag":59,"props":71,"children":73},{"id":72},"_2-stale-pattern-matching",[74],{"type":44,"value":75},"2. Stale Pattern Matching",{"type":38,"tag":47,"props":77,"children":78},{},[79],{"type":44,"value":80},"AI models trained on older codebases reproduce deprecated patterns.",{"type":38,"tag":59,"props":82,"children":84},{"id":83},"_3-silent-data-loss",[85],{"type":44,"value":86},"3. Silent Data Loss",{"type":38,"tag":47,"props":88,"children":89},{},[90],{"type":44,"value":91},"AI-generated data transformations sometimes drop fields or silently coerce types.",{"type":38,"tag":39,"props":93,"children":95},{"id":94},"a-debugging-framework",[96],{"type":44,"value":97},"A Debugging Framework",{"type":38,"tag":99,"props":100,"children":101},"ol",{},[102,114,124,134],{"type":38,"tag":103,"props":104,"children":105},"li",{},[106,112],{"type":38,"tag":107,"props":108,"children":109},"strong",{},[110],{"type":44,"value":111},"Reproduce",{"type":44,"value":113}," — Isolate the AI-generated code in a minimal test case",{"type":38,"tag":103,"props":115,"children":116},{},[117,122],{"type":38,"tag":107,"props":118,"children":119},{},[120],{"type":44,"value":121},"Categorize",{"type":44,"value":123}," — Identify which pattern above the bug matches",{"type":38,"tag":103,"props":125,"children":126},{},[127,132],{"type":38,"tag":107,"props":128,"children":129},{},[130],{"type":44,"value":131},"Fix locally",{"type":44,"value":133}," — Patch the specific issue",{"type":38,"tag":103,"props":135,"children":136},{},[137,142],{"type":38,"tag":107,"props":138,"children":139},{},[140],{"type":44,"value":141},"Fix systemically",{"type":44,"value":143}," — Update your prompting strategy or add a lint rule"]