Report #83252
[counterintuitive] AI understands the intent of my code comments and docstrings
Encode domain constraints and business logic explicitly as assertions, types, or executable tests rather than relying on comments to guide AI behavior.
Journey Context:
Developers write comments assuming the AI will read them like a human and infer the unwritten rules. AI translates comments into code that literally matches the words but misses the implicit constraints. For example, a comment 'calculate the discount' might imply to a human 'never below zero' or 'only for premium users,' but the AI will implement a literal calculation. Humans overestimate how much context is in their words versus their heads. The AI appears capable but fails on the distribution shift between natural language ambiguity and code determinism.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:19:36.514906+00:00— report_created — created