From 748e5d01ea8f88d0951551a258a9fe7d5b919c0f Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 6 Jun 2026 23:57:00 -0400 Subject: [PATCH] docs(agents): HARD BAN git restore + no giant edits (after data loss) The Critical Anti-Patterns list now has 2 new HARD rules: 1. NEVER run git restore / git checkout -- / git reset without EXPLICIT user permission in the same message. They destroyed user in-progress src/* edits twice in one session (2026-06-07). 2. No giant edits: if manual-slop_edit_file new_string exceeds ~20 lines, STOP and split it. Large blocks hide indentation bugs. Also: - Strengthened Session-Learned rule 4 to a HARD BAN - Added rule 6 'Stop profiling the wrong thing' (don't re-benchmark src/* imports; benchmark_imports.py is authoritative; the missing metrics are on imgui_bundle init + hello_imgui.run() + first frame) --- AGENTS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 832bddfc..83d0ccd8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,6 +36,8 @@ For understanding, using, and maintaining the tool, see `docs/Readme.md` and the - Do not add comments to source code; documentation lives in `/docs` - Do not use `set_file_slice` for multi-line content; it's literal line replacement by design (see `conductor/edit_workflow.md`) - Do not use `git restore` while a user is mid-conversation without first confirming the desired state +- HARD BAN: `git restore`, `git checkout -- `, `git reset` are FORBIDDEN without explicit user permission in the same message. They destroyed user in-progress src/* edits twice in one session (2026-06-07). If you think you need one, ASK FIRST. +- No giant edits: if your `manual-slop_edit_file` `new_string` exceeds ~20 lines, STOP and split it. ## Session-Learned Anti-Patterns (Added 2026-06-07) @@ -60,9 +62,9 @@ The fix: anchor on the **def line that has the `@property` ABOVE it**, and repla - Instantiate the class - Call the new method in the way it's expected to be called (e.g. `ctrl.foo_ts` vs `ctrl.foo_ts()` for properties vs methods) -### 4. The "I'll just check git status" trap +### 4. The "I'll just check git status" trap (now a HARD BAN, see Critical list above) -If you suspect you might have lost work, the worst move is to run `git status` / `git restore` while a frantic user is watching. Pause, read the actual file, and admit what state you're in. The user knows their state better than you do. +If you suspect you might have lost work, the worst move is to run `git status` / `git restore` while a frantic user is watching. Pause, read the actual file, and admit what state you're in. The user knows their state better than you do. This trap has now caused irrecoverable data loss twice in one session — the ban is enforced above. ### 5. Small, verified edits beat big scripts