Search Sreeni's Insights

Filter by content type
ai crafting August 4, 2026 4 min read

I Shipped a Black Box, Not a Feature

I merged a 400-line AI-assisted PR I understood for about 48 hours, then couldn't explain my own code when a bug came in. That gap between 'I shipped it' and 'I understand it' is comprehension debt, the third of seven AI debts.

Share:

I Shipped a Black Box, Not a Feature

AI Debt 3/7 - I Shipped a Black Box, Not a Feature. When the code ships but the reasoning doesn't.
AI Debt 3/7 - I Shipped a Black Box, Not a Feature. When the code ships but the reasoning doesn't.

When the code ships but the reasoning doesn’t.


TL;DR: I merged a 400-line PR I genuinely understood — for about 48 hours. Then a bug came in, and I realised I couldn’t explain my own code. That gap between “I shipped it” and “I understand it” is comprehension debt, and it’s the one that turns on-call into archaeology.


The PR was clean.

Clean diff. Four files. A new caching layer with invalidation, a couple of decorators, and a small state machine to handle the edge cases. Reviewed in 20 minutes. Merged before lunch.

I prompted maybe 80% of it. I read 100% of it. It made sense at the time.

Two days later, a bug report came in. Cache wasn’t invalidating on one specific path.

I opened the file. And for a solid 90 seconds, I just… stared.

Not at unfamiliar code. At code I had merged with my own name on the commit.

The Moment It Hit

I could read every line. I could tell you what it did.

I could not tell you why it did it that way.

  • Why a state machine here and not a simple flag?
  • Why three cache keys instead of one?
  • Why the decorator order matters — and it clearly did, because reversing it broke a test.

I had reviewed it. I had approved it. The AI had a perfectly good reason for each choice when it generated it. But that reasoning lived in a chat session I’d closed, in a context window that no longer exists.

What landed in the repo was the answer. Not the working.

Reading Is Not Understanding

There’s a quiet trick AI-assisted development plays on you:

Reading code feels like understanding code. It isn’t.

When you write code, understanding is the byproduct of the struggle. You considered three approaches. You rejected two. You hit a bug and learned why your first instinct was wrong. By the time the code exists, your brain has a map of the territory.

When the AI writes it and you review it, you skip the struggle. You get the map without the walk. And maps without walks fade fast.

Within 48 hours, I had the same relationship to that code as a stranger reading it for the first time — except worse, because I felt like I should know it.

Why It’s Worse Than Legacy Code

Legacy code at least had a human who once understood it. You can git-blame your way to a person, ping them, get the story.

AI-generated code that nobody walked through has no such person. The git blame points at you — and you don’t remember either.

Multiply that across a team:

  • Engineer A prompts a module, ships it, forgets.
  • Engineer B is on-call when it breaks at 2 AM.
  • Engineer A is asleep / on PTO / at another company.
  • B is now doing archaeology on code A also can’t explain.

That’s not a codebase. That’s a shared amnesia.

What “Paying It Down” Looks Like

Comprehension debt isn’t fixed by reading harder. It’s fixed by forcing the walk.

  • Explain it back, in the PR. Before merging AI-assisted code, write a 3–5 line “why this shape, not another” in the PR description. If you can’t, you don’t understand it yet.
  • Pair-review AI PRs. Two humans, one of whom didn’t prompt it, walking through the logic together. The questions the second person asks are exactly the ones you skipped.
  • Comment the why, not the what. The AI is great at the what. The why is the part that decays. Lock it into the code while you still remember.
  • Delete and re-derive a piece. Pick the gnarliest function in the diff. Delete it. Re-prompt it from scratch without looking at the original. If the result drifts, you didn’t understand the original — you just trusted it.

The Real Lesson

The PR was green. The feature shipped. The dashboard was happy.

But two days later, I was a stranger in my own commit. And the people coming after me — teammates, future-me, the on-caller at 2 AM — they’re starting from even further behind.

I didn’t ship a feature. I shipped a black box with my name on it.

That’s debt number three of seven.

Related Posts