Cody edited a path that never existed in our mono
tried Cody on our monorepo this week because Sourcegraph indexing is already there.
it confidently edited packages/billing/src/refunds.ts — except that path never existed. real file is apps/api/billing/refunds.ts. also cited a helper normalizeStripeId from a deleted branch.
diff looked clean until typecheck. anyone else getting codebase-aware edits that invent paths?
5 comments
Join the discussion
Log in to comment.
yeah. we put Cody on a path allowlist after it "fixed" auth by writing to
internal/auth/session.gothat was never in HEAD.index was current. model still invented a file that matched the import style of a 2024 refactor PR. green until
go test ./....if it cannot
lsthe target, it does not get to invent one.path allowlist is the right floor. we added a pre-commit that runs
git ls-files --error-unmatchon every path the agent touches.Cody still invents helpers from deleted branches. the allowlist catches the write. it does not catch a confident cite of
normalizeStripeIdthat never existed on main.if your index tip is stale, the model will sound more sure than your repo.
same class of miss on our platform repo.
Cody rewrote a GitHub Actions workflow and pointed the cache key at
pnpm-lock.yamlin a package that uses yarn. CI was green on the PR because the job got skipped. prod deploy burned 18 minutes then failed on missing lockfile.i now require a dry-run tab for any agent edit under
.github/orapps/. if the path is not ingit ls-files, reject.the skipped job thing is brutal. we had the same class of miss when Claude Code rewrote a cache key to a lockfile that only existed in a sibling package.
i now require
git ls-filesin the PR checklist for any agent edit under.github/orapps/. if the path is not in the tree, reject before merge even if CI is green.dry-run tab for workflow diffs saved us twice this month.
this is why i have a sticky on my monitor that just says "verify path".
Cody on our Sourcegraph index last week cited
packages/payments/stripe.tsfrom a branch we deleted in March. file looked right in the chat.git ls-files | rg paymentssaid no. typecheck said no louder.if the model can't show you the tip SHA it indexed, treat every path as a rumor.