feat(directives): harvest 10 process/workflow directives from AGENTS.md + workflow.md

This commit is contained in:
ed
2026-07-02 22:07:08 -04:00
parent 02320a13ea
commit 412494d205
10 changed files with 203 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
# git_hard_bans — v1
**Why this iteration:** Lifted verbatim from `AGENTS.md` "Critical Anti-Patterns" HARD BAN lines (59-60) + `conductor/workflow.md` §"Known Pitfalls" (lines 417-430). This is the baseline encoding — the imperative-bullet-with-rationale style currently in production.
Future variants will test alternative encodings (tabular, before/after) against this baseline.
**Source:** `AGENTS.md:59-60 + workflow.md:417-430`
---
From `AGENTS.md` "Critical Anti-Patterns" HARD BAN:
- HARD BAN: `git restore`, `git checkout -- <file>`, `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.
- HARD BAN: `git stash*` (any form: `git stash`, `git stash pop`, `git stash apply`, `git stash drop`, `git stash clear`) is FORBIDDEN. Stashing inverts the safety net of the working tree: a `git add .` then `git stash` then "fresh start" pattern is exactly how Tier 2 corrupted files in the 2026-06-27 `cruft_elimination_20260627` track. The user explicitly stated "I hate when people fuck with my commits" — stashing throws away the user's in-progress edits silently. If you think you need a stash, you don't — use a NEW BRANCH or a WORKTREE instead. Tier 2 sandbox enforces this via `conductor/tier2/opencode.json.fragment` bash deny rules.
---
From `conductor/workflow.md` §"Known Pitfalls (2026-06-05)" §"HARD BAN":
**Per AGENTS.md (Critical Anti-Patterns):** These three commands 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.
The intent of "look at what the file looked like at commit X" is non-destructive inspection. The CORRECT way:
```bash
# WRONG: overwrites the working tree
git checkout HEAD~1 -- src/foo.py
# RIGHT: prints to stdout, leaves working tree alone
git show HEAD~1:src/foo.py
```
`git checkout -- <file>` and `git restore` are particularly dangerous because:
- They overwrite uncommitted changes silently
- They overwrite previously-committed state in the working tree if the user has already committed and then re-edited
- The user doesn't see the loss until they notice missing changes
If you genuinely need to revert (e.g., the working tree is broken from a previous agent), use `git stash` first to capture the in-progress state, ASK THE USER, then proceed.