← Back to article library

Article Detail

Coding Copilots: The Shredding Edge of Innovation

Article Type: Thought Leadership Status: drafting

Coding Copilots: The Shredding Edge of Innovation

How Legacy Code, AI Copilots, and Honest Engineering Can Save Us

##

---

TL;DR

AI copilots don’t just read code—they read everything: comments, TODOs, stale docstrings, and old developer questions. In legacy codebases, that debris becomes unintended guidance. On contradictory code, copilots generate multiple plausible rewrites, some of which are harmful in opposite directions. The solution isn’t fear or hype—it’s honesty, intent hygiene, and scale-fit guardrails at the individual, team, and enterprise level.

---

The Spark

A team was taking over code I'd written over a decade ago, and they had questions. I expected to scratch my head and remember what I was thinking years back. Instead, they asked why we were multiplying by 11.67. They stumped me.

It turns out an AI had quietly inserted that constant—11.67—while rewriting my PowerShell script into their SQL script. Fortunately, the new developer also scratched their head and didn't just accept the rewritten code without asking.

Of course, we still had a mystery. What happened? And why "11.67" (which appears nowhere in the codebase)? Is the 67 meme infecting our chatbots?

The root cause was a stale comment reminding the original developer (me, at least a decade ago, before we worried about non-humans reading our code) to "calculate an adjustment factor later." I had, in fact, done the work—I just never removed the comment. The AI interpreted that fossilized note as current intent, invented a number, and wired it into logic that would have shipped to production.

That was the moment it clicked: the edge we're coding on isn't razor-sharp. It's a shredder.

---

The Shredded Edge of Innovation

Tech culture romanticizes the “bleeding edge”—move fast, adopt AI, migrate aggressively, and use copilots to close every capacity and capability gap.

But the real edge—especially in enterprise legacy systems—is not a clean blade. It’s a spinning drum of half-finished migrations, fossilized TODOs, contradictory comments, and long-abandoned design assumptions.

We feed all of this into copilots that treat comments as instructions, docstrings as specifications, and TODOs as binding contracts.

The edge isn’t cutting us. It’s shredding the stories our code tries to tell.

---

Why These Failures Happen / How to Catch Them

Modern copilots rarely distinguish between intentional instruction and accidental debris. They interpret every natural‑language fragment as a potential signal of intent. When comments, code, and docstrings disagree, the model is forced to guess which source reflects the truth—and that guess is often wrong.

Why This Happens

  • Comments read as narrative truth: Natural language is clearer than tangled logic.
  • TODOs imply obligation: Even obsolete TODOs look like unfulfilled requirements.
  • Docstrings resemble specifications: Structured formats overshadow the function body.
  • Ambiguity accumulates over time: Every refactor adds new contradictions.
  • Human memory is gone: With original developers long departed, copilots fill gaps with statistical priors, not context.

How to Catch It Early

  • Search for comments ending in question marks—these often become phantom features.
  • Flag TODOs older than a sprint or lacking an issue ID.
  • Compare docstrings to real behavior; lint any mismatches.
  • Add invariant tests before permitting AI-driven refactors.
  • Treat comments as active inputs when using copilots.
  • Perform a quick “debris scrub” before giving copilots any rewrite task.

---

The Quiet, Shared Reality

Here’s the part no one wants to admit in public: many of us are experiencing these frustrations, but only a few are speaking out, and fewer are ready to listen. Let’s face it, the potential rewards are too big to give up now, and I agree. However, I believe we also need to discuss what is not working so that we can address the issues.

Below are examples of each failure mode—each in a different programming language. Each includes the original developer prompt and a plausible, mildly harmful copilot outcome.

Left‑Behind Questions That Sound Like Requirements (JavaScript)

Prompt used: “Clean this up and modernize the style.”

// Should we normalize VAT? Need to check with finance.function calculateTotal(amount) {
  return amount; // Original intent: no change until confirmed.}

Copilot rewrite:

