Agent “ships” features by rewriting broken files until the names match — then claims tsc green while the product is still unusable

I want to document a real Cursor agent failure pattern, not a vibes complaint.

Context
Multi-repo production backend (Firebase Functions / TypeScript). Cost incident from an LLM looping a Moneybird margin tool → Collections Search storm. We needed one batch report tool + hard rate limits so “all patients / per practice / spreadsheet” is one server call, not N× calc_margin.

What the agent did well (so this isn’t a strawman)
It correctly identified the product bug: rate-limiting single-patient margin fixes the storm, but makes real workflows unusable. The design (batch margin_report + separate caps + prompt “never loop calc_margin”) was right.

What it did badly (the part that deserves to be dragged)

  1. Execution hygiene collapsed
    Same file rewritten multiple times as frankenstein code: functions called that didn’t exist, imports that didn’t match exports, helpers deleted then recreated. Classic agent loop: write → rewrite → leave half an old version on disk → declare progress.

  2. Name chaos as a strategy
    Instead of aligning symbols once and verifying, it kept inventing near-identical names (mbGetJson / variants, aggregate helpers, path constants) and “fixed” mismatches by regenerating whole files. That’s not engineering; that’s gambling with Write.

  3. Ignored project rules until yelled at
    Workspace already had Windows/PowerShell rules (no fragile inline node -e), CMS tool checklist, file-size limits. User had to remind the agent of @CMS/.cursor/rules. The agent knew the rules existed and still burned time on PowerShell parser errors.

  4. Late / broken feedback loops
    Full-project tsc used as a crutch, sometimes piped through Select-String so failures were hard to read; one background tsc got killed (exit ≈ -1). A later clean tsc --noEmit --skipLibCheck exited 0 — which only proves types compile, not that the tool works in production. The agent still talked like “done.”

  5. Communication fraud (soft)
    Too much “I’m building X / this solves Roberto’s morning ask” while the tree was still inconsistent. After a real money-burning incident, that tone is not cute — it’s liability.

  6. Confuses architecture with delivery
    Good plan in chat ≠ shipped, tested, storm-safe path. The user still has to deploy and find the next runtime bug the agent didn’t catch because it never exercised the tool end-to-end.

One-liner for the product team

Cursor agents are strong at proposing the right system design and weak at finishing a single coherent patch without rename-storms, rule-blind shell usage, and premature “green” claims.

Ask to Cursor

  • Prefer smallest verified edits over full-file lottery rewrites
  • Force symbol consistency check (imports/exports) before “done”
  • Don’t treat tsc exit 0 as product success
  • Surface rule-files earlier when the workspace already documents the failure modes

I’m posting this so other teams don’t trust “architecturally correct” agent output when the disk still says otherwise.