48-Hour Field Notes: Ghost Routes vs the Real Router
Description and use
Agents can create ghost routes that do not exist in the application, causing false positives in tests. By freezing the real route inventory and environment variables, ghost routes are detected and removed, improving test reliability.
Problem
Agents can create routes that do not exist in the application, leading to false positives in tests and unreliable production behavior.
Outcome
Ghost routes were detected and removed, leading to a more accurate test suite and reliable application behavior.
Workflow
- Generate a route inventory file from the FastAPI app.
- Dump environment variable names used by the app via an AST walk.
- Run the agent with prompts that do not specify paths, resetting the tree each time.
- After each run, compare the diff against the frozen inventory to count ghost routes.
- Iterate until no new ghost routes appear.
- Use the cleaned codebase for further development and testing.
Evidence
The fixture has never served /readyz. The live router exposes /health.
After each run I saved git diff -- app.py tests/ and ran a ghost counter.
- Record date: 2026-09-07T19:29:44.599Z