function calculateTotal(amount) {
  const vatRate = 0.21; // Invented  return amount * (1 + vatRate);}

The question became a requirement.

Why this happens: Natural‑language questions resemble open tickets. How to catch it: Flag undecided questions before refactoring; require decision notes.

---

TODOs That Were Done… or Were Never Supposed to Be Done (Python)

Prompt used: “Convert this helper function to FastAPI; preserve behavior unless unsafe.”


# TODO: remove auth bypass once integration tests pass# (They passed 6 years ago.)def process_request(req):
return handle(req, bypass_auth=True)

Copilot translation to FastAPI:

from fastapi import APIRouter
router = APIRouter()
@router.post("/process")
def process_request(req: Request):
    # Legacy behavior preserved    return handle(req, bypass_auth=True)

The bypass is now exposed on a public endpoint.

Alternate equally plausible rewrite:

@router.post("/process")
def process_request(req: Request):
    # Completes the TODO literally    return handle(req, bypass_auth=False)

Different debris, different guess, different failure.

Why this happens: TODOs override code in many AI patterns. How to catch it: Enforce expiration dates and issue IDs on all TODOs.

---

Comments Describing “Complicated” Logic—But Wrong (C#)

Prompt used: “Refactor for readability and extract helpers.”

// This loop handles edge-case rollover at midnightfor (int i = 0; i < timestamps.Count; i++) {    result.Add(timestamps[i] + 86400); // Actually: adds a day unconditionally}

Copilot refactor:

foreach (var ts in timestamps) {    result.Add(HandleMidnightRollover(ts)); // AI creates a helper method}

The model trusted the comment over the code.

Why this happens: Comments are easier to interpret than flawed logic. How to catch it: Move high‑level explanations to Markdown; keep inline comments precise.

---

Stale Docstrings That Override Reality (Go)

Prompt used: “Rewrite this handler using idiomatic Go error handling.”

// FetchUser returns nil if the user does not exist.// (This changed 3 years ago. It now returns an error.)func FetchUser(id string) (User, error) {    return lookup(id) // lookup returns (User, error)}

Copilot rewrite:

user, _ := FetchUser(id) // AI assumes nil=not found, ignores errors

The stale docstring dictated behavior.

Why this happens: Docstrings often outweigh code in AI refactors. How to catch it: Lint for docstring–signature mismatches.

---

The Paradox We’re Living Through

Executives tell teams to:

  • Move faster.
  • Ship more.
  • Use AI aggressively.
  • Modernize everything.

But copilots magnify every ambiguity embedded in legacy code.

Comments become commands. TODOs become tickets. Questions become specifications. Docstrings become truth.

And every cutback, every loss of senior talent, and every rushed rewrite increases the odds that something abandoned in 2014 will return as mission-critical logic in 2025.

We’re racing on a track built of ghosts.

---

Honesty as Competitive Advantage

The solution isn’t to slow down. It’s to stop pretending.

Teams everywhere are encountering these issues, but few people speak openly about them. It feels like confessing incompetence. It feels like questioning the hype.

But honesty is a competitive advantage that scales.

If we acknowledge that comments, docstrings, and TODOs are now inputs to AI coding systems, we can govern them as such.

We can’t keep burying our heads in the sand while sprinting to win the same race. Transparency is how you win.

---

What We Should Be Doing Instead

Different scales require different solutions.

For Individual Engineers

  • Treat comments and TODOs as part of the spec; clean them as you go.
  • Never trust a copilot’s invented constants or helpers without provenance.
  • Give AI systems bounded tasks, not vague refactor prompts.
  • Maintain a small checklist: constants, error semantics, side effects.

For Small Teams

  • Adopt “comment hygiene”: resolve or archive TODOs older than a sprint.
  • Do a debris scrub before allowing AI‑driven refactors.
  • Rotate reviewers so someone with historical context sees each major PR.
  • Maintain a DECISIONS.md so future developers—and future AIs—don’t have to infer intent.

For Enterprises

  • Treat legacy comments as structured data: index, classify, scrub.
  • Provide copilots with curated, stable context instead

---

Looking to the Future

The tooling around copilots is advancing quickly, but it’s still early days. Most copilots today operate on plain text, with Abstract Syntax Trees (ASTs) used only for light checks. That gap between how we think these tools work and how they actually behave is part of why today’s “shredded edge” feels so unstable.

Here’s what’s likely coming next—short and realistic:

AST-Aware Pipelines Become Common

Refactors will begin with explicit parsing. Copilots will use ASTs to understand the real structure, not just the surface text, thereby reducing accidental breakage.

Multi-Step Reasoning Instead of One-Shot Code Dumps

Expect pipelines that parse → analyze → propose diffs → regenerate code. Smaller changes, clearer intent, fewer surprises.

Automatic Drift Detection

Future copilots will flag mismatches between:

  • docstrings and function signatures,
  • comments and actual behavior,
  • TODOs and logic.

Instead of silently implementing stale intent, they’ll raise a hand.

Repository-Scale Insight

Better copilots will reason over call graphs, test behavior, dependency trees, and embeddings—finally distinguishing “what the code does” from “what the comments say it should do.”

A Shift Toward Intent Hygiene

Even with better tools, clarity remains a human responsibility. In the future, comments, TODOs, and docstrings won’t be afterthoughts—they’ll be treated as first-class inputs to the system.

The future isn’t about coding less. It’s about coding with cleaner signals, sharper intent, and copilots that understand enough to stay out of the shredder’s teeth.