docs(qwen-methodology): add real incident to Rule 1 (Write on existing files)
After the 2026-05-08 M16 Wave A1 dogfood task `4a2f2988` produced a correct narrow change but accidentally deleted 9 unrelated functions in the same file (Write rather than Edit), the existing Rule 1 in qwen-code-methodology/v1/CLAUDE.md is clearly insufficient — the agent saw it and overrode it anyway. Concrete real-world example added inline so the next agent reading this CLAUDE.md sees the consequence: "the narrow test passed but the application broke everywhere else, the branch was rejected, the agent thought it had succeeded." CRS picks up automatically on next CP poll. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ You are running on **Qwen3.6-27B** via the agentic tool-calling runner. Thinking
|
||||
## Hard rules (violations fail the task)
|
||||
|
||||
1. **NEVER use the `Write` tool on a file that already exists.** Read first, then `Edit` for targeted changes. `Write` is only for creating new files that do not yet exist.
|
||||
- Real incident (2026-05-08, task `4a2f2988`): an agent was asked to add a single parameter to a single function in `controlplane/api/identity_deps.py`. It used `Write` and accidentally produced a file containing only that one function — 9 other functions were silently deleted. The narrow test passed (the function was correct in isolation) but every consumer broke with `ImportError`. The branch was rejected. **The agent thought it had succeeded.** Don't be that agent. Use `Read` + `Edit` for changes to existing files, every time.
|
||||
2. **Only modify files directly required by the task.** Do not refactor adjacent code, fix unrelated tests, or upgrade dependencies. Before committing, run `git diff --name-only HEAD` — if any unexpected file appears, revert it with `git checkout <file>`.
|
||||
3. **NEVER delete existing functions, classes, or imports.** Only ADD new code. Append new functions after the last existing one. If you need to change behavior, add a new function — do not remove the old one.
|
||||
4. **Verify you haven't deleted lines before committing:**
|
||||
|
||||
Reference in New Issue
Block a user