All courses

Half-finished changes: the call sites it missed

Recognise a rename, signature change or semantic change applied only in the files the agent read, while other callers, reflection or string references, configs, docs and other services still use the old form. Check for missed sites with search and the compiler.

Builds on: What the agent cannot see

Read it card by card Start the whole course

"Renamed everywhere", it says

You ask the agent to rename `send_email` to `send_message` and add a `channel` argument. It edits `notify.py` and `signup.py`, the tests go green, and the summary reads: *Renamed and updated all callers.* Two weeks later the nightly reminder job crashes. Nobody touched that job. So where did the agent's "all" stop?

Why the change stops halfway

"All callers" means all callers *in its context*: the files it opened or found with its own search. The agent never saw a job scheduled by name in YAML, a `getattr` lookup, a doc example or a service in another repo, so to it they don't exist. Green tests are only a proxy signal, a visible stand-in for the real goal: they prove nothing about code they never call. **Later cost:** a crash on a rarely run path, a config key silently ignored, docs that lie.

Where the old form survives

- **Direct callers:** the compiler catches them in Java, Go, Rust and TS, but only in the code you actually build. Python and JS catch nothing until the call runs. - **Strings:** reflection, `getattr`, config keys, route names, JSON fields, SQL. - **Outside the repo:** other services, clients, stored data. - **Docs and examples.** - **Meaning changes** (seconds→ms, dollars→cents): no compiler sees these. Rename the function or change its type so the compiler does.

Two files changed, tests green

The tell: a public function is renamed *and* gets a new required parameter, yet the diff touches only the one caller the agent had open, and its transcript shows no search. Python checks nothing until a call runs. `worker.py` calls `getattr(notify, job["handler"])`, and `jobs.yaml` still says `handler: send_email`. **Later cost:** that lookup raises `AttributeError` only when the nightly job runs. Fix just the YAML and, if the worker passes only `(to, body)`, the call still fails with `TypeError` for the missing `channel`.
// Python
--- a/notify.py
+++ b/notify.py
-def send_email(to, body):
+def send_message(to, body, channel):
--- a/signup.py
+++ b/signup.py
-  notify.send_email(u.email, msg)
+  notify.send_message(u.email, msg, "email")

Settling it: search, then build all

Run `$ rg -n -i 'send_email|sendemail'` over the whole repo: code, YAML, templates, docs and tests. Each hit is either a site to fix or a leftover the agent must justify. In typed languages, build every target from the repo root: `go vet ./...` (unlike `go build`, it also type-checks tests), `cargo check --workspace --all-targets`, `tsc --noEmit`, `mvn test-compile`. Then ask the agent: *how did you find the callers, and who outside this repo uses it?*

Its "everywhere" is where it looked

A rename, signature change or meaning change is only finished when the old form is gone everywhere. Before trusting one, search the old name across code, configs and docs, build every target, and ask who outside the repo depends on it.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.