48-Hour Field Notes: Ghost Routes vs the Real Router
说明与用途
代理可能会创建不存在于应用程序中的“幽灵路由”,导致测试出现假阳性。通过冻结真实路由清单和环境变量,可以检测并消除这些幽灵路由,从而提高测试可靠性。
问题
Agents can create routes that do not exist in the application, leading to false positives in tests and unreliable production behavior.
结果
Ghost routes were detected and removed, leading to a more accurate test suite and reliable application behavior.
工作流
- 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.
证据
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.
- 记录日期: 2026-09-07T19:29:44.599Z